(()=>{"use strict";function t(t,e){if(e.length>t.length)return!1;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function e(t){return Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}function n(t){if(t.length%2!=0)throw new Error(`Hex string must have an even length. Got: ${t}`);const e=new ArrayBuffer(t.length/2),n=new DataView(e);for(let e=0;e<t.length;e+=2){const r=t.substring(e,e+2),o=parseInt(r,16);n.setUint8(e/2,o)}return new Uint8Array(e)}async function r(t){await new Promise(e=>setTimeout(e,t))}function o(t){return Math.floor(10*(performance.now()-t))/10}var i,a;!function(t){t.SHA_256="SHA-256",t.SHA_384="SHA-384",t.SHA_512="SHA-512"}(i||(i={})),function(t){t.CODE="code",t.ERROR="error",t.VERIFIED="verified",t.VERIFYING="verifying",t.UNVERIFIED="unverified",t.EXPIRED="expired"}(a||(a={}));class u{nonce;mode;COUNTER_BYTES=4;buffer;dataView;encoder=new TextEncoder;constructor(t,e="uint32"){this.nonce=t,this.mode=e,this.buffer=new Uint8Array(this.nonce.length+this.COUNTER_BYTES),this.buffer.set(this.nonce,0),this.dataView=new DataView(this.buffer.buffer)}setCounter(t){return"string"===this.mode?function(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}(this.nonce,this.encoder.encode(t.toString())):(this.dataView.setUint32(this.nonce.length,t,!1),this.buffer)}}async function c(i){const{challenge:a,controller:c,counterMode:l="uint32",counterStart:f=0,counterStep:s=1,deriveKey:y,timeout:h=9e4}=i,{nonce:p,keyPrefix:b,salt:v}=a.parameters,d=n(p),m=n(v),w=b.length%2==0?n(b):null,g=new u(d,l),S=performance.now();let _=f,O=0,j="",P=S;for(;;){if(c?.signal.aborted||h&&O%10==0&&performance.now()-S>h)return null;const{derivedKey:n}=await y(a.parameters,m,g.setCounter(_));if(O%10==0&&performance.now()-P>200&&(await r(0),P=performance.now()),w?t(n,w):e(n).startsWith(b)){j=e(n);break}_+=s,O+=1}return{counter:_,derivedKey:j,time:o(S)}}Map;async function l(t,e,n){const{cost:r,keyLength:o=32}=t,i=t.algorithm.startsWith("PBKDF2/")?t.algorithm.slice(7):"SHA-256",a=await crypto.subtle.importKey("raw",n,{name:"PBKDF2"},!1,["deriveKey"]),u=await crypto.subtle.deriveKey({name:"PBKDF2",salt:e,iterations:r,hash:i},a,{name:"AES-GCM",length:8*o},!0,["encrypt"]);return{derivedKey:new Uint8Array(await crypto.subtle.exportKey("raw",u))}}function f(t){return f="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},f(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,y(r.key),r)}}function y(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}var h=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},n=[{key:"ParseIt",value:function(t){var e={};try{e=JSON.parse(t)}catch(i){var n="##APTO_OPEN##",r=0,o=0;t.indexOf(n)>=0?(r=t.indexOf(n)+13,o=t.lastIndexOf("##APTO_CLOSE##")):(r=t.indexOf("{"),o=t.lastIndexOf("}"));try{e=JSON.parse(t.substring(r,o))}catch(t){e={}}}return e}}],(e=null)&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function p(t){return p="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},p(t)}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,v(r.key),r)}}function v(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}function d(t){return d="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},d(t)}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,w(r.key),r)}}function w(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:e+""}function g(t,e,n){return e=_(e),function(t,e){if(e&&("object"==d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,S()?Reflect.construct(e,n||[],_(t).constructor):e.apply(t,n))}function S(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(S=function(){return!!t})()}function _(t){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_(t)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}var j=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),g(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(e,t),n=e,(r=[{key:"init",value:function(){this.exec()}}])&&m(n.prototype,r),o&&m(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(function(){return t=function t(){var e=arguments.length>0&&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()},(e=[{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}}])&&b(t.prototype,e),n&&b(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}());function P(t){return P="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},P(t)}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,k(r.key),r)}}function k(t){var e=function(t,e){if("object"!=P(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==P(e)?e:e+""}var C=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},n=[{key:"Get",value:function(t){var e=("; "+document.cookie).split("; "+t+"=");return 2===e.length?e.pop().split(";").shift():""}}],(e=null)&&E(t.prototype,e),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function R(t){return R="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},R(t)}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D(r.key),r)}}function D(t){var e=function(t,e){if("object"!=R(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==R(e)?e:e+""}var T=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},n=[{key:"ObjClone",value:function(t){return JSON.parse(JSON.stringify(t))}},{key:"Merge",value:function(){for(var t={},e=function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n=0;n<arguments.length;n++)e(arguments[n]);return t}},{key:"IsEmpty",value:function(t){return null==t||"object"===R(t)&&0===Object.keys(t).length}}],(e=null)&&A(t.prototype,e),n&&A(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function x(t){return x="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},x(t)}function q(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,F(r.key),r)}}function F(t){var e=function(t,e){if("object"!=x(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=x(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==x(e)?e:e+""}var N=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},n=[{key:"Retrieve",value:function(t){return new URLSearchParams(window.location.search).get(t)}}],(e=null)&&q(t.prototype,e),n&&q(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function B(t){return B="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},B(t)}function H(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,l=Object.create(c.prototype);return I(l,"_invoke",function(n,r,o){var i,u,c,l=0,f=o||[],s=!1,y={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,u=0,c=t,y.n=n,a}};function h(n,r){for(u=n,c=r,e=0;!s&&l&&!o&&e<f.length;e++){var o,i=f[e],h=y.p,p=i[2];n>3?(o=p===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(u=0,y.v=r,y.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,y.n=p,u=0))}if(o||n>1)return a;throw s=!0,r}return function(o,f,p){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&h(f,p),u=f,c=p;(e=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(y.n=-1),h(u,c)):y.n=c:y.v=c);try{if(l=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=y.n<0)?c:n.call(r,y))!==a)break}catch(e){i=t,u=1,c=e}finally{l=1}}return{value:e,done:s}}}(n,o,i),!0),l}var a={};function u(){}function c(){}function l(){}e=Object.getPrototypeOf;var f=[][r]?e(e([][r]())):(I(e={},r,function(){return this}),e),s=l.prototype=u.prototype=Object.create(f);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,I(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,I(s,"constructor",l),I(l,"constructor",c),c.displayName="GeneratorFunction",I(l,o,"GeneratorFunction"),I(s),I(s,o,"Generator"),I(s,r,function(){return this}),I(s,"toString",function(){return"[object Generator]"}),(H=function(){return{w:i,m:y}})()}function I(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}I=function(t,e,n,r){function i(e,n){I(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},I(t,e,n,r)}function U(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function K(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){U(i,r,o,a,u,"next",t)}function u(t){U(i,r,o,a,u,"throw",t)}a(void 0)})}}function G(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,L(r.key),r)}}function L(t){var e=function(t,e){if("object"!=B(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==B(e)?e:e+""}function M(t,e,n){return e=W(e),function(t,e){if(e&&("object"==B(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,V()?Reflect.construct(e,n||[],W(t).constructor):e.apply(t,n))}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(V=function(){return!!t})()}function J(){return J="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=W(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},J.apply(null,arguments)}function W(t){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},W(t)}function X(t,e){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},X(t,e)}var Y=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),M(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&X(t,e)}(e,t),n=e,r=[{key:"init",value:function(){var t,n,r,o,i;this.window_focus_at=Date.now(),this.window_blur_at=0,this.altchaChallengeRequestData=null,this.altchaUnsupported=!1,this.request_count=0,this.failed_request_count=0,this.shield_ajaxurl=this._base_data.ajax.silentcaptcha.ajaxurl,(t=e,n="init",r=this,i=J(W(1&(o=3)?t.prototype:t),n,r),2&o&&"function"==typeof i?function(t){return i.apply(r,t)}:i)([])}},{key:"run",value:function(){var t=this;window.addEventListener("focus",function(){t.window_focus_at=Date.now()}),window.addEventListener("blur",function(){t.window_blur_at=Date.now()}),this.fire()}},{key:"fire",value:function(){this.request_count<10&&this.failed_request_count<5&&this.performPathAltcha()}},{key:"performPathAltcha",value:function(){var t=this;if(this.isAltchaChallengeRequired())if(this.hasAltchaChallengeData()){if(!this.canSolveAltchaChallenge())return this.altchaUnsupported=!0,this.altchaChallengeRequestData=null,void this.reFire();this.request_count++,c({challenge:this.parseAltchaChallenge(this.altchaChallengeRequestData),deriveKey:l}).then(function(e){if(null===e)throw new Error("ALTCHA v2 challenge could not be solved.");t.request_count++;var n=T.ObjClone(t.altchaChallengeRequestData);return n.altcha_solution=JSON.stringify(e),delete n.ajaxurl,delete n._wpnonce,delete n._rest_url,fetch(t.shield_ajaxurl,t.constructFetchRequestData(n)).then(function(t){return t.text()}).then(function(t){if(T.IsEmpty(h.ParseIt(t)))throw new Error("Data in the altcha request could not be parsed.");return t}).then(function(){return t.reFire()})}).catch(function(e){t.failed_request_count++,console.log("hasAltchaChallengeData() error: "+e)}).finally(function(){t.altchaChallengeRequestData=null})}else this.performPathBasicSignal().finally();else this.isBasicSignalRequired()?this.performPathBasicSignal().finally():this.reFire()}},{key:"reFire",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12e4;this.start_refire_at=Date.now(),window.setTimeout(function(){0===e||t.windowHasHadFocus()?t.fire():t.reFire(2500)},e)}},{key:"performPathBasicSignal",value:(a=K(H().m(function t(){return H().w(function(t){for(;;)if(0===t.n)return t.a(2,this.fetchSilentCaptcha())},t,this)})),function(){return a.apply(this,arguments)})},{key:"hasAltchaChallengeData",value:function(){return this.verifyAltchaChallengeData(this.altchaChallengeRequestData)}},{key:"verifyAltchaChallengeData",value:function(t){return null!==this.parseAltchaChallenge(t)}},{key:"parseAltchaChallenge",value:function(t){if(null===t||"object"!==B(t))return null;if("2"!==String(t.altcha_version||"")||"string"!=typeof t.altcha_challenge)return null;try{var e=JSON.parse(t.altcha_challenge),n=(null==e?void 0:e.parameters)||{};return"PBKDF2/SHA-256"===n.algorithm&&"string"==typeof n.nonce&&"string"==typeof n.salt&&"string"==typeof n.keyPrefix&&"string"==typeof n.keySignature&&"number"==typeof n.cost&&"number"==typeof n.expiresAt&&"number"==typeof n.keyLength&&"string"==typeof e.signature?Math.round(Date.now()/1e3)>=Number(n.expiresAt)?null:e:null}catch(t){return null}}},{key:"canSolveAltchaChallenge",value:function(){return!(!window.crypto||!window.crypto.subtle)}},{key:"isBasicSignalRequired",value:function(){return"1"===N.Retrieve("force_notbot")||!this.getNonRequiredFlagsFromCookie().includes("notbot")}},{key:"isAltchaChallengeRequired",value:function(){return!(this.altchaUnsupported||"1"!==N.Retrieve("force_notbot")&&this.getNonRequiredFlagsFromCookie().includes("altcha"))}},{key:"getNonRequiredFlagsFromCookie",value:function(){var t=[],e=C.Get("icwp-wpsf-notbot"),n=("undefined"===B(e)||void 0===e||""===e?"":e).split("Z"),r=n.pop();if(r){var o=/^exp-([0-9]+)$/.exec(r);o&&Math.round(Date.now()/1e3)<Number(o[1])&&(t=n)}return t}},{key:"fetchSilentCaptcha",value:(i=K(H().m(function t(){var e,n=this;return H().w(function(t){for(;;)if(0===t.n)return this.request_count++,delete(e=T.ObjClone(this._base_data.ajax.silentcaptcha)).ajaxurl,delete e._rest_url,delete e._wpnonce,t.a(2,fetch(this.shield_ajaxurl,this.constructFetchRequestData(e)).then(function(t){return t.text()}).then(function(t){var e=h.ParseIt(t);if(T.IsEmpty(e)||!("data"in e))throw new Error("Data in the silentCAPTCHA request could not be parsed.");if("altcha_data"in e.data&&n.verifyAltchaChallengeData(e.data.altcha_data))n.altchaChallengeRequestData=e.data.altcha_data;else if(n.isAltchaChallengeRequired())throw new Error("Could not verify the altcha challenge data in response.");return e}).then(function(){return n.reFire(0)}).catch(function(t){n.failed_request_count++,console.log("fetchSilentCaptcha() error: "+t)}))},t,this)})),function(){return i.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:"windowHasHadFocus",value:function(){return this.window_focus_at>this.window_blur_at||this.window_focus_at>this.start_refire_at}}],r&&G(n.prototype,r),o&&G(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i,a}(j);"shield_vars_silentcaptcha"in window&&new Y(window.shield_vars_silentcaptcha.comps.silentcaptcha)})();