diff --git a/js/apbct-disable-comments.min.js b/js/apbct-disable-comments.min.js index 3691705a..7b149583 100644 --- a/js/apbct-disable-comments.min.js +++ b/js/apbct-disable-comments.min.js @@ -1,2 +1,2 @@ -wp.domReady(function(){wp.blocks&&wp.blocks.getBlockTypes().forEach(function(e){apbctDisableComments.disabled_blocks.includes(e.name)&&wp.blocks.unregisterBlockType(e.name)})}); +"use strict";wp.domReady(function(){wp.blocks&&wp.blocks.getBlockTypes().forEach(function(e){apbctDisableComments.disabled_blocks.includes(e.name)&&wp.blocks.unregisterBlockType(e.name)})}); //# sourceMappingURL=apbct-disable-comments.min.js.map diff --git a/js/apbct-disable-comments.min.js.map b/js/apbct-disable-comments.min.js.map index 78832453..d20f9007 100644 --- a/js/apbct-disable-comments.min.js.map +++ b/js/apbct-disable-comments.min.js.map @@ -1 +1 @@ -{"version":3,"file":"apbct-disable-comments.min.js","sources":["apbct-disable-comments.js"],"sourcesContent":["'use strict';\r\nwp.domReady(function() {\r\n if (wp.blocks) {\r\n wp.blocks.getBlockTypes().forEach(function(block) {\r\n if (apbctDisableComments.disabled_blocks.includes(block.name)) {\r\n wp.blocks.unregisterBlockType(block.name);\r\n }\r\n });\r\n }\r\n});\r\n"],"names":["wp","domReady","blocks","getBlockTypes","forEach","block","apbctDisableComments","disabled_blocks","includes","name","unregisterBlockType"],"mappings":"AACAA,GAAGC,SAAS,WACJD,GAAGE,QACHF,GAAGE,OAAOC,cAAc,EAAEC,QAAQ,SAASC,GACnCC,qBAAqBC,gBAAgBC,SAASH,EAAMI,IAAI,GACxDT,GAAGE,OAAOQ,oBAAoBL,EAAMI,IAAI,CAEhD,CAAC,CAET,CAAC"} \ No newline at end of file +{"version":3,"file":"apbct-disable-comments.min.js","sources":["apbct-disable-comments.js"],"sourcesContent":["'use strict';\nwp.domReady(function() {\n if (wp.blocks) {\n wp.blocks.getBlockTypes().forEach(function(block) {\n if (apbctDisableComments.disabled_blocks.includes(block.name)) {\n wp.blocks.unregisterBlockType(block.name);\n }\n });\n }\n});\n"],"names":["wp","domReady","blocks","getBlockTypes","forEach","block","apbctDisableComments","disabled_blocks","includes","name","unregisterBlockType"],"mappings":"AAAA,aACAA,GAAGC,SAAS,WACJD,GAAGE,QACHF,GAAGE,OAAOC,cAAc,EAAEC,QAAQ,SAASC,GACnCC,qBAAqBC,gBAAgBC,SAASH,EAAMI,IAAI,GACxDT,GAAGE,OAAOQ,oBAAoBL,EAAMI,IAAI,CAEhD,CAAC,CAET,CAAC"} \ No newline at end of file diff --git a/js/apbct-public--3--cleantalk-modal.min.js b/js/apbct-public--3--cleantalk-modal.min.js index aacd84d8..d7c5d67f 100644 --- a/js/apbct-public--3--cleantalk-modal.min.js +++ b/js/apbct-public--3--cleantalk-modal.min.js @@ -1,2 +1,2 @@ -let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,n,o){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(var t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},n={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},o={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},l={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},d={styles:{overflow:"hidden"},toString:e},i=document.createElement("style"),d=(i.setAttribute("id","cleantalk-modal-styles"),i.innerHTML="body.cleantalk-modal-opened{"+d+"}",i.innerHTML+="#cleantalk-modal-overlay{"+t+"}",i.innerHTML+="#cleantalk-modal-close{"+o+"}",i.innerHTML+="#cleantalk-modal-close:before{"+a+"}",i.innerHTML+="#cleantalk-modal-close:after{"+l+"}",document.body.append(i),document.createElement("div")),t=(d.setAttribute("id","cleantalk-modal-overlay"),document.body.append(d),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),o=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",n),d.append(t),document.createElement("div")),a=(o.setAttribute("id","cleantalk-modal-close"),t.append(o),document.createElement("div"));this.loaded?(l=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(l,'$1')):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};document.addEventListener("click",function(e){!e.target||"cleantalk-modal-overlay"!==e.target.id&&"cleantalk-modal-close"!==e.target.id||cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}); +let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,n,o){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(const t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},n={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},o={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},l={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},d={styles:{overflow:"hidden"},toString:e},i=document.createElement("style"),d=(i.setAttribute("id","cleantalk-modal-styles"),i.innerHTML="body.cleantalk-modal-opened{"+d+"}",i.innerHTML+="#cleantalk-modal-overlay{"+t+"}",i.innerHTML+="#cleantalk-modal-close{"+o+"}",i.innerHTML+="#cleantalk-modal-close:before{"+a+"}",i.innerHTML+="#cleantalk-modal-close:after{"+l+"}",document.body.append(i),document.createElement("div")),t=(d.setAttribute("id","cleantalk-modal-overlay"),document.body.append(d),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),o=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",n),d.append(t),document.createElement("div")),a=(o.setAttribute("id","cleantalk-modal-close"),t.append(o),document.createElement("div"));this.loaded?(l=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(l,'$1')):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};document.addEventListener("click",function(e){!e.target||"cleantalk-modal-overlay"!==e.target.id&&"cleantalk-modal-close"!==e.target.id||cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}); //# sourceMappingURL=apbct-public--3--cleantalk-modal.min.js.map diff --git a/js/apbct-public--3--cleantalk-modal.min.js.map b/js/apbct-public--3--cleantalk-modal.min.js.map index 33b50cfc..4df1be8b 100644 --- a/js/apbct-public--3--cleantalk-modal.min.js.map +++ b/js/apbct-public--3--cleantalk-modal.min.js.map @@ -1 +1 @@ -{"version":3,"file":"apbct-public--3--cleantalk-modal.min.js","sources":["apbct-public--3--cleantalk-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\r\nlet cleantalkModal = {\r\n\r\n // Flags\r\n loaded: false,\r\n loading: false,\r\n opened: false,\r\n opening: false,\r\n ignoreURLConvert: false,\r\n\r\n // Methods\r\n load: function( action ) {\r\n if ( ! this.loaded ) {\r\n this.loading = true;\r\n let callback = function( result, data, params, obj ) {\r\n cleantalkModal.loading = false;\r\n cleantalkModal.loaded = result;\r\n document.dispatchEvent(\r\n new CustomEvent( 'cleantalkModalContentLoaded', {\r\n bubbles: true,\r\n } ),\r\n );\r\n };\r\n // eslint-disable-next-line camelcase\r\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\r\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\r\n } else {\r\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\r\n }\r\n }\r\n },\r\n\r\n open: function() {\r\n /* Cleantalk Modal CSS start */\r\n let renderCss = function() {\r\n let cssStr = '';\r\n // eslint-disable-next-line guard-for-in\r\n for ( const key in this.styles ) {\r\n cssStr += key + ':' + this.styles[key] + ';';\r\n }\r\n return cssStr;\r\n };\r\n let overlayCss = {\r\n styles: {\r\n 'z-index': '9999999999',\r\n 'position': 'fixed',\r\n 'top': '0',\r\n 'left': '0',\r\n 'width': '100%',\r\n 'height': '100%',\r\n 'background': 'rgba(0,0,0,0.5)',\r\n 'display': 'flex',\r\n 'justify-content': 'center',\r\n 'align-items': 'center',\r\n },\r\n toString: renderCss,\r\n };\r\n let innerCss = {\r\n styles: {\r\n 'position': 'relative',\r\n 'padding': '30px',\r\n 'background': '#FFF',\r\n 'border': '1px solid rgba(0,0,0,0.75)',\r\n 'border-radius': '4px',\r\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\r\n },\r\n toString: renderCss,\r\n };\r\n let closeCss = {\r\n styles: {\r\n 'position': 'absolute',\r\n 'background': '#FFF',\r\n 'width': '20px',\r\n 'height': '20px',\r\n 'border': '2px solid rgba(0,0,0,0.75)',\r\n 'border-radius': '15px',\r\n 'cursor': 'pointer',\r\n 'top': '-8px',\r\n 'right': '-8px',\r\n 'box-sizing': 'content-box',\r\n },\r\n toString: renderCss,\r\n };\r\n let closeCssBefore = {\r\n styles: {\r\n 'content': '\"\"',\r\n 'display': 'block',\r\n 'position': 'absolute',\r\n 'background': '#000',\r\n 'border-radius': '1px',\r\n 'width': '2px',\r\n 'height': '16px',\r\n 'top': '2px',\r\n 'left': '9px',\r\n 'transform': 'rotate(45deg)',\r\n },\r\n toString: renderCss,\r\n };\r\n let closeCssAfter = {\r\n styles: {\r\n 'content': '\"\"',\r\n 'display': 'block',\r\n 'position': 'absolute',\r\n 'background': '#000',\r\n 'border-radius': '1px',\r\n 'width': '2px',\r\n 'height': '16px',\r\n 'top': '2px',\r\n 'left': '9px',\r\n 'transform': 'rotate(-45deg)',\r\n },\r\n toString: renderCss,\r\n };\r\n let bodyCss = {\r\n styles: {\r\n 'overflow': 'hidden',\r\n },\r\n toString: renderCss,\r\n };\r\n let cleantalkModalStyle = document.createElement( 'style' );\r\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\r\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\r\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\r\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\r\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\r\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\r\n document.body.append( cleantalkModalStyle );\r\n /* Cleantalk Modal CSS end */\r\n\r\n let overlay = document.createElement( 'div' );\r\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\r\n document.body.append( overlay );\r\n\r\n document.body.classList.add( 'cleantalk-modal-opened' );\r\n\r\n let inner = document.createElement( 'div' );\r\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\r\n inner.setAttribute( 'style', innerCss );\r\n overlay.append( inner );\r\n\r\n let close = document.createElement( 'div' );\r\n close.setAttribute( 'id', 'cleantalk-modal-close' );\r\n inner.append( close );\r\n\r\n let content = document.createElement( 'div' );\r\n if ( this.loaded ) {\r\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\r\n const serviceContentRegex = /.*\\/inc/g;\r\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\r\n content.innerHTML = this.loaded;\r\n } else {\r\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\r\n }\r\n } else {\r\n content.innerHTML = 'Loading...';\r\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\r\n this.load( 'get_options_template' );\r\n }\r\n content.setAttribute( 'id', 'cleantalk-modal-content' );\r\n inner.append( content );\r\n\r\n this.opened = true;\r\n },\r\n\r\n close: function() {\r\n document.body.classList.remove( 'cleantalk-modal-opened' );\r\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\r\n document.getElementById( 'cleantalk-modal-styles' ).remove();\r\n document.dispatchEvent(\r\n new CustomEvent( 'cleantalkModalClosed', {\r\n bubbles: true,\r\n } ),\r\n );\r\n },\r\n\r\n};\r\n\r\n/* Cleantalk Modal helpers */\r\ndocument.addEventListener('click', function( e ) {\r\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\r\n cleantalkModal.close();\r\n }\r\n});\r\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\r\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\r\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\r\n }\r\n});\r\n"],"names":["let","cleantalkModal","loaded","loading","opened","opening","ignoreURLConvert","load","action","callback","this","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","apbct_admin_sendAJAX","apbct_public_sendAJAX","notJson","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","border","border-radius","box-shadow","closeCss","cursor","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","urlRegex","test","replace","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,IAAIC,eAAiB,CAGjBC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,iBAAkB,CAAA,EAGlBC,KAAM,SAAUC,GACZ,IAEQC,EAFDC,KAAKR,SACRQ,KAAKP,QAAU,CAAA,EACXM,EAAW,SAAUE,EAAQC,EAAMC,EAAQC,GAC3Cb,eAAeE,QAAU,CAAA,EACzBF,e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AO,EAC5DrD,SAASsD,eAAgB,wBAAyB,EAAED,OAAO,EAC3DrD,SAASC,cACL,IAAIC,YAAa,uBAAwB,CACrCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,CAEJ,EAGAH,SAASuD,iBAAiB,QAAS,SAAUC,GACpCA,CAAAA,EAAEC,QAA2B,4BAAhBD,EAAEC,OAAOC,IAAoD,0BAAhBF,EAAEC,OAAOC,IACpExE,eAAe+D,MAAM,CAE7B,CAAC,EACDjD,SAASuD,iBAAiB,8BAA+B,SAAUC,GAC1DtE,eAAeG,QAAUH,eAAeC,SACzCa,SAASsD,eAAgB,yBAA0B,EAAEX,UAAYzD,eAAeC,OAExF,CAAC"} \ No newline at end of file +{"version":3,"file":"apbct-public--3--cleantalk-modal.min.js","sources":["apbct-public--3--cleantalk-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n"],"names":["let","cleantalkModal","loaded","loading","opened","opening","ignoreURLConvert","load","action","callback","this","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","apbct_admin_sendAJAX","apbct_public_sendAJAX","notJson","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","border","border-radius","box-shadow","closeCss","cursor","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","urlRegex","test","replace","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,IAAIC,eAAiB,CAGjBC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,iBAAkB,CAAA,EAGlBC,KAAM,SAAUC,GACZ,IAEQC,EAFDC,KAAKR,SACRQ,KAAKP,QAAU,CAAA,EACXM,EAAW,SAAUE,EAAQC,EAAMC,EAAQC,GAC3Cb,eAAeE,QAAU,CAAA,EACzBF,eAAeC,OAASS,EACxBI,SAASC,cACL,IAAIC,YAAa,8BAA+B,CAC5CC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,GAEqC,YAAhC,OAAOC,qBACRA,qBAEAC,uBAFsB,CAACZ,OAAUA,CAAM,EAAG,CAACC,SAAYA,EAAUY,QAAW,CAAA,CAAI,CAAE,EAK9F,EAEAC,KAAM,WAEc,SAAZC,IACAvB,IAAIwB,EAAS,GAEb,IAAM,MAAMC,KAAOf,KAAKgB,OACpBF,GAAUC,EAAM,IAAMf,KAAKgB,OAAOD,GAAO,IAE7C,OAAOD,CACX,CAPAxB,IAQI2B,EAAa,CACbD,OAAQ,CACJE,UAAW,aACXC,SAAY,QACZC,IAAO,IACPC,KAAQ,IACRC,MAAS,OACTC,OAAU,OACVC,WAAc,kBACdC,QAAW,OACXC,kBAAmB,SACnBC,cAAe,QACnB,EACAC,SAAUf,CACd,EACIgB,EAAW,CACXb,OAAQ,CACJG,SAAY,WACZW,QAAW,OACXN,WAAc,OACdO,OAAU,6BACVC,gBAAiB,MACjBC,aAAc,qCAClB,EACAL,SAAUf,CACd,EACIqB,EAAW,CACXlB,OAAQ,CACJG,SA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AMP,aAAc,KAAM,uBAAwB,EAClDI,EAAMD,OAAQI,CAAM,EAENjD,SAASwC,cAAe,KAAM,GACvC7C,KAAKR,QACA+D,EAAW,uBACW,WACJC,KAAKxD,KAAKR,MAAM,GAAKQ,KAAKJ,iBAC9C2C,EAAQS,UAAYhD,KAAKR,OAEzB+C,EAAQS,UAAYhD,KAAKR,OAAOiE,QAAQF,EAAU,qCAAqC,IAG3FhB,EAAQS,UAAY,aAEpBhD,KAAKH,KAAM,sBAAuB,GAEtC0C,EAAQQ,aAAc,KAAM,yBAA0B,EACtDI,EAAMD,OAAQX,CAAQ,EAEtBvC,KAAKN,OAAS,CAAA,CAClB,EAEA4D,MAAO,WACHjD,SAAS4C,KAAKG,UAAUM,OAAQ,wBAAyB,EACzDrD,SAASsD,eAAgB,yBAA0B,EAAED,OAAO,EAC5DrD,SAASsD,eAAgB,wBAAyB,EAAED,OAAO,EAC3DrD,SAASC,cACL,IAAIC,YAAa,uBAAwB,CACrCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,CAEJ,EAGAH,SAASuD,iBAAiB,QAAS,SAAUC,GACpCA,CAAAA,EAAEC,QAA2B,4BAAhBD,EAAEC,OAAOC,IAAoD,0BAAhBF,EAAEC,OAAOC,IACpExE,eAAe+D,MAAM,CAE7B,CAAC,EACDjD,SAASuD,iBAAiB,8BAA+B,SAAUC,GAC1DtE,eAAeG,QAAUH,eAAeC,SACzCa,SAASsD,eAAgB,yBAA0B,EAAEX,UAAYzD,eAAeC,OAExF,CAAC"} \ No newline at end of file diff --git a/js/apbct-public--7--trp.min.js b/js/apbct-public--7--trp.min.js index 8b1b6e75..c9aabba7 100644 --- a/js/apbct-public--7--trp.min.js +++ b/js/apbct-public--7--trp.min.js @@ -1,2 +1,2 @@ -document.addEventListener("DOMContentLoaded",function(){let l=void 0,p=!1;if("undefined"==typeof ctPublic&&"undefined"==typeof ctTrpAdminLocalize||void 0===(l="undefined"!=typeof ctPublic&&ctPublic.theRealPerson?ctPublic.theRealPerson:l)&&"undefined"!=typeof ctTrpAdminLocalize&&ctTrpAdminLocalize.theRealPerson&&(l=ctTrpAdminLocalize.theRealPerson,p=!0),l){let e='.apbct-trp *[class*="comment-author"]';document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]');var t=document.querySelectorAll(e+',.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong');0!==t.length&&(t.forEach((e,t)=>{var n,s=document.createElement("div"),a=(s.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),i=(a.setAttribute("src",l.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),r=(i.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),c=(r.setAttribute("class","apbct-real-user-popup-header"),r.append(l.phrases.trpHeading),document.createElement("div")),o=(c.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));o.append(l.phrases.trpContent1+" "),o.append(l.phrases.trpContent2),p&&((n=document.createElement("a")).setAttribute("href",l.trpContentLink),n.setAttribute("target","_blank"),n.text=l.phrases.trpContentLearnMore,o.append(" "),o.append(n)),c.append(o),i.append(r,c),s.append(a),e.append(s),e.append(i)}),document.querySelectorAll(".apbct-real-user-badge").forEach(n=>{let s=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){s=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(s),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){s=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){s=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(s),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(s=setTimeout(()=>{var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}); +document.addEventListener("DOMContentLoaded",function(){let l=void 0,p=!1;if("undefined"==typeof ctPublic&&"undefined"==typeof ctTrpAdminLocalize||void 0===(l="undefined"!=typeof ctPublic&&ctPublic.theRealPerson?ctPublic.theRealPerson:l)&&"undefined"!=typeof ctTrpAdminLocalize&&ctTrpAdminLocalize.theRealPerson&&(l=ctTrpAdminLocalize.theRealPerson,p=!0),l){let e='.apbct-trp *[class*="comment-author"]';document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]');var t=document.querySelectorAll(e+',.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong');0!==t.length&&(t.forEach((e,t)=>{var n,s=document.createElement("div"),a=(s.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),i=(a.setAttribute("src",l.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),r=(i.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),c=(r.setAttribute("class","apbct-real-user-popup-header"),r.append(l.phrases.trpHeading),document.createElement("div")),o=(c.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));o.append(l.phrases.trpContent1+" "),o.append(l.phrases.trpContent2),p&&((n=document.createElement("a")).setAttribute("href",l.trpContentLink),n.setAttribute("target","_blank"),n.text=l.phrases.trpContentLearnMore,o.append(" "),o.append(n)),c.append(o),i.append(r,c),s.append(a),e.append(s),e.append(i)}),document.querySelectorAll(".apbct-real-user-badge").forEach(n=>{let s=void 0;n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){s=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)});const e=n.nextElementSibling;e.addEventListener("mouseenter",function(){clearTimeout(s),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){s=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){s=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(s),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(s=setTimeout(()=>{var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}); //# sourceMappingURL=apbct-public--7--trp.min.js.map diff --git a/js/apbct-public--7--trp.min.js.map b/js/apbct-public--7--trp.min.js.map index e1f5db67..22b6e303 100644 --- a/js/apbct-public--7--trp.min.js.map +++ b/js/apbct-public--7--trp.min.js.map @@ -1 +1 @@ -{"version":3,"file":"apbct-public--7--trp.min.js","sources":["apbct-public--7--trp.js"],"sourcesContent":["document.addEventListener('DOMContentLoaded', function() {\r\n let ctTrpLocalize = undefined;\r\n let ctTrpIsAdminCommentsList = false;\r\n\r\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\r\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\r\n ctTrpLocalize = ctPublic.theRealPerson;\r\n }\r\n if (\r\n typeof ctTrpLocalize === 'undefined' &&\r\n typeof ctTrpAdminLocalize !== 'undefined' &&\r\n ctTrpAdminLocalize.theRealPerson\r\n ) {\r\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\r\n ctTrpIsAdminCommentsList = true;\r\n }\r\n }\r\n\r\n if ( ! ctTrpLocalize ) {\r\n return;\r\n }\r\n\r\n // Selectors. Try to handle the WIDE range of themes.\r\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\r\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\r\n // For Spacious theme\r\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\r\n }\r\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\r\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\r\n const trpComments = document.querySelectorAll(\r\n themesCommentsSelector + ',' +\r\n woocommerceReviewsSelector + ',' +\r\n adminCommentsListSelector);\r\n\r\n if ( trpComments.length === 0 ) {\r\n return;\r\n }\r\n\r\n trpComments.forEach(( element, index ) => {\r\n let trpLayout = document.createElement('div');\r\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\r\n\r\n let trpImage = document.createElement('img');\r\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\r\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\r\n\r\n let trpDescription = document.createElement('div');\r\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\r\n\r\n let trpDescriptionHeading = document.createElement('p');\r\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\r\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\r\n\r\n let trpDescriptionContent = document.createElement('div');\r\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\r\n\r\n let trpDescriptionContentSpan = document.createElement('span');\r\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\r\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\r\n\r\n if ( ctTrpIsAdminCommentsList ) {\r\n let learnMoreLink = document.createElement('a');\r\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\r\n learnMoreLink.setAttribute('target', '_blank');\r\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\r\n trpDescriptionContentSpan.append(' '); // Need one space\r\n trpDescriptionContentSpan.append(learnMoreLink);\r\n }\r\n\r\n trpDescriptionContent.append(trpDescriptionContentSpan);\r\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\r\n trpLayout.append(trpImage);\r\n element.append(trpLayout);\r\n element.append(trpDescription);\r\n });\r\n\r\n const badges = document.querySelectorAll('.apbct-real-user-badge');\r\n\r\n badges.forEach((badge) => {\r\n let hideTimeout = undefined;\r\n\r\n badge.addEventListener('click', function() {\r\n const popup = this.nextElementSibling;\r\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\r\n popup.classList.toggle('visible');\r\n }\r\n });\r\n\r\n badge.addEventListener('mouseenter', function() {\r\n const popup = this.nextElementSibling;\r\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\r\n popup.classList.add('visible');\r\n }\r\n });\r\n\r\n badge.addEventListener('mouseleave', function() {\r\n hideTimeout = setTimeout(() => {\r\n const popup = this.nextElementSibling;\r\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\r\n popup.classList.remove('visible');\r\n }\r\n }, 1000);\r\n });\r\n\r\n const popup = badge.nextElementSibling;\r\n popup.addEventListener('mouseenter', function() {\r\n clearTimeout(hideTimeout);\r\n popup.classList.add('visible');\r\n });\r\n\r\n popup.addEventListener('mouseleave', function() {\r\n hideTimeout = setTimeout(() => {\r\n if (popup.classList.contains('apbct-real-user-popup')) {\r\n popup.classList.remove('visible');\r\n }\r\n }, 1000);\r\n });\r\n\r\n // For mobile devices\r\n badge.addEventListener('touchend', function() {\r\n hideTimeout = setTimeout(() => {\r\n const popup = this.nextElementSibling;\r\n const selection = window.getSelection();\r\n // Check if no text is selected\r\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\r\n selection.toString().length === 0\r\n ) {\r\n popup.classList.remove('visible');\r\n } else {\r\n clearTimeout(hideTimeout);\r\n document.addEventListener('selectionchange', function onSelectionChange() {\r\n const selection = window.getSelection();\r\n if (selection && selection.toString().length === 0) {\r\n // Restart the hide timeout when selection is cleared\r\n hideTimeout = setTimeout(() => {\r\n const popup = badge.nextElementSibling;\r\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\r\n popup.classList.remove('visible');\r\n }\r\n }, 3000);\r\n document.removeEventListener('selectionchange', onSelectionChange);\r\n }\r\n });\r\n }\r\n }, 3000);\r\n });\r\n });\r\n});\r\n"],"names":["document","addEventListener","let","ctTrpLocalize","undefined","ctTrpIsAdminCommentsList","ctPublic","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","querySelector","trpComments","querySelectorAll","length","forEach","element","index","learnMoreLink","trpLayout","createElement","trpImage","setAttribute","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","append","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","popup","badge","this","nextElementSibling","classList","contains","toggle","add","setTimeout","remove","clearTimeout","selection","window","getSelection","toString","onSelectionChange","removeEventListener"],"mappings":"AAAAA,SAASC,iBAAiB,mBAAoB,WAC1CC,IAAIC,EAAgBC,KAAAA,EAChBC,EAA2B,CAAA,EAgB/B,GAdyB,aAApB,OAAOC,UAA0D,aAA9B,OAAOC,oBAKd,KAAA,KAHzBJ,EADqB,aAApB,OAAOG,UAA4BA,SAASE,cAC7BF,SAASE,cAGlBL,IACuB,aAA9B,OAAOI,oBACPA,mBAAmBC,gBAEnBL,EAAgBI,mBAAmBC,cACnCH,EAA2B,CAAA,GAI5BF,EAAP,CAKAD,IAAIO,EAAyB,wCACxBT,SAASU,cAAc,iDAAiD,IAEzED,EAAyB,8CAE7BP,IAEMS,EAAcX,SAASY,iBACzBH,EAF4B,uFAIH,EAED,IAAvBE,EAAYE,SAIjBF,EAAYG,QAAQ,CAAEC,EAASC,KAC3Bd,IAsBQe,EAtBJC,EAAYlB,SAASmB,cAAc,KAAK,EAGxC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A,EAAMI,UAAUC,SAAS,uBAAuB,GACzDL,EAAMI,UAAUG,IAAI,SAAS,CAErC,CAAC,EAEDN,EAAMpC,iBAAiB,aAAc,WACjCkC,EAAcS,WAAW,KACrB,IAAMR,EAAQE,KAAKC,mBACfH,GAASA,EAAMI,UAAUC,SAAS,uBAAuB,GACzDL,EAAMI,UAAUK,OAAO,SAAS,CAExC,EAAG,GAAI,CACX,CAAC,EAEaR,EAAME,oBACpBH,EAAMnC,iBAAiB,aAAc,WACjC6C,aAAaX,CAAW,EACxBC,EAAMI,UAAUG,IAAI,SAAS,CACjC,CAAC,EAEDP,EAAMnC,iBAAiB,aAAc,WACjCkC,EAAcS,WAAW,KACjBR,EAAMI,UAAUC,SAAS,uBAAuB,GAChDL,EAAMI,UAAUK,OAAO,SAAS,CAExC,EAAG,GAAI,CACX,CAAC,EAGDR,EAAMpC,iBAAiB,WAAY,WAC/BkC,EAAcS,WAAW,KACrB,IAAMR,EAAQE,KAAKC,mBACbQ,EAAYC,OAAOC,aAAa,EAElCb,GAASW,GAAaX,EAAMI,UAAUC,SAAS,uBAAuB,GACtC,IAAhCM,EAAUG,SAAS,EAAErC,OAErBuB,EAAMI,UAAUK,OAAO,SAAS,GAEhCC,aAAaX,CAAW,EACxBnC,SAASC,iBAAiB,kBAAmB,SAASkD,IAClD,IAAMJ,EAAYC,OAAOC,aAAa,EAClCF,GAA6C,IAAhCA,EAAUG,SAAS,EAAErC,SAElCsB,EAAcS,WAAW,KACrB,IAAMR,EAAQC,EAAME,mBAChBH,GAASA,EAAMI,UAAUC,SAAS,uBAAuB,GACzDL,EAAMI,UAAUK,OAAO,SAAS,CAExC,EAAG,GAAI,EACP7C,SAASoD,oBAAoB,kBAAmBD,CAAiB,EAEzE,CAAC,EAET,EAAG,GAAI,CACX,CAAC,CACL,CAAC,EA/HD,CAgIJ,CAAC"} \ No newline at end of file +{"version":3,"file":"apbct-public--7--trp.min.js","sources":["apbct-public--7--trp.js"],"sourcesContent":["document.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n"],"names":["document","addEventListener","let","ctTrpLocalize","undefined","ctTrpIsAdminCommentsList","ctPublic","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","querySelector","trpComments","querySelectorAll","length","forEach","element","index","learnMoreLink","trpLayout","createElement","trpImage","setAttribute","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","append","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","popup","this","nextElementSibling","classList","contains","toggle","add","setTimeout","remove","clearTimeout","selection","window","getSelection","toString","onSelectionChange","removeEventListener"],"mappings":"AAAAA,SAASC,iBAAiB,mBAAoB,WAC1CC,IAAIC,EAAgBC,KAAAA,EAChBC,EAA2B,CAAA,EAgB/B,GAdyB,aAApB,OAAOC,UAA0D,aAA9B,OAAOC,oBAKd,KAAA,KAHzBJ,EADqB,aAApB,OAAOG,UAA4BA,SAASE,cAC7BF,SAASE,cAGlBL,IACuB,aAA9B,OAAOI,oBACPA,mBAAmBC,gBAEnBL,EAAgBI,mBAAmBC,cACnCH,EAA2B,CAAA,GAI5BF,EAAP,CAKAD,IAAIO,EAAyB,wCACxBT,SAASU,cAAc,iDAAiD,IAEzED,EAAyB,8CAE7BP,IAEMS,EAAcX,SAASY,iBACzBH,EAF4B,uFAIH,EAED,IAAvBE,EAAYE,SAIjBF,EAAYG,QAAQ,CAAEC,EAASC,KAC3Bd,IAsBQe,EAtBJC,EAAYlB,SAASmB,cAAc,KAAK,EAGxCC,GAF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100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))();function ctProcessError(e,t){var o={},e=(e&&e.message?o.err={msg:e.message,file:e.fileName||!1,ln:e.lineNumber||lineNo||!1,col:e.columnNumber||columnNo||!1,stacktrace:e.stack||!1,cause:!!t&&JSON.stringify(t),errorObj:error||!1}:(o.err={msg:e},t&&(o.err.file=t)),o.url=window.location.href,o.userAgent=window.navigator.userAgent,"ct_js_errors");null===(n=localStorage.getItem(e))&&(n="[]");for(var n=JSON.parse(n),a=0;a{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",new XMLHttpRequest),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=this.xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}},{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elements",[]),this.getElements(),this.setListeners()},[{key:"getElements",value:function(){var e,t=this,o=document.querySelectorAll("*"),n=/^apbct-trusted-text--label/,a=/apbct_form_decoration--/,c=(this.setDecorationBackground(),Array.from(o).filter(function(e){return n.test(e.id)})),o=(c.forEach(function(e){t.elements.push(e)}),(c=Array.from(o).filter(function(e){return a.test(e.className)})).forEach(function(e){t.elements.push(e)}),document.querySelector(".apbct_form_decoration"));o&&(c=window.getComputedStyle(o,"::before"),e=window.getComputedStyle(o,"::after"),c)&&e&&this.elements.push(o)}},{key:"setDecorationBackground",value:function(){var e,t,o,n=document.querySelectorAll("#respond");document.querySelector('[class*="apbct_form_decoration"]')&&(t=(e=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class")).indexOf("_header__wrapper"),o=e.substring(0,t),n.forEach(function(e){e.className+=" "+o}))}},{key:"setListeners",value:function(){var r=this;this.elements.forEach(function(i){i&&(i.addEventListener("click",function(e){var t,o,n,a,c;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,n=parseFloat(window.getComputedStyle(i,"::before").height)/2,a=parseFloat(window.getComputedStyle(i,"::after").width)/2,c=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(eMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer};"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var t;this.wrappers.forEach(function(e){t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))(),CTTypoData=(()=>_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2{var t=r.value;if("undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&("searchform"===t.getAttribute("id")||null!==t.getAttribute("class")&&-1!==t.getAttribute("class").indexOf("search-form")||null!==t.getAttribute("role")&&-1!==t.getAttribute("role").indexOf("search"))){if(t.querySelector("input.dgwt-wcas-search-input"))return;t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return ctSearchFormOnSubmitHandler(e,t)}}})()}catch(e){l.e(e)}finally{l.f()}apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){var e;ctPublic.settings__data__bot_detector_enabled&&(e=setInterval(function(){!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500))}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{var o,e,n;if(c.data.forEach(function(e){e.encoded_email===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};void 0!==a[t].href&&0===a[t].href.indexOf("mailto:")?(e=a[t].href.replace("mailto:",""),n=a[t].innerHTML,a[t].innerHTML=n.replace(e,o.decoded_email),a[t].href="mailto:"+o.decoded_email,a[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3)),a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))return e.v}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(){var e=0)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";var t=document.getElementById("apbct_popup"),o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,r=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===r.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(r.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{var t=e.value;o.forEach(function(e){t.classList.contains(e)&&(n=!0)})})()}catch(e){t.e(e)}finally{t.f()}return n}function isFormThatNeedCatchXhr(e){return null==document.querySelector("div.elementor-widget[title='Login/Signup']")&&!(!e||!e.action||-1===e.action.toString().indexOf("mailpoet_subscription_form"))}function getNoCookieData(){var e=apbctLocalStorage.getCleanTalkData(),t=apbctSessionStorage.getCleanTalkData(),e=_objectSpread(_objectSpread({},e),t),e=JSON.stringify(e);return"_ct_no_cookie_data_"+btoa(e)}function apbctWriteReferrersToSessionStorage(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}function apbctCheckAddToCartByGet(){document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);var ctProtectOutsideIframeCheck,cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+n+"}",r.innerHTML+="#cleantalk-modal-close:before{"+a+"}",r.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(/(https?:\/\/[^\s]+)/g,'$1'):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(var e,t,o=0;o strong')).length)&&(e.forEach(function(e,t){var o,n=document.createElement("div"),a=(n.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),c=(a.setAttribute("src",s.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(c.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),u&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),c.append(i,r),n.append(a),e.append(n),e.append(c)}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +"use strict";function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);oMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t'+t+"")})}}])}(),CTTypoData=function(){return _createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";var t=document.getElementById("apbct_popup"),o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,r=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===r.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(r.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10$1'):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};document.addEventListener("click",function(e){!e.target||"cleantalk-modal-overlay"!==e.target.id&&"cleantalk-modal-close"!==e.target.id||cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),document.addEventListener("DOMContentLoaded",function(){var e,l=void 0,u=!1;"undefined"==typeof ctPublic&&"undefined"==typeof ctTrpAdminLocalize||void 0===(l="undefined"!=typeof ctPublic&&ctPublic.theRealPerson?ctPublic.theRealPerson:l)&&"undefined"!=typeof ctTrpAdminLocalize&&ctTrpAdminLocalize.theRealPerson&&(l=ctTrpAdminLocalize.theRealPerson,u=!0),l&&(e='.apbct-trp *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n=document.createElement("div"),a=(n.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),c=(a.setAttribute("src",l.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(c.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(l.phrases.trpHeading),document.createElement("div")),s=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));s.append(l.phrases.trpContent1+" "),s.append(l.phrases.trpContent2),u&&((o=document.createElement("a")).setAttribute("href",l.trpContentLink),o.setAttribute("target","_blank"),o.text=l.phrases.trpContentLearnMore,s.append(" "),s.append(o)),r.append(s),c.append(i,r),n.append(a),e.append(n),e.append(c)}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 211c12e4..cd8f2c03 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1,2 +1,2 @@ -class ApbctCore{ajax_parameters={};restParameters={};selector=null;elements=[];eventCallback;eventSelector;event;constructor(e){this.select(e)}select(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"==typeof e?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}addElement(e){"object"==typeof e?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}push(e){this.elements.push(e)}reduce(){this.elements=this.elements.slice(0,-1)}deselect(){this.elements=[]}css(o,t){if(t=t||!1,"object"==typeof o){for(let t in o)if(Object.hasOwn(o,t)){var a=t.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));for(let e=0;e(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||=e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||=Boolean(e[t]):o||=null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)),o}isWithoutSelector(e,t){var o;let a=!1;for(o of document.querySelectorAll(t))a||=e===o;return a}filter(t){this.selector=null;for(let e=this.elements.length-1;0<=e;e--)this.isElem(this.elements[e],t)||this.elements.splice(Number(e),1);return this}parent(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}parents(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}children(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}siblings(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}remove(){for(var e of this.elements)e.remove()}after(e){for(var t of this.elements)t.after(e)}append(e){for(var t of this.elements)t.append(e)}fadeIn(a){for(let o of this.elements){o.style.opacity=0,o.style.display="block";let e=+new Date,t=function(){o.style.opacity=+o.style.opacity+(new Date-e)/a,e=+new Date,+o.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16))};t()}}fadeOut(a){for(let o of this.elements){o.style.opacity=1;let e=+new Date,t=function(){o.style.opacity=+o.style.opacity-(new Date-e)/a,e=+new Date,0<+o.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16):o.style.display="none"};t()}}}function ctProcessError(e,t){var o={},e=(e&&e.message?o.err={msg:e.message,file:e.fileName||!1,ln:e.lineNumber||lineNo||!1,col:e.columnNumber||columnNo||!1,stacktrace:e.stack||!1,cause:!!t&&JSON.stringify(t),errorObj:error||!1}:(o.err={msg:e},t&&(o.err.file=t)),o.url=window.location.href,o.userAgent=window.navigator.userAgent,"ct_js_errors");let a=localStorage.getItem(e);null===a&&(a="[]"),a=JSON.parse(a);for(let e=0;et.test(e.id)));a.forEach(e=>{this.elements.push(e)}),(a=Array.from(e).filter(e=>o.test(e.className))).forEach(e=>{this.elements.push(e)});var c,n,e=document.querySelector(".apbct_form_decoration");e&&(c=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after"),c)&&n&&this.elements.push(e)}setDecorationBackground(){var e=document.querySelectorAll("#respond");if(document.querySelector('[class*="apbct_form_decoration"]')){var o=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class"),a=o.indexOf("_header__wrapper");let t=o.substring(0,a);e.forEach(e=>{e.className+=" "+t})}}setListeners(){this.elements.forEach(i=>{i&&(i.addEventListener("click",e=>{var t,o,a,c,n;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(e{setTimeout(()=>{window.getSelection().toString()&&this.addSelected()},100)}),i.addEventListener("mousemove",e=>{var t,o,a,c,n;(-1===i.className.indexOf("apbct_form_decoration")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,aMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;ethis.checkBotCallback(e)}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:e=>this.checkBotCallback(e)}))}checkBotCallback(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"==typeof e&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}decodeForms(){let t;this.wrappers.forEach(e=>{t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}showMessageForBot(t){let o;this.wrappers.forEach(e=>{(o=e.querySelector("div.ct-encoded-form").dataset.encodedForm)&&(e.outerHTML='
'+t+"
")})}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((e,t)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3),document.querySelectorAll("[data-original-string]"));if((ctPublic.encodedEmailNodes=c).length)for(let e=0;ectSearchFormOnSubmitHandler(e,t));apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){if(ctPublic.settings__data__bot_detector_enabled){let e=setInterval(()=>{!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use((e,t)=>("object"==typeof e&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{null!==e&&e.parentNode.removeChild(e),"function"==typeof c.apbctSearchPrevOnsubmit?c.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(c)},i=l,null!==t&&null!==o&&(i.apbct_search_form__honeypot_value=t,i.apbct_search_form__honeypot_id=o),i.ct_bot_detector_event_token=s,"string"==typeof i.apbct_pixel_url&&-1!==i.apbct_pixel_url.indexOf("%3A")&&(i.apbct_pixel_url=decodeURIComponent(i.apbct_pixel_url)),void 0!==(r=JSON.stringify(i))&&0!==r.length?ctSetAlternativeCookie(r,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o,a,c,n=document.getElementById("apbct_popup");n?(n.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((n=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),n.setAttribute("id","apbct_popup"),(t=document.createElement("span")).classList="apbct-email-encoder-elements_center",(o=document.createElement("p")).innerText=ctPublic.wl_brandname,o.setAttribute("class","apbct-email-encoder--popup-header"),t.append(o),(o=document.createElement("div")).setAttribute("id","apbct_popup_text"),o.setAttribute("class","apbct-email-encoder-elements_center"),o.style.color="black",(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",a.innerText="The magic is on the way, please wait for a few seconds!",a.setAttribute("class","apbct-email-encoder-elements_center"),(c=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",c.innerText="Decoding process to the original data.",o.append(a),o.append(c),n.append(t),n.append(o),n.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(n)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],o=document.createElement("div");o.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===r.dataset.originalString&&(t=e)});var o=t.decoded_email.split(/[&?]/)[0],a=e.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),o=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=o,c.title="Click to select the whole data",a&&(a.innerHTML="The original one is "+c.outerHTML,a.setAttribute("style","flex-direction: row;")),e.querySelector(".apbct-ee-animation-wrapper")),c=(o&&o.remove(),e.querySelector("#apbct_email_ecoder__popup_text_node_second")),a=(c&&c.remove(),document.createElement("span"));a.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||((o=document.createElement("button")).innerText="Got it",o.classList="apbct-email-encoder-got-it-button",o.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),e.setAttribute("style","display:none"),fillDecodedEmails(i,n),ctPublic.encodedEmailNodesIsMixed&&r.click()}),a.append(o),e.append(a))}},3e3):n.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+n.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+n.data[0].comment))}function fillDecodedEmails(a,e){for(let o=0;o{e.encoded_email===a[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;var c,n;void 0!==a[o].href&&0===a[o].href.indexOf("mailto:")?(c=a[o].href.replace("mailto:",""),n=a[o].innerHTML,a[o].innerHTML=n.replace(c,t.decoded_email),a[o].href="mailto:"+t.decoded_email,a[o].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let o="";e.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(a[o].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,a[o])},2e3)),a[o].removeEventListener("click",ctFillDecodedEmailHandler)}}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),r=apbctSessionStorage.get("apbct_site_referer"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),s=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),_=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),f=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(o.ct_mouse_moved=void 0!==e?e:p,o.ct_has_scrolled=void 0!==a?a:m,o.ct_cookies_type=void 0!==c?c:_,o.apbct_pixel_url=void 0!==s?s:b,o.apbct_headless=void 0!==d?d:f,o.ct_bot_detector_frontend_data_log=void 0!==u?u:"",o.apbct_pixel_url&&"string"==typeof o.apbct_pixel_url&&o.apbct_pixel_url.indexOf("%3A%2F")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),o.apbct_page_hits=n,o.apbct_prev_referer=i,o.apbct_site_referer=r,o.apbct_ct_js_errors=l,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t)for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],a="",c=0,n="",i=0,o=[];for(var r in e.elements)isNaN(+r)||(t[r]=e.elements[r]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(a+=" "+e.getAttribute("name"),c++):(n+=" "+e.getAttribute("name"),i++))}),n=n.trim(),{visible_fields:a=a.trim(),visible_fields_count:c,invisible_fields:n,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var a in o){if(10{a.addEventListener("click",function(e){let t=a.getAttribute("href");var o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",t+="ct_bot_detector_event_token="+o,a.setAttribute("href",t))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(var t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+a+"}",r.innerHTML+="#cleantalk-modal-close:before{"+c+"}",r.innerHTML+="#cleantalk-modal-close:after{"+n+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),c=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?(n=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?c.innerHTML=this.loaded:c.innerHTML=this.loaded.replace(n,'
$1')):(c.innerHTML="Loading...",this.load("get_options_template")),c.setAttribute("id","cleantalk-modal-content"),t.append(c),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(let e=0;e{a.forEach(e=>{t.name===e.name&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})}):o.forEach(t=>{a.forEach(e=>{t.outerHTML===e.outerHTML&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})})}function ctProtectKlaviyoForm(){if(document.querySelector('link[rel="dns-prefetch"][href="//static.klaviyo.com"]')){let t=setInterval(()=>{var e=document.querySelectorAll("form.klaviyo-form");e.length&&(clearInterval(t),e.forEach((e,t)=>{apbctProcessExternalFormKlaviyo(e,t,document)}))},500)}}function apbctProcessExternalFormKlaviyo(t,e,o){var a,c=t.querySelector('button[type="button"].needsclick');c&&(c.disabled=!0,(a=document.createElement("input")).name="action",a.value="cleantalk_force_ajax_check",a.type="hidden",t.appendChild(a),(a=document.createElement("div")).id="apbct-klaviyo-cover",a.style.width="100%",a.style.height="100%",a.style.background="black",a.style.opacity=0,a.style.position="absolute",a.style.top=0,a.style.cursor="pointer",a.onclick=function(e){sendAjaxCheckingFormData(t)},c.parentNode.style.position="relative",c.parentNode.appendChild(a))}function ctProtectOutsideIframe(){var e=document.querySelectorAll("iframe");0 strong');0!==t.length&&(t.forEach((e,t)=>{var o,a=document.createElement("div"),c=(a.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),n=(c.setAttribute("src",s.imgPersonUrl),c.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(n.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),d&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),n.append(i,r),a.append(c),e.append(a),e.append(n)}),document.querySelectorAll(".apbct-real-user-badge").forEach(o=>{let a=void 0,e=(o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){a=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){a=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(()=>{var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}),apbctLocalStorage.set("apbct_iframes_protected",[]),window.addEventListener("load",function(){+ctPublic.settings__forms__check_external&&(setTimeout(function(){ctProtectExternal(),catchDynamicRenderedForm(),catchNextendSocialLoginForm(),ctProtectOutsideIframe()},2e3),ctProtectKlaviyoForm())});let ctProtectOutsideIframeCheck;function ctProtectOutsideIframeHandler(e){var t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.background="black",t.style.opacity=0,t.style.position="absolute",t.style.top=0,t.onclick=function(t){if(void 0===ctProtectOutsideIframeCheck){var t=t.currentTarget,o=(t.style.opacity=.5,document.createElement("div"));o.className="apbct-iframe-preloader",t.appendChild(o);let e="";document.querySelector('[name*="ct_bot_detector_event_token"]')&&(e=document.querySelector('[name*="ct_bot_detector_event_token"]').value),apbct_public_sendAJAX({action:"cleantalk_outside_iframe_ajax_check",ct_no_cookie_hidden_field:getNoCookieData(),ct_bot_detector_event_token:e},{async:!1,callback:function(t){!(ctProtectOutsideIframeCheck=!0)===t.apbct.blocked?document.querySelectorAll("div.apbct-iframe-preloader").forEach(function(e){e.parentNode.remove()}):(document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.parentNode.style.color="white",e.parentNode.innerHTML+=t.apbct.comment}),document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.remove()}))}})}},e.parentNode.style.position="relative",e.parentNode.appendChild(t);let o=apbctLocalStorage.get("apbct_iframes_protected");!1===o&&(o=[]),void 0!==e.id&&(o.push(e.id),apbctLocalStorage.set("apbct_iframes_protected",o))}function catchNextendSocialLoginForm(){var e=document.getElementById("nsl-custom-login-form-main");e&&blockBtnNextendSocialLogin(e)}function blockBtnNextendSocialLogin(e){var t=e.querySelectorAll(".nsl-container-buttons a"),e=e.querySelectorAll('a[data-plugin="nsl"] .nsl-button');t.forEach(e=>{e.setAttribute("data-oauth-login-blocked","true"),e.addEventListener("click",e=>{e.preventDefault()})}),e.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),ctCheckAjax(t)})})}function allowAjaxNextendSocialLogin(e){e.parentElement.setAttribute("data-oauth-login-blocked","false"),e.parentElement.click()}function forbiddenAjaxNextendSocialLogin(e,t){var o,e=e.parentElement;"false"==e.getAttribute("data-oauth-login-blocked")&&e.setAttribute("data-oauth-login-blocked","true"),document.querySelector(".ct-forbidden-msg")||((o=document.createElement("div")).className="ct-forbidden-msg",o.style.background="red",o.style.color="white",o.style.padding="5px",o.innerHTML=t,e.insertAdjacentElement("beforebegin",o))}function ctCheckAjax(t){apbct_public_sendAJAX({action:"cleantalk_nsl_ajax_check",ct_no_cookie_hidden_field:document.getElementsByName("ct_no_cookie_hidden_field")[0].value},{async:!1,callback:function(e){!1===e.apbct.blocked?allowAjaxNextendSocialLogin(t):forbiddenAjaxNextendSocialLogin(t,e.apbct.comment)}})}function isIntegratedForm(e){var t="string"==typeof e.action?e.action:"",o=null!==e.getAttribute("id")?e.getAttribute("id"):"";return!!(-1!==t.indexOf("app.convertkit.com")||-1!==t.indexOf("app.kit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_")||-1!==o.indexOf("ihf-contact-request-form")||-1!==t.indexOf("crm.zoho.com")||-1!==o.indexOf("delivra-external-form")||-1!==t.indexOf("eloqua.com")||-1!==t.indexOf("kulahub.net")||isFormHasDiviRedirect(e)||-1!==t.indexOf("eocampaign1.com")||-1!==t.indexOf("wufoo.com")||void 0!==e.classList&&e.classList.contains("sp-element-container"))}function isFormHasDiviRedirect(e){let t=!1;var o=document.querySelector('div[id^="et_pb_contact_form"]');return t="object"==typeof e&&null!==e&&null!==o&&o.hasAttribute("data-redirect_url")&&""!==o.getAttribute("data-redirect_url")&&null!==o.querySelector('form[class^="et_pb_contact_form"]')?e===o.querySelector('form[class^="et_pb_contact_form"]'):t}function sendAjaxCheckingFormData(p){var e={};e[0]=apbct_collect_visible_fields(p),apbct_visible_fields_set_cookie(e);let o={ct_bot_detector_event_token:apbctLocalStorage.get("bot_detector_event_token")};e=p.elements;(e=Array.prototype.slice.call(e)).forEach(function(e,t){""===e.name?o["input_"+t]=e.value:o[e.name]=e.value}),apbct_public_sendAJAX(o,{async:!1,callback:function(e,t,o,a){if(apbctMoosendSpinnerToggle(p),void 0===e.apbct||!+e.apbct.blocked){for(var c of p.querySelectorAll('input[name="apbct_visible_fields"]'))c.remove();for(var n of p.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))n.remove();for(var i of p.querySelectorAll('input[name="ct_no_cookie_hidden_field"]'))i.remove();if(void 0!==p.classList&&p.classList.contains("klaviyo-form"))return(s=document.getElementById("apbct-klaviyo-cover"))&&s.remove(),void((s=p.querySelector('button[type="button"].needsclick'))&&(s.disabled=!1,s.click()));if(void 0!==p.dataset.mailingListId){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),void(e=p.querySelector('[type="submit"]')).click()}if(p.hasAttribute("action")&&-1!==p.getAttribute("action").indexOf("webto.salesforce.com")){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}if(p.querySelector('[href*="activecampaign"]')){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}var r,l,s=p,d=(p.parentElement.removeChild(p),p.apbctPrev),u=p.apbctFormOriginal;let e=!1;apbctReplaceInputsValuesFromOtherForm(s,u),-1!==u.id.indexOf("mautic")&&(e=!0),d.after(u);for(r of u.querySelectorAll('input[name="apbct_visible_fields"]'))r.remove();for(l of u.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))l.remove();let t=u.querySelectorAll("button[type=submit]");if(0!==t.length)return t[0].click(),void(e&&setTimeout(function(){ctProtectExternal()},1500));if(0!==(t=u.querySelectorAll("input[type=submit]")).length)return void t[0].click();if(0!==(t=u.querySelectorAll('button[data-element="submit"]')).length)return void t[0].click();0!==(t=u.querySelectorAll('input[type="image"][name="submit"]')).length&&t[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function catchDynamicRenderedForm(){catchDynamicRenderedFormHandler(document.getElementsByTagName("form"));var t=document.getElementsByTagName("iframe");if(0e.selected).map(e=>e.value):"checkbox"===e.type||"radio"===e.type?e.checked||null:e.value} +class ApbctCore{ajax_parameters={};restParameters={};selector=null;elements=[];eventCallback;eventSelector;event;constructor(e){this.select(e)}select(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"==typeof e?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}addElement(e){"object"==typeof e?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}push(e){this.elements.push(e)}reduce(){this.elements=this.elements.slice(0,-1)}deselect(){this.elements=[]}css(t,o){if(o=o||!1,"object"==typeof t){for(const a in t)if(Object.hasOwn(t,a)){var c=a.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));for(let e=0;et.test(e.id));c.forEach(e=>{this.elements.push(e)}),(c=Array.from(e).filter(e=>o.test(e.className))).forEach(e=>{this.elements.push(e)});var a,n,e=document.querySelector(".apbct_form_decoration");e&&(a=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after"),a)&&n&&this.elements.push(e)}setDecorationBackground(){var e=document.querySelectorAll("#respond");if(document.querySelector('[class*="apbct_form_decoration"]')){var o=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class"),c=o.indexOf("_header__wrapper");let t=o.substring(0,c);e.forEach(e=>{e.className+=" "+t})}}setListeners(){this.elements.forEach(i=>{i&&(i.addEventListener("click",e=>{var t,o,c,a,n;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,c=parseFloat(window.getComputedStyle(i,"::before").height)/2,a=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(e{setTimeout(()=>{window.getSelection().toString()&&this.addSelected()},100)}),i.addEventListener("mousemove",e=>{var t,o,c,a,n;(-1===i.className.indexOf("apbct_form_decoration")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,c=parseFloat(window.getComputedStyle(i,"::before").height)/2,a=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,cMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;ethis.checkBotCallback(e)}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:e=>this.checkBotCallback(e)}))}checkBotCallback(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"==typeof e&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}decodeForms(){let t;this.wrappers.forEach(e=>{t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}showMessageForBot(t){let o;this.wrappers.forEach(e=>{(o=e.querySelector("div.ct-encoded-form").dataset.encodedForm)&&(e.outerHTML='
'+t+"
")})}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((e,t)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3),document.querySelectorAll("[data-original-string]"));if((ctPublic.encodedEmailNodes=a).length)for(let e=0;ectSearchFormOnSubmitHandler(e,n));apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){if(ctPublic.settings__data__bot_detector_enabled){const e=setInterval(()=>{!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use((e,t)=>("object"==typeof e&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{null!==l&&l.parentNode.removeChild(l),"function"==typeof c.apbctSearchPrevOnsubmit?c.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(c)},n=r,null!==e&&null!==t&&(n.apbct_search_form__honeypot_value=e,n.apbct_search_form__honeypot_id=t),n.ct_bot_detector_event_token=s,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(i=JSON.stringify(n))&&0!==i.length?ctSetAlternativeCookie(i,{callback:a,onErrorCallback:a,forceAltCookies:!0}):a())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o,c,a,n=document.getElementById("apbct_popup");n?(n.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((n=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),n.setAttribute("id","apbct_popup"),(t=document.createElement("span")).classList="apbct-email-encoder-elements_center",(o=document.createElement("p")).innerText=ctPublic.wl_brandname,o.setAttribute("class","apbct-email-encoder--popup-header"),t.append(o),(o=document.createElement("div")).setAttribute("id","apbct_popup_text"),o.setAttribute("class","apbct-email-encoder-elements_center"),o.style.color="black",(c=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",c.innerText="The magic is on the way, please wait for a few seconds!",c.setAttribute("class","apbct-email-encoder-elements_center"),(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",a.innerText="Decoding process to the original data.",o.append(c),o.append(a),n.append(t),n.append(o),n.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(n)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],o=document.createElement("div");o.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===r.dataset.originalString&&(t=e)});var o=t.decoded_email.split(/[&?]/)[0],c=e.querySelector("#apbct_email_ecoder__popup_text_node_first"),a=document.createElement("b"),o=(a.setAttribute("class","apbct-email-encoder-select-whole-email"),a.innerText=o,a.title="Click to select the whole data",c&&(c.innerHTML="The original one is "+a.outerHTML,c.setAttribute("style","flex-direction: row;")),e.querySelector(".apbct-ee-animation-wrapper")),a=(o&&o.remove(),e.querySelector("#apbct_email_ecoder__popup_text_node_second")),c=(a&&a.remove(),document.createElement("span"));c.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||((o=document.createElement("button")).innerText="Got it",o.classList="apbct-email-encoder-got-it-button",o.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),e.setAttribute("style","display:none"),fillDecodedEmails(i,n),ctPublic.encodedEmailNodesIsMixed&&r.click()}),c.append(o),e.append(c))}},3e3):n.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+n.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+n.data[0].comment))}function fillDecodedEmails(c,e){for(let o=0;o{e.encoded_email===c[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;var a,n;void 0!==c[o].href&&0===c[o].href.indexOf("mailto:")?(a=c[o].href.replace("mailto:",""),n=c[o].innerHTML,c[o].innerHTML=n.replace(a,t.decoded_email),c[o].href="mailto:"+t.decoded_email,c[o].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let o="";e.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(c[o].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,c[o])},2e3)),c[o].removeEventListener("click",ctFillDecodedEmailHandler)}}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),a=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),r=apbctSessionStorage.get("apbct_site_referer"),s=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),_=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),f=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(o.ct_mouse_moved=void 0!==e?e:p,o.ct_has_scrolled=void 0!==c?c:m,o.ct_cookies_type=void 0!==a?a:_,o.apbct_pixel_url=void 0!==l?l:b,o.apbct_headless=void 0!==d?d:f,o.ct_bot_detector_frontend_data_log=void 0!==u?u:"",o.apbct_pixel_url&&"string"==typeof o.apbct_pixel_url&&o.apbct_pixel_url.indexOf("%3A%2F")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),o.apbct_page_hits=n,o.apbct_prev_referer=i,o.apbct_site_referer=r,o.apbct_ct_js_errors=s,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t)for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],c="",a=0,n="",i=0,o=[];for(var r in e.elements)isNaN(+r)||(t[r]=e.elements[r]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(c+=" "+e.getAttribute("name"),a++):(n+=" "+e.getAttribute("name"),i++))}),n=n.trim(),{visible_fields:c=c.trim(),visible_fields_count:a,invisible_fields:n,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var c in o){if(10{c.addEventListener("click",function(e){let t=c.getAttribute("href");var o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",t+="ct_bot_detector_event_token="+o,c.setAttribute("href",t))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,c){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(const t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},c={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+c+"}",r.innerHTML+="#cleantalk-modal-close:before{"+a+"}",r.innerHTML+="#cleantalk-modal-close:after{"+n+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),c=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(c.setAttribute("id","cleantalk-modal-close"),t.append(c),document.createElement("div"));this.loaded?(n=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(n,'$1')):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(let e=0;e{c.forEach(e=>{t.name===e.name&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})}):o.forEach(t=>{c.forEach(e=>{t.outerHTML===e.outerHTML&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})})}function ctProtectKlaviyoForm(){if(document.querySelector('link[rel="dns-prefetch"][href="//static.klaviyo.com"]')){let t=setInterval(()=>{var e=document.querySelectorAll("form.klaviyo-form");e.length&&(clearInterval(t),e.forEach((e,t)=>{apbctProcessExternalFormKlaviyo(e,t,document)}))},500)}}function apbctProcessExternalFormKlaviyo(t,e,o){var c,a=t.querySelector('button[type="button"].needsclick');a&&(a.disabled=!0,(c=document.createElement("input")).name="action",c.value="cleantalk_force_ajax_check",c.type="hidden",t.appendChild(c),(c=document.createElement("div")).id="apbct-klaviyo-cover",c.style.width="100%",c.style.height="100%",c.style.background="black",c.style.opacity=0,c.style.position="absolute",c.style.top=0,c.style.cursor="pointer",c.onclick=function(e){sendAjaxCheckingFormData(t)},a.parentNode.style.position="relative",a.parentNode.appendChild(c))}function ctProtectOutsideIframe(){var e=document.querySelectorAll("iframe");0 strong');0!==t.length&&(t.forEach((e,t)=>{var o,c=document.createElement("div"),a=(c.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),n=(a.setAttribute("src",l.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(n.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(l.phrases.trpHeading),document.createElement("div")),s=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));s.append(l.phrases.trpContent1+" "),s.append(l.phrases.trpContent2),d&&((o=document.createElement("a")).setAttribute("href",l.trpContentLink),o.setAttribute("target","_blank"),o.text=l.phrases.trpContentLearnMore,s.append(" "),s.append(o)),r.append(s),n.append(i,r),c.append(a),e.append(c),e.append(n)}),document.querySelectorAll(".apbct-real-user-badge").forEach(o=>{let c=void 0;o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){c=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)});const e=o.nextElementSibling;e.addEventListener("mouseenter",function(){clearTimeout(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){c=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=setTimeout(()=>{var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}),apbctLocalStorage.set("apbct_iframes_protected",[]),window.addEventListener("load",function(){+ctPublic.settings__forms__check_external&&(setTimeout(function(){ctProtectExternal(),catchDynamicRenderedForm(),catchNextendSocialLoginForm(),ctProtectOutsideIframe()},2e3),ctProtectKlaviyoForm())});let ctProtectOutsideIframeCheck;function ctProtectOutsideIframeHandler(e){var t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.background="black",t.style.opacity=0,t.style.position="absolute",t.style.top=0,t.onclick=function(t){if(void 0===ctProtectOutsideIframeCheck){var t=t.currentTarget,o=(t.style.opacity=.5,document.createElement("div"));o.className="apbct-iframe-preloader",t.appendChild(o);let e="";document.querySelector('[name*="ct_bot_detector_event_token"]')&&(e=document.querySelector('[name*="ct_bot_detector_event_token"]').value),apbct_public_sendAJAX({action:"cleantalk_outside_iframe_ajax_check",ct_no_cookie_hidden_field:getNoCookieData(),ct_bot_detector_event_token:e},{async:!1,callback:function(t){!(ctProtectOutsideIframeCheck=!0)===t.apbct.blocked?document.querySelectorAll("div.apbct-iframe-preloader").forEach(function(e){e.parentNode.remove()}):(document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.parentNode.style.color="white",e.parentNode.innerHTML+=t.apbct.comment}),document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.remove()}))}})}},e.parentNode.style.position="relative",e.parentNode.appendChild(t);let o=apbctLocalStorage.get("apbct_iframes_protected");!1===o&&(o=[]),void 0!==e.id&&(o.push(e.id),apbctLocalStorage.set("apbct_iframes_protected",o))}function catchNextendSocialLoginForm(){var e=document.getElementById("nsl-custom-login-form-main");e&&blockBtnNextendSocialLogin(e)}function blockBtnNextendSocialLogin(e){var t=e.querySelectorAll(".nsl-container-buttons a"),e=e.querySelectorAll('a[data-plugin="nsl"] .nsl-button');t.forEach(e=>{e.setAttribute("data-oauth-login-blocked","true"),e.addEventListener("click",e=>{e.preventDefault()})}),e.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),ctCheckAjax(t)})})}function allowAjaxNextendSocialLogin(e){e.parentElement.setAttribute("data-oauth-login-blocked","false"),e.parentElement.click()}function forbiddenAjaxNextendSocialLogin(e,t){var o,e=e.parentElement;"false"==e.getAttribute("data-oauth-login-blocked")&&e.setAttribute("data-oauth-login-blocked","true"),document.querySelector(".ct-forbidden-msg")||((o=document.createElement("div")).className="ct-forbidden-msg",o.style.background="red",o.style.color="white",o.style.padding="5px",o.innerHTML=t,e.insertAdjacentElement("beforebegin",o))}function ctCheckAjax(t){apbct_public_sendAJAX({action:"cleantalk_nsl_ajax_check",ct_no_cookie_hidden_field:document.getElementsByName("ct_no_cookie_hidden_field")[0].value},{async:!1,callback:function(e){!1===e.apbct.blocked?allowAjaxNextendSocialLogin(t):forbiddenAjaxNextendSocialLogin(t,e.apbct.comment)}})}function isIntegratedForm(e){var t="string"==typeof e.action?e.action:"",o=null!==e.getAttribute("id")?e.getAttribute("id"):"";return!!(-1!==t.indexOf("app.convertkit.com")||-1!==t.indexOf("app.kit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_")||-1!==o.indexOf("ihf-contact-request-form")||-1!==t.indexOf("crm.zoho.com")||-1!==o.indexOf("delivra-external-form")||-1!==t.indexOf("eloqua.com")||-1!==t.indexOf("kulahub.net")||isFormHasDiviRedirect(e)||-1!==t.indexOf("eocampaign1.com")||-1!==t.indexOf("wufoo.com")||void 0!==e.classList&&e.classList.contains("sp-element-container"))}function isFormHasDiviRedirect(e){let t=!1;var o=document.querySelector('div[id^="et_pb_contact_form"]');return t="object"==typeof e&&null!==e&&null!==o&&o.hasAttribute("data-redirect_url")&&""!==o.getAttribute("data-redirect_url")&&null!==o.querySelector('form[class^="et_pb_contact_form"]')?e===o.querySelector('form[class^="et_pb_contact_form"]'):t}function sendAjaxCheckingFormData(p){var e={};e[0]=apbct_collect_visible_fields(p),apbct_visible_fields_set_cookie(e);const o={ct_bot_detector_event_token:apbctLocalStorage.get("bot_detector_event_token")};e=p.elements;(e=Array.prototype.slice.call(e)).forEach(function(e,t){""===e.name?o["input_"+t]=e.value:o[e.name]=e.value}),apbct_public_sendAJAX(o,{async:!1,callback:function(e,t,o,c){if(apbctMoosendSpinnerToggle(p),void 0===e.apbct||!+e.apbct.blocked){for(const r of p.querySelectorAll('input[name="apbct_visible_fields"]'))r.remove();for(const s of p.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))s.remove();for(const l of p.querySelectorAll('input[name="ct_no_cookie_hidden_field"]'))l.remove();if(void 0!==p.classList&&p.classList.contains("klaviyo-form"))return(a=document.getElementById("apbct-klaviyo-cover"))&&a.remove(),void((a=p.querySelector('button[type="button"].needsclick'))&&(a.disabled=!1,a.click()));if(void 0!==p.dataset.mailingListId){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),void(e=p.querySelector('[type="submit"]')).click()}if(p.hasAttribute("action")&&-1!==p.getAttribute("action").indexOf("webto.salesforce.com")){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}if(p.querySelector('[href*="activecampaign"]')){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}var a=p,n=(p.parentElement.removeChild(p),p.apbctPrev),i=p.apbctFormOriginal;let e=!1;apbctReplaceInputsValuesFromOtherForm(a,i),-1!==i.id.indexOf("mautic")&&(e=!0),n.after(i);for(const d of i.querySelectorAll('input[name="apbct_visible_fields"]'))d.remove();for(const u of i.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))u.remove();let t=i.querySelectorAll("button[type=submit]");if(0!==t.length)return t[0].click(),void(e&&setTimeout(function(){ctProtectExternal()},1500));if(0!==(t=i.querySelectorAll("input[type=submit]")).length)return void t[0].click();if(0!==(t=i.querySelectorAll('button[data-element="submit"]')).length)return void t[0].click();0!==(t=i.querySelectorAll('input[type="image"][name="submit"]')).length&&t[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function catchDynamicRenderedForm(){catchDynamicRenderedFormHandler(document.getElementsByTagName("form"));var t=document.getElementsByTagName("iframe");if(0e.selected).map(e=>e.value):"checkbox"===e.type||"radio"===e.type?e.checked||null:e.value} //# sourceMappingURL=apbct-public-bundle_ext-protection.min.js.map diff --git a/js/apbct-public-bundle_ext-protection.min.js.map b/js/apbct-public-bundle_ext-protection.min.js.map index ab65111b..b9e4649d 100644 --- a/js/apbct-public-bundle_ext-protection.min.js.map +++ b/js/apbct-public-bundle_ext-protection.min.js.map @@ -1 +1 @@ -{"version":3,"file":"apbct-public-bundle_ext-protection.min.js","sources":["apbct-public-bundle_ext-protection.js"],"sourcesContent":["/**\n * Base class\n */\nclass ApbctCore {\n ajax_parameters = {};\n restParameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n * @param {string} selector\n */\n constructor(selector) {\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param {string} selector\n * @return {*}\n */\n select(selector) {\n if (selector instanceof HTMLCollection) {\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n } else if ( typeof selector === 'object' ) {\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n } else if ( typeof selector === 'string' ) {\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n } else {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {object|string} elemToAdd\n */\n addElement(elemToAdd) {\n if ( typeof elemToAdd === 'object' ) {\n this.elements.push(elemToAdd);\n } else if ( typeof elemToAdd === 'string' ) {\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n } else {\n this.deselect();\n }\n }\n\n /**\n * @param {object} elem\n */\n push(elem) {\n this.elements.push(elem);\n }\n\n /**\n * reduce\n */\n reduce() {\n this.elements = this.elements.slice(0, -1);\n }\n\n /**\n * deselect\n */\n deselect() {\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param {object|string} style\n * @param {boolean} getRaw\n *\n * @return {boolean|*}\n */\n css(style, getRaw) {\n getRaw = getRaw || false;\n\n // Set style\n if (typeof style === 'object') {\n const stringToCamelCase = (str) =>\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ctJsErrors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Select actual WP nonce depending on the ajax type and the fresh nonce provided.\n * @return {string} url\n */\nfunction selectActualNonce() {\n let defaultNonce = '';\n // return fresh nonce immediately if persists\n if (\n ctPublicFunctions.hasOwnProperty('_fresh_nonce') &&\n typeof ctPublicFunctions._fresh_nonce === 'string' &&\n ctPublicFunctions._fresh_nonce.length > 0\n ) {\n return ctPublicFunctions._fresh_nonce;\n }\n // select from default rest/ajax nonces\n if (\n ctPublicFunctions.data__ajax_type === 'admin_ajax' &&\n ctPublicFunctions.hasOwnProperty('_ajax_nonce') &&\n typeof ctPublicFunctions._ajax_nonce === 'string' &&\n ctPublicFunctions._ajax_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._ajax_nonce;\n }\n if (\n ctPublicFunctions.data__ajax_type === 'rest' &&\n ctPublicFunctions.hasOwnProperty('_rest_nonce') &&\n typeof ctPublicFunctions._rest_nonce === 'string' &&\n ctPublicFunctions._rest_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._rest_nonce;\n }\n\n return defaultNonce;\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n if (this.isWpNonceError()) {\n this.getFreshNonceAndRerunXHR(parameters);\n return;\n }\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * Check if 403 code of WP nonce error\n * @return {bool}\n */\n isWpNonceError() {\n let restErrror = false;\n let ajaxErrror = false;\n // check rest error\n if (this.xhr.readyState == 4) {\n restErrror = (\n typeof this.xhr.response === 'object' && this.xhr.response !== null &&\n this.xhr.response.hasOwnProperty('data') &&\n this.xhr.response.data.hasOwnProperty('status') &&\n this.xhr.response.data.status === 403\n );\n ajaxErrror = this.xhr.response === '-1' && this.xhr.status === 403;\n }\n // todo check AJAX error\n return restErrror || ajaxErrror;\n }\n\n /**\n * Get the fresh nonce and rerun the initial XHR with params\n * @param {[]} initialRequestParams\n */\n getFreshNonceAndRerunXHR(initialRequestParams) {\n let noncePrev = '';\n\n // Check if initialRequestParams['headers']['X-WP-Nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('headers') &&\n initialRequestParams.headers.hasOwnProperty('X-WP-Nonce')\n ) {\n noncePrev = initialRequestParams['headers']['X-WP-Nonce'];\n }\n\n // Check if initialRequestParams['data']['_ajax_nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('data') &&\n initialRequestParams.data.hasOwnProperty('_ajax_nonce')\n ) {\n noncePrev = initialRequestParams['data']['_ajax_nonce'];\n }\n\n // Nonce is not provided. Exit.\n if ( noncePrev === '' ) {\n return;\n }\n\n // prepare params for refreshing nonce\n let params = {};\n params.method = 'POST';\n params.data = {\n 'spbc_remote_call_action': 'get_fresh_wpnonce',\n 'plugin_name': 'antispam',\n 'nonce_prev': noncePrev,\n 'initial_request_params': initialRequestParams,\n };\n params.notJson = true;\n params.url = ctPublicFunctions.host_url;\n // this callback will rerun the XHR with initial params\n params.callback = function(...args) {\n // the refresh result itself\n let freshNonceResult = args[0];\n let newRequestParams = false;\n // provided initial params\n if (args[1] !== undefined && args[1].hasOwnProperty('initial_request_params')) {\n newRequestParams = args[1].initial_request_params;\n }\n if (newRequestParams && freshNonceResult.hasOwnProperty('wpnonce')) {\n ctPublicFunctions._fresh_nonce = freshNonceResult.wpnonce;\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n new ApbctCore().rest(newRequestParams);\n } else {\n new ApbctCore().ajax(newRequestParams);\n }\n }\n };\n // run the nonce refreshing call\n new ApbctXhr(params);\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.data._ajax_nonce = selectActualNonce();\n super(args);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n const nonce = selectActualNonce();\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': nonce,\n };\n super(args);\n }\n}\n\n// add hasOwn\nif (!Object.prototype.hasOwn) {\n Object.defineProperty(Object.prototype, 'hasOwn', { // eslint-disable-line\n value: function(property) {\n return Object.prototype.hasOwnProperty.call(this, property);\n },\n enumerable: false,\n configurable: true,\n writable: true,\n });\n}\n\n/**\n * Form skin class\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctFormDecorator {\n elements = [];\n\n /**\n * Constructor\n */\n constructor() {\n this.getElements();\n this.setListeners();\n }\n\n /**\n * Get elements\n */\n getElements() {\n const elements = document.querySelectorAll('*');\n const regexId = /^apbct-trusted-text--label/;\n const regexClass = /apbct_form_decoration--/;\n\n this.setDecorationBackground();\n\n // Collect elements with id or class that contains apbct-trusted-text--label or apbct_form_decoration--\n // id\n let matchingElements = Array.from(elements).filter((element) => {\n return regexId.test(element.id);\n });\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n // class\n matchingElements = Array.from(elements).filter((element) => {\n return regexClass.test(element.className);\n });\n\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n const flagWrap = document.querySelector('.apbct_form_decoration');\n if (flagWrap) {\n const flagLeft = window.getComputedStyle(flagWrap, '::before');\n const flagRight = window.getComputedStyle(flagWrap, '::after');\n if (flagLeft && flagRight) {\n this.elements.push(flagWrap);\n }\n }\n }\n\n /**\n * Set decoration background\n */\n setDecorationBackground() {\n let blockForms = document.querySelectorAll('#respond');\n\n if (document.querySelector('[class*=\"apbct_form_decoration\"]')) {\n let classHeaderWrapper = document.querySelector('[class*=\"apbct_form_decoration\"]').getAttribute('class');\n let endPosition = classHeaderWrapper.indexOf('_header__wrapper');\n let classTemplate = classHeaderWrapper.substring(0, endPosition);\n\n blockForms.forEach((blockForm) => {\n blockForm.className += ' ' + classTemplate;\n });\n }\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elements.forEach((element) => {\n if (!element) {\n return;\n }\n\n element.addEventListener('click', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n if (element.className.indexOf('header__wrapper') !== -1) {\n this.addClicks();\n return;\n }\n\n const clickX = event.offsetX;\n const clickY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (element.className.indexOf('christmas') !== -1) {\n if (\n clickY < flagLeftHeight / 3 && clickX < flagLeftWidth ||\n clickY < flagRightHeight / 3 && clickX > flagRightWidth\n ) {\n this.addClicks();\n return;\n }\n }\n\n if (\n (element.className.indexOf('new-year') !== -1) ||\n (element.className.indexOf('fourth-july') !== -1)\n ) {\n if (\n clickY > flagLeftHeight && clickX < flagLeftWidth ||\n clickY > flagRightHeight && clickX > flagRightWidth\n ) {\n this.addClicks();\n }\n }\n\n if (element.className.indexOf('signature')) {\n this.addClicks();\n }\n\n return;\n }\n\n this.addClicks();\n });\n\n element.addEventListener('mouseup', (event) => {\n setTimeout(() => {\n const selectedText = window.getSelection().toString();\n if (selectedText) {\n this.addSelected();\n }\n }, 100);\n });\n\n element.addEventListener('mousemove', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n const mouseX = event.offsetX;\n const mouseY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (mouseY > flagLeftHeight && mouseX < flagLeftWidth ||\n mouseY > flagRightHeight && mouseX > flagRightWidth\n ) {\n this.trackMouseMovement();\n }\n return;\n }\n\n this.trackMouseMovement();\n });\n });\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.clicks) {\n document.ctFormDecorationMouseData.clicks++;\n } else {\n document.ctFormDecorationMouseData.clicks = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.selected) {\n document.ctFormDecorationMouseData.selected++;\n } else {\n document.ctFormDecorationMouseData.selected = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctFormDecorationMouseData) {\n document.ctFormDecorationMouseData = {};\n }\n if (!document.ctFormDecorationMouseData.mouseMovements) {\n document.ctFormDecorationMouseData.mouseMovements = [];\n }\n\n document.ctFormDecorationMouseData.mouseMovements.push({timestamp: Date.now()});\n\n if (document.ctFormDecorationMouseData.mouseMovements.length > 1) {\n const index = document.ctFormDecorationMouseData.mouseMovements.length - 1;\n const lastMovement = document.ctFormDecorationMouseData.mouseMovements[index];\n const firstMovement = document.ctFormDecorationMouseData.mouseMovements[0];\n const timeDiff = lastMovement.timestamp - firstMovement.timestamp;\n document.ctFormDecorationMouseData.hovering = timeDiff;\n }\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_bot_detector_exist',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], item[1]);\n }\n });\n\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n let bloomPopup = document.querySelectorAll('div[class^=\"et_bloom_form_container\"]').length > 0;\n let pafeFormsFormElementor = document.querySelectorAll('div[class*=\"pafe-form\"]').length > 0;\n let otterForm = document.querySelectorAll('div [class*=\"otter-form\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp ||\n pafeFormsFormElementor ||\n bloomPopup ||\n otterForm;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n if (!cookies.apbct_site_referer) {\n cookies.apbct_site_referer = location.href;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n const nonce = selectActualNonce();\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i this.checkBotCallback(result),\n });\n } else if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n data.action = 'apbct_force_protection_check_bot';\n apbct_public_sendAJAX(data, {callback: (result) => this.checkBotCallback(result)});\n }\n }\n\n /**\n * Check bot callback\n * @param {Object} result\n * @return {void}\n */\n checkBotCallback(result) {\n // if error occurred\n if (result.data && result.data.status && result.data.status !== 200) {\n console.log('ApbctForceProtection connection error occurred');\n this.decodeForms();\n return;\n }\n\n if (typeof result === 'string') {\n try {\n result = JSON.parse(result);\n } catch (e) {\n console.log('ApbctForceProtection decodeForms error', e);\n this.decodeForms();\n return;\n }\n }\n\n if (typeof result === 'object' && result.allow && result.allow === 1) {\n this.decodeForms();\n } else {\n this.showMessageForBot(result.message);\n }\n }\n\n /**\n * Decode forms\n * @return {void}\n */\n decodeForms() {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n\n try {\n if (form && typeof(form) == 'string') {\n wrapper.outerHTML = atob(form);\n }\n } catch (error) {\n console.log(error);\n }\n });\n }\n\n /**\n * Show message for bot\n * @param {string} message\n * @return {void}\n */\n showMessageForBot(message) {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n if (form) {\n wrapper.outerHTML = '
' + message + '
';\n }\n });\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctCheckedEmailsExist = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\nlet tokenCheckerIntervalId;\nlet botDetectorLogLastUpdate = 0;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Run cron jobs\n */\n// forms handler cron\ncronFormsHandler(2000);\n\n// bot_detector frontend_data log alt session saving cron\nif (\n ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&\n ctPublicFunctions.data__bot_detector_enabled == 1\n) {\n sendBotDetectorLogToAltSessions(500);\n}\n/**\n * Cron jobs end.\n */\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Send BotDetector logs data to alternative sessions.\n * If log_last_update has changed, the log will be sent to the alternative sessions.\n * @param {int} cronStartTimeout delay before cron start\n * @param {int} interval check fires on interval\n */\nfunction sendBotDetectorLogToAltSessions(cronStartTimeout = 3000, interval = 1000) {\n setTimeout(function() {\n setInterval(function() {\n const currentLog = apbctLocalStorage.get('ct_bot_detector_frontend_data_log');\n if (currentLog && currentLog.hasOwnProperty('log_last_update')) {\n if (botDetectorLogLastUpdate !== currentLog.log_last_update) {\n botDetectorLogLastUpdate = currentLog.log_last_update;\n // the log will be taken from javascriptclientdata\n ctSetAlternativeCookie([], {forceAltCookies: true});\n }\n }\n }, interval);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0 ||\n document.getElementById('login-form-popup') !== null\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmailExist(e) {\n let currentEmail = e.target.value;\n let result;\n\n if (!currentEmail || !currentEmail.length) {\n let envelope = document.getElementById('apbct-check_email_exist-block');\n if (envelope) {\n envelope.remove();\n }\n let hint = document.getElementById('apbct-check_email_exist-popup_description');\n if (hint) {\n hint.remove();\n }\n return;\n }\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail in ctCheckedEmailsExist) {\n result = ctCheckedEmailsExist[currentEmail];\n getResultCheckEmailExist(e, result, currentEmail);\n\n return;\n }\n\n viewCheckEmailExist(e, 'load');\n\n // Using REST API handler\n ctPublicFunctions.data__ajax_type = 'rest';\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n apbct_public_sendREST(\n 'check_email_exist_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n\n return;\n }\n\n if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_exist_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} e\n * @param {mixed} result\n * @param {string} currentEmail\n */\nfunction getResultCheckEmailExist(e, result, currentEmail) {\n if (!result || !result.result) {\n return;\n }\n\n result = result.result;\n\n ctCheckedEmailsExist[currentEmail] = {\n 'result': result,\n 'timestamp': Date.now() / 1000 |0,\n };\n\n if (result.result == 'EXISTS') {\n viewCheckEmailExist(e, 'good_email', result.text_result);\n } else {\n viewCheckEmailExist(e, 'bad_email', result.text_result);\n }\n\n ctSetCookie('ct_checked_emails_exist', JSON.stringify(ctCheckedEmailsExist));\n}\n\n/**\n * @param {mixed} e\n * @param {string} state\n * @param {string} textResult\n */\nfunction viewCheckEmailExist(e, state, textResult) {\n let parentElement = e.target.parentElement;\n let inputEmail = parentElement.querySelector('[name*=\"email\"]');\n\n if (!inputEmail) {\n return;\n }\n\n const envelopeWidth = 35;\n let envelope;\n let hint;\n\n // envelope\n if (document.getElementById('apbct-check_email_exist-block')) {\n envelope = document.getElementById('apbct-check_email_exist-block');\n } else {\n envelope = document.createElement('div');\n envelope.setAttribute('class', 'apbct-check_email_exist-block');\n envelope.setAttribute('id', 'apbct-check_email_exist-block');\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n envelope.style.left = inputEmail.getBoundingClientRect().right - envelopeWidth - 10 + 'px';\n envelope.style.height = inputEmail.offsetHeight + 'px';\n envelope.style.width = envelopeWidth + 'px';\n\n window.addEventListener('scroll', function() {\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n });\n\n parentElement.after(envelope);\n }\n\n // hint\n if (document.getElementById('apbct-check_email_exist-popup_description')) {\n hint = document.getElementById('apbct-check_email_exist-popup_description');\n } else {\n hint = document.createElement('div');\n hint.setAttribute('class', 'apbct-check_email_exist-popup_description');\n hint.setAttribute('id', 'apbct-check_email_exist-popup_description');\n hint.style.width = inputEmail.offsetWidth + 'px';\n hint.style.left = inputEmail.getBoundingClientRect().left + 'px';\n\n window.addEventListener('scroll', function() {\n hint.style.top = envelope.getBoundingClientRect().top + 'px';\n });\n\n envelope.after(hint);\n }\n\n switch (state) {\n case 'load':\n envelope.classList.remove('apbct-check_email_exist-good_email', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-load');\n break;\n\n case 'good_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-good_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#1C7129';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n case 'bad_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-good_email');\n envelope.classList.add('apbct-check_email_exist-bad_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#E01111';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n default:\n break;\n }\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n } else {\n // if Jquery is not avaliable try to use xhr\n if (typeof XMLHttpRequest !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n document.addEventListener('readystatechange', function(event) {\n if (event.target.readyState === 4) {\n ctPrepareBlockMessage(event.target);\n }\n });\n }\n }\n}\n\n/**\n * For forced alt cookies.\n * If token is not added to the LS on apbc_ready, check every second if so and send token to the alt sessions.\n */\nfunction startForcedAltEventTokenChecker() {\n tokenCheckerIntervalId = setInterval( function() {\n if (apbctLocalStorage.get('event_token_forced_set') === '1') {\n clearInterval(tokenCheckerIntervalId);\n return;\n }\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if (eventToken) {\n ctSetAlternativeCookie([['ct_bot_detector_event_token', eventToken]], {forceAltCookies: true});\n apbctLocalStorage.set('event_token_forced_set', '1');\n clearInterval(tokenCheckerIntervalId);\n } else {\n }\n }, 1000);\n}\n\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n document.addEventListener('gform_page_loaded', function() {\n if (\n typeof ctPublic.force_alt_cookies === 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n if (typeof setEventTokenField === 'function' && typeof botDetectorLocalStorage === 'function') {\n setEventTokenField(botDetectorLocalStorage.get('bot_detector_event_token'));\n }\n }\n });\n if ( ! ctPublic.wc_ajax_add_to_cart ) {\n apbctCheckAddToCartByGet();\n }\n\n apbctPrepareBlockForAjaxForms();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n if (ctPublic.data__cookies_type !== 'alternative') {\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n }\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( ctIsDrawPixel() ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if ( +ctPublic.data__email_check_exist_post) {\n initCookies.push(['ct_checked_emails_exist', '0']);\n apbct('comment-form input[name = \\'email\\'], input#email').on('blur', checkEmailExist);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n let tokenForForceAlt = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n ctPublic.settings__data__bot_detector_enabled\n ) {\n apbctLocalStorage.set('event_token_forced_set', '0');\n if (tokenForForceAlt) {\n initCookies.push(['ct_bot_detector_event_token', tokenForForceAlt]);\n apbctLocalStorage.set('event_token_forced_set', '1');\n } else {\n startForcedAltEventTokenChecker();\n }\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n ctAddWCMiddlewares();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n + ctPublic.settings__forms__search_test === 1 &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n // fibosearch integration\n if (_form.querySelector('input.dgwt-wcas-search-input')) {\n continue;\n }\n\n // this handles search forms onsubmit process\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n\n // Check any XMLHttpRequest connections\n apbctCatchXmlHttpRequest();\n\n // Init form skin\n if (ctPublic.settings__comments__form_decoration) {\n new ApbctFormDecorator();\n }\n\n // Set important paramaters via ajax if problematic cache solutions found\n apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists || ctPublic.varnishCacheExists);\n\n // Checking that the bot detector has loaded and received the event token for Anti-Crawler\n if (ctPublic.settings__sfw__anti_crawler) {\n checkBotDetectorExist();\n }\n}\n\n/**\n * Checking that the bot detector has loaded and received the event token\n */\nfunction checkBotDetectorExist() {\n if (ctPublic.settings__data__bot_detector_enabled) {\n const botDetectorIntervalSearch = setInterval(() => {\n let botDetectorEventToken = localStorage.bot_detector_event_token ? true : false;\n\n if (botDetectorEventToken) {\n ctSetCookie('apbct_bot_detector_exist', '1', '3600');\n clearInterval(botDetectorIntervalSearch);\n }\n }, 500);\n }\n}\n\n/**\n * Insert no_cookies_data to rest request\n */\nfunction ctAddWCMiddlewares() {\n const ctPinDataToRequest = (options, next) => {\n if (typeof options !== 'object' || options === null ||\n !options.hasOwnProperty('data') || !options.hasOwnProperty('path')\n ) {\n return next(options);\n }\n\n // add to cart\n if (options.data.hasOwnProperty('requests') &&\n options.data.requests.length > 0 &&\n options.data.requests[0].hasOwnProperty('path') &&\n options.data.requests[0].path === '/wc/store/v1/cart/add-item'\n ) {\n options.data.requests[0].data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n // checkout\n if (options.path === '/wc/store/v1/checkout') {\n options.data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n return next(options);\n };\n\n if (window.hasOwnProperty('wp') &&\n window.wp.hasOwnProperty('apiFetch') &&\n typeof window.wp.apiFetch.use === 'function'\n ) {\n window.wp.apiFetch.use(ctPinDataToRequest);\n }\n}\n\n/**\n * Insert event_token and no_cookies_data to some ajax request\n */\nfunction apbctCatchXmlHttpRequest() {\n // 1) Check the page if it needed to catch XHR\n if ( document.querySelector('div.wfu_container') !== null ) {\n const originalSend = XMLHttpRequest.prototype.send;\n XMLHttpRequest.prototype.send = function(body) {\n // 2) Check the caught request fi it needed to modify\n if (\n body &&\n typeof body === 'string' &&\n (\n body.indexOf('action=wfu_ajax_action_ask_server') !== -1\n )\n ) {\n let addidionalCleantalkData = '';\n let eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (\n eventToken !== null &&\n eventToken !== false &&\n eventToken.hasOwnProperty('value') &&\n eventToken.value !== ''\n ) {\n eventToken = eventToken.value;\n addidionalCleantalkData += '&' + 'data%5Bct_bot_detector_event_token%5D=' + eventToken;\n }\n\n let noCookieData = getNoCookieData();\n addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData;\n\n body += addidionalCleantalkData;\n\n return originalSend.apply(this, [body]);\n }\n return originalSend.apply(this, [body]);\n };\n }\n}\n\n/**\n * Run AJAX to set important_parameters on the site backend if problematic cache solutions are defined.\n * @param {boolean} cacheExist\n */\nfunction apbctAjaxSetImportantParametersOnCacheExist(cacheExist) {\n // Set important parameters via ajax\n if ( cacheExist ) {\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST('apbct_set_important_parameters', {});\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX({action: 'apbct_set_important_parameters'}, {});\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n // this is the only place where we can found hard dependency on jQuery, if the form use it - the script\n // will work independing if jQuery is loaded by CleanTalk or not\n let eventToken = false;\n if ( typeof jQuery !== 'undefined' && typeof jQuery.ajaxSetup === 'function') {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n\n if (settings.data.indexOf('action=new_activity_comment') !== -1) {\n sourceSign = 'action=new_activity_comment';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n if (localStorage.getItem('bot_detector_event_token') !== null) {\n eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (eventToken !== false && eventToken.hasOwnProperty('value') && eventToken.value !== '') {\n eventToken = eventToken.value;\n }\n }\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n if (typeof eventToken === 'string') {\n eventToken = 'data%5Bct_bot_detector_event_token%5D=' + eventToken + '&';\n } else {\n eventToken = '';\n }\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n\n settings.data = noCookieData + eventToken + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {object} targetForm\n */\nfunction ctSearchFormOnSubmitHandler(e, targetForm) {\n try {\n // get honeypot field and it's value\n const honeyPotField = targetForm.querySelector('[id*=\"apbct__email_id__\"]');\n let hpValue = null;\n let hpEventId = null;\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n // get cookie data from storages\n let cleantalkStorageDataArray = getCleanTalkStorageDataArray();\n\n // get event token from storage\n let eventTokenLocalStorage = apbctLocalStorage.get('bot_detector_event_token');\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( cleantalkStorageDataArray !== null || honeyPotField !== null || eventTokenLocalStorage !== null ) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n if (typeof targetForm.apbctSearchPrevOnsubmit === 'function') {\n targetForm.apbctSearchPrevOnsubmit();\n } else {\n HTMLFormElement.prototype.submit.call(targetForm);\n }\n };\n\n let cookiesArray = cleantalkStorageDataArray;\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // set event token\n cookiesArray.ct_bot_detector_event_token = eventTokenLocalStorage;\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n // data to JSON\n const parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( typeof parsedCookies !== 'undefined' && parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctPublic.wl_brandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n let email = currentResultData.decoded_email.split(/[&?]/)[0];\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n if (firstNode) {\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNodes, result);\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNodes, decodingResult) {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML = baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n\n encodedEmailNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedEmailNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if ( typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n\n let noCookieData = getCleanTalkStorageDataArray();\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * Retrieves the clentalk \"cookie\" data from starages.\n * Contains {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration}.\n * @return {string}\n */\nfunction getCleanTalkStorageDataArray() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieDataFromDecoration = {form_decoration_mouse_data: []};\n if (document.ctFormDecorationMouseData) {\n let formDecorationMouseData = JSON.parse(JSON.stringify(document.ctFormDecorationMouseData));\n if (formDecorationMouseData.mouseMovements) {\n delete formDecorationMouseData.mouseMovements;\n }\n noCookieDataFromDecoration = {form_decoration_mouse_data: formDecorationMouseData};\n }\n return {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration};\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n const formAction = typeof(form.action) == 'string' ? form.action : '';\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n // Super WooCommerce Product Filter\n if (form.classList.contains('swpf-instant-filtering')) {\n return true;\n }\n // PayU 3-rd party service forms\n if (formAction.indexOf('secure.payu.com') !== -1 ) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n/**\n * WooCommerce add to cart by GET request params collecting\n */\nfunction apbctCheckAddToCartByGet() {\n // 1) Collect all links with add_to_cart_button class\n document.querySelectorAll('a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)').forEach((el) => {\n el.addEventListener('click', function(e) {\n let href = el.getAttribute('href');\n // 2) Add to href attribute additional parameter ct_bot_detector_event_token gathered from apbctLocalStorage\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if ( eventToken ) {\n if ( href.indexOf('?') === -1 ) {\n href += '?';\n } else {\n href += '&';\n }\n href += 'ct_bot_detector_event_token=' + eventToken;\n el.setAttribute('href', href);\n }\n });\n });\n}\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n\n/**\n * Handle external forms\n */\nfunction ctProtectExternal() {\n for (let i = 0; i < document.forms.length; i++) {\n if (document.forms[i].cleantalk_hidden_action === undefined &&\n document.forms[i].cleantalk_hidden_method === undefined) {\n // current form\n const currentForm = document.forms[i];\n\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n\n // Ajax checking for the integrated forms - will be changed the whole form object to make protection\n if ( isIntegratedForm(currentForm) ) {\n apbctProcessExternalForm(currentForm, i, document);\n\n // Ajax checking for the integrated forms - will be changed only submit button to make protection\n } else if (\n // MooForm 3rd party service\n currentForm.dataset.mailingListId !== undefined ||\n (typeof(currentForm.action) == 'string' &&\n (currentForm.action.indexOf('webto.salesforce.com') !== -1)) ||\n (typeof(currentForm.action) == 'string' &&\n currentForm.querySelector('[href*=\"activecampaign\"]'))\n ) {\n apbctProcessExternalFormByFakeButton(currentForm, i, document);\n // Common flow - modify form's action\n } else if (\n typeof(currentForm.action) == 'string' &&\n ( currentForm.action.indexOf('http://') !== -1 ||\n currentForm.action.indexOf('https://') !== -1 )\n ) {\n let tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n const host = tmp[0].toLowerCase();\n\n if (host !== location.hostname.toLowerCase()) {\n const ctAction = document.createElement('input');\n ctAction.name = 'cleantalk_hidden_action';\n ctAction.value = currentForm.action;\n ctAction.type = 'hidden';\n currentForm.appendChild(ctAction);\n\n const ctMethod = document.createElement('input');\n ctMethod.name = 'cleantalk_hidden_method';\n ctMethod.value = currentForm.method;\n ctMethod.type = 'hidden';\n\n currentForm.method = 'POST';\n\n currentForm.appendChild(ctMethod);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n // Trying to process external form into an iframe\n apbctProcessIframes();\n // if form is still not processed by fields listening, do it here\n ctStartFieldsListening();\n}\n\n/**\n * Exclusion forms\n * @param {HTMLElement} currentForm\n * @return {boolean}\n */\nfunction formIsExclusion(currentForm) {\n const exclusionsById = [\n 'give-form', // give form exclusion because of direct integration\n 'frmCalc', // nobletitle-calc\n 'ihf-contact-request-form',\n 'wpforms', // integration with wpforms\n ];\n\n const exclusionsByRole = [\n 'search', // search forms\n ];\n\n const exclusionsByClass = [\n 'search-form', // search forms\n 'hs-form', // integrated hubspot plugin through dynamicRenderedForms logic\n 'ihc-form-create-edit', // integrated Ultimate Membership Pro plugin through dynamicRenderedForms logic\n 'nf-form-content', // integration with Ninja Forms for js events\n 'elementor-form', // integration with elementor-form\n 'wpforms', // integration with wpforms\n 'et_pb_searchform', // integration with elementor-search-form\n ];\n\n const exclusionsByAction = [\n 'paypal.com/cgi-bin/webscr', // search forms\n ];\n\n let result = false;\n\n try {\n // mewto forms exclusion\n if (currentForm.parentElement &&\n currentForm.parentElement.classList.length > 0 &&\n currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1) {\n result = true;\n }\n\n if (currentForm.getAttribute('action') !== null) {\n exclusionsByAction.forEach(function(exclusionAction) {\n if (currentForm.getAttribute('action').indexOf(exclusionAction) !== -1) {\n result = true;\n }\n });\n }\n\n exclusionsById.forEach(function(exclusionId) {\n const formId = currentForm.getAttribute('id');\n if ( formId !== null && typeof (formId) !== 'undefined' && formId.indexOf(exclusionId) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByClass.forEach(function(exclusionClass) {\n let foundClass = '';\n if (currentForm.getAttribute('class')) {\n foundClass = currentForm.getAttribute('class');\n } else {\n foundClass = apbctGetFormClass(currentForm, exclusionClass);\n }\n const formClass = foundClass;\n if ( formClass !== null && typeof formClass !== 'undefined' && formClass.indexOf(exclusionClass) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByRole.forEach(function(exclusionRole) {\n const formRole = currentForm.getAttribute('id');\n if ( formRole !== null && typeof formRole !== 'undefined'&& formRole.indexOf(exclusionRole) !== -1 ) {\n result = true;\n }\n });\n } catch (e) {\n console.table('APBCT ERROR: formIsExclusion() - ', e);\n }\n\n return result;\n}\n\n/**\n * Gets the form class if it is not in
\n * @param {HTMLElement} currentForm\n * @param {string} exclusionClass\n * @return {string}\n */\nfunction apbctGetFormClass(currentForm, exclusionClass) {\n if (typeof(currentForm) == 'object' && currentForm.querySelector('.' + exclusionClass)) {\n return exclusionClass;\n }\n}\n\n/**\n * Handle external forms in iframes\n */\nfunction apbctProcessIframes() {\n const frames = document.getElementsByTagName('iframe');\n\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) {\n continue;\n }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n const currentForm = iframeForms[y];\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n const cleantalkPlaceholder = document.createElement('i');\n cleantalkPlaceholder.className = 'cleantalk_placeholder';\n cleantalkPlaceholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalkPlaceholder, currentForm);\n\n // Deleting form to prevent submit event\n const prev = currentForm.previousSibling;\n const formHtml = currentForm.outerHTML;\n const formOriginal = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement('div');\n placeholder.innerHTML = formHtml;\n prev.after(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = formOriginal;\n\n // mailerlite integration - disable click on submit button\n let mailerliteDetectedClass = false;\n if (reUseCurrentForm.classList !== undefined) {\n // list there all the mailerlite classes\n const mailerliteClasses = ['newsletterform', 'ml-block-form'];\n mailerliteClasses.forEach(function(mailerliteClass) {\n if (reUseCurrentForm.classList.contains(mailerliteClass)) {\n mailerliteDetectedClass = mailerliteClass;\n }\n });\n }\n\n let mailerliteSubmitButton = null;\n if ( mailerliteDetectedClass ) {\n mailerliteSubmitButton = reUseCurrentForm.querySelector('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== null && mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.addEventListener('click', function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(reUseCurrentForm);\n });\n }\n return;\n }\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Process external forms via fake button replacing\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormByFakeButton(currentForm, iterator, documentObject) {\n const submitButtonOriginal = currentForm.querySelector('[type=\"submit\"]');\n const onsubmitOriginal = currentForm.querySelector('[type=\"submit\"]').form.onsubmit;\n\n if ( ! submitButtonOriginal ) {\n return;\n }\n\n const parent = submitButtonOriginal.parentElement;\n const submitButtonHtml = submitButtonOriginal.outerHTML;\n\n // Remove the original submit button\n submitButtonOriginal.remove();\n\n // Insert a clone of the submit button\n const placeholder = document.createElement('div');\n placeholder.innerHTML = submitButtonHtml;\n parent.appendChild(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctParent = parent;\n reUseCurrentForm.submitButtonOriginal = submitButtonOriginal;\n reUseCurrentForm.onsubmitOriginal = onsubmitOriginal;\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n\n // MooSend spinner activate\n apbctMoosendSpinnerToggle(event.currentTarget);\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Activate or deactivate spinner for Moosend form during request checking\n * @param {HTMLElement} form\n */\nfunction apbctMoosendSpinnerToggle(form) {\n const buttonElement = form.querySelector('button[type=\"submit\"]');\n if ( buttonElement ) {\n const spinner = buttonElement.querySelector('i');\n const submitText = buttonElement.querySelector('span');\n if (spinner && submitText) {\n if ( spinner.style.zIndex == 1 ) {\n submitText.style.opacity = 1;\n spinner.style.zIndex = -1;\n spinner.style.opacity = 0;\n } else {\n submitText.style.opacity = 0;\n spinner.style.zIndex = 1;\n spinner.style.opacity = 1;\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} formSource\n * @param {HTMLElement} formTarget\n */\nfunction apbctReplaceInputsValuesFromOtherForm(formSource, formTarget) {\n const inputsSource = formSource.querySelectorAll('button, input, textarea, select');\n const inputsTarget = formTarget.querySelectorAll('button, input, textarea, select');\n\n if (formSource.outerHTML.indexOf('action=\"https://www.kulahub.net') !== -1 ||\n isFormHasDiviRedirect(formSource) ||\n formSource.outerHTML.indexOf('class=\"et_pb_contact_form') !== -1\n ) {\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.name === elemTarget.name) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n\n return;\n }\n\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.outerHTML === elemTarget.outerHTML) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n}\n// clear protected iframes list\napbctLocalStorage.set('apbct_iframes_protected', []);\nwindow.addEventListener('load', function() {\n if ( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n setTimeout(function() {\n ctProtectExternal();\n catchDynamicRenderedForm();\n catchNextendSocialLoginForm();\n ctProtectOutsideIframe();\n }, 2000);\n\n ctProtectKlaviyoForm();\n});\n\n/**\n * Protect klaviyo forms\n */\nfunction ctProtectKlaviyoForm() {\n if (!document.querySelector('link[rel=\"dns-prefetch\"][href=\"//static.klaviyo.com\"]')) {\n return;\n }\n\n let i = setInterval(() => {\n const klaviyoForms = document.querySelectorAll('form.klaviyo-form');\n if (klaviyoForms.length) {\n clearInterval(i);\n klaviyoForms.forEach((form, index) => {\n apbctProcessExternalFormKlaviyo(form, index, document);\n });\n }\n }, 500);\n}\n\n/**\n * Protect klaviyo forms\n * @param {HTMLElement} form\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormKlaviyo(form, iterator, documentObject) {\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (!btn) {\n return;\n }\n btn.disabled = true;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n let cover = document.createElement('div');\n cover.id = 'apbct-klaviyo-cover';\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.style.cursor = 'pointer';\n cover.onclick = function(e) {\n sendAjaxCheckingFormData(form);\n };\n btn.parentNode.style.position = 'relative';\n btn.parentNode.appendChild(cover);\n}\n\n/**\n * Protect forms placed in iframe with outside src\n */\nfunction ctProtectOutsideIframe() {\n let iframes = document.querySelectorAll('iframe');\n if (iframes.length > 0) {\n iframes.forEach(function(iframe) {\n if (iframe.src.indexOf('form.typeform.com') !== -1 ||\n iframe.src.indexOf('forms.zohopublic.com') !== -1 ||\n iframe.src.indexOf('link.surepathconnect.com') !== -1 ||\n iframe.src.indexOf('hello.dubsado.com') !== -1 ||\n iframe.classList.contains('hs-form-iframe') ||\n ( iframe.src.indexOf('facebook.com') !== -1 && iframe.src.indexOf('plugins/comments.php') !== -1)\n ) {\n // pass if is already protected\n if (false !== apbctLocalStorage.get('apbct_iframes_protected') &&\n apbctLocalStorage.get('apbct_iframes_protected').length > 0 &&\n typeof iframe.id !== 'undefined' &&\n apbctLocalStorage.get('apbct_iframes_protected').indexOf[iframe.id] !== -1\n ) {\n return;\n }\n ctProtectOutsideIframeHandler(iframe);\n }\n });\n }\n}\n\nlet ctProtectOutsideIframeCheck;\n/**\n * Protect forms placed in iframe with outside src handler\n * @param {HTMLElement} iframe\n */\nfunction ctProtectOutsideIframeHandler(iframe) {\n let cover = document.createElement('div');\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.onclick = function(e) {\n if (ctProtectOutsideIframeCheck === undefined) {\n let currentDiv = e.currentTarget;\n currentDiv.style.opacity = 0.5;\n let preloader = document.createElement('div');\n preloader.className = 'apbct-iframe-preloader';\n currentDiv.appendChild(preloader);\n let botDetectorToken = '';\n if (document.querySelector('[name*=\"ct_bot_detector_event_token\"]')) {\n botDetectorToken = document.querySelector('[name*=\"ct_bot_detector_event_token\"]').value;\n }\n\n let data = {\n 'action': 'cleantalk_outside_iframe_ajax_check',\n 'ct_no_cookie_hidden_field': getNoCookieData(),\n 'ct_bot_detector_event_token': botDetectorToken,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n ctProtectOutsideIframeCheck = true;\n if (result.apbct.blocked === false) {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach(function(el) {\n el.parentNode.remove();\n });\n } else {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.parentNode.style.color = 'white';\n el.parentNode.innerHTML += result.apbct.comment;\n });\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.remove();\n });\n }\n },\n },\n );\n }\n };\n iframe.parentNode.style.position = 'relative';\n iframe.parentNode.appendChild(cover);\n let iframes = apbctLocalStorage.get('apbct_iframes_protected');\n if (false === iframes) {\n iframes = [];\n }\n if (typeof iframe.id !== 'undefined') {\n iframes.push(iframe.id);\n apbctLocalStorage.set('apbct_iframes_protected', iframes);\n }\n}\n\n/**\n * Catch NSL form integration\n */\nfunction catchNextendSocialLoginForm() {\n let blockNSL = document.getElementById('nsl-custom-login-form-main');\n if (blockNSL) {\n blockBtnNextendSocialLogin(blockNSL);\n }\n}\n\n/**\n * Blocking NSL plugin buttons\n * @param {HTMLElement} blockNSL\n */\nfunction blockBtnNextendSocialLogin(blockNSL) {\n let parentBtnsNSL = blockNSL.querySelectorAll('.nsl-container-buttons a');\n let childBtnsNSL = blockNSL.querySelectorAll('a[data-plugin=\"nsl\"] .nsl-button');\n parentBtnsNSL.forEach((el) => {\n el.setAttribute('data-oauth-login-blocked', 'true');\n el.addEventListener('click', (event) => {\n event.preventDefault();\n });\n });\n childBtnsNSL.forEach((el) => {\n el.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n ctCheckAjax(el);\n });\n });\n}\n\n/**\n * Unlocking the button and clicking on it after an ajax response\n * @param {HTMLElement} childBtn\n */\nfunction allowAjaxNextendSocialLogin(childBtn) {\n childBtn.parentElement.setAttribute('data-oauth-login-blocked', 'false');\n childBtn.parentElement.click();\n}\n\n/**\n * Locking the button and entering a message after an ajax response\n * @param {HTMLElement} childBtn\n * @param {string} msg\n */\nfunction forbiddenAjaxNextendSocialLogin(childBtn, msg) {\n let parentElement = childBtn.parentElement;\n if (parentElement.getAttribute('data-oauth-login-blocked') == 'false') {\n parentElement.setAttribute('data-oauth-login-blocked', 'true');\n }\n if (!document.querySelector('.ct-forbidden-msg')) {\n let elemForMsg = document.createElement('div');\n elemForMsg.className = 'ct-forbidden-msg';\n elemForMsg.style.background = 'red';\n elemForMsg.style.color = 'white';\n elemForMsg.style.padding = '5px';\n elemForMsg.innerHTML = msg;\n parentElement.insertAdjacentElement('beforebegin', elemForMsg);\n }\n}\n\n/**\n * User verification using user data and ajax\n * @param {HTMLElement} elem\n */\nfunction ctCheckAjax(elem) {\n let data = {\n 'action': 'cleantalk_nsl_ajax_check',\n 'ct_no_cookie_hidden_field': document.getElementsByName('ct_no_cookie_hidden_field')[0].value,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if (result.apbct.blocked === false) {\n allowAjaxNextendSocialLogin(elem);\n } else {\n forbiddenAjaxNextendSocialLogin(elem, result.apbct.comment);\n }\n },\n },\n );\n}\n\n/**\n * Checking the form integration\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isIntegratedForm(formObj) {\n const formAction = typeof(formObj.action) == 'string' ? formObj.action : '';\n const formId = formObj.getAttribute('id') !== null ? formObj.getAttribute('id') : '';\n\n if (\n (\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n formAction.indexOf('app.kit.com') !== -1 // ConvertKit new form\n ) ||\n ( formObj.firstChild.classList !== undefined &&\n formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1 ||\n formId.indexOf('ihf-contact-request-form') !== -1 ||\n formAction.indexOf('crm.zoho.com') !== -1 ||\n formId.indexOf('delivra-external-form') !== -1 ||\n // todo Return to Hubspot for elementor in the future, disabled of reason https://doboard.com/1/task/9227\n // ( formObj.classList !== undefined &&\n // !formObj.classList.contains('woocommerce-checkout') &&\n // formObj.hasAttribute('data-hs-cf-bound')\n // ) || // Hubspot integration in Elementor form// Hubspot integration in Elementor form\n formAction.indexOf('eloqua.com') !== -1 || // Eloqua integration\n formAction.indexOf('kulahub.net') !== -1 || // Kulahub integration\n isFormHasDiviRedirect(formObj) || // Divi contact form\n formAction.indexOf('eocampaign1.com') !== -1 || // EmailOctopus Campaign form\n formAction.indexOf('wufoo.com') !== -1 || // Wufoo form\n ( formObj.classList !== undefined &&\n formObj.classList.contains('sp-element-container') ) // Sendpulse form\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * This function detect if the form has DIVI redirect. If so, the form will work as external.\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isFormHasDiviRedirect(formObj) {\n let result = false;\n const diviRedirectedSignSet = document.querySelector('div[id^=\"et_pb_contact_form\"]');\n if (\n typeof formObj === 'object' && formObj !== null &&\n diviRedirectedSignSet !== null &&\n diviRedirectedSignSet.hasAttribute('data-redirect_url') &&\n diviRedirectedSignSet.getAttribute('data-redirect_url') !== '' &&\n diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]') !== null\n ) {\n result = formObj === diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]');\n }\n return result;\n}\n\n/**\n * Sending Ajax for checking form data\n * @param {HTMLElement} form\n * @param {HTMLElement} prev\n * @param {HTMLElement} formOriginal\n */\nfunction sendAjaxCheckingFormData(form) {\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visibleFields );\n\n const data = {\n 'ct_bot_detector_event_token': apbctLocalStorage.get('bot_detector_event_token'),\n };\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ) {\n // MooSend spinner deactivate\n apbctMoosendSpinnerToggle(form);\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Klaviyo integration\n if (form.classList !== undefined && form.classList.contains('klaviyo-form')) {\n const cover = document.getElementById('apbct-klaviyo-cover');\n if (cover) {\n cover.remove();\n }\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (btn) {\n btn.disabled = false;\n btn.click();\n }\n return;\n }\n\n // MooSend integration\n if ( form.dataset.mailingListId !== undefined ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Salesforce integration\n if (form.hasAttribute('action') &&\n (form.getAttribute('action').indexOf('webto.salesforce.com') !== -1)\n ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Active Campaign integration\n if (form.querySelector('[href*=\"activecampaign\"]')) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n const formNew = form;\n form.parentElement.removeChild(form);\n const prev = form.apbctPrev;\n const formOriginal = form.apbctFormOriginal;\n let mauticIntegration = false;\n\n apbctReplaceInputsValuesFromOtherForm(formNew, formOriginal);\n\n // mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mauticIntegration = true;\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n for (const el of formOriginal.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n\n for (const el of formOriginal.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n\n // Common click event\n let submButton = formOriginal.querySelectorAll('button[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n if (mauticIntegration) {\n setTimeout(function() {\n ctProtectExternal();\n }, 1500);\n }\n return;\n }\n\n submButton = formOriginal.querySelectorAll('input[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // ConvertKit direct integration\n submButton = formOriginal.querySelectorAll('button[data-element=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // Paypal integration\n submButton = formOriginal.querySelectorAll('input[type=\"image\"][name=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n }\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Handle dynamic rendered form\n */\nfunction catchDynamicRenderedForm() {\n const forms = document.getElementsByTagName('form');\n\n catchDynamicRenderedFormHandler(forms);\n\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n\n if ( iframeForms.length === 0 ) {\n return;\n }\n\n catchDynamicRenderedFormHandler(iframeForms, frames[j].contentDocument);\n }\n }\n}\n\n/**\n * Handles dynamic rendered forms by attaching an onsubmit event handler to them.\n *\n * @param {HTMLCollection} forms - A collection of form elements to be processed.\n * @param {Document} [documentObject=document] - The document object to use for querying elements.\n */\nfunction catchDynamicRenderedFormHandler(forms, documentObject = document) {\n const neededFormIds = [];\n for (const form of forms) {\n const formIdAttr = form.getAttribute('id');\n if (formIdAttr && formIdAttr.indexOf('hsForm') !== -1) {\n neededFormIds.push(formIdAttr);\n }\n if (formIdAttr && formIdAttr.indexOf('createuser') !== -1 &&\n (form.classList !== undefined && form.classList.contains('ihc-form-create-edit'))\n ) {\n neededFormIds.push(formIdAttr);\n }\n }\n\n for (const formId of neededFormIds) {\n const form = documentObject.getElementById(formId);\n form.apbct_external_onsubmit_prev = form.onsubmit;\n form.onsubmit = sendAjaxCheckingDynamicFormData;\n }\n}\n\n/**\n * Sending Ajax for checking form data on dynamic rendered form\n * @param {HTMLElement} form\n */\nfunction sendAjaxCheckingDynamicFormData(form) {\n form.preventDefault();\n form.stopImmediatePropagation();\n const formEvent = form;\n form = form.target;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie(visibleFields);\n form.append(ctNoCookieConstructHiddenField('hidden'));\n\n const data = {};\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n form.onsubmit = null;\n\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Call previous submit action\n if (form.apbct_external_onsubmit_prev instanceof Function) {\n let timerId = setTimeout(function() {\n form.apbct_external_onsubmit_prev.call(form, formEvent);\n }, 500);\n clearTimeout(timerId);\n }\n\n const submButton = form.querySelector('input[type=\"submit\"]');\n if (submButton) {\n submButton.click();\n return;\n }\n }\n\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Implement jQuery val() function\n * @param {HTMLElement} el\n * @return {HTMLElements}\n */\nfunction apbctVal(el) {\n if (el.options && el.multiple) {\n return el.options\n .filter((option) => option.selected)\n .map((option) => option.value);\n } else if (el.type === 'checkbox' || el.type === 'radio') {\n return el.checked ? el.checked : null;\n } else {\n return el.value;\n }\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","getAttribute","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","ctJsErrors","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","selectActualNonce","defaultNonce","ctPublicFunctions","hasOwnProperty","_fresh_nonce","data__ajax_type","_ajax_nonce","_rest_nonce","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","prepare","keys","deleteDoubleJSONEncoding","convertData","console","open","setHeaders","onreadystatechange","isWpNonceError","getFreshNonceAndRerunXHR","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","restErrror","ajaxErrror","readyState","initialRequestParams","noncePrev","spbc_remote_call_action","plugin_name","nonce_prev","initial_request_params","notJson","host_url","freshNonceResult","newRequestParams","undefined","wpnonce","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","_rest_url","route","nonce","X-WP-Nonce","defineProperty","property","enumerable","configurable","writable","ApbctFormDecorator","getElements","setListeners","regexId","regexClass","matchingElements","setDecorationBackground","from","test","element","id","forEach","flagLeft","flagRight","flagWrap","blockForms","classHeaderWrapper","endPosition","classTemplate","substring","blockForm","clickX","flagLeftWidth","flagLeftHeight","flagRightWidth","flagRightHeight","offsetX","clickY","offsetY","parseFloat","width","height","addClicks","getSelection","addSelected","mouseX","mouseY","trackMouseMovement","ctFormDecorationMouseData","clicks","selected","firstMovement","timeDiff","mouseMovements","timestamp","now","index","lastMovement","hovering","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","item","apbctLocalStorage","set","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","encodeURIComponent","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bloomPopup","pafeFormsFormElementor","otterForm","bookingPress","isArray","getJavascriptClientData","e","apbct_site_referer","apbct_force_alt_cookies","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","beforeSend","ctGetCookie","matches","RegExp","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","no_cache","apbctGenerateUniqueID","substr","get","storageValue","json","isJson","objToSave","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","apbctForceProtect","ApbctForceProtection","data__key_is_ok","apbct_attach_event_handler","wrappers","findWrappers","checkBot","event_javascript_data","post_url","referrer","checkBotCallback","result","decodeForms","allow","showMessageForBot","form","wrapper","dataset","encodedForm","outerHTML","atob","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctCheckedEmailsExist","ctMouseReadInterval","ctMouseWriteDataInterval","tokenCheckerIntervalId","botDetectorLogLastUpdate","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__bot_detector_enabled","sendBotDetectorLogToAltSessions","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","interval","currentLog","log_last_update","token","doAttach","getElementsByClassName","getElementById","setEventTokenField","clearInterval","checkEmail","currentEmail","email","checkEmailExist","hint","getResultCheckEmailExist","viewCheckEmailExist","envelope","text_result","state","textResult","inputEmail","top","getBoundingClientRect","left","right","offsetHeight","envelopeWidth","offsetWidth","onmouseover","textContent","color","onmouseout","ctIsDrawPixel","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","startForcedAltEventTokenChecker","eventToken","apbct_ready","botDetectorLocalStorage","wc_ajax_add_to_cart","apbctCheckAddToCartByGet","sessionID","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","data__email_check_exist_post","tokenForForceAlt","encodedEmailNodes","settings__data__bot_detector_enabled","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","ctAddWCMiddlewares","hiddenInput","visibleFieldsToInput","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","ctFillDecodedEmailHandler","_form","settings__forms__search_test","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","apbctCatchXmlHttpRequest","settings__comments__form_decoration","apbctAjaxSetImportantParametersOnCacheExist","advancedCacheExists","varnishCacheExists","settings__sfw__anti_crawler","checkBotDetectorExist","botDetectorIntervalSearch","bot_detector_event_token","wp","apiFetch","use","options","next","requests","path","ct_no_cookie_hidden_field","originalSend","addidionalCleantalkData","apply","cacheExist","ajaxSetup","sourceSign","contains","targetForm","honeyPotField","hpValue","hpEventId","callBack","parsedCookies","cleantalkStorageDataArray","getCleanTalkStorageDataArray","eventTokenLocalStorage","preventDefault","parentNode","HTMLFormElement","submit","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","ct_bot_detector_event_token","warn","encodedEmailNodesIsMixed","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","innerHTML","wl_brandname","waitingPopup","popupHeader","innerText","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","animationElements","animationWrapper","apbctEEAnimationDogOne","clickSource","encodedEmails","encodedEmailsCollection","apbctTooltip","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","popup","currentResultData","row","encoded_email","decoded_email","firstNode","selectableEmail","title","secondNode","buttonWrapper","fillDecodedEmails","click","comment","decodingResult","encodedEmail","baseElementContent","encodedEmailTextInsideMailto","el","ctProcessDecodedDataResult","commonCookies","resultDataJson","ct_checked_emails","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_headless","ct_bot_detector_frontend_data_log","apbct_page_hits","apbct_prev_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","popupText","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","formDecorationMouseData","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","noCookieDataFromDecoration","form_decoration_mouse_data","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","hiddenFieldType","formAction","j","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","ignoreURLConvert","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","ctProtectExternal","cleantalk_hidden_action","cleantalk_hidden_method","ctMethod","currentForm","formIsExclusion","isIntegratedForm","apbctProcessExternalForm","mailingListId","apbctProcessExternalFormByFakeButton","tmp","hostname","ctAction","appendChild","apbctProcessIframes","exclusionAction","exclusionId","exclusionClass","foundClass","formClass","apbctGetFormClass","exclusionRole","formRole","table","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalkPlaceholder","prev","insertBefore","previousSibling","formHtml","formOriginal","placeholder","forceAction","firstElementChild","reUseCurrentForm","mailerliteDetectedClass","apbctPrev","apbctFormOriginal","mailerliteClass","mailerliteSubmitButton","sendAjaxCheckingFormData","currentTarget","submitButtonOriginal","onsubmitOriginal","submitButtonHtml","apbctParent","apbctMoosendSpinnerToggle","buttonElement","submitText","zIndex","apbctReplaceInputsValuesFromOtherForm","formSource","formTarget","inputsSource","inputsTarget","isFormHasDiviRedirect","elemSource","elemTarget","checked","apbctVal","ctProtectKlaviyoForm","klaviyoForms","apbctProcessExternalFormKlaviyo","cover","btn","disabled","onclick","ctProtectOutsideIframe","iframes","iframe","src","ctProtectOutsideIframeHandler","ctTrpLocalize","ctTrpIsAdminCommentsList","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","trpComments","learnMoreLink","trpLayout","trpImage","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","nextElementSibling","clearTimeout","selection","onSelectionChange","settings__forms__check_external","catchDynamicRenderedForm","catchNextendSocialLoginForm","ctProtectOutsideIframeCheck","currentDiv","preloader","botDetectorToken","blockNSL","blockBtnNextendSocialLogin","parentBtnsNSL","childBtnsNSL","ctCheckAjax","allowAjaxNextendSocialLogin","childBtn","forbiddenAjaxNextendSocialLogin","elemForMsg","insertAdjacentElement","getElementsByName","formObj","firstChild","diviRedirectedSignSet","elems","submitButton","formNew","mauticIntegration","submButton","catchDynamicRenderedFormHandler","neededFormIds","formIdAttr","apbct_external_onsubmit_prev","sendAjaxCheckingDynamicFormData","stopImmediatePropagation","formEvent","timerId","multiple","option","map"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACvB,UAApB,OAAOA,GACfM,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAS,GAAKD,GACS,UAApB,OAAOA,GACfM,KAAKN,SAAWA,EAChBM,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBd,CAAQ,CAAC,GAG9EM,KAAKS,SAAS,EAGXT,IACX,CAKAU,WAAWC,GACmB,UAArB,OAAOA,EACRX,KAAKL,SAASiB,KAAKD,CAAS,EACC,UAArB,OAAOA,GACfX,KAAKN,SAAWiB,EAChBX,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBG,CAAS,CAAC,GAE/EX,KAAKS,SAAS,CAEtB,CAKAG,KAAKC,GACDb,KAAKL,SAASiB,KAAKC,CAAI,CAC3B,CAKAC,SACId,KAAKL,SAAWK,KAAKL,SAASU,MAAM,EAAG,CAAC,CAAC,CAC7C,CAKAI,WACIT,KAAKL,SAAW,EACpB,CA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EAAOvP,MAAMujB,QAAU,CACzD5T,EAAKsJ,SAAW,KAGhB,IAAK,IAAMoG,KAAM1P,EAAKjY,iBAAiB,oCAAoC,EACvE2nB,EAAG3lB,OAAO,EAEd,IAAK,IAAM2lB,KAAM1P,EAAKjY,iBAAiB,2CAA2C,EAC9E2nB,EAAG3lB,OAAO,EAEd,IAAK,IAAM2lB,KAAM1P,EAAKjY,iBAAiB,yCAAyC,EAC5E2nB,EAAG3lB,OAAO,EAIViW,EAAKkgB,wCAAwCrW,WACzCyW,EAAU1yB,WAAW,WACrBoS,EAAKkgB,6BAA6Br4B,KAAKmY,EAAMqgB,CAAS,CAC1D,EAAG,GAAG,EACNnC,aAAaoC,CAAO,GAJxB,IAOMR,EAAa9f,EAAKnV,cAAc,sBAAsB,EAC5D,GAAIi1B,EAEA,OADAA,KAAAA,EAAW1Q,MAAM,CAGzB,CAEqBza,KAAAA,IAAjBiL,EAAOvP,OAAuB,CAACuP,EAAOvP,MAAMujB,SAC5C/M,oBAAoBjH,CAAM,CAElC,CACJ,CAAC,CACT,CAOA,SAASic,SAASnM,GACd,OAAIA,EAAG1E,SAAW0E,EAAG6Q,SACV7Q,EAAG1E,QACLnf,OAAO,GAAY20B,EAAOtnB,QAAQ,EAClCunB,IAAI,GAAYD,EAAOj1B,KAAK,EACd,aAAZmkB,EAAGxJ,MAAmC,UAAZwJ,EAAGxJ,KAC7BwJ,EAAGkM,SAAuB,KAE1BlM,EAAGnkB,KAElB"} \ No newline at end of file +{"version":3,"file":"apbct-public-bundle_ext-protection.min.js","sources":["apbct-public-bundle_ext-protection.js"],"sourcesContent":["/**\n * Base class\n */\nclass ApbctCore {\n ajax_parameters = {};\n restParameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n * @param {string} selector\n */\n constructor(selector) {\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param {string} selector\n * @return {*}\n */\n select(selector) {\n if (selector instanceof HTMLCollection) {\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n } else if ( typeof selector === 'object' ) {\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n } else if ( typeof selector === 'string' ) {\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n } else {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {object|string} elemToAdd\n */\n addElement(elemToAdd) {\n if ( typeof elemToAdd === 'object' ) {\n this.elements.push(elemToAdd);\n } else if ( typeof elemToAdd === 'string' ) {\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n } else {\n this.deselect();\n }\n }\n\n /**\n * @param {object} elem\n */\n push(elem) {\n this.elements.push(elem);\n }\n\n /**\n * reduce\n */\n reduce() {\n this.elements = this.elements.slice(0, -1);\n }\n\n /**\n * deselect\n */\n deselect() {\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param {object|string} style\n * @param {boolean} getRaw\n *\n * @return {boolean|*}\n */\n css(style, getRaw) {\n getRaw = getRaw || false;\n\n // Set style\n if (typeof style === 'object') {\n const stringToCamelCase = (str) =>\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ctJsErrors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Select actual WP nonce depending on the ajax type and the fresh nonce provided.\n * @return {string} url\n */\nfunction selectActualNonce() {\n let defaultNonce = '';\n // return fresh nonce immediately if persists\n if (\n ctPublicFunctions.hasOwnProperty('_fresh_nonce') &&\n typeof ctPublicFunctions._fresh_nonce === 'string' &&\n ctPublicFunctions._fresh_nonce.length > 0\n ) {\n return ctPublicFunctions._fresh_nonce;\n }\n // select from default rest/ajax nonces\n if (\n ctPublicFunctions.data__ajax_type === 'admin_ajax' &&\n ctPublicFunctions.hasOwnProperty('_ajax_nonce') &&\n typeof ctPublicFunctions._ajax_nonce === 'string' &&\n ctPublicFunctions._ajax_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._ajax_nonce;\n }\n if (\n ctPublicFunctions.data__ajax_type === 'rest' &&\n ctPublicFunctions.hasOwnProperty('_rest_nonce') &&\n typeof ctPublicFunctions._rest_nonce === 'string' &&\n ctPublicFunctions._rest_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._rest_nonce;\n }\n\n return defaultNonce;\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n if (this.isWpNonceError()) {\n this.getFreshNonceAndRerunXHR(parameters);\n return;\n }\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * Check if 403 code of WP nonce error\n * @return {bool}\n */\n isWpNonceError() {\n let restErrror = false;\n let ajaxErrror = false;\n // check rest error\n if (this.xhr.readyState == 4) {\n restErrror = (\n typeof this.xhr.response === 'object' && this.xhr.response !== null &&\n this.xhr.response.hasOwnProperty('data') &&\n this.xhr.response.data.hasOwnProperty('status') &&\n this.xhr.response.data.status === 403\n );\n ajaxErrror = this.xhr.response === '-1' && this.xhr.status === 403;\n }\n // todo check AJAX error\n return restErrror || ajaxErrror;\n }\n\n /**\n * Get the fresh nonce and rerun the initial XHR with params\n * @param {[]} initialRequestParams\n */\n getFreshNonceAndRerunXHR(initialRequestParams) {\n let noncePrev = '';\n\n // Check if initialRequestParams['headers']['X-WP-Nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('headers') &&\n initialRequestParams.headers.hasOwnProperty('X-WP-Nonce')\n ) {\n noncePrev = initialRequestParams['headers']['X-WP-Nonce'];\n }\n\n // Check if initialRequestParams['data']['_ajax_nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('data') &&\n initialRequestParams.data.hasOwnProperty('_ajax_nonce')\n ) {\n noncePrev = initialRequestParams['data']['_ajax_nonce'];\n }\n\n // Nonce is not provided. Exit.\n if ( noncePrev === '' ) {\n return;\n }\n\n // prepare params for refreshing nonce\n let params = {};\n params.method = 'POST';\n params.data = {\n 'spbc_remote_call_action': 'get_fresh_wpnonce',\n 'plugin_name': 'antispam',\n 'nonce_prev': noncePrev,\n 'initial_request_params': initialRequestParams,\n };\n params.notJson = true;\n params.url = ctPublicFunctions.host_url;\n // this callback will rerun the XHR with initial params\n params.callback = function(...args) {\n // the refresh result itself\n let freshNonceResult = args[0];\n let newRequestParams = false;\n // provided initial params\n if (args[1] !== undefined && args[1].hasOwnProperty('initial_request_params')) {\n newRequestParams = args[1].initial_request_params;\n }\n if (newRequestParams && freshNonceResult.hasOwnProperty('wpnonce')) {\n ctPublicFunctions._fresh_nonce = freshNonceResult.wpnonce;\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n new ApbctCore().rest(newRequestParams);\n } else {\n new ApbctCore().ajax(newRequestParams);\n }\n }\n };\n // run the nonce refreshing call\n new ApbctXhr(params);\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.data._ajax_nonce = selectActualNonce();\n super(args);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n const nonce = selectActualNonce();\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': nonce,\n };\n super(args);\n }\n}\n\n// add hasOwn\nif (!Object.prototype.hasOwn) {\n Object.defineProperty(Object.prototype, 'hasOwn', { // eslint-disable-line\n value: function(property) {\n return Object.prototype.hasOwnProperty.call(this, property);\n },\n enumerable: false,\n configurable: true,\n writable: true,\n });\n}\n\n/**\n * Form skin class\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctFormDecorator {\n elements = [];\n\n /**\n * Constructor\n */\n constructor() {\n this.getElements();\n this.setListeners();\n }\n\n /**\n * Get elements\n */\n getElements() {\n const elements = document.querySelectorAll('*');\n const regexId = /^apbct-trusted-text--label/;\n const regexClass = /apbct_form_decoration--/;\n\n this.setDecorationBackground();\n\n // Collect elements with id or class that contains apbct-trusted-text--label or apbct_form_decoration--\n // id\n let matchingElements = Array.from(elements).filter((element) => {\n return regexId.test(element.id);\n });\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n // class\n matchingElements = Array.from(elements).filter((element) => {\n return regexClass.test(element.className);\n });\n\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n const flagWrap = document.querySelector('.apbct_form_decoration');\n if (flagWrap) {\n const flagLeft = window.getComputedStyle(flagWrap, '::before');\n const flagRight = window.getComputedStyle(flagWrap, '::after');\n if (flagLeft && flagRight) {\n this.elements.push(flagWrap);\n }\n }\n }\n\n /**\n * Set decoration background\n */\n setDecorationBackground() {\n let blockForms = document.querySelectorAll('#respond');\n\n if (document.querySelector('[class*=\"apbct_form_decoration\"]')) {\n let classHeaderWrapper = document.querySelector('[class*=\"apbct_form_decoration\"]').getAttribute('class');\n let endPosition = classHeaderWrapper.indexOf('_header__wrapper');\n let classTemplate = classHeaderWrapper.substring(0, endPosition);\n\n blockForms.forEach((blockForm) => {\n blockForm.className += ' ' + classTemplate;\n });\n }\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elements.forEach((element) => {\n if (!element) {\n return;\n }\n\n element.addEventListener('click', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n if (element.className.indexOf('header__wrapper') !== -1) {\n this.addClicks();\n return;\n }\n\n const clickX = event.offsetX;\n const clickY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (element.className.indexOf('christmas') !== -1) {\n if (\n clickY < flagLeftHeight / 3 && clickX < flagLeftWidth ||\n clickY < flagRightHeight / 3 && clickX > flagRightWidth\n ) {\n this.addClicks();\n return;\n }\n }\n\n if (\n (element.className.indexOf('new-year') !== -1) ||\n (element.className.indexOf('fourth-july') !== -1)\n ) {\n if (\n clickY > flagLeftHeight && clickX < flagLeftWidth ||\n clickY > flagRightHeight && clickX > flagRightWidth\n ) {\n this.addClicks();\n }\n }\n\n if (element.className.indexOf('signature')) {\n this.addClicks();\n }\n\n return;\n }\n\n this.addClicks();\n });\n\n element.addEventListener('mouseup', (event) => {\n setTimeout(() => {\n const selectedText = window.getSelection().toString();\n if (selectedText) {\n this.addSelected();\n }\n }, 100);\n });\n\n element.addEventListener('mousemove', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n const mouseX = event.offsetX;\n const mouseY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (mouseY > flagLeftHeight && mouseX < flagLeftWidth ||\n mouseY > flagRightHeight && mouseX > flagRightWidth\n ) {\n this.trackMouseMovement();\n }\n return;\n }\n\n this.trackMouseMovement();\n });\n });\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.clicks) {\n document.ctFormDecorationMouseData.clicks++;\n } else {\n document.ctFormDecorationMouseData.clicks = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.selected) {\n document.ctFormDecorationMouseData.selected++;\n } else {\n document.ctFormDecorationMouseData.selected = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctFormDecorationMouseData) {\n document.ctFormDecorationMouseData = {};\n }\n if (!document.ctFormDecorationMouseData.mouseMovements) {\n document.ctFormDecorationMouseData.mouseMovements = [];\n }\n\n document.ctFormDecorationMouseData.mouseMovements.push({timestamp: Date.now()});\n\n if (document.ctFormDecorationMouseData.mouseMovements.length > 1) {\n const index = document.ctFormDecorationMouseData.mouseMovements.length - 1;\n const lastMovement = document.ctFormDecorationMouseData.mouseMovements[index];\n const firstMovement = document.ctFormDecorationMouseData.mouseMovements[0];\n const timeDiff = lastMovement.timestamp - firstMovement.timestamp;\n document.ctFormDecorationMouseData.hovering = timeDiff;\n }\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_bot_detector_exist',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], item[1]);\n }\n });\n\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n let bloomPopup = document.querySelectorAll('div[class^=\"et_bloom_form_container\"]').length > 0;\n let pafeFormsFormElementor = document.querySelectorAll('div[class*=\"pafe-form\"]').length > 0;\n let otterForm = document.querySelectorAll('div [class*=\"otter-form\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp ||\n pafeFormsFormElementor ||\n bloomPopup ||\n otterForm;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n if (!cookies.apbct_site_referer) {\n cookies.apbct_site_referer = location.href;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n const nonce = selectActualNonce();\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i this.checkBotCallback(result),\n });\n } else if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n data.action = 'apbct_force_protection_check_bot';\n apbct_public_sendAJAX(data, {callback: (result) => this.checkBotCallback(result)});\n }\n }\n\n /**\n * Check bot callback\n * @param {Object} result\n * @return {void}\n */\n checkBotCallback(result) {\n // if error occurred\n if (result.data && result.data.status && result.data.status !== 200) {\n console.log('ApbctForceProtection connection error occurred');\n this.decodeForms();\n return;\n }\n\n if (typeof result === 'string') {\n try {\n result = JSON.parse(result);\n } catch (e) {\n console.log('ApbctForceProtection decodeForms error', e);\n this.decodeForms();\n return;\n }\n }\n\n if (typeof result === 'object' && result.allow && result.allow === 1) {\n this.decodeForms();\n } else {\n this.showMessageForBot(result.message);\n }\n }\n\n /**\n * Decode forms\n * @return {void}\n */\n decodeForms() {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n\n try {\n if (form && typeof(form) == 'string') {\n wrapper.outerHTML = atob(form);\n }\n } catch (error) {\n console.log(error);\n }\n });\n }\n\n /**\n * Show message for bot\n * @param {string} message\n * @return {void}\n */\n showMessageForBot(message) {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n if (form) {\n wrapper.outerHTML = '
' + message + '
';\n }\n });\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctCheckedEmailsExist = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\nlet tokenCheckerIntervalId;\nlet botDetectorLogLastUpdate = 0;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Run cron jobs\n */\n// forms handler cron\ncronFormsHandler(2000);\n\n// bot_detector frontend_data log alt session saving cron\nif (\n ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&\n ctPublicFunctions.data__bot_detector_enabled == 1\n) {\n sendBotDetectorLogToAltSessions(500);\n}\n/**\n * Cron jobs end.\n */\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Send BotDetector logs data to alternative sessions.\n * If log_last_update has changed, the log will be sent to the alternative sessions.\n * @param {int} cronStartTimeout delay before cron start\n * @param {int} interval check fires on interval\n */\nfunction sendBotDetectorLogToAltSessions(cronStartTimeout = 3000, interval = 1000) {\n setTimeout(function() {\n setInterval(function() {\n const currentLog = apbctLocalStorage.get('ct_bot_detector_frontend_data_log');\n if (currentLog && currentLog.hasOwnProperty('log_last_update')) {\n if (botDetectorLogLastUpdate !== currentLog.log_last_update) {\n botDetectorLogLastUpdate = currentLog.log_last_update;\n // the log will be taken from javascriptclientdata\n ctSetAlternativeCookie([], {forceAltCookies: true});\n }\n }\n }, interval);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0 ||\n document.getElementById('login-form-popup') !== null\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmailExist(e) {\n let currentEmail = e.target.value;\n let result;\n\n if (!currentEmail || !currentEmail.length) {\n let envelope = document.getElementById('apbct-check_email_exist-block');\n if (envelope) {\n envelope.remove();\n }\n let hint = document.getElementById('apbct-check_email_exist-popup_description');\n if (hint) {\n hint.remove();\n }\n return;\n }\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail in ctCheckedEmailsExist) {\n result = ctCheckedEmailsExist[currentEmail];\n getResultCheckEmailExist(e, result, currentEmail);\n\n return;\n }\n\n viewCheckEmailExist(e, 'load');\n\n // Using REST API handler\n ctPublicFunctions.data__ajax_type = 'rest';\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n apbct_public_sendREST(\n 'check_email_exist_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n\n return;\n }\n\n if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_exist_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} e\n * @param {mixed} result\n * @param {string} currentEmail\n */\nfunction getResultCheckEmailExist(e, result, currentEmail) {\n if (!result || !result.result) {\n return;\n }\n\n result = result.result;\n\n ctCheckedEmailsExist[currentEmail] = {\n 'result': result,\n 'timestamp': Date.now() / 1000 |0,\n };\n\n if (result.result == 'EXISTS') {\n viewCheckEmailExist(e, 'good_email', result.text_result);\n } else {\n viewCheckEmailExist(e, 'bad_email', result.text_result);\n }\n\n ctSetCookie('ct_checked_emails_exist', JSON.stringify(ctCheckedEmailsExist));\n}\n\n/**\n * @param {mixed} e\n * @param {string} state\n * @param {string} textResult\n */\nfunction viewCheckEmailExist(e, state, textResult) {\n let parentElement = e.target.parentElement;\n let inputEmail = parentElement.querySelector('[name*=\"email\"]');\n\n if (!inputEmail) {\n return;\n }\n\n const envelopeWidth = 35;\n let envelope;\n let hint;\n\n // envelope\n if (document.getElementById('apbct-check_email_exist-block')) {\n envelope = document.getElementById('apbct-check_email_exist-block');\n } else {\n envelope = document.createElement('div');\n envelope.setAttribute('class', 'apbct-check_email_exist-block');\n envelope.setAttribute('id', 'apbct-check_email_exist-block');\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n envelope.style.left = inputEmail.getBoundingClientRect().right - envelopeWidth - 10 + 'px';\n envelope.style.height = inputEmail.offsetHeight + 'px';\n envelope.style.width = envelopeWidth + 'px';\n\n window.addEventListener('scroll', function() {\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n });\n\n parentElement.after(envelope);\n }\n\n // hint\n if (document.getElementById('apbct-check_email_exist-popup_description')) {\n hint = document.getElementById('apbct-check_email_exist-popup_description');\n } else {\n hint = document.createElement('div');\n hint.setAttribute('class', 'apbct-check_email_exist-popup_description');\n hint.setAttribute('id', 'apbct-check_email_exist-popup_description');\n hint.style.width = inputEmail.offsetWidth + 'px';\n hint.style.left = inputEmail.getBoundingClientRect().left + 'px';\n\n window.addEventListener('scroll', function() {\n hint.style.top = envelope.getBoundingClientRect().top + 'px';\n });\n\n envelope.after(hint);\n }\n\n switch (state) {\n case 'load':\n envelope.classList.remove('apbct-check_email_exist-good_email', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-load');\n break;\n\n case 'good_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-good_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#1C7129';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n case 'bad_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-good_email');\n envelope.classList.add('apbct-check_email_exist-bad_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#E01111';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n default:\n break;\n }\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n } else {\n // if Jquery is not avaliable try to use xhr\n if (typeof XMLHttpRequest !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n document.addEventListener('readystatechange', function(event) {\n if (event.target.readyState === 4) {\n ctPrepareBlockMessage(event.target);\n }\n });\n }\n }\n}\n\n/**\n * For forced alt cookies.\n * If token is not added to the LS on apbc_ready, check every second if so and send token to the alt sessions.\n */\nfunction startForcedAltEventTokenChecker() {\n tokenCheckerIntervalId = setInterval( function() {\n if (apbctLocalStorage.get('event_token_forced_set') === '1') {\n clearInterval(tokenCheckerIntervalId);\n return;\n }\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if (eventToken) {\n ctSetAlternativeCookie([['ct_bot_detector_event_token', eventToken]], {forceAltCookies: true});\n apbctLocalStorage.set('event_token_forced_set', '1');\n clearInterval(tokenCheckerIntervalId);\n } else {\n }\n }, 1000);\n}\n\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n document.addEventListener('gform_page_loaded', function() {\n if (\n typeof ctPublic.force_alt_cookies === 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n if (typeof setEventTokenField === 'function' && typeof botDetectorLocalStorage === 'function') {\n setEventTokenField(botDetectorLocalStorage.get('bot_detector_event_token'));\n }\n }\n });\n if ( ! ctPublic.wc_ajax_add_to_cart ) {\n apbctCheckAddToCartByGet();\n }\n\n apbctPrepareBlockForAjaxForms();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n if (ctPublic.data__cookies_type !== 'alternative') {\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n }\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( ctIsDrawPixel() ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if ( +ctPublic.data__email_check_exist_post) {\n initCookies.push(['ct_checked_emails_exist', '0']);\n apbct('comment-form input[name = \\'email\\'], input#email').on('blur', checkEmailExist);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n let tokenForForceAlt = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n ctPublic.settings__data__bot_detector_enabled\n ) {\n apbctLocalStorage.set('event_token_forced_set', '0');\n if (tokenForForceAlt) {\n initCookies.push(['ct_bot_detector_event_token', tokenForForceAlt]);\n apbctLocalStorage.set('event_token_forced_set', '1');\n } else {\n startForcedAltEventTokenChecker();\n }\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n ctAddWCMiddlewares();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n + ctPublic.settings__forms__search_test === 1 &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n // fibosearch integration\n if (_form.querySelector('input.dgwt-wcas-search-input')) {\n continue;\n }\n\n // this handles search forms onsubmit process\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n\n // Check any XMLHttpRequest connections\n apbctCatchXmlHttpRequest();\n\n // Init form skin\n if (ctPublic.settings__comments__form_decoration) {\n new ApbctFormDecorator();\n }\n\n // Set important paramaters via ajax if problematic cache solutions found\n apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists || ctPublic.varnishCacheExists);\n\n // Checking that the bot detector has loaded and received the event token for Anti-Crawler\n if (ctPublic.settings__sfw__anti_crawler) {\n checkBotDetectorExist();\n }\n}\n\n/**\n * Checking that the bot detector has loaded and received the event token\n */\nfunction checkBotDetectorExist() {\n if (ctPublic.settings__data__bot_detector_enabled) {\n const botDetectorIntervalSearch = setInterval(() => {\n let botDetectorEventToken = localStorage.bot_detector_event_token ? true : false;\n\n if (botDetectorEventToken) {\n ctSetCookie('apbct_bot_detector_exist', '1', '3600');\n clearInterval(botDetectorIntervalSearch);\n }\n }, 500);\n }\n}\n\n/**\n * Insert no_cookies_data to rest request\n */\nfunction ctAddWCMiddlewares() {\n const ctPinDataToRequest = (options, next) => {\n if (typeof options !== 'object' || options === null ||\n !options.hasOwnProperty('data') || !options.hasOwnProperty('path')\n ) {\n return next(options);\n }\n\n // add to cart\n if (options.data.hasOwnProperty('requests') &&\n options.data.requests.length > 0 &&\n options.data.requests[0].hasOwnProperty('path') &&\n options.data.requests[0].path === '/wc/store/v1/cart/add-item'\n ) {\n options.data.requests[0].data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n // checkout\n if (options.path === '/wc/store/v1/checkout') {\n options.data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n return next(options);\n };\n\n if (window.hasOwnProperty('wp') &&\n window.wp.hasOwnProperty('apiFetch') &&\n typeof window.wp.apiFetch.use === 'function'\n ) {\n window.wp.apiFetch.use(ctPinDataToRequest);\n }\n}\n\n/**\n * Insert event_token and no_cookies_data to some ajax request\n */\nfunction apbctCatchXmlHttpRequest() {\n // 1) Check the page if it needed to catch XHR\n if ( document.querySelector('div.wfu_container') !== null ) {\n const originalSend = XMLHttpRequest.prototype.send;\n XMLHttpRequest.prototype.send = function(body) {\n // 2) Check the caught request fi it needed to modify\n if (\n body &&\n typeof body === 'string' &&\n (\n body.indexOf('action=wfu_ajax_action_ask_server') !== -1\n )\n ) {\n let addidionalCleantalkData = '';\n let eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (\n eventToken !== null &&\n eventToken !== false &&\n eventToken.hasOwnProperty('value') &&\n eventToken.value !== ''\n ) {\n eventToken = eventToken.value;\n addidionalCleantalkData += '&' + 'data%5Bct_bot_detector_event_token%5D=' + eventToken;\n }\n\n let noCookieData = getNoCookieData();\n addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData;\n\n body += addidionalCleantalkData;\n\n return originalSend.apply(this, [body]);\n }\n return originalSend.apply(this, [body]);\n };\n }\n}\n\n/**\n * Run AJAX to set important_parameters on the site backend if problematic cache solutions are defined.\n * @param {boolean} cacheExist\n */\nfunction apbctAjaxSetImportantParametersOnCacheExist(cacheExist) {\n // Set important parameters via ajax\n if ( cacheExist ) {\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST('apbct_set_important_parameters', {});\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX({action: 'apbct_set_important_parameters'}, {});\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n // this is the only place where we can found hard dependency on jQuery, if the form use it - the script\n // will work independing if jQuery is loaded by CleanTalk or not\n let eventToken = false;\n if ( typeof jQuery !== 'undefined' && typeof jQuery.ajaxSetup === 'function') {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n\n if (settings.data.indexOf('action=new_activity_comment') !== -1) {\n sourceSign = 'action=new_activity_comment';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n if (localStorage.getItem('bot_detector_event_token') !== null) {\n eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (eventToken !== false && eventToken.hasOwnProperty('value') && eventToken.value !== '') {\n eventToken = eventToken.value;\n }\n }\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n if (typeof eventToken === 'string') {\n eventToken = 'data%5Bct_bot_detector_event_token%5D=' + eventToken + '&';\n } else {\n eventToken = '';\n }\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n\n settings.data = noCookieData + eventToken + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {object} targetForm\n */\nfunction ctSearchFormOnSubmitHandler(e, targetForm) {\n try {\n // get honeypot field and it's value\n const honeyPotField = targetForm.querySelector('[id*=\"apbct__email_id__\"]');\n let hpValue = null;\n let hpEventId = null;\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n // get cookie data from storages\n let cleantalkStorageDataArray = getCleanTalkStorageDataArray();\n\n // get event token from storage\n let eventTokenLocalStorage = apbctLocalStorage.get('bot_detector_event_token');\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( cleantalkStorageDataArray !== null || honeyPotField !== null || eventTokenLocalStorage !== null ) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n if (typeof targetForm.apbctSearchPrevOnsubmit === 'function') {\n targetForm.apbctSearchPrevOnsubmit();\n } else {\n HTMLFormElement.prototype.submit.call(targetForm);\n }\n };\n\n let cookiesArray = cleantalkStorageDataArray;\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // set event token\n cookiesArray.ct_bot_detector_event_token = eventTokenLocalStorage;\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n // data to JSON\n const parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( typeof parsedCookies !== 'undefined' && parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctPublic.wl_brandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n let email = currentResultData.decoded_email.split(/[&?]/)[0];\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n if (firstNode) {\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNodes, result);\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNodes, decodingResult) {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML = baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n\n encodedEmailNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedEmailNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if ( typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n\n let noCookieData = getCleanTalkStorageDataArray();\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * Retrieves the clentalk \"cookie\" data from starages.\n * Contains {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration}.\n * @return {string}\n */\nfunction getCleanTalkStorageDataArray() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieDataFromDecoration = {form_decoration_mouse_data: []};\n if (document.ctFormDecorationMouseData) {\n let formDecorationMouseData = JSON.parse(JSON.stringify(document.ctFormDecorationMouseData));\n if (formDecorationMouseData.mouseMovements) {\n delete formDecorationMouseData.mouseMovements;\n }\n noCookieDataFromDecoration = {form_decoration_mouse_data: formDecorationMouseData};\n }\n return {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration};\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n const formAction = typeof(form.action) == 'string' ? form.action : '';\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n // Super WooCommerce Product Filter\n if (form.classList.contains('swpf-instant-filtering')) {\n return true;\n }\n // PayU 3-rd party service forms\n if (formAction.indexOf('secure.payu.com') !== -1 ) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n/**\n * WooCommerce add to cart by GET request params collecting\n */\nfunction apbctCheckAddToCartByGet() {\n // 1) Collect all links with add_to_cart_button class\n document.querySelectorAll('a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)').forEach((el) => {\n el.addEventListener('click', function(e) {\n let href = el.getAttribute('href');\n // 2) Add to href attribute additional parameter ct_bot_detector_event_token gathered from apbctLocalStorage\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if ( eventToken ) {\n if ( href.indexOf('?') === -1 ) {\n href += '?';\n } else {\n href += '&';\n }\n href += 'ct_bot_detector_event_token=' + eventToken;\n el.setAttribute('href', href);\n }\n });\n });\n}\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n\n/**\n * Handle external forms\n */\nfunction ctProtectExternal() {\n for (let i = 0; i < document.forms.length; i++) {\n if (document.forms[i].cleantalk_hidden_action === undefined &&\n document.forms[i].cleantalk_hidden_method === undefined) {\n // current form\n const currentForm = document.forms[i];\n\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n\n // Ajax checking for the integrated forms - will be changed the whole form object to make protection\n if ( isIntegratedForm(currentForm) ) {\n apbctProcessExternalForm(currentForm, i, document);\n\n // Ajax checking for the integrated forms - will be changed only submit button to make protection\n } else if (\n // MooForm 3rd party service\n currentForm.dataset.mailingListId !== undefined ||\n (typeof(currentForm.action) == 'string' &&\n (currentForm.action.indexOf('webto.salesforce.com') !== -1)) ||\n (typeof(currentForm.action) == 'string' &&\n currentForm.querySelector('[href*=\"activecampaign\"]'))\n ) {\n apbctProcessExternalFormByFakeButton(currentForm, i, document);\n // Common flow - modify form's action\n } else if (\n typeof(currentForm.action) == 'string' &&\n ( currentForm.action.indexOf('http://') !== -1 ||\n currentForm.action.indexOf('https://') !== -1 )\n ) {\n let tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n const host = tmp[0].toLowerCase();\n\n if (host !== location.hostname.toLowerCase()) {\n const ctAction = document.createElement('input');\n ctAction.name = 'cleantalk_hidden_action';\n ctAction.value = currentForm.action;\n ctAction.type = 'hidden';\n currentForm.appendChild(ctAction);\n\n const ctMethod = document.createElement('input');\n ctMethod.name = 'cleantalk_hidden_method';\n ctMethod.value = currentForm.method;\n ctMethod.type = 'hidden';\n\n currentForm.method = 'POST';\n\n currentForm.appendChild(ctMethod);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n // Trying to process external form into an iframe\n apbctProcessIframes();\n // if form is still not processed by fields listening, do it here\n ctStartFieldsListening();\n}\n\n/**\n * Exclusion forms\n * @param {HTMLElement} currentForm\n * @return {boolean}\n */\nfunction formIsExclusion(currentForm) {\n const exclusionsById = [\n 'give-form', // give form exclusion because of direct integration\n 'frmCalc', // nobletitle-calc\n 'ihf-contact-request-form',\n 'wpforms', // integration with wpforms\n ];\n\n const exclusionsByRole = [\n 'search', // search forms\n ];\n\n const exclusionsByClass = [\n 'search-form', // search forms\n 'hs-form', // integrated hubspot plugin through dynamicRenderedForms logic\n 'ihc-form-create-edit', // integrated Ultimate Membership Pro plugin through dynamicRenderedForms logic\n 'nf-form-content', // integration with Ninja Forms for js events\n 'elementor-form', // integration with elementor-form\n 'wpforms', // integration with wpforms\n 'et_pb_searchform', // integration with elementor-search-form\n ];\n\n const exclusionsByAction = [\n 'paypal.com/cgi-bin/webscr', // search forms\n ];\n\n let result = false;\n\n try {\n // mewto forms exclusion\n if (currentForm.parentElement &&\n currentForm.parentElement.classList.length > 0 &&\n currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1) {\n result = true;\n }\n\n if (currentForm.getAttribute('action') !== null) {\n exclusionsByAction.forEach(function(exclusionAction) {\n if (currentForm.getAttribute('action').indexOf(exclusionAction) !== -1) {\n result = true;\n }\n });\n }\n\n exclusionsById.forEach(function(exclusionId) {\n const formId = currentForm.getAttribute('id');\n if ( formId !== null && typeof (formId) !== 'undefined' && formId.indexOf(exclusionId) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByClass.forEach(function(exclusionClass) {\n let foundClass = '';\n if (currentForm.getAttribute('class')) {\n foundClass = currentForm.getAttribute('class');\n } else {\n foundClass = apbctGetFormClass(currentForm, exclusionClass);\n }\n const formClass = foundClass;\n if ( formClass !== null && typeof formClass !== 'undefined' && formClass.indexOf(exclusionClass) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByRole.forEach(function(exclusionRole) {\n const formRole = currentForm.getAttribute('id');\n if ( formRole !== null && typeof formRole !== 'undefined'&& formRole.indexOf(exclusionRole) !== -1 ) {\n result = true;\n }\n });\n } catch (e) {\n console.table('APBCT ERROR: formIsExclusion() - ', e);\n }\n\n return result;\n}\n\n/**\n * Gets the form class if it is not in \n * @param {HTMLElement} currentForm\n * @param {string} exclusionClass\n * @return {string}\n */\nfunction apbctGetFormClass(currentForm, exclusionClass) {\n if (typeof(currentForm) == 'object' && currentForm.querySelector('.' + exclusionClass)) {\n return exclusionClass;\n }\n}\n\n/**\n * Handle external forms in iframes\n */\nfunction apbctProcessIframes() {\n const frames = document.getElementsByTagName('iframe');\n\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) {\n continue;\n }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n const currentForm = iframeForms[y];\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n const cleantalkPlaceholder = document.createElement('i');\n cleantalkPlaceholder.className = 'cleantalk_placeholder';\n cleantalkPlaceholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalkPlaceholder, currentForm);\n\n // Deleting form to prevent submit event\n const prev = currentForm.previousSibling;\n const formHtml = currentForm.outerHTML;\n const formOriginal = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement('div');\n placeholder.innerHTML = formHtml;\n prev.after(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = formOriginal;\n\n // mailerlite integration - disable click on submit button\n let mailerliteDetectedClass = false;\n if (reUseCurrentForm.classList !== undefined) {\n // list there all the mailerlite classes\n const mailerliteClasses = ['newsletterform', 'ml-block-form'];\n mailerliteClasses.forEach(function(mailerliteClass) {\n if (reUseCurrentForm.classList.contains(mailerliteClass)) {\n mailerliteDetectedClass = mailerliteClass;\n }\n });\n }\n\n let mailerliteSubmitButton = null;\n if ( mailerliteDetectedClass ) {\n mailerliteSubmitButton = reUseCurrentForm.querySelector('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== null && mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.addEventListener('click', function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(reUseCurrentForm);\n });\n }\n return;\n }\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Process external forms via fake button replacing\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormByFakeButton(currentForm, iterator, documentObject) {\n const submitButtonOriginal = currentForm.querySelector('[type=\"submit\"]');\n const onsubmitOriginal = currentForm.querySelector('[type=\"submit\"]').form.onsubmit;\n\n if ( ! submitButtonOriginal ) {\n return;\n }\n\n const parent = submitButtonOriginal.parentElement;\n const submitButtonHtml = submitButtonOriginal.outerHTML;\n\n // Remove the original submit button\n submitButtonOriginal.remove();\n\n // Insert a clone of the submit button\n const placeholder = document.createElement('div');\n placeholder.innerHTML = submitButtonHtml;\n parent.appendChild(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctParent = parent;\n reUseCurrentForm.submitButtonOriginal = submitButtonOriginal;\n reUseCurrentForm.onsubmitOriginal = onsubmitOriginal;\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n\n // MooSend spinner activate\n apbctMoosendSpinnerToggle(event.currentTarget);\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Activate or deactivate spinner for Moosend form during request checking\n * @param {HTMLElement} form\n */\nfunction apbctMoosendSpinnerToggle(form) {\n const buttonElement = form.querySelector('button[type=\"submit\"]');\n if ( buttonElement ) {\n const spinner = buttonElement.querySelector('i');\n const submitText = buttonElement.querySelector('span');\n if (spinner && submitText) {\n if ( spinner.style.zIndex == 1 ) {\n submitText.style.opacity = 1;\n spinner.style.zIndex = -1;\n spinner.style.opacity = 0;\n } else {\n submitText.style.opacity = 0;\n spinner.style.zIndex = 1;\n spinner.style.opacity = 1;\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} formSource\n * @param {HTMLElement} formTarget\n */\nfunction apbctReplaceInputsValuesFromOtherForm(formSource, formTarget) {\n const inputsSource = formSource.querySelectorAll('button, input, textarea, select');\n const inputsTarget = formTarget.querySelectorAll('button, input, textarea, select');\n\n if (formSource.outerHTML.indexOf('action=\"https://www.kulahub.net') !== -1 ||\n isFormHasDiviRedirect(formSource) ||\n formSource.outerHTML.indexOf('class=\"et_pb_contact_form') !== -1\n ) {\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.name === elemTarget.name) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n\n return;\n }\n\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.outerHTML === elemTarget.outerHTML) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n}\n// clear protected iframes list\napbctLocalStorage.set('apbct_iframes_protected', []);\nwindow.addEventListener('load', function() {\n if ( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n setTimeout(function() {\n ctProtectExternal();\n catchDynamicRenderedForm();\n catchNextendSocialLoginForm();\n ctProtectOutsideIframe();\n }, 2000);\n\n ctProtectKlaviyoForm();\n});\n\n/**\n * Protect klaviyo forms\n */\nfunction ctProtectKlaviyoForm() {\n if (!document.querySelector('link[rel=\"dns-prefetch\"][href=\"//static.klaviyo.com\"]')) {\n return;\n }\n\n let i = setInterval(() => {\n const klaviyoForms = document.querySelectorAll('form.klaviyo-form');\n if (klaviyoForms.length) {\n clearInterval(i);\n klaviyoForms.forEach((form, index) => {\n apbctProcessExternalFormKlaviyo(form, index, document);\n });\n }\n }, 500);\n}\n\n/**\n * Protect klaviyo forms\n * @param {HTMLElement} form\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormKlaviyo(form, iterator, documentObject) {\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (!btn) {\n return;\n }\n btn.disabled = true;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n let cover = document.createElement('div');\n cover.id = 'apbct-klaviyo-cover';\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.style.cursor = 'pointer';\n cover.onclick = function(e) {\n sendAjaxCheckingFormData(form);\n };\n btn.parentNode.style.position = 'relative';\n btn.parentNode.appendChild(cover);\n}\n\n/**\n * Protect forms placed in iframe with outside src\n */\nfunction ctProtectOutsideIframe() {\n let iframes = document.querySelectorAll('iframe');\n if (iframes.length > 0) {\n iframes.forEach(function(iframe) {\n if (iframe.src.indexOf('form.typeform.com') !== -1 ||\n iframe.src.indexOf('forms.zohopublic.com') !== -1 ||\n iframe.src.indexOf('link.surepathconnect.com') !== -1 ||\n iframe.src.indexOf('hello.dubsado.com') !== -1 ||\n iframe.classList.contains('hs-form-iframe') ||\n ( iframe.src.indexOf('facebook.com') !== -1 && iframe.src.indexOf('plugins/comments.php') !== -1)\n ) {\n // pass if is already protected\n if (false !== apbctLocalStorage.get('apbct_iframes_protected') &&\n apbctLocalStorage.get('apbct_iframes_protected').length > 0 &&\n typeof iframe.id !== 'undefined' &&\n apbctLocalStorage.get('apbct_iframes_protected').indexOf[iframe.id] !== -1\n ) {\n return;\n }\n ctProtectOutsideIframeHandler(iframe);\n }\n });\n }\n}\n\nlet ctProtectOutsideIframeCheck;\n/**\n * Protect forms placed in iframe with outside src handler\n * @param {HTMLElement} iframe\n */\nfunction ctProtectOutsideIframeHandler(iframe) {\n let cover = document.createElement('div');\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.onclick = function(e) {\n if (ctProtectOutsideIframeCheck === undefined) {\n let currentDiv = e.currentTarget;\n currentDiv.style.opacity = 0.5;\n let preloader = document.createElement('div');\n preloader.className = 'apbct-iframe-preloader';\n currentDiv.appendChild(preloader);\n let botDetectorToken = '';\n if (document.querySelector('[name*=\"ct_bot_detector_event_token\"]')) {\n botDetectorToken = document.querySelector('[name*=\"ct_bot_detector_event_token\"]').value;\n }\n\n let data = {\n 'action': 'cleantalk_outside_iframe_ajax_check',\n 'ct_no_cookie_hidden_field': getNoCookieData(),\n 'ct_bot_detector_event_token': botDetectorToken,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n ctProtectOutsideIframeCheck = true;\n if (result.apbct.blocked === false) {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach(function(el) {\n el.parentNode.remove();\n });\n } else {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.parentNode.style.color = 'white';\n el.parentNode.innerHTML += result.apbct.comment;\n });\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.remove();\n });\n }\n },\n },\n );\n }\n };\n iframe.parentNode.style.position = 'relative';\n iframe.parentNode.appendChild(cover);\n let iframes = apbctLocalStorage.get('apbct_iframes_protected');\n if (false === iframes) {\n iframes = [];\n }\n if (typeof iframe.id !== 'undefined') {\n iframes.push(iframe.id);\n apbctLocalStorage.set('apbct_iframes_protected', iframes);\n }\n}\n\n/**\n * Catch NSL form integration\n */\nfunction catchNextendSocialLoginForm() {\n let blockNSL = document.getElementById('nsl-custom-login-form-main');\n if (blockNSL) {\n blockBtnNextendSocialLogin(blockNSL);\n }\n}\n\n/**\n * Blocking NSL plugin buttons\n * @param {HTMLElement} blockNSL\n */\nfunction blockBtnNextendSocialLogin(blockNSL) {\n let parentBtnsNSL = blockNSL.querySelectorAll('.nsl-container-buttons a');\n let childBtnsNSL = blockNSL.querySelectorAll('a[data-plugin=\"nsl\"] .nsl-button');\n parentBtnsNSL.forEach((el) => {\n el.setAttribute('data-oauth-login-blocked', 'true');\n el.addEventListener('click', (event) => {\n event.preventDefault();\n });\n });\n childBtnsNSL.forEach((el) => {\n el.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n ctCheckAjax(el);\n });\n });\n}\n\n/**\n * Unlocking the button and clicking on it after an ajax response\n * @param {HTMLElement} childBtn\n */\nfunction allowAjaxNextendSocialLogin(childBtn) {\n childBtn.parentElement.setAttribute('data-oauth-login-blocked', 'false');\n childBtn.parentElement.click();\n}\n\n/**\n * Locking the button and entering a message after an ajax response\n * @param {HTMLElement} childBtn\n * @param {string} msg\n */\nfunction forbiddenAjaxNextendSocialLogin(childBtn, msg) {\n let parentElement = childBtn.parentElement;\n if (parentElement.getAttribute('data-oauth-login-blocked') == 'false') {\n parentElement.setAttribute('data-oauth-login-blocked', 'true');\n }\n if (!document.querySelector('.ct-forbidden-msg')) {\n let elemForMsg = document.createElement('div');\n elemForMsg.className = 'ct-forbidden-msg';\n elemForMsg.style.background = 'red';\n elemForMsg.style.color = 'white';\n elemForMsg.style.padding = '5px';\n elemForMsg.innerHTML = msg;\n parentElement.insertAdjacentElement('beforebegin', elemForMsg);\n }\n}\n\n/**\n * User verification using user data and ajax\n * @param {HTMLElement} elem\n */\nfunction ctCheckAjax(elem) {\n let data = {\n 'action': 'cleantalk_nsl_ajax_check',\n 'ct_no_cookie_hidden_field': document.getElementsByName('ct_no_cookie_hidden_field')[0].value,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if (result.apbct.blocked === false) {\n allowAjaxNextendSocialLogin(elem);\n } else {\n forbiddenAjaxNextendSocialLogin(elem, result.apbct.comment);\n }\n },\n },\n );\n}\n\n/**\n * Checking the form integration\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isIntegratedForm(formObj) {\n const formAction = typeof(formObj.action) == 'string' ? formObj.action : '';\n const formId = formObj.getAttribute('id') !== null ? formObj.getAttribute('id') : '';\n\n if (\n (\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n formAction.indexOf('app.kit.com') !== -1 // ConvertKit new form\n ) ||\n ( formObj.firstChild.classList !== undefined &&\n formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1 ||\n formId.indexOf('ihf-contact-request-form') !== -1 ||\n formAction.indexOf('crm.zoho.com') !== -1 ||\n formId.indexOf('delivra-external-form') !== -1 ||\n // todo Return to Hubspot for elementor in the future, disabled of reason https://doboard.com/1/task/9227\n // ( formObj.classList !== undefined &&\n // !formObj.classList.contains('woocommerce-checkout') &&\n // formObj.hasAttribute('data-hs-cf-bound')\n // ) || // Hubspot integration in Elementor form// Hubspot integration in Elementor form\n formAction.indexOf('eloqua.com') !== -1 || // Eloqua integration\n formAction.indexOf('kulahub.net') !== -1 || // Kulahub integration\n isFormHasDiviRedirect(formObj) || // Divi contact form\n formAction.indexOf('eocampaign1.com') !== -1 || // EmailOctopus Campaign form\n formAction.indexOf('wufoo.com') !== -1 || // Wufoo form\n ( formObj.classList !== undefined &&\n formObj.classList.contains('sp-element-container') ) // Sendpulse form\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * This function detect if the form has DIVI redirect. If so, the form will work as external.\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isFormHasDiviRedirect(formObj) {\n let result = false;\n const diviRedirectedSignSet = document.querySelector('div[id^=\"et_pb_contact_form\"]');\n if (\n typeof formObj === 'object' && formObj !== null &&\n diviRedirectedSignSet !== null &&\n diviRedirectedSignSet.hasAttribute('data-redirect_url') &&\n diviRedirectedSignSet.getAttribute('data-redirect_url') !== '' &&\n diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]') !== null\n ) {\n result = formObj === diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]');\n }\n return result;\n}\n\n/**\n * Sending Ajax for checking form data\n * @param {HTMLElement} form\n * @param {HTMLElement} prev\n * @param {HTMLElement} formOriginal\n */\nfunction sendAjaxCheckingFormData(form) {\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visibleFields );\n\n const data = {\n 'ct_bot_detector_event_token': apbctLocalStorage.get('bot_detector_event_token'),\n };\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ) {\n // MooSend spinner deactivate\n apbctMoosendSpinnerToggle(form);\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Klaviyo integration\n if (form.classList !== undefined && form.classList.contains('klaviyo-form')) {\n const cover = document.getElementById('apbct-klaviyo-cover');\n if (cover) {\n cover.remove();\n }\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (btn) {\n btn.disabled = false;\n btn.click();\n }\n return;\n }\n\n // MooSend integration\n if ( form.dataset.mailingListId !== undefined ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Salesforce integration\n if (form.hasAttribute('action') &&\n (form.getAttribute('action').indexOf('webto.salesforce.com') !== -1)\n ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Active Campaign integration\n if (form.querySelector('[href*=\"activecampaign\"]')) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n const formNew = form;\n form.parentElement.removeChild(form);\n const prev = form.apbctPrev;\n const formOriginal = form.apbctFormOriginal;\n let mauticIntegration = false;\n\n apbctReplaceInputsValuesFromOtherForm(formNew, formOriginal);\n\n // mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mauticIntegration = true;\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n for (const el of formOriginal.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n\n for (const el of formOriginal.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n\n // Common click event\n let submButton = formOriginal.querySelectorAll('button[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n if (mauticIntegration) {\n setTimeout(function() {\n ctProtectExternal();\n }, 1500);\n }\n return;\n }\n\n submButton = formOriginal.querySelectorAll('input[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // ConvertKit direct integration\n submButton = formOriginal.querySelectorAll('button[data-element=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // Paypal integration\n submButton = formOriginal.querySelectorAll('input[type=\"image\"][name=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n }\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Handle dynamic rendered form\n */\nfunction catchDynamicRenderedForm() {\n const forms = document.getElementsByTagName('form');\n\n catchDynamicRenderedFormHandler(forms);\n\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n\n if ( iframeForms.length === 0 ) {\n return;\n }\n\n catchDynamicRenderedFormHandler(iframeForms, frames[j].contentDocument);\n }\n }\n}\n\n/**\n * Handles dynamic rendered forms by attaching an onsubmit event handler to them.\n *\n * @param {HTMLCollection} forms - A collection of form elements to be processed.\n * @param {Document} [documentObject=document] - The document object to use for querying elements.\n */\nfunction catchDynamicRenderedFormHandler(forms, documentObject = document) {\n const neededFormIds = [];\n for (const form of forms) {\n const formIdAttr = form.getAttribute('id');\n if (formIdAttr && formIdAttr.indexOf('hsForm') !== -1) {\n neededFormIds.push(formIdAttr);\n }\n if (formIdAttr && formIdAttr.indexOf('createuser') !== -1 &&\n (form.classList !== undefined && form.classList.contains('ihc-form-create-edit'))\n ) {\n neededFormIds.push(formIdAttr);\n }\n }\n\n for (const formId of neededFormIds) {\n const form = documentObject.getElementById(formId);\n form.apbct_external_onsubmit_prev = form.onsubmit;\n form.onsubmit = sendAjaxCheckingDynamicFormData;\n }\n}\n\n/**\n * Sending Ajax for checking form data on dynamic rendered form\n * @param {HTMLElement} form\n */\nfunction sendAjaxCheckingDynamicFormData(form) {\n form.preventDefault();\n form.stopImmediatePropagation();\n const formEvent = form;\n form = form.target;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie(visibleFields);\n form.append(ctNoCookieConstructHiddenField('hidden'));\n\n const data = {};\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n form.onsubmit = null;\n\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Call previous submit action\n if (form.apbct_external_onsubmit_prev instanceof Function) {\n let timerId = setTimeout(function() {\n form.apbct_external_onsubmit_prev.call(form, formEvent);\n }, 500);\n clearTimeout(timerId);\n }\n\n const submButton = form.querySelector('input[type=\"submit\"]');\n if (submButton) {\n submButton.click();\n return;\n }\n }\n\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Implement jQuery val() function\n * @param {HTMLElement} el\n * @return {HTMLElements}\n */\nfunction apbctVal(el) {\n if (el.options && el.multiple) {\n return el.options\n .filter((option) => option.selected)\n .map((option) => option.value);\n } else if (el.type === 'checkbox' || el.type === 'radio') {\n return el.checked ? el.checked : null;\n } else {\n return el.value;\n }\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","getAttribute","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","ctJsErrors","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","selectActualNonce","defaultNonce","ctPublicFunctions","hasOwnProperty","_fresh_nonce","data__ajax_type","_ajax_nonce","_rest_nonce","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","prepare","keys","deleteDoubleJSONEncoding","convertData","console","open","setHeaders","onreadystatechange","isWpNonceError","getFreshNonceAndRerunXHR","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","restErrror","ajaxErrror","readyState","initialRequestParams","noncePrev","spbc_remote_call_action","plugin_name","nonce_prev","initial_request_params","notJson","host_url","freshNonceResult","newRequestParams","undefined","wpnonce","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","_rest_url","route","nonce","X-WP-Nonce","defineProperty","property","enumerable","configurable","writable","ApbctFormDecorator","getElements","setListeners","regexId","regexClass","setDecorationBackground","matchingElements","from","test","element","id","forEach","flagLeft","flagRight","flagWrap","blockForms","classHeaderWrapper","endPosition","classTemplate","substring","blockForm","clickX","flagLeftWidth","flagLeftHeight","flagRightWidth","flagRightHeight","offsetX","clickY","offsetY","parseFloat","width","height","addClicks","getSelection","addSelected","mouseX","mouseY","trackMouseMovement","ctFormDecorationMouseData","clicks","selected","firstMovement","timeDiff","mouseMovements","timestamp","now","index","lastMovement","hovering","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","item","apbctLocalStorage","set","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","encodeURIComponent","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bloomPopup","pafeFormsFormElementor","otterForm","bookingPress","isArray","getJavascriptClientData","e","apbct_site_referer","apbct_force_alt_cookies","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","beforeSend","ctGetCookie","matches","RegExp","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","no_cache","apbctGenerateUniqueID","substr","get","storageValue","json","isJson","objToSave","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","apbctForceProtect","ApbctForceProtection","data__key_is_ok","apbct_attach_event_handler","wrappers","findWrappers","checkBot","event_javascript_data","post_url","referrer","checkBotCallback","result","decodeForms","allow","showMessageForBot","form","wrapper","dataset","encodedForm","outerHTML","atob","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctCheckedEmailsExist","ctMouseReadInterval","ctMouseWriteDataInterval","tokenCheckerIntervalId","botDetectorLogLastUpdate","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__bot_detector_enabled","sendBotDetectorLogToAltSessions","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","interval","currentLog","log_last_update","token","doAttach","getElementsByClassName","getElementById","setEventTokenField","clearInterval","checkEmail","currentEmail","email","checkEmailExist","hint","getResultCheckEmailExist","viewCheckEmailExist","envelope","text_result","state","textResult","inputEmail","top","getBoundingClientRect","left","right","offsetHeight","envelopeWidth","offsetWidth","onmouseover","textContent","color","onmouseout","ctIsDrawPixel","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","startForcedAltEventTokenChecker","eventToken","apbct_ready","botDetectorLocalStorage","wc_ajax_add_to_cart","apbctCheckAddToCartByGet","sessionID","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","data__email_check_exist_post","tokenForForceAlt","encodedEmailNodes","settings__data__bot_detector_enabled","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","ctAddWCMiddlewares","hiddenInput","visibleFieldsToInput","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","ctFillDecodedEmailHandler","_form","settings__forms__search_test","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","apbctCatchXmlHttpRequest","settings__comments__form_decoration","apbctAjaxSetImportantParametersOnCacheExist","advancedCacheExists","varnishCacheExists","settings__sfw__anti_crawler","checkBotDetectorExist","botDetectorIntervalSearch","bot_detector_event_token","wp","apiFetch","use","options","next","requests","path","ct_no_cookie_hidden_field","originalSend","addidionalCleantalkData","apply","cacheExist","ajaxSetup","sourceSign","contains","targetForm","honeyPotField","hpValue","hpEventId","callBack","parsedCookies","cleantalkStorageDataArray","getCleanTalkStorageDataArray","eventTokenLocalStorage","preventDefault","parentNode","HTMLFormElement","submit","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","ct_bot_detector_event_token","warn","encodedEmailNodesIsMixed","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","innerHTML","wl_brandname","waitingPopup","popupHeader","innerText","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","animationElements","animationWrapper","apbctEEAnimationDogOne","clickSource","encodedEmails","encodedEmailsCollection","apbctTooltip","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","popup","currentResultData","row","encoded_email","decoded_email","firstNode","selectableEmail","title","secondNode","buttonWrapper","fillDecodedEmails","click","comment","decodingResult","encodedEmail","baseElementContent","encodedEmailTextInsideMailto","el","ctProcessDecodedDataResult","commonCookies","resultDataJson","ct_checked_emails","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_headless","ct_bot_detector_frontend_data_log","apbct_page_hits","apbct_prev_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","popupText","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","formDecorationMouseData","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","noCookieDataFromDecoration","form_decoration_mouse_data","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","hiddenFieldType","formAction","j","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","ignoreURLConvert","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","ctProtectExternal","cleantalk_hidden_action","cleantalk_hidden_method","ctMethod","currentForm","formIsExclusion","isIntegratedForm","apbctProcessExternalForm","mailingListId","apbctProcessExternalFormByFakeButton","tmp","hostname","ctAction","appendChild","apbctProcessIframes","exclusionAction","exclusionId","exclusionClass","foundClass","formClass","apbctGetFormClass","exclusionRole","formRole","table","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalkPlaceholder","prev","insertBefore","previousSibling","formHtml","formOriginal","placeholder","forceAction","firstElementChild","reUseCurrentForm","apbctPrev","apbctFormOriginal","mailerliteDetectedClass","mailerliteClass","mailerliteSubmitButton","sendAjaxCheckingFormData","currentTarget","submitButtonOriginal","onsubmitOriginal","submitButtonHtml","apbctParent","apbctMoosendSpinnerToggle","buttonElement","submitText","zIndex","apbctReplaceInputsValuesFromOtherForm","formSource","formTarget","inputsSource","inputsTarget","isFormHasDiviRedirect","elemSource","elemTarget","checked","apbctVal","ctProtectKlaviyoForm","klaviyoForms","apbctProcessExternalFormKlaviyo","cover","btn","disabled","onclick","ctProtectOutsideIframe","iframes","iframe","src","ctProtectOutsideIframeHandler","ctTrpLocalize","ctTrpIsAdminCommentsList","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","trpComments","learnMoreLink","trpLayout","trpImage","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","nextElementSibling","clearTimeout","selection","onSelectionChange","settings__forms__check_external","catchDynamicRenderedForm","catchNextendSocialLoginForm","ctProtectOutsideIframeCheck","currentDiv","preloader","botDetectorToken","blockNSL","blockBtnNextendSocialLogin","parentBtnsNSL","childBtnsNSL","ctCheckAjax","allowAjaxNextendSocialLogin","childBtn","forbiddenAjaxNextendSocialLogin","elemForMsg","insertAdjacentElement","getElementsByName","formObj","firstChild","diviRedirectedSignSet","elems","submitButton","formNew","mauticIntegration","submButton","catchDynamicRenderedFormHandler","neededFormIds","formIdAttr","apbct_external_onsubmit_prev","sendAjaxCheckingDynamicFormData","stopImmediatePropagation","formEvent","timerId","multiple","option","map"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACvB,UAApB,OAAOA,GACfM,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAS,GAAKD,GACS,UAApB,OAAOA,GACfM,KAAKN,SAAWA,EAChBM,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,S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AG1E,SAAW0E,EAAG6Q,SACV7Q,EAAG1E,QACLnf,OAAO,GAAY20B,EAAOtnB,QAAQ,EAClCunB,IAAI,GAAYD,EAAOj1B,KAAK,EACd,aAAZmkB,EAAGxJ,MAAmC,UAAZwJ,EAAGxJ,KAC7BwJ,EAAGkM,SAAuB,KAE1BlM,EAAGnkB,KAElB"} \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index 13b6b0d0..2d264fbf 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1,2 +1,2 @@ -class ApbctCore{ajax_parameters={};restParameters={};selector=null;elements=[];eventCallback;eventSelector;event;constructor(e){this.select(e)}select(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"==typeof e?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}addElement(e){"object"==typeof e?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}push(e){this.elements.push(e)}reduce(){this.elements=this.elements.slice(0,-1)}deselect(){this.elements=[]}css(o,t){if(t=t||!1,"object"==typeof o){for(let t in o)if(Object.hasOwn(o,t)){var a=t.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));for(let e=0;e(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||=e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||=Boolean(e[t]):o||=null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)),o}isWithoutSelector(e,t){var o;let a=!1;for(o of document.querySelectorAll(t))a||=e===o;return a}filter(t){this.selector=null;for(let e=this.elements.length-1;0<=e;e--)this.isElem(this.elements[e],t)||this.elements.splice(Number(e),1);return this}parent(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}parents(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}children(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}siblings(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}remove(){for(var e of this.elements)e.remove()}after(e){for(var t of this.elements)t.after(e)}append(e){for(var t of this.elements)t.append(e)}fadeIn(a){for(let o of this.elements){o.style.opacity=0,o.style.display="block";let e=+new Date,t=function(){o.style.opacity=+o.style.opacity+(new Date-e)/a,e=+new Date,+o.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16))};t()}}fadeOut(a){for(let o of this.elements){o.style.opacity=1;let e=+new Date,t=function(){o.style.opacity=+o.style.opacity-(new Date-e)/a,e=+new Date,0<+o.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16):o.style.display="none"};t()}}}function ctProcessError(e,t){var o={},e=(e&&e.message?o.err={msg:e.message,file:e.fileName||!1,ln:e.lineNumber||lineNo||!1,col:e.columnNumber||columnNo||!1,stacktrace:e.stack||!1,cause:!!t&&JSON.stringify(t),errorObj:error||!1}:(o.err={msg:e},t&&(o.err.file=t)),o.url=window.location.href,o.userAgent=window.navigator.userAgent,"ct_js_errors");let a=localStorage.getItem(e);null===a&&(a="[]"),a=JSON.parse(a);for(let e=0;et.test(e.id)));a.forEach(e=>{this.elements.push(e)}),(a=Array.from(e).filter(e=>o.test(e.className))).forEach(e=>{this.elements.push(e)});var c,n,e=document.querySelector(".apbct_form_decoration");e&&(c=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after"),c)&&n&&this.elements.push(e)}setDecorationBackground(){var e=document.querySelectorAll("#respond");if(document.querySelector('[class*="apbct_form_decoration"]')){var o=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class"),a=o.indexOf("_header__wrapper");let t=o.substring(0,a);e.forEach(e=>{e.className+=" "+t})}}setListeners(){this.elements.forEach(i=>{i&&(i.addEventListener("click",e=>{var t,o,a,c,n;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(e{setTimeout(()=>{window.getSelection().toString()&&this.addSelected()},100)}),i.addEventListener("mousemove",e=>{var t,o,a,c,n;(-1===i.className.indexOf("apbct_form_decoration")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,aMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;ethis.checkBotCallback(e)}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:e=>this.checkBotCallback(e)}))}checkBotCallback(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"==typeof e&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}decodeForms(){let t;this.wrappers.forEach(e=>{t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}showMessageForBot(t){let o;this.wrappers.forEach(e=>{(o=e.querySelector("div.ct-encoded-form").dataset.encodedForm)&&(e.outerHTML='
'+t+"
")})}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((e,t)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3),document.querySelectorAll("[data-original-string]"));if((ctPublic.encodedEmailNodes=c).length)for(let e=0;ectSearchFormOnSubmitHandler(e,t));apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){if(ctPublic.settings__data__bot_detector_enabled){let e=setInterval(()=>{!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use((e,t)=>("object"==typeof e&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{null!==e&&e.parentNode.removeChild(e),"function"==typeof c.apbctSearchPrevOnsubmit?c.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(c)},i=l,null!==t&&null!==o&&(i.apbct_search_form__honeypot_value=t,i.apbct_search_form__honeypot_id=o),i.ct_bot_detector_event_token=s,"string"==typeof i.apbct_pixel_url&&-1!==i.apbct_pixel_url.indexOf("%3A")&&(i.apbct_pixel_url=decodeURIComponent(i.apbct_pixel_url)),void 0!==(r=JSON.stringify(i))&&0!==r.length?ctSetAlternativeCookie(r,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o,a,c,n=document.getElementById("apbct_popup");n?(n.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((n=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),n.setAttribute("id","apbct_popup"),(t=document.createElement("span")).classList="apbct-email-encoder-elements_center",(o=document.createElement("p")).innerText=ctPublic.wl_brandname,o.setAttribute("class","apbct-email-encoder--popup-header"),t.append(o),(o=document.createElement("div")).setAttribute("id","apbct_popup_text"),o.setAttribute("class","apbct-email-encoder-elements_center"),o.style.color="black",(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",a.innerText="The magic is on the way, please wait for a few seconds!",a.setAttribute("class","apbct-email-encoder-elements_center"),(c=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",c.innerText="Decoding process to the original data.",o.append(a),o.append(c),n.append(t),n.append(o),n.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(n)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],o=document.createElement("div");o.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===r.dataset.originalString&&(t=e)});var o=t.decoded_email.split(/[&?]/)[0],a=e.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),o=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=o,c.title="Click to select the whole data",a&&(a.innerHTML="The original one is "+c.outerHTML,a.setAttribute("style","flex-direction: row;")),e.querySelector(".apbct-ee-animation-wrapper")),c=(o&&o.remove(),e.querySelector("#apbct_email_ecoder__popup_text_node_second")),a=(c&&c.remove(),document.createElement("span"));a.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||((o=document.createElement("button")).innerText="Got it",o.classList="apbct-email-encoder-got-it-button",o.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),e.setAttribute("style","display:none"),fillDecodedEmails(i,n),ctPublic.encodedEmailNodesIsMixed&&r.click()}),a.append(o),e.append(a))}},3e3):n.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+n.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+n.data[0].comment))}function fillDecodedEmails(a,e){for(let o=0;o{e.encoded_email===a[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;var c,n;void 0!==a[o].href&&0===a[o].href.indexOf("mailto:")?(c=a[o].href.replace("mailto:",""),n=a[o].innerHTML,a[o].innerHTML=n.replace(c,t.decoded_email),a[o].href="mailto:"+t.decoded_email,a[o].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let o="";e.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(a[o].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,a[o])},2e3)),a[o].removeEventListener("click",ctFillDecodedEmailHandler)}}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),r=apbctSessionStorage.get("apbct_site_referer"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),s=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),_=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),f=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(o.ct_mouse_moved=void 0!==e?e:p,o.ct_has_scrolled=void 0!==a?a:m,o.ct_cookies_type=void 0!==c?c:_,o.apbct_pixel_url=void 0!==s?s:b,o.apbct_headless=void 0!==d?d:f,o.ct_bot_detector_frontend_data_log=void 0!==u?u:"",o.apbct_pixel_url&&"string"==typeof o.apbct_pixel_url&&o.apbct_pixel_url.indexOf("%3A%2F")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),o.apbct_page_hits=n,o.apbct_prev_referer=i,o.apbct_site_referer=r,o.apbct_ct_js_errors=l,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t)for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],a="",c=0,n="",i=0,o=[];for(var r in e.elements)isNaN(+r)||(t[r]=e.elements[r]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(a+=" "+e.getAttribute("name"),c++):(n+=" "+e.getAttribute("name"),i++))}),n=n.trim(),{visible_fields:a=a.trim(),visible_fields_count:c,invisible_fields:n,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var a in o){if(10{a.addEventListener("click",function(e){let t=a.getAttribute("href");var o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",t+="ct_bot_detector_event_token="+o,a.setAttribute("href",t))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(var t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+a+"}",r.innerHTML+="#cleantalk-modal-close:before{"+c+"}",r.innerHTML+="#cleantalk-modal-close:after{"+n+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),c=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?(n=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?c.innerHTML=this.loaded:c.innerHTML=this.loaded.replace(n,'
$1')):(c.innerHTML="Loading...",this.load("get_options_template")),c.setAttribute("id","cleantalk-modal-content"),t.append(c),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(let e=0;e{a.forEach(e=>{t.name===e.name&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})}):o.forEach(t=>{a.forEach(e=>{t.outerHTML===e.outerHTML&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})})}function ctProtectKlaviyoForm(){if(document.querySelector('link[rel="dns-prefetch"][href="//static.klaviyo.com"]')){let t=setInterval(()=>{var e=document.querySelectorAll("form.klaviyo-form");e.length&&(clearInterval(t),e.forEach((e,t)=>{apbctProcessExternalFormKlaviyo(e,t,document)}))},500)}}function apbctProcessExternalFormKlaviyo(t,e,o){var a,c=t.querySelector('button[type="button"].needsclick');c&&(c.disabled=!0,(a=document.createElement("input")).name="action",a.value="cleantalk_force_ajax_check",a.type="hidden",t.appendChild(a),(a=document.createElement("div")).id="apbct-klaviyo-cover",a.style.width="100%",a.style.height="100%",a.style.background="black",a.style.opacity=0,a.style.position="absolute",a.style.top=0,a.style.cursor="pointer",a.onclick=function(e){sendAjaxCheckingFormData(t)},c.parentNode.style.position="relative",c.parentNode.appendChild(a))}function ctProtectOutsideIframe(){var e=document.querySelectorAll("iframe");0 strong');0!==t.length&&(t.forEach((e,t)=>{var o,a=document.createElement("div"),c=(a.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),n=(c.setAttribute("src",s.imgPersonUrl),c.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(n.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),d&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),n.append(i,r),a.append(c),e.append(a),e.append(n)}),document.querySelectorAll(".apbct-real-user-badge").forEach(o=>{let a=void 0,e=(o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){a=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){a=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(()=>{var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}),apbctLocalStorage.set("apbct_iframes_protected",[]),window.addEventListener("load",function(){+ctPublic.settings__forms__check_external&&(setTimeout(function(){ctProtectExternal(),catchDynamicRenderedForm(),catchNextendSocialLoginForm(),ctProtectOutsideIframe()},2e3),ctProtectKlaviyoForm())});let ctProtectOutsideIframeCheck;function ctProtectOutsideIframeHandler(e){var t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.background="black",t.style.opacity=0,t.style.position="absolute",t.style.top=0,t.onclick=function(t){if(void 0===ctProtectOutsideIframeCheck){var t=t.currentTarget,o=(t.style.opacity=.5,document.createElement("div"));o.className="apbct-iframe-preloader",t.appendChild(o);let e="";document.querySelector('[name*="ct_bot_detector_event_token"]')&&(e=document.querySelector('[name*="ct_bot_detector_event_token"]').value),apbct_public_sendAJAX({action:"cleantalk_outside_iframe_ajax_check",ct_no_cookie_hidden_field:getNoCookieData(),ct_bot_detector_event_token:e},{async:!1,callback:function(t){!(ctProtectOutsideIframeCheck=!0)===t.apbct.blocked?document.querySelectorAll("div.apbct-iframe-preloader").forEach(function(e){e.parentNode.remove()}):(document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.parentNode.style.color="white",e.parentNode.innerHTML+=t.apbct.comment}),document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.remove()}))}})}},e.parentNode.style.position="relative",e.parentNode.appendChild(t);let o=apbctLocalStorage.get("apbct_iframes_protected");!1===o&&(o=[]),void 0!==e.id&&(o.push(e.id),apbctLocalStorage.set("apbct_iframes_protected",o))}function catchNextendSocialLoginForm(){var e=document.getElementById("nsl-custom-login-form-main");e&&blockBtnNextendSocialLogin(e)}function blockBtnNextendSocialLogin(e){var t=e.querySelectorAll(".nsl-container-buttons a"),e=e.querySelectorAll('a[data-plugin="nsl"] .nsl-button');t.forEach(e=>{e.setAttribute("data-oauth-login-blocked","true"),e.addEventListener("click",e=>{e.preventDefault()})}),e.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),ctCheckAjax(t)})})}function allowAjaxNextendSocialLogin(e){e.parentElement.setAttribute("data-oauth-login-blocked","false"),e.parentElement.click()}function forbiddenAjaxNextendSocialLogin(e,t){var o,e=e.parentElement;"false"==e.getAttribute("data-oauth-login-blocked")&&e.setAttribute("data-oauth-login-blocked","true"),document.querySelector(".ct-forbidden-msg")||((o=document.createElement("div")).className="ct-forbidden-msg",o.style.background="red",o.style.color="white",o.style.padding="5px",o.innerHTML=t,e.insertAdjacentElement("beforebegin",o))}function ctCheckAjax(t){apbct_public_sendAJAX({action:"cleantalk_nsl_ajax_check",ct_no_cookie_hidden_field:document.getElementsByName("ct_no_cookie_hidden_field")[0].value},{async:!1,callback:function(e){!1===e.apbct.blocked?allowAjaxNextendSocialLogin(t):forbiddenAjaxNextendSocialLogin(t,e.apbct.comment)}})}function isIntegratedForm(e){var t="string"==typeof e.action?e.action:"",o=null!==e.getAttribute("id")?e.getAttribute("id"):"";return!!(-1!==t.indexOf("app.convertkit.com")||-1!==t.indexOf("app.kit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_")||-1!==o.indexOf("ihf-contact-request-form")||-1!==t.indexOf("crm.zoho.com")||-1!==o.indexOf("delivra-external-form")||-1!==t.indexOf("eloqua.com")||-1!==t.indexOf("kulahub.net")||isFormHasDiviRedirect(e)||-1!==t.indexOf("eocampaign1.com")||-1!==t.indexOf("wufoo.com")||void 0!==e.classList&&e.classList.contains("sp-element-container"))}function isFormHasDiviRedirect(e){let t=!1;var o=document.querySelector('div[id^="et_pb_contact_form"]');return t="object"==typeof e&&null!==e&&null!==o&&o.hasAttribute("data-redirect_url")&&""!==o.getAttribute("data-redirect_url")&&null!==o.querySelector('form[class^="et_pb_contact_form"]')?e===o.querySelector('form[class^="et_pb_contact_form"]'):t}function sendAjaxCheckingFormData(p){var e={};e[0]=apbct_collect_visible_fields(p),apbct_visible_fields_set_cookie(e);let o={ct_bot_detector_event_token:apbctLocalStorage.get("bot_detector_event_token")};e=p.elements;(e=Array.prototype.slice.call(e)).forEach(function(e,t){""===e.name?o["input_"+t]=e.value:o[e.name]=e.value}),apbct_public_sendAJAX(o,{async:!1,callback:function(e,t,o,a){if(apbctMoosendSpinnerToggle(p),void 0===e.apbct||!+e.apbct.blocked){for(var c of p.querySelectorAll('input[name="apbct_visible_fields"]'))c.remove();for(var n of p.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))n.remove();for(var i of p.querySelectorAll('input[name="ct_no_cookie_hidden_field"]'))i.remove();if(void 0!==p.classList&&p.classList.contains("klaviyo-form"))return(s=document.getElementById("apbct-klaviyo-cover"))&&s.remove(),void((s=p.querySelector('button[type="button"].needsclick'))&&(s.disabled=!1,s.click()));if(void 0!==p.dataset.mailingListId){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),void(e=p.querySelector('[type="submit"]')).click()}if(p.hasAttribute("action")&&-1!==p.getAttribute("action").indexOf("webto.salesforce.com")){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}if(p.querySelector('[href*="activecampaign"]')){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}var r,l,s=p,d=(p.parentElement.removeChild(p),p.apbctPrev),u=p.apbctFormOriginal;let e=!1;apbctReplaceInputsValuesFromOtherForm(s,u),-1!==u.id.indexOf("mautic")&&(e=!0),d.after(u);for(r of u.querySelectorAll('input[name="apbct_visible_fields"]'))r.remove();for(l of u.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))l.remove();let t=u.querySelectorAll("button[type=submit]");if(0!==t.length)return t[0].click(),void(e&&setTimeout(function(){ctProtectExternal()},1500));if(0!==(t=u.querySelectorAll("input[type=submit]")).length)return void t[0].click();if(0!==(t=u.querySelectorAll('button[data-element="submit"]')).length)return void t[0].click();0!==(t=u.querySelectorAll('input[type="image"][name="submit"]')).length&&t[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function catchDynamicRenderedForm(){catchDynamicRenderedFormHandler(document.getElementsByTagName("form"));var t=document.getElementsByTagName("iframe");if(0e.selected).map(e=>e.value):"checkbox"===e.type||"radio"===e.type?e.checked||null:e.value}function ctCheckInternal(t){var e={},o=t.elements;let a;for(a in o)"submit"!==o[a].type&&void 0!==o[a].value&&""!==o[a].value&&(e[o[a].name]=t.elements[a].value);e.action="ct_check_internal",apbct_public_sendAJAX(e,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctCheckInternalIsExcludedForm(t){return["wp-login.php","wp-comments-post.php"].some(e=>null!==t.match(new RegExp(ctPublic.blog_home+".*"+e)))}document.addEventListener("DOMContentLoaded",function(){let o="",a="";+ctPublic.settings__forms__check_internal&&setTimeout(()=>{for(let e=0;ee.toUpperCase().replace("-","").replace("_",""));for(let e=0;et.test(e.id));c.forEach(e=>{this.elements.push(e)}),(c=Array.from(e).filter(e=>o.test(e.className))).forEach(e=>{this.elements.push(e)});var a,n,e=document.querySelector(".apbct_form_decoration");e&&(a=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after"),a)&&n&&this.elements.push(e)}setDecorationBackground(){var e=document.querySelectorAll("#respond");if(document.querySelector('[class*="apbct_form_decoration"]')){var o=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class"),c=o.indexOf("_header__wrapper");let t=o.substring(0,c);e.forEach(e=>{e.className+=" "+t})}}setListeners(){this.elements.forEach(i=>{i&&(i.addEventListener("click",e=>{var t,o,c,a,n;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,c=parseFloat(window.getComputedStyle(i,"::before").height)/2,a=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(e{setTimeout(()=>{window.getSelection().toString()&&this.addSelected()},100)}),i.addEventListener("mousemove",e=>{var t,o,c,a,n;(-1===i.className.indexOf("apbct_form_decoration")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,c=parseFloat(window.getComputedStyle(i,"::before").height)/2,a=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,cMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;ethis.checkBotCallback(e)}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:e=>this.checkBotCallback(e)}))}checkBotCallback(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"==typeof e&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}decodeForms(){let t;this.wrappers.forEach(e=>{t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}showMessageForBot(t){let o;this.wrappers.forEach(e=>{(o=e.querySelector("div.ct-encoded-form").dataset.encodedForm)&&(e.outerHTML='
'+t+"
")})}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((e,t)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3),document.querySelectorAll("[data-original-string]"));if((ctPublic.encodedEmailNodes=a).length)for(let e=0;ectSearchFormOnSubmitHandler(e,n));apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){if(ctPublic.settings__data__bot_detector_enabled){const e=setInterval(()=>{!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use((e,t)=>("object"==typeof e&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{null!==s&&s.parentNode.removeChild(s),"function"==typeof c.apbctSearchPrevOnsubmit?c.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(c)},n=r,null!==e&&null!==t&&(n.apbct_search_form__honeypot_value=e,n.apbct_search_form__honeypot_id=t),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(i=JSON.stringify(n))&&0!==i.length?ctSetAlternativeCookie(i,{callback:a,onErrorCallback:a,forceAltCookies:!0}):a())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o,c,a,n=document.getElementById("apbct_popup");n?(n.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((n=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),n.setAttribute("id","apbct_popup"),(t=document.createElement("span")).classList="apbct-email-encoder-elements_center",(o=document.createElement("p")).innerText=ctPublic.wl_brandname,o.setAttribute("class","apbct-email-encoder--popup-header"),t.append(o),(o=document.createElement("div")).setAttribute("id","apbct_popup_text"),o.setAttribute("class","apbct-email-encoder-elements_center"),o.style.color="black",(c=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",c.innerText="The magic is on the way, please wait for a few seconds!",c.setAttribute("class","apbct-email-encoder-elements_center"),(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",a.innerText="Decoding process to the original data.",o.append(c),o.append(a),n.append(t),n.append(o),n.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(n)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],o=document.createElement("div");o.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===r.dataset.originalString&&(t=e)});var o=t.decoded_email.split(/[&?]/)[0],c=e.querySelector("#apbct_email_ecoder__popup_text_node_first"),a=document.createElement("b"),o=(a.setAttribute("class","apbct-email-encoder-select-whole-email"),a.innerText=o,a.title="Click to select the whole data",c&&(c.innerHTML="The original one is "+a.outerHTML,c.setAttribute("style","flex-direction: row;")),e.querySelector(".apbct-ee-animation-wrapper")),a=(o&&o.remove(),e.querySelector("#apbct_email_ecoder__popup_text_node_second")),c=(a&&a.remove(),document.createElement("span"));c.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||((o=document.createElement("button")).innerText="Got it",o.classList="apbct-email-encoder-got-it-button",o.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),e.setAttribute("style","display:none"),fillDecodedEmails(i,n),ctPublic.encodedEmailNodesIsMixed&&r.click()}),c.append(o),e.append(c))}},3e3):n.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+n.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+n.data[0].comment))}function fillDecodedEmails(c,e){for(let o=0;o{e.encoded_email===c[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;var a,n;void 0!==c[o].href&&0===c[o].href.indexOf("mailto:")?(a=c[o].href.replace("mailto:",""),n=c[o].innerHTML,c[o].innerHTML=n.replace(a,t.decoded_email),c[o].href="mailto:"+t.decoded_email,c[o].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let o="";e.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(c[o].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,c[o])},2e3)),c[o].removeEventListener("click",ctFillDecodedEmailHandler)}}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),a=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),r=apbctSessionStorage.get("apbct_site_referer"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),s=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),_=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),f=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(o.ct_mouse_moved=void 0!==e?e:p,o.ct_has_scrolled=void 0!==c?c:m,o.ct_cookies_type=void 0!==a?a:_,o.apbct_pixel_url=void 0!==s?s:b,o.apbct_headless=void 0!==d?d:f,o.ct_bot_detector_frontend_data_log=void 0!==u?u:"",o.apbct_pixel_url&&"string"==typeof o.apbct_pixel_url&&o.apbct_pixel_url.indexOf("%3A%2F")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),o.apbct_page_hits=n,o.apbct_prev_referer=i,o.apbct_site_referer=r,o.apbct_ct_js_errors=l,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t)for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],c="",a=0,n="",i=0,o=[];for(var r in e.elements)isNaN(+r)||(t[r]=e.elements[r]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(c+=" "+e.getAttribute("name"),a++):(n+=" "+e.getAttribute("name"),i++))}),n=n.trim(),{visible_fields:c=c.trim(),visible_fields_count:a,invisible_fields:n,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var c in o){if(10{c.addEventListener("click",function(e){let t=c.getAttribute("href");var o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",t+="ct_bot_detector_event_token="+o,c.setAttribute("href",t))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,c){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(const t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},c={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+c+"}",r.innerHTML+="#cleantalk-modal-close:before{"+a+"}",r.innerHTML+="#cleantalk-modal-close:after{"+n+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),c=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(c.setAttribute("id","cleantalk-modal-close"),t.append(c),document.createElement("div"));this.loaded?(n=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(n,'$1')):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(let e=0;e{c.forEach(e=>{t.name===e.name&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})}):o.forEach(t=>{c.forEach(e=>{t.outerHTML===e.outerHTML&&("checkbox"===e.type||"radio"===e.type?e.checked=apbctVal(t):e.value=apbctVal(t))})})}function ctProtectKlaviyoForm(){if(document.querySelector('link[rel="dns-prefetch"][href="//static.klaviyo.com"]')){let t=setInterval(()=>{var e=document.querySelectorAll("form.klaviyo-form");e.length&&(clearInterval(t),e.forEach((e,t)=>{apbctProcessExternalFormKlaviyo(e,t,document)}))},500)}}function apbctProcessExternalFormKlaviyo(t,e,o){var c,a=t.querySelector('button[type="button"].needsclick');a&&(a.disabled=!0,(c=document.createElement("input")).name="action",c.value="cleantalk_force_ajax_check",c.type="hidden",t.appendChild(c),(c=document.createElement("div")).id="apbct-klaviyo-cover",c.style.width="100%",c.style.height="100%",c.style.background="black",c.style.opacity=0,c.style.position="absolute",c.style.top=0,c.style.cursor="pointer",c.onclick=function(e){sendAjaxCheckingFormData(t)},a.parentNode.style.position="relative",a.parentNode.appendChild(c))}function ctProtectOutsideIframe(){var e=document.querySelectorAll("iframe");0 strong');0!==t.length&&(t.forEach((e,t)=>{var o,c=document.createElement("div"),a=(c.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),n=(a.setAttribute("src",s.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(n.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),d&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),n.append(i,r),c.append(a),e.append(c),e.append(n)}),document.querySelectorAll(".apbct-real-user-badge").forEach(o=>{let c=void 0;o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){c=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)});const e=o.nextElementSibling;e.addEventListener("mouseenter",function(){clearTimeout(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){c=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=setTimeout(()=>{var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}),apbctLocalStorage.set("apbct_iframes_protected",[]),window.addEventListener("load",function(){+ctPublic.settings__forms__check_external&&(setTimeout(function(){ctProtectExternal(),catchDynamicRenderedForm(),catchNextendSocialLoginForm(),ctProtectOutsideIframe()},2e3),ctProtectKlaviyoForm())});let ctProtectOutsideIframeCheck;function ctProtectOutsideIframeHandler(e){var t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.background="black",t.style.opacity=0,t.style.position="absolute",t.style.top=0,t.onclick=function(t){if(void 0===ctProtectOutsideIframeCheck){var t=t.currentTarget,o=(t.style.opacity=.5,document.createElement("div"));o.className="apbct-iframe-preloader",t.appendChild(o);let e="";document.querySelector('[name*="ct_bot_detector_event_token"]')&&(e=document.querySelector('[name*="ct_bot_detector_event_token"]').value),apbct_public_sendAJAX({action:"cleantalk_outside_iframe_ajax_check",ct_no_cookie_hidden_field:getNoCookieData(),ct_bot_detector_event_token:e},{async:!1,callback:function(t){!(ctProtectOutsideIframeCheck=!0)===t.apbct.blocked?document.querySelectorAll("div.apbct-iframe-preloader").forEach(function(e){e.parentNode.remove()}):(document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.parentNode.style.color="white",e.parentNode.innerHTML+=t.apbct.comment}),document.querySelectorAll("div.apbct-iframe-preloader").forEach(e=>{e.remove()}))}})}},e.parentNode.style.position="relative",e.parentNode.appendChild(t);let o=apbctLocalStorage.get("apbct_iframes_protected");!1===o&&(o=[]),void 0!==e.id&&(o.push(e.id),apbctLocalStorage.set("apbct_iframes_protected",o))}function catchNextendSocialLoginForm(){var e=document.getElementById("nsl-custom-login-form-main");e&&blockBtnNextendSocialLogin(e)}function blockBtnNextendSocialLogin(e){var t=e.querySelectorAll(".nsl-container-buttons a"),e=e.querySelectorAll('a[data-plugin="nsl"] .nsl-button');t.forEach(e=>{e.setAttribute("data-oauth-login-blocked","true"),e.addEventListener("click",e=>{e.preventDefault()})}),e.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),ctCheckAjax(t)})})}function allowAjaxNextendSocialLogin(e){e.parentElement.setAttribute("data-oauth-login-blocked","false"),e.parentElement.click()}function forbiddenAjaxNextendSocialLogin(e,t){var o,e=e.parentElement;"false"==e.getAttribute("data-oauth-login-blocked")&&e.setAttribute("data-oauth-login-blocked","true"),document.querySelector(".ct-forbidden-msg")||((o=document.createElement("div")).className="ct-forbidden-msg",o.style.background="red",o.style.color="white",o.style.padding="5px",o.innerHTML=t,e.insertAdjacentElement("beforebegin",o))}function ctCheckAjax(t){apbct_public_sendAJAX({action:"cleantalk_nsl_ajax_check",ct_no_cookie_hidden_field:document.getElementsByName("ct_no_cookie_hidden_field")[0].value},{async:!1,callback:function(e){!1===e.apbct.blocked?allowAjaxNextendSocialLogin(t):forbiddenAjaxNextendSocialLogin(t,e.apbct.comment)}})}function isIntegratedForm(e){var t="string"==typeof e.action?e.action:"",o=null!==e.getAttribute("id")?e.getAttribute("id"):"";return!!(-1!==t.indexOf("app.convertkit.com")||-1!==t.indexOf("app.kit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_")||-1!==o.indexOf("ihf-contact-request-form")||-1!==t.indexOf("crm.zoho.com")||-1!==o.indexOf("delivra-external-form")||-1!==t.indexOf("eloqua.com")||-1!==t.indexOf("kulahub.net")||isFormHasDiviRedirect(e)||-1!==t.indexOf("eocampaign1.com")||-1!==t.indexOf("wufoo.com")||void 0!==e.classList&&e.classList.contains("sp-element-container"))}function isFormHasDiviRedirect(e){let t=!1;var o=document.querySelector('div[id^="et_pb_contact_form"]');return t="object"==typeof e&&null!==e&&null!==o&&o.hasAttribute("data-redirect_url")&&""!==o.getAttribute("data-redirect_url")&&null!==o.querySelector('form[class^="et_pb_contact_form"]')?e===o.querySelector('form[class^="et_pb_contact_form"]'):t}function sendAjaxCheckingFormData(p){var e={};e[0]=apbct_collect_visible_fields(p),apbct_visible_fields_set_cookie(e);const o={ct_bot_detector_event_token:apbctLocalStorage.get("bot_detector_event_token")};e=p.elements;(e=Array.prototype.slice.call(e)).forEach(function(e,t){""===e.name?o["input_"+t]=e.value:o[e.name]=e.value}),apbct_public_sendAJAX(o,{async:!1,callback:function(e,t,o,c){if(apbctMoosendSpinnerToggle(p),void 0===e.apbct||!+e.apbct.blocked){for(const r of p.querySelectorAll('input[name="apbct_visible_fields"]'))r.remove();for(const l of p.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))l.remove();for(const s of p.querySelectorAll('input[name="ct_no_cookie_hidden_field"]'))s.remove();if(void 0!==p.classList&&p.classList.contains("klaviyo-form"))return(a=document.getElementById("apbct-klaviyo-cover"))&&a.remove(),void((a=p.querySelector('button[type="button"].needsclick'))&&(a.disabled=!1,a.click()));if(void 0!==p.dataset.mailingListId){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),void(e=p.querySelector('[type="submit"]')).click()}if(p.hasAttribute("action")&&-1!==p.getAttribute("action").indexOf("webto.salesforce.com")){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}if(p.querySelector('[href*="activecampaign"]')){let e=p.querySelector('[type="submit"]');return e.remove(),p.apbctParent.appendChild(p.submitButtonOriginal),p.onsubmit=p.onsubmitOriginal,void(e=p.querySelector('[type="submit"]')).click()}var a=p,n=(p.parentElement.removeChild(p),p.apbctPrev),i=p.apbctFormOriginal;let e=!1;apbctReplaceInputsValuesFromOtherForm(a,i),-1!==i.id.indexOf("mautic")&&(e=!0),n.after(i);for(const d of i.querySelectorAll('input[name="apbct_visible_fields"]'))d.remove();for(const u of i.querySelectorAll('input[value="cleantalk_force_ajax_check"]'))u.remove();let t=i.querySelectorAll("button[type=submit]");if(0!==t.length)return t[0].click(),void(e&&setTimeout(function(){ctProtectExternal()},1500));if(0!==(t=i.querySelectorAll("input[type=submit]")).length)return void t[0].click();if(0!==(t=i.querySelectorAll('button[data-element="submit"]')).length)return void t[0].click();0!==(t=i.querySelectorAll('input[type="image"][name="submit"]')).length&&t[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function catchDynamicRenderedForm(){catchDynamicRenderedFormHandler(document.getElementsByTagName("form"));var t=document.getElementsByTagName("iframe");if(0e.selected).map(e=>e.value):"checkbox"===e.type||"radio"===e.type?e.checked||null:e.value}function ctCheckInternal(t){var e={},o=t.elements;let c;for(c in o)"submit"!==o[c].type&&void 0!==o[c].value&&""!==o[c].value&&(e[o[c].name]=t.elements[c].value);e.action="ct_check_internal",apbct_public_sendAJAX(e,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctCheckInternalIsExcludedForm(t){return["wp-login.php","wp-comments-post.php"].some(e=>null!==t.match(new RegExp(ctPublic.blog_home+".*"+e)))}document.addEventListener("DOMContentLoaded",function(){let o="",c="";+ctPublic.settings__forms__check_internal&&setTimeout(()=>{for(let e=0;e\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ctJsErrors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Select actual WP nonce depending on the ajax type and the fresh nonce provided.\n * @return {string} url\n */\nfunction selectActualNonce() {\n let defaultNonce = '';\n // return fresh nonce immediately if persists\n if (\n ctPublicFunctions.hasOwnProperty('_fresh_nonce') &&\n typeof ctPublicFunctions._fresh_nonce === 'string' &&\n ctPublicFunctions._fresh_nonce.length > 0\n ) {\n return ctPublicFunctions._fresh_nonce;\n }\n // select from default rest/ajax nonces\n if (\n ctPublicFunctions.data__ajax_type === 'admin_ajax' &&\n ctPublicFunctions.hasOwnProperty('_ajax_nonce') &&\n typeof ctPublicFunctions._ajax_nonce === 'string' &&\n ctPublicFunctions._ajax_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._ajax_nonce;\n }\n if (\n ctPublicFunctions.data__ajax_type === 'rest' &&\n ctPublicFunctions.hasOwnProperty('_rest_nonce') &&\n typeof ctPublicFunctions._rest_nonce === 'string' &&\n ctPublicFunctions._rest_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._rest_nonce;\n }\n\n return defaultNonce;\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n if (this.isWpNonceError()) {\n this.getFreshNonceAndRerunXHR(parameters);\n return;\n }\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * Check if 403 code of WP nonce error\n * @return {bool}\n */\n isWpNonceError() {\n let restErrror = false;\n let ajaxErrror = false;\n // check rest error\n if (this.xhr.readyState == 4) {\n restErrror = (\n typeof this.xhr.response === 'object' && this.xhr.response !== null &&\n this.xhr.response.hasOwnProperty('data') &&\n this.xhr.response.data.hasOwnProperty('status') &&\n this.xhr.response.data.status === 403\n );\n ajaxErrror = this.xhr.response === '-1' && this.xhr.status === 403;\n }\n // todo check AJAX error\n return restErrror || ajaxErrror;\n }\n\n /**\n * Get the fresh nonce and rerun the initial XHR with params\n * @param {[]} initialRequestParams\n */\n getFreshNonceAndRerunXHR(initialRequestParams) {\n let noncePrev = '';\n\n // Check if initialRequestParams['headers']['X-WP-Nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('headers') &&\n initialRequestParams.headers.hasOwnProperty('X-WP-Nonce')\n ) {\n noncePrev = initialRequestParams['headers']['X-WP-Nonce'];\n }\n\n // Check if initialRequestParams['data']['_ajax_nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('data') &&\n initialRequestParams.data.hasOwnProperty('_ajax_nonce')\n ) {\n noncePrev = initialRequestParams['data']['_ajax_nonce'];\n }\n\n // Nonce is not provided. Exit.\n if ( noncePrev === '' ) {\n return;\n }\n\n // prepare params for refreshing nonce\n let params = {};\n params.method = 'POST';\n params.data = {\n 'spbc_remote_call_action': 'get_fresh_wpnonce',\n 'plugin_name': 'antispam',\n 'nonce_prev': noncePrev,\n 'initial_request_params': initialRequestParams,\n };\n params.notJson = true;\n params.url = ctPublicFunctions.host_url;\n // this callback will rerun the XHR with initial params\n params.callback = function(...args) {\n // the refresh result itself\n let freshNonceResult = args[0];\n let newRequestParams = false;\n // provided initial params\n if (args[1] !== undefined && args[1].hasOwnProperty('initial_request_params')) {\n newRequestParams = args[1].initial_request_params;\n }\n if (newRequestParams && freshNonceResult.hasOwnProperty('wpnonce')) {\n ctPublicFunctions._fresh_nonce = freshNonceResult.wpnonce;\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n new ApbctCore().rest(newRequestParams);\n } else {\n new ApbctCore().ajax(newRequestParams);\n }\n }\n };\n // run the nonce refreshing call\n new ApbctXhr(params);\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.data._ajax_nonce = selectActualNonce();\n super(args);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n const nonce = selectActualNonce();\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': nonce,\n };\n super(args);\n }\n}\n\n// add hasOwn\nif (!Object.prototype.hasOwn) {\n Object.defineProperty(Object.prototype, 'hasOwn', { // eslint-disable-line\n value: function(property) {\n return Object.prototype.hasOwnProperty.call(this, property);\n },\n enumerable: false,\n configurable: true,\n writable: true,\n });\n}\n\n/**\n * Form skin class\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctFormDecorator {\n elements = [];\n\n /**\n * Constructor\n */\n constructor() {\n this.getElements();\n this.setListeners();\n }\n\n /**\n * Get elements\n */\n getElements() {\n const elements = document.querySelectorAll('*');\n const regexId = /^apbct-trusted-text--label/;\n const regexClass = /apbct_form_decoration--/;\n\n this.setDecorationBackground();\n\n // Collect elements with id or class that contains apbct-trusted-text--label or apbct_form_decoration--\n // id\n let matchingElements = Array.from(elements).filter((element) => {\n return regexId.test(element.id);\n });\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n // class\n matchingElements = Array.from(elements).filter((element) => {\n return regexClass.test(element.className);\n });\n\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n const flagWrap = document.querySelector('.apbct_form_decoration');\n if (flagWrap) {\n const flagLeft = window.getComputedStyle(flagWrap, '::before');\n const flagRight = window.getComputedStyle(flagWrap, '::after');\n if (flagLeft && flagRight) {\n this.elements.push(flagWrap);\n }\n }\n }\n\n /**\n * Set decoration background\n */\n setDecorationBackground() {\n let blockForms = document.querySelectorAll('#respond');\n\n if (document.querySelector('[class*=\"apbct_form_decoration\"]')) {\n let classHeaderWrapper = document.querySelector('[class*=\"apbct_form_decoration\"]').getAttribute('class');\n let endPosition = classHeaderWrapper.indexOf('_header__wrapper');\n let classTemplate = classHeaderWrapper.substring(0, endPosition);\n\n blockForms.forEach((blockForm) => {\n blockForm.className += ' ' + classTemplate;\n });\n }\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elements.forEach((element) => {\n if (!element) {\n return;\n }\n\n element.addEventListener('click', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n if (element.className.indexOf('header__wrapper') !== -1) {\n this.addClicks();\n return;\n }\n\n const clickX = event.offsetX;\n const clickY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (element.className.indexOf('christmas') !== -1) {\n if (\n clickY < flagLeftHeight / 3 && clickX < flagLeftWidth ||\n clickY < flagRightHeight / 3 && clickX > flagRightWidth\n ) {\n this.addClicks();\n return;\n }\n }\n\n if (\n (element.className.indexOf('new-year') !== -1) ||\n (element.className.indexOf('fourth-july') !== -1)\n ) {\n if (\n clickY > flagLeftHeight && clickX < flagLeftWidth ||\n clickY > flagRightHeight && clickX > flagRightWidth\n ) {\n this.addClicks();\n }\n }\n\n if (element.className.indexOf('signature')) {\n this.addClicks();\n }\n\n return;\n }\n\n this.addClicks();\n });\n\n element.addEventListener('mouseup', (event) => {\n setTimeout(() => {\n const selectedText = window.getSelection().toString();\n if (selectedText) {\n this.addSelected();\n }\n }, 100);\n });\n\n element.addEventListener('mousemove', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n const mouseX = event.offsetX;\n const mouseY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (mouseY > flagLeftHeight && mouseX < flagLeftWidth ||\n mouseY > flagRightHeight && mouseX > flagRightWidth\n ) {\n this.trackMouseMovement();\n }\n return;\n }\n\n this.trackMouseMovement();\n });\n });\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.clicks) {\n document.ctFormDecorationMouseData.clicks++;\n } else {\n document.ctFormDecorationMouseData.clicks = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.selected) {\n document.ctFormDecorationMouseData.selected++;\n } else {\n document.ctFormDecorationMouseData.selected = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctFormDecorationMouseData) {\n document.ctFormDecorationMouseData = {};\n }\n if (!document.ctFormDecorationMouseData.mouseMovements) {\n document.ctFormDecorationMouseData.mouseMovements = [];\n }\n\n document.ctFormDecorationMouseData.mouseMovements.push({timestamp: Date.now()});\n\n if (document.ctFormDecorationMouseData.mouseMovements.length > 1) {\n const index = document.ctFormDecorationMouseData.mouseMovements.length - 1;\n const lastMovement = document.ctFormDecorationMouseData.mouseMovements[index];\n const firstMovement = document.ctFormDecorationMouseData.mouseMovements[0];\n const timeDiff = lastMovement.timestamp - firstMovement.timestamp;\n document.ctFormDecorationMouseData.hovering = timeDiff;\n }\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_bot_detector_exist',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], item[1]);\n }\n });\n\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n let bloomPopup = document.querySelectorAll('div[class^=\"et_bloom_form_container\"]').length > 0;\n let pafeFormsFormElementor = document.querySelectorAll('div[class*=\"pafe-form\"]').length > 0;\n let otterForm = document.querySelectorAll('div [class*=\"otter-form\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp ||\n pafeFormsFormElementor ||\n bloomPopup ||\n otterForm;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n if (!cookies.apbct_site_referer) {\n cookies.apbct_site_referer = location.href;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n const nonce = selectActualNonce();\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i this.checkBotCallback(result),\n });\n } else if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n data.action = 'apbct_force_protection_check_bot';\n apbct_public_sendAJAX(data, {callback: (result) => this.checkBotCallback(result)});\n }\n }\n\n /**\n * Check bot callback\n * @param {Object} result\n * @return {void}\n */\n checkBotCallback(result) {\n // if error occurred\n if (result.data && result.data.status && result.data.status !== 200) {\n console.log('ApbctForceProtection connection error occurred');\n this.decodeForms();\n return;\n }\n\n if (typeof result === 'string') {\n try {\n result = JSON.parse(result);\n } catch (e) {\n console.log('ApbctForceProtection decodeForms error', e);\n this.decodeForms();\n return;\n }\n }\n\n if (typeof result === 'object' && result.allow && result.allow === 1) {\n this.decodeForms();\n } else {\n this.showMessageForBot(result.message);\n }\n }\n\n /**\n * Decode forms\n * @return {void}\n */\n decodeForms() {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n\n try {\n if (form && typeof(form) == 'string') {\n wrapper.outerHTML = atob(form);\n }\n } catch (error) {\n console.log(error);\n }\n });\n }\n\n /**\n * Show message for bot\n * @param {string} message\n * @return {void}\n */\n showMessageForBot(message) {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n if (form) {\n wrapper.outerHTML = '
' + message + '
';\n }\n });\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctCheckedEmailsExist = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\nlet tokenCheckerIntervalId;\nlet botDetectorLogLastUpdate = 0;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Run cron jobs\n */\n// forms handler cron\ncronFormsHandler(2000);\n\n// bot_detector frontend_data log alt session saving cron\nif (\n ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&\n ctPublicFunctions.data__bot_detector_enabled == 1\n) {\n sendBotDetectorLogToAltSessions(500);\n}\n/**\n * Cron jobs end.\n */\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Send BotDetector logs data to alternative sessions.\n * If log_last_update has changed, the log will be sent to the alternative sessions.\n * @param {int} cronStartTimeout delay before cron start\n * @param {int} interval check fires on interval\n */\nfunction sendBotDetectorLogToAltSessions(cronStartTimeout = 3000, interval = 1000) {\n setTimeout(function() {\n setInterval(function() {\n const currentLog = apbctLocalStorage.get('ct_bot_detector_frontend_data_log');\n if (currentLog && currentLog.hasOwnProperty('log_last_update')) {\n if (botDetectorLogLastUpdate !== currentLog.log_last_update) {\n botDetectorLogLastUpdate = currentLog.log_last_update;\n // the log will be taken from javascriptclientdata\n ctSetAlternativeCookie([], {forceAltCookies: true});\n }\n }\n }, interval);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0 ||\n document.getElementById('login-form-popup') !== null\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmailExist(e) {\n let currentEmail = e.target.value;\n let result;\n\n if (!currentEmail || !currentEmail.length) {\n let envelope = document.getElementById('apbct-check_email_exist-block');\n if (envelope) {\n envelope.remove();\n }\n let hint = document.getElementById('apbct-check_email_exist-popup_description');\n if (hint) {\n hint.remove();\n }\n return;\n }\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail in ctCheckedEmailsExist) {\n result = ctCheckedEmailsExist[currentEmail];\n getResultCheckEmailExist(e, result, currentEmail);\n\n return;\n }\n\n viewCheckEmailExist(e, 'load');\n\n // Using REST API handler\n ctPublicFunctions.data__ajax_type = 'rest';\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n apbct_public_sendREST(\n 'check_email_exist_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n\n return;\n }\n\n if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_exist_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} e\n * @param {mixed} result\n * @param {string} currentEmail\n */\nfunction getResultCheckEmailExist(e, result, currentEmail) {\n if (!result || !result.result) {\n return;\n }\n\n result = result.result;\n\n ctCheckedEmailsExist[currentEmail] = {\n 'result': result,\n 'timestamp': Date.now() / 1000 |0,\n };\n\n if (result.result == 'EXISTS') {\n viewCheckEmailExist(e, 'good_email', result.text_result);\n } else {\n viewCheckEmailExist(e, 'bad_email', result.text_result);\n }\n\n ctSetCookie('ct_checked_emails_exist', JSON.stringify(ctCheckedEmailsExist));\n}\n\n/**\n * @param {mixed} e\n * @param {string} state\n * @param {string} textResult\n */\nfunction viewCheckEmailExist(e, state, textResult) {\n let parentElement = e.target.parentElement;\n let inputEmail = parentElement.querySelector('[name*=\"email\"]');\n\n if (!inputEmail) {\n return;\n }\n\n const envelopeWidth = 35;\n let envelope;\n let hint;\n\n // envelope\n if (document.getElementById('apbct-check_email_exist-block')) {\n envelope = document.getElementById('apbct-check_email_exist-block');\n } else {\n envelope = document.createElement('div');\n envelope.setAttribute('class', 'apbct-check_email_exist-block');\n envelope.setAttribute('id', 'apbct-check_email_exist-block');\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n envelope.style.left = inputEmail.getBoundingClientRect().right - envelopeWidth - 10 + 'px';\n envelope.style.height = inputEmail.offsetHeight + 'px';\n envelope.style.width = envelopeWidth + 'px';\n\n window.addEventListener('scroll', function() {\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n });\n\n parentElement.after(envelope);\n }\n\n // hint\n if (document.getElementById('apbct-check_email_exist-popup_description')) {\n hint = document.getElementById('apbct-check_email_exist-popup_description');\n } else {\n hint = document.createElement('div');\n hint.setAttribute('class', 'apbct-check_email_exist-popup_description');\n hint.setAttribute('id', 'apbct-check_email_exist-popup_description');\n hint.style.width = inputEmail.offsetWidth + 'px';\n hint.style.left = inputEmail.getBoundingClientRect().left + 'px';\n\n window.addEventListener('scroll', function() {\n hint.style.top = envelope.getBoundingClientRect().top + 'px';\n });\n\n envelope.after(hint);\n }\n\n switch (state) {\n case 'load':\n envelope.classList.remove('apbct-check_email_exist-good_email', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-load');\n break;\n\n case 'good_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-good_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#1C7129';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n case 'bad_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-good_email');\n envelope.classList.add('apbct-check_email_exist-bad_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#E01111';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n default:\n break;\n }\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n } else {\n // if Jquery is not avaliable try to use xhr\n if (typeof XMLHttpRequest !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n document.addEventListener('readystatechange', function(event) {\n if (event.target.readyState === 4) {\n ctPrepareBlockMessage(event.target);\n }\n });\n }\n }\n}\n\n/**\n * For forced alt cookies.\n * If token is not added to the LS on apbc_ready, check every second if so and send token to the alt sessions.\n */\nfunction startForcedAltEventTokenChecker() {\n tokenCheckerIntervalId = setInterval( function() {\n if (apbctLocalStorage.get('event_token_forced_set') === '1') {\n clearInterval(tokenCheckerIntervalId);\n return;\n }\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if (eventToken) {\n ctSetAlternativeCookie([['ct_bot_detector_event_token', eventToken]], {forceAltCookies: true});\n apbctLocalStorage.set('event_token_forced_set', '1');\n clearInterval(tokenCheckerIntervalId);\n } else {\n }\n }, 1000);\n}\n\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n document.addEventListener('gform_page_loaded', function() {\n if (\n typeof ctPublic.force_alt_cookies === 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n if (typeof setEventTokenField === 'function' && typeof botDetectorLocalStorage === 'function') {\n setEventTokenField(botDetectorLocalStorage.get('bot_detector_event_token'));\n }\n }\n });\n if ( ! ctPublic.wc_ajax_add_to_cart ) {\n apbctCheckAddToCartByGet();\n }\n\n apbctPrepareBlockForAjaxForms();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n if (ctPublic.data__cookies_type !== 'alternative') {\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n }\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( ctIsDrawPixel() ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if ( +ctPublic.data__email_check_exist_post) {\n initCookies.push(['ct_checked_emails_exist', '0']);\n apbct('comment-form input[name = \\'email\\'], input#email').on('blur', checkEmailExist);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n let tokenForForceAlt = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n ctPublic.settings__data__bot_detector_enabled\n ) {\n apbctLocalStorage.set('event_token_forced_set', '0');\n if (tokenForForceAlt) {\n initCookies.push(['ct_bot_detector_event_token', tokenForForceAlt]);\n apbctLocalStorage.set('event_token_forced_set', '1');\n } else {\n startForcedAltEventTokenChecker();\n }\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n ctAddWCMiddlewares();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n + ctPublic.settings__forms__search_test === 1 &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n // fibosearch integration\n if (_form.querySelector('input.dgwt-wcas-search-input')) {\n continue;\n }\n\n // this handles search forms onsubmit process\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n\n // Check any XMLHttpRequest connections\n apbctCatchXmlHttpRequest();\n\n // Init form skin\n if (ctPublic.settings__comments__form_decoration) {\n new ApbctFormDecorator();\n }\n\n // Set important paramaters via ajax if problematic cache solutions found\n apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists || ctPublic.varnishCacheExists);\n\n // Checking that the bot detector has loaded and received the event token for Anti-Crawler\n if (ctPublic.settings__sfw__anti_crawler) {\n checkBotDetectorExist();\n }\n}\n\n/**\n * Checking that the bot detector has loaded and received the event token\n */\nfunction checkBotDetectorExist() {\n if (ctPublic.settings__data__bot_detector_enabled) {\n const botDetectorIntervalSearch = setInterval(() => {\n let botDetectorEventToken = localStorage.bot_detector_event_token ? true : false;\n\n if (botDetectorEventToken) {\n ctSetCookie('apbct_bot_detector_exist', '1', '3600');\n clearInterval(botDetectorIntervalSearch);\n }\n }, 500);\n }\n}\n\n/**\n * Insert no_cookies_data to rest request\n */\nfunction ctAddWCMiddlewares() {\n const ctPinDataToRequest = (options, next) => {\n if (typeof options !== 'object' || options === null ||\n !options.hasOwnProperty('data') || !options.hasOwnProperty('path')\n ) {\n return next(options);\n }\n\n // add to cart\n if (options.data.hasOwnProperty('requests') &&\n options.data.requests.length > 0 &&\n options.data.requests[0].hasOwnProperty('path') &&\n options.data.requests[0].path === '/wc/store/v1/cart/add-item'\n ) {\n options.data.requests[0].data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n // checkout\n if (options.path === '/wc/store/v1/checkout') {\n options.data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n return next(options);\n };\n\n if (window.hasOwnProperty('wp') &&\n window.wp.hasOwnProperty('apiFetch') &&\n typeof window.wp.apiFetch.use === 'function'\n ) {\n window.wp.apiFetch.use(ctPinDataToRequest);\n }\n}\n\n/**\n * Insert event_token and no_cookies_data to some ajax request\n */\nfunction apbctCatchXmlHttpRequest() {\n // 1) Check the page if it needed to catch XHR\n if ( document.querySelector('div.wfu_container') !== null ) {\n const originalSend = XMLHttpRequest.prototype.send;\n XMLHttpRequest.prototype.send = function(body) {\n // 2) Check the caught request fi it needed to modify\n if (\n body &&\n typeof body === 'string' &&\n (\n body.indexOf('action=wfu_ajax_action_ask_server') !== -1\n )\n ) {\n let addidionalCleantalkData = '';\n let eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (\n eventToken !== null &&\n eventToken !== false &&\n eventToken.hasOwnProperty('value') &&\n eventToken.value !== ''\n ) {\n eventToken = eventToken.value;\n addidionalCleantalkData += '&' + 'data%5Bct_bot_detector_event_token%5D=' + eventToken;\n }\n\n let noCookieData = getNoCookieData();\n addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData;\n\n body += addidionalCleantalkData;\n\n return originalSend.apply(this, [body]);\n }\n return originalSend.apply(this, [body]);\n };\n }\n}\n\n/**\n * Run AJAX to set important_parameters on the site backend if problematic cache solutions are defined.\n * @param {boolean} cacheExist\n */\nfunction apbctAjaxSetImportantParametersOnCacheExist(cacheExist) {\n // Set important parameters via ajax\n if ( cacheExist ) {\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST('apbct_set_important_parameters', {});\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX({action: 'apbct_set_important_parameters'}, {});\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n // this is the only place where we can found hard dependency on jQuery, if the form use it - the script\n // will work independing if jQuery is loaded by CleanTalk or not\n let eventToken = false;\n if ( typeof jQuery !== 'undefined' && typeof jQuery.ajaxSetup === 'function') {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n\n if (settings.data.indexOf('action=new_activity_comment') !== -1) {\n sourceSign = 'action=new_activity_comment';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n if (localStorage.getItem('bot_detector_event_token') !== null) {\n eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (eventToken !== false && eventToken.hasOwnProperty('value') && eventToken.value !== '') {\n eventToken = eventToken.value;\n }\n }\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n if (typeof eventToken === 'string') {\n eventToken = 'data%5Bct_bot_detector_event_token%5D=' + eventToken + '&';\n } else {\n eventToken = '';\n }\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n\n settings.data = noCookieData + eventToken + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {object} targetForm\n */\nfunction ctSearchFormOnSubmitHandler(e, targetForm) {\n try {\n // get honeypot field and it's value\n const honeyPotField = targetForm.querySelector('[id*=\"apbct__email_id__\"]');\n let hpValue = null;\n let hpEventId = null;\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n // get cookie data from storages\n let cleantalkStorageDataArray = getCleanTalkStorageDataArray();\n\n // get event token from storage\n let eventTokenLocalStorage = apbctLocalStorage.get('bot_detector_event_token');\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( cleantalkStorageDataArray !== null || honeyPotField !== null || eventTokenLocalStorage !== null ) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n if (typeof targetForm.apbctSearchPrevOnsubmit === 'function') {\n targetForm.apbctSearchPrevOnsubmit();\n } else {\n HTMLFormElement.prototype.submit.call(targetForm);\n }\n };\n\n let cookiesArray = cleantalkStorageDataArray;\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // set event token\n cookiesArray.ct_bot_detector_event_token = eventTokenLocalStorage;\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n // data to JSON\n const parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( typeof parsedCookies !== 'undefined' && parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctPublic.wl_brandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n let email = currentResultData.decoded_email.split(/[&?]/)[0];\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n if (firstNode) {\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNodes, result);\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNodes, decodingResult) {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML = baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n\n encodedEmailNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedEmailNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if ( typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n\n let noCookieData = getCleanTalkStorageDataArray();\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * Retrieves the clentalk \"cookie\" data from starages.\n * Contains {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration}.\n * @return {string}\n */\nfunction getCleanTalkStorageDataArray() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieDataFromDecoration = {form_decoration_mouse_data: []};\n if (document.ctFormDecorationMouseData) {\n let formDecorationMouseData = JSON.parse(JSON.stringify(document.ctFormDecorationMouseData));\n if (formDecorationMouseData.mouseMovements) {\n delete formDecorationMouseData.mouseMovements;\n }\n noCookieDataFromDecoration = {form_decoration_mouse_data: formDecorationMouseData};\n }\n return {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration};\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n const formAction = typeof(form.action) == 'string' ? form.action : '';\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n // Super WooCommerce Product Filter\n if (form.classList.contains('swpf-instant-filtering')) {\n return true;\n }\n // PayU 3-rd party service forms\n if (formAction.indexOf('secure.payu.com') !== -1 ) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n/**\n * WooCommerce add to cart by GET request params collecting\n */\nfunction apbctCheckAddToCartByGet() {\n // 1) Collect all links with add_to_cart_button class\n document.querySelectorAll('a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)').forEach((el) => {\n el.addEventListener('click', function(e) {\n let href = el.getAttribute('href');\n // 2) Add to href attribute additional parameter ct_bot_detector_event_token gathered from apbctLocalStorage\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if ( eventToken ) {\n if ( href.indexOf('?') === -1 ) {\n href += '?';\n } else {\n href += '&';\n }\n href += 'ct_bot_detector_event_token=' + eventToken;\n el.setAttribute('href', href);\n }\n });\n });\n}\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n\n/**\n * Handle external forms\n */\nfunction ctProtectExternal() {\n for (let i = 0; i < document.forms.length; i++) {\n if (document.forms[i].cleantalk_hidden_action === undefined &&\n document.forms[i].cleantalk_hidden_method === undefined) {\n // current form\n const currentForm = document.forms[i];\n\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n\n // Ajax checking for the integrated forms - will be changed the whole form object to make protection\n if ( isIntegratedForm(currentForm) ) {\n apbctProcessExternalForm(currentForm, i, document);\n\n // Ajax checking for the integrated forms - will be changed only submit button to make protection\n } else if (\n // MooForm 3rd party service\n currentForm.dataset.mailingListId !== undefined ||\n (typeof(currentForm.action) == 'string' &&\n (currentForm.action.indexOf('webto.salesforce.com') !== -1)) ||\n (typeof(currentForm.action) == 'string' &&\n currentForm.querySelector('[href*=\"activecampaign\"]'))\n ) {\n apbctProcessExternalFormByFakeButton(currentForm, i, document);\n // Common flow - modify form's action\n } else if (\n typeof(currentForm.action) == 'string' &&\n ( currentForm.action.indexOf('http://') !== -1 ||\n currentForm.action.indexOf('https://') !== -1 )\n ) {\n let tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n const host = tmp[0].toLowerCase();\n\n if (host !== location.hostname.toLowerCase()) {\n const ctAction = document.createElement('input');\n ctAction.name = 'cleantalk_hidden_action';\n ctAction.value = currentForm.action;\n ctAction.type = 'hidden';\n currentForm.appendChild(ctAction);\n\n const ctMethod = document.createElement('input');\n ctMethod.name = 'cleantalk_hidden_method';\n ctMethod.value = currentForm.method;\n ctMethod.type = 'hidden';\n\n currentForm.method = 'POST';\n\n currentForm.appendChild(ctMethod);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n // Trying to process external form into an iframe\n apbctProcessIframes();\n // if form is still not processed by fields listening, do it here\n ctStartFieldsListening();\n}\n\n/**\n * Exclusion forms\n * @param {HTMLElement} currentForm\n * @return {boolean}\n */\nfunction formIsExclusion(currentForm) {\n const exclusionsById = [\n 'give-form', // give form exclusion because of direct integration\n 'frmCalc', // nobletitle-calc\n 'ihf-contact-request-form',\n 'wpforms', // integration with wpforms\n ];\n\n const exclusionsByRole = [\n 'search', // search forms\n ];\n\n const exclusionsByClass = [\n 'search-form', // search forms\n 'hs-form', // integrated hubspot plugin through dynamicRenderedForms logic\n 'ihc-form-create-edit', // integrated Ultimate Membership Pro plugin through dynamicRenderedForms logic\n 'nf-form-content', // integration with Ninja Forms for js events\n 'elementor-form', // integration with elementor-form\n 'wpforms', // integration with wpforms\n 'et_pb_searchform', // integration with elementor-search-form\n ];\n\n const exclusionsByAction = [\n 'paypal.com/cgi-bin/webscr', // search forms\n ];\n\n let result = false;\n\n try {\n // mewto forms exclusion\n if (currentForm.parentElement &&\n currentForm.parentElement.classList.length > 0 &&\n currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1) {\n result = true;\n }\n\n if (currentForm.getAttribute('action') !== null) {\n exclusionsByAction.forEach(function(exclusionAction) {\n if (currentForm.getAttribute('action').indexOf(exclusionAction) !== -1) {\n result = true;\n }\n });\n }\n\n exclusionsById.forEach(function(exclusionId) {\n const formId = currentForm.getAttribute('id');\n if ( formId !== null && typeof (formId) !== 'undefined' && formId.indexOf(exclusionId) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByClass.forEach(function(exclusionClass) {\n let foundClass = '';\n if (currentForm.getAttribute('class')) {\n foundClass = currentForm.getAttribute('class');\n } else {\n foundClass = apbctGetFormClass(currentForm, exclusionClass);\n }\n const formClass = foundClass;\n if ( formClass !== null && typeof formClass !== 'undefined' && formClass.indexOf(exclusionClass) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByRole.forEach(function(exclusionRole) {\n const formRole = currentForm.getAttribute('id');\n if ( formRole !== null && typeof formRole !== 'undefined'&& formRole.indexOf(exclusionRole) !== -1 ) {\n result = true;\n }\n });\n } catch (e) {\n console.table('APBCT ERROR: formIsExclusion() - ', e);\n }\n\n return result;\n}\n\n/**\n * Gets the form class if it is not in \n * @param {HTMLElement} currentForm\n * @param {string} exclusionClass\n * @return {string}\n */\nfunction apbctGetFormClass(currentForm, exclusionClass) {\n if (typeof(currentForm) == 'object' && currentForm.querySelector('.' + exclusionClass)) {\n return exclusionClass;\n }\n}\n\n/**\n * Handle external forms in iframes\n */\nfunction apbctProcessIframes() {\n const frames = document.getElementsByTagName('iframe');\n\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) {\n continue;\n }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n const currentForm = iframeForms[y];\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n const cleantalkPlaceholder = document.createElement('i');\n cleantalkPlaceholder.className = 'cleantalk_placeholder';\n cleantalkPlaceholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalkPlaceholder, currentForm);\n\n // Deleting form to prevent submit event\n const prev = currentForm.previousSibling;\n const formHtml = currentForm.outerHTML;\n const formOriginal = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement('div');\n placeholder.innerHTML = formHtml;\n prev.after(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = formOriginal;\n\n // mailerlite integration - disable click on submit button\n let mailerliteDetectedClass = false;\n if (reUseCurrentForm.classList !== undefined) {\n // list there all the mailerlite classes\n const mailerliteClasses = ['newsletterform', 'ml-block-form'];\n mailerliteClasses.forEach(function(mailerliteClass) {\n if (reUseCurrentForm.classList.contains(mailerliteClass)) {\n mailerliteDetectedClass = mailerliteClass;\n }\n });\n }\n\n let mailerliteSubmitButton = null;\n if ( mailerliteDetectedClass ) {\n mailerliteSubmitButton = reUseCurrentForm.querySelector('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== null && mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.addEventListener('click', function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(reUseCurrentForm);\n });\n }\n return;\n }\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Process external forms via fake button replacing\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormByFakeButton(currentForm, iterator, documentObject) {\n const submitButtonOriginal = currentForm.querySelector('[type=\"submit\"]');\n const onsubmitOriginal = currentForm.querySelector('[type=\"submit\"]').form.onsubmit;\n\n if ( ! submitButtonOriginal ) {\n return;\n }\n\n const parent = submitButtonOriginal.parentElement;\n const submitButtonHtml = submitButtonOriginal.outerHTML;\n\n // Remove the original submit button\n submitButtonOriginal.remove();\n\n // Insert a clone of the submit button\n const placeholder = document.createElement('div');\n placeholder.innerHTML = submitButtonHtml;\n parent.appendChild(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctParent = parent;\n reUseCurrentForm.submitButtonOriginal = submitButtonOriginal;\n reUseCurrentForm.onsubmitOriginal = onsubmitOriginal;\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n\n // MooSend spinner activate\n apbctMoosendSpinnerToggle(event.currentTarget);\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Activate or deactivate spinner for Moosend form during request checking\n * @param {HTMLElement} form\n */\nfunction apbctMoosendSpinnerToggle(form) {\n const buttonElement = form.querySelector('button[type=\"submit\"]');\n if ( buttonElement ) {\n const spinner = buttonElement.querySelector('i');\n const submitText = buttonElement.querySelector('span');\n if (spinner && submitText) {\n if ( spinner.style.zIndex == 1 ) {\n submitText.style.opacity = 1;\n spinner.style.zIndex = -1;\n spinner.style.opacity = 0;\n } else {\n submitText.style.opacity = 0;\n spinner.style.zIndex = 1;\n spinner.style.opacity = 1;\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} formSource\n * @param {HTMLElement} formTarget\n */\nfunction apbctReplaceInputsValuesFromOtherForm(formSource, formTarget) {\n const inputsSource = formSource.querySelectorAll('button, input, textarea, select');\n const inputsTarget = formTarget.querySelectorAll('button, input, textarea, select');\n\n if (formSource.outerHTML.indexOf('action=\"https://www.kulahub.net') !== -1 ||\n isFormHasDiviRedirect(formSource) ||\n formSource.outerHTML.indexOf('class=\"et_pb_contact_form') !== -1\n ) {\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.name === elemTarget.name) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n\n return;\n }\n\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.outerHTML === elemTarget.outerHTML) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n}\n// clear protected iframes list\napbctLocalStorage.set('apbct_iframes_protected', []);\nwindow.addEventListener('load', function() {\n if ( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n setTimeout(function() {\n ctProtectExternal();\n catchDynamicRenderedForm();\n catchNextendSocialLoginForm();\n ctProtectOutsideIframe();\n }, 2000);\n\n ctProtectKlaviyoForm();\n});\n\n/**\n * Protect klaviyo forms\n */\nfunction ctProtectKlaviyoForm() {\n if (!document.querySelector('link[rel=\"dns-prefetch\"][href=\"//static.klaviyo.com\"]')) {\n return;\n }\n\n let i = setInterval(() => {\n const klaviyoForms = document.querySelectorAll('form.klaviyo-form');\n if (klaviyoForms.length) {\n clearInterval(i);\n klaviyoForms.forEach((form, index) => {\n apbctProcessExternalFormKlaviyo(form, index, document);\n });\n }\n }, 500);\n}\n\n/**\n * Protect klaviyo forms\n * @param {HTMLElement} form\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormKlaviyo(form, iterator, documentObject) {\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (!btn) {\n return;\n }\n btn.disabled = true;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n let cover = document.createElement('div');\n cover.id = 'apbct-klaviyo-cover';\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.style.cursor = 'pointer';\n cover.onclick = function(e) {\n sendAjaxCheckingFormData(form);\n };\n btn.parentNode.style.position = 'relative';\n btn.parentNode.appendChild(cover);\n}\n\n/**\n * Protect forms placed in iframe with outside src\n */\nfunction ctProtectOutsideIframe() {\n let iframes = document.querySelectorAll('iframe');\n if (iframes.length > 0) {\n iframes.forEach(function(iframe) {\n if (iframe.src.indexOf('form.typeform.com') !== -1 ||\n iframe.src.indexOf('forms.zohopublic.com') !== -1 ||\n iframe.src.indexOf('link.surepathconnect.com') !== -1 ||\n iframe.src.indexOf('hello.dubsado.com') !== -1 ||\n iframe.classList.contains('hs-form-iframe') ||\n ( iframe.src.indexOf('facebook.com') !== -1 && iframe.src.indexOf('plugins/comments.php') !== -1)\n ) {\n // pass if is already protected\n if (false !== apbctLocalStorage.get('apbct_iframes_protected') &&\n apbctLocalStorage.get('apbct_iframes_protected').length > 0 &&\n typeof iframe.id !== 'undefined' &&\n apbctLocalStorage.get('apbct_iframes_protected').indexOf[iframe.id] !== -1\n ) {\n return;\n }\n ctProtectOutsideIframeHandler(iframe);\n }\n });\n }\n}\n\nlet ctProtectOutsideIframeCheck;\n/**\n * Protect forms placed in iframe with outside src handler\n * @param {HTMLElement} iframe\n */\nfunction ctProtectOutsideIframeHandler(iframe) {\n let cover = document.createElement('div');\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.onclick = function(e) {\n if (ctProtectOutsideIframeCheck === undefined) {\n let currentDiv = e.currentTarget;\n currentDiv.style.opacity = 0.5;\n let preloader = document.createElement('div');\n preloader.className = 'apbct-iframe-preloader';\n currentDiv.appendChild(preloader);\n let botDetectorToken = '';\n if (document.querySelector('[name*=\"ct_bot_detector_event_token\"]')) {\n botDetectorToken = document.querySelector('[name*=\"ct_bot_detector_event_token\"]').value;\n }\n\n let data = {\n 'action': 'cleantalk_outside_iframe_ajax_check',\n 'ct_no_cookie_hidden_field': getNoCookieData(),\n 'ct_bot_detector_event_token': botDetectorToken,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n ctProtectOutsideIframeCheck = true;\n if (result.apbct.blocked === false) {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach(function(el) {\n el.parentNode.remove();\n });\n } else {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.parentNode.style.color = 'white';\n el.parentNode.innerHTML += result.apbct.comment;\n });\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.remove();\n });\n }\n },\n },\n );\n }\n };\n iframe.parentNode.style.position = 'relative';\n iframe.parentNode.appendChild(cover);\n let iframes = apbctLocalStorage.get('apbct_iframes_protected');\n if (false === iframes) {\n iframes = [];\n }\n if (typeof iframe.id !== 'undefined') {\n iframes.push(iframe.id);\n apbctLocalStorage.set('apbct_iframes_protected', iframes);\n }\n}\n\n/**\n * Catch NSL form integration\n */\nfunction catchNextendSocialLoginForm() {\n let blockNSL = document.getElementById('nsl-custom-login-form-main');\n if (blockNSL) {\n blockBtnNextendSocialLogin(blockNSL);\n }\n}\n\n/**\n * Blocking NSL plugin buttons\n * @param {HTMLElement} blockNSL\n */\nfunction blockBtnNextendSocialLogin(blockNSL) {\n let parentBtnsNSL = blockNSL.querySelectorAll('.nsl-container-buttons a');\n let childBtnsNSL = blockNSL.querySelectorAll('a[data-plugin=\"nsl\"] .nsl-button');\n parentBtnsNSL.forEach((el) => {\n el.setAttribute('data-oauth-login-blocked', 'true');\n el.addEventListener('click', (event) => {\n event.preventDefault();\n });\n });\n childBtnsNSL.forEach((el) => {\n el.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n ctCheckAjax(el);\n });\n });\n}\n\n/**\n * Unlocking the button and clicking on it after an ajax response\n * @param {HTMLElement} childBtn\n */\nfunction allowAjaxNextendSocialLogin(childBtn) {\n childBtn.parentElement.setAttribute('data-oauth-login-blocked', 'false');\n childBtn.parentElement.click();\n}\n\n/**\n * Locking the button and entering a message after an ajax response\n * @param {HTMLElement} childBtn\n * @param {string} msg\n */\nfunction forbiddenAjaxNextendSocialLogin(childBtn, msg) {\n let parentElement = childBtn.parentElement;\n if (parentElement.getAttribute('data-oauth-login-blocked') == 'false') {\n parentElement.setAttribute('data-oauth-login-blocked', 'true');\n }\n if (!document.querySelector('.ct-forbidden-msg')) {\n let elemForMsg = document.createElement('div');\n elemForMsg.className = 'ct-forbidden-msg';\n elemForMsg.style.background = 'red';\n elemForMsg.style.color = 'white';\n elemForMsg.style.padding = '5px';\n elemForMsg.innerHTML = msg;\n parentElement.insertAdjacentElement('beforebegin', elemForMsg);\n }\n}\n\n/**\n * User verification using user data and ajax\n * @param {HTMLElement} elem\n */\nfunction ctCheckAjax(elem) {\n let data = {\n 'action': 'cleantalk_nsl_ajax_check',\n 'ct_no_cookie_hidden_field': document.getElementsByName('ct_no_cookie_hidden_field')[0].value,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if (result.apbct.blocked === false) {\n allowAjaxNextendSocialLogin(elem);\n } else {\n forbiddenAjaxNextendSocialLogin(elem, result.apbct.comment);\n }\n },\n },\n );\n}\n\n/**\n * Checking the form integration\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isIntegratedForm(formObj) {\n const formAction = typeof(formObj.action) == 'string' ? formObj.action : '';\n const formId = formObj.getAttribute('id') !== null ? formObj.getAttribute('id') : '';\n\n if (\n (\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n formAction.indexOf('app.kit.com') !== -1 // ConvertKit new form\n ) ||\n ( formObj.firstChild.classList !== undefined &&\n formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1 ||\n formId.indexOf('ihf-contact-request-form') !== -1 ||\n formAction.indexOf('crm.zoho.com') !== -1 ||\n formId.indexOf('delivra-external-form') !== -1 ||\n // todo Return to Hubspot for elementor in the future, disabled of reason https://doboard.com/1/task/9227\n // ( formObj.classList !== undefined &&\n // !formObj.classList.contains('woocommerce-checkout') &&\n // formObj.hasAttribute('data-hs-cf-bound')\n // ) || // Hubspot integration in Elementor form// Hubspot integration in Elementor form\n formAction.indexOf('eloqua.com') !== -1 || // Eloqua integration\n formAction.indexOf('kulahub.net') !== -1 || // Kulahub integration\n isFormHasDiviRedirect(formObj) || // Divi contact form\n formAction.indexOf('eocampaign1.com') !== -1 || // EmailOctopus Campaign form\n formAction.indexOf('wufoo.com') !== -1 || // Wufoo form\n ( formObj.classList !== undefined &&\n formObj.classList.contains('sp-element-container') ) // Sendpulse form\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * This function detect if the form has DIVI redirect. If so, the form will work as external.\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isFormHasDiviRedirect(formObj) {\n let result = false;\n const diviRedirectedSignSet = document.querySelector('div[id^=\"et_pb_contact_form\"]');\n if (\n typeof formObj === 'object' && formObj !== null &&\n diviRedirectedSignSet !== null &&\n diviRedirectedSignSet.hasAttribute('data-redirect_url') &&\n diviRedirectedSignSet.getAttribute('data-redirect_url') !== '' &&\n diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]') !== null\n ) {\n result = formObj === diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]');\n }\n return result;\n}\n\n/**\n * Sending Ajax for checking form data\n * @param {HTMLElement} form\n * @param {HTMLElement} prev\n * @param {HTMLElement} formOriginal\n */\nfunction sendAjaxCheckingFormData(form) {\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visibleFields );\n\n const data = {\n 'ct_bot_detector_event_token': apbctLocalStorage.get('bot_detector_event_token'),\n };\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ) {\n // MooSend spinner deactivate\n apbctMoosendSpinnerToggle(form);\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Klaviyo integration\n if (form.classList !== undefined && form.classList.contains('klaviyo-form')) {\n const cover = document.getElementById('apbct-klaviyo-cover');\n if (cover) {\n cover.remove();\n }\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (btn) {\n btn.disabled = false;\n btn.click();\n }\n return;\n }\n\n // MooSend integration\n if ( form.dataset.mailingListId !== undefined ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Salesforce integration\n if (form.hasAttribute('action') &&\n (form.getAttribute('action').indexOf('webto.salesforce.com') !== -1)\n ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Active Campaign integration\n if (form.querySelector('[href*=\"activecampaign\"]')) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n const formNew = form;\n form.parentElement.removeChild(form);\n const prev = form.apbctPrev;\n const formOriginal = form.apbctFormOriginal;\n let mauticIntegration = false;\n\n apbctReplaceInputsValuesFromOtherForm(formNew, formOriginal);\n\n // mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mauticIntegration = true;\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n for (const el of formOriginal.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n\n for (const el of formOriginal.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n\n // Common click event\n let submButton = formOriginal.querySelectorAll('button[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n if (mauticIntegration) {\n setTimeout(function() {\n ctProtectExternal();\n }, 1500);\n }\n return;\n }\n\n submButton = formOriginal.querySelectorAll('input[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // ConvertKit direct integration\n submButton = formOriginal.querySelectorAll('button[data-element=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // Paypal integration\n submButton = formOriginal.querySelectorAll('input[type=\"image\"][name=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n }\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Handle dynamic rendered form\n */\nfunction catchDynamicRenderedForm() {\n const forms = document.getElementsByTagName('form');\n\n catchDynamicRenderedFormHandler(forms);\n\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n\n if ( iframeForms.length === 0 ) {\n return;\n }\n\n catchDynamicRenderedFormHandler(iframeForms, frames[j].contentDocument);\n }\n }\n}\n\n/**\n * Handles dynamic rendered forms by attaching an onsubmit event handler to them.\n *\n * @param {HTMLCollection} forms - A collection of form elements to be processed.\n * @param {Document} [documentObject=document] - The document object to use for querying elements.\n */\nfunction catchDynamicRenderedFormHandler(forms, documentObject = document) {\n const neededFormIds = [];\n for (const form of forms) {\n const formIdAttr = form.getAttribute('id');\n if (formIdAttr && formIdAttr.indexOf('hsForm') !== -1) {\n neededFormIds.push(formIdAttr);\n }\n if (formIdAttr && formIdAttr.indexOf('createuser') !== -1 &&\n (form.classList !== undefined && form.classList.contains('ihc-form-create-edit'))\n ) {\n neededFormIds.push(formIdAttr);\n }\n }\n\n for (const formId of neededFormIds) {\n const form = documentObject.getElementById(formId);\n form.apbct_external_onsubmit_prev = form.onsubmit;\n form.onsubmit = sendAjaxCheckingDynamicFormData;\n }\n}\n\n/**\n * Sending Ajax for checking form data on dynamic rendered form\n * @param {HTMLElement} form\n */\nfunction sendAjaxCheckingDynamicFormData(form) {\n form.preventDefault();\n form.stopImmediatePropagation();\n const formEvent = form;\n form = form.target;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie(visibleFields);\n form.append(ctNoCookieConstructHiddenField('hidden'));\n\n const data = {};\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n form.onsubmit = null;\n\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Call previous submit action\n if (form.apbct_external_onsubmit_prev instanceof Function) {\n let timerId = setTimeout(function() {\n form.apbct_external_onsubmit_prev.call(form, formEvent);\n }, 500);\n clearTimeout(timerId);\n }\n\n const submButton = form.querySelector('input[type=\"submit\"]');\n if (submButton) {\n submButton.click();\n return;\n }\n }\n\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Implement jQuery val() function\n * @param {HTMLElement} el\n * @return {HTMLElements}\n */\nfunction apbctVal(el) {\n if (el.options && el.multiple) {\n return el.options\n .filter((option) => option.selected)\n .map((option) => option.value);\n } else if (el.type === 'checkbox' || el.type === 'radio') {\n return el.checked ? el.checked : null;\n } else {\n return el.value;\n }\n}\n\n/**\n * Check form as internal.\n * @param {int} currForm Current form.\n */\nfunction ctCheckInternal(currForm) {\n // Gathering data\n const ctData = {};\n const elems = currForm.elements;\n let key;\n\n for (key in elems) {\n if (elems[key].type !== 'submit' &&\n elems[key].value !== undefined &&\n elems[key].value !== '') {\n ctData[elems[key].name] = currForm.elements[key].value;\n }\n }\n ctData.action = 'ct_check_internal';\n\n // AJAX Request\n apbct_public_sendAJAX(\n ctData,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function(data) {\n if (data.success === true) {\n currForm.origSubmit();\n } else {\n alert(data.data);\n return false;\n }\n },\n },\n );\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctCurrAction = '';\n let ctCurrForm = '';\n\n if ( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n setTimeout(() => {\n for ( let i = 0; i < document.forms.length; i++ ) {\n if ( typeof(document.forms[i].action) == 'string' ) {\n ctCurrForm = document.forms[i];\n ctCurrAction = ctCurrForm.action;\n if (\n ctCurrAction.indexOf('https?://') !== null && // The protocol is obligatory\n ctCurrAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ctCheckInternalIsExcludedForm(ctCurrAction) // Exclude WordPress native scripts from processing\n ) {\n const formClone = ctCurrForm.cloneNode(true);\n ctCurrForm.parentNode.replaceChild(formClone, ctCurrForm);\n\n formClone.origSubmit = ctCurrForm.submit;\n formClone.submit = null;\n\n formClone.addEventListener('submit', function(event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n ctCheckInternal(event.target);\n return false;\n });\n }\n }\n }\n }, 500);\n});\n\n/**\n * Check by action to exclude the form checking\n * @param {string} action\n * @return {boolean}\n */\nfunction ctCheckInternalIsExcludedForm(action) {\n // An array contains forms action need to be excluded.\n const ctInternalScriptExclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ctInternalScriptExclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","getAttribute","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","ctJsErrors","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","selectActualNonce","defaultNonce","ctPublicFunctions","hasOwnProperty","_fresh_nonce","data__ajax_type","_ajax_nonce","_rest_nonce","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","prepare","keys","deleteDoubleJSONEncoding","convertData","console","open","setHeaders","onreadystatechange","isWpNonceError","getFreshNonceAndRerunXHR","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","restErrror","ajaxErrror","readyState","initialRequestParams","noncePrev","spbc_remote_call_action","plugin_name","nonce_prev","initial_request_params","notJson","host_url","freshNonceResult","newRequestParams","undefined","wpnonce","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","_rest_url","route","nonce","X-WP-Nonce","defineProperty","property","enumerable","configurable","writable","ApbctFormDecorator","getElements","setListeners","regexId","regexClass","matchingElements","setDecorationBackground","from","test","element","id","forEach","flagLeft","flagRight","flagWrap","blockForms","classHeaderWrapper","endPosition","classTemplate","substring","blockForm","clickX","flagLeftWidth","flagLeftHeight","flagRightWidth","flagRightHeight","offsetX","clickY","offsetY","parseFloat","width","height","addClicks","getSelection","addSelected","mouseX","mouseY","trackMouseMovement","ctFormDecorationMouseData","clicks","selected","firstMovement","timeDiff","mouseMovements","timestamp","now","index","lastMovement","hovering","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","item","apbctLocalStorage","set","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","encodeURIComponent","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bloomPopup","pafeFormsFormElementor","otterForm","bookingPress","isArray","getJavascriptClientData","e","apbct_site_referer","apbct_force_alt_cookies","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","beforeSend","ctGetCookie","matches","RegExp","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","no_cache","apbctGenerateUniqueID","substr","get","storageValue","json","isJson","objToSave","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","apbctForceProtect","ApbctForceProtection","data__key_is_ok","apbct_attach_event_handler","wrappers","findWrappers","checkBot","event_javascript_data","post_url","referrer","checkBotCallback","result","decodeForms","allow","showMessageForBot","form","wrapper","dataset","encodedForm","outerHTML","atob","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctCheckedEmailsExist","ctMouseReadInterval","ctMouseWriteDataInterval","tokenCheckerIntervalId","botDetectorLogLastUpdate","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__bot_detector_enabled","sendBotDetectorLogToAltSessions","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","interval","currentLog","log_last_update","token","doAttach","getElementsByClassName","getElementById","setEventTokenField","clearInterval","checkEmail","currentEmail","email","checkEmailExist","hint","getResultCheckEmailExist","viewCheckEmailExist","envelope","text_result","state","textResult","inputEmail","top","getBoundingClientRect","left","right","offsetHeight","envelopeWidth","offsetWidth","onmouseover","textContent","color","onmouseout","ctIsDrawPixel","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","startForcedAltEventTokenChecker","eventToken","apbct_ready","botDetectorLocalStorage","wc_ajax_add_to_cart","apbctCheckAddToCartByGet","sessionID","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","data__email_check_exist_post","tokenForForceAlt","encodedEmailNodes","settings__data__bot_detector_enabled","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","ctAddWCMiddlewares","hiddenInput","visibleFieldsToInput","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","ctFillDecodedEmailHandler","_form","settings__forms__search_test","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","apbctCatchXmlHttpRequest","settings__comments__form_decoration","apbctAjaxSetImportantParametersOnCacheExist","advancedCacheExists","varnishCacheExists","settings__sfw__anti_crawler","checkBotDetectorExist","botDetectorIntervalSearch","bot_detector_event_token","wp","apiFetch","use","options","next","requests","path","ct_no_cookie_hidden_field","originalSend","addidionalCleantalkData","apply","cacheExist","ajaxSetup","sourceSign","contains","targetForm","honeyPotField","hpValue","hpEventId","callBack","parsedCookies","cleantalkStorageDataArray","getCleanTalkStorageDataArray","eventTokenLocalStorage","preventDefault","parentNode","HTMLFormElement","submit","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","ct_bot_detector_event_token","warn","encodedEmailNodesIsMixed","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","innerHTML","wl_brandname","waitingPopup","popupHeader","innerText","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","animationElements","animationWrapper","apbctEEAnimationDogOne","clickSource","encodedEmails","encodedEmailsCollection","apbctTooltip","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","popup","currentResultData","row","encoded_email","decoded_email","firstNode","selectableEmail","title","secondNode","buttonWrapper","fillDecodedEmails","click","comment","decodingResult","encodedEmail","baseElementContent","encodedEmailTextInsideMailto","el","ctProcessDecodedDataResult","commonCookies","resultDataJson","ct_checked_emails","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_headless","ct_bot_detector_frontend_data_log","apbct_page_hits","apbct_prev_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","popupText","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","formDecorationMouseData","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","noCookieDataFromDecoration","form_decoration_mouse_data","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","hiddenFieldType","formAction","j","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","ignoreURLConvert","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","ctProtectExternal","cleantalk_hidden_action","cleantalk_hidden_method","ctMethod","currentForm","formIsExclusion","isIntegratedForm","apbctProcessExternalForm","mailingListId","apbctProcessExternalFormByFakeButton","tmp","hostname","ctAction","appendChild","apbctProcessIframes","exclusionAction","exclusionId","exclusionClass","foundClass","formClass","apbctGetFormClass","exclusionRole","formRole","table","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalkPlaceholder","prev","insertBefore","previousSibling","formHtml","formOriginal","placeholder","forceAction","firstElementChild","reUseCurrentForm","mailerliteDetectedClass","apbctPrev","apbctFormOriginal","mailerliteClass","mailerliteSubmitButton","sendAjaxCheckingFormData","currentTarget","submitButtonOriginal","onsubmitOriginal","submitButtonHtml","apbctParent","apbctMoosendSpinnerToggle","buttonElement","submitText","zIndex","apbctReplaceInputsValuesFromOtherForm","formSource","formTarget","inputsSource","inputsTarget","isFormHasDiviRedirect","elemSource","elemTarget","checked","apbctVal","ctProtectKlaviyoForm","klaviyoForms","apbctProcessExternalFormKlaviyo","cover","btn","disabled","onclick","ctProtectOutsideIframe","iframes","iframe","src","ctProtectOutsideIframeHandler","ctTrpLocalize","ctTrpIsAdminCommentsList","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","trpComments","learnMoreLink","trpLayout","trpImage","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","nextElementSibling","clearTimeout","selection","onSelectionChange","settings__forms__check_external","catchDynamicRenderedForm","catchNextendSocialLoginForm","ctProtectOutsideIframeCheck","currentDiv","preloader","botDetectorToken","blockNSL","blockBtnNextendSocialLogin","parentBtnsNSL","childBtnsNSL","ctCheckAjax","allowAjaxNextendSocialLogin","childBtn","forbiddenAjaxNextendSocialLogin","elemForMsg","insertAdjacentElement","getElementsByName","formObj","firstChild","diviRedirectedSignSet","elems","submitButton","formNew","mauticIntegration","submButton","catchDynamicRenderedFormHandler","neededFormIds","formIdAttr","apbct_external_onsubmit_prev","sendAjaxCheckingDynamicFormData","stopImmediatePropagation","formEvent","timerId","multiple","option","map","ctCheckInternal","currForm","ctData","alert","origSubmit","ctCheckInternalIsExcludedForm","some","blog_home","ctCurrAction","ctCurrForm","settings__forms__check_internal","formClone","cloneNode","replaceChild"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACvB,UAApB,OAAOA,GACfM,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAS,GAAKD,GACS,UAApB,OAAOA,GACfM,KAAKN,SAAWA,EAChBM,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBd,CAAQ,CAAC,GAG9EM,KAAKS,SAAS,EAGXT,IACX,CAKAU,WAAWC,GACmB,UAArB,OAAOA,EACRX,KAAKL,SAASiB,KAAKD,CAAS,EACC,UAArB,OAAOA,GACfX,KAAKN,SAAWiB,EAChBX,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBG,CAAS,CAAC,GAE/EX,KAAKS,SAAS,CAEtB,CAKAG,KAAKC,GACDb,KAAKL,SAASiB,KAAKC,CAAI,CAC3B,CAKAC,SACId,KAAKL,SAAWK,KAAKL,SAASU,MAAM,EAAG,CAAC,CAAC,CAC7C,CAKAI,WACIT,KAAKL,SAAW,EACpB,CAUAoB,IAAIC,EAAOC,GAIP,GAHAA,EAASA,GAAU,CAAA,EAGE,UAAjB,OAAOD,EAAoB,CAU3B,IAAK,IAAME,KAAaF,EACpB,GAAIG,OAAOC,OAAOJ,EAAO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HPi1B,EAASG,WAAW,CAK5B,CACJ,CACJ,CACJ,CA4CA,SAASC,8BAA8BzkB,GAOnC,MALmC,CAC/B,eACA,wBAG8B0kB,KAAK,GACmC,OAA/D1kB,EAAOtQ,MAAM,IAAI0Q,OAAOpC,SAAS2mB,UAAY,KAAO/mB,CAAI,CAAC,CACnE,CACL,CApDApS,SAAS2C,iBAAiB,mBAAoB,WAC1CzB,IAAIk4B,EAAe,GACfC,EAAa,GAEV,CAAC7mB,SAAS8mB,iCAIjBxzB,WAAW,KACP,IAAM5E,IAAIC,EAAI,EAAGA,EAAInB,SAASge,MAAM5c,OAAQD,CAAC,GAAK,CAC9C,IAQco4B,EAR2B,UAApC,OAAOv5B,SAASge,MAAM7c,GAAS,SAChCk4B,EAAar5B,SAASge,MAAM7c,GAGc,QAF1Ci4B,EAAeC,EAAW7kB,QAEThQ,QAAQ,WAAW,GACwB,OAAxD40B,EAAal1B,MAAMsO,SAAS2mB,UAAY,SAAU,GAChDF,8BAA8BG,CAAY,IAEtCG,EAAYF,EAAWG,UAAU,CAAA,CAAI,EAC3CH,EAAW7U,WAAWiV,aAAaF,EAAWF,CAAU,EAExDE,EAAUP,WAAaK,EAAW3U,OAClC6U,EAAU7U,OAAS,KAEnB6U,EAAU52B,iBAAiB,SAAU,SAASpD,GAK1C,OAJAA,EAAMglB,eAAe,EACrBhlB,EAAMyD,gBAAgB,EACtBzD,EAAM+4B,yBAAyB,EAC/BM,gBAAgBr5B,EAAMuD,MAAM,EACrB,CAAA,CACX,CAAC,GAGb,CACJ,EAAG,GAAG,CACV,CAAC"} \ No newline at end of file +{"version":3,"file":"apbct-public-bundle_full-protection.min.js","sources":["apbct-public-bundle_full-protection.js"],"sourcesContent":["/**\n * Base class\n */\nclass ApbctCore {\n ajax_parameters = {};\n restParameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n * @param {string} selector\n */\n constructor(selector) {\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param {string} selector\n * @return {*}\n */\n select(selector) {\n if (selector instanceof HTMLCollection) {\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n } else if ( typeof selector === 'object' ) {\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n } else if ( typeof selector === 'string' ) {\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n } else {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {object|string} elemToAdd\n */\n addElement(elemToAdd) {\n if ( typeof elemToAdd === 'object' ) {\n this.elements.push(elemToAdd);\n } else if ( typeof elemToAdd === 'string' ) {\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n } else {\n this.deselect();\n }\n }\n\n /**\n * @param {object} elem\n */\n push(elem) {\n this.elements.push(elem);\n }\n\n /**\n * reduce\n */\n reduce() {\n this.elements = this.elements.slice(0, -1);\n }\n\n /**\n * deselect\n */\n deselect() {\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param {object|string} style\n * @param {boolean} getRaw\n *\n * @return {boolean|*}\n */\n css(style, getRaw) {\n getRaw = getRaw || false;\n\n // Set style\n if (typeof style === 'object') {\n const stringToCamelCase = (str) =>\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ctJsErrors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Select actual WP nonce depending on the ajax type and the fresh nonce provided.\n * @return {string} url\n */\nfunction selectActualNonce() {\n let defaultNonce = '';\n // return fresh nonce immediately if persists\n if (\n ctPublicFunctions.hasOwnProperty('_fresh_nonce') &&\n typeof ctPublicFunctions._fresh_nonce === 'string' &&\n ctPublicFunctions._fresh_nonce.length > 0\n ) {\n return ctPublicFunctions._fresh_nonce;\n }\n // select from default rest/ajax nonces\n if (\n ctPublicFunctions.data__ajax_type === 'admin_ajax' &&\n ctPublicFunctions.hasOwnProperty('_ajax_nonce') &&\n typeof ctPublicFunctions._ajax_nonce === 'string' &&\n ctPublicFunctions._ajax_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._ajax_nonce;\n }\n if (\n ctPublicFunctions.data__ajax_type === 'rest' &&\n ctPublicFunctions.hasOwnProperty('_rest_nonce') &&\n typeof ctPublicFunctions._rest_nonce === 'string' &&\n ctPublicFunctions._rest_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._rest_nonce;\n }\n\n return defaultNonce;\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n if (this.isWpNonceError()) {\n this.getFreshNonceAndRerunXHR(parameters);\n return;\n }\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * Check if 403 code of WP nonce error\n * @return {bool}\n */\n isWpNonceError() {\n let restErrror = false;\n let ajaxErrror = false;\n // check rest error\n if (this.xhr.readyState == 4) {\n restErrror = (\n typeof this.xhr.response === 'object' && this.xhr.response !== null &&\n this.xhr.response.hasOwnProperty('data') &&\n this.xhr.response.data.hasOwnProperty('status') &&\n this.xhr.response.data.status === 403\n );\n ajaxErrror = this.xhr.response === '-1' && this.xhr.status === 403;\n }\n // todo check AJAX error\n return restErrror || ajaxErrror;\n }\n\n /**\n * Get the fresh nonce and rerun the initial XHR with params\n * @param {[]} initialRequestParams\n */\n getFreshNonceAndRerunXHR(initialRequestParams) {\n let noncePrev = '';\n\n // Check if initialRequestParams['headers']['X-WP-Nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('headers') &&\n initialRequestParams.headers.hasOwnProperty('X-WP-Nonce')\n ) {\n noncePrev = initialRequestParams['headers']['X-WP-Nonce'];\n }\n\n // Check if initialRequestParams['data']['_ajax_nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('data') &&\n initialRequestParams.data.hasOwnProperty('_ajax_nonce')\n ) {\n noncePrev = initialRequestParams['data']['_ajax_nonce'];\n }\n\n // Nonce is not provided. Exit.\n if ( noncePrev === '' ) {\n return;\n }\n\n // prepare params for refreshing nonce\n let params = {};\n params.method = 'POST';\n params.data = {\n 'spbc_remote_call_action': 'get_fresh_wpnonce',\n 'plugin_name': 'antispam',\n 'nonce_prev': noncePrev,\n 'initial_request_params': initialRequestParams,\n };\n params.notJson = true;\n params.url = ctPublicFunctions.host_url;\n // this callback will rerun the XHR with initial params\n params.callback = function(...args) {\n // the refresh result itself\n let freshNonceResult = args[0];\n let newRequestParams = false;\n // provided initial params\n if (args[1] !== undefined && args[1].hasOwnProperty('initial_request_params')) {\n newRequestParams = args[1].initial_request_params;\n }\n if (newRequestParams && freshNonceResult.hasOwnProperty('wpnonce')) {\n ctPublicFunctions._fresh_nonce = freshNonceResult.wpnonce;\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n new ApbctCore().rest(newRequestParams);\n } else {\n new ApbctCore().ajax(newRequestParams);\n }\n }\n };\n // run the nonce refreshing call\n new ApbctXhr(params);\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.data._ajax_nonce = selectActualNonce();\n super(args);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n const nonce = selectActualNonce();\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': nonce,\n };\n super(args);\n }\n}\n\n// add hasOwn\nif (!Object.prototype.hasOwn) {\n Object.defineProperty(Object.prototype, 'hasOwn', { // eslint-disable-line\n value: function(property) {\n return Object.prototype.hasOwnProperty.call(this, property);\n },\n enumerable: false,\n configurable: true,\n writable: true,\n });\n}\n\n/**\n * Form skin class\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctFormDecorator {\n elements = [];\n\n /**\n * Constructor\n */\n constructor() {\n this.getElements();\n this.setListeners();\n }\n\n /**\n * Get elements\n */\n getElements() {\n const elements = document.querySelectorAll('*');\n const regexId = /^apbct-trusted-text--label/;\n const regexClass = /apbct_form_decoration--/;\n\n this.setDecorationBackground();\n\n // Collect elements with id or class that contains apbct-trusted-text--label or apbct_form_decoration--\n // id\n let matchingElements = Array.from(elements).filter((element) => {\n return regexId.test(element.id);\n });\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n // class\n matchingElements = Array.from(elements).filter((element) => {\n return regexClass.test(element.className);\n });\n\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n const flagWrap = document.querySelector('.apbct_form_decoration');\n if (flagWrap) {\n const flagLeft = window.getComputedStyle(flagWrap, '::before');\n const flagRight = window.getComputedStyle(flagWrap, '::after');\n if (flagLeft && flagRight) {\n this.elements.push(flagWrap);\n }\n }\n }\n\n /**\n * Set decoration background\n */\n setDecorationBackground() {\n let blockForms = document.querySelectorAll('#respond');\n\n if (document.querySelector('[class*=\"apbct_form_decoration\"]')) {\n let classHeaderWrapper = document.querySelector('[class*=\"apbct_form_decoration\"]').getAttribute('class');\n let endPosition = classHeaderWrapper.indexOf('_header__wrapper');\n let classTemplate = classHeaderWrapper.substring(0, endPosition);\n\n blockForms.forEach((blockForm) => {\n blockForm.className += ' ' + classTemplate;\n });\n }\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elements.forEach((element) => {\n if (!element) {\n return;\n }\n\n element.addEventListener('click', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n if (element.className.indexOf('header__wrapper') !== -1) {\n this.addClicks();\n return;\n }\n\n const clickX = event.offsetX;\n const clickY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (element.className.indexOf('christmas') !== -1) {\n if (\n clickY < flagLeftHeight / 3 && clickX < flagLeftWidth ||\n clickY < flagRightHeight / 3 && clickX > flagRightWidth\n ) {\n this.addClicks();\n return;\n }\n }\n\n if (\n (element.className.indexOf('new-year') !== -1) ||\n (element.className.indexOf('fourth-july') !== -1)\n ) {\n if (\n clickY > flagLeftHeight && clickX < flagLeftWidth ||\n clickY > flagRightHeight && clickX > flagRightWidth\n ) {\n this.addClicks();\n }\n }\n\n if (element.className.indexOf('signature')) {\n this.addClicks();\n }\n\n return;\n }\n\n this.addClicks();\n });\n\n element.addEventListener('mouseup', (event) => {\n setTimeout(() => {\n const selectedText = window.getSelection().toString();\n if (selectedText) {\n this.addSelected();\n }\n }, 100);\n });\n\n element.addEventListener('mousemove', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n const mouseX = event.offsetX;\n const mouseY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (mouseY > flagLeftHeight && mouseX < flagLeftWidth ||\n mouseY > flagRightHeight && mouseX > flagRightWidth\n ) {\n this.trackMouseMovement();\n }\n return;\n }\n\n this.trackMouseMovement();\n });\n });\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.clicks) {\n document.ctFormDecorationMouseData.clicks++;\n } else {\n document.ctFormDecorationMouseData.clicks = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.selected) {\n document.ctFormDecorationMouseData.selected++;\n } else {\n document.ctFormDecorationMouseData.selected = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctFormDecorationMouseData) {\n document.ctFormDecorationMouseData = {};\n }\n if (!document.ctFormDecorationMouseData.mouseMovements) {\n document.ctFormDecorationMouseData.mouseMovements = [];\n }\n\n document.ctFormDecorationMouseData.mouseMovements.push({timestamp: Date.now()});\n\n if (document.ctFormDecorationMouseData.mouseMovements.length > 1) {\n const index = document.ctFormDecorationMouseData.mouseMovements.length - 1;\n const lastMovement = document.ctFormDecorationMouseData.mouseMovements[index];\n const firstMovement = document.ctFormDecorationMouseData.mouseMovements[0];\n const timeDiff = lastMovement.timestamp - firstMovement.timestamp;\n document.ctFormDecorationMouseData.hovering = timeDiff;\n }\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_bot_detector_exist',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], item[1]);\n }\n });\n\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n let bloomPopup = document.querySelectorAll('div[class^=\"et_bloom_form_container\"]').length > 0;\n let pafeFormsFormElementor = document.querySelectorAll('div[class*=\"pafe-form\"]').length > 0;\n let otterForm = document.querySelectorAll('div [class*=\"otter-form\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp ||\n pafeFormsFormElementor ||\n bloomPopup ||\n otterForm;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n if (!cookies.apbct_site_referer) {\n cookies.apbct_site_referer = location.href;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n const nonce = selectActualNonce();\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i this.checkBotCallback(result),\n });\n } else if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n data.action = 'apbct_force_protection_check_bot';\n apbct_public_sendAJAX(data, {callback: (result) => this.checkBotCallback(result)});\n }\n }\n\n /**\n * Check bot callback\n * @param {Object} result\n * @return {void}\n */\n checkBotCallback(result) {\n // if error occurred\n if (result.data && result.data.status && result.data.status !== 200) {\n console.log('ApbctForceProtection connection error occurred');\n this.decodeForms();\n return;\n }\n\n if (typeof result === 'string') {\n try {\n result = JSON.parse(result);\n } catch (e) {\n console.log('ApbctForceProtection decodeForms error', e);\n this.decodeForms();\n return;\n }\n }\n\n if (typeof result === 'object' && result.allow && result.allow === 1) {\n this.decodeForms();\n } else {\n this.showMessageForBot(result.message);\n }\n }\n\n /**\n * Decode forms\n * @return {void}\n */\n decodeForms() {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n\n try {\n if (form && typeof(form) == 'string') {\n wrapper.outerHTML = atob(form);\n }\n } catch (error) {\n console.log(error);\n }\n });\n }\n\n /**\n * Show message for bot\n * @param {string} message\n * @return {void}\n */\n showMessageForBot(message) {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n if (form) {\n wrapper.outerHTML = '
' + message + '
';\n }\n });\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctCheckedEmailsExist = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\nlet tokenCheckerIntervalId;\nlet botDetectorLogLastUpdate = 0;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Run cron jobs\n */\n// forms handler cron\ncronFormsHandler(2000);\n\n// bot_detector frontend_data log alt session saving cron\nif (\n ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&\n ctPublicFunctions.data__bot_detector_enabled == 1\n) {\n sendBotDetectorLogToAltSessions(500);\n}\n/**\n * Cron jobs end.\n */\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Send BotDetector logs data to alternative sessions.\n * If log_last_update has changed, the log will be sent to the alternative sessions.\n * @param {int} cronStartTimeout delay before cron start\n * @param {int} interval check fires on interval\n */\nfunction sendBotDetectorLogToAltSessions(cronStartTimeout = 3000, interval = 1000) {\n setTimeout(function() {\n setInterval(function() {\n const currentLog = apbctLocalStorage.get('ct_bot_detector_frontend_data_log');\n if (currentLog && currentLog.hasOwnProperty('log_last_update')) {\n if (botDetectorLogLastUpdate !== currentLog.log_last_update) {\n botDetectorLogLastUpdate = currentLog.log_last_update;\n // the log will be taken from javascriptclientdata\n ctSetAlternativeCookie([], {forceAltCookies: true});\n }\n }\n }, interval);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0 ||\n document.getElementById('login-form-popup') !== null\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmailExist(e) {\n let currentEmail = e.target.value;\n let result;\n\n if (!currentEmail || !currentEmail.length) {\n let envelope = document.getElementById('apbct-check_email_exist-block');\n if (envelope) {\n envelope.remove();\n }\n let hint = document.getElementById('apbct-check_email_exist-popup_description');\n if (hint) {\n hint.remove();\n }\n return;\n }\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail in ctCheckedEmailsExist) {\n result = ctCheckedEmailsExist[currentEmail];\n getResultCheckEmailExist(e, result, currentEmail);\n\n return;\n }\n\n viewCheckEmailExist(e, 'load');\n\n // Using REST API handler\n ctPublicFunctions.data__ajax_type = 'rest';\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n apbct_public_sendREST(\n 'check_email_exist_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n\n return;\n }\n\n if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_exist_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} e\n * @param {mixed} result\n * @param {string} currentEmail\n */\nfunction getResultCheckEmailExist(e, result, currentEmail) {\n if (!result || !result.result) {\n return;\n }\n\n result = result.result;\n\n ctCheckedEmailsExist[currentEmail] = {\n 'result': result,\n 'timestamp': Date.now() / 1000 |0,\n };\n\n if (result.result == 'EXISTS') {\n viewCheckEmailExist(e, 'good_email', result.text_result);\n } else {\n viewCheckEmailExist(e, 'bad_email', result.text_result);\n }\n\n ctSetCookie('ct_checked_emails_exist', JSON.stringify(ctCheckedEmailsExist));\n}\n\n/**\n * @param {mixed} e\n * @param {string} state\n * @param {string} textResult\n */\nfunction viewCheckEmailExist(e, state, textResult) {\n let parentElement = e.target.parentElement;\n let inputEmail = parentElement.querySelector('[name*=\"email\"]');\n\n if (!inputEmail) {\n return;\n }\n\n const envelopeWidth = 35;\n let envelope;\n let hint;\n\n // envelope\n if (document.getElementById('apbct-check_email_exist-block')) {\n envelope = document.getElementById('apbct-check_email_exist-block');\n } else {\n envelope = document.createElement('div');\n envelope.setAttribute('class', 'apbct-check_email_exist-block');\n envelope.setAttribute('id', 'apbct-check_email_exist-block');\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n envelope.style.left = inputEmail.getBoundingClientRect().right - envelopeWidth - 10 + 'px';\n envelope.style.height = inputEmail.offsetHeight + 'px';\n envelope.style.width = envelopeWidth + 'px';\n\n window.addEventListener('scroll', function() {\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n });\n\n parentElement.after(envelope);\n }\n\n // hint\n if (document.getElementById('apbct-check_email_exist-popup_description')) {\n hint = document.getElementById('apbct-check_email_exist-popup_description');\n } else {\n hint = document.createElement('div');\n hint.setAttribute('class', 'apbct-check_email_exist-popup_description');\n hint.setAttribute('id', 'apbct-check_email_exist-popup_description');\n hint.style.width = inputEmail.offsetWidth + 'px';\n hint.style.left = inputEmail.getBoundingClientRect().left + 'px';\n\n window.addEventListener('scroll', function() {\n hint.style.top = envelope.getBoundingClientRect().top + 'px';\n });\n\n envelope.after(hint);\n }\n\n switch (state) {\n case 'load':\n envelope.classList.remove('apbct-check_email_exist-good_email', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-load');\n break;\n\n case 'good_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-good_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#1C7129';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n case 'bad_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-good_email');\n envelope.classList.add('apbct-check_email_exist-bad_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#E01111';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n default:\n break;\n }\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n } else {\n // if Jquery is not avaliable try to use xhr\n if (typeof XMLHttpRequest !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n document.addEventListener('readystatechange', function(event) {\n if (event.target.readyState === 4) {\n ctPrepareBlockMessage(event.target);\n }\n });\n }\n }\n}\n\n/**\n * For forced alt cookies.\n * If token is not added to the LS on apbc_ready, check every second if so and send token to the alt sessions.\n */\nfunction startForcedAltEventTokenChecker() {\n tokenCheckerIntervalId = setInterval( function() {\n if (apbctLocalStorage.get('event_token_forced_set') === '1') {\n clearInterval(tokenCheckerIntervalId);\n return;\n }\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if (eventToken) {\n ctSetAlternativeCookie([['ct_bot_detector_event_token', eventToken]], {forceAltCookies: true});\n apbctLocalStorage.set('event_token_forced_set', '1');\n clearInterval(tokenCheckerIntervalId);\n } else {\n }\n }, 1000);\n}\n\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n document.addEventListener('gform_page_loaded', function() {\n if (\n typeof ctPublic.force_alt_cookies === 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n if (typeof setEventTokenField === 'function' && typeof botDetectorLocalStorage === 'function') {\n setEventTokenField(botDetectorLocalStorage.get('bot_detector_event_token'));\n }\n }\n });\n if ( ! ctPublic.wc_ajax_add_to_cart ) {\n apbctCheckAddToCartByGet();\n }\n\n apbctPrepareBlockForAjaxForms();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n if (ctPublic.data__cookies_type !== 'alternative') {\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n }\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( ctIsDrawPixel() ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if ( +ctPublic.data__email_check_exist_post) {\n initCookies.push(['ct_checked_emails_exist', '0']);\n apbct('comment-form input[name = \\'email\\'], input#email').on('blur', checkEmailExist);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n let tokenForForceAlt = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n ctPublic.settings__data__bot_detector_enabled\n ) {\n apbctLocalStorage.set('event_token_forced_set', '0');\n if (tokenForForceAlt) {\n initCookies.push(['ct_bot_detector_event_token', tokenForForceAlt]);\n apbctLocalStorage.set('event_token_forced_set', '1');\n } else {\n startForcedAltEventTokenChecker();\n }\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n ctAddWCMiddlewares();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n + ctPublic.settings__forms__search_test === 1 &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n // fibosearch integration\n if (_form.querySelector('input.dgwt-wcas-search-input')) {\n continue;\n }\n\n // this handles search forms onsubmit process\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n\n // Check any XMLHttpRequest connections\n apbctCatchXmlHttpRequest();\n\n // Init form skin\n if (ctPublic.settings__comments__form_decoration) {\n new ApbctFormDecorator();\n }\n\n // Set important paramaters via ajax if problematic cache solutions found\n apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists || ctPublic.varnishCacheExists);\n\n // Checking that the bot detector has loaded and received the event token for Anti-Crawler\n if (ctPublic.settings__sfw__anti_crawler) {\n checkBotDetectorExist();\n }\n}\n\n/**\n * Checking that the bot detector has loaded and received the event token\n */\nfunction checkBotDetectorExist() {\n if (ctPublic.settings__data__bot_detector_enabled) {\n const botDetectorIntervalSearch = setInterval(() => {\n let botDetectorEventToken = localStorage.bot_detector_event_token ? true : false;\n\n if (botDetectorEventToken) {\n ctSetCookie('apbct_bot_detector_exist', '1', '3600');\n clearInterval(botDetectorIntervalSearch);\n }\n }, 500);\n }\n}\n\n/**\n * Insert no_cookies_data to rest request\n */\nfunction ctAddWCMiddlewares() {\n const ctPinDataToRequest = (options, next) => {\n if (typeof options !== 'object' || options === null ||\n !options.hasOwnProperty('data') || !options.hasOwnProperty('path')\n ) {\n return next(options);\n }\n\n // add to cart\n if (options.data.hasOwnProperty('requests') &&\n options.data.requests.length > 0 &&\n options.data.requests[0].hasOwnProperty('path') &&\n options.data.requests[0].path === '/wc/store/v1/cart/add-item'\n ) {\n options.data.requests[0].data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n // checkout\n if (options.path === '/wc/store/v1/checkout') {\n options.data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n return next(options);\n };\n\n if (window.hasOwnProperty('wp') &&\n window.wp.hasOwnProperty('apiFetch') &&\n typeof window.wp.apiFetch.use === 'function'\n ) {\n window.wp.apiFetch.use(ctPinDataToRequest);\n }\n}\n\n/**\n * Insert event_token and no_cookies_data to some ajax request\n */\nfunction apbctCatchXmlHttpRequest() {\n // 1) Check the page if it needed to catch XHR\n if ( document.querySelector('div.wfu_container') !== null ) {\n const originalSend = XMLHttpRequest.prototype.send;\n XMLHttpRequest.prototype.send = function(body) {\n // 2) Check the caught request fi it needed to modify\n if (\n body &&\n typeof body === 'string' &&\n (\n body.indexOf('action=wfu_ajax_action_ask_server') !== -1\n )\n ) {\n let addidionalCleantalkData = '';\n let eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (\n eventToken !== null &&\n eventToken !== false &&\n eventToken.hasOwnProperty('value') &&\n eventToken.value !== ''\n ) {\n eventToken = eventToken.value;\n addidionalCleantalkData += '&' + 'data%5Bct_bot_detector_event_token%5D=' + eventToken;\n }\n\n let noCookieData = getNoCookieData();\n addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData;\n\n body += addidionalCleantalkData;\n\n return originalSend.apply(this, [body]);\n }\n return originalSend.apply(this, [body]);\n };\n }\n}\n\n/**\n * Run AJAX to set important_parameters on the site backend if problematic cache solutions are defined.\n * @param {boolean} cacheExist\n */\nfunction apbctAjaxSetImportantParametersOnCacheExist(cacheExist) {\n // Set important parameters via ajax\n if ( cacheExist ) {\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST('apbct_set_important_parameters', {});\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX({action: 'apbct_set_important_parameters'}, {});\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n // this is the only place where we can found hard dependency on jQuery, if the form use it - the script\n // will work independing if jQuery is loaded by CleanTalk or not\n let eventToken = false;\n if ( typeof jQuery !== 'undefined' && typeof jQuery.ajaxSetup === 'function') {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n\n if (settings.data.indexOf('action=new_activity_comment') !== -1) {\n sourceSign = 'action=new_activity_comment';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n if (localStorage.getItem('bot_detector_event_token') !== null) {\n eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (eventToken !== false && eventToken.hasOwnProperty('value') && eventToken.value !== '') {\n eventToken = eventToken.value;\n }\n }\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n if (typeof eventToken === 'string') {\n eventToken = 'data%5Bct_bot_detector_event_token%5D=' + eventToken + '&';\n } else {\n eventToken = '';\n }\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n\n settings.data = noCookieData + eventToken + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {object} targetForm\n */\nfunction ctSearchFormOnSubmitHandler(e, targetForm) {\n try {\n // get honeypot field and it's value\n const honeyPotField = targetForm.querySelector('[id*=\"apbct__email_id__\"]');\n let hpValue = null;\n let hpEventId = null;\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n // get cookie data from storages\n let cleantalkStorageDataArray = getCleanTalkStorageDataArray();\n\n // get event token from storage\n let eventTokenLocalStorage = apbctLocalStorage.get('bot_detector_event_token');\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( cleantalkStorageDataArray !== null || honeyPotField !== null || eventTokenLocalStorage !== null ) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n if (typeof targetForm.apbctSearchPrevOnsubmit === 'function') {\n targetForm.apbctSearchPrevOnsubmit();\n } else {\n HTMLFormElement.prototype.submit.call(targetForm);\n }\n };\n\n let cookiesArray = cleantalkStorageDataArray;\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // set event token\n cookiesArray.ct_bot_detector_event_token = eventTokenLocalStorage;\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n // data to JSON\n const parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( typeof parsedCookies !== 'undefined' && parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctPublic.wl_brandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n let email = currentResultData.decoded_email.split(/[&?]/)[0];\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n if (firstNode) {\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNodes, result);\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNodes, decodingResult) {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML = baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n\n encodedEmailNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedEmailNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if ( typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n\n let noCookieData = getCleanTalkStorageDataArray();\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * Retrieves the clentalk \"cookie\" data from starages.\n * Contains {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration}.\n * @return {string}\n */\nfunction getCleanTalkStorageDataArray() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieDataFromDecoration = {form_decoration_mouse_data: []};\n if (document.ctFormDecorationMouseData) {\n let formDecorationMouseData = JSON.parse(JSON.stringify(document.ctFormDecorationMouseData));\n if (formDecorationMouseData.mouseMovements) {\n delete formDecorationMouseData.mouseMovements;\n }\n noCookieDataFromDecoration = {form_decoration_mouse_data: formDecorationMouseData};\n }\n return {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration};\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n const formAction = typeof(form.action) == 'string' ? form.action : '';\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n // Super WooCommerce Product Filter\n if (form.classList.contains('swpf-instant-filtering')) {\n return true;\n }\n // PayU 3-rd party service forms\n if (formAction.indexOf('secure.payu.com') !== -1 ) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n/**\n * WooCommerce add to cart by GET request params collecting\n */\nfunction apbctCheckAddToCartByGet() {\n // 1) Collect all links with add_to_cart_button class\n document.querySelectorAll('a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)').forEach((el) => {\n el.addEventListener('click', function(e) {\n let href = el.getAttribute('href');\n // 2) Add to href attribute additional parameter ct_bot_detector_event_token gathered from apbctLocalStorage\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if ( eventToken ) {\n if ( href.indexOf('?') === -1 ) {\n href += '?';\n } else {\n href += '&';\n }\n href += 'ct_bot_detector_event_token=' + eventToken;\n el.setAttribute('href', href);\n }\n });\n });\n}\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n\n/**\n * Handle external forms\n */\nfunction ctProtectExternal() {\n for (let i = 0; i < document.forms.length; i++) {\n if (document.forms[i].cleantalk_hidden_action === undefined &&\n document.forms[i].cleantalk_hidden_method === undefined) {\n // current form\n const currentForm = document.forms[i];\n\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n\n // Ajax checking for the integrated forms - will be changed the whole form object to make protection\n if ( isIntegratedForm(currentForm) ) {\n apbctProcessExternalForm(currentForm, i, document);\n\n // Ajax checking for the integrated forms - will be changed only submit button to make protection\n } else if (\n // MooForm 3rd party service\n currentForm.dataset.mailingListId !== undefined ||\n (typeof(currentForm.action) == 'string' &&\n (currentForm.action.indexOf('webto.salesforce.com') !== -1)) ||\n (typeof(currentForm.action) == 'string' &&\n currentForm.querySelector('[href*=\"activecampaign\"]'))\n ) {\n apbctProcessExternalFormByFakeButton(currentForm, i, document);\n // Common flow - modify form's action\n } else if (\n typeof(currentForm.action) == 'string' &&\n ( currentForm.action.indexOf('http://') !== -1 ||\n currentForm.action.indexOf('https://') !== -1 )\n ) {\n let tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n const host = tmp[0].toLowerCase();\n\n if (host !== location.hostname.toLowerCase()) {\n const ctAction = document.createElement('input');\n ctAction.name = 'cleantalk_hidden_action';\n ctAction.value = currentForm.action;\n ctAction.type = 'hidden';\n currentForm.appendChild(ctAction);\n\n const ctMethod = document.createElement('input');\n ctMethod.name = 'cleantalk_hidden_method';\n ctMethod.value = currentForm.method;\n ctMethod.type = 'hidden';\n\n currentForm.method = 'POST';\n\n currentForm.appendChild(ctMethod);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n // Trying to process external form into an iframe\n apbctProcessIframes();\n // if form is still not processed by fields listening, do it here\n ctStartFieldsListening();\n}\n\n/**\n * Exclusion forms\n * @param {HTMLElement} currentForm\n * @return {boolean}\n */\nfunction formIsExclusion(currentForm) {\n const exclusionsById = [\n 'give-form', // give form exclusion because of direct integration\n 'frmCalc', // nobletitle-calc\n 'ihf-contact-request-form',\n 'wpforms', // integration with wpforms\n ];\n\n const exclusionsByRole = [\n 'search', // search forms\n ];\n\n const exclusionsByClass = [\n 'search-form', // search forms\n 'hs-form', // integrated hubspot plugin through dynamicRenderedForms logic\n 'ihc-form-create-edit', // integrated Ultimate Membership Pro plugin through dynamicRenderedForms logic\n 'nf-form-content', // integration with Ninja Forms for js events\n 'elementor-form', // integration with elementor-form\n 'wpforms', // integration with wpforms\n 'et_pb_searchform', // integration with elementor-search-form\n ];\n\n const exclusionsByAction = [\n 'paypal.com/cgi-bin/webscr', // search forms\n ];\n\n let result = false;\n\n try {\n // mewto forms exclusion\n if (currentForm.parentElement &&\n currentForm.parentElement.classList.length > 0 &&\n currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1) {\n result = true;\n }\n\n if (currentForm.getAttribute('action') !== null) {\n exclusionsByAction.forEach(function(exclusionAction) {\n if (currentForm.getAttribute('action').indexOf(exclusionAction) !== -1) {\n result = true;\n }\n });\n }\n\n exclusionsById.forEach(function(exclusionId) {\n const formId = currentForm.getAttribute('id');\n if ( formId !== null && typeof (formId) !== 'undefined' && formId.indexOf(exclusionId) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByClass.forEach(function(exclusionClass) {\n let foundClass = '';\n if (currentForm.getAttribute('class')) {\n foundClass = currentForm.getAttribute('class');\n } else {\n foundClass = apbctGetFormClass(currentForm, exclusionClass);\n }\n const formClass = foundClass;\n if ( formClass !== null && typeof formClass !== 'undefined' && formClass.indexOf(exclusionClass) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByRole.forEach(function(exclusionRole) {\n const formRole = currentForm.getAttribute('id');\n if ( formRole !== null && typeof formRole !== 'undefined'&& formRole.indexOf(exclusionRole) !== -1 ) {\n result = true;\n }\n });\n } catch (e) {\n console.table('APBCT ERROR: formIsExclusion() - ', e);\n }\n\n return result;\n}\n\n/**\n * Gets the form class if it is not in \n * @param {HTMLElement} currentForm\n * @param {string} exclusionClass\n * @return {string}\n */\nfunction apbctGetFormClass(currentForm, exclusionClass) {\n if (typeof(currentForm) == 'object' && currentForm.querySelector('.' + exclusionClass)) {\n return exclusionClass;\n }\n}\n\n/**\n * Handle external forms in iframes\n */\nfunction apbctProcessIframes() {\n const frames = document.getElementsByTagName('iframe');\n\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) {\n continue;\n }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n const currentForm = iframeForms[y];\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n const cleantalkPlaceholder = document.createElement('i');\n cleantalkPlaceholder.className = 'cleantalk_placeholder';\n cleantalkPlaceholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalkPlaceholder, currentForm);\n\n // Deleting form to prevent submit event\n const prev = currentForm.previousSibling;\n const formHtml = currentForm.outerHTML;\n const formOriginal = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement('div');\n placeholder.innerHTML = formHtml;\n prev.after(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = formOriginal;\n\n // mailerlite integration - disable click on submit button\n let mailerliteDetectedClass = false;\n if (reUseCurrentForm.classList !== undefined) {\n // list there all the mailerlite classes\n const mailerliteClasses = ['newsletterform', 'ml-block-form'];\n mailerliteClasses.forEach(function(mailerliteClass) {\n if (reUseCurrentForm.classList.contains(mailerliteClass)) {\n mailerliteDetectedClass = mailerliteClass;\n }\n });\n }\n\n let mailerliteSubmitButton = null;\n if ( mailerliteDetectedClass ) {\n mailerliteSubmitButton = reUseCurrentForm.querySelector('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== null && mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.addEventListener('click', function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(reUseCurrentForm);\n });\n }\n return;\n }\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Process external forms via fake button replacing\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormByFakeButton(currentForm, iterator, documentObject) {\n const submitButtonOriginal = currentForm.querySelector('[type=\"submit\"]');\n const onsubmitOriginal = currentForm.querySelector('[type=\"submit\"]').form.onsubmit;\n\n if ( ! submitButtonOriginal ) {\n return;\n }\n\n const parent = submitButtonOriginal.parentElement;\n const submitButtonHtml = submitButtonOriginal.outerHTML;\n\n // Remove the original submit button\n submitButtonOriginal.remove();\n\n // Insert a clone of the submit button\n const placeholder = document.createElement('div');\n placeholder.innerHTML = submitButtonHtml;\n parent.appendChild(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctParent = parent;\n reUseCurrentForm.submitButtonOriginal = submitButtonOriginal;\n reUseCurrentForm.onsubmitOriginal = onsubmitOriginal;\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n\n // MooSend spinner activate\n apbctMoosendSpinnerToggle(event.currentTarget);\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Activate or deactivate spinner for Moosend form during request checking\n * @param {HTMLElement} form\n */\nfunction apbctMoosendSpinnerToggle(form) {\n const buttonElement = form.querySelector('button[type=\"submit\"]');\n if ( buttonElement ) {\n const spinner = buttonElement.querySelector('i');\n const submitText = buttonElement.querySelector('span');\n if (spinner && submitText) {\n if ( spinner.style.zIndex == 1 ) {\n submitText.style.opacity = 1;\n spinner.style.zIndex = -1;\n spinner.style.opacity = 0;\n } else {\n submitText.style.opacity = 0;\n spinner.style.zIndex = 1;\n spinner.style.opacity = 1;\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} formSource\n * @param {HTMLElement} formTarget\n */\nfunction apbctReplaceInputsValuesFromOtherForm(formSource, formTarget) {\n const inputsSource = formSource.querySelectorAll('button, input, textarea, select');\n const inputsTarget = formTarget.querySelectorAll('button, input, textarea, select');\n\n if (formSource.outerHTML.indexOf('action=\"https://www.kulahub.net') !== -1 ||\n isFormHasDiviRedirect(formSource) ||\n formSource.outerHTML.indexOf('class=\"et_pb_contact_form') !== -1\n ) {\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.name === elemTarget.name) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n\n return;\n }\n\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.outerHTML === elemTarget.outerHTML) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n}\n// clear protected iframes list\napbctLocalStorage.set('apbct_iframes_protected', []);\nwindow.addEventListener('load', function() {\n if ( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n setTimeout(function() {\n ctProtectExternal();\n catchDynamicRenderedForm();\n catchNextendSocialLoginForm();\n ctProtectOutsideIframe();\n }, 2000);\n\n ctProtectKlaviyoForm();\n});\n\n/**\n * Protect klaviyo forms\n */\nfunction ctProtectKlaviyoForm() {\n if (!document.querySelector('link[rel=\"dns-prefetch\"][href=\"//static.klaviyo.com\"]')) {\n return;\n }\n\n let i = setInterval(() => {\n const klaviyoForms = document.querySelectorAll('form.klaviyo-form');\n if (klaviyoForms.length) {\n clearInterval(i);\n klaviyoForms.forEach((form, index) => {\n apbctProcessExternalFormKlaviyo(form, index, document);\n });\n }\n }, 500);\n}\n\n/**\n * Protect klaviyo forms\n * @param {HTMLElement} form\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormKlaviyo(form, iterator, documentObject) {\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (!btn) {\n return;\n }\n btn.disabled = true;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n let cover = document.createElement('div');\n cover.id = 'apbct-klaviyo-cover';\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.style.cursor = 'pointer';\n cover.onclick = function(e) {\n sendAjaxCheckingFormData(form);\n };\n btn.parentNode.style.position = 'relative';\n btn.parentNode.appendChild(cover);\n}\n\n/**\n * Protect forms placed in iframe with outside src\n */\nfunction ctProtectOutsideIframe() {\n let iframes = document.querySelectorAll('iframe');\n if (iframes.length > 0) {\n iframes.forEach(function(iframe) {\n if (iframe.src.indexOf('form.typeform.com') !== -1 ||\n iframe.src.indexOf('forms.zohopublic.com') !== -1 ||\n iframe.src.indexOf('link.surepathconnect.com') !== -1 ||\n iframe.src.indexOf('hello.dubsado.com') !== -1 ||\n iframe.classList.contains('hs-form-iframe') ||\n ( iframe.src.indexOf('facebook.com') !== -1 && iframe.src.indexOf('plugins/comments.php') !== -1)\n ) {\n // pass if is already protected\n if (false !== apbctLocalStorage.get('apbct_iframes_protected') &&\n apbctLocalStorage.get('apbct_iframes_protected').length > 0 &&\n typeof iframe.id !== 'undefined' &&\n apbctLocalStorage.get('apbct_iframes_protected').indexOf[iframe.id] !== -1\n ) {\n return;\n }\n ctProtectOutsideIframeHandler(iframe);\n }\n });\n }\n}\n\nlet ctProtectOutsideIframeCheck;\n/**\n * Protect forms placed in iframe with outside src handler\n * @param {HTMLElement} iframe\n */\nfunction ctProtectOutsideIframeHandler(iframe) {\n let cover = document.createElement('div');\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.onclick = function(e) {\n if (ctProtectOutsideIframeCheck === undefined) {\n let currentDiv = e.currentTarget;\n currentDiv.style.opacity = 0.5;\n let preloader = document.createElement('div');\n preloader.className = 'apbct-iframe-preloader';\n currentDiv.appendChild(preloader);\n let botDetectorToken = '';\n if (document.querySelector('[name*=\"ct_bot_detector_event_token\"]')) {\n botDetectorToken = document.querySelector('[name*=\"ct_bot_detector_event_token\"]').value;\n }\n\n let data = {\n 'action': 'cleantalk_outside_iframe_ajax_check',\n 'ct_no_cookie_hidden_field': getNoCookieData(),\n 'ct_bot_detector_event_token': botDetectorToken,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n ctProtectOutsideIframeCheck = true;\n if (result.apbct.blocked === false) {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach(function(el) {\n el.parentNode.remove();\n });\n } else {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.parentNode.style.color = 'white';\n el.parentNode.innerHTML += result.apbct.comment;\n });\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.remove();\n });\n }\n },\n },\n );\n }\n };\n iframe.parentNode.style.position = 'relative';\n iframe.parentNode.appendChild(cover);\n let iframes = apbctLocalStorage.get('apbct_iframes_protected');\n if (false === iframes) {\n iframes = [];\n }\n if (typeof iframe.id !== 'undefined') {\n iframes.push(iframe.id);\n apbctLocalStorage.set('apbct_iframes_protected', iframes);\n }\n}\n\n/**\n * Catch NSL form integration\n */\nfunction catchNextendSocialLoginForm() {\n let blockNSL = document.getElementById('nsl-custom-login-form-main');\n if (blockNSL) {\n blockBtnNextendSocialLogin(blockNSL);\n }\n}\n\n/**\n * Blocking NSL plugin buttons\n * @param {HTMLElement} blockNSL\n */\nfunction blockBtnNextendSocialLogin(blockNSL) {\n let parentBtnsNSL = blockNSL.querySelectorAll('.nsl-container-buttons a');\n let childBtnsNSL = blockNSL.querySelectorAll('a[data-plugin=\"nsl\"] .nsl-button');\n parentBtnsNSL.forEach((el) => {\n el.setAttribute('data-oauth-login-blocked', 'true');\n el.addEventListener('click', (event) => {\n event.preventDefault();\n });\n });\n childBtnsNSL.forEach((el) => {\n el.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n ctCheckAjax(el);\n });\n });\n}\n\n/**\n * Unlocking the button and clicking on it after an ajax response\n * @param {HTMLElement} childBtn\n */\nfunction allowAjaxNextendSocialLogin(childBtn) {\n childBtn.parentElement.setAttribute('data-oauth-login-blocked', 'false');\n childBtn.parentElement.click();\n}\n\n/**\n * Locking the button and entering a message after an ajax response\n * @param {HTMLElement} childBtn\n * @param {string} msg\n */\nfunction forbiddenAjaxNextendSocialLogin(childBtn, msg) {\n let parentElement = childBtn.parentElement;\n if (parentElement.getAttribute('data-oauth-login-blocked') == 'false') {\n parentElement.setAttribute('data-oauth-login-blocked', 'true');\n }\n if (!document.querySelector('.ct-forbidden-msg')) {\n let elemForMsg = document.createElement('div');\n elemForMsg.className = 'ct-forbidden-msg';\n elemForMsg.style.background = 'red';\n elemForMsg.style.color = 'white';\n elemForMsg.style.padding = '5px';\n elemForMsg.innerHTML = msg;\n parentElement.insertAdjacentElement('beforebegin', elemForMsg);\n }\n}\n\n/**\n * User verification using user data and ajax\n * @param {HTMLElement} elem\n */\nfunction ctCheckAjax(elem) {\n let data = {\n 'action': 'cleantalk_nsl_ajax_check',\n 'ct_no_cookie_hidden_field': document.getElementsByName('ct_no_cookie_hidden_field')[0].value,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if (result.apbct.blocked === false) {\n allowAjaxNextendSocialLogin(elem);\n } else {\n forbiddenAjaxNextendSocialLogin(elem, result.apbct.comment);\n }\n },\n },\n );\n}\n\n/**\n * Checking the form integration\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isIntegratedForm(formObj) {\n const formAction = typeof(formObj.action) == 'string' ? formObj.action : '';\n const formId = formObj.getAttribute('id') !== null ? formObj.getAttribute('id') : '';\n\n if (\n (\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n formAction.indexOf('app.kit.com') !== -1 // ConvertKit new form\n ) ||\n ( formObj.firstChild.classList !== undefined &&\n formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1 ||\n formId.indexOf('ihf-contact-request-form') !== -1 ||\n formAction.indexOf('crm.zoho.com') !== -1 ||\n formId.indexOf('delivra-external-form') !== -1 ||\n // todo Return to Hubspot for elementor in the future, disabled of reason https://doboard.com/1/task/9227\n // ( formObj.classList !== undefined &&\n // !formObj.classList.contains('woocommerce-checkout') &&\n // formObj.hasAttribute('data-hs-cf-bound')\n // ) || // Hubspot integration in Elementor form// Hubspot integration in Elementor form\n formAction.indexOf('eloqua.com') !== -1 || // Eloqua integration\n formAction.indexOf('kulahub.net') !== -1 || // Kulahub integration\n isFormHasDiviRedirect(formObj) || // Divi contact form\n formAction.indexOf('eocampaign1.com') !== -1 || // EmailOctopus Campaign form\n formAction.indexOf('wufoo.com') !== -1 || // Wufoo form\n ( formObj.classList !== undefined &&\n formObj.classList.contains('sp-element-container') ) // Sendpulse form\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * This function detect if the form has DIVI redirect. If so, the form will work as external.\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isFormHasDiviRedirect(formObj) {\n let result = false;\n const diviRedirectedSignSet = document.querySelector('div[id^=\"et_pb_contact_form\"]');\n if (\n typeof formObj === 'object' && formObj !== null &&\n diviRedirectedSignSet !== null &&\n diviRedirectedSignSet.hasAttribute('data-redirect_url') &&\n diviRedirectedSignSet.getAttribute('data-redirect_url') !== '' &&\n diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]') !== null\n ) {\n result = formObj === diviRedirectedSignSet.querySelector('form[class^=\"et_pb_contact_form\"]');\n }\n return result;\n}\n\n/**\n * Sending Ajax for checking form data\n * @param {HTMLElement} form\n * @param {HTMLElement} prev\n * @param {HTMLElement} formOriginal\n */\nfunction sendAjaxCheckingFormData(form) {\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visibleFields );\n\n const data = {\n 'ct_bot_detector_event_token': apbctLocalStorage.get('bot_detector_event_token'),\n };\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ) {\n // MooSend spinner deactivate\n apbctMoosendSpinnerToggle(form);\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Klaviyo integration\n if (form.classList !== undefined && form.classList.contains('klaviyo-form')) {\n const cover = document.getElementById('apbct-klaviyo-cover');\n if (cover) {\n cover.remove();\n }\n const btn = form.querySelector('button[type=\"button\"].needsclick');\n if (btn) {\n btn.disabled = false;\n btn.click();\n }\n return;\n }\n\n // MooSend integration\n if ( form.dataset.mailingListId !== undefined ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Salesforce integration\n if (form.hasAttribute('action') &&\n (form.getAttribute('action').indexOf('webto.salesforce.com') !== -1)\n ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n // Active Campaign integration\n if (form.querySelector('[href*=\"activecampaign\"]')) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n form.onsubmit = form.onsubmitOriginal;\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n const formNew = form;\n form.parentElement.removeChild(form);\n const prev = form.apbctPrev;\n const formOriginal = form.apbctFormOriginal;\n let mauticIntegration = false;\n\n apbctReplaceInputsValuesFromOtherForm(formNew, formOriginal);\n\n // mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mauticIntegration = true;\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n for (const el of formOriginal.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n\n for (const el of formOriginal.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n\n // Common click event\n let submButton = formOriginal.querySelectorAll('button[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n if (mauticIntegration) {\n setTimeout(function() {\n ctProtectExternal();\n }, 1500);\n }\n return;\n }\n\n submButton = formOriginal.querySelectorAll('input[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // ConvertKit direct integration\n submButton = formOriginal.querySelectorAll('button[data-element=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // Paypal integration\n submButton = formOriginal.querySelectorAll('input[type=\"image\"][name=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n }\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Handle dynamic rendered form\n */\nfunction catchDynamicRenderedForm() {\n const forms = document.getElementsByTagName('form');\n\n catchDynamicRenderedFormHandler(forms);\n\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n\n if ( iframeForms.length === 0 ) {\n return;\n }\n\n catchDynamicRenderedFormHandler(iframeForms, frames[j].contentDocument);\n }\n }\n}\n\n/**\n * Handles dynamic rendered forms by attaching an onsubmit event handler to them.\n *\n * @param {HTMLCollection} forms - A collection of form elements to be processed.\n * @param {Document} [documentObject=document] - The document object to use for querying elements.\n */\nfunction catchDynamicRenderedFormHandler(forms, documentObject = document) {\n const neededFormIds = [];\n for (const form of forms) {\n const formIdAttr = form.getAttribute('id');\n if (formIdAttr && formIdAttr.indexOf('hsForm') !== -1) {\n neededFormIds.push(formIdAttr);\n }\n if (formIdAttr && formIdAttr.indexOf('createuser') !== -1 &&\n (form.classList !== undefined && form.classList.contains('ihc-form-create-edit'))\n ) {\n neededFormIds.push(formIdAttr);\n }\n }\n\n for (const formId of neededFormIds) {\n const form = documentObject.getElementById(formId);\n form.apbct_external_onsubmit_prev = form.onsubmit;\n form.onsubmit = sendAjaxCheckingDynamicFormData;\n }\n}\n\n/**\n * Sending Ajax for checking form data on dynamic rendered form\n * @param {HTMLElement} form\n */\nfunction sendAjaxCheckingDynamicFormData(form) {\n form.preventDefault();\n form.stopImmediatePropagation();\n const formEvent = form;\n form = form.target;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie(visibleFields);\n form.append(ctNoCookieConstructHiddenField('hidden'));\n\n const data = {};\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n form.onsubmit = null;\n\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Call previous submit action\n if (form.apbct_external_onsubmit_prev instanceof Function) {\n let timerId = setTimeout(function() {\n form.apbct_external_onsubmit_prev.call(form, formEvent);\n }, 500);\n clearTimeout(timerId);\n }\n\n const submButton = form.querySelector('input[type=\"submit\"]');\n if (submButton) {\n submButton.click();\n return;\n }\n }\n\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Implement jQuery val() function\n * @param {HTMLElement} el\n * @return {HTMLElements}\n */\nfunction apbctVal(el) {\n if (el.options && el.multiple) {\n return el.options\n .filter((option) => option.selected)\n .map((option) => option.value);\n } else if (el.type === 'checkbox' || el.type === 'radio') {\n return el.checked ? el.checked : null;\n } else {\n return el.value;\n }\n}\n\n/**\n * Check form as internal.\n * @param {int} currForm Current form.\n */\nfunction ctCheckInternal(currForm) {\n // Gathering data\n const ctData = {};\n const elems = currForm.elements;\n let key;\n\n for (key in elems) {\n if (elems[key].type !== 'submit' &&\n elems[key].value !== undefined &&\n elems[key].value !== '') {\n ctData[elems[key].name] = currForm.elements[key].value;\n }\n }\n ctData.action = 'ct_check_internal';\n\n // AJAX Request\n apbct_public_sendAJAX(\n ctData,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function(data) {\n if (data.success === true) {\n currForm.origSubmit();\n } else {\n alert(data.data);\n return false;\n }\n },\n },\n );\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctCurrAction = '';\n let ctCurrForm = '';\n\n if ( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n setTimeout(() => {\n for ( let i = 0; i < document.forms.length; i++ ) {\n if ( typeof(document.forms[i].action) == 'string' ) {\n ctCurrForm = document.forms[i];\n ctCurrAction = ctCurrForm.action;\n if (\n ctCurrAction.indexOf('https?://') !== null && // The protocol is obligatory\n ctCurrAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ctCheckInternalIsExcludedForm(ctCurrAction) // Exclude WordPress native scripts from processing\n ) {\n const formClone = ctCurrForm.cloneNode(true);\n ctCurrForm.parentNode.replaceChild(formClone, ctCurrForm);\n\n formClone.origSubmit = ctCurrForm.submit;\n formClone.submit = null;\n\n formClone.addEventListener('submit', function(event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n ctCheckInternal(event.target);\n return false;\n });\n }\n }\n }\n }, 500);\n});\n\n/**\n * Check by action to exclude the form checking\n * @param {string} action\n * @return {boolean}\n */\nfunction ctCheckInternalIsExcludedForm(action) {\n // An array contains forms action need to be excluded.\n const ctInternalScriptExclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ctInternalScriptExclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","getAttribute","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","ctJsErrors","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","selectActualNonce","defaultNonce","ctPublicFunctions","hasOwnProperty","_fresh_nonce","data__ajax_type","_ajax_nonce","_rest_nonce","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","prepare","keys","deleteDoubleJSONEncoding","convertData","console","open","setHeaders","onreadystatechange","isWpNonceError","getFreshNonceAndRerunXHR","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","restErrror","ajaxErrror","readyState","initialRequestParams","noncePrev","spbc_remote_call_action","plugin_name","nonce_prev","initial_request_params","notJson","host_url","freshNonceResult","newRequestParams","undefined","wpnonce","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","_rest_url","route","nonce","X-WP-Nonce","defineProperty","property","enumerable","configurable","writable","ApbctFormDecorator","getElements","setListeners","regexId","regexClass","setDecorationBackground","matchingElements","from","test","element","id","forEach","flagLeft","flagRight","flagWrap","blockForms","classHeaderWrapper","endPosition","classTemplate","substring","blockForm","clickX","flagLeftWidth","flagLeftHeight","flagRightWidth","flagRightHeight","offsetX","clickY","offsetY","parseFloat","width","height","addClicks","getSelection","addSelected","mouseX","mouseY","trackMouseMovement","ctFormDecorationMouseData","clicks","selected","firstMovement","timeDiff","mouseMovements","timestamp","now","index","lastMovement","hovering","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","item","apbctLocalStorage","set","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","encodeURIComponent","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bloomPopup","pafeFormsFormElementor","otterForm","bookingPress","isArray","getJavascriptClientData","e","apbct_site_referer","apbct_force_alt_cookies","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","beforeSend","ctGetCookie","matches","RegExp","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","no_cache","apbctGenerateUniqueID","substr","get","storageValue","json","isJson","objToSave","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","apbctForceProtect","ApbctForceProtection","data__key_is_ok","apbct_attach_event_handler","wrappers","findWrappers","checkBot","event_javascript_data","post_url","referrer","checkBotCallback","result","decodeForms","allow","showMessageForBot","form","wrapper","dataset","encodedForm","outerHTML","atob","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctCheckedEmailsExist","ctMouseReadInterval","ctMouseWriteDataInterval","tokenCheckerIntervalId","botDetectorLogLastUpdate","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__bot_detector_enabled","sendBotDetectorLogToAltSessions","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","interval","currentLog","log_last_update","token","doAttach","getElementsByClassName","getElementById","setEventTokenField","clearInterval","checkEmail","currentEmail","email","checkEmailExist","hint","getResultCheckEmailExist","viewCheckEmailExist","envelope","text_result","state","textResult","inputEmail","top","getBoundingClientRect","left","right","offsetHeight","envelopeWidth","offsetWidth","onmouseover","textContent","color","onmouseout","ctIsDrawPixel","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","startForcedAltEventTokenChecker","eventToken","apbct_ready","botDetectorLocalStorage","wc_ajax_add_to_cart","apbctCheckAddToCartByGet","sessionID","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","data__email_check_exist_post","tokenForForceAlt","encodedEmailNodes","settings__data__bot_detector_enabled","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","ctAddWCMiddlewares","hiddenInput","visibleFieldsToInput","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","ctFillDecodedEmailHandler","_form","settings__forms__search_test","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","apbctCatchXmlHttpRequest","settings__comments__form_decoration","apbctAjaxSetImportantParametersOnCacheExist","advancedCacheExists","varnishCacheExists","settings__sfw__anti_crawler","checkBotDetectorExist","botDetectorIntervalSearch","bot_detector_event_token","wp","apiFetch","use","options","next","requests","path","ct_no_cookie_hidden_field","originalSend","addidionalCleantalkData","apply","cacheExist","ajaxSetup","sourceSign","contains","targetForm","honeyPotField","hpValue","hpEventId","callBack","parsedCookies","cleantalkStorageDataArray","getCleanTalkStorageDataArray","eventTokenLocalStorage","preventDefault","parentNode","HTMLFormElement","submit","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","ct_bot_detector_event_token","warn","encodedEmailNodesIsMixed","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","innerHTML","wl_brandname","waitingPopup","popupHeader","innerText","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","animationElements","animationWrapper","apbctEEAnimationDogOne","clickSource","encodedEmails","encodedEmailsCollection","apbctTooltip","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","popup","currentResultData","row","encoded_email","decoded_email","firstNode","selectableEmail","title","secondNode","buttonWrapper","fillDecodedEmails","click","comment","decodingResult","encodedEmail","baseElementContent","encodedEmailTextInsideMailto","el","ctProcessDecodedDataResult","commonCookies","resultDataJson","ct_checked_emails","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_headless","ct_bot_detector_frontend_data_log","apbct_page_hits","apbct_prev_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","popupText","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","formDecorationMouseData","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","noCookieDataFromDecoration","form_decoration_mouse_data","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","hiddenFieldType","formAction","j","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","ignoreURLConvert","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","ctProtectExternal","cleantalk_hidden_action","cleantalk_hidden_method","ctMethod","currentForm","formIsExclusion","isIntegratedForm","apbctProcessExternalForm","mailingListId","apbctProcessExternalFormByFakeButton","tmp","hostname","ctAction","appendChild","apbctProcessIframes","exclusionAction","exclusionId","exclusionClass","foundClass","formClass","apbctGetFormClass","exclusionRole","formRole","table","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalkPlaceholder","prev","insertBefore","previousSibling","formHtml","formOriginal","placeholder","forceAction","firstElementChild","reUseCurrentForm","apbctPrev","apbctFormOriginal","mailerliteDetectedClass","mailerliteClass","mailerliteSubmitButton","sendAjaxCheckingFormData","currentTarget","submitButtonOriginal","onsubmitOriginal","submitButtonHtml","apbctParent","apbctMoosendSpinnerToggle","buttonElement","submitText","zIndex","apbctReplaceInputsValuesFromOtherForm","formSource","formTarget","inputsSource","inputsTarget","isFormHasDiviRedirect","elemSource","elemTarget","checked","apbctVal","ctProtectKlaviyoForm","klaviyoForms","apbctProcessExternalFormKlaviyo","cover","btn","disabled","onclick","ctProtectOutsideIframe","iframes","iframe","src","ctProtectOutsideIframeHandler","ctTrpLocalize","ctTrpIsAdminCommentsList","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","trpComments","learnMoreLink","trpLayout","trpImage","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","nextElementSibling","clearTimeout","selection","onSelectionChange","settings__forms__check_external","catchDynamicRenderedForm","catchNextendSocialLoginForm","ctProtectOutsideIframeCheck","currentDiv","preloader","botDetectorToken","blockNSL","blockBtnNextendSocialLogin","parentBtnsNSL","childBtnsNSL","ctCheckAjax","allowAjaxNextendSocialLogin","childBtn","forbiddenAjaxNextendSocialLogin","elemForMsg","insertAdjacentElement","getElementsByName","formObj","firstChild","diviRedirectedSignSet","elems","submitButton","formNew","mauticIntegration","submButton","catchDynamicRenderedFormHandler","neededFormIds","formIdAttr","apbct_external_onsubmit_prev","sendAjaxCheckingDynamicFormData","stopImmediatePropagation","formEvent","timerId","multiple","option","map","ctCheckInternal","currForm","ctData","alert","origSubmit","ctCheckInternalIsExcludedForm","some","blog_home","ctCurrAction","ctCurrForm","settings__forms__check_internal","formClone","cloneNode","replaceChild"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,M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EAAGA,EAAInB,SAASge,MAAM5c,OAAQD,CAAC,GAAK,CAC9C,IAQco4B,EAR2B,UAApC,OAAOv5B,SAASge,MAAM7c,GAAS,SAChCk4B,EAAar5B,SAASge,MAAM7c,GAGc,QAF1Ci4B,EAAeC,EAAW7kB,QAEThQ,QAAQ,WAAW,GACwB,OAAxD40B,EAAal1B,MAAMsO,SAAS2mB,UAAY,SAAU,GAChDF,8BAA8BG,CAAY,IAEtCG,EAAYF,EAAWG,UAAU,CAAA,CAAI,EAC3CH,EAAW7U,WAAWiV,aAAaF,EAAWF,CAAU,EAExDE,EAAUP,WAAaK,EAAW3U,OAClC6U,EAAU7U,OAAS,KAEnB6U,EAAU52B,iBAAiB,SAAU,SAASpD,GAK1C,OAJAA,EAAMglB,eAAe,EACrBhlB,EAAMyD,gBAAgB,EACtBzD,EAAM+4B,yBAAyB,EAC/BM,gBAAgBr5B,EAAMuD,MAAM,EACrB,CAAA,CACX,CAAC,GAGb,CACJ,EAAG,GAAG,CACV,CAAC"} \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index c594752b..34cf5628 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1,2 +1,2 @@ -class ApbctCore{ajax_parameters={};restParameters={};selector=null;elements=[];eventCallback;eventSelector;event;constructor(e){this.select(e)}select(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"==typeof e?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}addElement(e){"object"==typeof e?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}push(e){this.elements.push(e)}reduce(){this.elements=this.elements.slice(0,-1)}deselect(){this.elements=[]}css(o,t){if(t=t||!1,"object"==typeof o){for(let t in o)if(Object.hasOwn(o,t)){var a=t.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));for(let e=0;e(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||=e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||=Boolean(e[t]):o||=null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)),o}isWithoutSelector(e,t){var o;let a=!1;for(o of document.querySelectorAll(t))a||=e===o;return a}filter(t){this.selector=null;for(let e=this.elements.length-1;0<=e;e--)this.isElem(this.elements[e],t)||this.elements.splice(Number(e),1);return this}parent(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}parents(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}children(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}siblings(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}remove(){for(var e of this.elements)e.remove()}after(e){for(var t of this.elements)t.after(e)}append(e){for(var t of this.elements)t.append(e)}fadeIn(a){for(let o of this.elements){o.style.opacity=0,o.style.display="block";let e=+new Date,t=function(){o.style.opacity=+o.style.opacity+(new Date-e)/a,e=+new Date,+o.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16))};t()}}fadeOut(a){for(let o of this.elements){o.style.opacity=1;let e=+new Date,t=function(){o.style.opacity=+o.style.opacity-(new Date-e)/a,e=+new Date,0<+o.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,16):o.style.display="none"};t()}}}function ctProcessError(e,t){var o={},e=(e&&e.message?o.err={msg:e.message,file:e.fileName||!1,ln:e.lineNumber||lineNo||!1,col:e.columnNumber||columnNo||!1,stacktrace:e.stack||!1,cause:!!t&&JSON.stringify(t),errorObj:error||!1}:(o.err={msg:e},t&&(o.err.file=t)),o.url=window.location.href,o.userAgent=window.navigator.userAgent,"ct_js_errors");let a=localStorage.getItem(e);null===a&&(a="[]"),a=JSON.parse(a);for(let e=0;et.test(e.id)));a.forEach(e=>{this.elements.push(e)}),(a=Array.from(e).filter(e=>o.test(e.className))).forEach(e=>{this.elements.push(e)});var c,n,e=document.querySelector(".apbct_form_decoration");e&&(c=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after"),c)&&n&&this.elements.push(e)}setDecorationBackground(){var e=document.querySelectorAll("#respond");if(document.querySelector('[class*="apbct_form_decoration"]')){var o=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class"),a=o.indexOf("_header__wrapper");let t=o.substring(0,a);e.forEach(e=>{e.className+=" "+t})}}setListeners(){this.elements.forEach(i=>{i&&(i.addEventListener("click",e=>{var t,o,a,c,n;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(e{setTimeout(()=>{window.getSelection().toString()&&this.addSelected()},100)}),i.addEventListener("mousemove",e=>{var t,o,a,c,n;(-1===i.className.indexOf("apbct_form_decoration")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,aMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;ethis.checkBotCallback(e)}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:e=>this.checkBotCallback(e)}))}checkBotCallback(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"==typeof e&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}decodeForms(){let t;this.wrappers.forEach(e=>{t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}showMessageForBot(t){let o;this.wrappers.forEach(e=>{(o=e.querySelector("div.ct-encoded-form").dataset.encodedForm)&&(e.outerHTML='
'+t+"
")})}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((e,t)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3),document.querySelectorAll("[data-original-string]"));if((ctPublic.encodedEmailNodes=c).length)for(let e=0;ectSearchFormOnSubmitHandler(e,t));apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){if(ctPublic.settings__data__bot_detector_enabled){let e=setInterval(()=>{!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use((e,t)=>("object"==typeof e&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{null!==e&&e.parentNode.removeChild(e),"function"==typeof c.apbctSearchPrevOnsubmit?c.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(c)},i=r,null!==t&&null!==o&&(i.apbct_search_form__honeypot_value=t,i.apbct_search_form__honeypot_id=o),i.ct_bot_detector_event_token=l,"string"==typeof i.apbct_pixel_url&&-1!==i.apbct_pixel_url.indexOf("%3A")&&(i.apbct_pixel_url=decodeURIComponent(i.apbct_pixel_url)),void 0!==(s=JSON.stringify(i))&&0!==s.length?ctSetAlternativeCookie(s,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o,a,c,n=document.getElementById("apbct_popup");n?(n.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((n=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),n.setAttribute("id","apbct_popup"),(t=document.createElement("span")).classList="apbct-email-encoder-elements_center",(o=document.createElement("p")).innerText=ctPublic.wl_brandname,o.setAttribute("class","apbct-email-encoder--popup-header"),t.append(o),(o=document.createElement("div")).setAttribute("id","apbct_popup_text"),o.setAttribute("class","apbct-email-encoder-elements_center"),o.style.color="black",(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",a.innerText="The magic is on the way, please wait for a few seconds!",a.setAttribute("class","apbct-email-encoder-elements_center"),(c=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",c.innerText="Decoding process to the original data.",o.append(a),o.append(c),n.append(t),n.append(o),n.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(n)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],o=document.createElement("div");o.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===s.dataset.originalString&&(t=e)});var o=t.decoded_email.split(/[&?]/)[0],a=e.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),o=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=o,c.title="Click to select the whole data",a&&(a.innerHTML="The original one is "+c.outerHTML,a.setAttribute("style","flex-direction: row;")),e.querySelector(".apbct-ee-animation-wrapper")),c=(o&&o.remove(),e.querySelector("#apbct_email_ecoder__popup_text_node_second")),a=(c&&c.remove(),document.createElement("span"));a.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||((o=document.createElement("button")).innerText="Got it",o.classList="apbct-email-encoder-got-it-button",o.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),e.setAttribute("style","display:none"),fillDecodedEmails(i,n),ctPublic.encodedEmailNodesIsMixed&&s.click()}),a.append(o),e.append(a))}},3e3):n.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+n.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+n.data[0].comment))}function fillDecodedEmails(a,e){for(let o=0;o{e.encoded_email===a[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;var c,n;void 0!==a[o].href&&0===a[o].href.indexOf("mailto:")?(c=a[o].href.replace("mailto:",""),n=a[o].innerHTML,a[o].innerHTML=n.replace(c,t.decoded_email),a[o].href="mailto:"+t.decoded_email,a[o].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let o="";e.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(a[o].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,a[o])},2e3)),a[o].removeEventListener("click",ctFillDecodedEmailHandler)}}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),s=apbctSessionStorage.get("apbct_site_referer"),r=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),_=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),h=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(o.ct_mouse_moved=void 0!==e?e:p,o.ct_has_scrolled=void 0!==a?a:_,o.ct_cookies_type=void 0!==c?c:m,o.apbct_pixel_url=void 0!==l?l:b,o.apbct_headless=void 0!==d?d:h,o.ct_bot_detector_frontend_data_log=void 0!==u?u:"",o.apbct_pixel_url&&"string"==typeof o.apbct_pixel_url&&o.apbct_pixel_url.indexOf("%3A%2F")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),o.apbct_page_hits=n,o.apbct_prev_referer=i,o.apbct_site_referer=s,o.apbct_ct_js_errors=r,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t)for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],a="",c=0,n="",i=0,o=[];for(var s in e.elements)isNaN(+s)||(t[s]=e.elements[s]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(a+=" "+e.getAttribute("name"),c++):(n+=" "+e.getAttribute("name"),i++))}),n=n.trim(),{visible_fields:a=a.trim(),visible_fields_count:c,invisible_fields:n,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var a in o){if(10{a.addEventListener("click",function(e){let t=a.getAttribute("href");var o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",t+="ct_bot_detector_event_token="+o,a.setAttribute("href",t))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(var t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},s=document.createElement("style"),i=(s.setAttribute("id","cleantalk-modal-styles"),s.innerHTML="body.cleantalk-modal-opened{"+i+"}",s.innerHTML+="#cleantalk-modal-overlay{"+t+"}",s.innerHTML+="#cleantalk-modal-close{"+a+"}",s.innerHTML+="#cleantalk-modal-close:before{"+c+"}",s.innerHTML+="#cleantalk-modal-close:after{"+n+"}",document.body.append(s),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),c=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?(n=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?c.innerHTML=this.loaded:c.innerHTML=this.loaded.replace(n,'
$1')):(c.innerHTML="Loading...",this.load("get_options_template")),c.setAttribute("id","cleantalk-modal-content"),t.append(c),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctCheckInternal(t){var e={},o=t.elements;let a;for(a in o)"submit"!==o[a].type&&void 0!==o[a].value&&""!==o[a].value&&(e[o[a].name]=t.elements[a].value);e.action="ct_check_internal",apbct_public_sendAJAX(e,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctCheckInternalIsExcludedForm(t){return["wp-login.php","wp-comments-post.php"].some(e=>null!==t.match(new RegExp(ctPublic.blog_home+".*"+e)))}document.addEventListener("click",function(e){!e.target||"cleantalk-modal-overlay"!==e.target.id&&"cleantalk-modal-close"!==e.target.id||cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),document.addEventListener("DOMContentLoaded",function(){let l=void 0,d=!1;if("undefined"==typeof ctPublic&&"undefined"==typeof ctTrpAdminLocalize||void 0===(l="undefined"!=typeof ctPublic&&ctPublic.theRealPerson?ctPublic.theRealPerson:l)&&"undefined"!=typeof ctTrpAdminLocalize&&ctTrpAdminLocalize.theRealPerson&&(l=ctTrpAdminLocalize.theRealPerson,d=!0),l){let e='.apbct-trp *[class*="comment-author"]';document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]');var t=document.querySelectorAll(e+',.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong');0!==t.length&&(t.forEach((e,t)=>{var o,a=document.createElement("div"),c=(a.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),n=(c.setAttribute("src",l.imgPersonUrl),c.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(n.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),s=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(l.phrases.trpHeading),document.createElement("div")),r=(s.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));r.append(l.phrases.trpContent1+" "),r.append(l.phrases.trpContent2),d&&((o=document.createElement("a")).setAttribute("href",l.trpContentLink),o.setAttribute("target","_blank"),o.text=l.phrases.trpContentLearnMore,r.append(" "),r.append(o)),s.append(r),n.append(i,s),a.append(c),e.append(a),e.append(n)}),document.querySelectorAll(".apbct-real-user-badge").forEach(o=>{let a=void 0,e=(o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){a=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){a=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(()=>{var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}),document.addEventListener("DOMContentLoaded",function(){let o="",a="";+ctPublic.settings__forms__check_internal&&setTimeout(()=>{for(let e=0;ee.toUpperCase().replace("-","").replace("_",""));for(let e=0;et.test(e.id));a.forEach(e=>{this.elements.push(e)}),(a=Array.from(e).filter(e=>o.test(e.className))).forEach(e=>{this.elements.push(e)});var c,n,e=document.querySelector(".apbct_form_decoration");e&&(c=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after"),c)&&n&&this.elements.push(e)}setDecorationBackground(){var e=document.querySelectorAll("#respond");if(document.querySelector('[class*="apbct_form_decoration"]')){var o=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class"),a=o.indexOf("_header__wrapper");let t=o.substring(0,a);e.forEach(e=>{e.className+=" "+t})}}setListeners(){this.elements.forEach(i=>{i&&(i.addEventListener("click",e=>{var t,o,a,c,n;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(e{setTimeout(()=>{window.getSelection().toString()&&this.addSelected()},100)}),i.addEventListener("mousemove",e=>{var t,o,a,c,n;(-1===i.className.indexOf("apbct_form_decoration")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,a=parseFloat(window.getComputedStyle(i,"::before").height)/2,c=parseFloat(window.getComputedStyle(i,"::after").width)/2,n=parseFloat(window.getComputedStyle(i,"::after").height)/2,aMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){var t={};for(let e=0;ethis.checkBotCallback(e)}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:e=>this.checkBotCallback(e)}))}checkBotCallback(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"==typeof e&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}decodeForms(){let t;this.wrappers.forEach(e=>{t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}showMessageForBot(t){let o;this.wrappers.forEach(e=>{(o=e.querySelector("div.ct-encoded-form").dataset.encodedForm)&&(e.outerHTML='
'+t+"
")})}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((e,t)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((e,t)=>{e.addEventListener("paste",()=>{this.data[t].isUseBuffer=!0})}),this.fields.forEach((e,t)=>{e.addEventListener("onautocomplete",()=>{this.data[t].isAutoFill=!0})}),this.fields.forEach((e,o)=>{e.addEventListener("input",()=>{this.data[o].countOfKey++;var e,t=+new Date;1===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].firstKeyTimestamp=t):(e=t-this.data[o].lastKeyTimestamp,2===this.data[o].countOfKey?(this.data[o].lastKeyTimestamp=t,this.data[o].lastDelta=e):2{window.XMLHttpRequest.prototype.send=defaultSend},0)}),e.target.onsubmit_prev instanceof Function&&!ctOnsubmitPrevCallExclude(e.target)&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3),document.querySelectorAll("[data-original-string]"));if((ctPublic.encodedEmailNodes=c).length)for(let e=0;ectSearchFormOnSubmitHandler(e,n));apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists),ctPublic.settings__sfw__anti_crawler&&checkBotDetectorExist()}function checkBotDetectorExist(){if(ctPublic.settings__data__bot_detector_enabled){const e=setInterval(()=>{!localStorage.bot_detector_event_token||(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use((e,t)=>("object"==typeof e&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{null!==l&&l.parentNode.removeChild(l),"function"==typeof a.apbctSearchPrevOnsubmit?a.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(a)},n=s,null!==e&&null!==t&&(n.apbct_search_form__honeypot_value=e,n.apbct_search_form__honeypot_id=t),n.ct_bot_detector_event_token=r,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(i=JSON.stringify(n))&&0!==i.length?ctSetAlternativeCookie(i,{callback:c,onErrorCallback:c,forceAltCookies:!0}):c())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler);ctPublic.encodedEmailNodesIsMixed=!1,document.body.classList.add("apbct-popup-fade");var t,o,a,c,n=document.getElementById("apbct_popup");n?(n.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctPublic.wl_brandname+" is decoding the email addresses."):((n=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),n.setAttribute("id","apbct_popup"),(t=document.createElement("span")).classList="apbct-email-encoder-elements_center",(o=document.createElement("p")).innerText=ctPublic.wl_brandname,o.setAttribute("class","apbct-email-encoder--popup-header"),t.append(o),(o=document.createElement("div")).setAttribute("id","apbct_popup_text"),o.setAttribute("class","apbct-email-encoder-elements_center"),o.style.color="black",(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",a.innerText="The magic is on the way, please wait for a few seconds!",a.setAttribute("class","apbct-email-encoder-elements_center"),(c=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",c.innerText="Decoding process to the original data.",o.append(a),o.append(c),n.append(t),n.append(o),n.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(n)),apbctAjaxEmailDecodeBulk(e,ctPublic.encodedEmailNodes,this)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],o=document.createElement("div");o.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===s.dataset.originalString&&(t=e)});var o=t.decoded_email.split(/[&?]/)[0],a=e.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),o=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=o,c.title="Click to select the whole data",a&&(a.innerHTML="The original one is "+c.outerHTML,a.setAttribute("style","flex-direction: row;")),e.querySelector(".apbct-ee-animation-wrapper")),c=(o&&o.remove(),e.querySelector("#apbct_email_ecoder__popup_text_node_second")),a=(c&&c.remove(),document.createElement("span"));a.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||((o=document.createElement("button")).innerText="Got it",o.classList="apbct-email-encoder-got-it-button",o.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),e.setAttribute("style","display:none"),fillDecodedEmails(i,n),ctPublic.encodedEmailNodesIsMixed&&s.click()}),a.append(o),e.append(a))}},3e3):n.success?(resetEncodedNodes(),ctShowDecodeComment("Blocked: "+n.data[0].comment)):(resetEncodedNodes(),ctShowDecodeComment("Cannot connect with CleanTalk server: "+n.data[0].comment))}function fillDecodedEmails(a,e){for(let o=0;o{e.encoded_email===a[o].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;var c,n;void 0!==a[o].href&&0===a[o].href.indexOf("mailto:")?(c=a[o].href.replace("mailto:",""),n=a[o].innerHTML,a[o].innerHTML=n.replace(c,t.decoded_email),a[o].href="mailto:"+t.decoded_email,a[o].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let o="";e.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(a[o].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,a[o])},2e3)),a[o].removeEventListener("click",ctFillDecodedEmailHandler)}}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(t=[]){let o={};o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=apbctLocalStorage.get("apbct_page_hits"),i=apbctSessionStorage.get("apbct_prev_referer"),s=apbctSessionStorage.get("apbct_site_referer"),r=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),d=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),_=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),m=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),h=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(o.ct_mouse_moved=void 0!==e?e:p,o.ct_has_scrolled=void 0!==a?a:_,o.ct_cookies_type=void 0!==c?c:m,o.apbct_pixel_url=void 0!==l?l:b,o.apbct_headless=void 0!==d?d:h,o.ct_bot_detector_frontend_data_log=void 0!==u?u:"",o.apbct_pixel_url&&"string"==typeof o.apbct_pixel_url&&o.apbct_pixel_url.indexOf("%3A%2F")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),o.apbct_page_hits=n,o.apbct_prev_referer=i,o.apbct_site_referer=s,o.apbct_ct_js_errors=r,o.apbct_pixel_url||(o.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof t)for(let e=0;e)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";let t=document.getElementById("apbct_popup");var o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){let t=[],a="",c=0,n="",i=0,o=[];for(var s in e.elements)isNaN(+s)||(t[s]=e.elements[s]);return(t=t.filter(function(e){return-1===o.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(o.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(a+=" "+e.getAttribute("name"),c++):(n+=" "+e.getAttribute("name"),i++))}),n=n.trim(),{visible_fields:a=a.trim(),visible_fields_count:c,invisible_fields:n,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var a in o){if(10{a.addEventListener("click",function(e){let t=a.getAttribute("href");var o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",t+="ct_bot_detector_event_token="+o,a.setAttribute("href",t))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){let e="";for(const t in this.styles)e+=t+":"+this.styles[t]+";";return e}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},s=document.createElement("style"),i=(s.setAttribute("id","cleantalk-modal-styles"),s.innerHTML="body.cleantalk-modal-opened{"+i+"}",s.innerHTML+="#cleantalk-modal-overlay{"+t+"}",s.innerHTML+="#cleantalk-modal-close{"+a+"}",s.innerHTML+="#cleantalk-modal-close:before{"+c+"}",s.innerHTML+="#cleantalk-modal-close:after{"+n+"}",document.body.append(s),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),c=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?(n=/(https?:\/\/[^\s]+)/g,/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?c.innerHTML=this.loaded:c.innerHTML=this.loaded.replace(n,'
$1')):(c.innerHTML="Loading...",this.load("get_options_template")),c.setAttribute("id","cleantalk-modal-content"),t.append(c),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctCheckInternal(t){var e={},o=t.elements;let a;for(a in o)"submit"!==o[a].type&&void 0!==o[a].value&&""!==o[a].value&&(e[o[a].name]=t.elements[a].value);e.action="ct_check_internal",apbct_public_sendAJAX(e,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctCheckInternalIsExcludedForm(t){return["wp-login.php","wp-comments-post.php"].some(e=>null!==t.match(new RegExp(ctPublic.blog_home+".*"+e)))}document.addEventListener("click",function(e){!e.target||"cleantalk-modal-overlay"!==e.target.id&&"cleantalk-modal-close"!==e.target.id||cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),document.addEventListener("DOMContentLoaded",function(){let l=void 0,d=!1;if("undefined"==typeof ctPublic&&"undefined"==typeof ctTrpAdminLocalize||void 0===(l="undefined"!=typeof ctPublic&&ctPublic.theRealPerson?ctPublic.theRealPerson:l)&&"undefined"!=typeof ctTrpAdminLocalize&&ctTrpAdminLocalize.theRealPerson&&(l=ctTrpAdminLocalize.theRealPerson,d=!0),l){let e='.apbct-trp *[class*="comment-author"]';document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]');var t=document.querySelectorAll(e+',.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong');0!==t.length&&(t.forEach((e,t)=>{var o,a=document.createElement("div"),c=(a.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),n=(c.setAttribute("src",l.imgPersonUrl),c.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(n.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),s=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(l.phrases.trpHeading),document.createElement("div")),r=(s.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));r.append(l.phrases.trpContent1+" "),r.append(l.phrases.trpContent2),d&&((o=document.createElement("a")).setAttribute("href",l.trpContentLink),o.setAttribute("target","_blank"),o.text=l.phrases.trpContentLearnMore,r.append(" "),r.append(o)),s.append(r),n.append(i,s),a.append(c),e.append(a),e.append(n)}),document.querySelectorAll(".apbct-real-user-badge").forEach(o=>{let a=void 0;o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){a=setTimeout(()=>{var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)});const e=o.nextElementSibling;e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(()=>{e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){a=setTimeout(()=>{var e=this.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(()=>{var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}}),document.addEventListener("DOMContentLoaded",function(){let o="",a="";+ctPublic.settings__forms__check_internal&&setTimeout(()=>{for(let e=0;e\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ctJsErrors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Select actual WP nonce depending on the ajax type and the fresh nonce provided.\n * @return {string} url\n */\nfunction selectActualNonce() {\n let defaultNonce = '';\n // return fresh nonce immediately if persists\n if (\n ctPublicFunctions.hasOwnProperty('_fresh_nonce') &&\n typeof ctPublicFunctions._fresh_nonce === 'string' &&\n ctPublicFunctions._fresh_nonce.length > 0\n ) {\n return ctPublicFunctions._fresh_nonce;\n }\n // select from default rest/ajax nonces\n if (\n ctPublicFunctions.data__ajax_type === 'admin_ajax' &&\n ctPublicFunctions.hasOwnProperty('_ajax_nonce') &&\n typeof ctPublicFunctions._ajax_nonce === 'string' &&\n ctPublicFunctions._ajax_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._ajax_nonce;\n }\n if (\n ctPublicFunctions.data__ajax_type === 'rest' &&\n ctPublicFunctions.hasOwnProperty('_rest_nonce') &&\n typeof ctPublicFunctions._rest_nonce === 'string' &&\n ctPublicFunctions._rest_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._rest_nonce;\n }\n\n return defaultNonce;\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n if (this.isWpNonceError()) {\n this.getFreshNonceAndRerunXHR(parameters);\n return;\n }\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * Check if 403 code of WP nonce error\n * @return {bool}\n */\n isWpNonceError() {\n let restErrror = false;\n let ajaxErrror = false;\n // check rest error\n if (this.xhr.readyState == 4) {\n restErrror = (\n typeof this.xhr.response === 'object' && this.xhr.response !== null &&\n this.xhr.response.hasOwnProperty('data') &&\n this.xhr.response.data.hasOwnProperty('status') &&\n this.xhr.response.data.status === 403\n );\n ajaxErrror = this.xhr.response === '-1' && this.xhr.status === 403;\n }\n // todo check AJAX error\n return restErrror || ajaxErrror;\n }\n\n /**\n * Get the fresh nonce and rerun the initial XHR with params\n * @param {[]} initialRequestParams\n */\n getFreshNonceAndRerunXHR(initialRequestParams) {\n let noncePrev = '';\n\n // Check if initialRequestParams['headers']['X-WP-Nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('headers') &&\n initialRequestParams.headers.hasOwnProperty('X-WP-Nonce')\n ) {\n noncePrev = initialRequestParams['headers']['X-WP-Nonce'];\n }\n\n // Check if initialRequestParams['data']['_ajax_nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('data') &&\n initialRequestParams.data.hasOwnProperty('_ajax_nonce')\n ) {\n noncePrev = initialRequestParams['data']['_ajax_nonce'];\n }\n\n // Nonce is not provided. Exit.\n if ( noncePrev === '' ) {\n return;\n }\n\n // prepare params for refreshing nonce\n let params = {};\n params.method = 'POST';\n params.data = {\n 'spbc_remote_call_action': 'get_fresh_wpnonce',\n 'plugin_name': 'antispam',\n 'nonce_prev': noncePrev,\n 'initial_request_params': initialRequestParams,\n };\n params.notJson = true;\n params.url = ctPublicFunctions.host_url;\n // this callback will rerun the XHR with initial params\n params.callback = function(...args) {\n // the refresh result itself\n let freshNonceResult = args[0];\n let newRequestParams = false;\n // provided initial params\n if (args[1] !== undefined && args[1].hasOwnProperty('initial_request_params')) {\n newRequestParams = args[1].initial_request_params;\n }\n if (newRequestParams && freshNonceResult.hasOwnProperty('wpnonce')) {\n ctPublicFunctions._fresh_nonce = freshNonceResult.wpnonce;\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n new ApbctCore().rest(newRequestParams);\n } else {\n new ApbctCore().ajax(newRequestParams);\n }\n }\n };\n // run the nonce refreshing call\n new ApbctXhr(params);\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.data._ajax_nonce = selectActualNonce();\n super(args);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n const nonce = selectActualNonce();\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': nonce,\n };\n super(args);\n }\n}\n\n// add hasOwn\nif (!Object.prototype.hasOwn) {\n Object.defineProperty(Object.prototype, 'hasOwn', { // eslint-disable-line\n value: function(property) {\n return Object.prototype.hasOwnProperty.call(this, property);\n },\n enumerable: false,\n configurable: true,\n writable: true,\n });\n}\n\n/**\n * Form skin class\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctFormDecorator {\n elements = [];\n\n /**\n * Constructor\n */\n constructor() {\n this.getElements();\n this.setListeners();\n }\n\n /**\n * Get elements\n */\n getElements() {\n const elements = document.querySelectorAll('*');\n const regexId = /^apbct-trusted-text--label/;\n const regexClass = /apbct_form_decoration--/;\n\n this.setDecorationBackground();\n\n // Collect elements with id or class that contains apbct-trusted-text--label or apbct_form_decoration--\n // id\n let matchingElements = Array.from(elements).filter((element) => {\n return regexId.test(element.id);\n });\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n // class\n matchingElements = Array.from(elements).filter((element) => {\n return regexClass.test(element.className);\n });\n\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n const flagWrap = document.querySelector('.apbct_form_decoration');\n if (flagWrap) {\n const flagLeft = window.getComputedStyle(flagWrap, '::before');\n const flagRight = window.getComputedStyle(flagWrap, '::after');\n if (flagLeft && flagRight) {\n this.elements.push(flagWrap);\n }\n }\n }\n\n /**\n * Set decoration background\n */\n setDecorationBackground() {\n let blockForms = document.querySelectorAll('#respond');\n\n if (document.querySelector('[class*=\"apbct_form_decoration\"]')) {\n let classHeaderWrapper = document.querySelector('[class*=\"apbct_form_decoration\"]').getAttribute('class');\n let endPosition = classHeaderWrapper.indexOf('_header__wrapper');\n let classTemplate = classHeaderWrapper.substring(0, endPosition);\n\n blockForms.forEach((blockForm) => {\n blockForm.className += ' ' + classTemplate;\n });\n }\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elements.forEach((element) => {\n if (!element) {\n return;\n }\n\n element.addEventListener('click', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n if (element.className.indexOf('header__wrapper') !== -1) {\n this.addClicks();\n return;\n }\n\n const clickX = event.offsetX;\n const clickY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (element.className.indexOf('christmas') !== -1) {\n if (\n clickY < flagLeftHeight / 3 && clickX < flagLeftWidth ||\n clickY < flagRightHeight / 3 && clickX > flagRightWidth\n ) {\n this.addClicks();\n return;\n }\n }\n\n if (\n (element.className.indexOf('new-year') !== -1) ||\n (element.className.indexOf('fourth-july') !== -1)\n ) {\n if (\n clickY > flagLeftHeight && clickX < flagLeftWidth ||\n clickY > flagRightHeight && clickX > flagRightWidth\n ) {\n this.addClicks();\n }\n }\n\n if (element.className.indexOf('signature')) {\n this.addClicks();\n }\n\n return;\n }\n\n this.addClicks();\n });\n\n element.addEventListener('mouseup', (event) => {\n setTimeout(() => {\n const selectedText = window.getSelection().toString();\n if (selectedText) {\n this.addSelected();\n }\n }, 100);\n });\n\n element.addEventListener('mousemove', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n const mouseX = event.offsetX;\n const mouseY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (mouseY > flagLeftHeight && mouseX < flagLeftWidth ||\n mouseY > flagRightHeight && mouseX > flagRightWidth\n ) {\n this.trackMouseMovement();\n }\n return;\n }\n\n this.trackMouseMovement();\n });\n });\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.clicks) {\n document.ctFormDecorationMouseData.clicks++;\n } else {\n document.ctFormDecorationMouseData.clicks = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.selected) {\n document.ctFormDecorationMouseData.selected++;\n } else {\n document.ctFormDecorationMouseData.selected = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctFormDecorationMouseData) {\n document.ctFormDecorationMouseData = {};\n }\n if (!document.ctFormDecorationMouseData.mouseMovements) {\n document.ctFormDecorationMouseData.mouseMovements = [];\n }\n\n document.ctFormDecorationMouseData.mouseMovements.push({timestamp: Date.now()});\n\n if (document.ctFormDecorationMouseData.mouseMovements.length > 1) {\n const index = document.ctFormDecorationMouseData.mouseMovements.length - 1;\n const lastMovement = document.ctFormDecorationMouseData.mouseMovements[index];\n const firstMovement = document.ctFormDecorationMouseData.mouseMovements[0];\n const timeDiff = lastMovement.timestamp - firstMovement.timestamp;\n document.ctFormDecorationMouseData.hovering = timeDiff;\n }\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_bot_detector_exist',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], item[1]);\n }\n });\n\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n let bloomPopup = document.querySelectorAll('div[class^=\"et_bloom_form_container\"]').length > 0;\n let pafeFormsFormElementor = document.querySelectorAll('div[class*=\"pafe-form\"]').length > 0;\n let otterForm = document.querySelectorAll('div [class*=\"otter-form\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp ||\n pafeFormsFormElementor ||\n bloomPopup ||\n otterForm;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n if (!cookies.apbct_site_referer) {\n cookies.apbct_site_referer = location.href;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n const nonce = selectActualNonce();\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i this.checkBotCallback(result),\n });\n } else if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n data.action = 'apbct_force_protection_check_bot';\n apbct_public_sendAJAX(data, {callback: (result) => this.checkBotCallback(result)});\n }\n }\n\n /**\n * Check bot callback\n * @param {Object} result\n * @return {void}\n */\n checkBotCallback(result) {\n // if error occurred\n if (result.data && result.data.status && result.data.status !== 200) {\n console.log('ApbctForceProtection connection error occurred');\n this.decodeForms();\n return;\n }\n\n if (typeof result === 'string') {\n try {\n result = JSON.parse(result);\n } catch (e) {\n console.log('ApbctForceProtection decodeForms error', e);\n this.decodeForms();\n return;\n }\n }\n\n if (typeof result === 'object' && result.allow && result.allow === 1) {\n this.decodeForms();\n } else {\n this.showMessageForBot(result.message);\n }\n }\n\n /**\n * Decode forms\n * @return {void}\n */\n decodeForms() {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n\n try {\n if (form && typeof(form) == 'string') {\n wrapper.outerHTML = atob(form);\n }\n } catch (error) {\n console.log(error);\n }\n });\n }\n\n /**\n * Show message for bot\n * @param {string} message\n * @return {void}\n */\n showMessageForBot(message) {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n if (form) {\n wrapper.outerHTML = '
' + message + '
';\n }\n });\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctCheckedEmailsExist = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\nlet tokenCheckerIntervalId;\nlet botDetectorLogLastUpdate = 0;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Run cron jobs\n */\n// forms handler cron\ncronFormsHandler(2000);\n\n// bot_detector frontend_data log alt session saving cron\nif (\n ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&\n ctPublicFunctions.data__bot_detector_enabled == 1\n) {\n sendBotDetectorLogToAltSessions(500);\n}\n/**\n * Cron jobs end.\n */\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Send BotDetector logs data to alternative sessions.\n * If log_last_update has changed, the log will be sent to the alternative sessions.\n * @param {int} cronStartTimeout delay before cron start\n * @param {int} interval check fires on interval\n */\nfunction sendBotDetectorLogToAltSessions(cronStartTimeout = 3000, interval = 1000) {\n setTimeout(function() {\n setInterval(function() {\n const currentLog = apbctLocalStorage.get('ct_bot_detector_frontend_data_log');\n if (currentLog && currentLog.hasOwnProperty('log_last_update')) {\n if (botDetectorLogLastUpdate !== currentLog.log_last_update) {\n botDetectorLogLastUpdate = currentLog.log_last_update;\n // the log will be taken from javascriptclientdata\n ctSetAlternativeCookie([], {forceAltCookies: true});\n }\n }\n }, interval);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0 ||\n document.getElementById('login-form-popup') !== null\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmailExist(e) {\n let currentEmail = e.target.value;\n let result;\n\n if (!currentEmail || !currentEmail.length) {\n let envelope = document.getElementById('apbct-check_email_exist-block');\n if (envelope) {\n envelope.remove();\n }\n let hint = document.getElementById('apbct-check_email_exist-popup_description');\n if (hint) {\n hint.remove();\n }\n return;\n }\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail in ctCheckedEmailsExist) {\n result = ctCheckedEmailsExist[currentEmail];\n getResultCheckEmailExist(e, result, currentEmail);\n\n return;\n }\n\n viewCheckEmailExist(e, 'load');\n\n // Using REST API handler\n ctPublicFunctions.data__ajax_type = 'rest';\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n apbct_public_sendREST(\n 'check_email_exist_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n\n return;\n }\n\n if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_exist_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} e\n * @param {mixed} result\n * @param {string} currentEmail\n */\nfunction getResultCheckEmailExist(e, result, currentEmail) {\n if (!result || !result.result) {\n return;\n }\n\n result = result.result;\n\n ctCheckedEmailsExist[currentEmail] = {\n 'result': result,\n 'timestamp': Date.now() / 1000 |0,\n };\n\n if (result.result == 'EXISTS') {\n viewCheckEmailExist(e, 'good_email', result.text_result);\n } else {\n viewCheckEmailExist(e, 'bad_email', result.text_result);\n }\n\n ctSetCookie('ct_checked_emails_exist', JSON.stringify(ctCheckedEmailsExist));\n}\n\n/**\n * @param {mixed} e\n * @param {string} state\n * @param {string} textResult\n */\nfunction viewCheckEmailExist(e, state, textResult) {\n let parentElement = e.target.parentElement;\n let inputEmail = parentElement.querySelector('[name*=\"email\"]');\n\n if (!inputEmail) {\n return;\n }\n\n const envelopeWidth = 35;\n let envelope;\n let hint;\n\n // envelope\n if (document.getElementById('apbct-check_email_exist-block')) {\n envelope = document.getElementById('apbct-check_email_exist-block');\n } else {\n envelope = document.createElement('div');\n envelope.setAttribute('class', 'apbct-check_email_exist-block');\n envelope.setAttribute('id', 'apbct-check_email_exist-block');\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n envelope.style.left = inputEmail.getBoundingClientRect().right - envelopeWidth - 10 + 'px';\n envelope.style.height = inputEmail.offsetHeight + 'px';\n envelope.style.width = envelopeWidth + 'px';\n\n window.addEventListener('scroll', function() {\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n });\n\n parentElement.after(envelope);\n }\n\n // hint\n if (document.getElementById('apbct-check_email_exist-popup_description')) {\n hint = document.getElementById('apbct-check_email_exist-popup_description');\n } else {\n hint = document.createElement('div');\n hint.setAttribute('class', 'apbct-check_email_exist-popup_description');\n hint.setAttribute('id', 'apbct-check_email_exist-popup_description');\n hint.style.width = inputEmail.offsetWidth + 'px';\n hint.style.left = inputEmail.getBoundingClientRect().left + 'px';\n\n window.addEventListener('scroll', function() {\n hint.style.top = envelope.getBoundingClientRect().top + 'px';\n });\n\n envelope.after(hint);\n }\n\n switch (state) {\n case 'load':\n envelope.classList.remove('apbct-check_email_exist-good_email', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-load');\n break;\n\n case 'good_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-good_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#1C7129';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n case 'bad_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-good_email');\n envelope.classList.add('apbct-check_email_exist-bad_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#E01111';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n default:\n break;\n }\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n } else {\n // if Jquery is not avaliable try to use xhr\n if (typeof XMLHttpRequest !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n document.addEventListener('readystatechange', function(event) {\n if (event.target.readyState === 4) {\n ctPrepareBlockMessage(event.target);\n }\n });\n }\n }\n}\n\n/**\n * For forced alt cookies.\n * If token is not added to the LS on apbc_ready, check every second if so and send token to the alt sessions.\n */\nfunction startForcedAltEventTokenChecker() {\n tokenCheckerIntervalId = setInterval( function() {\n if (apbctLocalStorage.get('event_token_forced_set') === '1') {\n clearInterval(tokenCheckerIntervalId);\n return;\n }\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if (eventToken) {\n ctSetAlternativeCookie([['ct_bot_detector_event_token', eventToken]], {forceAltCookies: true});\n apbctLocalStorage.set('event_token_forced_set', '1');\n clearInterval(tokenCheckerIntervalId);\n } else {\n }\n }, 1000);\n}\n\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n document.addEventListener('gform_page_loaded', function() {\n if (\n typeof ctPublic.force_alt_cookies === 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n if (typeof setEventTokenField === 'function' && typeof botDetectorLocalStorage === 'function') {\n setEventTokenField(botDetectorLocalStorage.get('bot_detector_event_token'));\n }\n }\n });\n if ( ! ctPublic.wc_ajax_add_to_cart ) {\n apbctCheckAddToCartByGet();\n }\n\n apbctPrepareBlockForAjaxForms();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n if (ctPublic.data__cookies_type !== 'alternative') {\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n }\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( ctIsDrawPixel() ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if ( +ctPublic.data__email_check_exist_post) {\n initCookies.push(['ct_checked_emails_exist', '0']);\n apbct('comment-form input[name = \\'email\\'], input#email').on('blur', checkEmailExist);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n let tokenForForceAlt = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n ctPublic.settings__data__bot_detector_enabled\n ) {\n apbctLocalStorage.set('event_token_forced_set', '0');\n if (tokenForForceAlt) {\n initCookies.push(['ct_bot_detector_event_token', tokenForForceAlt]);\n apbctLocalStorage.set('event_token_forced_set', '1');\n } else {\n startForcedAltEventTokenChecker();\n }\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n ctAddWCMiddlewares();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n + ctPublic.settings__forms__search_test === 1 &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n // fibosearch integration\n if (_form.querySelector('input.dgwt-wcas-search-input')) {\n continue;\n }\n\n // this handles search forms onsubmit process\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n\n // Check any XMLHttpRequest connections\n apbctCatchXmlHttpRequest();\n\n // Init form skin\n if (ctPublic.settings__comments__form_decoration) {\n new ApbctFormDecorator();\n }\n\n // Set important paramaters via ajax if problematic cache solutions found\n apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists || ctPublic.varnishCacheExists);\n\n // Checking that the bot detector has loaded and received the event token for Anti-Crawler\n if (ctPublic.settings__sfw__anti_crawler) {\n checkBotDetectorExist();\n }\n}\n\n/**\n * Checking that the bot detector has loaded and received the event token\n */\nfunction checkBotDetectorExist() {\n if (ctPublic.settings__data__bot_detector_enabled) {\n const botDetectorIntervalSearch = setInterval(() => {\n let botDetectorEventToken = localStorage.bot_detector_event_token ? true : false;\n\n if (botDetectorEventToken) {\n ctSetCookie('apbct_bot_detector_exist', '1', '3600');\n clearInterval(botDetectorIntervalSearch);\n }\n }, 500);\n }\n}\n\n/**\n * Insert no_cookies_data to rest request\n */\nfunction ctAddWCMiddlewares() {\n const ctPinDataToRequest = (options, next) => {\n if (typeof options !== 'object' || options === null ||\n !options.hasOwnProperty('data') || !options.hasOwnProperty('path')\n ) {\n return next(options);\n }\n\n // add to cart\n if (options.data.hasOwnProperty('requests') &&\n options.data.requests.length > 0 &&\n options.data.requests[0].hasOwnProperty('path') &&\n options.data.requests[0].path === '/wc/store/v1/cart/add-item'\n ) {\n options.data.requests[0].data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n // checkout\n if (options.path === '/wc/store/v1/checkout') {\n options.data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n return next(options);\n };\n\n if (window.hasOwnProperty('wp') &&\n window.wp.hasOwnProperty('apiFetch') &&\n typeof window.wp.apiFetch.use === 'function'\n ) {\n window.wp.apiFetch.use(ctPinDataToRequest);\n }\n}\n\n/**\n * Insert event_token and no_cookies_data to some ajax request\n */\nfunction apbctCatchXmlHttpRequest() {\n // 1) Check the page if it needed to catch XHR\n if ( document.querySelector('div.wfu_container') !== null ) {\n const originalSend = XMLHttpRequest.prototype.send;\n XMLHttpRequest.prototype.send = function(body) {\n // 2) Check the caught request fi it needed to modify\n if (\n body &&\n typeof body === 'string' &&\n (\n body.indexOf('action=wfu_ajax_action_ask_server') !== -1\n )\n ) {\n let addidionalCleantalkData = '';\n let eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (\n eventToken !== null &&\n eventToken !== false &&\n eventToken.hasOwnProperty('value') &&\n eventToken.value !== ''\n ) {\n eventToken = eventToken.value;\n addidionalCleantalkData += '&' + 'data%5Bct_bot_detector_event_token%5D=' + eventToken;\n }\n\n let noCookieData = getNoCookieData();\n addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData;\n\n body += addidionalCleantalkData;\n\n return originalSend.apply(this, [body]);\n }\n return originalSend.apply(this, [body]);\n };\n }\n}\n\n/**\n * Run AJAX to set important_parameters on the site backend if problematic cache solutions are defined.\n * @param {boolean} cacheExist\n */\nfunction apbctAjaxSetImportantParametersOnCacheExist(cacheExist) {\n // Set important parameters via ajax\n if ( cacheExist ) {\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST('apbct_set_important_parameters', {});\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX({action: 'apbct_set_important_parameters'}, {});\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n // this is the only place where we can found hard dependency on jQuery, if the form use it - the script\n // will work independing if jQuery is loaded by CleanTalk or not\n let eventToken = false;\n if ( typeof jQuery !== 'undefined' && typeof jQuery.ajaxSetup === 'function') {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n\n if (settings.data.indexOf('action=new_activity_comment') !== -1) {\n sourceSign = 'action=new_activity_comment';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n if (localStorage.getItem('bot_detector_event_token') !== null) {\n eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (eventToken !== false && eventToken.hasOwnProperty('value') && eventToken.value !== '') {\n eventToken = eventToken.value;\n }\n }\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n if (typeof eventToken === 'string') {\n eventToken = 'data%5Bct_bot_detector_event_token%5D=' + eventToken + '&';\n } else {\n eventToken = '';\n }\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n\n settings.data = noCookieData + eventToken + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {object} targetForm\n */\nfunction ctSearchFormOnSubmitHandler(e, targetForm) {\n try {\n // get honeypot field and it's value\n const honeyPotField = targetForm.querySelector('[id*=\"apbct__email_id__\"]');\n let hpValue = null;\n let hpEventId = null;\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n // get cookie data from storages\n let cleantalkStorageDataArray = getCleanTalkStorageDataArray();\n\n // get event token from storage\n let eventTokenLocalStorage = apbctLocalStorage.get('bot_detector_event_token');\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( cleantalkStorageDataArray !== null || honeyPotField !== null || eventTokenLocalStorage !== null ) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n if (typeof targetForm.apbctSearchPrevOnsubmit === 'function') {\n targetForm.apbctSearchPrevOnsubmit();\n } else {\n HTMLFormElement.prototype.submit.call(targetForm);\n }\n };\n\n let cookiesArray = cleantalkStorageDataArray;\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // set event token\n cookiesArray.ct_bot_detector_event_token = eventTokenLocalStorage;\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n // data to JSON\n const parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( typeof parsedCookies !== 'undefined' && parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctPublic.wl_brandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n let email = currentResultData.decoded_email.split(/[&?]/)[0];\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n if (firstNode) {\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNodes, result);\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNodes, decodingResult) {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML = baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n\n encodedEmailNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedEmailNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if ( typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n\n let noCookieData = getCleanTalkStorageDataArray();\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * Retrieves the clentalk \"cookie\" data from starages.\n * Contains {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration}.\n * @return {string}\n */\nfunction getCleanTalkStorageDataArray() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieDataFromDecoration = {form_decoration_mouse_data: []};\n if (document.ctFormDecorationMouseData) {\n let formDecorationMouseData = JSON.parse(JSON.stringify(document.ctFormDecorationMouseData));\n if (formDecorationMouseData.mouseMovements) {\n delete formDecorationMouseData.mouseMovements;\n }\n noCookieDataFromDecoration = {form_decoration_mouse_data: formDecorationMouseData};\n }\n return {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration};\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n const formAction = typeof(form.action) == 'string' ? form.action : '';\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n // Super WooCommerce Product Filter\n if (form.classList.contains('swpf-instant-filtering')) {\n return true;\n }\n // PayU 3-rd party service forms\n if (formAction.indexOf('secure.payu.com') !== -1 ) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n/**\n * WooCommerce add to cart by GET request params collecting\n */\nfunction apbctCheckAddToCartByGet() {\n // 1) Collect all links with add_to_cart_button class\n document.querySelectorAll('a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)').forEach((el) => {\n el.addEventListener('click', function(e) {\n let href = el.getAttribute('href');\n // 2) Add to href attribute additional parameter ct_bot_detector_event_token gathered from apbctLocalStorage\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if ( eventToken ) {\n if ( href.indexOf('?') === -1 ) {\n href += '?';\n } else {\n href += '&';\n }\n href += 'ct_bot_detector_event_token=' + eventToken;\n el.setAttribute('href', href);\n }\n });\n });\n}\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n\n/**\n * Check form as internal.\n * @param {int} currForm Current form.\n */\nfunction ctCheckInternal(currForm) {\n // Gathering data\n const ctData = {};\n const elems = currForm.elements;\n let key;\n\n for (key in elems) {\n if (elems[key].type !== 'submit' &&\n elems[key].value !== undefined &&\n elems[key].value !== '') {\n ctData[elems[key].name] = currForm.elements[key].value;\n }\n }\n ctData.action = 'ct_check_internal';\n\n // AJAX Request\n apbct_public_sendAJAX(\n ctData,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function(data) {\n if (data.success === true) {\n currForm.origSubmit();\n } else {\n alert(data.data);\n return false;\n }\n },\n },\n );\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctCurrAction = '';\n let ctCurrForm = '';\n\n if ( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n setTimeout(() => {\n for ( let i = 0; i < document.forms.length; i++ ) {\n if ( typeof(document.forms[i].action) == 'string' ) {\n ctCurrForm = document.forms[i];\n ctCurrAction = ctCurrForm.action;\n if (\n ctCurrAction.indexOf('https?://') !== null && // The protocol is obligatory\n ctCurrAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ctCheckInternalIsExcludedForm(ctCurrAction) // Exclude WordPress native scripts from processing\n ) {\n const formClone = ctCurrForm.cloneNode(true);\n ctCurrForm.parentNode.replaceChild(formClone, ctCurrForm);\n\n formClone.origSubmit = ctCurrForm.submit;\n formClone.submit = null;\n\n formClone.addEventListener('submit', function(event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n ctCheckInternal(event.target);\n return false;\n });\n }\n }\n }\n }, 500);\n});\n\n/**\n * Check by action to exclude the form checking\n * @param {string} action\n * @return {boolean}\n */\nfunction ctCheckInternalIsExcludedForm(action) {\n // An array contains forms action need to be excluded.\n const ctInternalScriptExclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ctInternalScriptExclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","getAttribute","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","ctJsErrors","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","selectActualNonce","defaultNonce","ctPublicFunctions","hasOwnProperty","_fresh_nonce","data__ajax_type","_ajax_nonce","_rest_nonce","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","prepare","keys","deleteDoubleJSONEncoding","convertData","console","open","setHeaders","onreadystatechange","isWpNonceError","getFreshNonceAndRerunXHR","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","restErrror","ajaxErrror","readyState","initialRequestParams","noncePrev","spbc_remote_call_action","plugin_name","nonce_prev","initial_request_params","notJson","host_url","freshNonceResult","newRequestParams","undefined","wpnonce","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","_rest_url","route","nonce","X-WP-Nonce","defineProperty","property","enumerable","configurable","writable","ApbctFormDecorator","getElements","setListeners","regexId","regexClass","matchingElements","setDecorationBackground","from","test","element","id","forEach","flagLeft","flagRight","flagWrap","blockForms","classHeaderWrapper","endPosition","classTemplate","substring","blockForm","clickX","flagLeftWidth","flagLeftHeight","flagRightWidth","flagRightHeight","offsetX","clickY","offsetY","parseFloat","width","height","addClicks","getSelection","addSelected","mouseX","mouseY","trackMouseMovement","ctFormDecorationMouseData","clicks","selected","firstMovement","timeDiff","mouseMovements","timestamp","now","index","lastMovement","hovering","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","item","apbctLocalStorage","set","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","encodeURIComponent","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bloomPopup","pafeFormsFormElementor","otterForm","bookingPress","isArray","getJavascriptClientData","e","apbct_site_referer","apbct_force_alt_cookies","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","beforeSend","ctGetCookie","matches","RegExp","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","no_cache","apbctGenerateUniqueID","substr","get","storageValue","json","isJson","objToSave","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","apbctForceProtect","ApbctForceProtection","data__key_is_ok","apbct_attach_event_handler","wrappers","findWrappers","checkBot","event_javascript_data","post_url","referrer","checkBotCallback","result","decodeForms","allow","showMessageForBot","form","wrapper","dataset","encodedForm","outerHTML","atob","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctCheckedEmailsExist","ctMouseReadInterval","ctMouseWriteDataInterval","tokenCheckerIntervalId","botDetectorLogLastUpdate","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__bot_detector_enabled","sendBotDetectorLogToAltSessions","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","interval","currentLog","log_last_update","token","doAttach","getElementsByClassName","getElementById","setEventTokenField","clearInterval","checkEmail","currentEmail","email","checkEmailExist","hint","getResultCheckEmailExist","viewCheckEmailExist","envelope","text_result","state","textResult","inputEmail","top","getBoundingClientRect","left","right","offsetHeight","envelopeWidth","offsetWidth","onmouseover","textContent","color","onmouseout","ctIsDrawPixel","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","startForcedAltEventTokenChecker","eventToken","apbct_ready","botDetectorLocalStorage","wc_ajax_add_to_cart","apbctCheckAddToCartByGet","sessionID","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","data__email_check_exist_post","tokenForForceAlt","encodedEmailNodes","settings__data__bot_detector_enabled","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","ctAddWCMiddlewares","hiddenInput","visibleFieldsToInput","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","ctFillDecodedEmailHandler","_form","settings__forms__search_test","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","apbctCatchXmlHttpRequest","settings__comments__form_decoration","apbctAjaxSetImportantParametersOnCacheExist","advancedCacheExists","varnishCacheExists","settings__sfw__anti_crawler","checkBotDetectorExist","botDetectorIntervalSearch","bot_detector_event_token","wp","apiFetch","use","options","next","requests","path","ct_no_cookie_hidden_field","originalSend","addidionalCleantalkData","apply","cacheExist","ajaxSetup","sourceSign","contains","targetForm","honeyPotField","hpValue","hpEventId","callBack","parsedCookies","cleantalkStorageDataArray","getCleanTalkStorageDataArray","eventTokenLocalStorage","preventDefault","parentNode","HTMLFormElement","submit","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","ct_bot_detector_event_token","warn","encodedEmailNodesIsMixed","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","innerHTML","wl_brandname","waitingPopup","popupHeader","innerText","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","animationElements","animationWrapper","apbctEEAnimationDogOne","clickSource","encodedEmails","encodedEmailsCollection","apbctTooltip","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","popup","currentResultData","row","encoded_email","decoded_email","firstNode","selectableEmail","title","secondNode","buttonWrapper","fillDecodedEmails","click","comment","decodingResult","encodedEmail","baseElementContent","encodedEmailTextInsideMailto","el","ctProcessDecodedDataResult","commonCookies","resultDataJson","ct_checked_emails","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_headless","ct_bot_detector_frontend_data_log","apbct_page_hits","apbct_prev_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","popupText","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","formDecorationMouseData","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","noCookieDataFromDecoration","form_decoration_mouse_data","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","hiddenFieldType","formAction","j","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","ignoreURLConvert","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","ctCheckInternal","currForm","ctData","elems","alert","origSubmit","ctCheckInternalIsExcludedForm","some","blog_home","ctTrpLocalize","ctTrpIsAdminCommentsList","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","trpComments","learnMoreLink","trpLayout","trpImage","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","nextElementSibling","clearTimeout","selection","onSelectionChange","ctCurrAction","ctCurrForm","settings__forms__check_internal","formClone","cloneNode","replaceChild","stopImmediatePropagation"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACvB,UAApB,OAAOA,GACfM,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAS,GAAKD,GACS,UAApB,OAAOA,GACfM,KAAKN,SAAWA,EAChBM,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBd,CAAQ,CAAC,GAG9EM,KAAKS,SAAS,EAGXT,IACX,CAKAU,WAAWC,GACmB,UAArB,OAAOA,EACRX,KAAKL,SAASiB,KAAKD,CAAS,EACC,UAArB,OAAOA,GACfX,KAAKN,SAAWiB,EAChBX,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBG,CAAS,CAAC,GAE/EX,KAAKS,SAAS,CAEtB,CAKAG,KAAKC,GACDb,KAAKL,SAASiB,KAAKC,CAAI,CAC3B,CAKAC,SACId,KAAKL,SAAWK,KAAKL,SAASU,MAAM,EAAG,CAAC,CAAC,CAC7C,CAKAI,WACIT,KAAKL,SAAW,EACpB,CAUAoB,IAAIC,EAAOC,GAIP,GAHAA,EAASA,GAAU,CAAA,EAGE,UAAjB,OAAOD,EAAoB,CAU3B,IAAK,IAAME,KAAaF,EACpB,GAA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Aa,EAClCmhB,GAA6C,IAAhCA,EAAUtkB,SAAS,EAAEtM,SAElCwwB,EAAc9rB,WAAW,KACrB,IAAM6gB,EAAQkL,EAAMC,mBAChBnL,GAASA,EAAM9kB,UAAUgiB,SAAS,uBAAuB,GACzD8C,EAAM9kB,UAAUI,OAAO,SAAS,CAExC,EAAG,GAAI,EACPjC,SAASoa,oBAAoB,kBAAmB6X,CAAiB,EAEzE,CAAC,EAET,EAAG,GAAI,CACX,CAAC,CACL,CAAC,EA/HD,CAgIJ,CAAC,EAsCDjyB,SAAS2C,iBAAiB,mBAAoB,WAC1CzB,IAAIgxB,EAAe,GACfC,EAAa,GAEV,CAAC3f,SAAS4f,iCAIjBtsB,WAAW,KACP,IAAM5E,IAAIC,EAAI,EAAGA,EAAInB,SAASge,MAAM5c,OAAQD,CAAC,GAAK,CAC9C,IAQckxB,EAR2B,UAApC,OAAOryB,SAASge,MAAM7c,GAAS,SAChCgxB,EAAanyB,SAASge,MAAM7c,GAGc,QAF1C+wB,EAAeC,EAAW3d,QAEThQ,QAAQ,WAAW,GACwB,OAAxD0tB,EAAahuB,MAAMsO,SAAS8d,UAAY,SAAU,GAChDF,8BAA8B8B,CAAY,IAEtCG,EAAYF,EAAWG,UAAU,CAAA,CAAI,EAC3CH,EAAW3N,WAAW+N,aAAaF,EAAWF,CAAU,EAExDE,EAAUlC,WAAagC,EAAWzN,OAClC2N,EAAU3N,OAAS,KAEnB2N,EAAU1vB,iBAAiB,SAAU,SAASpD,GAK1C,OAJAA,EAAMglB,eAAe,EACrBhlB,EAAMyD,gBAAgB,EACtBzD,EAAMizB,yBAAyB,EAC/B1C,gBAAgBvwB,EAAMuD,MAAM,EACrB,CAAA,CACX,CAAC,GAGb,CACJ,EAAG,GAAG,CACV,CAAC"} \ No newline at end of file +{"version":3,"file":"apbct-public-bundle_int-protection.min.js","sources":["apbct-public-bundle_int-protection.js"],"sourcesContent":["/**\n * Base class\n */\nclass ApbctCore {\n ajax_parameters = {};\n restParameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n * @param {string} selector\n */\n constructor(selector) {\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param {string} selector\n * @return {*}\n */\n select(selector) {\n if (selector instanceof HTMLCollection) {\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n } else if ( typeof selector === 'object' ) {\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n } else if ( typeof selector === 'string' ) {\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n } else {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {object|string} elemToAdd\n */\n addElement(elemToAdd) {\n if ( typeof elemToAdd === 'object' ) {\n this.elements.push(elemToAdd);\n } else if ( typeof elemToAdd === 'string' ) {\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n } else {\n this.deselect();\n }\n }\n\n /**\n * @param {object} elem\n */\n push(elem) {\n this.elements.push(elem);\n }\n\n /**\n * reduce\n */\n reduce() {\n this.elements = this.elements.slice(0, -1);\n }\n\n /**\n * deselect\n */\n deselect() {\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param {object|string} style\n * @param {boolean} getRaw\n *\n * @return {boolean|*}\n */\n css(style, getRaw) {\n getRaw = getRaw || false;\n\n // Set style\n if (typeof style === 'object') {\n const stringToCamelCase = (str) =>\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ctJsErrors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Select actual WP nonce depending on the ajax type and the fresh nonce provided.\n * @return {string} url\n */\nfunction selectActualNonce() {\n let defaultNonce = '';\n // return fresh nonce immediately if persists\n if (\n ctPublicFunctions.hasOwnProperty('_fresh_nonce') &&\n typeof ctPublicFunctions._fresh_nonce === 'string' &&\n ctPublicFunctions._fresh_nonce.length > 0\n ) {\n return ctPublicFunctions._fresh_nonce;\n }\n // select from default rest/ajax nonces\n if (\n ctPublicFunctions.data__ajax_type === 'admin_ajax' &&\n ctPublicFunctions.hasOwnProperty('_ajax_nonce') &&\n typeof ctPublicFunctions._ajax_nonce === 'string' &&\n ctPublicFunctions._ajax_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._ajax_nonce;\n }\n if (\n ctPublicFunctions.data__ajax_type === 'rest' &&\n ctPublicFunctions.hasOwnProperty('_rest_nonce') &&\n typeof ctPublicFunctions._rest_nonce === 'string' &&\n ctPublicFunctions._rest_nonce.length > 0\n ) {\n defaultNonce = ctPublicFunctions._rest_nonce;\n }\n\n return defaultNonce;\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n if (this.isWpNonceError()) {\n this.getFreshNonceAndRerunXHR(parameters);\n return;\n }\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * Check if 403 code of WP nonce error\n * @return {bool}\n */\n isWpNonceError() {\n let restErrror = false;\n let ajaxErrror = false;\n // check rest error\n if (this.xhr.readyState == 4) {\n restErrror = (\n typeof this.xhr.response === 'object' && this.xhr.response !== null &&\n this.xhr.response.hasOwnProperty('data') &&\n this.xhr.response.data.hasOwnProperty('status') &&\n this.xhr.response.data.status === 403\n );\n ajaxErrror = this.xhr.response === '-1' && this.xhr.status === 403;\n }\n // todo check AJAX error\n return restErrror || ajaxErrror;\n }\n\n /**\n * Get the fresh nonce and rerun the initial XHR with params\n * @param {[]} initialRequestParams\n */\n getFreshNonceAndRerunXHR(initialRequestParams) {\n let noncePrev = '';\n\n // Check if initialRequestParams['headers']['X-WP-Nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('headers') &&\n initialRequestParams.headers.hasOwnProperty('X-WP-Nonce')\n ) {\n noncePrev = initialRequestParams['headers']['X-WP-Nonce'];\n }\n\n // Check if initialRequestParams['data']['_ajax_nonce'] exists.\n if (\n initialRequestParams.hasOwnProperty('data') &&\n initialRequestParams.data.hasOwnProperty('_ajax_nonce')\n ) {\n noncePrev = initialRequestParams['data']['_ajax_nonce'];\n }\n\n // Nonce is not provided. Exit.\n if ( noncePrev === '' ) {\n return;\n }\n\n // prepare params for refreshing nonce\n let params = {};\n params.method = 'POST';\n params.data = {\n 'spbc_remote_call_action': 'get_fresh_wpnonce',\n 'plugin_name': 'antispam',\n 'nonce_prev': noncePrev,\n 'initial_request_params': initialRequestParams,\n };\n params.notJson = true;\n params.url = ctPublicFunctions.host_url;\n // this callback will rerun the XHR with initial params\n params.callback = function(...args) {\n // the refresh result itself\n let freshNonceResult = args[0];\n let newRequestParams = false;\n // provided initial params\n if (args[1] !== undefined && args[1].hasOwnProperty('initial_request_params')) {\n newRequestParams = args[1].initial_request_params;\n }\n if (newRequestParams && freshNonceResult.hasOwnProperty('wpnonce')) {\n ctPublicFunctions._fresh_nonce = freshNonceResult.wpnonce;\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n new ApbctCore().rest(newRequestParams);\n } else {\n new ApbctCore().ajax(newRequestParams);\n }\n }\n };\n // run the nonce refreshing call\n new ApbctXhr(params);\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.data._ajax_nonce = selectActualNonce();\n super(args);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n const nonce = selectActualNonce();\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': nonce,\n };\n super(args);\n }\n}\n\n// add hasOwn\nif (!Object.prototype.hasOwn) {\n Object.defineProperty(Object.prototype, 'hasOwn', { // eslint-disable-line\n value: function(property) {\n return Object.prototype.hasOwnProperty.call(this, property);\n },\n enumerable: false,\n configurable: true,\n writable: true,\n });\n}\n\n/**\n * Form skin class\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctFormDecorator {\n elements = [];\n\n /**\n * Constructor\n */\n constructor() {\n this.getElements();\n this.setListeners();\n }\n\n /**\n * Get elements\n */\n getElements() {\n const elements = document.querySelectorAll('*');\n const regexId = /^apbct-trusted-text--label/;\n const regexClass = /apbct_form_decoration--/;\n\n this.setDecorationBackground();\n\n // Collect elements with id or class that contains apbct-trusted-text--label or apbct_form_decoration--\n // id\n let matchingElements = Array.from(elements).filter((element) => {\n return regexId.test(element.id);\n });\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n // class\n matchingElements = Array.from(elements).filter((element) => {\n return regexClass.test(element.className);\n });\n\n matchingElements.forEach((element) => {\n this.elements.push(element);\n });\n\n const flagWrap = document.querySelector('.apbct_form_decoration');\n if (flagWrap) {\n const flagLeft = window.getComputedStyle(flagWrap, '::before');\n const flagRight = window.getComputedStyle(flagWrap, '::after');\n if (flagLeft && flagRight) {\n this.elements.push(flagWrap);\n }\n }\n }\n\n /**\n * Set decoration background\n */\n setDecorationBackground() {\n let blockForms = document.querySelectorAll('#respond');\n\n if (document.querySelector('[class*=\"apbct_form_decoration\"]')) {\n let classHeaderWrapper = document.querySelector('[class*=\"apbct_form_decoration\"]').getAttribute('class');\n let endPosition = classHeaderWrapper.indexOf('_header__wrapper');\n let classTemplate = classHeaderWrapper.substring(0, endPosition);\n\n blockForms.forEach((blockForm) => {\n blockForm.className += ' ' + classTemplate;\n });\n }\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elements.forEach((element) => {\n if (!element) {\n return;\n }\n\n element.addEventListener('click', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n if (element.className.indexOf('header__wrapper') !== -1) {\n this.addClicks();\n return;\n }\n\n const clickX = event.offsetX;\n const clickY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (element.className.indexOf('christmas') !== -1) {\n if (\n clickY < flagLeftHeight / 3 && clickX < flagLeftWidth ||\n clickY < flagRightHeight / 3 && clickX > flagRightWidth\n ) {\n this.addClicks();\n return;\n }\n }\n\n if (\n (element.className.indexOf('new-year') !== -1) ||\n (element.className.indexOf('fourth-july') !== -1)\n ) {\n if (\n clickY > flagLeftHeight && clickX < flagLeftWidth ||\n clickY > flagRightHeight && clickX > flagRightWidth\n ) {\n this.addClicks();\n }\n }\n\n if (element.className.indexOf('signature')) {\n this.addClicks();\n }\n\n return;\n }\n\n this.addClicks();\n });\n\n element.addEventListener('mouseup', (event) => {\n setTimeout(() => {\n const selectedText = window.getSelection().toString();\n if (selectedText) {\n this.addSelected();\n }\n }, 100);\n });\n\n element.addEventListener('mousemove', (event) => {\n if (element.className.indexOf('apbct_form_decoration') !== -1) {\n const mouseX = event.offsetX;\n const mouseY = event.offsetY;\n const flagLeftWidth = parseFloat(window.getComputedStyle(element, '::before').width) / 2;\n const flagLeftHeight = parseFloat(window.getComputedStyle(element, '::before').height) / 2;\n const flagRightWidth = parseFloat(window.getComputedStyle(element, '::after').width) / 2;\n const flagRightHeight = parseFloat(window.getComputedStyle(element, '::after').height) / 2;\n\n if (mouseY > flagLeftHeight && mouseX < flagLeftWidth ||\n mouseY > flagRightHeight && mouseX > flagRightWidth\n ) {\n this.trackMouseMovement();\n }\n return;\n }\n\n this.trackMouseMovement();\n });\n });\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.clicks) {\n document.ctFormDecorationMouseData.clicks++;\n } else {\n document.ctFormDecorationMouseData.clicks = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctFormDecorationMouseData) {\n if (document.ctFormDecorationMouseData.selected) {\n document.ctFormDecorationMouseData.selected++;\n } else {\n document.ctFormDecorationMouseData.selected = 1;\n }\n return;\n }\n\n document.ctFormDecorationMouseData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctFormDecorationMouseData) {\n document.ctFormDecorationMouseData = {};\n }\n if (!document.ctFormDecorationMouseData.mouseMovements) {\n document.ctFormDecorationMouseData.mouseMovements = [];\n }\n\n document.ctFormDecorationMouseData.mouseMovements.push({timestamp: Date.now()});\n\n if (document.ctFormDecorationMouseData.mouseMovements.length > 1) {\n const index = document.ctFormDecorationMouseData.mouseMovements.length - 1;\n const lastMovement = document.ctFormDecorationMouseData.mouseMovements[index];\n const firstMovement = document.ctFormDecorationMouseData.mouseMovements[0];\n const timeDiff = lastMovement.timestamp - firstMovement.timestamp;\n document.ctFormDecorationMouseData.hovering = timeDiff;\n }\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_bot_detector_exist',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], item[1]);\n }\n });\n\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n let bloomPopup = document.querySelectorAll('div[class^=\"et_bloom_form_container\"]').length > 0;\n let pafeFormsFormElementor = document.querySelectorAll('div[class*=\"pafe-form\"]').length > 0;\n let otterForm = document.querySelectorAll('div [class*=\"otter-form\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp ||\n pafeFormsFormElementor ||\n bloomPopup ||\n otterForm;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n if (!cookies.apbct_site_referer) {\n cookies.apbct_site_referer = location.href;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n const nonce = selectActualNonce();\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i this.checkBotCallback(result),\n });\n } else if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n data.action = 'apbct_force_protection_check_bot';\n apbct_public_sendAJAX(data, {callback: (result) => this.checkBotCallback(result)});\n }\n }\n\n /**\n * Check bot callback\n * @param {Object} result\n * @return {void}\n */\n checkBotCallback(result) {\n // if error occurred\n if (result.data && result.data.status && result.data.status !== 200) {\n console.log('ApbctForceProtection connection error occurred');\n this.decodeForms();\n return;\n }\n\n if (typeof result === 'string') {\n try {\n result = JSON.parse(result);\n } catch (e) {\n console.log('ApbctForceProtection decodeForms error', e);\n this.decodeForms();\n return;\n }\n }\n\n if (typeof result === 'object' && result.allow && result.allow === 1) {\n this.decodeForms();\n } else {\n this.showMessageForBot(result.message);\n }\n }\n\n /**\n * Decode forms\n * @return {void}\n */\n decodeForms() {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n\n try {\n if (form && typeof(form) == 'string') {\n wrapper.outerHTML = atob(form);\n }\n } catch (error) {\n console.log(error);\n }\n });\n }\n\n /**\n * Show message for bot\n * @param {string} message\n * @return {void}\n */\n showMessageForBot(message) {\n let form;\n\n this.wrappers.forEach((wrapper) => {\n form = wrapper.querySelector('div.ct-encoded-form').dataset.encodedForm;\n if (form) {\n wrapper.outerHTML = '
' + message + '
';\n }\n });\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctCheckedEmailsExist = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\nlet tokenCheckerIntervalId;\nlet botDetectorLogLastUpdate = 0;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Run cron jobs\n */\n// forms handler cron\ncronFormsHandler(2000);\n\n// bot_detector frontend_data log alt session saving cron\nif (\n ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&\n ctPublicFunctions.data__bot_detector_enabled == 1\n) {\n sendBotDetectorLogToAltSessions(500);\n}\n/**\n * Cron jobs end.\n */\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Send BotDetector logs data to alternative sessions.\n * If log_last_update has changed, the log will be sent to the alternative sessions.\n * @param {int} cronStartTimeout delay before cron start\n * @param {int} interval check fires on interval\n */\nfunction sendBotDetectorLogToAltSessions(cronStartTimeout = 3000, interval = 1000) {\n setTimeout(function() {\n setInterval(function() {\n const currentLog = apbctLocalStorage.get('ct_bot_detector_frontend_data_log');\n if (currentLog && currentLog.hasOwnProperty('log_last_update')) {\n if (botDetectorLogLastUpdate !== currentLog.log_last_update) {\n botDetectorLogLastUpdate = currentLog.log_last_update;\n // the log will be taken from javascriptclientdata\n ctSetAlternativeCookie([], {forceAltCookies: true});\n }\n }\n }, interval);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0 ||\n document.getElementById('login-form-popup') !== null\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmailExist(e) {\n let currentEmail = e.target.value;\n let result;\n\n if (!currentEmail || !currentEmail.length) {\n let envelope = document.getElementById('apbct-check_email_exist-block');\n if (envelope) {\n envelope.remove();\n }\n let hint = document.getElementById('apbct-check_email_exist-popup_description');\n if (hint) {\n hint.remove();\n }\n return;\n }\n\n if (! /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentEmail)) {\n return;\n }\n\n if (currentEmail in ctCheckedEmailsExist) {\n result = ctCheckedEmailsExist[currentEmail];\n getResultCheckEmailExist(e, result, currentEmail);\n\n return;\n }\n\n viewCheckEmailExist(e, 'load');\n\n // Using REST API handler\n ctPublicFunctions.data__ajax_type = 'rest';\n if (ctPublicFunctions.data__ajax_type === 'rest') {\n apbct_public_sendREST(\n 'check_email_exist_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n\n return;\n }\n\n if (ctPublicFunctions.data__ajax_type === 'admin_ajax') {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_exist_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n getResultCheckEmailExist(e, result, currentEmail);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} e\n * @param {mixed} result\n * @param {string} currentEmail\n */\nfunction getResultCheckEmailExist(e, result, currentEmail) {\n if (!result || !result.result) {\n return;\n }\n\n result = result.result;\n\n ctCheckedEmailsExist[currentEmail] = {\n 'result': result,\n 'timestamp': Date.now() / 1000 |0,\n };\n\n if (result.result == 'EXISTS') {\n viewCheckEmailExist(e, 'good_email', result.text_result);\n } else {\n viewCheckEmailExist(e, 'bad_email', result.text_result);\n }\n\n ctSetCookie('ct_checked_emails_exist', JSON.stringify(ctCheckedEmailsExist));\n}\n\n/**\n * @param {mixed} e\n * @param {string} state\n * @param {string} textResult\n */\nfunction viewCheckEmailExist(e, state, textResult) {\n let parentElement = e.target.parentElement;\n let inputEmail = parentElement.querySelector('[name*=\"email\"]');\n\n if (!inputEmail) {\n return;\n }\n\n const envelopeWidth = 35;\n let envelope;\n let hint;\n\n // envelope\n if (document.getElementById('apbct-check_email_exist-block')) {\n envelope = document.getElementById('apbct-check_email_exist-block');\n } else {\n envelope = document.createElement('div');\n envelope.setAttribute('class', 'apbct-check_email_exist-block');\n envelope.setAttribute('id', 'apbct-check_email_exist-block');\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n envelope.style.left = inputEmail.getBoundingClientRect().right - envelopeWidth - 10 + 'px';\n envelope.style.height = inputEmail.offsetHeight + 'px';\n envelope.style.width = envelopeWidth + 'px';\n\n window.addEventListener('scroll', function() {\n envelope.style.top = inputEmail.getBoundingClientRect().top + 'px';\n });\n\n parentElement.after(envelope);\n }\n\n // hint\n if (document.getElementById('apbct-check_email_exist-popup_description')) {\n hint = document.getElementById('apbct-check_email_exist-popup_description');\n } else {\n hint = document.createElement('div');\n hint.setAttribute('class', 'apbct-check_email_exist-popup_description');\n hint.setAttribute('id', 'apbct-check_email_exist-popup_description');\n hint.style.width = inputEmail.offsetWidth + 'px';\n hint.style.left = inputEmail.getBoundingClientRect().left + 'px';\n\n window.addEventListener('scroll', function() {\n hint.style.top = envelope.getBoundingClientRect().top + 'px';\n });\n\n envelope.after(hint);\n }\n\n switch (state) {\n case 'load':\n envelope.classList.remove('apbct-check_email_exist-good_email', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-load');\n break;\n\n case 'good_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-bad_email');\n envelope.classList.add('apbct-check_email_exist-good_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#1C7129';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n case 'bad_email':\n envelope.classList.remove('apbct-check_email_exist-load', 'apbct-check_email_exist-good_email');\n envelope.classList.add('apbct-check_email_exist-bad_email');\n\n envelope.onmouseover = function() {\n hint.textContent = textResult;\n hint.style.display = 'block';\n hint.style.top = inputEmail.getBoundingClientRect().top - hint.getBoundingClientRect().height + 'px';\n hint.style.color = '#E01111';\n };\n\n envelope.onmouseout = function() {\n hint.style.display = 'none';\n };\n\n break;\n\n default:\n break;\n }\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n } else {\n // if Jquery is not avaliable try to use xhr\n if (typeof XMLHttpRequest !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n document.addEventListener('readystatechange', function(event) {\n if (event.target.readyState === 4) {\n ctPrepareBlockMessage(event.target);\n }\n });\n }\n }\n}\n\n/**\n * For forced alt cookies.\n * If token is not added to the LS on apbc_ready, check every second if so and send token to the alt sessions.\n */\nfunction startForcedAltEventTokenChecker() {\n tokenCheckerIntervalId = setInterval( function() {\n if (apbctLocalStorage.get('event_token_forced_set') === '1') {\n clearInterval(tokenCheckerIntervalId);\n return;\n }\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if (eventToken) {\n ctSetAlternativeCookie([['ct_bot_detector_event_token', eventToken]], {forceAltCookies: true});\n apbctLocalStorage.set('event_token_forced_set', '1');\n clearInterval(tokenCheckerIntervalId);\n } else {\n }\n }, 1000);\n}\n\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n document.addEventListener('gform_page_loaded', function() {\n if (\n typeof ctPublic.force_alt_cookies === 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n if (typeof setEventTokenField === 'function' && typeof botDetectorLocalStorage === 'function') {\n setEventTokenField(botDetectorLocalStorage.get('bot_detector_event_token'));\n }\n }\n });\n if ( ! ctPublic.wc_ajax_add_to_cart ) {\n apbctCheckAddToCartByGet();\n }\n\n apbctPrepareBlockForAjaxForms();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n if (ctPublic.data__cookies_type !== 'alternative') {\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n }\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( ctIsDrawPixel() ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if ( +ctPublic.data__email_check_exist_post) {\n initCookies.push(['ct_checked_emails_exist', '0']);\n apbct('comment-form input[name = \\'email\\'], input#email').on('blur', checkEmailExist);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n let tokenForForceAlt = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n ctPublic.settings__data__bot_detector_enabled\n ) {\n apbctLocalStorage.set('event_token_forced_set', '0');\n if (tokenForForceAlt) {\n initCookies.push(['ct_bot_detector_event_token', tokenForForceAlt]);\n apbctLocalStorage.set('event_token_forced_set', '1');\n } else {\n startForcedAltEventTokenChecker();\n }\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n ctAddWCMiddlewares();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n + ctPublic.settings__forms__search_test === 1 &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n // fibosearch integration\n if (_form.querySelector('input.dgwt-wcas-search-input')) {\n continue;\n }\n\n // this handles search forms onsubmit process\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n\n // Check any XMLHttpRequest connections\n apbctCatchXmlHttpRequest();\n\n // Init form skin\n if (ctPublic.settings__comments__form_decoration) {\n new ApbctFormDecorator();\n }\n\n // Set important paramaters via ajax if problematic cache solutions found\n apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists || ctPublic.varnishCacheExists);\n\n // Checking that the bot detector has loaded and received the event token for Anti-Crawler\n if (ctPublic.settings__sfw__anti_crawler) {\n checkBotDetectorExist();\n }\n}\n\n/**\n * Checking that the bot detector has loaded and received the event token\n */\nfunction checkBotDetectorExist() {\n if (ctPublic.settings__data__bot_detector_enabled) {\n const botDetectorIntervalSearch = setInterval(() => {\n let botDetectorEventToken = localStorage.bot_detector_event_token ? true : false;\n\n if (botDetectorEventToken) {\n ctSetCookie('apbct_bot_detector_exist', '1', '3600');\n clearInterval(botDetectorIntervalSearch);\n }\n }, 500);\n }\n}\n\n/**\n * Insert no_cookies_data to rest request\n */\nfunction ctAddWCMiddlewares() {\n const ctPinDataToRequest = (options, next) => {\n if (typeof options !== 'object' || options === null ||\n !options.hasOwnProperty('data') || !options.hasOwnProperty('path')\n ) {\n return next(options);\n }\n\n // add to cart\n if (options.data.hasOwnProperty('requests') &&\n options.data.requests.length > 0 &&\n options.data.requests[0].hasOwnProperty('path') &&\n options.data.requests[0].path === '/wc/store/v1/cart/add-item'\n ) {\n options.data.requests[0].data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n // checkout\n if (options.path === '/wc/store/v1/checkout') {\n options.data.ct_no_cookie_hidden_field = getNoCookieData();\n }\n\n return next(options);\n };\n\n if (window.hasOwnProperty('wp') &&\n window.wp.hasOwnProperty('apiFetch') &&\n typeof window.wp.apiFetch.use === 'function'\n ) {\n window.wp.apiFetch.use(ctPinDataToRequest);\n }\n}\n\n/**\n * Insert event_token and no_cookies_data to some ajax request\n */\nfunction apbctCatchXmlHttpRequest() {\n // 1) Check the page if it needed to catch XHR\n if ( document.querySelector('div.wfu_container') !== null ) {\n const originalSend = XMLHttpRequest.prototype.send;\n XMLHttpRequest.prototype.send = function(body) {\n // 2) Check the caught request fi it needed to modify\n if (\n body &&\n typeof body === 'string' &&\n (\n body.indexOf('action=wfu_ajax_action_ask_server') !== -1\n )\n ) {\n let addidionalCleantalkData = '';\n let eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (\n eventToken !== null &&\n eventToken !== false &&\n eventToken.hasOwnProperty('value') &&\n eventToken.value !== ''\n ) {\n eventToken = eventToken.value;\n addidionalCleantalkData += '&' + 'data%5Bct_bot_detector_event_token%5D=' + eventToken;\n }\n\n let noCookieData = getNoCookieData();\n addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData;\n\n body += addidionalCleantalkData;\n\n return originalSend.apply(this, [body]);\n }\n return originalSend.apply(this, [body]);\n };\n }\n}\n\n/**\n * Run AJAX to set important_parameters on the site backend if problematic cache solutions are defined.\n * @param {boolean} cacheExist\n */\nfunction apbctAjaxSetImportantParametersOnCacheExist(cacheExist) {\n // Set important parameters via ajax\n if ( cacheExist ) {\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST('apbct_set_important_parameters', {});\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX({action: 'apbct_set_important_parameters'}, {});\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n // this is the only place where we can found hard dependency on jQuery, if the form use it - the script\n // will work independing if jQuery is loaded by CleanTalk or not\n let eventToken = false;\n if ( typeof jQuery !== 'undefined' && typeof jQuery.ajaxSetup === 'function') {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n\n if (settings.data.indexOf('action=new_activity_comment') !== -1) {\n sourceSign = 'action=new_activity_comment';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n if (localStorage.getItem('bot_detector_event_token') !== null) {\n eventToken = localStorage.getItem('bot_detector_event_token');\n try {\n eventToken = JSON.parse(eventToken);\n } catch {\n eventToken = false;\n }\n if (eventToken !== false && eventToken.hasOwnProperty('value') && eventToken.value !== '') {\n eventToken = eventToken.value;\n }\n }\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n if (typeof eventToken === 'string') {\n eventToken = 'data%5Bct_bot_detector_event_token%5D=' + eventToken + '&';\n } else {\n eventToken = '';\n }\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n\n settings.data = noCookieData + eventToken + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {object} targetForm\n */\nfunction ctSearchFormOnSubmitHandler(e, targetForm) {\n try {\n // get honeypot field and it's value\n const honeyPotField = targetForm.querySelector('[id*=\"apbct__email_id__\"]');\n let hpValue = null;\n let hpEventId = null;\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n // get cookie data from storages\n let cleantalkStorageDataArray = getCleanTalkStorageDataArray();\n\n // get event token from storage\n let eventTokenLocalStorage = apbctLocalStorage.get('bot_detector_event_token');\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( cleantalkStorageDataArray !== null || honeyPotField !== null || eventTokenLocalStorage !== null ) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n if (typeof targetForm.apbctSearchPrevOnsubmit === 'function') {\n targetForm.apbctSearchPrevOnsubmit();\n } else {\n HTMLFormElement.prototype.submit.call(targetForm);\n }\n };\n\n let cookiesArray = cleantalkStorageDataArray;\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // set event token\n cookiesArray.ct_bot_detector_event_token = eventTokenLocalStorage;\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n // data to JSON\n const parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( typeof parsedCookies !== 'undefined' && parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctPublic.wl_brandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n let email = currentResultData.decoded_email.split(/[&?]/)[0];\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n if (firstNode) {\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNodes, result);\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNodes, decodingResult) {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML = baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n\n encodedEmailNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedEmailNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if ( typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n\n let noCookieData = getCleanTalkStorageDataArray();\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * Retrieves the clentalk \"cookie\" data from starages.\n * Contains {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration}.\n * @return {string}\n */\nfunction getCleanTalkStorageDataArray() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieDataFromDecoration = {form_decoration_mouse_data: []};\n if (document.ctFormDecorationMouseData) {\n let formDecorationMouseData = JSON.parse(JSON.stringify(document.ctFormDecorationMouseData));\n if (formDecorationMouseData.mouseMovements) {\n delete formDecorationMouseData.mouseMovements;\n }\n noCookieDataFromDecoration = {form_decoration_mouse_data: formDecorationMouseData};\n }\n return {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo, ...noCookieDataFromDecoration};\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n const formAction = typeof(form.action) == 'string' ? form.action : '';\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n // Super WooCommerce Product Filter\n if (form.classList.contains('swpf-instant-filtering')) {\n return true;\n }\n // PayU 3-rd party service forms\n if (formAction.indexOf('secure.payu.com') !== -1 ) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n/**\n * WooCommerce add to cart by GET request params collecting\n */\nfunction apbctCheckAddToCartByGet() {\n // 1) Collect all links with add_to_cart_button class\n document.querySelectorAll('a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)').forEach((el) => {\n el.addEventListener('click', function(e) {\n let href = el.getAttribute('href');\n // 2) Add to href attribute additional parameter ct_bot_detector_event_token gathered from apbctLocalStorage\n let eventToken = apbctLocalStorage.get('bot_detector_event_token');\n if ( eventToken ) {\n if ( href.indexOf('?') === -1 ) {\n href += '?';\n } else {\n href += '&';\n }\n href += 'ct_bot_detector_event_token=' + eventToken;\n el.setAttribute('href', href);\n }\n });\n });\n}\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n ignoreURLConvert: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded) || this.ignoreURLConvert) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctTrpLocalize = undefined;\n let ctTrpIsAdminCommentsList = false;\n\n if ( typeof ctPublic !== 'undefined' || typeof ctTrpAdminLocalize !== 'undefined' ) {\n if ( typeof ctPublic !== 'undefined' && ctPublic.theRealPerson ) {\n ctTrpLocalize = ctPublic.theRealPerson;\n }\n if (\n typeof ctTrpLocalize === 'undefined' &&\n typeof ctTrpAdminLocalize !== 'undefined' &&\n ctTrpAdminLocalize.theRealPerson\n ) {\n ctTrpLocalize = ctTrpAdminLocalize.theRealPerson;\n ctTrpIsAdminCommentsList = true;\n }\n }\n\n if ( ! ctTrpLocalize ) {\n return;\n }\n\n // Selectors. Try to handle the WIDE range of themes.\n let themesCommentsSelector = '.apbct-trp *[class*=\"comment-author\"]';\n if ( document.querySelector('.apbct-trp .comment-author .comment-author-link') ) {\n // For Spacious theme\n themesCommentsSelector = '.apbct-trp *[class*=\"comment-author-link\"]';\n }\n let woocommerceReviewsSelector = '.apbct-trp *[class*=\"review__author\"]';\n let adminCommentsListSelector = '.apbct-trp td[class*=\"column-author\"] > strong';\n const trpComments = document.querySelectorAll(\n themesCommentsSelector + ',' +\n woocommerceReviewsSelector + ',' +\n adminCommentsListSelector);\n\n if ( trpComments.length === 0 ) {\n return;\n }\n\n trpComments.forEach(( element, index ) => {\n let trpLayout = document.createElement('div');\n trpLayout.setAttribute('class', 'apbct-real-user-badge');\n\n let trpImage = document.createElement('img');\n trpImage.setAttribute('src', ctTrpLocalize.imgPersonUrl);\n trpImage.setAttribute('class', 'apbct-real-user-popup-img');\n\n let trpDescription = document.createElement('div');\n trpDescription.setAttribute('class', 'apbct-real-user-popup');\n\n let trpDescriptionHeading = document.createElement('p');\n trpDescriptionHeading.setAttribute('class', 'apbct-real-user-popup-header');\n trpDescriptionHeading.append(ctTrpLocalize.phrases.trpHeading);\n\n let trpDescriptionContent = document.createElement('div');\n trpDescriptionContent.setAttribute('class', 'apbct-real-user-popup-content_row');\n\n let trpDescriptionContentSpan = document.createElement('span');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent1 + ' ');\n trpDescriptionContentSpan.append(ctTrpLocalize.phrases.trpContent2);\n\n if ( ctTrpIsAdminCommentsList ) {\n let learnMoreLink = document.createElement('a');\n learnMoreLink.setAttribute('href', ctTrpLocalize.trpContentLink);\n learnMoreLink.setAttribute('target', '_blank');\n learnMoreLink.text = ctTrpLocalize.phrases.trpContentLearnMore;\n trpDescriptionContentSpan.append(' '); // Need one space\n trpDescriptionContentSpan.append(learnMoreLink);\n }\n\n trpDescriptionContent.append(trpDescriptionContentSpan);\n trpDescription.append(trpDescriptionHeading, trpDescriptionContent);\n trpLayout.append(trpImage);\n element.append(trpLayout);\n element.append(trpDescription);\n });\n\n const badges = document.querySelectorAll('.apbct-real-user-badge');\n\n badges.forEach((badge) => {\n let hideTimeout = undefined;\n\n badge.addEventListener('click', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.toggle('visible');\n }\n });\n\n badge.addEventListener('mouseenter', function() {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.add('visible');\n }\n });\n\n badge.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n const popup = badge.nextElementSibling;\n popup.addEventListener('mouseenter', function() {\n clearTimeout(hideTimeout);\n popup.classList.add('visible');\n });\n\n popup.addEventListener('mouseleave', function() {\n hideTimeout = setTimeout(() => {\n if (popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 1000);\n });\n\n // For mobile devices\n badge.addEventListener('touchend', function() {\n hideTimeout = setTimeout(() => {\n const popup = this.nextElementSibling;\n const selection = window.getSelection();\n // Check if no text is selected\n if (popup && selection && popup.classList.contains('apbct-real-user-popup') &&\n selection.toString().length === 0\n ) {\n popup.classList.remove('visible');\n } else {\n clearTimeout(hideTimeout);\n document.addEventListener('selectionchange', function onSelectionChange() {\n const selection = window.getSelection();\n if (selection && selection.toString().length === 0) {\n // Restart the hide timeout when selection is cleared\n hideTimeout = setTimeout(() => {\n const popup = badge.nextElementSibling;\n if (popup && popup.classList.contains('apbct-real-user-popup')) {\n popup.classList.remove('visible');\n }\n }, 3000);\n document.removeEventListener('selectionchange', onSelectionChange);\n }\n });\n }\n }, 3000);\n });\n });\n});\n\n/**\n * Check form as internal.\n * @param {int} currForm Current form.\n */\nfunction ctCheckInternal(currForm) {\n // Gathering data\n const ctData = {};\n const elems = currForm.elements;\n let key;\n\n for (key in elems) {\n if (elems[key].type !== 'submit' &&\n elems[key].value !== undefined &&\n elems[key].value !== '') {\n ctData[elems[key].name] = currForm.elements[key].value;\n }\n }\n ctData.action = 'ct_check_internal';\n\n // AJAX Request\n apbct_public_sendAJAX(\n ctData,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function(data) {\n if (data.success === true) {\n currForm.origSubmit();\n } else {\n alert(data.data);\n return false;\n }\n },\n },\n );\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctCurrAction = '';\n let ctCurrForm = '';\n\n if ( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n setTimeout(() => {\n for ( let i = 0; i < document.forms.length; i++ ) {\n if ( typeof(document.forms[i].action) == 'string' ) {\n ctCurrForm = document.forms[i];\n ctCurrAction = ctCurrForm.action;\n if (\n ctCurrAction.indexOf('https?://') !== null && // The protocol is obligatory\n ctCurrAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ctCheckInternalIsExcludedForm(ctCurrAction) // Exclude WordPress native scripts from processing\n ) {\n const formClone = ctCurrForm.cloneNode(true);\n ctCurrForm.parentNode.replaceChild(formClone, ctCurrForm);\n\n formClone.origSubmit = ctCurrForm.submit;\n formClone.submit = null;\n\n formClone.addEventListener('submit', function(event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n ctCheckInternal(event.target);\n return false;\n });\n }\n }\n }\n }, 500);\n});\n\n/**\n * Check by action to exclude the form checking\n * @param {string} action\n * @return {boolean}\n */\nfunction ctCheckInternalIsExcludedForm(action) {\n // An array contains forms action need to be excluded.\n const ctInternalScriptExclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ctInternalScriptExclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","getAttribute","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","ctJsErrors","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","selectActualNonce","defaultNonce","ctPublicFunctions","hasOwnProperty","_fresh_nonce","data__ajax_type","_ajax_nonce","_rest_nonce","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","prepare","keys","deleteDoubleJSONEncoding","convertData","console","open","setHeaders","onreadystatechange","isWpNonceError","getFreshNonceAndRerunXHR","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","restErrror","ajaxErrror","readyState","initialRequestParams","noncePrev","spbc_remote_call_action","plugin_name","nonce_prev","initial_request_params","notJson","host_url","freshNonceResult","newRequestParams","undefined","wpnonce","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","_rest_url","route","nonce","X-WP-Nonce","defineProperty","property","enumerable","configurable","writable","ApbctFormDecorator","getElements","setListeners","regexId","regexClass","setDecorationBackground","matchingElements","from","test","element","id","forEach","flagLeft","flagRight","flagWrap","blockForms","classHeaderWrapper","endPosition","classTemplate","substring","blockForm","clickX","flagLeftWidth","flagLeftHeight","flagRightWidth","flagRightHeight","offsetX","clickY","offsetY","parseFloat","width","height","addClicks","getSelection","addSelected","mouseX","mouseY","trackMouseMovement","ctFormDecorationMouseData","clicks","selected","firstMovement","timeDiff","mouseMovements","timestamp","now","index","lastMovement","hovering","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","item","apbctLocalStorage","set","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","encodeURIComponent","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bloomPopup","pafeFormsFormElementor","otterForm","bookingPress","isArray","getJavascriptClientData","e","apbct_site_referer","apbct_force_alt_cookies","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","beforeSend","ctGetCookie","matches","RegExp","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","no_cache","apbctGenerateUniqueID","substr","get","storageValue","json","isJson","objToSave","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","apbctForceProtect","ApbctForceProtection","data__key_is_ok","apbct_attach_event_handler","wrappers","findWrappers","checkBot","event_javascript_data","post_url","referrer","checkBotCallback","result","decodeForms","allow","showMessageForBot","form","wrapper","dataset","encodedForm","outerHTML","atob","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctCheckedEmailsExist","ctMouseReadInterval","ctMouseWriteDataInterval","tokenCheckerIntervalId","botDetectorLogLastUpdate","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__bot_detector_enabled","sendBotDetectorLogToAltSessions","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","interval","currentLog","log_last_update","token","doAttach","getElementsByClassName","getElementById","setEventTokenField","clearInterval","checkEmail","currentEmail","email","checkEmailExist","hint","getResultCheckEmailExist","viewCheckEmailExist","envelope","text_result","state","textResult","inputEmail","top","getBoundingClientRect","left","right","offsetHeight","envelopeWidth","offsetWidth","onmouseover","textContent","color","onmouseout","ctIsDrawPixel","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","startForcedAltEventTokenChecker","eventToken","apbct_ready","botDetectorLocalStorage","wc_ajax_add_to_cart","apbctCheckAddToCartByGet","sessionID","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","data__email_check_exist_post","tokenForForceAlt","encodedEmailNodes","settings__data__bot_detector_enabled","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","ctAddWCMiddlewares","hiddenInput","visibleFieldsToInput","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","ctFillDecodedEmailHandler","_form","settings__forms__search_test","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","apbctCatchXmlHttpRequest","settings__comments__form_decoration","apbctAjaxSetImportantParametersOnCacheExist","advancedCacheExists","varnishCacheExists","settings__sfw__anti_crawler","checkBotDetectorExist","botDetectorIntervalSearch","bot_detector_event_token","wp","apiFetch","use","options","next","requests","path","ct_no_cookie_hidden_field","originalSend","addidionalCleantalkData","apply","cacheExist","ajaxSetup","sourceSign","contains","targetForm","honeyPotField","hpValue","hpEventId","callBack","parsedCookies","cleantalkStorageDataArray","getCleanTalkStorageDataArray","eventTokenLocalStorage","preventDefault","parentNode","HTMLFormElement","submit","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","ct_bot_detector_event_token","warn","encodedEmailNodesIsMixed","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","innerHTML","wl_brandname","waitingPopup","popupHeader","innerText","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","animationElements","animationWrapper","apbctEEAnimationDogOne","clickSource","encodedEmails","encodedEmailsCollection","apbctTooltip","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","popup","currentResultData","row","encoded_email","decoded_email","firstNode","selectableEmail","title","secondNode","buttonWrapper","fillDecodedEmails","click","comment","decodingResult","encodedEmail","baseElementContent","encodedEmailTextInsideMailto","el","ctProcessDecodedDataResult","commonCookies","resultDataJson","ct_checked_emails","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_headless","ct_bot_detector_frontend_data_log","apbct_page_hits","apbct_prev_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","popupText","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","formDecorationMouseData","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","noCookieDataFromDecoration","form_decoration_mouse_data","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","hiddenFieldType","formAction","j","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","ignoreURLConvert","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","ctCheckInternal","currForm","ctData","elems","alert","origSubmit","ctCheckInternalIsExcludedForm","some","blog_home","ctTrpLocalize","ctTrpIsAdminCommentsList","ctTrpAdminLocalize","theRealPerson","themesCommentsSelector","trpComments","learnMoreLink","trpLayout","trpImage","trpDescription","imgPersonUrl","trpDescriptionHeading","trpDescriptionContent","phrases","trpHeading","trpDescriptionContentSpan","trpContent1","trpContent2","trpContentLink","text","trpContentLearnMore","hideTimeout","badge","nextElementSibling","clearTimeout","selection","onSelectionChange","ctCurrAction","ctCurrForm","settings__forms__check_internal","formClone","cloneNode","replaceChild","stopImmediatePropagation"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACvB,UAApB,OAAOA,GACfM,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChB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GA,EAAInB,SAASge,MAAM5c,OAAQD,CAAC,GAAK,CAC9C,IAQckxB,EAR2B,UAApC,OAAOryB,SAASge,MAAM7c,GAAS,SAChCgxB,EAAanyB,SAASge,MAAM7c,GAGc,QAF1C+wB,EAAeC,EAAW3d,QAEThQ,QAAQ,WAAW,GACwB,OAAxD0tB,EAAahuB,MAAMsO,SAAS8d,UAAY,SAAU,GAChDF,8BAA8B8B,CAAY,IAEtCG,EAAYF,EAAWG,UAAU,CAAA,CAAI,EAC3CH,EAAW3N,WAAW+N,aAAaF,EAAWF,CAAU,EAExDE,EAAUlC,WAAagC,EAAWzN,OAClC2N,EAAU3N,OAAS,KAEnB2N,EAAU1vB,iBAAiB,SAAU,SAASpD,GAK1C,OAJAA,EAAMglB,eAAe,EACrBhlB,EAAMyD,gBAAgB,EACtBzD,EAAMizB,yBAAyB,EAC/B1C,gBAAgBvwB,EAAMuD,MAAM,EACrB,CAAA,CACX,CAAC,GAGb,CACJ,EAAG,GAAG,CACV,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-admin-settings-page.min.js b/js/cleantalk-admin-settings-page.min.js index e3e8440e..ca749611 100644 --- a/js/cleantalk-admin-settings-page.min.js +++ b/js/cleantalk-admin-settings-page.min.js @@ -1,2 +1,2 @@ -function apbctBannerCheck(){let c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbctGetElems(a){for(let t=0,e=(a=a.split(",")).length,n;t{document.getElementById(t)&&"none"!==document.getElementById(t).style.display&&apbctShowHideElem(t)})}function apbctShowRequiredGroups(t,e){var n=document.getElementById("apbct_settings__dwpms_settings");n&&"none"===n.style.display&&((n=t).preventDefault(),apbctShowHideElem("apbct_settings__dwpms_settings"),document.getElementById(e).dispatchEvent(new n.constructor(n.type,n)))}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbctGetElemsNative(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependenciesGetState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependenciesGetState(t){let e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbctSettingsShowDescription(t,e){function c(t){var e=0!=jQuery(t.target).parent(".apbct_long_desc").length,t=jQuery(t.target).hasClass("apbct_long_desc__cancel");(0
");var n=jQuery("#apbct_long_desc__"+e);n.append("").append("
").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("
").append("").append("

"+t.title+"

").append("

"+t.desc+"

"),jQuery(document).on("click",c)}},n)}function apbctSaveButtonPosition(){var t,e,n,a,c,i,o,s;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,o=(i=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,s=i.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t{var e;"checkbox"===t.target.type?(e=t.target.checked?1:2,document.querySelectorAll("input[id^=apbct_setting_data__email_decoder]")[e].checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});let t=(new Date).getTimezoneOffset()/60*-1;jQuery("#ct_admin_timezone").val(t),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto",ct_admin_timezone:t},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));if(jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");let n={};if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var a=e.val();if(""===a)return void e.css("border-color","red");n={template_name:a}}else n={template_id:t.data("id")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){let c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbctSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbctBannerCheck(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbctSaveButtonPosition(),window.addEventListener("scroll",apbctSaveButtonPosition),jQuery("#ct_adv_showhide a").on("click",apbctSaveButtonPosition),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("

Please, insert a correct access key before saving changes!

").insertAfter(jQuery("#apbct_setting_apikey")),apbctHighlightElement("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("

Synchronization process failed. Please, check the acces key and restart the synch.

").insertAfter(jQuery("#apbct_button__sync")),apbctHighlightElement("apbct_setting_apikey",3),apbctHighlightElement("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();let e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))}),jQuery('button[id*="apbct-action-adjust-change-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_change"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-change-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),jQuery('button[id*="apbct-action-adjust-reverse-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_reverse"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-reverse-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),document.querySelector(".apbct_hidden_section_nav_mob_btn").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="block",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="none"}),document.querySelector(".apbct_hidden_section_nav_mob_btn-close").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="none",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="block"})}); +function apbctBannerCheck(){let c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbctGetElems(a){for(let t=0,e=(a=a.split(",")).length,n;t{document.getElementById(t)&&"none"!==document.getElementById(t).style.display&&apbctShowHideElem(t)})}function apbctShowRequiredGroups(t,e){var n=document.getElementById("apbct_settings__dwpms_settings");n&&"none"===n.style.display&&((n=t).preventDefault(),apbctShowHideElem("apbct_settings__dwpms_settings"),document.getElementById(e).dispatchEvent(new n.constructor(n.type,n)))}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbctGetElemsNative(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependenciesGetState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependenciesGetState(t){let e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbctSettingsShowDescription(t,e){function c(t){var e=0!=jQuery(t.target).parent(".apbct_long_desc").length,t=jQuery(t.target).hasClass("apbct_long_desc__cancel");(0
");var n=jQuery("#apbct_long_desc__"+e);n.append("").append("
").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("
").append("").append("

"+t.title+"

").append("

"+t.desc+"

"),jQuery(document).on("click",c)}},n)}function apbctSaveButtonPosition(){var t,e,n,a,c,i,o,s;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,o=(i=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,s=i.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t{var e;"checkbox"===t.target.type?(e=t.target.checked?1:2,document.querySelectorAll("input[id^=apbct_setting_data__email_decoder]")[e].checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});let t=(new Date).getTimezoneOffset()/60*-1;jQuery("#ct_admin_timezone").val(t),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto",ct_admin_timezone:t},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));if(jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");let n={};if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var a=e.val();if(""===a)return void e.css("border-color","red");n={template_name:a}}else n={template_id:t.data("id")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){let c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbctSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbctBannerCheck(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbctSaveButtonPosition(),window.addEventListener("scroll",apbctSaveButtonPosition),jQuery("#ct_adv_showhide a").on("click",apbctSaveButtonPosition),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("

Please, insert a correct access key before saving changes!

").insertAfter(jQuery("#apbct_setting_apikey")),apbctHighlightElement("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("

Synchronization process failed. Please, check the acces key and restart the synch.

").insertAfter(jQuery("#apbct_button__sync")),apbctHighlightElement("apbct_setting_apikey",3),apbctHighlightElement("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();const e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))}),jQuery('button[id*="apbct-action-adjust-change-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_change"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-change-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),jQuery('button[id*="apbct-action-adjust-reverse-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_reverse"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-reverse-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),document.querySelector(".apbct_hidden_section_nav_mob_btn").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="block",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="none"}),document.querySelector(".apbct_hidden_section_nav_mob_btn-close").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="none",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="block"})}); //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map diff --git a/js/cleantalk-admin-settings-page.min.js.map b/js/cleantalk-admin-settings-page.min.js.map index 5f478517..0c5c2d5c 100644 --- a/js/cleantalk-admin-settings-page.min.js.map +++ b/js/cleantalk-admin-settings-page.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function() {\r\n // Top level settings\r\n jQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\r\n if ( event.target.type === 'checkbox' ) {\r\n let currentTarget = event.target.checked ? 1 : 2;\r\n document.querySelectorAll('input[id^=apbct_setting_data__email_decoder]')[currentTarget].checked = true;\r\n } else {\r\n document.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\r\n }\r\n });\r\n\r\n // Crunch for Right to Left direction languages\r\n if (document.getElementsByClassName('apbct_settings-title')[0]) {\r\n if (getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl') {\r\n jQuery('.apbct_switchers').css('text-align', 'right');\r\n }\r\n }\r\n\r\n // Show/Hide access key\r\n jQuery('#apbct_showApiKey').on('click', function() {\r\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\r\n jQuery('.apbct_setting---apikey+div').show();\r\n jQuery(this).fadeOut(300);\r\n });\r\n\r\n let d = new Date();\r\n let timezone = d.getTimezoneOffset()/60*(-1);\r\n jQuery('#ct_admin_timezone').val(timezone);\r\n\r\n // Key KEY automatically\r\n jQuery('#apbct_button__get_key_auto').on('click', function() {\r\n apbct_admin_sendAJAX(\r\n {action: 'apbct_get_key_auto', ct_admin_timezone: timezone},\r\n {\r\n timeout: 25000,\r\n button: document.getElementById('apbct_button__get_key_auto' ),\r\n spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\r\n callback: function(result, data, params, obj) {\r\n jQuery('#apbct_button__get_key_auto .apbct_success').show(300);\r\n setTimeout(function() {\r\n jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);\r\n }, 2000);\r\n if (result.reload) {\r\n document.location.reload();\r\n }\r\n if (result.getTemplates) {\r\n cleantalkModal.loaded = result.getTemplates;\r\n cleantalkModal.open();\r\n document.addEventListener('cleantalkModalClosed', function( e ) {\r\n document.location.reload();\r\n });\r\n }\r\n },\r\n },\r\n );\r\n });\r\n\r\n // Import settings\r\n jQuery( document ).on('click', '#apbct_settings_templates_import_button', function() {\r\n jQuery('#apbct-ajax-result').remove();\r\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\r\n let templateNameInput = jQuery('#apbct_settings_templates_import_name');\r\n templateNameInput.css('border-color', 'inherit');\r\n if ( typeof optionSelected.data('id') === 'undefined' ) {\r\n console.log( 'Attribute \"data-id\" not set for the option.' );\r\n return;\r\n }\r\n let data = {\r\n 'template_id': optionSelected.data('id'),\r\n 'template_name': optionSelected.data('name'),\r\n 'settings': optionSelected.data('settings'),\r\n };\r\n let button = this;\r\n apbct_admin_sendAJAX(\r\n {action: 'settings_templates_import', data: data},\r\n {\r\n timeout: 25000,\r\n button: button,\r\n spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\r\n notJson: true,\r\n callback: function(result, data, params, obj) {\r\n if (result.success) {\r\n jQuery( '

' + result.data + '

' )\r\n .insertAfter( jQuery(button) );\r\n jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\r\n setTimeout(function() {\r\n jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);\r\n }, 2000);\r\n document.addEventListener('cleantalkModalClosed', function( e ) {\r\n document.location.reload();\r\n });\r\n setTimeout(function() {\r\n cleantalkModal.close();\r\n }, 2000);\r\n } else {\r\n jQuery( '

' + result.data + '

' )\r\n .insertAfter( jQuery(button) );\r\n }\r\n },\r\n },\r\n );\r\n });\r\n\r\n // Export settings\r\n jQuery( document ).on('click', '#apbct_settings_templates_export_button', function() {\r\n jQuery('#apbct-ajax-result').remove();\r\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\r\n let templateNameInput = jQuery('#apbct_settings_templates_export_name');\r\n let data = {};\r\n templateNameInput.css('border-color', 'inherit');\r\n if ( typeof optionSelected.data('id') === 'undefined' ) {\r\n console.log( 'Attribute \"data-id\" not set for the option.' );\r\n return;\r\n }\r\n if ( optionSelected.data('id') === 'new_template' ) {\r\n let templateName = templateNameInput.val();\r\n if ( templateName === '' ) {\r\n templateNameInput.css('border-color', 'red');\r\n return;\r\n }\r\n data = {\r\n 'template_name': templateName,\r\n };\r\n } else {\r\n data = {\r\n 'template_id': optionSelected.data('id'),\r\n };\r\n }\r\n let button = this;\r\n apbct_admin_sendAJAX(\r\n {action: 'settings_templates_export', data: data},\r\n {\r\n timeout: 25000,\r\n button: button,\r\n spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\r\n notJson: true,\r\n callback: function(result, data, params, obj) {\r\n if (result.success) {\r\n jQuery( '

' + result.data + '

' )\r\n .insertAfter( jQuery(button) );\r\n jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\r\n setTimeout(function() {\r\n jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);\r\n }, 2000);\r\n document.addEventListener('cleantalkModalClosed', function( e ) {\r\n document.location.reload();\r\n });\r\n setTimeout(function() {\r\n cleantalkModal.close();\r\n }, 2000);\r\n } else {\r\n jQuery( '

' + result.data + '

' )\r\n .insertAfter( jQuery(button) );\r\n }\r\n },\r\n },\r\n );\r\n });\r\n\r\n // Reset settings\r\n jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function() {\r\n let button = this;\r\n apbct_admin_sendAJAX(\r\n {action: 'settings_templates_reset'},\r\n {\r\n timeout: 25000,\r\n button: button,\r\n spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\r\n notJson: true,\r\n callback: function(result, data, params, obj) {\r\n if (result.success) {\r\n jQuery( '

' + result.data + '

' )\r\n .insertAfter( jQuery(button) );\r\n jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\r\n setTimeout(function() {\r\n jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);\r\n }, 2000);\r\n document.addEventListener('cleantalkModalClosed', function( e ) {\r\n document.location.reload();\r\n });\r\n setTimeout(function() {\r\n cleantalkModal.close();\r\n }, 2000);\r\n } else {\r\n jQuery( '

' + result.data + '

' )\r\n .insertAfter( jQuery(button) );\r\n }\r\n },\r\n },\r\n );\r\n });\r\n\r\n // Sync button\r\n jQuery('#apbct_button__sync').on('click', function() {\r\n apbct_admin_sendAJAX(\r\n {action: 'apbct_sync'},\r\n {\r\n timeout: 25000,\r\n button: document.getElementById('apbct_button__sync' ),\r\n spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\r\n callback: function(result, data, params, obj) {\r\n jQuery('#apbct_button__sync .apbct_success').show(300);\r\n setTimeout(function() {\r\n jQuery('#apbct_button__sync .apbct_success').hide(300);\r\n }, 2000);\r\n if (result.reload) {\r\n if ( ctSettingsPage.key_changed ) {\r\n jQuery('.key_changed_sync').hide(300);\r\n jQuery('.key_changed_success').show(300);\r\n setTimeout(function() {\r\n document.location.reload();\r\n }, 3000);\r\n } else {\r\n document.location.reload();\r\n }\r\n }\r\n },\r\n },\r\n );\r\n });\r\n\r\n if ( ctSettingsPage.key_changed ) {\r\n jQuery('#apbct_button__sync').click();\r\n }\r\n\r\n jQuery(document).on('click', '.apbct_settings-long_description---show', function() {\r\n self = jQuery(this);\r\n apbctSettingsShowDescription(self, self.attr('setting'));\r\n });\r\n\r\n if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length) {\r\n apbctBannerCheck();\r\n }\r\n\r\n jQuery(document).on('change', '#apbct_settings_templates_export', function() {\r\n let optionSelected = jQuery('option:selected', this);\r\n if ( optionSelected.data('id') === 'new_template' ) {\r\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\r\n } else {\r\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\r\n }\r\n });\r\n\r\n apbctSaveButtonPosition();\r\n window.addEventListener('scroll', apbctSaveButtonPosition);\r\n jQuery('#ct_adv_showhide a').on('click', apbctSaveButtonPosition);\r\n\r\n\r\n /**\r\n * Change cleantalk account email\r\n */\r\n jQuery('#apbct-change-account-email').on('click', function(e) {\r\n e.preventDefault();\r\n\r\n let $this = jQuery(this);\r\n let accountEmailField = jQuery('#apbct-account-email');\r\n let accountEmail = accountEmailField.text();\r\n\r\n $this.toggleClass('active');\r\n\r\n if ($this.hasClass('active')) {\r\n $this.text($this.data('save-text'));\r\n accountEmailField.attr('contenteditable', 'true');\r\n accountEmailField.on('keydown', function(e) {\r\n if (e.code === 'Enter') {\r\n e.preventDefault();\r\n }\r\n });\r\n accountEmailField.on('input', function(e) {\r\n if (e.inputType === 'insertParagraph') {\r\n e.preventDefault();\r\n }\r\n });\r\n } else {\r\n apbct_admin_sendAJAX(\r\n {\r\n action: 'apbct_update_account_email',\r\n accountEmail: accountEmail,\r\n },\r\n {\r\n timeout: 5000,\r\n callback: function(result, data, params, obj) {\r\n if (result.success !== undefined && result.success === 'ok') {\r\n if (result.manuallyLink !== undefined) {\r\n jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\r\n }\r\n }\r\n\r\n if (result.error !== undefined) {\r\n jQuery('#apbct-account-email').css('border-color', 'red');\r\n }\r\n },\r\n },\r\n );\r\n\r\n accountEmailField.attr('contenteditable', 'false');\r\n $this.text($this.data('default-text'));\r\n }\r\n });\r\n\r\n /**\r\n * Validate apkikey and hide get auto btn\r\n */\r\n jQuery('#apbct_setting_apikey').on('input', function() {\r\n let enteredValue = jQuery(this).val();\r\n jQuery('button.cleantalk_link[value=\"save_changes\"]').off('click');\r\n if (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\r\n jQuery('#apbct_button__get_key_auto__wrapper').show();\r\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\r\n function(e) {\r\n e.preventDefault();\r\n if (!jQuery('#apbct_bad_key_notice').length) {\r\n jQuery( '

' +\r\n 'Please, insert a correct access key before saving changes!' +\r\n '

' ).insertAfter( jQuery('#apbct_setting_apikey') );\r\n }\r\n apbctHighlightElement('apbct_setting_apikey', 3);\r\n },\r\n );\r\n return;\r\n }\r\n });\r\n\r\n if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\r\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\r\n }\r\n\r\n /**\r\n * Handle synchronization errors when key is no ok to force user check the key and restart the sync\r\n */\r\n if ( !ctSettingsPage.key_is_ok ) {\r\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\r\n function(e) {\r\n e.preventDefault();\r\n if (!jQuery('#sync_required_notice').length) {\r\n jQuery( '

' +\r\n 'Synchronization process failed. Please, check the acces key and restart the synch.' +\r\n '

' ).insertAfter( jQuery('#apbct_button__sync') );\r\n }\r\n apbctHighlightElement('apbct_setting_apikey', 3);\r\n apbctHighlightElement('apbct_button__sync', 3);\r\n jQuery('#apbct_button__get_key_auto__wrapper').show();\r\n },\r\n );\r\n }\r\n\r\n /**\r\n * Open WP gallery for adding custom logo\r\n */\r\n jQuery('#apbct-custom-logo-open-gallery').click(function(e) {\r\n e.preventDefault();\r\n\r\n const button = jQuery(this);\r\n\r\n const customUploader = wp.media({\r\n library: {\r\n type: 'image',\r\n },\r\n multiple: false,\r\n });\r\n\r\n customUploader.on('select', function() {\r\n const image = customUploader.state().get('selection').first().toJSON();\r\n\r\n button.parent().prev().attr( 'src', image.url );\r\n jQuery('#cleantalk_custom_logo').val( image.id );\r\n });\r\n\r\n customUploader.open();\r\n });\r\n\r\n /**\r\n * Remove selected logo\r\n */\r\n jQuery('#apbct-custom-logo-remove-image').click(function(e) {\r\n e.preventDefault();\r\n\r\n if ( true === confirm( 'Sure?' ) ) {\r\n const src = jQuery(this).parent().prev().data('src');\r\n jQuery(this).parent().prev().attr('src', src);\r\n jQuery(this).prev().prev().val('');\r\n }\r\n });\r\n\r\n jQuery('button[id*=\"apbct-action-adjust-change-\"]').click(function(e) {\r\n e.preventDefault();\r\n\r\n let data = {};\r\n data.action = 'apbct_action_adjust_change';\r\n data.adjust = jQuery(this).data('adjust');\r\n\r\n let params = {};\r\n params.button = document.getElementById('apbct-action-adjust-change-' + data.adjust);\r\n params.notJson = true;\r\n\r\n params.callback = function() {\r\n document.location.reload();\r\n };\r\n\r\n apbct_admin_sendAJAX(data, params);\r\n });\r\n\r\n jQuery('button[id*=\"apbct-action-adjust-reverse-\"]').click(function(e) {\r\n e.preventDefault();\r\n\r\n let data = {};\r\n data.action = 'apbct_action_adjust_reverse';\r\n data.adjust = jQuery(this).data('adjust');\r\n\r\n let params = {};\r\n params.button = document.getElementById('apbct-action-adjust-reverse-' + data.adjust);\r\n params.notJson = true;\r\n\r\n params.callback = function() {\r\n document.location.reload();\r\n };\r\n\r\n apbct_admin_sendAJAX(data, params);\r\n });\r\n\r\n document.querySelector('.apbct_hidden_section_nav_mob_btn').addEventListener('click', () => {\r\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'block';\r\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'none';\r\n });\r\n\r\n document.querySelector('.apbct_hidden_section_nav_mob_btn-close').addEventListener('click', () => {\r\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'none';\r\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'block';\r\n });\r\n});\r\n\r\n/**\r\n * Checking current account status for renew notice\r\n */\r\nfunction apbctBannerCheck() {\r\n let bannerChecker = setInterval( function() {\r\n apbct_admin_sendAJAX(\r\n {action: 'apbct_settings__check_renew_banner'},\r\n {\r\n callback: function(result, data, params, obj) {\r\n if (result.close_renew_banner) {\r\n if (jQuery('#cleantalk_notice_renew').length) {\r\n jQuery('#cleantalk_notice_renew').hide('slow');\r\n }\r\n if (jQuery('#cleantalk_notice_trial').length) {\r\n jQuery('#cleantalk_notice_trial').hide('slow');\r\n }\r\n clearInterval(bannerChecker);\r\n }\r\n },\r\n },\r\n );\r\n }, 900000);\r\n}\r\n\r\n/**\r\n * Select elems like #{selector} or .{selector}\r\n * Selector passed in string separated by ,\r\n *\r\n * @param {string|array} elems\r\n * @return {*}\r\n */\r\nfunction apbctGetElems(elems) {\r\n elems = elems.split(',');\r\n for ( let i=0, len = elems.length, tmp; i < len; i++) {\r\n tmp = jQuery('#'+elems[i]);\r\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\r\n }\r\n return elems;\r\n}\r\n\r\n/**\r\n * Select elems like #{selector} or .{selector}\r\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\r\n *\r\n * @param {string|array} elems\r\n * @return {array}\r\n */\r\nfunction apbctGetElemsNative(elems) {\r\n // Make array from a string\r\n if (typeof elems === 'string') {\r\n elems = elems.split(',');\r\n }\r\n\r\n let out = [];\r\n\r\n elems.forEach(function(elem, i, arr) {\r\n // try to get elements with such IDs\r\n let tmp = document.getElementById(elem);\r\n if (tmp !== null) {\r\n out.push( tmp[key] );\r\n return;\r\n }\r\n\r\n // try to get elements with such class name\r\n // write each elem from collection to new element of output array\r\n tmp = document.getElementsByClassName(elem);\r\n if (tmp !== null && tmp.length !==0 ) {\r\n for (key in tmp) {\r\n if ( +key >= 0 ) {\r\n out.push( tmp[key] );\r\n }\r\n }\r\n }\r\n });\r\n\r\n return out;\r\n}\r\n\r\n/**\r\n * @param {string|array} elems\r\n */\r\nfunction apbctShowHideElem(elems) {\r\n elems = apbctGetElems(elems);\r\n for ( let i=0, len = elems.length; i < len; i++) {\r\n elems[i].each(function(i, elem) {\r\n elem = jQuery(elem);\r\n let label = elem.next('label') || elem.prev('label') || null;\r\n if (elem.is(':visible')) {\r\n elem.hide();\r\n if (label) label.hide();\r\n } else {\r\n elem.show();\r\n if (label) label.show();\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * @param {string|array} element\r\n */\r\nfunction apbctExceptedShowHide(element) { // eslint-disable-line no-unused-vars\r\n let toHide = [\r\n 'apbct_settings__dwpms_settings',\r\n 'apbct_settings__advanced_settings',\r\n 'trusted_and_affiliate__special_span',\r\n ];\r\n let index = toHide.indexOf(element);\r\n if (index !== -1) {\r\n toHide.splice(index, 1);\r\n }\r\n apbctShowHideElem(element);\r\n toHide.forEach((toHideElem) => {\r\n if (document.getElementById(toHideElem) && document.getElementById(toHideElem).style.display !== 'none') {\r\n apbctShowHideElem(toHideElem);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @param {mixed} event\r\n * @param {string} id\r\n */\r\nfunction apbctShowRequiredGroups(event, id) { // eslint-disable-line no-unused-vars\r\n let required = document.getElementById('apbct_settings__dwpms_settings');\r\n if (required && required.style.display === 'none') {\r\n let originEvent = event;\r\n event.preventDefault();\r\n apbctShowHideElem('apbct_settings__dwpms_settings');\r\n document.getElementById(id).dispatchEvent(new originEvent.constructor(originEvent.type, originEvent));\r\n }\r\n}\r\n\r\n/**\r\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\r\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\r\n *\r\n * @param {string|array} ids\r\n * @param {int} enable\r\n */\r\nfunction apbctSettingsDependencies(ids, enable) { // eslint-disable-line no-unused-vars\r\n enable = ! isNaN(enable) ? enable : null;\r\n\r\n // Get elements\r\n let elems = apbctGetElemsNative( ids );\r\n\r\n elems.forEach(function(elem, i, arr) {\r\n let doDisable = function() {\r\n elem.setAttribute('disabled', 'disabled');\r\n };\r\n let doEnable = function() {\r\n elem.removeAttribute('disabled');\r\n };\r\n\r\n // Set defined state\r\n if (enable === null) {\r\n enable = elem.getAttribute('disabled') === null ? 0 : 1;\r\n }\r\n\r\n enable === 1 ? doEnable() : doDisable();\r\n\r\n if ( elem.getAttribute('apbct_children') !== null) {\r\n let state = apbctSettingsDependenciesGetState( elem ) && enable;\r\n if ( state !== null ) {\r\n apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\r\n }\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} elem\r\n * @return {int|null}\r\n */\r\nfunction apbctSettingsDependenciesGetState(elem) {\r\n let state;\r\n\r\n switch ( elem.getAttribute( 'type' ) ) {\r\n case 'checkbox':\r\n state = +elem.checked;\r\n break;\r\n case 'radio':\r\n state = +(+elem.getAttribute('value') === 1);\r\n break;\r\n default:\r\n state = null;\r\n }\r\n\r\n return state;\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} label\r\n * @param {string} settingId\r\n */\r\nfunction apbctSettingsShowDescription(label, settingId) {\r\n let removeDescFunc = function(e) {\r\n const callerIsPopup = jQuery(e.target).parent('.apbct_long_desc').length != 0;\r\n const callerIsHideCross = jQuery(e.target).hasClass('apbct_long_desc__cancel');\r\n const descIsShown = jQuery('.apbct_long_desc__title').length > 0;\r\n if (descIsShown && !callerIsPopup || callerIsHideCross) {\r\n jQuery('.apbct_long_desc').remove();\r\n jQuery(document).off('click', removeDescFunc);\r\n }\r\n };\r\n\r\n label.after('
');\r\n let obj = jQuery('#apbct_long_desc__'+settingId);\r\n obj.append('')\r\n .append('
')\r\n .css({\r\n top: label.position().top - 5,\r\n left: label.position().left + 25,\r\n });\r\n\r\n\r\n apbct_admin_sendAJAX(\r\n {action: 'apbct_settings__get__long_description', setting_id: settingId},\r\n {\r\n spinner: obj.children('img'),\r\n callback: function(result, data, params, obj) {\r\n obj.empty()\r\n .append('
')\r\n .append('')\r\n .append('

'+result.title+'

')\r\n .append('

'+result.desc+'

');\r\n\r\n jQuery(document).on('click', removeDescFunc);\r\n },\r\n },\r\n obj,\r\n );\r\n}\r\n\r\n/**\r\n * save button, navigation menu, navigation button position\r\n */\r\nfunction apbctSaveButtonPosition() {\r\n if (\r\n document.getElementById('apbct_settings__before_advanced_settings') === null ||\r\n document.getElementById('apbct_settings__after_advanced_settings') === null ||\r\n document.getElementById('apbct_settings__button_section') === null ||\r\n document.getElementById('apbct_settings__advanced_settings') === null ||\r\n document.getElementById('apbct_hidden_section_nav') === null\r\n ) {\r\n return;\r\n }\r\n let docInnerHeight = window.innerHeight;\r\n let advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\r\n let advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\r\n let buttonBlock = document.getElementById('apbct_settings__button_section');\r\n let buttonHeight = buttonBlock.getBoundingClientRect().height;\r\n let navBlock = document.getElementById('apbct_hidden_section_nav');\r\n let navBlockOffset = navBlock.getBoundingClientRect().top;\r\n let navBlockHeight = navBlock.getBoundingClientRect().height;\r\n\r\n // Set Save button position\r\n if ( getComputedStyle(advSettingsBlock).display !== 'none' ) {\r\n jQuery('#apbct_settings__main_save_button').hide();\r\n if ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\r\n buttonBlock.style.bottom = '';\r\n buttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\r\n } else {\r\n buttonBlock.style.bottom = 0;\r\n buttonBlock.style.top = '';\r\n }\r\n } else {\r\n jQuery('#apbct_settings__main_save_button').show();\r\n }\r\n\r\n if (window.innerWidth <= 768 && advSettingsOffset < 0) {\r\n document.querySelector('#apbct_hidden_section_nav').style.display = 'grid';\r\n document.querySelector('#apbct_hidden_section_nav').style.top = docInnerHeight + 'px';\r\n } else if (window.innerWidth <= 768) {\r\n document.querySelector('#apbct_hidden_section_nav').style.display = 'none';\r\n }\r\n\r\n // Set nav position\r\n if ( advSettingsOffset <= 0 ) {\r\n navBlock.style.top = - advSettingsOffset + 30 + 'px';\r\n } else {\r\n navBlock.style.top = 0;\r\n }\r\n}\r\n\r\n/**\r\n * Hightlights element\r\n *\r\n * @param {string} id\r\n * @param {int} times\r\n */\r\nfunction apbctHighlightElement(id, times) {\r\n times = times-1 || 0;\r\n let keyField = jQuery('#'+id);\r\n jQuery('html, body').animate({scrollTop: keyField.offset().top - 100}, 'slow');\r\n keyField.addClass('apbct_highlighted');\r\n keyField.animate({opacity: 0}, 400, 'linear', function() {\r\n keyField.animate({opacity: 1}, 400, 'linear', function() {\r\n if (times>0) {\r\n apbctHighlightElement(id, times);\r\n } else {\r\n keyField.removeClass('apbct_highlighted');\r\n }\r\n });\r\n });\r\n}\r\n"],"names":["apbctBannerCheck","let","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbctGetElems","elems","i","len","split","tmp","apbctGetElemsNative","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbctShowHideElem","each","label","next","prev","is","show","apbctExceptedShowHide","element","toHide","index","indexOf","splice","toHideElem","style","display","apbctShowRequiredGroups","event","id","required","originEvent","preventDefault","dispatchEvent","constructor","type","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependenciesGetState","checked","apbctSettingsShowDescription","settingId","removeDescFunc","e","callerIsPopup","target","parent","callerIsHideCross","hasClass","remove","off","after","append","css","top","position","left","setting_id","spinner","children","empty","title","desc","on","apbctSaveButtonPosition","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","bottom","innerWidth","querySelector","apbctHighlightElement","times","keyField","animate","scrollTop","offset","addClass","opacity","removeClass","ready","currentTarget","querySelectorAll","parseInt","value","direction","val","attr","this","fadeOut","timezone","Date","getTimezoneOffset","ct_admin_timezone","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src","adjust"],"mappings":"AAkbA,SAASA,mBACLC,IAAIC,EAAgBC,YAAa,WAC7BC,qBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOI,qBACHC,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAE7CF,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAEjDC,cAAcb,CAAa,EAEnC,CACJ,CACJ,CACJ,EAAG,GAAM,CACb,CASA,SAASc,cAAcC,GAEnB,IAAMhB,IAAIiB,EAAE,EAAGC,GADfF,EAAQA,EAAMG,MAAM,GAAG,GACIP,OAAQQ,EAAKH,EAAIC,EAAKD,CAAC,GAC9CG,EAAMT,OAAO,IAAIK,EAAMC,EAAE,EACzBD,EAAMC,GAAoB,IAAfG,EAAIR,OAAeD,OAAO,IAAIK,EAAMC,EAAE,EAAIG,EAEzD,OAAOJ,CACX,CASA,SAASK,oBAAoBL,GAEJ,UAAjB,OAAOA,IACPA,EAAQA,EAAMG,MAAM,GAAG,GAG3BnB,IAAIsB,EAAM,GA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BAA8B,EAAE7D,MAAMC,QAAU,QACvEpB,SAASgF,cAAc,mCAAmC,EAAE7D,MAAMC,QAAU,MAChF,CAAC,EAEDpB,SAASgF,cAAc,yCAAyC,EAAEiC,iBAAiB,QAAS,KACxFjH,SAASgF,cAAc,8BAA8B,EAAE7D,MAAMC,QAAU,OACvEpB,SAASgF,cAAc,mCAAmC,EAAE7D,MAAMC,QAAU,OAChF,CAAC,CACL,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function() {\n // Top level settings\n jQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n if ( event.target.type === 'checkbox' ) {\n let currentTarget = event.target.checked ? 1 : 2;\n document.querySelectorAll('input[id^=apbct_setting_data__email_decoder]')[currentTarget].checked = true;\n } else {\n document.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n }\n });\n\n // Crunch for Right to Left direction languages\n if (document.getElementsByClassName('apbct_settings-title')[0]) {\n if (getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl') {\n jQuery('.apbct_switchers').css('text-align', 'right');\n }\n }\n\n // Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function() {\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n let d = new Date();\n let timezone = d.getTimezoneOffset()/60*(-1);\n jQuery('#ct_admin_timezone').val(timezone);\n\n // Key KEY automatically\n jQuery('#apbct_button__get_key_auto').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_get_key_auto', ct_admin_timezone: timezone},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__get_key_auto' ),\n spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.getTemplates) {\n cleantalkModal.loaded = result.getTemplates;\n cleantalkModal.open();\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#apbct_settings_templates_import_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n let templateNameInput = jQuery('#apbct_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#apbct_settings_templates_export_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n let templateNameInput = jQuery('#apbct_settings_templates_export_name');\n let data = {};\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function() {\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Sync button\n jQuery('#apbct_button__sync').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_sync'},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__sync' ),\n spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__sync .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__sync .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n if ( ctSettingsPage.key_changed ) {\n jQuery('.key_changed_sync').hide(300);\n jQuery('.key_changed_success').show(300);\n setTimeout(function() {\n document.location.reload();\n }, 3000);\n } else {\n document.location.reload();\n }\n }\n },\n },\n );\n });\n\n if ( ctSettingsPage.key_changed ) {\n jQuery('#apbct_button__sync').click();\n }\n\n jQuery(document).on('click', '.apbct_settings-long_description---show', function() {\n self = jQuery(this);\n apbctSettingsShowDescription(self, self.attr('setting'));\n });\n\n if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length) {\n apbctBannerCheck();\n }\n\n jQuery(document).on('change', '#apbct_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n }\n });\n\n apbctSaveButtonPosition();\n window.addEventListener('scroll', apbctSaveButtonPosition);\n jQuery('#ct_adv_showhide a').on('click', apbctSaveButtonPosition);\n\n\n /**\n * Change cleantalk account email\n */\n jQuery('#apbct-change-account-email').on('click', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#apbct-account-email');\n let accountEmail = accountEmailField.text();\n\n $this.toggleClass('active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n apbct_admin_sendAJAX(\n {\n action: 'apbct_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#apbct-account-email').css('border-color', 'red');\n }\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n /**\n * Validate apkikey and hide get auto btn\n */\n jQuery('#apbct_setting_apikey').on('input', function() {\n let enteredValue = jQuery(this).val();\n jQuery('button.cleantalk_link[value=\"save_changes\"]').off('click');\n if (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#apbct_bad_key_notice').length) {\n jQuery( '

' +\n 'Please, insert a correct access key before saving changes!' +\n '

' ).insertAfter( jQuery('#apbct_setting_apikey') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n },\n );\n return;\n }\n });\n\n if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n }\n\n /**\n * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n */\n if ( !ctSettingsPage.key_is_ok ) {\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#sync_required_notice').length) {\n jQuery( '

' +\n 'Synchronization process failed. Please, check the acces key and restart the synch.' +\n '

' ).insertAfter( jQuery('#apbct_button__sync') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n apbctHighlightElement('apbct_button__sync', 3);\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n },\n );\n }\n\n /**\n * Open WP gallery for adding custom logo\n */\n jQuery('#apbct-custom-logo-open-gallery').click(function(e) {\n e.preventDefault();\n\n const button = jQuery(this);\n\n const customUploader = wp.media({\n library: {\n type: 'image',\n },\n multiple: false,\n });\n\n customUploader.on('select', function() {\n const image = customUploader.state().get('selection').first().toJSON();\n\n button.parent().prev().attr( 'src', image.url );\n jQuery('#cleantalk_custom_logo').val( image.id );\n });\n\n customUploader.open();\n });\n\n /**\n * Remove selected logo\n */\n jQuery('#apbct-custom-logo-remove-image').click(function(e) {\n e.preventDefault();\n\n if ( true === confirm( 'Sure?' ) ) {\n const src = jQuery(this).parent().prev().data('src');\n jQuery(this).parent().prev().attr('src', src);\n jQuery(this).prev().prev().val('');\n }\n });\n\n jQuery('button[id*=\"apbct-action-adjust-change-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_change';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-change-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n jQuery('button[id*=\"apbct-action-adjust-reverse-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_reverse';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-reverse-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'block';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'none';\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn-close').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'none';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'block';\n });\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbctBannerCheck() {\n let bannerChecker = setInterval( function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#cleantalk_notice_renew').length) {\n jQuery('#cleantalk_notice_renew').hide('slow');\n }\n if (jQuery('#cleantalk_notice_trial').length) {\n jQuery('#cleantalk_notice_trial').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param {string|array} elems\n * @return {*}\n */\nfunction apbctGetElems(elems) {\n elems = elems.split(',');\n for ( let i=0, len = elems.length, tmp; i < len; i++) {\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param {string|array} elems\n * @return {array}\n */\nfunction apbctGetElemsNative(elems) {\n // Make array from a string\n if (typeof elems === 'string') {\n elems = elems.split(',');\n }\n\n let out = [];\n\n elems.forEach(function(elem, i, arr) {\n // try to get elements with such IDs\n let tmp = document.getElementById(elem);\n if (tmp !== null) {\n out.push( tmp[key] );\n return;\n }\n\n // try to get elements with such class name\n // write each elem from collection to new element of output array\n tmp = document.getElementsByClassName(elem);\n if (tmp !== null && tmp.length !==0 ) {\n for (key in tmp) {\n if ( +key >= 0 ) {\n out.push( tmp[key] );\n }\n }\n }\n });\n\n return out;\n}\n\n/**\n * @param {string|array} elems\n */\nfunction apbctShowHideElem(elems) {\n elems = apbctGetElems(elems);\n for ( let i=0, len = elems.length; i < len; i++) {\n elems[i].each(function(i, elem) {\n elem = jQuery(elem);\n let label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(':visible')) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * @param {string|array} element\n */\nfunction apbctExceptedShowHide(element) { // eslint-disable-line no-unused-vars\n let toHide = [\n 'apbct_settings__dwpms_settings',\n 'apbct_settings__advanced_settings',\n 'trusted_and_affiliate__special_span',\n ];\n let index = toHide.indexOf(element);\n if (index !== -1) {\n toHide.splice(index, 1);\n }\n apbctShowHideElem(element);\n toHide.forEach((toHideElem) => {\n if (document.getElementById(toHideElem) && document.getElementById(toHideElem).style.display !== 'none') {\n apbctShowHideElem(toHideElem);\n }\n });\n}\n\n/**\n * @param {mixed} event\n * @param {string} id\n */\nfunction apbctShowRequiredGroups(event, id) { // eslint-disable-line no-unused-vars\n let required = document.getElementById('apbct_settings__dwpms_settings');\n if (required && required.style.display === 'none') {\n let originEvent = event;\n event.preventDefault();\n apbctShowHideElem('apbct_settings__dwpms_settings');\n document.getElementById(id).dispatchEvent(new originEvent.constructor(originEvent.type, originEvent));\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param {string|array} ids\n * @param {int} enable\n */\nfunction apbctSettingsDependencies(ids, enable) { // eslint-disable-line no-unused-vars\n enable = ! isNaN(enable) ? enable : null;\n\n // Get elements\n let elems = apbctGetElemsNative( ids );\n\n elems.forEach(function(elem, i, arr) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n // Set defined state\n if (enable === null) {\n enable = elem.getAttribute('disabled') === null ? 0 : 1;\n }\n\n enable === 1 ? doEnable() : doDisable();\n\n if ( elem.getAttribute('apbct_children') !== null) {\n let state = apbctSettingsDependenciesGetState( elem ) && enable;\n if ( state !== null ) {\n apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n }\n }\n });\n}\n\n/**\n * @param {HTMLElement} elem\n * @return {int|null}\n */\nfunction apbctSettingsDependenciesGetState(elem) {\n let state;\n\n switch ( elem.getAttribute( 'type' ) ) {\n case 'checkbox':\n state = +elem.checked;\n break;\n case 'radio':\n state = +(+elem.getAttribute('value') === 1);\n break;\n default:\n state = null;\n }\n\n return state;\n}\n\n/**\n * @param {HTMLElement} label\n * @param {string} settingId\n */\nfunction apbctSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n const callerIsPopup = jQuery(e.target).parent('.apbct_long_desc').length != 0;\n const callerIsHideCross = jQuery(e.target).hasClass('apbct_long_desc__cancel');\n const descIsShown = jQuery('.apbct_long_desc__title').length > 0;\n if (descIsShown && !callerIsPopup || callerIsHideCross) {\n jQuery('.apbct_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n label.after('
');\n let obj = jQuery('#apbct_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top - 5,\n left: label.position().left + 25,\n });\n\n\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__get__long_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * save button, navigation menu, navigation button position\n */\nfunction apbctSaveButtonPosition() {\n if (\n document.getElementById('apbct_settings__before_advanced_settings') === null ||\n document.getElementById('apbct_settings__after_advanced_settings') === null ||\n document.getElementById('apbct_settings__button_section') === null ||\n document.getElementById('apbct_settings__advanced_settings') === null ||\n document.getElementById('apbct_hidden_section_nav') === null\n ) {\n return;\n }\n let docInnerHeight = window.innerHeight;\n let advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n let advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n let buttonBlock = document.getElementById('apbct_settings__button_section');\n let buttonHeight = buttonBlock.getBoundingClientRect().height;\n let navBlock = document.getElementById('apbct_hidden_section_nav');\n let navBlockOffset = navBlock.getBoundingClientRect().top;\n let navBlockHeight = navBlock.getBoundingClientRect().height;\n\n // Set Save button position\n if ( getComputedStyle(advSettingsBlock).display !== 'none' ) {\n jQuery('#apbct_settings__main_save_button').hide();\n if ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n buttonBlock.style.bottom = '';\n buttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n } else {\n buttonBlock.style.bottom = 0;\n buttonBlock.style.top = '';\n }\n } else {\n jQuery('#apbct_settings__main_save_button').show();\n }\n\n if (window.innerWidth <= 768 && advSettingsOffset < 0) {\n document.querySelector('#apbct_hidden_section_nav').style.display = 'grid';\n document.querySelector('#apbct_hidden_section_nav').style.top = docInnerHeight + 'px';\n } else if (window.innerWidth <= 768) {\n document.querySelector('#apbct_hidden_section_nav').style.display = 'none';\n }\n\n // Set nav position\n if ( advSettingsOffset <= 0 ) {\n navBlock.style.top = - advSettingsOffset + 30 + 'px';\n } else {\n navBlock.style.top = 0;\n }\n}\n\n/**\n * Hightlights element\n *\n * @param {string} id\n * @param {int} times\n */\nfunction apbctHighlightElement(id, times) {\n times = times-1 || 0;\n let keyField = jQuery('#'+id);\n jQuery('html, body').animate({scrollTop: keyField.offset().top - 100}, 'slow');\n keyField.addClass('apbct_highlighted');\n keyField.animate({opacity: 0}, 400, 'linear', function() {\n keyField.animate({opacity: 1}, 400, 'linear', function() {\n if (times>0) {\n apbctHighlightElement(id, times);\n } else {\n keyField.removeClass('apbct_highlighted');\n }\n });\n });\n}\n"],"names":["apbctBannerCheck","let","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbctGetElems","elems","i","len","split","tmp","apbctGetElemsNative","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbctShowHideElem","each","label","next","prev","is","show","apbctExceptedShowHide","element","toHide","index","indexOf","splice","toHideElem","style","display","apbctShowRequiredGroups","event","id","required","originEvent","preventDefault","dispatchEvent","constructor","type","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependenciesGetState","checked","apbctSettingsShowDescription","settingId","removeDescFunc","e","callerIsPopup","target","parent","callerIsHideCross","hasClass","remove","off","after","append","css","top","position","left","setting_id","spinner","children","empty","title","desc","on","apbctSaveButtonPosition","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","bottom","innerWidth","querySelector","apbctHighlightElement","times","keyField","animate","scrollTop","offset","addClass","opacity","removeClass","ready","currentTarget","querySelectorAll","parseInt","value","direction","val","attr","this","fadeOut","timezone","Date","getTimezoneOffset","ct_admin_timezone","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src","adjust"],"mappings":"AAkbA,SAASA,mBACLC,IAAIC,EAAgBC,YAAa,WAC7BC,qBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOI,qBACHC,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAE7CF,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAEjDC,cAAcb,CAAa,EAEnC,CACJ,CACJ,CACJ,EAAG,GAAM,CACb,CASA,SAASc,cAAcC,GAEnB,IAAMhB,IAAIiB,EAAE,EAAGC,GADfF,EAAQA,EAAMG,MAAM,GAAG,GACIP,OAAQQ,EAAKH,EAAIC,EAAKD,CAAC,GAC9CG,EAAMT,OAAO,IAAIK,EAAMC,EAAE,EACzBD,EAAMC,GAAoB,IAAfG,EAAIR,OAAeD,OAAO,IAAIK,EAAMC,EAA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AAO,CAC7B,EAEAlI,qBAAqBI,EAAMC,CAAM,CACrC,CAAC,EAEDkB,SAASgF,cAAc,mCAAmC,EAAEiC,iBAAiB,QAAS,KAClFjH,SAASgF,cAAc,8BAA8B,EAAE7D,MAAMC,QAAU,QACvEpB,SAASgF,cAAc,mCAAmC,EAAE7D,MAAMC,QAAU,MAChF,CAAC,EAEDpB,SAASgF,cAAc,yCAAyC,EAAEiC,iBAAiB,QAAS,KACxFjH,SAASgF,cAAc,8BAA8B,EAAE7D,MAAMC,QAAU,OACvEpB,SAASgF,cAAc,mCAAmC,EAAE7D,MAAMC,QAAU,OAChF,CAAC,CACL,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-admin.min.js b/js/cleantalk-admin.min.js index 06603a6c..79947e75 100644 --- a/js/cleantalk-admin.min.js +++ b/js/cleantalk-admin.min.js @@ -1,4 +1,4 @@ -function ctFillDecodedEmailHandler(){document.body.classList.add("apbct-popup-fade");var e,t,n,a,o=document.getElementById("apbct_popup");o?(o.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctAdminCommon.plugin_name+" is decoding the email addresses."):((o=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),o.setAttribute("id","apbct_popup"),(e=document.createElement("span")).classList="apbct-email-encoder-elements_center",(t=document.createElement("p")).innerText=ctAdminCommon.plugin_name,t.setAttribute("class","apbct-email-encoder--popup-header"),e.append(t),(t=document.createElement("div")).setAttribute("id","apbct_popup_text"),t.setAttribute("class","apbct-email-encoder-elements_center"),t.style.color="black",(n=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",n.innerText="The magic is on the way, please wait for a few seconds!",n.setAttribute("class","apbct-email-encoder-elements_center"),(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",a.innerText="Decoding process to the original data.",t.append(n),t.append(a),o.append(e),o.append(t),o.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(o)),apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],n=document.createElement("div");n.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.setAttribute("title",""),e.removeAttribute("style"),ctFillDecodedEmail(e,n)},2e3),e.removeEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmail(e,t){jQuery(e).html(jQuery(e).html().replace(/.+?(
)/,t+"$1"))}function apbct_admin_sendAJAX(t,n,a){let o=n.callback||null,c=n.callback_context||null,i=n.callback_params||null;var e=n.async||!0;let l=n.notJson||null;var r=n.timeout||15e3,a=a||null;let d=n.button||null,s=n.spinner||null,p=n.progressbar||null;"string"==typeof t?t=t+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(t._ajax_nonce=ctAdminCommon._ajax_nonce,t.no_cache=Math.random()),d&&(d.setAttribute("disabled","disabled"),d.style.cursor="not-allowed"),s&&jQuery(s).css("display","inline"),jQuery.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:t,async:e,success:function(e){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){p&&p.fadeOut("slow")},1e3),"undefined"!=typeof cleantalkModal?(cleantalkModal.loaded="Error:
"+e.error.toString(),cleantalkModal.open()):alert("Error happens: "+(e.error||"Unkown"))):o&&(i?o.apply(c,i.concat(e,t,n,a)):o(e,t,n,a))},error:function(e,t,n){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log(n)},timeout:r})}function ctDecorationSelectorActions(){var e=document.querySelector("#apbct_setting_comments__form_decoration_selector");let t=document.querySelector("#apbct_setting_comments__form_decoration_color"),n=document.querySelector("#apbct_setting_comments__form_decoration_text"),a="Default Theme";t&&n&&e&&(e.value===a&&(t.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled")),e.addEventListener("change",function(e){e=e.target.value;e&&0

'+ctAdminCommon.apbctNoticeDismissSuccess+"

"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3))}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),jQuery("#deactivate-cleantalk-spam-protect").on("click",function(e){e.preventDefault();var t,e=this.getAttribute("href");"undefined"!=typeof cleantalkModal&&"1"===ctAdminCommon.deactivation_banner_is_needed?(t=` +function ctFillDecodedEmailHandler(){document.body.classList.add("apbct-popup-fade");var e,t,n,a,o=document.getElementById("apbct_popup");o?(o.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctAdminCommon.plugin_name+" is decoding the email addresses."):((o=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),o.setAttribute("id","apbct_popup"),(e=document.createElement("span")).classList="apbct-email-encoder-elements_center",(t=document.createElement("p")).innerText=ctAdminCommon.plugin_name,t.setAttribute("class","apbct-email-encoder--popup-header"),e.append(t),(t=document.createElement("div")).setAttribute("id","apbct_popup_text"),t.setAttribute("class","apbct-email-encoder-elements_center"),t.style.color="black",(n=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",n.innerText="The magic is on the way, please wait for a few seconds!",n.setAttribute("class","apbct-email-encoder-elements_center"),(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",a.innerText="Decoding process to the original data.",t.append(n),t.append(a),o.append(e),o.append(t),o.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(o)),apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],n=document.createElement("div");n.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.setAttribute("title",""),e.removeAttribute("style"),ctFillDecodedEmail(e,n)},2e3),e.removeEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmail(e,t){jQuery(e).html(jQuery(e).html().replace(/.+?(
)/,t+"$1"))}function apbct_admin_sendAJAX(t,n,a){let o=n.callback||null,c=n.callback_context||null,i=n.callback_params||null;var e=n.async||!0;let l=n.notJson||null;var r=n.timeout||15e3,a=a||null;let d=n.button||null,s=n.spinner||null,p=n.progressbar||null;"string"==typeof t?t=t+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(t._ajax_nonce=ctAdminCommon._ajax_nonce,t.no_cache=Math.random()),d&&(d.setAttribute("disabled","disabled"),d.style.cursor="not-allowed"),s&&jQuery(s).css("display","inline"),jQuery.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:t,async:e,success:function(e){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){p&&p.fadeOut("slow")},1e3),"undefined"!=typeof cleantalkModal?(cleantalkModal.loaded="Error:
"+e.error.toString(),cleantalkModal.open()):alert("Error happens: "+(e.error||"Unkown"))):o&&(i?o.apply(c,i.concat(e,t,n,a)):o(e,t,n,a))},error:function(e,t,n){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log(n)},timeout:r})}function ctDecorationSelectorActions(){var e=document.querySelector("#apbct_setting_comments__form_decoration_selector");const t=document.querySelector("#apbct_setting_comments__form_decoration_color"),n=document.querySelector("#apbct_setting_comments__form_decoration_text"),a="Default Theme";t&&n&&e&&(e.value===a&&(t.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled")),e.addEventListener("change",function(e){e=e.target.value;e&&0

'+ctAdminCommon.apbctNoticeDismissSuccess+"

"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3))}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),jQuery("#deactivate-cleantalk-spam-protect").on("click",function(e){e.preventDefault();var t,e=this.getAttribute("href");"undefined"!=typeof cleantalkModal&&"1"===ctAdminCommon.deactivation_banner_is_needed?(t=`
${bannertText=ctAdminCommon.deactivation_banner_text.replace(/(https?:\/\/[^\s]+)/g,'$1')}
diff --git a/js/cleantalk-admin.min.js.map b/js/cleantalk-admin.min.js.map index 98d3e7b0..bbc16449 100644 --- a/js/cleantalk-admin.min.js.map +++ b/js/cleantalk-admin.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function($) {\r\n // Auto update banner close handler\r\n jQuery('.apbct_update_notice').on('click', 'button', function() {\r\n let ctDate = new Date(new Date().getTime() + 1000 * 86400 * 30 );\r\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\r\n document.cookie = 'apbct_update_banner_closed=1; path=/; expires=' +\r\n ctDate.toUTCString() + '; samesite=lax' + ctSecure;\r\n });\r\n\r\n jQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space', 'nowrap')\r\n .css('display', 'inline-block');\r\n\r\n jQuery('body').on('click', '.apbct-notice .notice-dismiss-link', function(e) {\r\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\r\n });\r\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\r\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\r\n if ( apbctNoticeName ) {\r\n apbct_admin_sendAJAX(\r\n {\r\n 'action': 'cleantalk_dismiss_notice',\r\n 'notice_id': apbctNoticeName,\r\n },\r\n {\r\n 'callback': null,\r\n 'notJson': true,\r\n },\r\n );\r\n jQuery(e.target)\r\n .parent('.notice')\r\n .after('

' +\r\n ctAdminCommon.apbctNoticeDismissSuccess +\r\n '

');\r\n setTimeout(function() {\r\n jQuery('#apbct-notice-dismiss-success').fadeOut();\r\n }, 2000);\r\n }\r\n });\r\n\r\n // Notice when deleting user\r\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\r\n e.preventDefault();\r\n\r\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\r\n\r\n if (result) {\r\n window.location = this.href;\r\n }\r\n });\r\n\r\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\r\n if (btnForceProtectionOn) {\r\n btnForceProtectionOn.addEventListener('click', function(e) {\r\n if (btnForceProtectionOn.checked) {\r\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\r\n\r\n if (!result) {\r\n e.preventDefault();\r\n }\r\n }\r\n });\r\n }\r\n // Restore spam order\r\n $('.apbct-restore-spam-order-button').click(function() {\r\n const spmOrderId = $(this).data('spam-order-id');\r\n let data = {\r\n action: 'apbct_restore_spam_order',\r\n _ajax_nonce: ctAdminCommon._ajax_nonce,\r\n order_id: spmOrderId,\r\n };\r\n $.ajax({\r\n type: 'POST',\r\n url: ctAdminCommon._ajax_url,\r\n data: data,\r\n success: function(result) {\r\n if (result.success) {\r\n window.location.reload();\r\n } else {\r\n alert(result.data.message);\r\n }\r\n },\r\n });\r\n });\r\n\r\n // Deactivation banner\r\n jQuery('#deactivate-cleantalk-spam-protect').on('click', function(e) {\r\n e.preventDefault();\r\n let deactivationLink = this.getAttribute('href');\r\n if ( typeof cleantalkModal !== 'undefined' && ctAdminCommon.deactivation_banner_is_needed === '1') {\r\n // force replace raw link to the href - fix for https://doboard.com/1/task/10192\r\n bannertText = ctAdminCommon.deactivation_banner_text\r\n .replace(/(https?:\\/\\/[^\\s]+)/g, '$1');\r\n const modalHTML = `\r\n
\r\n ${bannertText}\r\n
\r\n
\r\n \r\n No, deactivate anyway\r\n
\r\n `;\r\n // look ahead ^ deactivationLink in the href was broken after modal handler URL converison\r\n cleantalkModal.loaded = modalHTML;\r\n // ignore URL conversions due modal handler\r\n cleantalkModal.ignoreURLConvert = true;\r\n cleantalkModal.open();\r\n } else {\r\n window.location.href = deactivationLink;\r\n }\r\n });\r\n\r\n // Email decoder example\r\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\r\n let encodedEmailNode = document.querySelector('[data-original-string]');\r\n if (encodedEmailNode) {\r\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\r\n encodedEmailNode.style.cursor = 'pointer';\r\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\r\n }\r\n }\r\n\r\n ctDecorationSelectorActions();\r\n});\r\n\r\n/**\r\n * @param {mixed} event\r\n */\r\nfunction ctFillDecodedEmailHandler() {\r\n document.body.classList.add('apbct-popup-fade');\r\n let encoderPopup = document.getElementById('apbct_popup');\r\n\r\n if (!encoderPopup) {\r\n // construct popup\r\n let waitingPopup = document.createElement('div');\r\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\r\n waitingPopup.setAttribute('id', 'apbct_popup');\r\n\r\n // construct text header\r\n let popupHeaderWrapper = document.createElement('span');\r\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\r\n let popupHeader = document.createElement('p');\r\n popupHeader.innerText = ctAdminCommon.plugin_name;\r\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\r\n popupHeaderWrapper.append(popupHeader);\r\n\r\n // construct text wrapper\r\n let popupTextWrapper = document.createElement('div');\r\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\r\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\r\n popupTextWrapper.style.color = 'black';\r\n\r\n // construct text first node\r\n // todo make translatable\r\n let popupTextWaiting = document.createElement('p');\r\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\r\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\r\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\r\n\r\n // construct text second node\r\n // todo make translatable\r\n let popupTextDecoding = document.createElement('p');\r\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\r\n popupTextDecoding.innerText = 'Decoding process to the original data.';\r\n\r\n // appending\r\n popupTextWrapper.append(popupTextWaiting);\r\n popupTextWrapper.append(popupTextDecoding);\r\n waitingPopup.append(popupHeaderWrapper);\r\n waitingPopup.append(popupTextWrapper);\r\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\r\n document.body.append(waitingPopup);\r\n } else {\r\n encoderPopup.setAttribute('style', 'display: inherit');\r\n document.getElementById('apbct_popup_text').innerHTML =\r\n 'Please wait while ' + ctAdminCommon.plugin_name + ' is decoding the email addresses.';\r\n }\r\n\r\n apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode);\r\n}\r\n/**\r\n * @return {HTMLElement} event\r\n */\r\nfunction apbctSetEmailDecoderPopupAnimation() {\r\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\r\n const animationWrapper = document.createElement('div');\r\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\r\n for (let i = 0; i < animationElements.length; i++) {\r\n const apbctEEAnimationDogOne = document.createElement('span');\r\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\r\n apbctEEAnimationDogOne.innerText = '@';\r\n animationWrapper.append(apbctEEAnimationDogOne);\r\n }\r\n return animationWrapper;\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} encodedEmailNode\r\n */\r\nfunction apbctAjaxEmailDecodeBulk(encodedEmailNode) {\r\n const encodedEmail = encodedEmailNode.dataset.originalString;\r\n let data = {\r\n encodedEmails: JSON.stringify({0: encodedEmail}),\r\n };\r\n\r\n // Adding a tooltip\r\n let apbctTooltip = document.createElement('div');\r\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\r\n jQuery(encodedEmailNode).append(apbctTooltip);\r\n\r\n apbct_admin_sendAJAX(\r\n {\r\n 'action': 'apbct_decode_email',\r\n 'encodedEmails': data.encodedEmails,\r\n },\r\n {\r\n 'callback': function(result) {\r\n apbctEmailEncoderCallbackBulk(result, encodedEmailNode);\r\n },\r\n 'notJson': true,\r\n },\r\n );\r\n}\r\n\r\n/**\r\n * @param {mixed} result\r\n * @param {mixed} encodedEmailNode\r\n */\r\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNode) {\r\n if (result.success && result.data[0].is_allowed === true) {\r\n // start process of visual decoding\r\n setTimeout(function() {\r\n let email = result.data[0].decoded_email;\r\n\r\n // change text\r\n let popup = document.getElementById('apbct_popup');\r\n if (popup !== null) {\r\n // handle first node\r\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\r\n // get email selectable by click\r\n let selectableEmail = document.createElement('b');\r\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\r\n selectableEmail.innerText = email;\r\n selectableEmail.title = 'Click to select the whole data';\r\n // add email to the first node\r\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\r\n firstNode.setAttribute('style', 'flex-direction: row;');\r\n // handle second node\r\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\r\n secondNode.innerText = 'Happy conversations!';\r\n // remove animation\r\n popup.querySelector('.apbct-ee-animation-wrapper').remove();\r\n // remove second node\r\n popup.querySelector('#apbct_email_ecoder__popup_text_node_second').remove();\r\n // add button\r\n let buttonWrapper = document.createElement('span');\r\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\r\n let button = document.createElement('button');\r\n button.innerText = 'Got it';\r\n button.classList = 'apbct-email-encoder-got-it-button';\r\n button.addEventListener('click', function() {\r\n document.body.classList.remove('apbct-popup-fade');\r\n popup.setAttribute('style', 'display:none');\r\n fillDecodedEmails(encodedEmailNode, result);\r\n });\r\n buttonWrapper.append(button);\r\n popup.append(buttonWrapper);\r\n }\r\n }, 3000);\r\n } else {\r\n console.log('result', result);\r\n }\r\n}\r\n\r\n/**\r\n * Run filling for every node with decoding result.\r\n * @param {mixed} encodedEmailNode\r\n * @param {mixed} decodingResult\r\n */\r\nfunction fillDecodedEmails(encodedEmailNode, decodingResult) {\r\n let currentResultData = decodingResult.data[0].decoded_email;\r\n encodedEmailNode.classList.add('no-blur');\r\n // fill the nodes\r\n setTimeout(() => {\r\n encodedEmailNode.setAttribute('title', '');\r\n encodedEmailNode.removeAttribute('style');\r\n ctFillDecodedEmail(encodedEmailNode, currentResultData);\r\n }, 2000);\r\n encodedEmailNode.removeEventListener('click', ctFillDecodedEmailHandler);\r\n}\r\n\r\n/**\r\n * @param {mixed} target\r\n * @param {string} email\r\n */\r\nfunction ctFillDecodedEmail(target, email) {\r\n jQuery(target).html(\r\n jQuery(target)\r\n .html()\r\n .replace(/.+?(
)/, email + '$1'),\r\n );\r\n}\r\n\r\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\r\nfunction apbct_admin_sendAJAX(data, params, obj) {\r\n // Default params\r\n let callback = params.callback || null;\r\n let callbackContext = params.callback_context || null;\r\n let callbackParams = params.callback_params || null;\r\n let async = params.async || true;\r\n let notJson = params.notJson || null;\r\n let timeout = params.timeout || 15000;\r\n var obj = obj || null; // eslint-disable-line no-var\r\n let button = params.button || null;\r\n let spinner = params.spinner || null;\r\n let progressbar = params.progressbar || null;\r\n\r\n if (typeof (data) === 'string') {\r\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\r\n } else {\r\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\r\n data.no_cache = Math.random();\r\n }\r\n // Button and spinner\r\n if (button) {\r\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\r\n }\r\n if (spinner) jQuery(spinner).css('display', 'inline');\r\n\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ctAdminCommon._ajax_url,\r\n data: data,\r\n async: async,\r\n success: function(result) {\r\n if (button) {\r\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\r\n }\r\n if (spinner) jQuery(spinner).css('display', 'none');\r\n if (!notJson) result = JSON.parse(result);\r\n if (result.error) {\r\n setTimeout(function() {\r\n if (progressbar) progressbar.fadeOut('slow');\r\n }, 1000);\r\n if ( typeof cleantalkModal !== 'undefined' ) {\r\n // Show the result by modal\r\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\r\n cleantalkModal.open();\r\n } else {\r\n alert('Error happens: ' + (result.error || 'Unkown'));\r\n }\r\n } else {\r\n if (callback) {\r\n if (callbackParams) {\r\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\r\n } else {\r\n callback(result, data, params, obj);\r\n }\r\n }\r\n }\r\n },\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n if (button) {\r\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\r\n }\r\n if (spinner) jQuery(spinner).css('display', 'none');\r\n console.log('APBCT_AJAX_ERROR');\r\n console.log(jqXHR);\r\n console.log(textStatus);\r\n console.log(errorThrown);\r\n },\r\n timeout: timeout,\r\n });\r\n}\r\n/**\r\n* @return {void}\r\n */\r\nfunction ctDecorationSelectorActions() {\r\n const selector = document.querySelector('#apbct_setting_comments__form_decoration_selector');\r\n const colorPicker = document.querySelector('#apbct_setting_comments__form_decoration_color');\r\n const headingText = document.querySelector('#apbct_setting_comments__form_decoration_text');\r\n const defaultThemeExpectedValue = 'Default Theme';\r\n if (colorPicker && headingText && selector) {\r\n if (selector.value === defaultThemeExpectedValue) {\r\n colorPicker.setAttribute('disabled', 'disabled');\r\n headingText.setAttribute('disabled', 'disabled');\r\n }\r\n selector.addEventListener('change', function(event) {\r\n const selectedValue = event.target.value;\r\n if (selectedValue && selectedValue.length > 0 && selectedValue === defaultThemeExpectedValue) {\r\n colorPicker.setAttribute('disabled', 'disabled');\r\n headingText.setAttribute('disabled', 'disabled');\r\n } else {\r\n colorPicker.removeAttribute('disabled');\r\n headingText.removeAttribute('disabled');\r\n }\r\n });\r\n }\r\n}\r\n"],"names":["ctFillDecodedEmailHandler","document","body","classList","add","let","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","getElementById","setAttribute","innerHTML","ctAdminCommon","plugin_name","waitingPopup","createElement","popupHeader","innerText","append","style","color","id","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","encodedEmailNode","animationElements","animationWrapper","i","length","apbctEEAnimationDogOne","encodedEmail","dataset","originalString","data","encodedEmails","JSON","stringify","0","apbctTooltip","jQuery","apbct_admin_sendAJAX","action","callback","result","apbctEmailEncoderCallbackBulk","notJson","success","is_allowed","setTimeout","firstNode","button","email","decoded_email","popup","querySelector","selectableEmail","title","outerHTML","remove","buttonWrapper","addEventListener","fillDecodedEmails","console","log","decodingResult","currentResultData","removeAttribute","ctFillDecodedEmail","removeEventListener","target","html","replace","params","obj","callbackContext","callback_context","callbackParams","callback_params","async","timeout","spinner","progressbar","_ajax_nonce","Math","random","no_cache","cursor","css","ajax","type","url","_ajax_url","parse","error","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","ctDecorationSelectorActions","selector","colorPicker","headingText","defaultThemeExpectedValue","value","event","selectedValue","ready","$","on","ctDate","Date","getTime","ctSecure","location","protocol","cookie","toUTCString","e","parent","siblings","click","apbctNoticeName","attr","notice_id","after","apbctNoticeDismissSuccess","preventDefault","confirm","notice_when_deleting_user_text","window","this","href","btnForceProtectionOn","checked","apbctNoticeForceProtectionOn","spmOrderId","order_id","reload","message","modalHTML","deactivationLink","getAttribute","deactivation_banner_is_needed","bannertText","deactivation_banner_text","ignoreURLConvert","includes"],"mappings":"AA+HA,SAASA,4BACLC,SAASC,KAAKC,UAAUC,IAAI,kBAAkB,EAC9CC,IASQC,EAQAC,EAOAC,EAOAC,EA/BJC,EAAeT,SAASU,eAAe,aAAa,EAEnDD,GAyCDA,EAAaE,aAAa,QAAS,kBAAkB,EACrDX,SAASU,eAAe,kBAAkB,EAAEE,UACxC,qBAAuBC,cAAcC,YAAc,uCAzCnDC,EAAef,SAASgB,cAAc,KAAK,GAClCL,aAAa,QAAS,uCAAuC,EAC1EI,EAAaJ,aAAa,KAAM,aAAa,GAGzCN,EAAqBL,SAASgB,cAAc,MAAM,GACnCd,UAAY,uCAC3Be,EAAcjB,SAASgB,cAAc,GAAG,GAChCE,UAAYL,cAAcC,YACtCG,EAAYN,aAAa,QAAS,mCAAmC,EACrEN,EAAmBc,OAAOF,CAAW,GAGjCX,EAAmBN,SAASgB,cAAc,KAAK,GAClCL,aAAa,KAAM,kBAAkB,EACtDL,EAAiBK,aAAa,QAAS,qCAAqC,EAC5EL,EAAiBc,MAAMC,MAAQ,SAI3Bd,EAAmBP,SAASgB,cAAc,GAAG,GAChCM,GAAK,4CACtBf,EAAiBW,UAAY,0DAC7BX,EAAiBI,aAAa,QAAS,qCAAqC,GAIxEH,EAAoBR,SAASgB,cAAc,GAAG,GAChCM,GAAK,6CACvBd,EAAkBU,UAAY,yCAG9BZ,EAAiBa,OAAOZ,CAAgB,EACxCD,EAAiBa,OAAOX,CAAiB,EACzCO,EAAaI,OAAOd,CAAkB,EACtCU,EAAaI,OAAOb,CAAgB,EACpCS,EAAaI,OAAOI,mCAAmC,CAAC,EACxDvB,SAASC,KAAKkB,OAAOJ,CAAY,GAOrCS,yBAAyBX,cAAcY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rD,gBAAkF,MAAhDnF,cAAcyI,+BAIlDH;;sBAFNI,YAAc1I,cAAc2I,yBACvBhF,QAAQ,uBAAwB,qCAAqC;;;;qDAOjC4E;;cAIzCpD,eAAeC,OAASkD,EAExBnD,eAAeyD,iBAAmB,CAAA,EAClCzD,eAAeG,KAAK,GAEpBsC,OAAOhB,SAASkB,KAAOS,CAE/B,CAAC,EAGGX,OAAOhB,SAASkB,KAAKe,SAAS,oCAAoC,IAC9DjI,EAAmBzB,SAASuD,cAAc,wBAAwB,MAElE1C,cAAcY,iBAAmBA,GAChBL,MAAMmE,OAAS,UAChC9D,EAAiBoC,iBAAiB,QAAS9D,yBAAyB,GAI5E2G,4BAA4B,CAChC,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function($) {\n // Auto update banner close handler\n jQuery('.apbct_update_notice').on('click', 'button', function() {\n let ctDate = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = 'apbct_update_banner_closed=1; path=/; expires=' +\n ctDate.toUTCString() + '; samesite=lax' + ctSecure;\n });\n\n jQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space', 'nowrap')\n .css('display', 'inline-block');\n\n jQuery('body').on('click', '.apbct-notice .notice-dismiss-link', function(e) {\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\n });\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\n if ( apbctNoticeName ) {\n apbct_admin_sendAJAX(\n {\n 'action': 'cleantalk_dismiss_notice',\n 'notice_id': apbctNoticeName,\n },\n {\n 'callback': null,\n 'notJson': true,\n },\n );\n jQuery(e.target)\n .parent('.notice')\n .after('

' +\n ctAdminCommon.apbctNoticeDismissSuccess +\n '

');\n setTimeout(function() {\n jQuery('#apbct-notice-dismiss-success').fadeOut();\n }, 2000);\n }\n });\n\n // Notice when deleting user\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\n e.preventDefault();\n\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n if (result) {\n window.location = this.href;\n }\n });\n\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\n if (btnForceProtectionOn) {\n btnForceProtectionOn.addEventListener('click', function(e) {\n if (btnForceProtectionOn.checked) {\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\n\n if (!result) {\n e.preventDefault();\n }\n }\n });\n }\n // Restore spam order\n $('.apbct-restore-spam-order-button').click(function() {\n const spmOrderId = $(this).data('spam-order-id');\n let data = {\n action: 'apbct_restore_spam_order',\n _ajax_nonce: ctAdminCommon._ajax_nonce,\n order_id: spmOrderId,\n };\n $.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n success: function(result) {\n if (result.success) {\n window.location.reload();\n } else {\n alert(result.data.message);\n }\n },\n });\n });\n\n // Deactivation banner\n jQuery('#deactivate-cleantalk-spam-protect').on('click', function(e) {\n e.preventDefault();\n let deactivationLink = this.getAttribute('href');\n if ( typeof cleantalkModal !== 'undefined' && ctAdminCommon.deactivation_banner_is_needed === '1') {\n // force replace raw link to the href - fix for https://doboard.com/1/task/10192\n bannertText = ctAdminCommon.deactivation_banner_text\n .replace(/(https?:\\/\\/[^\\s]+)/g, '$1');\n const modalHTML = `\n
\n ${bannertText}\n
\n \n `;\n // look ahead ^ deactivationLink in the href was broken after modal handler URL converison\n cleantalkModal.loaded = modalHTML;\n // ignore URL conversions due modal handler\n cleantalkModal.ignoreURLConvert = true;\n cleantalkModal.open();\n } else {\n window.location.href = deactivationLink;\n }\n });\n\n // Email decoder example\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\n let encodedEmailNode = document.querySelector('[data-original-string]');\n if (encodedEmailNode) {\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\n encodedEmailNode.style.cursor = 'pointer';\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n ctDecorationSelectorActions();\n});\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler() {\n document.body.classList.add('apbct-popup-fade');\n let encoderPopup = document.getElementById('apbct_popup');\n\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctAdminCommon.plugin_name;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctAdminCommon.plugin_name + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {HTMLElement} encodedEmailNode\n */\nfunction apbctAjaxEmailDecodeBulk(encodedEmailNode) {\n const encodedEmail = encodedEmailNode.dataset.originalString;\n let data = {\n encodedEmails: JSON.stringify({0: encodedEmail}),\n };\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n jQuery(encodedEmailNode).append(apbctTooltip);\n\n apbct_admin_sendAJAX(\n {\n 'action': 'apbct_decode_email',\n 'encodedEmails': data.encodedEmails,\n },\n {\n 'callback': function(result) {\n apbctEmailEncoderCallbackBulk(result, encodedEmailNode);\n },\n 'notJson': true,\n },\n );\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNode\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNode) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n let email = result.data[0].decoded_email;\n\n // change text\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n // handle second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n secondNode.innerText = 'Happy conversations!';\n // remove animation\n popup.querySelector('.apbct-ee-animation-wrapper').remove();\n // remove second node\n popup.querySelector('#apbct_email_ecoder__popup_text_node_second').remove();\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNode, result);\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }, 3000);\n } else {\n console.log('result', result);\n }\n}\n\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNode\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNode, decodingResult) {\n let currentResultData = decodingResult.data[0].decoded_email;\n encodedEmailNode.classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n encodedEmailNode.setAttribute('title', '');\n encodedEmailNode.removeAttribute('style');\n ctFillDecodedEmail(encodedEmailNode, currentResultData);\n }, 2000);\n encodedEmailNode.removeEventListener('click', ctFillDecodedEmailHandler);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n jQuery(target).html(\n jQuery(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_admin_sendAJAX(data, params, obj) {\n // Default params\n let callback = params.callback || null;\n let callbackContext = params.callback_context || null;\n let callbackParams = params.callback_params || null;\n let async = params.async || true;\n let notJson = params.notJson || null;\n let timeout = params.timeout || 15000;\n var obj = obj || null; // eslint-disable-line no-var\n let button = params.button || null;\n let spinner = params.spinner || null;\n let progressbar = params.progressbar || null;\n\n if (typeof (data) === 'string') {\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n } else {\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if (button) {\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\n }\n if (spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n async: async,\n success: function(result) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n if (!notJson) result = JSON.parse(result);\n if (result.error) {\n setTimeout(function() {\n if (progressbar) progressbar.fadeOut('slow');\n }, 1000);\n if ( typeof cleantalkModal !== 'undefined' ) {\n // Show the result by modal\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\n cleantalkModal.open();\n } else {\n alert('Error happens: ' + (result.error || 'Unkown'));\n }\n } else {\n if (callback) {\n if (callbackParams) {\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\n } else {\n callback(result, data, params, obj);\n }\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n },\n timeout: timeout,\n });\n}\n/**\n* @return {void}\n */\nfunction ctDecorationSelectorActions() {\n const selector = document.querySelector('#apbct_setting_comments__form_decoration_selector');\n const colorPicker = document.querySelector('#apbct_setting_comments__form_decoration_color');\n const headingText = document.querySelector('#apbct_setting_comments__form_decoration_text');\n const defaultThemeExpectedValue = 'Default Theme';\n if (colorPicker && headingText && selector) {\n if (selector.value === defaultThemeExpectedValue) {\n colorPicker.setAttribute('disabled', 'disabled');\n headingText.setAttribute('disabled', 'disabled');\n }\n selector.addEventListener('change', function(event) {\n const selectedValue = event.target.value;\n if (selectedValue && selectedValue.length > 0 && selectedValue === defaultThemeExpectedValue) {\n colorPicker.setAttribute('disabled', 'disabled');\n headingText.setAttribute('disabled', 'disabled');\n } else {\n colorPicker.removeAttribute('disabled');\n headingText.removeAttribute('disabled');\n }\n });\n }\n}\n"],"names":["ctFillDecodedEmailHandler","document","body","classList","add","let","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","getElementById","setAttribute","innerHTML","ctAdminCommon","plugin_name","waitingPopup","createElement","popupHeader","innerText","append","style","color","id","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","encodedEmailNode","animationElements","animationWrapper","i","length","apbctEEAnimationDogOne","encodedEmail","dataset","originalString","data","encodedEmails","JSON","stringify","0","apbctTooltip","jQuery","apbct_admin_sendAJAX","action","callback","result","apbctEmailEncoderCallbackBulk","notJson","success","is_allowed","setTimeout","firstNode","button","email","decoded_email","popup","querySelector","selectableEmail","title","outerHTML","remove","buttonWrapper","addEventListener","fillDecodedEmails","console","log","decodingResult","currentResultData","removeAttribute","ctFillDecodedEmail","removeEventListener","target","html","replace","params","obj","callbackContext","callback_context","callbackParams","callback_params","async","timeout","spinner","progressbar","_ajax_nonce","Math","random","no_cache","cursor","css","ajax","type","url","_ajax_url","parse","error","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","ctDecorationSelectorActions","selector","colorPicker","headingText","defaultThemeExpectedValue","value","event","selectedValue","ready","$","on","ctDate","Date","getTime","ctSecure","location","protocol","cookie","toUTCString","e","parent","siblings","click","apbctNoticeName","attr","notice_id","after","apbctNoticeDismissSuccess","preventDefault","confirm","notice_when_deleting_user_text","window","this","href","btnForceProtectionOn","checked","apbctNoticeForceProtectionOn","spmOrderId","order_id","reload","message","modalHTML","deactivationLink","getAttribute","deactivation_banner_is_needed","bannertText","deactivation_banner_text","ignoreURLConvert","includes"],"mappings":"AA+HA,SAASA,4BACLC,SAASC,KAAK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,CAE/B,CAAC,EAGGX,OAAOhB,SAASkB,KAAKe,SAAS,oCAAoC,IAC9DjI,EAAmBzB,SAASuD,cAAc,wBAAwB,MAElE1C,cAAcY,iBAAmBA,GAChBL,MAAMmE,OAAS,UAChC9D,EAAiBoC,iBAAiB,QAAS9D,yBAAyB,GAI5E2G,4BAA4B,CAChC,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-comments-checkspam.min.js.map b/js/cleantalk-comments-checkspam.min.js.map index ecbf5fe3..d78e2fde 100644 --- a/js/cleantalk-comments-checkspam.min.js.map +++ b/js/cleantalk-comments-checkspam.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\r\nString.prototype.printf = function() { // eslint-disable-line no-extend-native\r\n let formatted = this;\r\n for ( let arg in arguments ) { // eslint-disable-line guard-for-in,prefer-rest-params\r\n let beforeFormatted = formatted.substring(0, formatted.indexOf('%s', 0));\r\n let afterFormatted = formatted.substring(formatted.indexOf('%s', 0)+2, formatted.length);\r\n // eslint-disable-next-line guard-for-in,prefer-rest-params\r\n formatted = beforeFormatted + arguments[arg] + afterFormatted;\r\n }\r\n return formatted;\r\n};\r\n\r\n// Flags\r\nlet ctWorking = false;\r\nlet ctNewCheck = true;\r\nlet ctCoolingDownFlag = false;\r\nlet ctCloseAnimate = true;\r\nlet ctAccurateCheck = false;\r\nlet ctPause = false;\r\nlet ctPrevAccurate = ctCommentsCheck.ct_prev_accurate;\r\nlet ctPrevFrom = ctCommentsCheck.ct_prev_from;\r\nlet ctPrevTill = ctCommentsCheck.ct_prev_till;\r\n// Settings\r\nlet ctCoolDownTime = 90000;\r\nlet ctRequestsCounter = 0;\r\nlet ctMaxRequests = 60;\r\n// Variables\r\nlet ctAjaxNonce = ctCommentsCheck.ct_ajax_nonce;\r\nlet ctCommentsTotal = 0;\r\nlet ctCommentsChecked = 0;\r\nlet ctCommentsSpam = 0;\r\nlet ctCommentsBad = 0;\r\nlet ctUnchecked = 'unset';\r\nlet ctDateFrom = 0;\r\nlet ctDateTill = 0;\r\n\r\n/**\r\n * @param {mixed} to\r\n * @param {string} id\r\n */\r\nfunction animateComment(to, id) { // eslint-disable-line no-unused-vars\r\n if (ctCloseAnimate) {\r\n if (to==0.3) {\r\n jQuery('#comment-'+id).fadeTo(200, to, function() {\r\n animateComment(1, id);\r\n });\r\n } else {\r\n jQuery('#comment-'+id).fadeTo(200, to, function() {\r\n animateComment(0.3, id);\r\n });\r\n }\r\n } else {\r\n ctCloseAnimate =true;\r\n }\r\n}\r\n\r\n/**\r\n * clear comments\r\n */\r\nfunction ctClearComments() {\r\n let from = 0; let till = 0;\r\n if (jQuery('#ct_allow_date_range').is(':checked')) {\r\n from = jQuery('#ct_date_range_from').val();\r\n till = jQuery('#ct_date_range_till').val();\r\n }\r\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\r\n document.cookie = 'apbct_check_comments_offset' + '=' + 0 + '; path=/; samesite=lax' + ctSecure;\r\n\r\n let data = {\r\n 'action': 'ajax_clear_comments',\r\n 'security': ctAjaxNonce,\r\n 'from': from,\r\n 'till': till,\r\n };\r\n\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ajaxurl,\r\n data: data,\r\n success: function(msg) {\r\n ctShowInfo();\r\n ctSendComments();\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Continues the check after cooldown time\r\n * Called by ct_send_users();\r\n */\r\nfunction ctCoolingDownToggle() {\r\n ctCoolingDownFlag = false;\r\n ctSendComments();\r\n ctShowInfo();\r\n}\r\n\r\n/**\r\n * send comments\r\n */\r\nfunction ctSendComments() {\r\n if (ctCoolingDownFlag === true) {\r\n return;\r\n }\r\n\r\n if (ctRequestsCounter >= ctMaxRequests) {\r\n setTimeout(ctCoolingDownToggle, ctCoolDownTime);\r\n ctRequestsCounter = 0;\r\n ctCoolingDownFlag = true;\r\n return;\r\n } else {\r\n ctRequestsCounter++;\r\n }\r\n\r\n let data = {\r\n 'action': 'ajax_check_comments',\r\n 'security': ctAjaxNonce,\r\n 'new_check': ctNewCheck,\r\n 'unchecked': ctUnchecked,\r\n 'offset': Number(ctGetCookie('apbct_check_comments_offset')),\r\n };\r\n\r\n if (ctAccurateCheck) {\r\n data['accurate_check'] = true;\r\n }\r\n\r\n if (ctDateFrom && ctDateTill) {\r\n data['from'] = ctDateFrom;\r\n data['till'] = ctDateTill;\r\n }\r\n\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ajaxurl,\r\n data: data,\r\n success: function(msg) {\r\n msg = jQuery.parseJSON(msg);\r\n\r\n if (parseInt(msg.error)) {\r\n ctWorking = false;\r\n if (!confirm(msg.error_message+'. Do you want to proceed?')) {\r\n let newHref = 'edit-comments.php?page=ct_check_spam';\r\n if (ctDateFrom != 0 && ctDateTill != 0) {\r\n newHref+='&from='+ctDateFrom+'&till='+ctDateTill;\r\n }\r\n location.href = newHref;\r\n } else {\r\n ctSendComments();\r\n }\r\n } else {\r\n ctNewCheck = false;\r\n let offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\r\n\r\n if (parseInt(msg.end) == 1 || ctPause === true) {\r\n if (parseInt(msg.end) == 1) {\r\n document.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\r\n }\r\n ctWorking = false;\r\n jQuery('#ct_working_message').hide();\r\n let newHref = 'edit-comments.php?page=ct_check_spam';\r\n if (ctDateFrom != 0 && ctDateTill != 0) {\r\n newHref+='&from='+ctDateFrom+'&till='+ctDateTill;\r\n }\r\n\r\n document.cookie = 'apbct_check_comments_offset' + '=' + offset + '; path=/; samesite=lax'+ctSecure;\r\n\r\n location.href = newHref;\r\n } else if (parseInt(msg.end) == 0) {\r\n ctCommentsChecked += msg.checked;\r\n ctCommentsSpam += msg.spam;\r\n ctCommentsBad += msg.bad;\r\n ctCommentsTotal += msg.total;\r\n ctUnchecked = ctCommentsTotal - ctCommentsChecked - ctCommentsBad;\r\n let statusString = String(ctCommentsCheck.ct_status_string);\r\n statusString = statusString.printf(ctCommentsChecked, ctCommentsSpam, ctCommentsBad);\r\n if (parseInt(ctCommentsSpam) > 0) {\r\n statusString += ctCommentsCheck.ct_status_string_warning;\r\n }\r\n jQuery('#ct_checking_status').html(statusString);\r\n jQuery('#ct_error_message').hide();\r\n // If DB woks not properly\r\n if (+ctCommentsTotal < ctCommentsChecked + ctCommentsBad) {\r\n document.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\r\n location.href = 'edit-comments.php?page=ct_check_spam';\r\n }\r\n\r\n document.cookie = 'apbct_check_comments_offset' + '=' + offset + '; path=/; samesite=lax'+ctSecure;\r\n\r\n ctSendComments();\r\n }\r\n }\r\n },\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n jQuery('#ct_error_message').show();\r\n jQuery('#cleantalk_ajax_error').html(textStatus);\r\n jQuery('#cleantalk_js_func').html('Check comments');\r\n setTimeout(ctSendComments(), 3000);\r\n },\r\n timeout: 25000,\r\n });\r\n}\r\n\r\n/**\r\n * show info\r\n */\r\nfunction ctShowInfo() {\r\n if (ctWorking) {\r\n if (ctCoolingDownFlag == true) {\r\n jQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\r\n jQuery('#ct_cooling_notice').show();\r\n return;\r\n } else {\r\n jQuery('#ct_cooling_notice').hide();\r\n }\r\n\r\n if (!ctCommentsTotal) {\r\n let data = {\r\n 'action': 'ajax_info_comments',\r\n 'security': ctAjaxNonce,\r\n };\r\n\r\n if (ctDateFrom && ctDateTill) {\r\n data['from'] = ctDateFrom;\r\n data['till'] = ctDateTill;\r\n }\r\n\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ajaxurl,\r\n data: data,\r\n success: function(msg) {\r\n msg = jQuery.parseJSON(msg);\r\n jQuery('#ct_checking_status').html(msg.message);\r\n ctCommentsTotal = msg.total;\r\n ctCommentsSpam = msg.spam;\r\n ctCommentsChecked = msg.checked;\r\n ctCommentsBad = msg.bad;\r\n },\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n jQuery('#ct_error_message').show();\r\n jQuery('#cleantalk_ajax_error').html(textStatus);\r\n jQuery('#cleantalk_js_func').html('Check comments');\r\n setTimeout(ctShowInfo(), 3000);\r\n },\r\n timeout: 15000,\r\n });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Function to toggle dependences\r\n *\r\n * @param {object} obj\r\n * @param {mixed} secondary\r\n */\r\nfunction ctToggleDepended(obj, secondary) { // eslint-disable-line no-unused-vars\r\n secondary = secondary || null;\r\n\r\n let depended = jQuery(obj.data('depended'));\r\n let state = obj.data('state');\r\n\r\n if (!state && !secondary) {\r\n obj.data('state', true);\r\n depended.removeProp('disabled');\r\n } else {\r\n obj.data('state', false);\r\n depended.prop('disabled', true);\r\n depended.removeProp('checked');\r\n if (depended.data('depended')) {\r\n ctToggleDepended(depended, true);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * trash all\r\n *\r\n * @param {object} e\r\n */\r\nfunction ctTrashAll( e ) {\r\n let data = {\r\n 'action': 'ajax_trash_all',\r\n 'security': ctAjaxNonce,\r\n };\r\n\r\n jQuery('.' + e.target.id).addClass('disabled');\r\n jQuery('.spinner').css('visibility', 'visible');\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ajaxurl,\r\n data: data,\r\n success: function( msg ) {\r\n if ( msg > 0 ) {\r\n jQuery('#cleantalk_comments_left').html(msg);\r\n ctTrashAll( e );\r\n } else {\r\n jQuery('.' + e.target.id).removeClass('disabled');\r\n jQuery('.spinner').css('visibility', 'hidden');\r\n location.href='edit-comments.php?page=ct_check_spam';\r\n }\r\n },\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n jQuery('#ct_error_message').show();\r\n jQuery('#cleantalk_ajax_error').html(textStatus);\r\n jQuery('#cleantalk_js_func').html('Check comments');\r\n setTimeout(ctTrashAll( e ), 3000);\r\n },\r\n timeout: 25000,\r\n });\r\n}\r\n\r\n/**\r\n * spam all\r\n *\r\n * @param {object} e\r\n */\r\nfunction ctSpamAll( e ) {\r\n let data = {\r\n 'action': 'ajax_spam_all',\r\n 'security': ctAjaxNonce,\r\n };\r\n\r\n jQuery('.' + e.target.id).addClass('disabled');\r\n jQuery('.spinner').css('visibility', 'visible');\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ajaxurl,\r\n data: data,\r\n success: function( msg ) {\r\n if ( msg > 0 ) {\r\n jQuery('#cleantalk_comments_left').html(msg);\r\n ctSpamAll( e );\r\n } else {\r\n jQuery('.' + e.target.id).removeClass('disabled');\r\n jQuery('.spinner').css('visibility', 'hidden');\r\n location.href='edit-comments.php?page=ct_check_spam';\r\n }\r\n },\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n jQuery('#ct_error_message').show();\r\n jQuery('#cleantalk_ajax_error').html(textStatus);\r\n jQuery('#cleantalk_js_func').html('Check comments');\r\n setTimeout(ctSpamAll( e ), 3000);\r\n },\r\n timeout: 25000,\r\n });\r\n}\r\n\r\njQuery(document).ready(function() {\r\n // Prev check parameters\r\n if (ctPrevAccurate) {\r\n jQuery('#ct_accurate_check').prop('checked', true);\r\n }\r\n if (ctPrevFrom) {\r\n jQuery('#ct_allow_date_range').prop('checked', true).data('state', true);\r\n jQuery('#ct_date_range_from').removeProp('disabled').val(ctPrevFrom);\r\n jQuery('#ct_date_range_till').removeProp('disabled').val(ctPrevTill);\r\n }\r\n\r\n // Toggle dependences\r\n jQuery('#ct_allow_date_range').on('change', function() {\r\n document.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\r\n document.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\r\n if ( this.checked ) {\r\n document.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\r\n jQuery('.ct_date').prop('checked', true).attr('disabled', false);\r\n } else {\r\n document.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\r\n jQuery('.ct_date').prop('disabled', true).attr('disabled', true);\r\n }\r\n });\r\n\r\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\r\n var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker( // eslint-disable-line no-var\r\n {\r\n dateFormat: 'M d yy',\r\n maxDate: '+0D',\r\n changeMonth: true,\r\n changeYear: true,\r\n showAnim: 'slideDown',\r\n onSelect: function(selectedDate) {\r\n let option = this.id == 'ct_date_range_from' ? 'minDate' : 'maxDate';\r\n let instance = jQuery( this ).data( 'datepicker' );\r\n let date = jQuery.datepicker.parseDate(\r\n instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\r\n selectedDate, instance.settings);\r\n dates.not(this).datepicker('option', option, date);\r\n document.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\r\n document.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\r\n },\r\n },\r\n );\r\n\r\n // eslint-disable-next-line require-jsdoc\r\n function ctStartCheck(continueCheck) {\r\n continueCheck = continueCheck || null;\r\n\r\n if (jQuery('#ct_allow_date_range').is(':checked')) {\r\n ctDateFrom = jQuery('#ct_date_range_from').val();\r\n ctDateTill = jQuery('#ct_date_range_till').val();\r\n\r\n if (!(ctDateFrom != '' && ctDateTill != '')) {\r\n alert('Please, specify a date range.');\r\n return;\r\n }\r\n }\r\n\r\n if (jQuery('#ct_accurate_check').is(':checked')) {\r\n ctAccurateCheck = true;\r\n }\r\n\r\n if (\r\n jQuery('#ct_accurate_check').is(':checked') &&\r\n ! jQuery('#ct_allow_date_range').is(':checked')\r\n ) {\r\n alert('Please, select a date range.');\r\n return;\r\n }\r\n\r\n jQuery('.ct_to_hide').hide();\r\n jQuery('#ct_working_message').show();\r\n jQuery('#ct_preloader').show();\r\n jQuery('#ct_pause').show();\r\n\r\n ctWorking = true;\r\n\r\n if (continueCheck) {\r\n ctShowInfo();\r\n ctSendComments();\r\n } else {\r\n ctClearComments();\r\n }\r\n }\r\n\r\n // Check comments\r\n jQuery('#ct_check_spam_button').click(function() {\r\n document.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\r\n ctStartCheck(false);\r\n });\r\n jQuery('#ct_proceed_check_button').click(function() {\r\n ctStartCheck(true);\r\n });\r\n\r\n // Pause the check\r\n jQuery('#ct_pause').on('click', function() {\r\n ctPause = true;\r\n let ctCheck = {\r\n 'accurate': ctAccurateCheck,\r\n 'from': ctDateFrom,\r\n 'till': ctDateTill,\r\n };\r\n document.cookie = 'ct_paused_spam_check=' + JSON.stringify(ctCheck) + '; path=/; samesite=lax';\r\n });\r\n\r\n\r\n if (ctCommentsCheck.start === '1') {\r\n document.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\r\n jQuery('#ct_check_spam_button').click();\r\n }\r\n\r\n // Delete all spam comments\r\n jQuery('.ct_trash_all').click(function( e ) {\r\n if (!confirm(ctCommentsCheck.ct_confirm_trash_all)) {\r\n return false;\r\n }\r\n\r\n ctTrashAll( e );\r\n });\r\n\r\n // Mark as spam all spam comments\r\n jQuery('.ct_spam_all').click(function( e ) {\r\n if (!confirm(ctCommentsCheck.ct_confirm_spam_all)) {\r\n return false;\r\n }\r\n\r\n ctSpamAll( e );\r\n });\r\n\r\n /**\r\n * Checked ct_accurate_check\r\n */\r\n jQuery('#ct_accurate_check').change(function() {\r\n if (this.checked) {\r\n jQuery('#ct_allow_date_range').prop('checked', true);\r\n jQuery('.ct_date').prop('checked', true).attr('disabled', false);\r\n }\r\n });\r\n});\r\n\r\n\r\n/**\r\n * Get cookie by name\r\n * @param {string} name\r\n * @return {string|undefined}\r\n */\r\nfunction ctGetCookie(name) {\r\n let matches = document.cookie.match(new RegExp(\r\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\r\n ));\r\n return matches ? decodeURIComponent(matches[1]) : undefined;\r\n}\r\n"],"names":["let","ctWorking","String","prototype","printf","formatted","this","arg","arguments","beforeFormatted","substring","indexOf","afterFormatted","length","ctNewCheck","ctCoolingDownFlag","ctCloseAnimate","ctAccurateCheck","ctPause","ctPrevAccurate","ctCommentsCheck","ct_prev_accurate","ctPrevFrom","ct_prev_from","ctPrevTill","ct_prev_till","ctCoolDownTime","ctRequestsCounter","ctMaxRequests","ctAjaxNonce","ct_ajax_nonce","ctCommentsTotal","ctCommentsChecked","ctCommentsSpam","ctCommentsBad","ctUnchecked","ctDateFrom","ctDateTill","animateComment","to","id","jQuery","fadeTo","ctClearComments","from","till","is","val","ctSecure","location","protocol","data","document","cookie","action","security","ajax","type","url","ajaxurl","success","msg","ctShowInfo","ctSendComments","ctCoolingDownToggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","parseJSON","parseInt","error","confirm","error_message","newHref","href","end","hide","checked","spam","bad","total","statusString","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ctToggleDepended","obj","secondary","depended","prop","removeProp","ctTrashAll","e","target","addClass","css","removeClass","ctSpamAll","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ctStartCheck","continueCheck","alert","click","ctCheck","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all","change"],"mappings":"AAaAA,IAAIC,UAAY,EAZhBC,OAAOC,UAAUC,OAAS,WACtBJ,IAAIK,EAAYC,KAChB,IAAMN,IAAIO,KAAOC,UAAY,CACzBR,IAAIS,EAAkBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,CAAC,CAAC,EACnEC,EAAiBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,CAAC,EAAE,EAAGN,EAAUQ,MAAM,EAEvFR,EAAYI,EAAkBD,UAAUD,GAAOK,CACnD,CACA,OAAOP,CACX,GAIIS,WAAa,CAAA,EACbC,kBAAoB,CAAA,E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3B,QAAQtD,gBAAgB+H,mBAAmB,EAC5C,MAAO,CAAA,EAGXzC,UAAWL,CAAE,CACjB,CAAC,EAKD5D,OAAO,oBAAoB,EAAE2G,OAAO,WAC5B9I,KAAK0E,UACLvC,OAAO,sBAAsB,EAAEyD,KAAK,UAAW,CAAA,CAAI,EACnDzD,OAAO,UAAU,EAAEyD,KAAK,UAAW,CAAA,CAAI,EAAEkB,KAAK,WAAY,CAAA,CAAK,EAEvE,CAAC,CACL,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function() { // eslint-disable-line no-extend-native\n let formatted = this;\n for ( let arg in arguments ) { // eslint-disable-line guard-for-in,prefer-rest-params\n let beforeFormatted = formatted.substring(0, formatted.indexOf('%s', 0));\n let afterFormatted = formatted.substring(formatted.indexOf('%s', 0)+2, formatted.length);\n // eslint-disable-next-line guard-for-in,prefer-rest-params\n formatted = beforeFormatted + arguments[arg] + afterFormatted;\n }\n return formatted;\n};\n\n// Flags\nlet ctWorking = false;\nlet ctNewCheck = true;\nlet ctCoolingDownFlag = false;\nlet ctCloseAnimate = true;\nlet ctAccurateCheck = false;\nlet ctPause = false;\nlet ctPrevAccurate = ctCommentsCheck.ct_prev_accurate;\nlet ctPrevFrom = ctCommentsCheck.ct_prev_from;\nlet ctPrevTill = ctCommentsCheck.ct_prev_till;\n// Settings\nlet ctCoolDownTime = 90000;\nlet ctRequestsCounter = 0;\nlet ctMaxRequests = 60;\n// Variables\nlet ctAjaxNonce = ctCommentsCheck.ct_ajax_nonce;\nlet ctCommentsTotal = 0;\nlet ctCommentsChecked = 0;\nlet ctCommentsSpam = 0;\nlet ctCommentsBad = 0;\nlet ctUnchecked = 'unset';\nlet ctDateFrom = 0;\nlet ctDateTill = 0;\n\n/**\n * @param {mixed} to\n * @param {string} id\n */\nfunction animateComment(to, id) { // eslint-disable-line no-unused-vars\n if (ctCloseAnimate) {\n if (to==0.3) {\n jQuery('#comment-'+id).fadeTo(200, to, function() {\n animateComment(1, id);\n });\n } else {\n jQuery('#comment-'+id).fadeTo(200, to, function() {\n animateComment(0.3, id);\n });\n }\n } else {\n ctCloseAnimate =true;\n }\n}\n\n/**\n * clear comments\n */\nfunction ctClearComments() {\n let from = 0; let till = 0;\n if (jQuery('#ct_allow_date_range').is(':checked')) {\n from = jQuery('#ct_date_range_from').val();\n till = jQuery('#ct_date_range_till').val();\n }\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = 'apbct_check_comments_offset' + '=' + 0 + '; path=/; samesite=lax' + ctSecure;\n\n let data = {\n 'action': 'ajax_clear_comments',\n 'security': ctAjaxNonce,\n 'from': from,\n 'till': till,\n };\n\n jQuery.ajax({\n type: 'POST',\n url: ajaxurl,\n data: data,\n success: function(msg) {\n ctShowInfo();\n ctSendComments();\n },\n });\n}\n\n/**\n * Continues the check after cooldown time\n * Called by ct_send_users();\n */\nfunction ctCoolingDownToggle() {\n ctCoolingDownFlag = false;\n ctSendComments();\n ctShowInfo();\n}\n\n/**\n * send comments\n */\nfunction ctSendComments() {\n if (ctCoolingDownFlag === true) {\n return;\n }\n\n if (ctRequestsCounter >= ctMaxRequests) {\n setTimeout(ctCoolingDownToggle, ctCoolDownTime);\n ctRequestsCounter = 0;\n ctCoolingDownFlag = true;\n return;\n } else {\n ctRequestsCounter++;\n }\n\n let data = {\n 'action': 'ajax_check_comments',\n 'security': ctAjaxNonce,\n 'new_check': ctNewCheck,\n 'unchecked': ctUnchecked,\n 'offset': Number(ctGetCookie('apbct_check_comments_offset')),\n };\n\n if (ctAccurateCheck) {\n data['accurate_check'] = true;\n }\n\n if (ctDateFrom && ctDateTill) {\n data['from'] = ctDateFrom;\n data['till'] = ctDateTill;\n }\n\n jQuery.ajax({\n type: 'POST',\n url: ajaxurl,\n data: data,\n success: function(msg) {\n msg = jQuery.parseJSON(msg);\n\n if (parseInt(msg.error)) {\n ctWorking = false;\n if (!confirm(msg.error_message+'. Do you want to proceed?')) {\n let newHref = 'edit-comments.php?page=ct_check_spam';\n if (ctDateFrom != 0 && ctDateTill != 0) {\n newHref+='&from='+ctDateFrom+'&till='+ctDateTill;\n }\n location.href = newHref;\n } else {\n ctSendComments();\n }\n } else {\n ctNewCheck = false;\n let offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\n if (parseInt(msg.end) == 1 || ctPause === true) {\n if (parseInt(msg.end) == 1) {\n document.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n }\n ctWorking = false;\n jQuery('#ct_working_message').hide();\n let newHref = 'edit-comments.php?page=ct_check_spam';\n if (ctDateFrom != 0 && ctDateTill != 0) {\n newHref+='&from='+ctDateFrom+'&till='+ctDateTill;\n }\n\n document.cookie = 'apbct_check_comments_offset' + '=' + offset + '; path=/; samesite=lax'+ctSecure;\n\n location.href = newHref;\n } else if (parseInt(msg.end) == 0) {\n ctCommentsChecked += msg.checked;\n ctCommentsSpam += msg.spam;\n ctCommentsBad += msg.bad;\n ctCommentsTotal += msg.total;\n ctUnchecked = ctCommentsTotal - ctCommentsChecked - ctCommentsBad;\n let statusString = String(ctCommentsCheck.ct_status_string);\n statusString = statusString.printf(ctCommentsChecked, ctCommentsSpam, ctCommentsBad);\n if (parseInt(ctCommentsSpam) > 0) {\n statusString += ctCommentsCheck.ct_status_string_warning;\n }\n jQuery('#ct_checking_status').html(statusString);\n jQuery('#ct_error_message').hide();\n // If DB woks not properly\n if (+ctCommentsTotal < ctCommentsChecked + ctCommentsBad) {\n document.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n location.href = 'edit-comments.php?page=ct_check_spam';\n }\n\n document.cookie = 'apbct_check_comments_offset' + '=' + offset + '; path=/; samesite=lax'+ctSecure;\n\n ctSendComments();\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n jQuery('#ct_error_message').show();\n jQuery('#cleantalk_ajax_error').html(textStatus);\n jQuery('#cleantalk_js_func').html('Check comments');\n setTimeout(ctSendComments(), 3000);\n },\n timeout: 25000,\n });\n}\n\n/**\n * show info\n */\nfunction ctShowInfo() {\n if (ctWorking) {\n if (ctCoolingDownFlag == true) {\n jQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n jQuery('#ct_cooling_notice').show();\n return;\n } else {\n jQuery('#ct_cooling_notice').hide();\n }\n\n if (!ctCommentsTotal) {\n let data = {\n 'action': 'ajax_info_comments',\n 'security': ctAjaxNonce,\n };\n\n if (ctDateFrom && ctDateTill) {\n data['from'] = ctDateFrom;\n data['till'] = ctDateTill;\n }\n\n jQuery.ajax({\n type: 'POST',\n url: ajaxurl,\n data: data,\n success: function(msg) {\n msg = jQuery.parseJSON(msg);\n jQuery('#ct_checking_status').html(msg.message);\n ctCommentsTotal = msg.total;\n ctCommentsSpam = msg.spam;\n ctCommentsChecked = msg.checked;\n ctCommentsBad = msg.bad;\n },\n error: function(jqXHR, textStatus, errorThrown) {\n jQuery('#ct_error_message').show();\n jQuery('#cleantalk_ajax_error').html(textStatus);\n jQuery('#cleantalk_js_func').html('Check comments');\n setTimeout(ctShowInfo(), 3000);\n },\n timeout: 15000,\n });\n }\n }\n}\n\n/**\n * Function to toggle dependences\n *\n * @param {object} obj\n * @param {mixed} secondary\n */\nfunction ctToggleDepended(obj, secondary) { // eslint-disable-line no-unused-vars\n secondary = secondary || null;\n\n let depended = jQuery(obj.data('depended'));\n let state = obj.data('state');\n\n if (!state && !secondary) {\n obj.data('state', true);\n depended.removeProp('disabled');\n } else {\n obj.data('state', false);\n depended.prop('disabled', true);\n depended.removeProp('checked');\n if (depended.data('depended')) {\n ctToggleDepended(depended, true);\n }\n }\n}\n\n/**\n * trash all\n *\n * @param {object} e\n */\nfunction ctTrashAll( e ) {\n let data = {\n 'action': 'ajax_trash_all',\n 'security': ctAjaxNonce,\n };\n\n jQuery('.' + e.target.id).addClass('disabled');\n jQuery('.spinner').css('visibility', 'visible');\n jQuery.ajax({\n type: 'POST',\n url: ajaxurl,\n data: data,\n success: function( msg ) {\n if ( msg > 0 ) {\n jQuery('#cleantalk_comments_left').html(msg);\n ctTrashAll( e );\n } else {\n jQuery('.' + e.target.id).removeClass('disabled');\n jQuery('.spinner').css('visibility', 'hidden');\n location.href='edit-comments.php?page=ct_check_spam';\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n jQuery('#ct_error_message').show();\n jQuery('#cleantalk_ajax_error').html(textStatus);\n jQuery('#cleantalk_js_func').html('Check comments');\n setTimeout(ctTrashAll( e ), 3000);\n },\n timeout: 25000,\n });\n}\n\n/**\n * spam all\n *\n * @param {object} e\n */\nfunction ctSpamAll( e ) {\n let data = {\n 'action': 'ajax_spam_all',\n 'security': ctAjaxNonce,\n };\n\n jQuery('.' + e.target.id).addClass('disabled');\n jQuery('.spinner').css('visibility', 'visible');\n jQuery.ajax({\n type: 'POST',\n url: ajaxurl,\n data: data,\n success: function( msg ) {\n if ( msg > 0 ) {\n jQuery('#cleantalk_comments_left').html(msg);\n ctSpamAll( e );\n } else {\n jQuery('.' + e.target.id).removeClass('disabled');\n jQuery('.spinner').css('visibility', 'hidden');\n location.href='edit-comments.php?page=ct_check_spam';\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n jQuery('#ct_error_message').show();\n jQuery('#cleantalk_ajax_error').html(textStatus);\n jQuery('#cleantalk_js_func').html('Check comments');\n setTimeout(ctSpamAll( e ), 3000);\n },\n timeout: 25000,\n });\n}\n\njQuery(document).ready(function() {\n // Prev check parameters\n if (ctPrevAccurate) {\n jQuery('#ct_accurate_check').prop('checked', true);\n }\n if (ctPrevFrom) {\n jQuery('#ct_allow_date_range').prop('checked', true).data('state', true);\n jQuery('#ct_date_range_from').removeProp('disabled').val(ctPrevFrom);\n jQuery('#ct_date_range_till').removeProp('disabled').val(ctPrevTill);\n }\n\n // Toggle dependences\n jQuery('#ct_allow_date_range').on('change', function() {\n document.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n document.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n if ( this.checked ) {\n document.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n jQuery('.ct_date').prop('checked', true).attr('disabled', false);\n } else {\n document.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n jQuery('.ct_date').prop('disabled', true).attr('disabled', true);\n }\n });\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker( // eslint-disable-line no-var\n {\n dateFormat: 'M d yy',\n maxDate: '+0D',\n changeMonth: true,\n changeYear: true,\n showAnim: 'slideDown',\n onSelect: function(selectedDate) {\n let option = this.id == 'ct_date_range_from' ? 'minDate' : 'maxDate';\n let instance = jQuery( this ).data( 'datepicker' );\n let date = jQuery.datepicker.parseDate(\n instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n selectedDate, instance.settings);\n dates.not(this).datepicker('option', option, date);\n document.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n document.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n },\n },\n );\n\n // eslint-disable-next-line require-jsdoc\n function ctStartCheck(continueCheck) {\n continueCheck = continueCheck || null;\n\n if (jQuery('#ct_allow_date_range').is(':checked')) {\n ctDateFrom = jQuery('#ct_date_range_from').val();\n ctDateTill = jQuery('#ct_date_range_till').val();\n\n if (!(ctDateFrom != '' && ctDateTill != '')) {\n alert('Please, specify a date range.');\n return;\n }\n }\n\n if (jQuery('#ct_accurate_check').is(':checked')) {\n ctAccurateCheck = true;\n }\n\n if (\n jQuery('#ct_accurate_check').is(':checked') &&\n ! jQuery('#ct_allow_date_range').is(':checked')\n ) {\n alert('Please, select a date range.');\n return;\n }\n\n jQuery('.ct_to_hide').hide();\n jQuery('#ct_working_message').show();\n jQuery('#ct_preloader').show();\n jQuery('#ct_pause').show();\n\n ctWorking = true;\n\n if (continueCheck) {\n ctShowInfo();\n ctSendComments();\n } else {\n ctClearComments();\n }\n }\n\n // Check comments\n jQuery('#ct_check_spam_button').click(function() {\n document.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n ctStartCheck(false);\n });\n jQuery('#ct_proceed_check_button').click(function() {\n ctStartCheck(true);\n });\n\n // Pause the check\n jQuery('#ct_pause').on('click', function() {\n ctPause = true;\n let ctCheck = {\n 'accurate': ctAccurateCheck,\n 'from': ctDateFrom,\n 'till': ctDateTill,\n };\n document.cookie = 'ct_paused_spam_check=' + JSON.stringify(ctCheck) + '; path=/; samesite=lax';\n });\n\n\n if (ctCommentsCheck.start === '1') {\n document.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n jQuery('#ct_check_spam_button').click();\n }\n\n // Delete all spam comments\n jQuery('.ct_trash_all').click(function( e ) {\n if (!confirm(ctCommentsCheck.ct_confirm_trash_all)) {\n return false;\n }\n\n ctTrashAll( e );\n });\n\n // Mark as spam all spam comments\n jQuery('.ct_spam_all').click(function( e ) {\n if (!confirm(ctCommentsCheck.ct_confirm_spam_all)) {\n return false;\n }\n\n ctSpamAll( e );\n });\n\n /**\n * Checked ct_accurate_check\n */\n jQuery('#ct_accurate_check').change(function() {\n if (this.checked) {\n jQuery('#ct_allow_date_range').prop('checked', true);\n jQuery('.ct_date').prop('checked', true).attr('disabled', false);\n }\n });\n});\n\n\n/**\n * Get cookie by name\n * @param {string} name\n * @return {string|undefined}\n */\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n"],"names":["let","ctWorking","String","prototype","printf","formatted","this","arg","arguments","beforeFormatted","substring","indexOf","afterFormatted","length","ctNewCheck","ctCoolingDownFlag","ctCloseAnimate","ctAccurateCheck","ctPause","ctPrevAccurate","ctCommentsCheck","ct_prev_accurate","ctPrevFrom","ct_prev_from","ctPrevTill","ct_prev_till","ctCoolDownTime","ctRequestsCounter","ctMaxRequests","ctAjaxNonce","ct_ajax_nonce","ctCommentsTotal","ctCommentsChecked","ctCommentsSpam","ctCommentsBad","ctUnchecked","ctDateFrom","ctDateTill","animateComment","to","id","jQuery","fadeTo","ctClearComments","from","till","is","val","ctSecure","location","protocol","data","document","cookie","action","security","ajax","type","url","ajaxurl","success","msg","ctShowInfo","ctSendComments","ctCoolingDownToggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","parseJSON","parseInt","error","confirm","error_message","newHref","href","end","hide","checked","spam","bad","total","statusString","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ctToggleDepended","obj","secondary","depended","prop","removeProp","ctTrashAll","e","target","addClass","css","removeClass","ctSpamAll","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ctStartCheck","continueCheck","alert","click","ctCheck","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all","change"],"mappings":"AAaAA,IAAIC,UAAY,EAZhBC,OAAOC,UAAUC,OAAS,WACtBJ,IAAIK,EAAYC,KAChB,IAAMN,IAAIO,KAAOC,UAAY,CACzBR,IAAIS,EAAkBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,CAAC,CAAC,EACnEC,EAAiBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,CAAC,EAAE,EAAGN,EAAUQ,MAAM,EAEvFR,EAAYI,EAAkBD,UAAUD,GAAOK,CACnD,CACA,OAAOP,CACX,GAIIS,WAAa,CAAA,EACbC,kBAAoB,CAAA,EACpBC,eAAiB,CAAA,EACjBC,gBAAkB,CAAA,EAClBC,QA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EAGXzC,UAAWL,CAAE,CACjB,CAAC,EAKD5D,OAAO,oBAAoB,EAAE2G,OAAO,WAC5B9I,KAAK0E,UACLvC,OAAO,sBAAsB,EAAEyD,KAAK,UAAW,CAAA,CAAI,EACnDzD,OAAO,UAAU,EAAEyD,KAAK,UAAW,CAAA,CAAI,EAAEkB,KAAK,WAAY,CAAA,CAAK,EAEvE,CAAC,CACL,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-comments-editscreen.min.js.map b/js/cleantalk-comments-editscreen.min.js.map index 88f3f8a3..67782f63 100644 --- a/js/cleantalk-comments-editscreen.min.js.map +++ b/js/cleantalk-comments-editscreen.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-comments-editscreen.min.js","sources":["cleantalk-comments-editscreen.js"],"sourcesContent":["function ct_is_email(str){\r\n\treturn str.search(/.*@.*\\..*/);\r\n}\r\nfunction ct_is_ip(str){\r\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\t/* Shows link to blacklists near every email and IP address */\r\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\r\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\r\n\t\t\tvar ct_curr_str = jQuery(this).html();\r\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\r\n\t\t\t\tjQuery(this).after(' ');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t/* Feedback for comments */\r\n\tvar ct_comment_id;\r\n\r\n\t// For approved\r\n\tjQuery('span.approve').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tundo_comment_id = ct_comment_id;\r\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\r\n\t});\r\n\r\n\t// For unapprove\r\n\tjQuery('span.unapprove').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tundo_comment_id = ct_comment_id;\r\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\r\n\t});\r\n\r\n\t// For spammed\r\n\tjQuery('span.spam').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tundo_comment_id = ct_comment_id;\r\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\r\n\t\tsetTimeout(function(){\r\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\r\n\t\t\t\tvar result = jQuery(this).attr('href');\r\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\r\n\t\t\t\tct_comment_id = result[1];\r\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\r\n\t\t\t});\r\n\t\t}, 202);\r\n\r\n\t});\r\n\r\n\t// For unspammed\r\n\tjQuery('span.unspam').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\r\n\t});\r\n\r\n\t// For untrashed\r\n\tjQuery('span.untrash a').on('click', function(){\r\n\t\tvar result = jQuery(this).attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\r\n\t});\r\n});\r\n\r\n// Send feedback to backend\r\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\r\n\r\n\tvar data = {\r\n\t\t'action': 'ct_feedback_comment',\r\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\r\n\t\t'comment_id': ct_comment_id,\r\n\t\t'comment_status': ct_comment_status\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\r\n\t\t},\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tconsole.log(jqXHR);\r\n\t\t\tconsole.log(textStatus);\r\n\t\t\tconsole.log(errorThrown);\r\n\t\t},\r\n timeout: 5000\r\n\t});\r\n}\r\n\r\n// Outputs CT message about feedback\r\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\r\n\tif(ct_result == 1){\r\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\r\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\r\n\t\t\t\t.html('')\r\n\t\t\t\t.show()\r\n\t\t\t\t.append(\"\").children('td')\r\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\r\n\t\t\t\t\t.append(\"
\"+ctCommentsScreen.ct_feedback_msg+\"
\");\r\n\t\t}\r\n\t\tif(ct_comment_status == 'spam'){\r\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\r\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\r\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\r\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\r\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg);\r\n\t\t\t}else{\r\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\r\n\t\t\t\t.html('')\r\n\t\t\t\t.show()\r\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\r\n\t\t\t\t.append(\"\").children('td')\r\n\t\t\t\t\t.append(\"
\"+ctCommentsScreen.ct_feedback_msg+\"
\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif(ct_result == 0){\r\n\t\t// Error occurred\r\n\t}if(ct_result == 'no_hash'){\r\n\t\t// No hash for this comment\r\n\t}\r\n}\r\n"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg","is","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAqEA,SAASE,yBAAyBC,EAAeC,EAAmBC,GAEnE,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,iBAAiBC,cAC7BC,WAAcR,EACdS,eAAkBR,CACnB,EAEAS,OAAOC,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLX,KAAMA,EACNY,QAAS,SAASC,GACjBC,2BAA2BjB,EAAeC,EAAmBe,EAAKd,CAAO,CAC1E,EACMgB,MAAO,SAASC,EAAOC,EAAYC,GACxCC,QAAQC,IAAIJ,CAAK,EACjBG,QAAQC,IAAIH,CAAU,EACtBE,QAAQC,IAAIF,CAAW,CACxB,EACMG,QAAS,GAChB,CAAC,CACF,CAGA,SAASP,2BAA2BjB,EAAeC,EAAmBwB,EAAWvB,GAChE,GAAbuB,IACsB,WAArBxB,GAAmCC,GACrCQ,OAAO,cAAcV,CAAa,EAChC0B,KAAK,EAAE,EACPC,KAAK,EACLC,OAAO,uBAAuB,EAAEC,SAAS,IAAI,EAC5CC,IAAI,aAAc,uBAAuB,EACzCF,OAAO,iCAAiCtB,iBAAiByB,gBAAgB,Q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AAS,WAC/B,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEV,SAAS,GAAG,EAAEe,KAAK,MAAM,GACnCC,MAAM,4BAA4B,EAClD7C,EAAgB2C,EAAO,GAEvB5C,yBADA+C,gBAAkB9C,EACsB,OAAQ,CAAC,EACjD+C,WAAW,WACVrC,OAAO,WAAWV,EAAc,gBAAgB,EAAEgD,MAAM,WACvD,IACAL,GAASA,EADIjC,OAAO6B,IAAI,EAAEK,KAAK,MAAM,GACrBC,MAAM,6BAA6B,EAEnD9C,yBADAC,EAAgB2C,EAAO,GACiB,UAAW,CAAC,CACrD,CAAC,CACF,EAAG,GAAG,CAEP,CAAC,EAGDjC,OAAO,aAAa,EAAEgC,GAAG,QAAS,WACjC,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEV,SAAS,GAAG,EAAEe,KAAK,MAAM,GACnCC,MAAM,4BAA4B,EAElD9C,yBADAC,EAAgB2C,EAAO,GACiB,UAAW,CAAC,CACrD,CAAC,EAGDjC,OAAO,gBAAgB,EAAEgC,GAAG,QAAS,WACpC,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEK,KAAK,MAAM,GACrBC,MAAM,4BAA4B,EAClD7C,EAAgB2C,EAAO,GACvBM,gBAAkBlD,yBAAyBC,EAAe,UAAW,CAAC,CACvE,CAAC,CACF,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-comments-editscreen.min.js","sources":["cleantalk-comments-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after(' ');\n\t\t\t}\n\t\t});\n\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t});\n\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\n\t});\n\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"
\"+ctCommentsScreen.ct_feedback_msg+\"
\");\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"\").children('td')\n\t\t\t\t\t.append(\"
\"+ctCommentsScreen.ct_feedback_msg+\"
\");\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg","is","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAqEA,SAASE,yBAAyBC,EAAeC,EAAmBC,GAEnE,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,iBAAiBC,cAC7BC,WAAcR,EACdS,eAAkBR,CACnB,EAEAS,OAAOC,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLX,KAAMA,EACNY,QAAS,SAASC,GACjBC,2BAA2BjB,EAAeC,EAAmBe,EAAKd,CAAO,CAC1E,EACMgB,MAAO,SAASC,EAAOC,EAAYC,GACxCC,QAAQC,IAAIJ,CAAK,EACjBG,QAAQC,IAAIH,CAAU,EACtBE,QAAQC,IAAIF,CAAW,CACxB,EACMG,QAAS,GAChB,CAAC,CACF,CAGA,SAASP,2BAA2BjB,EAAeC,EAAmBwB,EAAWvB,GAChE,GAAbuB,IACsB,WAArBxB,GAAmCC,GACrCQ,OAAO,cAAcV,CAAa,EAChC0B,KAAK,EAAE,EACPC,KAAK,EACLC,O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2C,EAAO,GAEvB5C,yBADA+C,gBAAkB9C,EACsB,OAAQ,CAAC,CAClD,CAAC,EAGDU,OAAO,WAAW,EAAEgC,GAAG,QAAS,WAC/B,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEV,SAAS,GAAG,EAAEe,KAAK,MAAM,GACnCC,MAAM,4BAA4B,EAClD7C,EAAgB2C,EAAO,GAEvB5C,yBADA+C,gBAAkB9C,EACsB,OAAQ,CAAC,EACjD+C,WAAW,WACVrC,OAAO,WAAWV,EAAc,gBAAgB,EAAEgD,MAAM,WACvD,IACAL,GAASA,EADIjC,OAAO6B,IAAI,EAAEK,KAAK,MAAM,GACrBC,MAAM,6BAA6B,EAEnD9C,yBADAC,EAAgB2C,EAAO,GACiB,UAAW,CAAC,CACrD,CAAC,CACF,EAAG,GAAG,CAEP,CAAC,EAGDjC,OAAO,aAAa,EAAEgC,GAAG,QAAS,WACjC,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEV,SAAS,GAAG,EAAEe,KAAK,MAAM,GACnCC,MAAM,4BAA4B,EAElD9C,yBADAC,EAAgB2C,EAAO,GACiB,UAAW,CAAC,CACrD,CAAC,EAGDjC,OAAO,gBAAgB,EAAEgC,GAAG,QAAS,WACpC,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEK,KAAK,MAAM,GACrBC,MAAM,4BAA4B,EAClD7C,EAAgB2C,EAAO,GACvBM,gBAAkBlD,yBAAyBC,EAAe,UAAW,CAAC,CACvE,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-dashboard-widget.min.js b/js/cleantalk-dashboard-widget.min.js index 09a5e06b..bc663742 100644 --- a/js/cleantalk-dashboard-widget.min.js +++ b/js/cleantalk-dashboard-widget.min.js @@ -1,2 +1,2 @@ -jQuery(document).ready(function(){jQuery(".ct_widget_refresh_link").on("click",function(){jQuery(".ct_preloader").show(),setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),setTimeout(function(){jQuery("#ct_refresh_form").submit()},2500)}),"#ct_widget"==location.hash&&setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),jQuery("#ct_widget_wrapper").parent().css("padding",0),locale=navigator.language||navigator.userLanguage;var o=new Intl.DateTimeFormat(locale,{month:"short",day:"numeric"});var e=document.getElementById("ct_widget_chart"),t=(t=>{var a={labels:[],counts:[]};for(let e=0;e 0 && e != 'rgba(0, 0, 0, 0)') {\r\n jQuery('.ct_comment_info').css('background', e);\r\n return false;\r\n }\r\n });\r\n\r\n // Set same float style with article\r\n var ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\r\n jQuery('.ct_comment_info').css('float', ct_post_float);\r\n\r\n var ct_posts = jQuery('.ct_comment_info');\r\n\r\n jQuery(ct_posts).each(function (indx, elem) {\r\n curr_elem = jQuery(elem);\r\n curr_elem.parent().prepend(curr_elem);\r\n });\r\n\r\n // Handler for buttons\r\n jQuery('.ct_this_is').on('click', function () {\r\n\r\n var ct_current_button = jQuery(this),\r\n ct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\r\n ct_feedback_msg = jQuery('.ct_feedback_msg'),\r\n ct_comment_status;\r\n\r\n if (ct_current_button.hasClass('ct_this_is_spam'))\r\n ct_comment_status = 'spam';\r\n else\r\n ct_comment_status = 'approve';\r\n\r\n var data = {\r\n 'action': 'ct_feedback_comment',\r\n 'security': ctPublicAdmin.ct_ajax_nonce,\r\n 'comment_id': ct_current_button.attr('commentid'),\r\n 'comment_status': ct_comment_status,\r\n 'change_status': 1\r\n };\r\n\r\n apbct_public_sendAJAX(\r\n data,\r\n {\r\n callback: function (msg) {\r\n\r\n ct_current_button.hide();\r\n ct_current_button.siblings('span.ct_this_is').show();\r\n\r\n jQuery('.ct_feedback_result').hide();\r\n if (ct_comment_status == 'approve') {\r\n jQuery('.ct_feedback_result_not_spam').show();\r\n } else {\r\n jQuery('.ct_feedback_result_spam').show();\r\n }\r\n\r\n if (msg == 1) {\r\n ct_feedback_msg.addClass('ct_feedback_success');\r\n ct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\r\n } else if (msg == 0) {\r\n // Error occurred\r\n ct_feedback_msg.addClass('ct_feedback_error');\r\n ct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\r\n } else if (msg == 'no_hash') {\r\n // No hash for this comment\r\n ct_feedback_msg.addClass('ct_feedback_no_hash');\r\n ct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\r\n }\r\n // Hidding feedback message for every message type\r\n ct_feedback_wrap.show();\r\n ct_feedback_wrap.css('display', 'inline-block');\r\n\r\n var ct_timeout_id = ct_feedback_wrap.data('interval_id');\r\n clearInterval(ct_timeout_id);\r\n ct_timeout_id = setTimeout(function () {\r\n ct_feedback_wrap.fadeOut(1000);\r\n }, 5000);\r\n ct_feedback_wrap.data('interval_id', ct_timeout_id);\r\n },\r\n button: ct_current_button[0],\r\n spinner: ct_current_button[0].querySelectorAll('.apbct_preloader_button')[0],\r\n notJson: true\r\n }\r\n );\r\n });\r\n});"],"names":["document","addEventListener","jQuery","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","ct_comment_status","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","apbct_public_sendAJAX","callback","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","button","spinner","querySelectorAll","notJson"],"mappings":"AAAAA,SAASC,iBAAiB,mBAAoB,WAG1CC,OAAO,kBAAkB,EAAEC,QAAQ,EAAEC,KAAK,WACtC,GAAwD,GAAnDC,EAAIH,OAAOI,IAAI,EAAEC,IAAI,kBAAkB,GAAGC,QAAmB,oBAALH,EAEzD,OADAH,OAAO,kBAAkB,EAAEK,IAAI,aAAcF,CAAC,EACvC,CAAA,CAEf,CAAC,EAGD,IAAII,EAAgBP,O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B,QAAQ,GAAI,CACjC,EAAG,GAAI,EACP1B,EAAiBK,KAAK,cAAekB,CAAa,CACtD,EACAI,OAAQ5B,EAAkB,GAC1B6B,QAAS7B,EAAkB,GAAG8B,iBAAiB,yBAAyB,EAAE,GAC1EC,QAAS,CAAA,CACb,CACJ,CACJ,CAAC,CACL,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-public-admin.min.js","sources":["cleantalk-public-admin.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\n\n // Set background-color similar to parents\n jQuery('.ct_comment_info').parents().each(function () {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)') {\n jQuery('.ct_comment_info').css('background', e);\n return false;\n }\n });\n\n // Set same float style with article\n var ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n jQuery('.ct_comment_info').css('float', ct_post_float);\n\n var ct_posts = jQuery('.ct_comment_info');\n\n jQuery(ct_posts).each(function (indx, elem) {\n curr_elem = jQuery(elem);\n curr_elem.parent().prepend(curr_elem);\n });\n\n // Handler for buttons\n jQuery('.ct_this_is').on('click', function () {\n\n var ct_current_button = jQuery(this),\n ct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n ct_feedback_msg = jQuery('.ct_feedback_msg'),\n ct_comment_status;\n\n if (ct_current_button.hasClass('ct_this_is_spam'))\n ct_comment_status = 'spam';\n else\n ct_comment_status = 'approve';\n\n var data = {\n 'action': 'ct_feedback_comment',\n 'security': ctPublicAdmin.ct_ajax_nonce,\n 'comment_id': ct_current_button.attr('commentid'),\n 'comment_status': ct_comment_status,\n 'change_status': 1\n };\n\n apbct_public_sendAJAX(\n data,\n {\n callback: function (msg) {\n\n ct_current_button.hide();\n ct_current_button.siblings('span.ct_this_is').show();\n\n jQuery('.ct_feedback_result').hide();\n if (ct_comment_status == 'approve') {\n jQuery('.ct_feedback_result_not_spam').show();\n } else {\n jQuery('.ct_feedback_result_spam').show();\n }\n\n if (msg == 1) {\n ct_feedback_msg.addClass('ct_feedback_success');\n ct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n } else if (msg == 0) {\n // Error occurred\n ct_feedback_msg.addClass('ct_feedback_error');\n ct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n } else if (msg == 'no_hash') {\n // No hash for this comment\n ct_feedback_msg.addClass('ct_feedback_no_hash');\n ct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n }\n // Hidding feedback message for every message type\n ct_feedback_wrap.show();\n ct_feedback_wrap.css('display', 'inline-block');\n\n var ct_timeout_id = ct_feedback_wrap.data('interval_id');\n clearInterval(ct_timeout_id);\n ct_timeout_id = setTimeout(function () {\n ct_feedback_wrap.fadeOut(1000);\n }, 5000);\n ct_feedback_wrap.data('interval_id', ct_timeout_id);\n },\n button: ct_current_button[0],\n spinner: ct_current_button[0].querySelectorAll('.apbct_preloader_button')[0],\n notJson: true\n }\n );\n });\n});"],"names":["document","addEventListener","jQuery","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","ct_comment_status","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","apbct_public_sendAJAX","callback","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","button","spinner","querySelectorAll","notJson"],"mappings":"AAAAA,SAASC,iBAAiB,mBAAoB,WAG1CC,OAAO,kBAAkB,EAAEC,QAAQ,EAAEC,KAAK,WACtC,GAAwD,GAAnDC,EAAIH,OAAOI,IAAI,EAAEC,IAAI,kBAAkB,GAAGC,QAAmB,oBAALH,EAEzD,OADAH,OAAO,kBAAkB,EAAEK,IAAI,aAAcF,CAAC,EACvC,CAAA,CAEf,CAAC,EAGD,IAAII,EAAgBP,OAAO,kBAAkB,EAAEQ,KAAK,EAAEC,KAAK,EAAEJ,IAAI,OAAO,EAGpEK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CACtD,EACAI,OAAQ5B,EAAkB,GAC1B6B,QAAS7B,EAAkB,GAAG8B,iBAAiB,yBAAyB,EAAE,GAC1EC,QAAS,CAAA,CACb,CACJ,CACJ,CAAC,CACL,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-users-checkspam.min.js.map b/js/cleantalk-users-checkspam.min.js.map index 19666623..1feb75dc 100644 --- a/js/cleantalk-users-checkspam.min.js.map +++ b/js/cleantalk-users-checkspam.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.js"],"sourcesContent":["// Printf for JS\r\nString.prototype.printf = function(){\r\n var formatted = this;\r\n for( var arg in arguments ) {\r\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\r\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\r\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\r\n }\r\n return formatted;\r\n};\r\n\r\n// Set deafult amount to check by request.\r\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\r\n\r\n// Flags\r\nvar ct_working = false,\r\n\tct_new_check = true,\r\n\tct_cooling_down_flag = false,\r\n\tct_close_animate = true,\r\n\tct_accurate_check = false,\r\n\tct_pause = false,\r\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\r\n\tct_prev_from = ctUsersCheck.ct_prev_from,\r\n\tct_prev_till = ctUsersCheck.ct_prev_till;\r\n// Settings\r\nvar ct_cool_down_time = 90000,\r\n\tct_requests_counter = 0,\r\n\tct_max_requests = 60;\r\n// Variables\r\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\r\n\tct_users_total = 0,\r\n\tct_users_checked = 0,\r\n\tct_users_spam = 0,\r\n\tct_users_bad = 0,\r\n\tct_unchecked = 'unset',\r\n\tct_date_from = 0,\r\n\tct_date_till = 0;\r\n\r\n/* Function: Reuturns cookie with prefix */\r\nfunction apbct_cookie__get(names, prefixes){\r\n\tvar cookie = {};\r\n\tnames = names || null;\r\n\tif(typeof names == 'string') names = names.split();\r\n\tprefixes = prefixes || ['apbct_', 'ct_'];\r\n\tif(prefixes === 'none') prefixes = null;\r\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\r\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\r\n\t\tvar curr = item.trim().split('=');\r\n\t\t// Detect by full cookie name\r\n\t\tif(names){\r\n\t\t\tnames.forEach(function(name, i, all){\r\n\t\t\t\tif(curr[0] === name)\r\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\r\n\t\t\t});\r\n\t\t}\r\n\t\t// Detect by name prefix\r\n\t\tif(prefixes){\r\n\t\t\tprefixes.forEach(function(prefix, i, all){\r\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\r\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\treturn cookie;\r\n}\r\n\r\nfunction apbct_get_cookie( name ){\r\n\tvar cookie = apbct_cookie__get( name, name );\r\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\r\n\t\treturn cookie[name];\r\n\t}else\r\n\t\treturn null;\r\n}\r\n\r\nfunction animate_comment(to,id){\r\n\tif(ct_close_animate){\r\n\t\tif(to === 0.3){\r\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\r\n\t\t\t\tanimate_comment(1,id)\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\r\n\t\t\t\tanimate_comment(0.3,id)\r\n\t\t\t});\r\n\t\t}\r\n\t}else{\r\n\t\tct_close_animate=true;\r\n\t}\r\n}\r\n\r\nfunction ct_clear_users(){\r\n\r\n\tvar from = 0, till = 0;\r\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\r\n\t\tfrom = jQuery('#ct_date_range_from').val();\r\n\t\ttill = jQuery('#ct_date_range_till').val();\r\n\t}\r\n\r\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\r\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\r\n\r\n\tvar data = {\r\n\t\t'action' : 'ajax_clear_users',\r\n\t\t'security' : ct_ajax_nonce,\r\n\t\t'from' : from,\r\n\t\t'till' : till,\r\n\t\t'no_cache': Math.random()\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\tct_show_users_info();\r\n\t\t\tct_send_users();\r\n\t\t}\r\n\t});\r\n\r\n}\r\n\r\n//Continues the check after cooldown time\r\n//Called by ct_send_users();\r\nfunction ct_cooling_down_toggle(){\r\n\tct_cooling_down_flag = false;\r\n\tct_send_users();\r\n\tct_show_users_info();\r\n}\r\n\r\nfunction ct_send_users(){\r\n\r\n\tif(ct_cooling_down_flag === true)\r\n\t\treturn;\r\n\tif (ct_pause === true) {\r\n\t\tct_working=false;\r\n\t\tjQuery('#ct_working_message').hide();\r\n\t\tlet new_href = 'users.php?page=ct_check_users&ct_worked=1';\r\n\t\tif(ct_date_from !== 0 && ct_date_till !== 0)\r\n\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\tlocation.href = new_href;\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(ct_requests_counter >= ct_max_requests){\r\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\r\n\t\tct_requests_counter = 0;\r\n\t\tct_cooling_down_flag = true;\r\n\t\treturn;\r\n\t}else{\r\n\t\tct_requests_counter++;\r\n\t}\r\n\r\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\r\n\r\n\tvar data = {\r\n\t\taction: 'ajax_check_users',\r\n\t\tsecurity: ct_ajax_nonce,\r\n\t\tnew_check: ct_new_check,\r\n\t\tunchecked: ct_unchecked,\r\n\t\tamount: check_amount,\r\n\t\t'no_cache': Math.random(),\r\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\r\n\t};\r\n\r\n\tif(ct_accurate_check)\r\n\t\tdata['accurate_check'] = true;\r\n\r\n\tif(ct_date_from && ct_date_till){\r\n\t\tdata['from'] = ct_date_from;\r\n\t\tdata['till'] = ct_date_till;\r\n\t}\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\r\n\t\t\tmsg = jQuery.parseJSON(msg);\r\n\r\n\t\t\tif(parseInt(msg.error)){\r\n\t\t\t\tct_working=false;\r\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\r\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\r\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\r\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\t\t\t\tlocation.href = new_href;\r\n\t\t\t\t}else\r\n\t\t\t\t\tct_send_users();\r\n\t\t\t}else{\r\n\t\t\t\tct_new_check = false;\r\n\t\t\t\tif(parseInt(msg.end) == 1){\r\n\t\t\t\t\tif(parseInt(msg.end) == 1)\r\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\r\n\t\t\t\t\tct_working=false;\r\n\t\t\t\t\tjQuery('#ct_working_message').hide();\r\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\r\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\r\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\t\t\t\tlocation.href = new_href;\r\n\t\t\t\t}else if(parseInt(msg.end) == 0){\r\n\t\t\t\t\tct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );\r\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\r\n\t\t\t\t\tct_users_bad = parseInt( msg.bad );\r\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\r\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\r\n\t\t\t\t\tstatus_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\r\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\r\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\r\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\r\n\t\t\t\t\tjQuery('#ct_error_message').hide();\r\n\r\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\r\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\r\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\r\n\r\n\t\t\t\t\tct_send_users();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tif(check_amount > 20){\r\n\t\t\t\tcheck_amount -= 20;\r\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\r\n\t\t\t}\r\n\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\r\n\t\t\tsetTimeout(ct_send_users(), 3000);\r\n },\r\n timeout: 25000\r\n\t});\r\n}\r\nfunction ct_show_users_info(){\r\n\r\n\tif( ct_working ){\r\n\r\n\t\tif(ct_cooling_down_flag === true){\r\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tjQuery('#ct_cooling_notice').hide();\r\n\t\t}\r\n\r\n\t\tif( ! ct_users_total ){\r\n\r\n\t\t\tvar data = {\r\n\t\t\t\t'action': 'ajax_info_users',\r\n\t\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t\t'no_cache': Math.random()\r\n\t\t\t};\r\n\r\n\t\t\tif( ct_date_from && ct_date_till ){\r\n\t\t\t\tdata['from'] = ct_date_from;\r\n\t\t\t\tdata['till'] = ct_date_till;\r\n\t\t\t}\r\n\r\n\t\t\tjQuery.ajax({\r\n\t\t\t\ttype: \"POST\",\r\n\t\t\t\turl: ajaxurl,\r\n\t\t\t\tdata: data,\r\n\t\t\t\tsuccess: function(msg){\r\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\r\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\r\n\t\t\t\t\tct_users_spam = msg.spam;\r\n\t\t\t\t\tct_users_checked = msg.checked;\r\n\t\t\t\t\tct_users_bad = msg.bad;\r\n\t\t\t\t},\r\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\r\n\t\t\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\r\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\r\n\t\t\t\t},\r\n\t\t\t\ttimeout: 15000\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n// Function to toggle dependences\r\nfunction ct_toggle_depended(obj, secondary){\r\n\r\n secondary = secondary || null;\r\n\r\n\tvar depended = jQuery(obj.data('depended')),\r\n\t\tstate = obj.data('state');\r\n\r\n\tif(!state && !secondary){\r\n\t\tobj.data('state', true);\r\n\t\tdepended.removeProp('disabled');\r\n\t}else{\r\n\t\tobj.data('state', false);\r\n\t\tdepended.prop('disabled', true);\r\n\t\tdepended.removeProp('checked');\r\n\t\tif(depended.data('depended'))\r\n\t\t\tct_toggle_depended(depended, true);\r\n\t}\r\n}\r\n\r\n// Main function of checking\r\nfunction ct_start_check( continue_check ){\r\n\r\n\tcontinue_check = continue_check || null;\r\n\r\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\r\n\r\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\r\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\r\n\r\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\r\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tif(jQuery('#ct_accurate_check').is(':checked')){\r\n\t\tct_accurate_check = true;\r\n\t}\r\n\r\n\t//\r\n\tif (\r\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\r\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\r\n\t) {\r\n\t\talert(ctUsersCheck.ct_select_date_range);\r\n\t\treturn;\r\n\t}\r\n\r\n\tjQuery('.ct_to_hide').hide();\r\n\tjQuery('#ct_working_message').show();\r\n\tjQuery('#ct_preloader').show();\r\n\tjQuery('#ct_pause').show();\r\n\r\n\tct_working = true;\r\n\r\n\tif( continue_check ){\r\n\t\tct_show_users_info();\r\n\t\tct_send_users();\r\n\t} else {\r\n\t\tct_clear_users();\r\n\t}\r\n\r\n}\r\n\r\nfunction ct_delete_all_users( e ){\r\n\r\n\tvar data = {\r\n\t\t'action': 'ajax_delete_all_users',\r\n\t\t'security': ct_ajax_nonce,\r\n\t\t'no_cache': Math.random()\r\n\t};\r\n\r\n\tjQuery('.' + e.target.id).addClass('disabled');\r\n\tjQuery('.spinner').css('visibility', 'visible');\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function( msg ){\r\n\t\t\tif( msg > 0 ){\r\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\r\n\t\t\t\tct_delete_all_users( e, data );\r\n\t\t\t}else{\r\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\r\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\r\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\r\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\r\n\t\t},\r\n\t\ttimeout: 25000\r\n\t});\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\t// Setting dependences\r\n\r\n\t// Prev check parameters\r\n\tif(ct_prev_accurate){\r\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\r\n\t}\r\n\tif(ct_prev_from){\r\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\r\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\r\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\r\n\t}\r\n\r\n\t// Toggle dependences\r\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\r\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\r\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\r\n\t\tif( this.checked ) {\r\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\r\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\r\n\t\t} else {\r\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\r\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\r\n\t\t}\r\n\t});\r\n\r\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\r\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\r\n\t\t{\r\n\t\t\tdateFormat: 'M d yy',\r\n\t\t\tmaxDate:\"+0D\",\r\n\t\t\tchangeMonth:true,\r\n\t\t\tchangeYear:true,\r\n\t\t\tshowAnim: 'slideDown',\r\n\t\t\tonSelect: function(selectedDate){\r\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\r\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\r\n\t\t\t\tdate = jQuery.datepicker.parseDate(\r\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\r\n\t\t\t\t\tselectedDate, instance.settings);\r\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\r\n\t\t\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\r\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\r\n\t// Check users\r\n\tjQuery(\"#ct_check_spam_button\").click(function(){\r\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\r\n\t\tct_pause = false;\r\n\r\n\t\t//\r\n\r\n\r\n\t\tct_start_check(false);\r\n\t});\r\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\r\n\t\tct_pause = false;\r\n\t\tct_start_check(true);\r\n\t});\r\n\r\n\t// Pause the check\r\n\tjQuery('#ct_pause').on('click', function(){\r\n\t\tct_pause = true;\r\n\t\tvar ct_check = {\r\n\t\t\t'accurate': ct_accurate_check,\r\n\t\t\t'from' : ct_date_from,\r\n\t\t\t'till' : ct_date_till\r\n\t\t};\r\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\r\n\t});\r\n\r\n\t//Approve button\r\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\r\n\t\tct_id = jQuery(this).attr(\"data-id\");\r\n\r\n\t\t// Approving\r\n\t\tvar data = {\r\n\t\t\t'action': 'ajax_ct_approve_user',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'id': ct_id,\r\n\t\t\t'no_cache': Math.random()\r\n\t\t};\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\r\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\r\n\t\t// Positive feedback\r\n\t\tvar data = {\r\n\t\t\t'action': 'ct_feedback_user',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'user_id': ct_id,\r\n\t\t\t'status': 'approve',\r\n\t\t\t'no_cache': Math.random()\r\n\t\t};\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tif(msg == 1){\r\n\t\t\t\t\t// Success\r\n\t\t\t\t}\r\n\t\t\t\tif(msg == 0){\r\n\t\t\t\t\t// Error occurred\r\n\t\t\t\t}\r\n\t\t\t\tif(msg == 'no_hash'){\r\n\t\t\t\t\t// No hash\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\r\n\t\t\t},\r\n\t\t\ttimeout: 5000\r\n\t\t});\r\n\r\n\t});\r\n\r\n\t// Request to Download CSV file.\r\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\r\n\t\tvar data = {\r\n\t\t\t'action': 'ajax_ct_get_csv_file',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'filename': ctUsersCheck.ct_csv_filename,\r\n\t\t\t'no_cache': Math.random()\r\n\t\t};\r\n\t\tjQuery('.' + e.target.id).addClass('disabled');\r\n\t\tjQuery('.spinner').css('visibility', 'visible');\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tif( parseInt(msg) === 0 ) {\r\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\r\n\r\n\t\t\t\t\tvar dummy = document.createElement('a');\r\n\t\t\t\t\tdummy.href = url;\r\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\r\n\r\n\t\t\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\t\t\tdummy.click();\r\n\t\t\t\t}\r\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\r\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t// Delete inserted users\r\n\tjQuery(\".ct_insert_users\").click(function( e ){\r\n\t\tct_insert_users();\r\n\t});\r\n\r\n\t// Insert users\r\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\r\n\t\tct_insert_users( true );\r\n\t});\r\n\r\n\t// Delete all spam users\r\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\r\n\r\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\r\n\t\t\treturn false;\r\n\r\n\t\tct_delete_all_users( e );\r\n\r\n\t});\r\n\r\n\tfunction ct_insert_users(delete_accounts){\r\n\r\n\t\tdelete_accounts = delete_accounts || null;\r\n\r\n\t\tvar data = {\r\n\t\t\t'action': 'ajax_insert_users',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'no_cache': Math.random()\r\n\t\t};\r\n\r\n\t\tif(delete_accounts)\r\n\t\t\tdata['delete'] = true;\r\n\r\n\t\tlet waitingPopup = document.createElement('div');\r\n\t\twaitingPopup.setAttribute('class', 'apbct-popup');\r\n\t\twaitingPopup.setAttribute('id', 'apbct_popup');\r\n\t\twaitingPopup.setAttribute('style', 'font-size: 20px');\r\n\t\twaitingPopup.innerText = 'Wait for users handling!..'\r\n\t\tdocument.body.append(waitingPopup);\r\n\t\tdocument.body.classList.add('apbct-popup-fade');\r\n\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tif(delete_accounts)\r\n\t\t\t\t\talert('Deleted ' + msg + ' users');\r\n\t\t\t\telse\r\n\t\t\t\t\talert('Inserted ' + msg + ' users');\r\n\t\t\t\tjQuery('#apbct_popup')[0].remove()\r\n\t\t\t\tdocument.body.classList.remove('apbct-popup-fade');\r\n\t\t\t\twindow.location.reload();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Checked ct_accurate_check\r\n\t */\r\n\tjQuery('#ct_accurate_check').change(function () {\r\n\t\tif(this.checked) {\r\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\r\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\r\n\t\t}\r\n\t});\r\n});\r\n\r\n/**\r\n * Get cookie by name\r\n * @param name\r\n * @returns {string|undefined}\r\n */\r\nfunction getCookie(name) {\r\n\tlet matches = document.cookie.match(new RegExp(\r\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\r\n\t));\r\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\r\n}\r\n\r\n// Binds the bulk action events to the submit buttons.\r\n// This code has been copied from wordpress core js file wp-admin/js/media.js:184\r\njQuery( '#doaction' ).on( 'click', function( event ) {\r\n\t/*\r\n * Handle the bulk action based on its value.\r\n */\r\n\tjQuery( 'select[name=\"action\"]' ).each( function() {\r\n\t\tvar optionValue = jQuery( this ).val();\r\n\t\tif ( 'delete' === optionValue ) {\r\n\t\t\tif ( ! showNotice.warn() ) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n});\r\n"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","hide","let","new_href","href","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","end","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","css","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_insert_users","delete_accounts","waitingPopup","createElement","setAttribute","innerText","body","append","classList","add","remove","window","reload","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","download","appendChild","ct_confirm_deletion_all","change","event","each","showNotice","warn","preventDefault"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CA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CACF,CAAC,EAGDvE,OAAO,kBAAkB,EAAEiH,MAAM,SAAU7C,GAC1CgC,EAAgB,CACjB,CAAC,EAGDpG,OAAO,0BAA0B,EAAEiH,MAAM,SAAU7C,GAClDgC,EAAiB,CAAA,CAAK,CACvB,CAAC,EAGDpG,OAAO,sBAAsB,EAAEiH,MAAM,SAAU7C,GAE9C,GAAK,CAAE5B,QAASvE,aAAakK,uBAAwB,EACpD,MAAO,CAAA,EAERhE,oBAAqBC,CAAE,CAExB,CAAC,EA2CDpE,OAAO,oBAAoB,EAAEoI,OAAO,WAChCnL,KAAK0F,UACP3C,OAAO,sBAAsB,EAAE4D,KAAK,UAAW,CAAA,CAAI,EACnD5D,OAAO,UAAU,EAAE4D,KAAK,UAAW,CAAA,CAAI,EAAEqB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC,EAgBDjF,OAAQ,WAAY,EAAEgF,GAAI,QAAS,SAAUqD,GAI5CrI,OAAQ,uBAAwB,EAAEsI,KAAM,WAElC,WADatI,OAAQ/C,IAAK,EAAEsD,IAAI,GAE7BgI,WAAWC,KAAK,GACtBH,EAAMI,eAAe,CAGxB,CAAC,CACF,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes === 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to === 0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\tif (ct_pause === true) {\n\t\tct_working=false;\n\t\tjQuery('#ct_working_message').hide();\n\t\tlet new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\tif(ct_date_from !== 0 && ct_date_till !== 0)\n\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\tlocation.href = new_href;\n\t\treturn;\n\t}\n\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random(),\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\n\t};\n\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\n\t\t\tmsg = jQuery.parseJSON(msg);\n\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( msg.bad );\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tstatus_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\n\tif( ct_working ){\n\n\t\tif(ct_cooling_down_flag === true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();\n\t\t\treturn;\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\n\t\tif( ! ct_users_total ){\n\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce,\n\t\t\t\t'no_cache': Math.random()\n\t\t\t};\n\n\t\t\tif( ct_date_from && ct_date_till ){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_pause = false;\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_pause = false;\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve',\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\n\t});\n\n\tfunction blinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(500, 0.25).fadeTo(500, 1);\n\t}\n\n\tfunction stopBlinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(1)\n\t}\n\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tblinkElement('ct_get_csv_file');\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif( parseInt(msg) === 0 ) {\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tstopBlinkElement('ct_get_csv_file');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\t\tblinkElement('ct_delete_all_users');\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tlet waitingPopup = document.createElement('div');\n\t\twaitingPopup.setAttribute('class', 'apbct-popup');\n\t\twaitingPopup.setAttribute('id', 'apbct_popup');\n\t\twaitingPopup.setAttribute('style', 'font-size: 20px');\n\t\twaitingPopup.innerText = 'Wait for users handling!..'\n\t\tdocument.body.append(waitingPopup);\n\t\tdocument.body.classList.add('apbct-popup-fade');\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t\tjQuery('#apbct_popup')[0].remove()\n\t\t\t\tdocument.body.classList.remove('apbct-popup-fade');\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// Binds the bulk action events to the submit buttons.\n// This code has been copied from wordpress core js file wp-admin/js/media.js:184\njQuery( '#doaction' ).on( 'click', function( event ) {\n\t/*\n * Handle the bulk action based on its value.\n */\n\tjQuery( 'select[name=\"action\"]' ).each( function() {\n\t\tvar optionValue = jQuery( this ).val();\n\t\tif ( 'delete' === optionValue ) {\n\t\t\tif ( ! showNotice.warn() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t});\n});\n"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","hide","let","new_href","href","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","end","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","blinkElement","ct_insert_users","delete_accounts","waitingPopup","createElement","setAttribute","innerText","body","append","classList","add","remove","window","reload","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","download","appendChild","ct_confirm_deletion_all","change","event","each","showNotice","warn","preventDefault"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAAC,EACpEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,CAAC,EAAE,EAAGL,EAAUO,MAAM,EACzFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,CACX,EAMA,IAAIQ,WAAa,EAHjBC,SAASC,OAAS,oDAIjBC,aAAe,CAAA,EACfC,qBAAuB,CAAA,EACvBC,iBAAmB,CAAA,EACnBC,kBAAoB,CAAA,EACpBC,SAAW,CAAA,EACXC,iBAAmBC,aAAaD,iBAChCE,aAAmBD,aAAaC,aAChCC,aAAmBF,aAAaE,aAE7BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,aAAaM,cAChCC,eAAiB,EACjBC,iBAAmB,EACnBC,cAAgB,EAChBC,aAAe,EACfC,aAAe,QACfC,aAAe,EACfC,aAAe,EAGhB,SAASC,kBAAkBC,EAAOC,GACjC,IAAIvB,EAAS,GAuBb,MArBmB,UAAhB,OADHsB,EAAQA,GAAS,QACYA,EAAQA,EAAME,MAAM,GAG3B,UAAnB,OAD8BD,EAAjB,UADhBA,EAAWA,GAAY,CAAC,SAAU,QACU,KAClCA,KAAsBA,EAAWA,EAASC,MAAM,GAC1DzB,SAASC,OAAOwB,MAAM,GAAG,EAAEC,QAAQ,SAASC,EAAMC,EAAGC,GACpD,IAAIC,EAAOH,EAAKI,KAAK,EAAEN,MAAM,GAAG,EAE7BF,GACFA,EAAMG,QAAQ,SAASM,EAAMJ,EAAGK,GAC5BH,EAAK,KAAOE,IACd/B,EAAO6B,EAAK,IAAOA,EAAK,GAC1B,CAAC,EA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,EAAMK,SAAWhK,aAAa0J,gBAAkB,OAEhDlK,SAASiJ,KAAKwB,YAAYN,CAAK,EAC/BA,EAAMX,MAAM,GAEbjH,OAAO,IAAMoE,EAAEC,OAAOtE,EAAE,EAAEwE,YAAY,UAAU,EA9BlDvE,OAAO,kBAAQ,EAAEC,OAAO,CAAC,CAgCxB,CACD,CAAC,CACF,CAAC,EAGDD,OAAO,kBAAkB,EAAEiH,MAAM,SAAU7C,GAC1CgC,EAAgB,CACjB,CAAC,EAGDpG,OAAO,0BAA0B,EAAEiH,MAAM,SAAU7C,GAClDgC,EAAiB,CAAA,CAAK,CACvB,CAAC,EAGDpG,OAAO,sBAAsB,EAAEiH,MAAM,SAAU7C,GAE9C,GAAK,CAAE5B,QAASvE,aAAakK,uBAAwB,EACpD,MAAO,CAAA,EACRhC,EAAa,qBAAqB,EAClChC,oBAAqBC,CAAE,CAExB,CAAC,EA2CDpE,OAAO,oBAAoB,EAAEoI,OAAO,WAChCnL,KAAK0F,UACP3C,OAAO,sBAAsB,EAAE4D,KAAK,UAAW,CAAA,CAAI,EACnD5D,OAAO,UAAU,EAAE4D,KAAK,UAAW,CAAA,CAAI,EAAEoB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC,EAgBDhF,OAAQ,WAAY,EAAE+E,GAAI,QAAS,SAAUsD,GAI5CrI,OAAQ,uBAAwB,EAAEsI,KAAM,WAElC,WADatI,OAAQ/C,IAAK,EAAEsD,IAAI,GAE7BgI,WAAWC,KAAK,GACtBH,EAAMI,eAAe,CAGxB,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-users-editscreen.min.js.map b/js/cleantalk-users-editscreen.min.js.map index ec2524bb..500e6e1f 100644 --- a/js/cleantalk-users-editscreen.min.js.map +++ b/js/cleantalk-users-editscreen.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-users-editscreen.min.js","sources":["cleantalk-users-editscreen.js"],"sourcesContent":["function ct_is_email(str){\r\n\treturn str.search(/.*@.*\\..*/);\r\n}\r\nfunction ct_is_ip(str){\r\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\r\n\tif(parseInt(ctUsersScreen.ct_show_check_links)) {\r\n\r\n\t\t/* Shows link to blacklists near every email and IP address */\r\n\t\tjQuery('.column-email a').each(function(){\r\n\t\t\tvar ct_curr_str = jQuery(this).html();\r\n\t\t\tif( ct_is_email(ct_curr_str) !== -1 ){\r\n\t\t\t\tjQuery(this).after(' ');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t/* Show checked ico near avatar */\r\n\t\tjQuery('.username.column-username').each(function(){\r\n\r\n\t\t\tvar apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');\r\n\t\t\tvar apbct_checking_status = apbct_checking_el.attr('id');\r\n\t\t\tvar apbct_checking_status_text = apbct_checking_el.text();\r\n\r\n\t\t\tvar apbct_add_text_element = jQuery('', {\r\n\t\t\t\ttext : apbct_checking_status_text\r\n\t\t\t});\r\n\t\t\tvar apbct_add_ico_ok = jQuery('', {\r\n\t\t\t\tclass : 'apbct-icon-ok'\r\n\t\t\t});\r\n\t\t\tvar apbct_add_ico_cancel = jQuery('', {\r\n\t\t\t\tclass : 'apbct-icon-cancel',\r\n\t\t\t\tcss : {\r\n\t\t\t\t\tcolor : 'red'\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif( apbct_checking_status ==='apbct_not_checked' ) {\r\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\r\n\t\t\t}\r\n\t\t\tif( apbct_checking_status ==='apbct_checked_not_spam' ) {\r\n\t\t\t\tapbct_add_ico_ok.attr('style', 'color:green;');\r\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\r\n\t\t\t}\r\n\t\t\tif( apbct_checking_status ==='apbct_checked_spam' ) {\r\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t}\r\n\r\n});"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab","apbct_checking_el","siblings","children","apbct_checking_status","attr","apbct_checking_status_text","text","apbct_add_text_element","apbct_add_ico_ok","class","apbct_add_ico_cancel","css","color","before"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAEAE,OAAOC,QAAQ,EAAEC,MAAM,WAGnBC,SAASC,cAAcC,mBAAmB,IAG5CL,OAAO,iBAAiB,EAAEM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,IAAI,EAAEC,KAAK,EACH,CAAC,IAA9Bb,YAAYW,CAAW,GAC1BP,OAAOQ,IAAI,EAAEE,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB,QAAQ,CAE7O,CAAC,EAGDX,OAAO,2BAA2B,EAAEM,KAAK,WAExC,IAAIM,EAAoBZ,OAAOQ,IAAI,EAAEK,SAAS,eAAe,EAAEC,SAAS,MAAM,EAC1EC,EAAwBH,EAAkBI,KAAK,IAAI,EACnDC,EAA6BL,EAAkBM,KAAK,EAEpDC,EAAyBnB,OAAO,SAAU,CAC7CkB,KAAOD,CACR,CAAC,EACGG,EAAmBpB,OAAO,MAAO,CACpCqB,MAAS,eACV,CAAC,EACGC,EAAuBtB,OAAO,MAAO,CACxCqB,MAAS,oBACTE,IAAM,CACLC,MAAQ,KACT,CACD,CAAC,EAE4B,sBAAzBT,GACHf,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOL,CAAgB,EAAEK,OAAON,CAAsB,EAEhE,2BAAzBJ,IACHK,EAAiBJ,KAAK,QAAS,cAAc,EAC7ChB,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOL,CAAgB,EAAEK,OAAON,CAAsB,GAEhE,uBAAzBJ,GACHf,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOH,CAAoB,EAAEG,OAAON,CAAsB,CAGlG,CAAC,EAIH,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-users-editscreen.min.js","sources":["cleantalk-users-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\n\tif(parseInt(ctUsersScreen.ct_show_check_links)) {\n\n\t\t/* Shows link to blacklists near every email and IP address */\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif( ct_is_email(ct_curr_str) !== -1 ){\n\t\t\t\tjQuery(this).after(' ');\n\t\t\t}\n\t\t});\n\n\t\t/* Show checked ico near avatar */\n\t\tjQuery('.username.column-username').each(function(){\n\n\t\t\tvar apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');\n\t\t\tvar apbct_checking_status = apbct_checking_el.attr('id');\n\t\t\tvar apbct_checking_status_text = apbct_checking_el.text();\n\n\t\t\tvar apbct_add_text_element = jQuery('', {\n\t\t\t\ttext : apbct_checking_status_text\n\t\t\t});\n\t\t\tvar apbct_add_ico_ok = jQuery('', {\n\t\t\t\tclass : 'apbct-icon-ok'\n\t\t\t});\n\t\t\tvar apbct_add_ico_cancel = jQuery('', {\n\t\t\t\tclass : 'apbct-icon-cancel',\n\t\t\t\tcss : {\n\t\t\t\t\tcolor : 'red'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif( apbct_checking_status ==='apbct_not_checked' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_not_spam' ) {\n\t\t\t\tapbct_add_ico_ok.attr('style', 'color:green;');\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_spam' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);\n\t\t\t}\n\n\t\t});\n\n\t}\n\n});"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab","apbct_checking_el","siblings","children","apbct_checking_status","attr","apbct_checking_status_text","text","apbct_add_text_element","apbct_add_ico_ok","class","apbct_add_ico_cancel","css","color","before"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAEAE,OAAOC,QAAQ,EAAEC,MAAM,WAGnBC,SAASC,cAAcC,mBAAmB,IAG5CL,OAAO,iBAAiB,EAAEM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,IAAI,EAAEC,KAAK,EACH,CAAC,IAA9Bb,YAAYW,CAAW,GAC1BP,OAAOQ,IAAI,EAAEE,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB,QAAQ,CAE7O,CAAC,EAGDX,OAAO,2BAA2B,EAAEM,KAAK,WAExC,IAAIM,EAAoBZ,OAAOQ,IAAI,EAAEK,SAAS,eAAe,EAAEC,SAAS,MAAM,EAC1EC,EAAwBH,EAAkBI,KAAK,IAAI,EACnDC,EAA6BL,EAAkBM,KAAK,EAEpDC,EAAyBnB,OAAO,SAAU,CAC7CkB,KAAOD,CACR,CAAC,EACGG,EAAmBpB,OAAO,MAAO,CACpCqB,MAAS,eACV,CAAC,EACGC,EAAuBtB,OAAO,MAAO,CACxCqB,MAAS,oBACTE,IAAM,CACLC,MAAQ,KACT,CACD,CAAC,EAE4B,sBAAzBT,GACHf,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOL,CAAgB,EAAEK,OAAON,CAAsB,EAEhE,2BAAzBJ,IACHK,EAAiBJ,KAAK,QAAS,cAAc,EAC7ChB,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOL,CAAgB,EAAEK,OAAON,CAAsB,GAEhE,uBAAzBJ,GACHf,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOH,CAAoB,EAAEG,OAAON,CAAsB,CAGlG,CAAC,EAIH,CAAC"} \ No newline at end of file diff --git a/js/src/apbct-public-bundle_ext-protection.js b/js/src/apbct-public-bundle_ext-protection.js index ee5a0d65..1524ac00 100644 --- a/js/src/apbct-public-bundle_ext-protection.js +++ b/js/src/apbct-public-bundle_ext-protection.js @@ -1819,7 +1819,7 @@ function apbctCancelAutocomplete(element) { } if (ctPublic.data__key_is_ok) { - if (document.readyState !== 'loading') { + if (document.readyState !== 'loading' && typeof ApbctForceProtection !== 'undefined') { apbctForceProtect(); } else { apbct_attach_event_handler(document, 'DOMContentLoaded', apbctForceProtect); diff --git a/js/src/apbct-public-bundle_full-protection.js b/js/src/apbct-public-bundle_full-protection.js index e1e37363..2bd3fb9c 100644 --- a/js/src/apbct-public-bundle_full-protection.js +++ b/js/src/apbct-public-bundle_full-protection.js @@ -1819,7 +1819,7 @@ function apbctCancelAutocomplete(element) { } if (ctPublic.data__key_is_ok) { - if (document.readyState !== 'loading') { + if (document.readyState !== 'loading' && typeof ApbctForceProtection !== 'undefined') { apbctForceProtect(); } else { apbct_attach_event_handler(document, 'DOMContentLoaded', apbctForceProtect); diff --git a/js/src/apbct-public-bundle_int-protection.js b/js/src/apbct-public-bundle_int-protection.js index 8981b444..b6bafe72 100644 --- a/js/src/apbct-public-bundle_int-protection.js +++ b/js/src/apbct-public-bundle_int-protection.js @@ -1819,7 +1819,7 @@ function apbctCancelAutocomplete(element) { } if (ctPublic.data__key_is_ok) { - if (document.readyState !== 'loading') { + if (document.readyState !== 'loading' && typeof ApbctForceProtection !== 'undefined') { apbctForceProtect(); } else { apbct_attach_event_handler(document, 'DOMContentLoaded', apbctForceProtect);