/*! For license information please see shield-notbot.bundle.js.LICENSE.txt */ (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,r){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._init_data=e,this._base_data=this.retrieveBaseData(),this.init()}var r,n,o;return r=t,(n=[{key:"retrieveBaseData",value:function(){return this._init_data}},{key:"init",value:function(){}},{key:"run",value:function(){}},{key:"exec",value:function(){this.canRun()&&this.run()}},{key:"canRun",value:function(){return!0}}])&&e(r.prototype,n),o&&e(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}());function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function f(t,e){for(var r=0;r=0?(n=t.indexOf(r)+13,o=t.lastIndexOf("##APTO_CLOSE##")):(n=t.indexOf("{"),o=t.lastIndexOf("}"));try{e=JSON.parse(t.substring(n,o))}catch(t){e={}}}return e}}],(r=null)&&f(e.prototype,r),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function y(t,e){for(var r=0;r=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var c=n.call(u,"catchLoc"),f=n.call(u,"finallyLoc");if(c&&f){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function _(t,e,r,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function j(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){_(i,n,o,u,a,"next",t)}function a(t){_(i,n,o,u,a,"throw",t)}u(void 0)}))}}function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function O(t,e){for(var r=0;r0&&this.setNotBotNonce(t),t}},{key:"setNotBotNonce",value:function(t){this._base_data.ajax.not_bot.exnonce=t}},{key:"getNotBotNonce",value:function(){return this.readNotBotNonceFromCookie(),this._base_data.ajax.not_bot.exnonce}},{key:"isNotBotRequestRequired",value:function(){return this._base_data.flags.required||"1"===g.Retrieve("force_notbot")}},{key:"isNotBotFlagCookieMissing",value:function(){var t=p.Get("icwp-wpsf-notbot");return"undefined"===S(t)||void 0===t||""===t}},{key:"runNotBot",value:(u=j(w().mark((function t(){var e=this;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.fetch_RetrieveNotBotNonce().then((function(){return e.fetch_NotBot()}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"fetch_RetrieveNotBotNonce",value:(i=j(w().mark((function t(){var e=this;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:0===this.getNotBotNonce().length&&fetch(this.shield_ajaxurl,this.constructFetchRequestData(this._base_data.ajax.not_bot_nonce)).then((function(t){return t.text()})).then((function(t){var r=s.ParseIt(t);return e.can_send_request=!b.IsEmpty(r),0===e.getNotBotNonce().length&&e.setNotBotNonce(r.data.nonce),t})).catch((function(t){return console.log(t)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"fetch_NotBot",value:(o=j(w().mark((function t(){var e=this;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.getNotBotNonce().length>0&&fetch(this.shield_ajaxurl,this.constructFetchRequestData(this._base_data.ajax.not_bot)).then((function(t){return 401===t.status&&e.setNotBotNonce(""),t})).then((function(t){return t.text()})).then((function(t){var r=s.ParseIt(t);return b.IsEmpty(r)?e.can_send_request=e.notbot_request_success=!1:(e.can_send_request=!0,e.notbot_request_success=r.success),t})).catch((function(t){console.log("notBotSendReqWithFetch() error: "+t)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"constructFetchRequestData",value:function(t){return{method:"POST",body:new URLSearchParams(t).toString(),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8","X-Requested-With":"XMLHttpRequest"}}}},{key:"legacyReq",value:function(){var t=this,e=new XMLHttpRequest;e.open("POST",this.shield_ajaxurl,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.onreadystatechange=function(){if(4===e.readyState){var r=e.response;if(null!=r&&""!==r&&"{"===r.charAt(0)){var n=JSON.parse(r);t.can_send_request=n&&n.success,t.can_send_request||console.log(e.response)}}else t.can_send_request=!1},e.send(new URLSearchParams(this._base_data.ajax.not_bot).toString())}}],r&&O(e.prototype,r),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(a);"shield_vars_notbot"in window&&new E(window.shield_vars_notbot.comps.notbot)})();