// source --> https://liangyi.com.sg/wp-content/plugins/linguise/assets/js/front.bundle.js?ver=2.2.39 
/*! 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:()=>N,__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 N(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)}}const c="v4.1",u="_linguise_ttl",h="linguiseDynamicCache";function d(e){return Math.floor(((new Date).getTime()+e)/1e3)}function g(e,t){return t?`${t}::${e}`:e}class f{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(h);if(!e)return;const t=JSON.parse(e);t.version===c&&(this.caches=t.caches,this.global_ttl=Number(t[u]),this.updateTTL())}updateTTL(){const e=Math.floor((new Date).getTime()/1e3);if(isNaN(this.global_ttl))return this.global_ttl=d(this.MAX_TTL_TIME),void this.saveToStorageDebounced();e>this.global_ttl&&(this.caches={}),this.global_ttl=d(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=g(e,i);this.caches[n][r]?(this.caches[n][r].value=t,this.caches[n][r].ttl=d(this.MAX_TTL_TIME)):this.caches[n][r]={value:t,ttl:d(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=g(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(h,JSON.stringify({version:c,caches:this.caches,[u]:this.global_ttl}))}flush(){this.caches={},this.updateTTL()}}function p(){return f.instance||(f.instance=new f,window.globalLinguiseCache=f.instance),f.instance}class _{constructor(e,t,n,i={}){this.id=e?e.id:"noop",this.index=t,this.text=n,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 _(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?_.fromElement(n):void 0}}const m=_;const b=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 m(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 m(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)`),i.setAttribute(e,t),n.skipCache||n.dryRun||p().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||{});if(i.skipCache||this.cachedIndex.push(e.index),this.element.nodeType===Node.TEXT_NODE)if(i.dryRun){const t=this.element.textContent.match(/\s*$/)[0];this.element.textContent=e.text+" (translated)"+t}else if(i.skipCache||p().add(this.element.textContent,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=e.text,this.bindEditor(this.parentElement);else{const t=document.createElement("span");t.textContent=e.text,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=e.text;else if(this.element.childNodes[e.index])if(i.dryRun){const t=this.element.childNodes[e.index].textContent.match(/\s*$/)[0];this.element.childNodes[e.index].textContent=e.text+" (translated)"+t}else{i.skipCache||p().add(this.element.childNodes[e.index].textContent,e.text,t,e.subId);const n=this.element.childNodes[e.index];if(e.editorMeta){const t=document.createElement("span");t.textContent=e.text,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=e.text}}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 y=r(634),w=r(735),E=r.n(w);const v=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 T=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+"/"+E().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 v.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 y.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 A=r(260),x=r.n(A);const N=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})`:`(${x()(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 S=class extends b{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 m(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 L=class extends b{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 m(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 m(this,0,n);e.subId="alt",t.push(e)}if(i&&this.shouldWeTranslate(i)){const e=new m(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||p().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 C=class extends b{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 m(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(){}},k={IMG:L,A:S,TEXTAREA:C,INPUT:C};const I=class{static createAsNode(e,t){const n=e.nodeName.toUpperCase();return new(k[n]||b)(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 P=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=[]}},M=p(),O=new Set;for(const e in s)s[e].forEach((e=>{O.add(e)}));const R={childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0,attributeFilter:[...O,"linguise-ignore"]};class D{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 P(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 N,this._config_fetch=t,this._linguise_editor=!1,this.patchAttachShadow()}wrapFetchConfig(){"function"==typeof this._config_fetch&&this._config_fetch(this.config,(async t=>{const n=T.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 N(r),this.rules.shouldPauseDynamicContent())return e.warn("Dynamic content is paused due to rules",this.rules.pause_dynamic_content_rules),void this.cancelProcess();if(T.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=I.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)return n})).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 T.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=I.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=I.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=m.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){const i=I.createAsNode(t,n);if(this._locker.isLocked(t))return void e.debug("Skipping locked node",i);let r=[];try{r=i.tokenize()}catch{return}if(this.setLinguiseEditorActiveStatus())return e.log("Linguise editor is active, skipping cache"),i;return r.map((e=>{if(this.isWpBrickDetected)return!1;const t=M.get(e.text,this.current_language||this.current_document_language,e.subId);if(t){const n=new m(null,e.index,t);return e.subId&&(n.subId=e.subId),this._locker.add(i.element),i.applyChange(n,this.current_language||this.current_document_language,{dryRun:this.config.dryRun}),!0}for(const[t,n]of Object.entries(e.metaExtra||{})){const r=M.get(n,this.current_language||this.current_document_language,e.subId);if(r){const n={};n[t]=r;const a=new m(null,e.index,e.text,n);return e.subId&&(a.subId=e.subId),this._locker.add(i.element),i.applyChange(a,this.current_language||this.current_document_language,{dryRun:this.config.dryRun}),!0}}return!1})).every((e=>e))?void 0:i}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(I.isParentNodeIgnored(n))return!1;if(I.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&&I.isIgnoredAttribute(n)||I.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),"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);e&&n.push(e)}}else if("childList"===e.type&&e.addedNodes.length>0){const t=[];e.addedNodes.forEach((e=>{const n=I.uniqueElementNode(I.collectChildren(e));t.push(...n)}));const i=I.uniqueElementNode(t).filter((([e,t])=>this.isElementPreflightAllow(e,t)));if(i.length>0){const e=i.filter((([e])=>!this.isShadowRoot(e))).map((([e,t])=>this.applyCacheOrTranslate(e,t))).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);r&&(this.config_ready&&r.blurParent(),n.push(r))}})),n.length&&(this.config_ready&&n.forEach((e=>e.detachEditor())),this.debouncedProcessTranslation(n))}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}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),M.importFromStorage(),M.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");I.collectShadowNodes().forEach((e=>{e.shadowRoot&&this.attachShadowObserver(e.shadowRoot)})),e.log("Starting observer",i),this.observer.observe(document.body,R)}}const U=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                                ${v.renderFlag(n,t.code)}\n                                ${v.renderLanguageName(n,t.code,t.name,t.original_name)}\n                            </a>\n                          </div>`,v.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}v.sort(e);const t=e.language_settings,n=v.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="${v.getLanguageUrl(e,n.code)}">\n                                   ${v.renderFlag(t,n.code)}\n                                   ${v.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");v.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 H=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));v.sort(e);const n=e.language_settings,i=v.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                        ${v.renderFlag(n,e.current_language)}\n                        ${v.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="${v.getLanguageUrl(e,t.code)}">\n                                            <li class="linguise_lang_item" data-lang="${t.code}" id="linguise_lang_item">\n                                                ${v.renderFlag(n,t.code)}\n                                                ${v.renderLanguageName(n,t.code,t.name,t.original_name,!0)}\n                                            </li>\n                                        </a>`})).join("")}\n                    </ul>\n                </li>\n            </ul>`,r.id="dropdown",v.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){v.sort(e);const t=e.language_settings,n=v.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="${v.getLanguageUrl(e,n.code)}">\n                                ${v.renderFlag(t,n.code)}\n                                ${v.renderLanguageName(t,n.code,n.name,n.original_name)}\n                            </a>`)).join("")}\n            </div>`,i.id="side_by_side",v.replaceLinguiseShortcodeToSwitcher(t?.position??"bottom_right",i,e),i}postLoad(){}};const $=class{static platform=null;constructor(e){this.switcher=e}onInitialize(){}afterInitialize(e){}};class j extends ${static platform="shopify";constructor(t){super(t),this.logger=e.createChild("Patcher.Shopify")}onInitialize(){}afterInitialize(e){if(e===j.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 B=j;class z extends ${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!==z.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 W=z;const q=class{constructor(t){this.platforms={shopify:new B(t),tilda:new W(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 X=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&&T.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 T.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 G=class{constructor(e){this.url_translations={},this._current_script=e,this._switcher=null,this._switcher_element=null,this.config=new X(this._current_script,this),this.patcher=new q(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 T.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 H;this._switcher=e,this._switcher_element=e.load(this.config);break}case"popup":{const e=new U;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 U;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=v.getLanguageUrl(this.config,"x-default"===e?this.config.default_language: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;v.replaceAndPaintElement(n,this._switcher_element,i),r||this.demo_mode||v.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");v.replaceAndPaintElement(n,this._switcher_element,e),i||this.config.demo_mode||v.languagePosition(n,e?.display,e?.position),t=!0}else"[linguise]"===n.textContent?.trim()&&(v.replaceAndPaintElement(n,this._switcher_element,e),t=!0)}}t&&this._switcher&&this._switcher.postLoad(this.config)}))})).observe(document.body,{childList:!0,subtree:!0})}};const K=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&&!T._stored_pkey)throw new Error("Linguise: cannot retrieve domain configuration, disabling dynamic content");T.setPublicKey(n);const r=await T.getConfig();if(!r)throw new Error("Linguise: cannot retrieve domain configuration, disabling dynamic content");r.public_key=T._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 V=class{constructor(e){this.currentScript=e}async initDynamicContent(){const t=new K(this.currentScript),n=t.getLinguiseConfigsVarsLoader();if(!1===n)return;let i;i=Array.isArray(n)&&2===n.length?new D(n[0],n[1]):new D(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 G(e);let n=!0;if(e){const t=new URL(e.src);"1"===t.searchParams.get("hide")&&(n=!1),T.setPublicKey(t.searchParams.get("d"))}n&&await t.initialize()}},J=document.currentScript;if("loading"!==document.readyState){const e=new V(J);e.loadSwitcher(J),e.initDynamicContent()}else document.addEventListener("DOMContentLoaded",(()=>{const e=new V(J);e.loadSwitcher(J),e.initDynamicContent()}))})()})();
// source --> https://liangyi.com.sg/wp-content/plugins/happy-elementor-addons/assets/vendor/dom-purify/purify.min.js?ver=3.1.6 
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.6",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):D({}),Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):D({}),qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),Ue&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a),m=c;let f="value"===a?m:A(m);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),f=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),f="user-content-"+f),Ue&&S(/((--!?|])>)|<\/(style|title)/i,f)){At(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){At(a,e);continue}if(!Me&&S(/\/>/i,f)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{f=y(f,e," ")}));const d=pt(e.nodeName);if(Ot(d,s,f)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(d,s)){case"TrustedHTML":f=le.createHTML(f);break;case"TrustedScriptURL":f=le.createScriptURL(f)}if(f!==m)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),bt(e)?Et(e):p(o.removed)}catch(t){At(a,e)}}else At(a,e)}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));
//# sourceMappingURL=purify.min.js.map;