// source --> https://one-fox.com/wp-content/plugins/linguise/assets/js/front.bundle.js?ver=2.2.42 
/*! For license information please see front.bundle.js.LICENSE.txt */
(()=>{var e,t,n={955:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var i=n(38),r=n(136),a=n(994),s=n(226),o=n(13),l=function(){function e(e){(0,a.supportsWebCrypto)((0,s.locateWindow)())?this.hash=new i.Sha256(e):this.hash=new r.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update((0,o.convertToBuffer)(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();t.Sha256=l},634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=void 0,n(455).__exportStar(n(258),t);var i=n(38);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return i.Sha256}})},38:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var i=n(13),r=n(955),a=n(226),s=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!(0,i.isEmptyData)(e)){var t=(0,i.convertToBuffer)(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return(0,a.locateWindow)().crypto.subtle.sign(r.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,i.isEmptyData)(this.toHash)?Promise.resolve(r.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,a.locateWindow)().crypto.subtle.digest(r.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise((function(t,n){(0,a.locateWindow)().crypto.subtle.importKey("raw",(0,i.convertToBuffer)(e.secret),r.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))},e}();t.Sha256=s},455:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__assign:()=>a,__asyncDelegator:()=>w,__asyncGenerator:()=>y,__asyncValues:()=>E,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>x,__classPrivateFieldSet:()=>S,__createBinding:()=>d,__decorate:()=>o,__exportStar:()=>g,__extends:()=>r,__generator:()=>h,__importDefault:()=>A,__importStar:()=>T,__makeTemplateObject:()=>v,__metadata:()=>c,__param:()=>l,__read:()=>p,__rest:()=>s,__spread:()=>_,__spreadArrays:()=>m,__values:()=>f});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)};function r(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function s(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function o(e,t,n,i){var r,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,n,s):r(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,i){t(n,i,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}l((i=i.apply(e,t||[])).next())}))}function h(e,t){var n,i,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}function d(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}function g(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}function m(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,r++)i[r]=a[s];return i}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function y(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),a=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(e){r[e]&&(i[e]=function(t){return new Promise((function(n,i){a.push([e,t,n,i])>1||o(e,t)}))})}function o(e,t){try{(n=r[e](t)).value instanceof b?Promise.resolve(n.value.v).then(l,c):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function l(e){o("next",e)}function c(e){o("throw",e)}function u(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}}function w(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,r){t[i]=e[i]?function(t){return(n=!n)?{value:b(e[i](t)),done:"return"===i}:r?r(t):t}:r}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,r){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,r,(t=e[n](t)).done,t.value)}))}}}function v(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},136:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Sha256:()=>u});var i=n(635),r=64,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],o=Math.pow(2,53)-1,l=function(){function e(){this.state=Int32Array.from(s),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>o)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r>=56){for(var i=this.bufferLength;i<r;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<56;i++)t.setUint8(i,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var a=new Uint8Array(32);for(i=0;i<8;i++)a[4*i]=this.state[i]>>>24&255,a[4*i+1]=this.state[i]>>>16&255,a[4*i+2]=this.state[i]>>>8&255,a[4*i+3]=this.state[i]>>>0&255;return a},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],s=t[2],o=t[3],l=t[4],c=t[5],u=t[6],h=t[7],d=0;d<r;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var g=this.temp[d-2],f=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,p=((g=this.temp[d-15])>>>7|g<<25)^(g>>>18|g<<14)^g>>>3;this.temp[d]=(f+this.temp[d-7]|0)+(p+this.temp[d-16]|0)}var _=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&c^~l&u)|0)+(h+(a[d]+this.temp[d]|0)|0)|0,m=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&s^i&s)|0;h=u,u=c,c=l,l=o+_|0,o=s,s=i,i=n,n=_+m|0}t[0]+=n,t[1]+=i,t[2]+=s,t[3]+=o,t[4]+=l,t[5]+=c,t[6]+=u,t[7]+=h},e}(),c=n(13),u=function(){function e(e){this.secret=e,this.hash=new l,this.reset()}return e.prototype.update=function(e){if(!(0,c.isEmptyData)(e)&&!this.error)try{this.hash.update((0,c.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,i.sH)(this,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){return[2,this.digestSync()]}))}))},e.prototype.reset=function(){if(this.hash=new l,this.secret){this.outer=new l;var e=function(e){var t=(0,c.convertToBuffer)(e);if(t.byteLength>r){var n=new l;n.update(t),t=n.digest()}var i=new Uint8Array(r);return i.set(t),i}(this.secret),t=new Uint8Array(r);t.set(e);for(var n=0;n<r;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n<e.byteLength;n++)e[n]=0}},e}()},994:(e,t,n)=>{"use strict";n.r(t),n.d(t,{supportsSecureRandom:()=>s,supportsSubtleCrypto:()=>o,supportsWebCrypto:()=>a,supportsZeroByteGCM:()=>l});var i=n(635),r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function a(e){return!(!s(e)||"object"!=typeof e.crypto.subtle)&&o(e.crypto.subtle)}function s(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function o(e){return e&&r.every((function(t){return"function"==typeof e[t]}))}function l(e){return(0,i.sH)(this,void 0,void 0,(function(){var t;return(0,i.YH)(this,(function(n){switch(n.label){case 0:if(!o(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},13:(e,t,n)=>{"use strict";n.r(t),n.d(t,{convertToBuffer:()=>r,isEmptyData:()=>a,numToUint8:()=>s,uint32ArrayFrom:()=>o});var i="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function r(e){return e instanceof Uint8Array?e:"string"==typeof e?i(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function a(e){return"string"==typeof e?0===e.length:0===e.byteLength}function s(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}function o(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}},226:(e,t,n)=>{"use strict";n.r(t),n.d(t,{locateWindow:()=>r});const i={};function r(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}},260:e=>{"use strict";function t(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}t.proto=function(){return RegExp.escape=t,t},e.exports=t},735:e=>{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],i=e[1],r=e[2],a=e[3];i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&r|~i&a)+t[0]-680876936|0)<<7|n>>>25)+i|0)&i|~n&r)+t[1]-389564586|0)<<12|a>>>20)+n|0)&n|~a&i)+t[2]+606105819|0)<<17|r>>>15)+a|0)&a|~r&n)+t[3]-1044525330|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&r|~i&a)+t[4]-176418897|0)<<7|n>>>25)+i|0)&i|~n&r)+t[5]+1200080426|0)<<12|a>>>20)+n|0)&n|~a&i)+t[6]-1473231341|0)<<17|r>>>15)+a|0)&a|~r&n)+t[7]-45705983|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&r|~i&a)+t[8]+1770035416|0)<<7|n>>>25)+i|0)&i|~n&r)+t[9]-1958414417|0)<<12|a>>>20)+n|0)&n|~a&i)+t[10]-42063|0)<<17|r>>>15)+a|0)&a|~r&n)+t[11]-1990404162|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&r|~i&a)+t[12]+1804603682|0)<<7|n>>>25)+i|0)&i|~n&r)+t[13]-40341101|0)<<12|a>>>20)+n|0)&n|~a&i)+t[14]-1502002290|0)<<17|r>>>15)+a|0)&a|~r&n)+t[15]+1236535329|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&a|r&~a)+t[1]-165796510|0)<<5|n>>>27)+i|0)&r|i&~r)+t[6]-1069501632|0)<<9|a>>>23)+n|0)&i|n&~i)+t[11]+643717713|0)<<14|r>>>18)+a|0)&n|a&~n)+t[0]-373897302|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&a|r&~a)+t[5]-701558691|0)<<5|n>>>27)+i|0)&r|i&~r)+t[10]+38016083|0)<<9|a>>>23)+n|0)&i|n&~i)+t[15]-660478335|0)<<14|r>>>18)+a|0)&n|a&~n)+t[4]-405537848|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&a|r&~a)+t[9]+568446438|0)<<5|n>>>27)+i|0)&r|i&~r)+t[14]-1019803690|0)<<9|a>>>23)+n|0)&i|n&~i)+t[3]-187363961|0)<<14|r>>>18)+a|0)&n|a&~n)+t[8]+1163531501|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i&a|r&~a)+t[13]-1444681467|0)<<5|n>>>27)+i|0)&r|i&~r)+t[2]-51403784|0)<<9|a>>>23)+n|0)&i|n&~i)+t[7]+1735328473|0)<<14|r>>>18)+a|0)&n|a&~n)+t[12]-1926607734|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i^r^a)+t[5]-378558|0)<<4|n>>>28)+i|0)^i^r)+t[8]-2022574463|0)<<11|a>>>21)+n|0)^n^i)+t[11]+1839030562|0)<<16|r>>>16)+a|0)^a^n)+t[14]-35309556|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i^r^a)+t[1]-1530992060|0)<<4|n>>>28)+i|0)^i^r)+t[4]+1272893353|0)<<11|a>>>21)+n|0)^n^i)+t[7]-155497632|0)<<16|r>>>16)+a|0)^a^n)+t[10]-1094730640|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i^r^a)+t[13]+681279174|0)<<4|n>>>28)+i|0)^i^r)+t[0]-358537222|0)<<11|a>>>21)+n|0)^n^i)+t[3]-722521979|0)<<16|r>>>16)+a|0)^a^n)+t[6]+76029189|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((a=((a+=((n=((n+=(i^r^a)+t[9]-640364487|0)<<4|n>>>28)+i|0)^i^r)+t[12]-421815835|0)<<11|a>>>21)+n|0)^n^i)+t[15]+530742520|0)<<16|r>>>16)+a|0)^a^n)+t[2]-995338651|0)<<23|i>>>9)+r|0,i=((i+=((a=((a+=(i^((n=((n+=(r^(i|~a))+t[0]-198630844|0)<<6|n>>>26)+i|0)|~r))+t[7]+1126891415|0)<<10|a>>>22)+n|0)^((r=((r+=(n^(a|~i))+t[14]-1416354905|0)<<15|r>>>17)+a|0)|~n))+t[5]-57434055|0)<<21|i>>>11)+r|0,i=((i+=((a=((a+=(i^((n=((n+=(r^(i|~a))+t[12]+1700485571|0)<<6|n>>>26)+i|0)|~r))+t[3]-1894986606|0)<<10|a>>>22)+n|0)^((r=((r+=(n^(a|~i))+t[10]-1051523|0)<<15|r>>>17)+a|0)|~n))+t[1]-2054922799|0)<<21|i>>>11)+r|0,i=((i+=((a=((a+=(i^((n=((n+=(r^(i|~a))+t[8]+1873313359|0)<<6|n>>>26)+i|0)|~r))+t[15]-30611744|0)<<10|a>>>22)+n|0)^((r=((r+=(n^(a|~i))+t[6]-1560198380|0)<<15|r>>>17)+a|0)|~n))+t[13]+1309151649|0)<<21|i>>>11)+r|0,i=((i+=((a=((a+=(i^((n=((n+=(r^(i|~a))+t[4]-145523070|0)<<6|n>>>26)+i|0)|~r))+t[11]-1120210379|0)<<10|a>>>22)+n|0)^((r=((r+=(n^(a|~i))+t[2]+718787259|0)<<15|r>>>17)+a|0)|~n))+t[9]-343485551|0)<<21|i>>>11)+r|0,e[0]=n+e[0]|0,e[1]=i+e[1]|0,e[2]=r+e[2]|0,e[3]=a+e[3]|0}function i(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function r(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function a(e){var t,r,a,s,o,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(u,i(e.substring(t-64,t)));for(r=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(u,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(s[2],16),l=parseInt(s[1],16)||0,a[14]=o,a[15]=l,n(u,a),u}function s(e){var t,i,a,s,o,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(u,r(e.subarray(t-64,t)));for(i=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)a[t>>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(u,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(s[2],16),l=parseInt(s[1],16)||0,a[14]=o,a[15]=l,n(u,a),u}function o(e){var n,i="";for(n=0;n<4;n+=1)i+=t[e>>8*n+4&15]+t[e>>8*n&15];return i}function l(e){var t;for(t=0;t<e.length;t+=1)e[t]=o(e[t]);return e.join("")}function c(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function u(e,t){var n,i=e.length,r=new ArrayBuffer(i),a=new Uint8Array(r);for(n=0;n<i;n+=1)a[n]=e.charCodeAt(n);return t?a:r}function h(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function d(e,t,n){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e)),i.set(new Uint8Array(t),e.byteLength),n?i:i.buffer}function g(e){var t,n=[],i=e.length;for(t=0;t<i-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function f(){this.reset()}return l(a("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,i){var r,a,s,o,l=this.byteLength,c=t(n,l),u=l;return i!==e&&(u=t(i,l)),c>u?new ArrayBuffer(0):(r=u-c,a=new ArrayBuffer(r),s=new Uint8Array(a),o=new Uint8Array(this,c,r),s.set(o),a)}}(),f.prototype.append=function(e){return this.appendBinary(c(e)),this},f.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,r=this._buff.length;for(t=64;t<=r;t+=64)n(this._hash,i(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},f.prototype.end=function(e){var t,n,i=this._buff,r=i.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<r;t+=1)a[t>>2]|=i.charCodeAt(t)<<(t%4<<3);return this._finish(a,r),n=l(this._hash),e&&(n=g(n)),this.reset(),n},f.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},f.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},f.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},f.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},f.prototype._finish=function(e,t){var i,r,a,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;i=(i=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(i[2],16),a=parseInt(i[1],16)||0,e[14]=r,e[15]=a,n(this._hash,e)},f.hash=function(e,t){return f.hashBinary(c(e),t)},f.hashBinary=function(e,t){var n=l(a(e));return t?g(n):n},f.ArrayBuffer=function(){this.reset()},f.ArrayBuffer.prototype.append=function(e){var t,i=d(this._buff.buffer,e,!0),a=i.length;for(this._length+=e.byteLength,t=64;t<=a;t+=64)n(this._hash,r(i.subarray(t-64,t)));return this._buff=t-64<a?new Uint8Array(i.buffer.slice(t-64)):new Uint8Array(0),this},f.ArrayBuffer.prototype.end=function(e){var t,n,i=this._buff,r=i.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<r;t+=1)a[t>>2]|=i[t]<<(t%4<<3);return this._finish(a,r),n=l(this._hash),e&&(n=g(n)),this.reset(),n},f.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},f.ArrayBuffer.prototype.getState=function(){var e=f.prototype.getState.call(this);return e.buff=h(e.buff),e},f.ArrayBuffer.prototype.setState=function(e){return e.buff=u(e.buff,!0),f.prototype.setState.call(this,e)},f.ArrayBuffer.prototype.destroy=f.prototype.destroy,f.ArrayBuffer.prototype._finish=f.prototype._finish,f.ArrayBuffer.hash=function(e,t){var n=l(s(new Uint8Array(e)));return t?g(n):n},f}()},635:(e,t,n)=>{"use strict";n.d(t,{YH:()=>r,sH:()=>i});function i(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}l((i=i.apply(e,t||[])).next())}))}function r(e,t){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var a=i[e]={exports:{}};return n[e](a,a.exports,r),a.exports}r.m=n,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"js/"+e+".bundle.js",r.miniCssF=e=>"css/front.bundle.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="wordpress-plugin:",r.l=(n,i,a,s)=>{if(e[n])e[n].push(i);else{var o,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var h=c[u];if(h.getAttribute("src")==n||h.getAttribute("data-webpack")==t+a){o=h;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,r.nc&&o.setAttribute("nonce",r.nc),o.setAttribute("data-webpack",t+a),o.src=n),e[n]=[i];var d=(t,i)=>{o.onerror=o.onload=null,clearTimeout(g);var r=e[n];if(delete e[n],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach((e=>e(i))),t)return t(i)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=d.bind(null,o.onerror),o.onload=d.bind(null,o.onload),l&&document.head.appendChild(o)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e+"../"})(),(()=>{var e={440:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var a=new Promise(((n,r)=>i=e[t]=[n,r]));n.push(i[2]=a);var s=r.p+r.u(t),o=new Error;r.l(s,(n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+a+": "+s+")",o.name="ChunkLoadError",o.type=a,o.request=s,i[1](o)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,a,[s,o,l]=n,c=0;if(s.some((t=>0!==e[t]))){for(i in o)r.o(o,i)&&(r.m[i]=o[i]);if(l)l(r)}for(t&&t(n);c<s.length;c++)a=s[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0},n=self.webpackChunkwordpress_plugin=self.webpackChunkwordpress_plugin||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";let e,t=!1;try{crypto.randomUUID(),t=!0}catch(e){console.warn("Linguise: crypto.randomUUID is not available, using unsafe UUID generator")}class n{constructor(e=!1){this._enabled=e,this.name=void 0,this.__children={},this.__parent=void 0}createChild(t){if(t in this.__children)return this.__children[t];const i=new n(e._enabled);return i.__parent=this,i.name=t,this.__children[t]=i,i}enable(e,t=!1){if(this._enabled=e,t)for(const n in this.__children)this.__children[n].enable(e,t)}_getNames(){const e=[];return this.__parent&&e.push(...this.__parent._getNames()),this.name&&e.push(this.name),e}_call(e,...t){if(!this._enabled)return;const n=this._getNames().map((e=>`[${e}]`)),i=["%c[%cLinguise%c]","font-weight: bold","font-weight: bold; background-color: #5e47be; color: white;","font-weight: bold"];n.length>0&&(i[0]=i[0]+" "+n.join(" "));e(...[...i,...t])}log(...e){this._call(console.log,...e)}error(...e){this._call(console.error,...e)}debug(...e){this._call(console.debug,...e)}warn(...e){this._call(console.warn,...e)}info(...e){this._call(console.info,...e)}}e=new n;const i=["SCRIPT","NOSCRIPT","HEAD","META","STYLE","IFRAME","OBJECT","SELECT","AREA","AUDIO","SVG","MATH","CANVAS","MAP","AUDIO","TRACK","VIDEO"],a=[...i,"TEXTAREA","INPUT"],s={IMG:["alt","title","src"],A:["href"],INPUT:["placeholder"],TEXTAREA:["placeholder"]};function o(){return t?crypto.randomUUID():function(){let e=(new Date).getTime(),t="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var i=16*Math.random();return e>0?(i=(e+i)%16|0,e=Math.floor(e/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),("x"===n?i:3&i|8).toString(16)}))}()}function l(e,t){let n=null;return(...i)=>{clearTimeout(n),n=setTimeout((()=>{e(...i)}),t)}}function c(e){if("string"!=typeof e)return{leading:"",trailing:"",content:e};const t=e.match(/^\s+/),n=e.match(/\s+$/);return{leading:t?t[0]:"",trailing:n?n[0]:"",content:e.trim()}}const u="v4.1",h="_linguise_ttl",d="linguiseDynamicCache";function g(e){return Math.floor(((new Date).getTime()+e)/1e3)}function f(e,t){return t?`${t}::${e}`:e}class p{static instance=null;constructor(e=!1){this.caches={},this.global_ttl=void 0,this.MAX_TTL_TIME=2592e5,this.saveToStorageDebounced=l(this.saveToStorage.bind(this),300),e||document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.saveToStorage()}))}importFromStorage(){const e=localStorage.getItem(d);if(!e)return;const t=JSON.parse(e);t.version===u&&(this.caches=t.caches,this.global_ttl=Number(t[h]),this.updateTTL())}updateTTL(){const e=Math.floor((new Date).getTime()/1e3);if(isNaN(this.global_ttl))return this.global_ttl=g(this.MAX_TTL_TIME),void this.saveToStorageDebounced();e>this.global_ttl&&(this.caches={}),this.global_ttl=g(this.MAX_TTL_TIME),this.saveToStorageDebounced()}setMaxTTL(e){this.MAX_TTL_TIME=e,this.updateTTL()}add(e,t,n,i){if(!n)throw new Error("Language is required");this.updateTTL(),this.caches[n]=this.caches[n]||{};const r=f(e,i);this.caches[n][r]?(this.caches[n][r].value=t,this.caches[n][r].ttl=g(this.MAX_TTL_TIME)):this.caches[n][r]={value:t,ttl:g(this.MAX_TTL_TIME)},this.saveToStorageDebounced()}get(e,t,n){if(!t)throw new Error("Language is required");const i=(new Date).getTime();if(1e3*this.global_ttl<i)return void this.flush();this.caches[t]=this.caches[t]||{};const r=f(e,n),a=this.caches[t][r];if(a){if(!(1e3*a.ttl<i))return this.caches[t][r].ttl=Math.floor((i+this.MAX_TTL_TIME)/1e3),this.updateTTL(),a.value;try{delete this.caches[t][r]}catch{}this.updateTTL()}}saveToStorage(){localStorage.setItem(d,JSON.stringify({version:u,caches:this.caches,[h]:this.global_ttl}))}flush(){this.caches={},this.updateTTL()}}function _(){return p.instance||(p.instance=new p,window.globalLinguiseCache=p.instance),p.instance}class m{constructor(e,t,n,i={}){this.id=e?e.id:"noop",this.index=t;const{leading:r,trailing:a,content:s}=c(n);this.text=s,this.leading=r,this.trailing=a,this.metaExtra=i,this.editorMeta=null,this.node=e,this.subId=null,this.tagName=null}isCached(){return Boolean(this.node&&this.node.cachedIndex.includes(this.index))}asHtml(){if(this.isCached())return;const e=this.tagName?this.tagName:this.node?this.node.tagWrapper:"div",t=["linguiseId","linguiseIndex","linguiseSubId","linguiseMetaExtra"],n=document.createElement("div"),i=document.createElement(e),r=[];if(this.metaExtra)for(const[e,t]of Object.entries(this.metaExtra))i.setAttribute(e,t),r.push(e);if(this.node){let e=(this.node.element.nodeType===Node.TEXT_NODE?this.node.element.parentElement:this.node.element.attributes).className||"";const n=this.node.extraMetadata.class||[];if(n.length>0){const t=n.filter((e=>""!==e.trim()));e+=` ${Array.from(new Set(t)).join(" ")}`}if("string"==typeof e&&e.trim().length&&(i.className=e.trim()),this.node.extraMetadata.id&&(i.id=this.node.extraMetadata.id),this.node.extraMetadata.dataset)for(const e of Object.keys(this.node.extraMetadata.dataset)){if(-1!==t.indexOf(e))continue;const n=this.node.extraMetadata.dataset[e];i.dataset[e]=n}}return i.dataset.linguiseId=this.id,i.dataset.linguiseIndex=this.index.toString(),this.subId&&(i.dataset.linguiseSubId=this.subId),r.length>0&&(i.dataset.linguiseMetaExtra=r.join(";;")),i.textContent=this.text||"",n.appendChild(i),n.innerHTML}static fromElement(e){const t=e.querySelector('span[data-editor="linguise"]');let n=e;t&&(n=t);const i=e.dataset.linguiseId;let r=e.dataset.linguiseIndex;if(!i||!r)return;if(r=Number.parseInt(r,10),isNaN(r))return;const a={};if(e.dataset.linguiseMetaExtra){const t=e.dataset.linguiseMetaExtra.split(";;");for(const n of t)a[n]=e.getAttribute(n)}const s=new m(null,r,n.textContent,a);s.id=i;const o=e.dataset.linguiseSubId;if(o&&(s.subId=o),e.dataset&&"linguise"===e.dataset.editor){const t=e.dataset.linguiseHash,n=e.dataset.linguiseType,i=e.dataset.linguiseAltHash;s.editorMeta={hash:t,type:n,altHash:i}}if(t&&t.dataset&&"linguise"===t.dataset.editor){const e=t.dataset.linguiseHash;s.editorMeta={hash:e}}return s}static fromString(e){if("string"!=typeof e)return;const t=document.createElement("div");t.innerHTML=e;const n=t.firstElementChild;return n?m.fromElement(n):void 0}}const b=m;const y=class{constructor(e,t){this.id=o(),this.element=e,this.parentElement=t||e,this._cachedTokenized=void 0,this.cachedIndex=[],this._blurred=!1,this.tagWrapper="div",this.extraMetadata={},this.mergeable=!1}shouldWeTranslate(e){const t=e.trim();return""!==t&&(!/^\d+(?:[,.]\d+)*$/.test(t)&&!/^[^a-zA-Z\p{L}]*$/u.test(t))}tokenize(e=!1){if(void 0!==this._cachedTokenized&&!e)return this._cachedTokenized;if(this.element.nodeType===Node.TEXT_NODE){const t=Array.from(this.parentElement.childNodes).indexOf(this.element);if(-1===t)throw new Error("can't find index of text node");if(!this.shouldWeTranslate(this.element.textContent))return[];const n=[new b(this,t,this.element.textContent)];return e||(this._cachedTokenized=n),n}let t=[];for(let e=0;e<this.element.childNodes.length;e++){const n=this.element.childNodes[e];if(n.nodeType===Node.TEXT_NODE){if(!this.shouldWeTranslate(n.textContent))continue;t.push(new b(this,e,n.textContent))}}return e||(this._cachedTokenized=t),t}asHtml(){const e=this.tokenize();if(!e.length)return;let t=[];for(let n=0;n<e.length;n++){const i=e[n].asHtml();i&&t.push(i)}return t.length?t.join(""):void 0}applyAttributeChange(e,t,n){let i=this.element;i.nodeType===Node.TEXT_NODE&&(i=this.parentElement);const r=i.getAttribute(e);n.dryRun&&(t="href"===e?`${r}#linguise-translated-demo`:`${r} (translated)`);const{trailing:a,leading:s}=c(r),o=s+t+a;i.setAttribute(e,o),n.skipCache||n.dryRun||_().add(r,t,n.language,n.subId||e)}bindEditor(e){window._linguiseEditor&&window._linguiseEditor.attach(e)}unbindEditor(e){window._linguiseEditor&&window._linguiseEditor.detach(e)}attachEditor(e){const t=this.element.nodeType===Node.TEXT_NODE?this.parentElement:this.element;e.editorMeta&&t&&(t.setAttribute("data-editor","linguise"),t.setAttribute("data-linguise-hash",e.editorMeta.hash),t.setAttribute("data-linguise-type",e.editorMeta.type),e.editorMeta.altHash&&t.setAttribute("data-linguise-alt-hash",e.editorMeta.altHash),this.bindEditor(t))}detachEditor(){const e=this.element.nodeType===Node.TEXT_NODE?this.parentElement:this.element;e&&(this.element.nodeType===Node.TEXT_NODE&&"linguise"===e.getAttribute("data-editor")&&e.setAttribute("data-linguise-was-edit","1"),e.removeAttribute("data-editor"),e.removeAttribute("data-linguise-hash"),e.removeAttribute("data-linguise-type"),e.removeAttribute("data-linguise-alt-hash"),this.unbindEditor(e))}applyChange(e,t,n){const i=Object.assign({},{dryRun:!1,skipCache:!1},n||{});i.skipCache||this.cachedIndex.push(e.index);const r=this.tokenize().find((t=>t.index===e.index));if(r)if(this.element.nodeType===Node.TEXT_NODE)if(i.dryRun)e.text+=" (translated)",this.element.textContent=this.withSpacing(r,e);else if(i.skipCache||_().add(r.text,e.text,t,e.subId),e.editorMeta)if(this.parentElement&&"SPAN"===this.parentElement.tagName&&"1"===this.parentElement.getAttribute("data-linguise-was-edit"))this.parentElement.setAttribute("data-editor","linguise"),this.parentElement.setAttribute("data-linguise-hash",e.editorMeta.hash),this.parentElement.setAttribute("data-linguise-editor-wrap","1"),this.parentElement.removeAttribute("data-linguise-was-edit"),this.element.textContent=this.withSpacing(r,e),this.bindEditor(this.parentElement);else{const t=document.createElement("span");t.textContent=this.withSpacing(r,e),t.setAttribute("data-editor","linguise"),t.setAttribute("data-linguise-hash",e.editorMeta.hash),t.setAttribute("data-linguise-editor-wrap","1"),this.bindEditor(t),this.element.replaceWith(t)}else this.element.textContent=this.withSpacing(r,e);else if(this.element.childNodes[e.index])if(i.dryRun)e.text+=" (translated)",this.element.childNodes[e.index].textContent=this.withSpacing(r,e);else{i.skipCache||_().add(r.text,e.text,t,e.subId);const n=this.element.childNodes[e.index];if(e.editorMeta){const t=document.createElement("span");t.textContent=this.withSpacing(r,e),t.setAttribute("data-editor","linguise"),t.setAttribute("data-linguise-hash",e.editorMeta.hash),t.setAttribute("data-linguise-editor-wrap","1"),this.bindEditor(t),n.replaceWith(t)}else n.textContent=this.withSpacing(r,e)}}withSpacing(e,t){return e.leading+t.text+e.trailing}isElementModified(e=null){const t=this.tokenize(),n=this.tokenize(!0);if("number"==typeof e){const i=t.find((t=>t.index===e)),r=n.find((t=>t.index===e));if(!i||!r)return!0;if(i.text!==r.text)return!0;for(const e in i.metaExtra)if(i.metaExtra[e]!==r.metaExtra[e])return!0;return!1}if(t.length!==n.length)return!0;t.sort(((e,t)=>e.index-t.index)),n.sort(((e,t)=>e.index-t.index));for(let e=0;e<t.length;e++){const i=t[e],r=n[e];if(i.text!==r.text)return!0;for(const e in i.metaExtra)if(i.metaExtra[e]!==r.metaExtra[e])return!0}return!1}blurParent(){this.parentElement&&!this._blurred&&(this.parentElement.setAttribute("data-linguise-loading","1"),this._blurred=!0)}unblurParent(){this.parentElement&&(this.parentElement.removeAttribute("data-linguise-loading"),this._blurred=!1)}};var w=r(634),E=r(735),v=r.n(E);const T=new class{getLanguageUrl(e,t){return this.isDemoMode(e)?"#":"joomla"===e.platform?this.fixTrailingSlashes(e,this.getJoomlaLanguageUrl(t,e)):"wordpress"===e.platform?this.fixTrailingSlashes(e,this.getWpLanguageUrl(t,e)):this.fixTrailingSlashes(e,this.getOtherCMSUrl(e,t))}getOtherCMSUrl(e,t){return"subdomains"===e.domain_structure?this.getUrlForSubDomains(e,t):this.getUrlForSubFolders(e,t)}isAlternateEmpty(e){return"string"==typeof e&&""===e.trim()||null==e}getWpLanguageUrl(e,t){const n=document.querySelector('link[rel="alternate"][hreflang="'+e+'"]');if(!this.isAlternateEmpty(n?.href)){let e=n.href;const t=new URL(window.location.href),i=t?.search;return i&&""!==i&&!e.includes(i)&&(e+=i),e}return t.scheme+"//"+t.host+(t.base?t.base:"")+(e===t.default_language?"":"/"+e)+t.original_path+t.trailing_slashes+(t.search?t.search:"")}getJoomlaLanguageUrl(e,t){const n=document.querySelector('link[rel="alternate"][hreflang="'+e+'"]');if(!this.isAlternateEmpty(n?.href))return n.href;return-1!==(t.linguise_configs?.joomla_languages||[]).indexOf(e)&&e!==t.default_language?`${t.scheme}//${t.host+(t.base?t.base:"")+"/"+e+t.trailing_slashes}`:`${t.scheme}//${t.host+(t.base?t.base:"")+(e===t.default_language?"":"/"+e)+t.original_path+t.trailing_slashes+(t.search?t.search:"")}`}fixTrailingSlashes(e,t){const n=new URL(t);return"/"===n.pathname||(n.pathname=n.pathname.replace(/\/+$/,""),n.pathname=n.pathname+e.trailing_slashes),n.toString()}getUrlForSubFolders(e,t){const n=e.parent.url_translations?.[t],i=e.parent.url_translations?.[e.default_language];return"string"==typeof n?e.domain+(t===e.default_language?"":"/"+t)+n:"string"==typeof i?e.domain+(t===e.default_language?"":"/"+t)+i:e.domain+(t===e.default_language?"":"/"+t)+e.getPath()+(e.search??"")}getUrlForSubDomains(e,t){const n=e.domain,i=n.substring(0,n.indexOf("//")+2),r=e.available_languages.map((e=>e.code));let a=n.replace(new RegExp(`(https?://(?:${r.join("|")})\\.|https?://)`,""),"");t!==e.default_language&&a.startsWith("www.")&&(a=a.substring(4));const s=e.parent.url_translations?.[t],o=e.parent.url_translations?.[e.default_language];return"string"==typeof s?i+(t===e.default_language?"":t+".")+a+s:"string"==typeof o?i+(t===e.default_language?"":t+".")+a+o:i+(t===e.default_language?"":t+".")+a+e.path+(e.search??"")}sort(e){["joomla","wordpress"].includes(e.platform)||e.available_languages.sort(((t,n)=>t.code===e.default_language?-1:n.code===e.default_language?1:t.original_name<n.original_name))}getFlagClass(e,t){return"en"===t&&"en-gb"===e?.flag_en_type?"en_gb":"de"===t&&"de-at"===e?.flag_de_type?"de_at":"es"===t&&"es-mx"===e?.flag_es_type?"es_mx":"es"===t&&"es-pu"===e?.flag_es_type?"es_pu":"pt"===t&&"pt-br"===e?.flag_pt_type?"pt_br":"zh-tw"===t&&"zh-cn"===e?.flag_tw_type?"zh-cn":t}renderFlag(e,t){if(e){const{enabled_flag:n,flag_width:i,flag_shape:r,flag_border_radius:a}=e;return n?`<span \n                        class="linguise_flags linguise_flag_${this.getFlagClass(e,t)} linguise_language_icon" \n                        style="width: ${i+"px"}; min-width: ${i+"px"};\n                               height: ${("rectangular"===r?i/1.7:i)+"px"};\n                               min-height: ${("rectangular"===r?i/1.7:i)+"px"};\n                               border-radius: ${"rectangular"===r?a+"px":"50%"};">         \n                    </span>`:""}return`<span class="linguise_flags linguise_flag_${this.getFlagClass(e,t)} linguise_language_icon" style="width: 24px; height: 24px; border-radius: 50%"></span>`}isLanguageNameEnabled(e,t=!1){const n=Boolean(e?.enabled_lang_short_name),i=t?Boolean(e.enabled_lang_name_popup||e.enabled_lang_name):Boolean(e.enabled_lang_name);return!(t||i||!n)||i}renderLanguageName(e,t,n,i,r=!1){if(e){if(!this.isLanguageNameEnabled(e,r))return"";let a="en"===e.lang_name_display?n:i;return e.enabled_lang_short_name&&(a=t.toUpperCase()),`<span class="linguise_lang_name mr-10 ${r?"popup_linguise_lang_name":""}">${a}</span>`}return`<span class="linguise_lang_name popup_linguise_lang_name">${i}</span>`}colorAndHoverLanguageName(e,t,n){const i=e?.flag_shadow_color||"#eeeeee",r=e?.flag_hover_shadow_color||"#bfbfbf",a=e?.flag_shadow_color_alpha??1,s=e?.flag_hover_shadow_color_alpha??1,o=this.mixinColorAndAlpha(i,this.clampAlpha(a))||i,l=this.mixinColorAndAlpha(r,this.clampAlpha(s))||r,c=""+((e?.flag_shadow_h??2)+"px "+(e?.flag_shadow_v??2)+"px "+(e?.flag_shadow_blur??12)+"px "+(e?.flag_shadow_spread??0)+"px "+o),u=""+((e?.flag_hover_shadow_h??3)+"px "+(e?.flag_hover_shadow_v??3)+"px "+(e?.flag_hover_shadow_blur??6)+"px "+(e?.flag_hover_shadow_spread??0)+"px "+l),h=(e,t,n,i,r,a)=>{e.style.color=n||"#000000",t&&(t.style.boxShadow=r),e.parentNode.addEventListener("mouseover",(function(){e.style.color=i||"#000000",t&&(t.style.boxShadow=a)})),e.parentNode.addEventListener("mouseout",(function(){e.style.color=n||"#000000",t&&(t.style.boxShadow=r)}))};Array.from(t).forEach((function(t){const n=t.previousElementSibling;h(t,n,e?.language_name_color,e?.language_name_hover_color,c,u)})),Array.from(n).forEach((function(t){const n=t.previousElementSibling;h(t,n,e?.popup_language_name_color,e?.popup_language_name_hover_color,c,u)}))}languagePosition(e,t,n){const i=e.querySelector(".linguise_switcher"),r=e.querySelector(".linguise_switcher_sub");let a="";switch(n){case"no":default:break;case"top_left":case"top_left_no_scroll":a="position: fixed; top: 10px; left: 10px; z-index: 99999; background: #fff; border-radius: 0;";break;case"top_right":case"top_right_no_scroll":a="position: fixed; top: 10px; right: 10px;z-index: 99999; background: #fff; border-radius: 0;";break;case"bottom_left":case"bottom_left_no_scroll":a="position: fixed; bottom: 10px; left: 10px;z-index: 99999; background: #fff; border-radius: 0;","dropdown"===t&&r&&(r.style.cssText="top: unset; bottom: 100%");break;case"bottom_right":case"bottom_right_no_scroll":a="position: fixed; bottom: 10px; right: 10px;z-index: 99999; background: #fff; border-radius: 0;","dropdown"===t&&r&&(r.style.cssText="top: unset; bottom: 100%")}i&&(i.style.cssText=a,["top_left_no_scroll","top_right_no_scroll","bottom_left_no_scroll","bottom_right_no_scroll"].includes(n)&&(i.style.position="absolute"))}isAlreadyInjected(e){const t=e.innerHTML?.trim()||"",n=t.length>0&&"[linguise]"!==t;return"function"==typeof e.getAttribute&&"1"===e.getAttribute("data-flag-ready")&&n}replaceAndPaintElement(e,t,n){if(this.isAlreadyInjected(e))return;e.innerHTML="";const i=t.cloneNode(!0);i.dataset.flagReady="1",e.appendChild(i),e.setAttribute("data-flag-ready","1");const r=e.getElementsByClassName("linguise_lang_name"),a=e.getElementsByClassName("popup_linguise_lang_name");if(this.colorAndHoverLanguageName(n,r,a),"A"===e.tagName.toUpperCase()){const t=document.createElement("div");t.className=e.className,t.style.cssText=window.getComputedStyle(e).cssText,Array.from(e.attributes).forEach((e=>{e.name.startsWith("data-")&&t.setAttribute(e.name,e.value)})),t.setAttribute("data-flag-ready","1"),t.setAttribute("data-from-kind",e.tagName.toLowerCase()),t.innerHTML=e.innerHTML,e.replaceWith(t)}}replaceLinguiseShortcodeToSwitcher(e,t,n){const i=this.isDemoMode(n),r=document.getElementById("dashboard-live-preview"),a=document.getElementsByClassName("linguise_switcher_root"),s=this.findElementWithShortcode("[linguise]");let o=!1;if(r){const e=t.getElementsByClassName("linguise_lang_name"),i=t.getElementsByClassName("popup_linguise_lang_name");return this.colorAndHoverLanguageName(n.language_settings,e,i),void r.appendChild(t)}s.length>0&&Array.from(s).forEach((e=>{this.replaceAndPaintElement(e,t,n.language_settings),o=!0})),a.length>0&&Array.from(a).forEach((r=>{const a=r.classList.contains("linguise_menu_root")||r.classList.contains("linguise_menu");this.replaceAndPaintElement(r,t,n.language_settings),a||i||this.languagePosition(r,n.language_settings?.display,e),o=!0}));const l=["wordpress","joomla"].includes(n.platform);if(!o||null!==e&&"no"!==e){if(l&&!n.cms_automatic_switcher)return;const r=document.createElement("div");r.className="linguise_switcher_wrapper",this.replaceAndPaintElement(r,t,n.language_settings),i||this.languagePosition(r,n.language_settings?.display,e),document.body.appendChild(r)}}findElementWithShortcode(e){const t=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,(t=>t.isConnected&&t.parentElement&&1===t.parentElement.childNodes.length&&t.textContent?.length>0&&t.textContent.trim()===e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT)),n=[];let i=t.nextNode();for(;i;)i.parentElement&&n.push(i.parentElement),i=t.nextNode();return n}isDemoMode(e){return!!e.demo_mode||Boolean(document.getElementById("dashboard-live-preview"))}async tryGetLinguiseEditorCookie(){try{const e=document.cookie.split(";");for(let t=0;t<e.length;t++){const n=e[t].split("=");if("linguiseEditorToken"===n[0].trim())return n[1]}}catch{if(window.cookieStore){const e=await window.cookieStore.get("linguiseEditorToken");return e?e.value:null}}return null}getOrderedLanguageList(e,t,n){if(!n)return e;const i=[...n];for(let t=0;t<e.length;t++){const r=e[t];n.includes(r.code)||i.push(r.code)}const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(a===t)continue;const s=e.find((e=>e.code===a));s&&r.push(s)}const a=e.find((e=>e.code===t));return a&&r.unshift(a),r}parseHexColor(e){if(3===(e=e.replace("#","")).length)e=e.split("").map((e=>e+e)).join("");else if(6!==e.length)return null;if(e=e.toUpperCase(),!/^[0-9A-F]{6}$/i.test(e))return null;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}}mixinColorAndAlpha(e,t){if(1===t)return e;if(e.trim().startsWith("rgba("))return e;if(e.trim().startsWith("rgb(")){const n=e.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(!n)return null;return`rgba(${parseInt(n[1],10)}, ${parseInt(n[2],10)}, ${parseInt(n[3],10)}, ${t})`}const n=this.parseHexColor(e);if(!n)return null;const{r:i,g:r,b:a}=n;return`rgba(${i}, ${r}, ${a}, ${t})`}clampAlpha(e){return e<0?0:e>1?1:e}};const A=new class{constructor(){if(this._cached_config=null,this._stored_pkey=null,this._config_request=!1,this.linguiseFetch=window.fetch.bind(window),document.currentScript){const e=new URL(document.currentScript.src);this._stored_pkey=e.searchParams.get("d")}"undefined"!=typeof originalFetch&&"function"==typeof originalFetch&&(this.linguiseFetch=originalFetch.bind(window))}setPublicKey(e){!e&&this._stored_pkey||(this._stored_pkey=e)}_waitUntilConfigUnlock(){return new Promise((e=>{if(!this._config_request)return void e();const t=setInterval((()=>{this._config_request||(clearInterval(t),e())}),100)}))}getStoredMetadata(){const e=document.querySelector("script#linguise-extra-metadata");if(e){const t=JSON.parse(e.textContent);return t.url.startsWith("http")||(t.url=atob(t.url),t.domain=atob(t.domain)),t}}async getConfig(e){if(this._config_request&&await this._waitUntilConfigUnlock(),this._config_request=!0,null!==this._cached_config)return this._cached_config;const t=this.getStoredMetadata();if(t)return this._cached_config=t,this._stored_pkey=t.public_key,this._config_request=!1,t;if(!this._stored_pkey)throw new Error("Linguise: No available key can be used");try{const t=await this.callAPI("/config/"+this._stored_pkey+(e?"/"+e:""),{method:"GET",headers:{"Content-Type":"application/json"}});return this._cached_config=t,this._config_request=!1,t}catch(e){throw this._config_request=!1,e}}async getUrlTranslations(e,t){if(!this._stored_pkey)throw new Error("Linguise: No available key can be used");return await this.callAPI("/translations/url/"+this._stored_pkey+"/"+e+"/"+v().hash(decodeURI(t)),{method:"GET",headers:{"Content-Type":"application/json"}})}async callAPI(e,t={}){const n=new URL("http"+("1"==={}.API_USE_HTTPS?"s":"")+"://"+{}.API_DOMAIN+({}.API_DOMAIN_PORT?":"+{}.API_DOMAIN_PORT:"")+{}.API_BASE_PATH+e),i={};-1!==["POST","PUT"].indexOf(t.method)&&(i["Content-Type"]="application/json"),t={...t,referrerPolicy:"origin",headers:new Headers(i)};const r=await this.linguiseFetch(n,t),a=await r.json();if(!1===a.success)throw a;return a.data}getRequestedPath(e,t,n){const i=new URL(t);let r=new URL(e).pathname;if("/"===i.pathname&&r.startsWith(`/${n}`)){const e=r.replace(new RegExp(`^/${n}`),"");r=""===e.trim()||"/"===e.trim()?"/":e}else if("/"!==i.pathname){r=r.replace(i.pathname,"");const e=r.replace(new RegExp(`^/${n}`),"");r=""===e.trim()||"/"===e.trim()?"/":e}return r}async translate(e,t,n,i=null,r=!1){if(null===i&&(i=new URL("http"+("1"==={}.API_TRANSLATE_HTTPS?"s":"")+"://"+{}.API_TRANSLATE_HOST+({}.API_TRANSLATE_PORT?":"+{}.API_TRANSLATE_PORT:""))),!this._stored_pkey)throw new Error("Linguise: No available key can be used");const a=new FormData,s=new URL(window.location.href);if(a.append("version","2.3.0"),a.append("url",e),a.append("original_url",`${s.protocol}//${s.host}`),a.append("language",t),a.append("requested_path",this.getRequestedPath(window.location.href,e,t)),a.append("content",n),a.append("public_key",this._stored_pkey),a.append("response_code","200"),a.append("user_agent",navigator.userAgent),r){const e=await T.tryGetLinguiseEditorCookie();e&&a.append("editor_token",e)}const o=(new Date).getTime().toString(),l={Referer:window.location.href,"X-Linguise-Nonce":o,"X-Linguise-Key":this._stored_pkey,"X-Linguise-Language":t,"X-Linguise-Hash":await(async(e,t,n)=>{const i=new w.Sha256;i.update(`${e}_${t}-${n}`);const r=await i.digest();return Array.from(r).map((e=>e.toString(16).padStart(2,"0"))).join("")})(this._stored_pkey,o,t)},c=await this.linguiseFetch(i,{method:"POST",body:a,headers:l,referrerPolicy:"origin"}),u=await c.json();if(void 0!==u.response_code&&200!==u.response_code)throw new Error(u.message);return u}};var x=r(260),S=r.n(x);const L=class{constructor(e=[]){this.exclusion_rules=[],this.text_replacement_rules=[],this.text_ignore_rules=[],this.dynamic_content_rules=[],this.pause_dynamic_content_rules=[],e.forEach((e=>{if(e.apply_to_url&&e.apply_to_language)switch(e.type){case 1:this.text_ignore_rules.push(e.params);break;case 2:this.text_replacement_rules.push(e.params);break;case 3:this.exclusion_rules.push(e.params);break;case 4:this.pause_dynamic_content_rules.push(e.params);break;case 6:this.dynamic_content_rules.push(e.params)}}))}findMatchingSelector(e,t){if(!e)return null;if(!t||0===t.length)return null;for(const n of t){const t=document.querySelectorAll(n);if(0!==t.length)for(const n of Array.from(t))if(n.contains(e))return n}return null}shouldPauseDynamicContent(){return-1!==this.pause_dynamic_content_rules.findIndex((e=>!1===e.multilingual_url))}isElementRulesExcluded(e){return this.exclusion_rules.map((t=>{const n=t.element_selectors||[];return null!==this.findMatchingSelector(e,n)})).filter((e=>e)).length>0}isTextMatch(e,t,n,i=!0){if(!e)return!1;let r="gs";i&&(r+="i");const a="regex"===n?`(${t})`:`(${S()(t)})`;return new RegExp(a,r).test(e)}isElementHasAttributes(e,t){return!!e&&(!(!t||0===t.length)&&t.map((t=>e.hasAttribute(t))).filter((e=>e)).length>0)}attachTextRules(e){const t=e.tokenize().map((e=>e.text));this.text_ignore_rules.forEach((n=>{if(n.languages&&!n.languages.includes(this.current_language))return;if(n.text_ignore.map((e=>t.map((t=>this.isTextMatch(t,e.text_ignore,e.text_ignore_type,e.ignore_case))).filter((e=>e)).length>0)).filter((e=>e)).length>0){const t=this.findMatchingSelector(e.element,n.element_selectors||[]);t&&(e.extraMetadata.id=e.extraMetadata.id||t.id,e.extraMetadata.class=[...e.extraMetadata.class||[],...t.className.split(" ")],e.extraMetadata.dataset={...e.extraMetadata.dataset||{},...t.dataset})}})),this.text_replacement_rules.forEach((n=>{if(n.languages&&!n.languages.includes(this.current_language))return;if(n.text_replace.filter((e=>"original"===e.source_type)).map((e=>t.map((t=>this.isTextMatch(t,e.text_replace,e.text_replace_type,e.ignore_case))).filter((e=>e)).length>0)).filter((e=>e)).length>0){const t=this.findMatchingSelector(e.element,n.element_selectors||[]);t&&(e.extraMetadata.id=e.extraMetadata.id||t.id,e.extraMetadata.class=[...e.extraMetadata.class||[],...t.className.split(" ")],e.extraMetadata.dataset={...e.extraMetadata.dataset||{},...t.dataset})}}))}collectDynamicNodes(){const e=[];for(const t of this.dynamic_content_rules){const n=t.element_selectors||[];if(!n||0===n.length)continue;const r=n.map((e=>Array.from(document.querySelectorAll(e)))).reduce(((e,t)=>[...e,...t]),[]);if(0===r.length)continue;const a=new Set;for(const t of r){if(a.has(t))continue;a.add(t);const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_DOCUMENT_FRAGMENT,(e=>{if(!e.isConnected)return NodeFilter.FILTER_REJECT;if(e.nodeType===Node.COMMENT_NODE)return NodeFilter.FILTER_REJECT;if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host)return NodeFilter.FILTER_ACCEPT;if(e.nodeType===Node.ELEMENT_NODE&&this.isElementHasAttributes(e,s[e.nodeName.toUpperCase()]||[]))return NodeFilter.FILTER_SKIP;let t=e;return e.nodeType===Node.TEXT_NODE&&(t=e.parentElement),i.includes(e.nodeName.toUpperCase())||i.includes(t.nodeName.toUpperCase())?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}));for(;n.nextNode();)if(n.currentNode.nodeType===Node.TEXT_NODE){if(!n.currentNode.parentElement)continue;e.push([n.currentNode,n.currentNode.parentElement])}else n.currentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.push([n.currentNode,n.currentNode.host]):e.push([n.currentNode,n.currentNode])}}return e}};const N=class extends y{constructor(e,t){super(e,e),this.tagWrapper="a"}shouldWeTranslate(e){const t=e.trim(),n=["http:","https:","mailto:","tel:","ftp:"];try{const e=new URL(t,window.location.href);if(!n.includes(e.protocol))return!1;const i=new URL(window.location.href);return i.protocol!==e.protocol||i.origin!==e.origin||i.pathname!==e.pathname||i.search!==e.search||i.hash===e.hash}catch(e){return!1}return!1}tokenize(e=!1){if(void 0!==this._cachedTokenized&&!e)return this._cachedTokenized;const t=this.element.getAttribute("href"),n=[];if(t&&this.shouldWeTranslate(t)){const e=new b(this,0,"",{href:t});e.subId="href",n.push(e)}if(!n.length)throw new Error("No attribute to translate in link element");return e||(this._cachedTokenized=n),n}applyChange(e,t,n){const i=Object.assign({},{dryRun:!1,skipCache:!1},n||{});i.skipCache||this.cachedIndex.push(e.index);const r=e.subId;if(!r)return;if(!e.metaExtra)return;let a=e.metaExtra.href;this.applyAttributeChange("href",a,{...i,language:t,subId:r}),this.attachEditor(e)}blurParent(){}unblurParent(){}};const C=class extends y{constructor(e,t){super(e,e),this.mergeable=!1}shouldWeTranslate(e){return!e.trim().startsWith("data:image")&&super.shouldWeTranslate(e)}tokenize(e=!1){if(void 0!==this._cachedTokenized&&!e)return this._cachedTokenized;const t=this.element.getAttribute("src"),n=this.element.getAttribute("alt"),i=this.element.getAttribute("title");if(t){const r={};if(this.shouldWeTranslate(t)&&(r.src=t),n&&this.shouldWeTranslate(n)&&(r.alt=n),i&&this.shouldWeTranslate(i)&&(r.title=i),!Object.keys(r).length)throw new Error("No attribute to translate in image element");const a=new b(this,0,"",r);return a.subId="merged-src",a.tagName="img",e||(this._cachedTokenized=[a]),[a]}if(n||i){const t=[];if(n&&this.shouldWeTranslate(n)){const e=new b(this,0,n);e.subId="alt",t.push(e)}if(i&&this.shouldWeTranslate(i)){const e=new b(this,1,i);e.subId="title",t.push(e)}if(!t.length)throw new Error("No attribute to translate in image element");return e||(this._cachedTokenized=t),t}throw new Error("No attribute to translate in image element")}applyChange(e,t,n){const i=Object.assign({},{dryRun:!1,skipCache:!1},n||{});i.skipCache||this.cachedIndex.push(e.index);const r=e.subId;if(!r)return;let a=e.text;if("merged-src"===r){if(a=e.metaExtra.src,!a)return;const n=this.element.getAttribute("src");i.dryRun&&(a=`${n}#linguise-translated-demo`),this.element.setAttribute("src",a),i.skipCache||i.dryRun||_().add(n,a,t,r);const s=e.metaExtra.alt;s&&this.applyAttributeChange("alt",s,{...i,language:t,subId:r});const o=e.metaExtra.title;return o&&this.applyAttributeChange("title",o,{...i,language:t,subId:r}),void this.attachEditor(e)}"alt"===r&&(this.applyAttributeChange("alt",a,{...i,language:t}),e.editorMeta&&e.editorMeta.altHash&&this.element.setAttribute("data-linguise-alt-hash",e.editorMeta.altHash)),"title"===r&&this.applyAttributeChange("title",a,{...i,language:t})}blurParent(){}unblurParent(){}};const k=class extends y{constructor(e,t){super(e,e),this.mergeable=!1}tokenize(e=!1){if(void 0!==this._cachedTokenized&&!e)return this._cachedTokenized;const t=this.element.getAttribute("placeholder");if(t){const n=[];if(t&&this.shouldWeTranslate(t)){const e=new b(this,0,t);e.subId="placeholder",n.push(e)}if(!n.length)throw new Error("No attribute to translate in textarea/input element");return e||(this._cachedTokenized=n),n}throw new Error("No attribute to translate in textarea/input element")}applyChange(e,t,n){const i=Object.assign({},{dryRun:!1,skipCache:!1},n||{});i.skipCache||this.cachedIndex.push(e.index);const r=e.subId;if(!r)return;let a=e.text;"placeholder"===r&&this.applyAttributeChange("placeholder",a,{...i,language:t}),this.attachEditor(e)}blurParent(){}unblurParent(){}},I={IMG:C,A:N,TEXTAREA:k,INPUT:k};const P=class{static createAsNode(e,t){const n=e.nodeName.toUpperCase();return new(I[n]||y)(e,t)}static isLinguiseRelated(e){if(!e)return!1;if("BODY"===e.nodeName)return!1;if(e.nodeType===Node.ELEMENT_NODE){if("string"==typeof e.id&&(e.id.startsWith("linguise_")||e.id.startsWith("linguise-")))return!0;if("string"==typeof e.className&&(e.className.includes("linguise_")||e.className.includes("linguise-")))return!0}return this.isLinguiseRelated(e.parentNode)}static isParentNodeIgnored(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;return!!e.closest('[data-linguise-ignore], [data-linguise-parent-ignore="1"], .linguise-parent-ignore')}static isIgnoredAttribute(e){const t=["linguise-ignore","data-linguise-loading","data-linguise-editor-active","data-linguise-editor-wrap"];if("function"==typeof e?.hasAttribute){if(t.map((t=>e.hasAttribute(t))).some((e=>e)))return!0}if("function"==typeof e?.getAttribute){if("no"===e.getAttribute("translate")?.toLowerCase())return!0}return!1}static collectChildren(e,t=[]){e.nodeType===Node.TEXT_NODE?t.push([e,e.parentElement]):("IMG"===e.nodeName&&(e.hasAttribute("src")||e.hasAttribute("alt")||e.hasAttribute("title"))||"A"===e.nodeName&&e.hasAttribute("href")||["TEXTAREA","INPUT"].includes(e.nodeName)&&e.hasAttribute("placeholder"))&&t.push([e,e]);for(let n=0;n<e.childNodes.length;n++)this.collectChildren(e.childNodes[n],t);return e.nodeType===Node.ELEMENT_NODE&&e.shadowRoot&&(t.push([e.shadowRoot,e]),this.collectChildren(e.shadowRoot,t)),t}static collectShadowNodes(){const e=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,(e=>e.isConnected?e.shadowRoot?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT)),t=[];for(;e.nextNode();)t.push(e.currentNode);return t}static uniqueElementNode(e){const t=new Set,n=[];for(const[i,r]of e)t.has(i)||(t.add(i),n.push([i,r]));return n}static deduplicateTranslationArray(e){const t=new Set,n=new Set;return e.filter((e=>{const n=t.has(e.id);return t.add(e.id),!n})).filter((e=>{const t=n.has(e.element);return n.add(e.element),!t}))}static createContextualTokenizedData(e){const t=new Map,n=[];for(const i of e)i.element!==i.parentElement&&i.parentElement&&i.mergeable?t.has(i.parentElement)?t.get(i.parentElement).push(i):t.set(i.parentElement,[i]):n.push(i);const i=[];for(const[e,n]of t){if(1===n.length){i.push(n[0].asHtml());continue}const t=new Array(e.childNodes.length).fill(void 0);for(const i of n)for(let n=0;n<e.childNodes.length;n++)e.childNodes[n]===i.element&&(t[n]=i);const r=`<div data-linguise-parent="${o()}">`,a=t.filter((e=>void 0!==e)).map((e=>e.asHtml().replace("<div","<span").replace("</div>","</span>"))).join("");i.push(r+a+"</div>")}for(const e of n)i.push(e.asHtml());return i.join("")}};const M=class{constructor(e=500){this._locked_node=[],this._temp_excluded=[],this.setDelay(e)}setDelay(e){this.debounceClear=e<=0?this.clear.bind(this):l(this.clear.bind(this),e)}setTemporary(t){this._temp_excluded=t,e.debug("Setting temporary excluded nodes",this._temp_excluded)}isLocked(e){return this._locked_node.includes(e)}isExcludedTemporarily(e){return!!this._temp_excluded.includes(e)||this._temp_excluded.some((t=>t.contains(e)))}add(e){this._locked_node.push(e),this.debounceClear()}clear(){this._temp_excluded=this._temp_excluded.filter((e=>!this._locked_node.includes(e))),e.log("Dequeue-ing locked nodes",this._locked_node.length),e.debug("Locked node removal",this._locked_node),this._locked_node=[]}},O=_(),U=Symbol("LinguiseNodeDepressure"),D=new Set;for(const e in s)s[e].forEach((e=>{D.add(e)}));const R={childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0,attributeFilter:[...D,"linguise-ignore"]};class H{constructor(t,n=null,i=null){this.config={apiKey:void 0,debounceDelay:2500,clearDebounceDelay:500,cacheTTL:2592e5,debug:!1,forceDisable:!1,dryRun:!1,domainId:null,domainUrl:null,languageOverride:null,baseUrl:`${window.location.protocol}//${window.location.host}`,blurAnimation:!0,isWpBrickDetected:!1},this.config=Object.assign({},this.config,i||{}),this.debouncedProcessTranslation=this.config.debounceDelay>0?function(t,n){let i=null,r=[];const a=()=>{i=null,e.debug("Debounce is not called after timeout, executing with",r.length,"items"),t(r),r=[]};return t=>{e.debug("Called debouncer with",t.length,"items"),r=[...r,...t],t.length>0&&(i&&clearTimeout(i),i=setTimeout(a,n))}}(this.processTranslation.bind(this),this.config.debounceDelay):this.processTranslation.bind(this),this.config_ready=!1,this._queued_translations=[],this._translate_endpoint=n,this._locker=new M(this.config.clearDebounceDelay);let r=document.documentElement.lang||"";r.includes("-")&&!r.startsWith("zh-")&&(r=r.split("-")[0]),r=r.toLowerCase(),this.current_language=null,this.current_document_language=r,this.observer=null,this.shadow_observers=new Map,this.rules=new L,this._config_fetch=t,this._linguise_editor=!1,this._depressurer=new Set,this.patchAttachShadow()}wrapFetchConfig(){"function"==typeof this._config_fetch&&this._config_fetch(this.config,(async t=>{const n=A.getStoredMetadata();if((t=Object.assign({},n||{},t)).debug&&e.enable(!0,!0),!t.dynamic_translations.enabled)return e.log("Dynamic translation is disabled, cancelling"),void this.cancelProcess();if(!t.public_key)return e.warn("Public key is not set, cancelling"),void this.cancelProcess();if(!this.current_document_language&&"subdomains"===t.structure){const n=new URL(window.location.href).hostname.split(".")[0];if(!t.languages.map((e=>e.code)).includes(n))return e.warn("Unable to determine document language from subdomain, cancelling"),void this.cancelProcess();this.current_document_language=n}if(!this.current_document_language)return e.warn("Unable to determine document language, cancelling"),void this.cancelProcess();"string"==typeof t.current_language&&(this.current_document_language=t.current_language);let i=t.language;for(const e in t.languages)if(t.languages[e].code===this.current_document_language){i=this.current_document_language;break}if(this.config.languageOverride&&(i=this.config.languageOverride),t.language===i)return e.log("Document language is the same as current language, cancelling"),void this.cancelProcess();this.current_language=i,this.config.apiKey=t.public_key,this.config.baseUrl=t.domain||t.url;const r=t.rules||[];if(this.rules=new L(r),this.rules.shouldPauseDynamicContent())return e.warn("Dynamic content is paused due to rules",this.rules.pause_dynamic_content_rules),void this.cancelProcess();if(A.setPublicKey(t.public_key),this.config_ready=!0,this.isWpBrickDetected=void 0!==window?.wpgb_settings,e.info("Config is ready, processing queued translations",this.config),Array.isArray(t.cached_selectors)){const e=t.cached_selectors.map((e=>document.querySelector(e))).filter((e=>null!==e));this._locker.setTemporary(e)}this._queued_translations=this._queued_translations.filter((e=>this.isElementPreflightAllow(e.node,e.parentElement))),this._queued_translations.forEach((e=>{this.config.blurAnimation&&e.blurParent()}));const a=P.uniqueElementNode(this.rules.collectDynamicNodes()),s=a.filter((([e,t])=>this.isElementPreflightAllow(e,t)&&!this.isShadowRoot(e))).map((([e,t])=>{const n=this.applyCacheOrTranslate(e,t);if(n!==U)return n||void 0;this._depressurer.add(textNode)})).filter((e=>void 0!==e));a.forEach((([e])=>{this.isShadowRoot(e)&&this.attachShadowObserver(e)})),s.forEach((e=>{e.blurParent(),e.detachEditor()})),this.debouncedProcessTranslation([...s,...this._queued_translations])})).catch((t=>{e.error("Failed to fetch config",t),this.cancelProcess()}))}async _translate(t){if(this.config.dryRun)return[t,!0];const n=this.config.languageOverride||this.current_language;try{const e=`<div class="linguise-dynamic-wrapper">${t}</div>`;return[(await A.translate(this.config.baseUrl,n,e,this._translate_endpoint,this.setLinguiseEditorActiveStatus())).content,!0]}catch(n){return e.error("Failed to translate content",n),[t,!1]}}async processTranslation(t){if(!this.config_ready)return e.log("Config is not ready, queueing translations"),void this._queued_translations.push(...t);if(!t.length)return void e.log("Linguise: No nodes to be translated, skipping");this.setLinguiseEditorActiveStatus(),t.forEach((t=>{try{this.rules.attachTextRules(t)}catch(t){e.warn("Failed to attach text rules",t)}}));const n=t.map((e=>{try{return e.tokenize()}catch{return e.unblurParent(),[]}})).flat().filter((e=>!e.isCached())).map((e=>e.node)),i=P.deduplicateTranslationArray(n.filter((e=>e.element.isConnected)));t.forEach((e=>{e.blurParent()})),e.log("Found uncached",i),e.debug("Current translation queue:",t),e.debug("Current uncached response:",n),e.debug("Uncached disconnected:",n.filter((e=>!e.element.isConnected)));const r=P.createContextualTokenizedData(i);if(e.debug("Translating",r),!r.length)return t.forEach((e=>{e.unblurParent()})),void e.log("Nothing to be translated to server");e.log("Sending translation to server...");const[a,s]=await this._translate(r);if(t.forEach((e=>{e.unblurParent()})),!a)return void e.log("Translation failed, cancelling");e.log("Received translation from server...");const o=document.createElement("div");o.innerHTML=a,e.debug("Translated content:",o),e.log("Updating DOM..."),o.querySelectorAll("[data-linguise-id]").forEach((n=>{const i=b.fromElement(n);if(!i)return;const r=t.find((e=>e.id===i.id));r&&(r.element.isConnected?r.isElementModified(i.index)?e.warn("Element is changed, ignoring",r):(this._locker.add(r.element),r.applyChange(i,this.current_language,{dryRun:this.config.dryRun,skipCache:!s})):e.warn("Element is not attached to DOM, ignoring",r))}))}attachShadowObserver(t){if(this.shadow_observers.has(t))return;const n=new MutationObserver(((n,i)=>{this.observerCallback(n,i),t.isConnected||(e.log("Disconnecting shadow observer from observer",t),i.disconnect(),this.shadow_observers.delete(t))}));e.log("Attaching shadow observer",t),n.observe(t,R),this.shadow_observers.set(t,n)}patchAttachShadow(){const t=Element.prototype.attachShadow,n=this;Element.prototype.attachShadow=function(i){const r=t.call(this,i);return e.log("Called attachShadow, attaching observer to shadow root",this,r),n.attachShadowObserver(r),r}}applyCacheOrTranslate(t,n,i=!1){const r=P.createAsNode(t,n);if(this._locker.isLocked(t)&&!i)return void e.debug("Skipping locked node",r);let a=[];try{a=r.tokenize()}catch{return}if(this.setLinguiseEditorActiveStatus())return e.log("Linguise editor is active, skipping cache"),r;return a.map((e=>{if(this.isWpBrickDetected)return!1;const t=O.get(e.text,this.current_language||this.current_document_language,e.subId);if(t){const n=new b(null,e.index,t);return e.subId&&(n.subId=e.subId),this._locker.add(r.element),r.applyChange(n,this.current_language||this.current_document_language,{dryRun:this.config.dryRun}),r.unblurParent(),!0}for(const[t,n]of Object.entries(e.metaExtra||{})){const i=O.get(n,this.current_language||this.current_document_language,e.subId);if(i){const n={};n[t]=i;const a=new b(null,e.index,e.text,n);return e.subId&&(a.subId=e.subId),this._locker.add(r.element),r.applyChange(a,this.current_language||this.current_document_language,{dryRun:this.config.dryRun}),r.unblurParent(),!0}}return!1})).every((e=>e))?i?U:void 0:r}cancelProcess(){null!==this.observer&&this.observer.disconnect(),this._queued_translations.forEach((e=>{e.unblurParent()})),this._locker.debounceClear()}extractScriptParam(){if(!document.currentScript)return{};const e=new URL(document.currentScript.src),t=e.searchParams.get("d"),n=e.searchParams.get("i"),i={};return t&&(i.apiKey=t),n&&(i.domainId=n),i}setLinguiseEditorActiveStatus(){if(this._linguise_editor)return!0;if(document.querySelector("link#linguise_editor_style"))return this._linguise_editor=!0,!0;return!!document.querySelector("div#linguise_editor_toolbar")&&(this._linguise_editor=!0,!0)}isShadowRoot(e){return!!e&&(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Boolean(e.host))}isElementPreflightAllow(e,t){const n=this.isShadowRoot(e)?e.host:e;if(!n.isConnected)return!1;if(n.nodeType===Node.COMMENT_NODE)return!1;if(P.isParentNodeIgnored(n))return!1;if(P.isLinguiseRelated(n))return!1;const r=this.isShadowRoot(t)?t.host:t;return(n.nodeType===Node.TEXT_NODE||!i.includes(n.nodeName.toUpperCase()))&&((n.nodeType!==Node.TEXT_NODE||!r||!a.includes(r.nodeName.toUpperCase()))&&(!(n.nodeType===Node.ELEMENT_NODE&&P.isIgnoredAttribute(n)||P.isIgnoredAttribute(r))&&(!this.rules.isElementRulesExcluded(n)&&(this._locker.isExcludedTemporarily(n)?(this._locker.add(e),!1):!r||!this._locker.isExcludedTemporarily(r)||(this._locker.add(r),!1)))))}observerCallback(e,t){const n=[];e.forEach((e=>{const t=e.target;let i=e.target;if(t.nodeType===Node.TEXT_NODE&&(i=t.parentElement),this._depressurer.has(t))this._depressurer.delete(t);else if("attributes"===e.type&&t.nodeType===Node.ELEMENT_NODE){if(!this.isElementPreflightAllow(t,i))return;if(e.oldValue===t.getAttribute(e.attributeName))return;if((s[t.nodeName.toUpperCase()]||[]).includes(e.attributeName)){const e=this.applyCacheOrTranslate(t,i);void 0!==e&&e!==U?n.push(e):e===U&&this._depressurer.add(t)}}else if("childList"===e.type&&e.addedNodes.length>0){const t=[];e.addedNodes.forEach((e=>{const n=P.uniqueElementNode(P.collectChildren(e));t.push(...n)}));const i=P.uniqueElementNode(t).filter((([e,t])=>this.isElementPreflightAllow(e,t)));if(i.length>0){const e=i.filter((([e])=>!this.isShadowRoot(e))).map((([e,t])=>{const n=this.applyCacheOrTranslate(e,t);if(n!==U)return n;this._depressurer.add(e)})).filter((e=>!!e));e.forEach((e=>{this.config_ready&&this.config.blurAnimation&&e.blurParent()})),n.push(...e),i.forEach((([e])=>{this.isShadowRoot(e)&&this.attachShadowObserver(e)}))}}else if("characterData"===e.type&&t.nodeType===Node.TEXT_NODE){if(!this.isElementPreflightAllow(t,i))return;if(e.oldValue?.trim()===t.nodeValue?.trim())return;const r=this.applyCacheOrTranslate(t,i);if(void 0!==r&&r!==U)this.config_ready&&r.blurParent(),n.push(r);else{this.applyCacheOrTranslate(t,i,!0)===U&&this._depressurer.add(t)}}})),n.length&&(this.config_ready&&n.forEach((e=>e.detachEditor())),this.debouncedProcessTranslation(n))}initialize(){if(void 0===window)throw new Error("Linguise: please run this on browser");document.getElementById("linguise-dynamic-content-style")&&document.getElementById("linguise-dynamic-content-style").remove();const t=document.createElement("style");t.id="linguise-dynamic-content-style",t.innerHTML="\n[data-linguise-loading] {\n    text-shadow: 0 0 6px #8f8f8f;\n    transition: text-shadow 0.3s ease-in-out;\n    color: transparent !important;\n    animation: linguise-loading-pulse 1.5s ease-in-out infinite;\n}\n\n@keyframes linguise-loading-pulse {\n    0% {\n        text-shadow: 0 0 6px #8f8f8f;\n    }\n    50% {\n        text-shadow: 0 0 10px #8f8f8f;\n    }\n    100% {\n        text-shadow: 0 0 6px #8f8f8f;\n    }\n}\n",document.head.appendChild(t);const n=this.extractScriptParam(),i=Object.assign({},this.config,n,window.lingConfig||{});if(!this._config_fetch)throw new Error("Linguise: configFetch is not set, disabling dynamic content");if(this.config=i,e.enable(Boolean(this.config.debug),!0),this.config.forceDisable)return void e.log("forceDisable is set, disabling dynamic content");"number"==typeof this.config.clearDebounceDelay&&this._locker.setDelay(this.config.clearDebounceDelay),O.importFromStorage(),O.setMaxTTL(this.config.cacheTTL),null!==this.observer&&this.observer.disconnect(),this.observer=new MutationObserver(((e,t)=>{this.observerCallback(e,t)})),e.log("Attaching all shadow DOM observers");P.collectShadowNodes().forEach((e=>{e.shadowRoot&&this.attachShadowObserver(e.shadowRoot)})),e.log("Starting observer",i),this.observer.observe(document.body,R)}}const $=class{constructor(){this.initalized=!1,this.opened=!1,r.e(541).then(r.bind(r,761))}load(e){const t=e.available_languages.find((t=>t.code===e.current_language)),n=e.language_settings,i=document.createElement("div");return i.id="linguise_floating_wrapper",i.innerHTML=`<div class="linguise_switcher ${"rectangular"===n?.flag_shape?"linguise_flag_rectangular":"linguise_flag_rounded"}">\n                            <a href="#" class="linguise_switcher_popup" data-linguise-switcher="floating">\n                                ${T.renderFlag(n,t.code)}\n                                ${T.renderLanguageName(n,t.code,t.name,t.original_name)}\n                            </a>\n                          </div>`,T.replaceLinguiseShortcodeToSwitcher(n?.position??"bottom_right",i,e),this.postLoad(e),i}postLoad(e){document.querySelectorAll('[data-linguise-switcher="floating"]').forEach((t=>{t.__linguise_click_handled||(t.addEventListener("click",(t=>{t.preventDefault(),this.click(e)})),t.__linguise_click_handled=!0)}))}click(e){if(!document.getElementById("dashboard-live-preview")){if(!0===this.initalized)return void this.switch();this.initalized=!0}T.sort(e);const t=e.language_settings,n=T.getOrderedLanguageList(e.available_languages,e.default_language,t?.language_flag_order),i=document.createElement("div");i.innerHTML=`\n            <a class="close" href="#"><span></span></a>\n            <ul>\n                ${n.map((n=>`\n                            <li class="${e.default_language===n.code?"current":""}">\n                                <a href="${T.getLanguageUrl(e,n.code)}" data-ling-lang="${n.code}">\n                                   ${T.renderFlag(t,n.code)}\n                                   ${T.renderLanguageName(t,n.code,n.name,n.original_name,!0)}\n                                </a>\n                            </li>`)).join("")}\n            </ul>\n`,i.id="linguise_popup",i.className="linguise_switcher "+("rectangular"===t?.flag_shape?"linguise_flag_rectangular":"linguise_flag_rounded");const r=i.querySelector("ul");if(r){if(t?.pre_text){const e=document.createElement("p");e.classList.add("linguise_pre_text"),e.innerHTML=t.pre_text,r.parentNode.insertBefore(e,r)}if(t?.post_text){const e=document.createElement("p");e.classList.add("linguise_post_text"),e.innerHTML=t.post_text,r.parentNode.appendChild(e)}}const a=document.createElement("div");a.id="linguise_popup_container",a.appendChild(i),document.body.appendChild(a),setTimeout((()=>{a.classList.add("show_linguise_popup_container")}),100);const s=document.createElement("div");s.id="linguise_background",document.getElementById("linguise_popup_container").appendChild(s);const o=document.getElementsByClassName("popup_linguise_lang_name");T.colorAndHoverLanguageName(t,[],o),document.querySelectorAll("#linguise_background, #linguise_popup .close").forEach((e=>e.addEventListener("click",(e=>{e.preventDefault(),this.switch()})))),this.opened=!0}switch(){document.getElementById("dashboard-live-preview")?(document.getElementById("linguise_background").remove(),document.getElementById("linguise_popup_container").classList.remove("show_linguise_popup_container"),setTimeout((()=>{document.getElementById("linguise_popup_container").remove()}),100),this.opened=!1):(document.getElementById("linguise_background").style.display=this.opened?"none":"",document.querySelector("#linguise_popup_container").classList.toggle("show_linguise_popup_container"),this.opened=!this.opened)}};const j=class{constructor(e){r.e(541).then(r.bind(r,56))}load(e){const t=e.available_languages.find((t=>t.code===e.current_language));T.sort(e);const n=e.language_settings,i=T.getOrderedLanguageList(e.available_languages,e.default_language,n?.language_flag_order),r=document.createElement("div");return r.innerHTML=`\n            <ul class="linguise_switcher linguise_switcher_dropdown ${"rectangular"===n?.flag_shape?"linguise_flag_rectangular":"linguise_flag_rounded"}">\n                <li class="linguise_current">\n                    <div class="linguise_current_lang">\n                        ${T.renderFlag(n,e.current_language)}\n                        ${T.renderLanguageName(n,e.current_language,t.name,t.original_name)}\n                        <span class="lccaret top">\n                            <svg height="48" viewBox="0 96 960 960" width="48">\n                                <path d="M480 699q-6 0-11-2t-10-7L261 492q-8-8-7.5-21.5T262 449q10-10 21.5-8.5T304 450l176 176 176-176q8-8 21.5-9t21.5 9q10 8 8.5 21t-9.5 22L501 690q-5 5-10 7t-11 2Z"/>\n                            </svg>\n                        </span>\n                    </div>\n                    <ul class="linguise_switcher_sub linguise_switcher_un_mm ${e.available_languages.length>9?"many_languages":""}">\n                        ${i.map((t=>{if(t.code!==e.current_language)return`<a href="${T.getLanguageUrl(e,t.code)}" data-ling-lang="${t.code}">\n                                            <li class="linguise_lang_item" data-lang="${t.code}" id="linguise_lang_item">\n                                                ${T.renderFlag(n,t.code)}\n                                                ${T.renderLanguageName(n,t.code,t.name,t.original_name,!0)}\n                                            </li>\n                                        </a>`})).join("")}\n                    </ul>\n                </li>\n            </ul>`,r.id="dropdown",T.replaceLinguiseShortcodeToSwitcher(n?.position??"bottom_right",r,e),this.postLoad(e),r}postLoad(e){const t="linguise_switcher_sub linguise_switcher_un_mm "+(e.available_languages.length>9?"many_languages":""),n=document.querySelectorAll(".linguise_switcher_un_mm");Array.from(n).forEach((e=>{if(e.__observer)return;const n=new MutationObserver((i=>{i.forEach((i=>{if("attributes"===i.type&&"class"===i.attributeName){[e.classList.contains("linguise_switcher_un_mm"),e.classList.contains("linguise_switcher_sub"),e.classList.contains("many_languages")].filter(Boolean).length.length!==e.classList.length&&(e.className=t,n.disconnect(),e.__observer=null)}}))}));e.__observer=n,n.observe(e,{attributes:!0,attributeFilter:["class"]})}))}};const F=class{constructor(){r.e(541).then(r.bind(r,452))}load(e){T.sort(e);const t=e.language_settings,n=T.getOrderedLanguageList(e.available_languages,e.default_language,t?.language_flag_order),i=document.createElement("div");return i.innerHTML=`\n            <div class="linguise_switcher side_by_side_lang_list ${"rectangular"===t?.flag_shape?"linguise_flag_rectangular":"linguise_flag_rounded"}">\n                ${n.map((n=>`<a href="${T.getLanguageUrl(e,n.code)}" data-ling-lang="${n.code}">\n                                ${T.renderFlag(t,n.code)}\n                                ${T.renderLanguageName(t,n.code,n.name,n.original_name)}\n                            </a>`)).join("")}\n            </div>`,i.id="side_by_side",T.replaceLinguiseShortcodeToSwitcher(t?.position??"bottom_right",i,e),i}postLoad(){}};const B=class{static platform=null;constructor(e){this.switcher=e}onInitialize(){}afterInitialize(e){}};class z extends B{static platform="shopify";constructor(t){super(t),this.logger=e.createChild("Patcher.Shopify")}onInitialize(){}afterInitialize(e){if(e===z.platform&&!this.patchCookiesTlds()){const e=setInterval((()=>{this.patchCookiesTlds()&&clearInterval(e)}),1e3)}}patchCookiesTlds(){const e=document.cookie.split(";");for(let t=0;t<e.length;t++){const n=e[t].trim();if(n.startsWith("cart=")){this.logger.debug("Patching Shopify cart cookie for domain:",this.switcher.config.domain,n);const e="cart="+n.substring(5)+";domain=."+this.switcher.config.domain.split("//",2)[1]+";path=/";return document.cookie=e,!0}}return!1}}const W=z;class q extends B{static platform="tilda";constructor(t){super(t),this.tilda_timer=null,this.logger=e.createChild("Patcher.Tilda")}onInitialize(){const e=new URL(window.location.href),t=e.hostname.split(".")[0]?.toLowerCase()??"";"www"!==t&&/^[a-z]{2,3}(?:\-[a-z]{2})?$/.test(t)&&this.patchAPIEndpoint()}afterInitialize(e){e!==q.platform&&null!==this.tilda_timer&&(this.logger.debug(`Clearing Tilda timer since platform is not Tilda (platform=${e})`),clearTimeout(this.tilda_timer))}patchAPIEndpoint(){this.logger.debug("Running Tilda API endpoint patcher at:",performance.now()),window.t_store_endpoint?(-1===window.t_store_endpoint.indexOf("/cgi-linguise/")&&(this.logger.debug("Patching Tilda store endpoint from",window.t_store_endpoint),window.t_store_endpoint=`${window.location.host}/cgi-linguise/${window.t_store_endpoint}`),this.tilda_timer=setTimeout((()=>{this.patchAPIEndpoint()}),1e3)):this.tilda_timer=setTimeout((()=>{this.patchAPIEndpoint()}),100)}}const X=q;const G=class{constructor(t){this.platforms={shopify:new W(t),tilda:new X(t)},this.logger=e.createChild("Patcher")}onInitialize(){for(const t in this.platforms)e.debug(`Running onInitialize for platform patcher: ${t}`),this.platforms[t].onInitialize()}afterInitialize(t){for(const n in this.platforms)e.debug(`Running afterInitialize for platform patcher: ${n}`),this.platforms[n].afterInitialize(t)}};const K=class{constructor(e=null,t=null){this.domain=null,this.base=null,this.base_url=null,this.domain_id=null,this.current_language=null,this.default_language=null,this.translate_urls=null,this.available_languages=[],this.scheme=null,this.host=null,this.original_path="",this.alternate_link_injected=!1,this.cms_automatic_switcher=!1,this.path=null,this.trailing_slashes="",this.search=null,this.language_settings={},this.domain_structure=null,this.demo_mode=!1,this.linguise_configs={},this.is_loaded=!1,this.is_success=!1,this.platform=null,this._current_script=e,this.parent=t}setFromScriptConfig(){const{flag_display_type:e,language_default:t,default_language:n,display_position:i,languages:r,base_url:a,demo_mode:s,enable_language_name:o,enable_language_name_popup:l,enable_flag:c,enable_language_short_name:u,language_name_display:h,alternate_link:d,original_path:g,automatic_switcher:f,add_flag_automatically:p,platform:_,base:m}=window.linguise_configs.vars.configs;this.linguise_configs=linguise_configs.vars.configs;const b=this.getCurrentLocation();this.demo_mode=Boolean(s),this.demo_mode?(this.domain=b,this.base_url=b):(this.domain=a||b,this.base_url=a||b),this.available_languages=Object.keys(r).map((e=>({code:e,name:r[e],original_name:r[e]}))),this.default_language=n??t,this.alternate_link_injected=Boolean(d);const y=p??f;if(this.cms_automatic_switcher=Boolean(y),this.original_path=g,this.base=m||null,"string"==typeof _)this.platform=_;else{const e=Array.isArray(this.linguise_configs.joomla_languages);this.platform=e?"joomla":"wordpress"}this.language_settings={display:e,position:i,enabled_lang_name:Boolean(Number.parseInt(o,10)),enabled_lang_name_popup:Boolean(Number.parseInt(l,10)),enabled_lang_short_name:Boolean(Number.parseInt(u,10)),enabled_flag:Boolean(Number.parseInt(c,10)),lang_name_display:h,...this.linguise_configs}}async loadConfig(){if(this.is_loaded)return this.is_success;const e=this._current_script||document.currentScript;if(e&&e.getAttribute("src")){const t=new URL(e.src,window.location.href),n=t.searchParams.get("d"),i=t.searchParams.get("i");n&&A.setPublicKey(n),this.domain_id=i??null}window?.linguise_configs?.vars?.configs&&this.setFromScriptConfig();let t=Object.keys(this.linguise_configs).length>0;return 0===Object.keys(this.linguise_configs).length&&(t=await this.getDomainConfigFromAPI()),this.is_loaded=!0,this.is_success=t,t}async getDomainConfigFromAPI(){const e=await A.getConfig(this.domain_id);return!!e&&(this.base_url=e.url,this.domain=e.domain,this.available_languages=e.languages,this.default_language=e.language,this.translate_urls=!!e.translate_urls,this.language_settings=e.language_settings,this.domain_structure=e.structure,this.platform=e.platform??null,e.current_language&&(this.current_language=e.current_language),!0)}getCurrentLanguage(){if(null!==this.current_language)return this.current_language;let e=this.default_language;for(const t in this.available_languages)if(this.available_languages[t].code===document.documentElement.lang){e=document.documentElement.lang;break}if(this.current_language=e,"subdomains"===this.domain_structure){const e=this.getCurrentLanguageFromDomain();e&&e!==this.current_language&&(this.current_language=e)}return this.current_language}getCurrentLanguageFromDomain(){let e=null;const t=new URL(this.domain).hostname.split(".")[0];for(const n in this.available_languages)if(this.available_languages[n].code===t){e=t;break}return e}getCurrentLocation(){const e=new URL(window.location.href),t=e.pathname.endsWith("/")?"/":"";return`${e.protocol}//${e.host}${t}`}getPath(){if(null!==this.path)return this.path;if(this.demo_mode)return this.path="/",this.trailing_slashes="",this.search="",this.path;const e=new URL(this.domain);this.path=document.location.pathname.replace(/\/+$/,""),this.trailing_slashes=document.location.pathname.endsWith("/")?"/":"",this.search=document.location.search,"/"!==e.pathname&&(this.path=this.path.substring(e.pathname.length)),this.scheme=e.protocol,this.host=e.host;for(let e=0;e<this.available_languages.length;e++){const t=new RegExp("^/(?:"+this.available_languages[e].code+")($|/.*)").exec(this.path);if(t){this.path=t[1];break}}return""===this.path&&(this.path="/"),this.path}};const V=class{constructor(e){this.url_translations={},this.url_translations_cache={},this._current_script=e,this._switcher=null,this._switcher_element=null,this.config=new K(this._current_script,this),this.patcher=new G(this)}async initialize(){this.patcher.onInitialize();if(!await this.config.loadConfig())return;const e=this.config.getCurrentLanguage(),t=this.config.getPath();"/"!==t&&!t.endsWith(".php")&&this.config.translate_urls&&(this.url_translations=await A.getUrlTranslations(e,this.config.getPath())),this.addAlternates(),this.injectCustomCSS(),this.addFlag(),this.patcher.afterInitialize(this.config.platform)}addFlag(e={}){switch(Object.keys(e).length>0&&(this.config.language_settings=e),this.config.language_settings?.display){case"dropdown":{const e=new j;this._switcher=e,this._switcher_element=e.load(this.config);break}case"popup":{const e=new $;this._switcher=e,this._switcher_element=e.load(this.config);break}case"side_by_side":{const e=new F;this._switcher=e,this._switcher_element=e.load(this.config);break}default:{const e=new $;this._switcher=e,this._switcher_element=e.load(this.config);break}}this._switcher.postLoad(this.config),this.monitorDOM(),r.e(541).then(r.bind(r,907))}addAlternates(){this.config.alternate_link_injected||(this.config.available_languages.forEach((e=>{this.injectAlternate(e.code)})),this.injectAlternate("x-default"))}injectAlternate(e){const t=document.createElement("link");t.rel="alternate",t.hreflang=e,t.href=T.getLanguageUrl(this.config,"x-default"===e?this.config.default_language:e),t.setAttribute("data-linguise-alternate",e),document.head.appendChild(t)}injectCustomCSS(){if(this.config.language_settings?.custom_css){const e=document.createElement("style");e.setAttribute("data-linguise-css","custom-css"),e.innerHTML=this.config.language_settings.custom_css,document.head.appendChild(e)}}_uniqueElementNode(e){const t=new Set,n=[];for(const i of e)t.has(i)||(t.add(i),n.push(i));return n}_findLinguiseSwitcherRoot(e){const t=[];if(e.nodeType===Node.ELEMENT_NODE){let n=!1;if(e.classList&&e.classList.contains("linguise_switcher_root")?(t.push(e),n=!0):"[linguise]"===e.textContent?.trim()&&(e.__linguise_in_place=!0,t.push(e),n=!0),!n)for(let n=0;n<e.children?.length;n++)t.push(...this._findLinguiseSwitcherRoot(e.children[n]))}return t}monitorDOM(){new MutationObserver((e=>{e.forEach((e=>{let t=!1;if("childList"===e.type){e.addedNodes.forEach((e=>{if(!e.isConnected)return;const n=this._uniqueElementNode(this._findLinguiseSwitcherRoot(e));if(n.length>0&&this._switcher&&this._switcher_element){const i=this.config.language_settings;n.forEach((n=>{const r=n.classList?.contains("linguise_menu_root")||e.classList?.contains("linguise_menu")||n?.__linguise_in_place;T.replaceAndPaintElement(n,this._switcher_element,i),r||this.demo_mode||T.languagePosition(n,i?.display,i?.position),t=!0}))}}));const n=e.target;if(n.nodeType===Node.ELEMENT_NODE&&this._switcher_element&&this._switcher){const e=this.config.language_settings;if(n.classList&&n.classList.contains("linguise_switcher_root")){const i=n.classList.contains("linguise_menu_root")||n.classList.contains("linguise_menu");T.replaceAndPaintElement(n,this._switcher_element,e),i||this.config.demo_mode||T.languagePosition(n,e?.display,e?.position),t=!0}else"[linguise]"===n.textContent?.trim()&&(T.replaceAndPaintElement(n,this._switcher_element,e),t=!0)}}t&&this._switcher&&this._switcher.postLoad(this.config)}))})).observe(document.body,{childList:!0,subtree:!0}),this._interceptHistory()}_interceptHistory(){if("undefined"==typeof history)return;const e=history.pushState,t=history.replaceState;history.pushState=(...t)=>{const n=e.apply(history,t);return this._onUrlChange(),n},history.replaceState=(...e)=>{const n=t.apply(history,e);return this._onUrlChange(),n},window.addEventListener("popstate",this._onPopState.bind(this))}_onPopState(e){this._onUrlChange()}async _onUrlChange(){if(!this.config.is_success)return;if(!this.config.domain)return;const e=this.config.getPath(),t=this.config.getCurrentLanguage();if(this.url_translations_cache[e])this.url_translations=this.url_translations_cache[e];else if("/"!==e&&!e.endsWith(".php")&&this.config.translate_urls)try{const n=await A.getUrlTranslations(t,e);this.url_translations=n,this.url_translations_cache[e]=n}catch(e){console.warn("Linguise: Failed to fetch URL translations:",e),this.url_translations={}}else this.url_translations={};this._updateAlternateLinks(),this._updateSwitcherLinks()}_updateAlternateLinks(){document.querySelectorAll("link[data-linguise-alternate]").forEach((e=>{const t=e.getAttribute("data-linguise-alternate");t&&(e.href=T.getLanguageUrl(this.config,"x-default"===t?this.config.default_language:t))}))}_updateSwitcherLinks(){document.querySelectorAll("a[data-ling-lang]").forEach((e=>{const t=e.getAttribute("data-ling-lang");t&&(e.href=T.getLanguageUrl(this.config,t))}))}};const J=class{constructor(e){this.currentScript=e}async mainLinguiseConfigLoader(e,t){let n=e.apiKey;const i=document.currentScript||this.currentScript;if(i&&!n){n=new URL(i.src).searchParams.get("d")}if(!n&&!A._stored_pkey)throw new Error("Linguise: cannot retrieve domain configuration, disabling dynamic content");A.setPublicKey(n);const r=await A.getConfig();if(!r)throw new Error("Linguise: cannot retrieve domain configuration, disabling dynamic content");r.public_key=A._stored_pkey,t(r)}getLinguiseConfigsVarsLoader(){if(!window.linguise_configs)return;const t=window.linguise_configs.vars.configs;if(!t)return!1;const n=t.dynamic_translations,i=n?n.enabled:0,r=1===t.debug;e.enable(r,!0);const a="string"==typeof i?"1"===i:1===i;if(!a)return!1;const s=n?n.public_key:"";if(!s)return e.warn("No public key provided, dynamic translations are disabled."),!1;return[async(e,n)=>{const i=[];for(const e in t.languages)i.push({code:e,name:t.languages[e]});n({public_key:s,dynamic_translations:{enabled:a},language:t.default_language||t.language_default,languages:i,debug:r,url:t.base_url})},t.translate_host]}};const Y=class{constructor(e){this.currentScript=e}async initDynamicContent(){const t=new J(this.currentScript),n=t.getLinguiseConfigsVarsLoader();if(!1===n)return;let i;i=Array.isArray(n)&&2===n.length?new H(n[0],n[1]):new H(t.mainLinguiseConfigLoader);try{i.initialize()}catch(t){return e.error("Failed to initialize dynamic content",t),void i.cancelProcess()}try{i.wrapFetchConfig()}catch(t){e.error("Failed to initialize dynamic content config",t),i.cancelProcess()}}async loadSwitcher(e){const t=new V(e);let n=!0;if(e){const t=new URL(e.src);"1"===t.searchParams.get("hide")&&(n=!1),A.setPublicKey(t.searchParams.get("d"))}n&&await t.initialize()}},Z=document.currentScript;if("loading"!==document.readyState){const e=new Y(Z);e.loadSwitcher(Z),e.initDynamicContent()}else document.addEventListener("DOMContentLoaded",(()=>{const e=new Y(Z);e.loadSwitcher(Z),e.initDynamicContent()}))})()})();
// source --> https://one-fox.com/wp-content/plugins/stock-market-ticker/assets/stockdio-wp.js?ver=1.9.27 
!function(d,_){"use strict";if("IntersectionObserver"in d&&"IntersectionObserverEntry"in d&&"intersectionRatio"in d.IntersectionObserverEntry.prototype)"isIntersecting"in d.IntersectionObserverEntry.prototype||Object.defineProperty(d.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return 0<this.intersectionRatio}});else{var e=[];t.prototype.THROTTLE_TIMEOUT=100,t.prototype.POLL_INTERVAL=null,t.prototype.USE_MUTATION_OBSERVER=!0,t.prototype.observe=function(e){if(!this._observationTargets.some(function(t){return t.element==e})){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},t.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter(function(t){return t.element!=e}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},t.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},t.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},t.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||1<t)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},t.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},t.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(n(d,"resize",this._checkForIntersections,!0),n(_,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in d&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(_,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},t.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,o(d,"resize",this._checkForIntersections,!0),o(_,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},t.prototype._checkForIntersections=function(){var h=this._rootIsInDom(),c=h?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach(function(t){var e=t.element,n=m(e),o=this._rootContainsTarget(e),i=t.entry,r=h&&o&&this._computeTargetAndRootIntersection(e,c),s=t.entry=new a({time:d.performance&&performance.now&&performance.now(),target:e,boundingClientRect:n,rootBounds:c,intersectionRect:r});i?h&&o?this._hasCrossedThreshold(i,s)&&this._queuedEntries.push(s):i&&i.isIntersecting&&this._queuedEntries.push(s):this._queuedEntries.push(s)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},t.prototype._computeTargetAndRootIntersection=function(t,e){if("none"!=d.getComputedStyle(t).display){for(var n,o,i,r,s,h,c,a,u=m(t),l=v(t),p=!1;!p;){var f=null,g=1==l.nodeType?d.getComputedStyle(l):{};if("none"==g.display)return;if(l==this.root||l==_?(p=!0,f=e):l!=_.body&&l!=_.documentElement&&"visible"!=g.overflow&&(f=m(l)),f&&(n=f,o=u,void 0,i=Math.max(n.top,o.top),r=Math.min(n.bottom,o.bottom),s=Math.max(n.left,o.left),h=Math.min(n.right,o.right),a=r-i,!(u=0<=(c=h-s)&&0<=a&&{top:i,bottom:r,left:s,right:h,width:c,height:a})))break;l=v(l)}return u}},t.prototype._getRootRect=function(){var t;if(this.root)t=m(this.root);else{var e=_.documentElement,n=_.body;t={top:0,left:0,right:e.clientWidth||n.clientWidth,width:e.clientWidth||n.clientWidth,bottom:e.clientHeight||n.clientHeight,height:e.clientHeight||n.clientHeight}}return this._expandRectByRootMargin(t)},t.prototype._expandRectByRootMargin=function(n){var t=this._rootMarginValues.map(function(t,e){return"px"==t.unit?t.value:t.value*(e%2?n.width:n.height)/100}),e={top:n.top-t[0],right:n.right+t[1],bottom:n.bottom+t[2],left:n.left-t[3]};return e.width=e.right-e.left,e.height=e.bottom-e.top,e},t.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,o=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==o)for(var i=0;i<this.thresholds.length;i++){var r=this.thresholds[i];if(r==n||r==o||r<n!=r<o)return!0}},t.prototype._rootIsInDom=function(){return!this.root||i(_,this.root)},t.prototype._rootContainsTarget=function(t){return i(this.root||_,t)},t.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},t.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},d.IntersectionObserver=t,d.IntersectionObserverEntry=a}function a(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0},this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,o=this.intersectionRect,i=o.width*o.height;this.intersectionRatio=n?i/n:this.isIntersecting?1:0}function t(t,e){var n,o,i,r=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(r.root&&1!=r.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),o=this.THROTTLE_TIMEOUT,i=null,function(){i||(i=setTimeout(function(){n(),i=null},o))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(r.rootMargin),this.thresholds=this._initThresholds(r.threshold),this.root=r.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function n(t,e,n,o){"function"==typeof t.addEventListener?t.addEventListener(e,n,o||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function o(t,e,n,o){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,o||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function m(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function i(t,e){for(var n=e;n;){if(n==t)return!0;n=v(n)}return!1}function v(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e}}(window,document);

if (typeof(stockdio_event) == "undefined") {
  stockdio_event = true;
  var stockdio_eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
  var stockdio_eventer = window[stockdio_eventMethod];
  var stockdio_messageEvent = stockdio_eventMethod == "attachEvent" ? "onmessage" : "message";
  stockdio_eventer(stockdio_messageEvent, function (e) {
	  	if (e.origin !== "https://api.stockdio.com") return;
		if (typeof(e.data) != "undefined" && typeof(e.data.methodName) != "undefined") {
			var methodName = e.data.methodName;
			var params = e.data.methodParams;
			switch (methodName) 
			{
				case 'clickNews':
					window.open(params[0]);
				break;
				case 'clickQuote':
					if (params[1] === 'self')
						window.location.href=params[0];
					else
						window.open(params[0]);
					break;
				case 'adjustBorderHeight':
					var stockdio_iframe = document.getElementById(params[0]); 
					if (stockdio_iframe != undefined && stockdio_iframe != null)
						stockdio_iframe.height = params[1];
					break;
				case 'adjustFinancialBorderHeight':
					var stockdio_iframe = document.getElementById(params[0]); 
					if (stockdio_iframe != undefined && stockdio_iframe != null) { 
						stockdio_iframe.height = params[1];
						stockdio_iframe.style.height = `${params[1]}px`; 
					}
					break;
				case 'cssLoaded':
					var stockdio_iframe = document.getElementById(params[0]); 
					console.log('stockdio_iframe',params[1],stockdio_iframe);
					if (stockdio_iframe != undefined && stockdio_iframe != null) 
						stockdio_iframe.height = params[1];
					break;
				case 'setIframeHeight': 
					if (params[3] != 'Ticker') {
						var stockdio_iframe = document.getElementById(params[0]); 
						if (stockdio_iframe != undefined && stockdio_iframe != null) { 
							stockdio_iframe.height = params[1]; 
							stockdio_iframe.style.height = `${params[1]}px`; 
						}
					}
					else {
						var stockdio_iframe = document.getElementById(params[0]); 
						if (stockdio_iframe != undefined && stockdio_iframe != null) { 
							stockdio_iframe.height = params[1]; 
							stockdio_iframe.width = params[2]; 
							stockdio_iframe.scrolling = 'no' 
						}
					}
			
					if (params[0] === 'Ticker') {
						if (typeof(recalculate_stockdio_width) === 'undefined') { 
							recalculate_stockdio_width = function(initial, iframeId) { 
								if (true || (/iPhone|iPad|iPod|Android|IEMobile|blackberry|Windows Phone|webOS|Tablet|Nexus 7|Nexus 10|fennec/i.test(navigator.userAgent))) { 
									var item = document.getElementById(iframeId); 
									if (item != null) { 
										var parent = item.parentElement; 
										var maxWidth = 10000000; 
										if (parent != null) 
											maxWidth = parent.offsetWidth; 
										if (initial!='') 
											item.style.width = initial; 
										var newWidth = Math.min(item.offsetWidth, maxWidth); 
										item.style.width = newWidth + 'px'; 
									} 
								} 
							}
						}
						if (typeof(orientationchange_stockdio) === 'undefined') { 
							orientationchange_stockdio = true; 
							window.addEventListener('orientationchange', function() { 
								var frames = document.getElementsByTagName('iframe'); 
								for(var i = 0;i < frames.length; i++) { 
									if (frames[i].src.toLowerCase().indexOf('api.stockdio.com') > 0) { 
										recalculate_stockdio_width('100%', frames[i].id); 
									} 
								} 
							}, false); 
						}
						recalculate_stockdio_width('', params[0]);
					}
					break;
					case 'displayResults':
						var stockdio_iframe = document.getElementById(params[0]);
						if (stockdio_iframe != undefined && stockdio_iframe != null) 
							stockdio_iframe.height = params[1];
					break;
				default:
					break;
			}
		}
  },false);	   
}

(function () {
	  if (typeof(stockdio_events) == "undefined") {
		  stockdio_events = true;
	   	   		   
		   stockdioOnloadFunction = function () {
			   if (window.IntersectionObserver) {
					var elements = document.querySelectorAll('iframe[iframesrc]');		
					var element; var i;
					for (i=0; i< elements.length; i++){
						element = elements[i];
						if (element!=null && typeof(element) != "undefined") {					
							  var observer = new IntersectionObserver(function(entries) {
									//entries.forEach(function(entry) {
									var entry;var j;
									for (j=0; j< entries.length; j++){	
										entry = entries[j];
										element = entry.target;
										if (element.src != ""){
											observer.unobserve(element);
										}
										else {
											if (entry.isIntersecting) {
												if (entry.intersectionRatio > 0) {
													element.src = element.getAttribute("iframesrc");
												}
											}
										}
									//});					
									}
							  }, {
								rootMargin: "0px"
							  });
							  observer.POLL_INTERVAL = 100; // Time in milliseconds.
							  observer.observe(element);
							}
						};
				}		
				else{
					//browser do not support IntersectionObserver
					changeStockdioIframeSrc();
				}			
			}

		window.addEventListener ? 
		window.addEventListener("load",stockdioOnloadFunction,false) : 
		window.attachEvent && window.attachEvent("onload",stockdioOnloadFunction);				
			
			changeStockdioIframeSrc = function(){
				setTimeout(function(){
					var elements = document.querySelectorAll('iframe[iframesrc]');	
					var element;var i;
					for (i=0; i< elements.length; i++){
						element = elements[i];
						var b = false;
						if (element!=null && typeof(element) != "undefined" && element.src == "") {
							if (checkVisible(element))
								element.src = element.getAttribute("iframesrc");
							else b = true;
						}
						if (b) changeStockdioIframeSrc();
					}

				}, 100);
			}
			
			checkVisible = function(element) {
			  var rect = element.getBoundingClientRect();
			  var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
			  return !(rect.bottom < 0 || rect.top - viewHeight >= 0);
			}			
	  }
} ());