@tryghost/sodo-search 1.8.521 → 1.8.522
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/umd/sodo-search.min.js +1 -1
package/package.json
CHANGED
package/umd/sodo-search.min.js
CHANGED
|
@@ -14,4 +14,4 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
14
14
|
.ghost-display {
|
|
15
15
|
display: none;
|
|
16
16
|
}
|
|
17
|
-
`,t=this.context.stylesUrl;return t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`link`,{rel:`stylesheet`,href:t}),(0,b.jsx)(`style`,{dangerouslySetInnerHTML:{__html:e}}),(0,b.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1, maximum-scale=1`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`style`,{dangerouslySetInnerHTML:{__html:e}}),(0,b.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1, maximum-scale=1`})]})}renderFrameContainer(){let e=D(),t={...e.frame.common};return(0,b.jsx)(`div`,{style:e.modalContainer,className:`gh-root-frame`,children:(0,b.jsxs)(C,{style:t,title:`portal-popup`,head:this.renderFrameStyles(),searchdir:this.context.dir,children:[(0,b.jsx)(`div`,{onClick:e=>this.handlePopupClose(e),className:`absolute top-0 bottom-0 left-0 right-0 block backdrop-blur-[2px] animate-fadein z-0 bg-gradient-to-br from-[rgba(0,0,0,0.2)] to-[rgba(0,0,0,0.1)]`}),(0,b.jsx)(O,{})]})})}render(){let{showPopup:e}=this.context;return e?this.renderFrameContainer():null}},me=o(((e,t)=>{t.exports={}})),I;function L(e,t,n){let r=typeof n,i=typeof e;if(r!==`undefined`){if(i!==`undefined`){if(n){if(i===`function`&&r===i)return function(t){return e(n(t))};if(t=e.constructor,t===n.constructor){if(t===Array)return n.concat(e);if(t===Map){var a=new Map(n);for(var o of e)a.set(o[0],o[1]);return a}if(t===Set){o=new Set(n);for(a of e.values())o.add(a);return o}}}return e}return n}return i===`undefined`?t:e}function he(e,t){return e===void 0?t:e}function R(){return Object.create(null)}function ge(e){return typeof e==`string`}function _e(e){return typeof e==`object`}function ve(e,t){if(ge(t))e=e[t];else for(let n=0;e&&n<t.length;n++)e=e[t[n]];return e}var ye=/[^\p{L}\p{N}]+/u,be=/(\d{3})/g,xe=/(\D)(\d{3})/g,Se=/(\d{3})(\D)/g,Ce=/[\u0300-\u036f]/g;function we(e={}){if(!this||this.constructor!==we)return new we(...arguments);if(arguments.length)for(e=0;e<arguments.length;e++)this.assign(arguments[e]);else this.assign(e)}I=we.prototype,I.assign=function(e){this.normalize=L(e.normalize,!0,this.normalize);let t=e.include,n=t||e.exclude||e.split,r;if(n||n===``){if(typeof n==`object`&&n.constructor!==RegExp){let e=``;r=!t,t||(e+=`\\p{Z}`),n.letter&&(e+=`\\p{L}`),n.number&&(e+=`\\p{N}`,r=!!t),n.symbol&&(e+=`\\p{S}`),n.punctuation&&(e+=`\\p{P}`),n.control&&(e+=`\\p{C}`),(n=n.char)&&(e+=typeof n==`object`?n.join(``):n);try{this.split=RegExp(`[`+(t?`^`:``)+e+`]+`,`u`)}catch{this.split=/\s+/}}else this.split=n,r=n===!1||`a1a`.split(n).length<2;this.numeric=L(e.numeric,r)}else{try{this.split=L(this.split,ye)}catch{this.split=/\s+/}this.numeric=L(e.numeric,L(this.numeric,!0))}if(this.prepare=L(e.prepare,null,this.prepare),this.finalize=L(e.finalize,null,this.finalize),n=e.filter,this.filter=typeof n==`function`?n:L(n&&new Set(n),null,this.filter),this.dedupe=L(e.dedupe,!0,this.dedupe),this.matcher=L((n=e.matcher)&&new Map(n),null,this.matcher),this.mapper=L((n=e.mapper)&&new Map(n),null,this.mapper),this.stemmer=L((n=e.stemmer)&&new Map(n),null,this.stemmer),this.replacer=L(e.replacer,null,this.replacer),this.minlength=L(e.minlength,1,this.minlength),this.maxlength=L(e.maxlength,1024,this.maxlength),this.rtl=L(e.rtl,!1,this.rtl),(this.cache=n=L(e.cache,!0,this.cache))&&(this.F=null,this.L=typeof n==`number`?n:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h=``,this.J=null,this.A=``,this.K=null,this.matcher)for(let e of this.matcher.keys())this.h+=(this.h?`|`:``)+e;if(this.stemmer)for(let e of this.stemmer.keys())this.A+=(this.A?`|`:``)+e;return this},I.addStemmer=function(e,t){return this.stemmer||=new Map,this.stemmer.set(e,t),this.A+=(this.A?`|`:``)+e,this.K=null,this.cache&&Te(this),this},I.addFilter=function(e){return typeof e==`function`?this.filter=e:(this.filter||=new Set,this.filter.add(e)),this.cache&&Te(this),this},I.addMapper=function(e,t){return typeof e==`object`?this.addReplacer(e,t):e.length>1?this.addMatcher(e,t):(this.mapper||=new Map,this.mapper.set(e,t),this.cache&&Te(this),this)},I.addMatcher=function(e,t){return typeof e==`object`?this.addReplacer(e,t):e.length<2&&(this.dedupe||this.mapper)?this.addMapper(e,t):(this.matcher||=new Map,this.matcher.set(e,t),this.h+=(this.h?`|`:``)+e,this.J=null,this.cache&&Te(this),this)},I.addReplacer=function(e,t){return typeof e==`string`?this.addMatcher(e,t):(this.replacer||=[],this.replacer.push(e,t),this.cache&&Te(this),this)},I.encode=function(e,t){if(this.cache&&e.length<=this.H)if(this.F){if(this.B.has(e))return this.B.get(e)}else this.F=setTimeout(Te,50,this);this.normalize&&(e=typeof this.normalize==`function`?this.normalize(e):Ce?e.normalize(`NFKD`).replace(Ce,``).toLowerCase():e.toLowerCase()),this.prepare&&(e=this.prepare(e)),this.numeric&&e.length>3&&(e=e.replace(xe,`$1 $2`).replace(Se,`$1 $2`).replace(be,`$1 `));let n=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer),r=[],i=R(),a,o,s=this.split||this.split===``?e.split(this.split):[e];for(let e=0,l,u;e<s.length;e++)if((l=u=s[e])&&!(l.length<this.minlength||l.length>this.maxlength)){if(t){if(i[l])continue;i[l]=1}else{if(a===l)continue;a=l}if(n)r.push(l);else if(!this.filter||(typeof this.filter==`function`?this.filter(l):!this.filter.has(l))){if(this.cache&&l.length<=this.I)if(this.F){var c=this.D.get(l);if(c||c===``){c&&r.push(c);continue}}else this.F=setTimeout(Te,50,this);if(this.stemmer){this.K||=RegExp(`(?!^)(`+this.A+`)$`);let e;for(;e!==l&&l.length>2;)e=l,l=l.replace(this.K,e=>this.stemmer.get(e))}if(l&&(this.mapper||this.dedupe&&l.length>1)){c=``;for(let e=0,t=``,n,r;e<l.length;e++)n=l.charAt(e),n===t&&this.dedupe||((r=this.mapper&&this.mapper.get(n))||r===``?r===t&&this.dedupe||!(t=r)||(c+=r):c+=t=n);l=c}if(this.matcher&&l.length>1&&(this.J||=RegExp(`(`+this.h+`)`,`g`),l=l.replace(this.J,e=>this.matcher.get(e))),l&&this.replacer)for(c=0;l&&c<this.replacer.length;c+=2)l=l.replace(this.replacer[c],this.replacer[c+1]);if(this.cache&&u.length<=this.I&&(this.D.set(u,l),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),l){if(l!==u)if(t){if(i[l])continue;i[l]=1}else{if(o===l)continue;o=l}r.push(l)}}}return this.finalize&&(r=this.finalize(r)||r),this.cache&&e.length<=this.H&&(this.B.set(e,r),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),r};function Te(e){e.F=null,e.B.clear(),e.D.clear()}function Ee(e,t,n){n||(t||typeof e!=`object`?typeof t==`object`&&(n=t,t=0):n=e),n&&(e=n.query||e,t=n.limit||t);let r=``+(t||0);n&&(r+=(n.offset||0)+!!n.context+!!n.suggest+(n.resolve!==!1)+(n.resolution||this.resolution)+(n.boost||0)),e=(``+e).toLowerCase(),this.cache||=new De;let i=this.cache.get(e+r);if(!i){let a=n&&n.cache;a&&(n.cache=!1),i=this.search(e,t,n),a&&(n.cache=a),this.cache.set(e+r,i)}return i}function De(e){this.limit=e&&e!==!0?e:1e3,this.cache=new Map,this.h=``}De.prototype.set=function(e,t){this.cache.set(this.h=e,t),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},De.prototype.get=function(e){let t=this.cache.get(e);return t&&this.h!==e&&(this.cache.delete(e),this.cache.set(this.h=e,t)),t},De.prototype.remove=function(e){for(let t of this.cache){let n=t[0];t[1].includes(e)&&this.cache.delete(n)}},De.prototype.clear=function(){this.cache.clear(),this.h=``};var Oe={normalize:!1,numeric:!1,dedupe:!1},ke={},Ae=new Map([[`b`,`p`],[`v`,`f`],[`w`,`f`],[`z`,`s`],[`x`,`s`],[`d`,`t`],[`n`,`m`],[`c`,`k`],[`g`,`k`],[`j`,`k`],[`q`,`k`],[`i`,`e`],[`y`,`e`],[`u`,`o`]]),je=new Map([[`ae`,`a`],[`oe`,`o`],[`sh`,`s`],[`kh`,`k`],[`th`,`t`],[`ph`,`f`],[`pf`,`f`]]),Me=[/([^aeo])h(.)/g,`$1$2`,/([aeo])h([^aeo]|$)/g,`$1$2`,/(.)\1+/g,`$1`],Ne={a:``,e:``,i:``,o:``,u:``,y:``,b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6},Pe={Exact:Oe,Default:ke,Normalize:ke,LatinBalance:{mapper:Ae},LatinAdvanced:{mapper:Ae,matcher:je,replacer:Me},LatinExtra:{mapper:Ae,replacer:Me.concat([/(?!^)[aeo]/g,``]),matcher:je},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(e){for(let n=0;n<e.length;n++){var t=e[n];let r=t.charAt(0),i=Ne[r];for(let e=1,n;e<t.length&&(n=t.charAt(e),n===`h`||n===`w`||!(n=Ne[n])||n===i||(r+=n,i=n,r.length!==4));e++);e[n]=r}}},CJK:{split:``},LatinExact:Oe,LatinDefault:ke,LatinSimple:ke};function Fe(e,t,n,r){let i=[];for(let a=0,o;a<e.index.length;a++)if(o=e.index[a],t>=o.length)t-=o.length;else{t=o[r?`splice`:`slice`](t,n);let a=t.length;if(a&&(i=i.length?i.concat(t):t,n-=a,r&&(e.length-=a),!n))break;t=0}return i}function Ie(e){if(!this||this.constructor!==Ie)return new Ie(e);this.index=e?[e]:[],this.length=e?e.length:0;let t=this;return new Proxy([],{get(e,n){if(n===`length`)return t.length;if(n===`push`)return function(e){t.index[t.index.length-1].push(e),t.length++};if(n===`pop`)return function(){if(t.length)return t.length--,t.index[t.index.length-1].pop()};if(n===`indexOf`)return function(e){let n=0;for(let r=0,i,a;r<t.index.length;r++){if(i=t.index[r],a=i.indexOf(e),a>=0)return n+a;n+=i.length}return-1};if(n===`includes`)return function(e){for(let n=0;n<t.index.length;n++)if(t.index[n].includes(e))return!0;return!1};if(n===`slice`)return function(e,n){return Fe(t,e||0,n||t.length,!1)};if(n===`splice`)return function(e,n){return Fe(t,e||0,n||t.length,!0)};if(n===`constructor`)return Array;if(typeof n!=`symbol`)return(e=t.index[n/2**31|0])&&e[n]},set(e,n,r){return e=n/2**31|0,(t.index[e]||(t.index[e]=[]))[n]=r,t.length++,!0}})}Ie.prototype.clear=function(){this.index.length=0},Ie.prototype.push=function(){};function z(e=8){if(!this||this.constructor!==z)return new z(e);this.index=R(),this.h=[],this.size=0,e>32?(this.B=ze,this.A=BigInt(e)):(this.B=Re,this.A=e)}z.prototype.get=function(e){let t=this.index[this.B(e)];return t&&t.get(e)},z.prototype.set=function(e,t){var n=this.B(e);let r=this.index[n];r?(n=r.size,r.set(e,t),(n-=r.size)&&this.size++):(this.index[n]=r=new Map([[e,t]]),this.h.push(r),this.size++)};function Le(e=8){if(!this||this.constructor!==Le)return new Le(e);this.index=R(),this.h=[],this.size=0,e>32?(this.B=ze,this.A=BigInt(e)):(this.B=Re,this.A=e)}Le.prototype.add=function(e){var t=this.B(e);let n=this.index[t];n?(t=n.size,n.add(e),(t-=n.size)&&this.size++):(this.index[t]=n=new Set([e]),this.h.push(n),this.size++)},I=z.prototype,I.has=Le.prototype.has=function(e){let t=this.index[this.B(e)];return t&&t.has(e)},I.delete=Le.prototype.delete=function(e){let t=this.index[this.B(e)];t&&t.delete(e)&&this.size--},I.clear=Le.prototype.clear=function(){this.index=R(),this.h=[],this.size=0},I.values=Le.prototype.values=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].values())yield t},I.keys=Le.prototype.keys=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].keys())yield t},I.entries=Le.prototype.entries=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].entries())yield t};function Re(e){let t=2**this.A-1;if(typeof e==`number`)return e&t;let n=0,r=this.A+1;for(let i=0;i<e.length;i++)n=(n*r^e.charCodeAt(i))&t;return this.A===32?n+2**31:n}function ze(e){let t=BigInt(2)**this.A-BigInt(1);var n=typeof e;if(n===`bigint`)return e&t;if(n===`number`)return BigInt(e)&t;n=BigInt(0);let r=this.A+BigInt(1);for(let i=0;i<e.length;i++)n=(n*r^BigInt(e.charCodeAt(i)))&t;return n}var Be,Ve;async function He(e){e=e.data;var t=e.task;let n=e.id,r=e.args;switch(t){case`init`:Ve=e.options||{},(t=e.factory)?(Function(`return `+t)()(self),Be=new self.FlexSearch.Index(Ve),delete self.FlexSearch):Be=new Lt(Ve),postMessage({id:n});break;default:let i;t===`export`&&(r[1]?(r[0]=Ve.export,r[2]=0,r[3]=1):r=null),t===`import`?r[0]&&(e=await Ve.import.call(Be,r[0]),Be.import(r[0],e)):((i=r&&Be[t].apply(Be,r))&&i.then&&(i=await i),i&&i.await&&(i=await i.await),t===`search`&&i.result&&(i=i.result)),postMessage(t===`search`?{id:n,msg:i}:{id:n})}}function Ue(e){Je.call(e,`add`),Je.call(e,`append`),Je.call(e,`search`),Je.call(e,`update`),Je.call(e,`remove`),Je.call(e,`searchCache`)}var We,Ge,Ke;function qe(){We=Ke=0}function Je(e){this[e+`Async`]=function(){let t=arguments;var n=t[t.length-1];let r;if(typeof n==`function`&&(r=n,delete t[t.length-1]),We?Ke||=Date.now()-Ge>=this.priority*this.priority*3:(We=setTimeout(qe,0),Ge=Date.now()),Ke){let n=this;return new Promise(r=>{setTimeout(function(){r(n[e+`Async`].apply(n,t))},0)})}let i=this[e].apply(this,t);return n=i.then?i:new Promise(e=>e(i)),r&&n.then(r),n}}var Ye=0;function Xe(e={},t){function n(n){function o(e){e=e.data||e;let t=e.id,n=t&&a.h[t];n&&(n(e.msg),delete a.h[t])}if(this.worker=n,this.h=R(),this.worker)return i?this.worker.on(`message`,o):this.worker.onmessage=o,e.config?new Promise(function(t){Ye>1e9&&(Ye=0),a.h[++Ye]=function(){t(a)},a.worker.postMessage({id:Ye,task:`init`,factory:r,options:e})}):(this.priority=e.priority||4,this.encoder=t||null,this.worker.postMessage({task:`init`,factory:r,options:e}),this)}if(!this||this.constructor!==Xe)return new Xe(e);let r=typeof self<`u`?self._factory:typeof window<`u`?window._factory:null;r&&=r.toString();let i=typeof window>`u`,a=this,o=Qe(r,i,e.worker);return o.then?o.then(function(e){return n.call(a,e)}):n.call(this,o)}Ze(`add`),Ze(`append`),Ze(`search`),Ze(`update`),Ze(`remove`),Ze(`clear`),Ze(`export`),Ze(`import`),Xe.prototype.searchCache=Ee,Ue(Xe.prototype);function Ze(e){Xe.prototype[e]=function(){let t=this,n=[].slice.call(arguments);var r=n[n.length-1];let i;return typeof r==`function`&&(i=r,n.pop()),r=new Promise(function(r){e===`export`&&typeof n[0]==`function`&&(n[0]=null),Ye>1e9&&(Ye=0),t.h[++Ye]=r,t.worker.postMessage({task:e,id:Ye,args:n})}),i?(r.then(i),this):r}}function Qe(e,t,n){return t?typeof module<`u`?new(me()).Worker(__dirname+`/worker/node.js`):Promise.resolve().then(()=>c(me(),1)).then(function(e){return new e.Worker({}.dirname+`/node/node.mjs`)}):e?new window.Worker(URL.createObjectURL(new Blob([`onmessage=`+He.toString()],{type:`text/javascript`}))):new window.Worker(typeof n==`string`?n:{}.url.replace(`/worker.js`,`/worker/worker.js`).replace(`flexsearch.bundle.module.min.js`,`module/worker/worker.js`).replace(`flexsearch.bundle.module.min.mjs`,`module/worker/worker.js`),{type:`module`})}gt.prototype.add=function(e,t,n){if(_e(e)&&(t=e,e=ve(t,this.key)),t&&(e||e===0)){if(!n&&this.reg.has(e))return this.update(e,t);for(let a=0,o;a<this.field.length;a++){o=this.B[a];var r=this.index.get(this.field[a]);if(typeof o==`function`){var i=o(t);i&&r.add(e,i,n,!0)}else i=o.G,(!i||i(t))&&(o.constructor===String?o=[``+o]:ge(o)&&(o=[o]),et(t,o,this.D,0,r,e,o[0],n))}if(this.tag)for(r=0;r<this.A.length;r++){var a=this.A[r];i=this.tag.get(this.F[r]);let s=R();if(typeof a==`function`){if(a=a(t),!a)continue}else{var o=a.G;if(o&&!o(t))continue;a.constructor===String&&(a=``+a),a=ve(t,a)}if(i&&a){ge(a)&&(a=[a]);for(let t=0,r,c;t<a.length;t++)if(r=a[t],!s[r]&&(s[r]=1,(o=i.get(r))?c=o:i.set(r,c=[]),!n||!c.includes(e))){if(c.length===2**31-1){if(o=new Ie(c),this.fastupdate)for(let e of this.reg.values())e.includes(c)&&(e[e.indexOf(c)]=o);i.set(r,c=o)}c.push(e),this.fastupdate&&((o=this.reg.get(e))?o.push(c):this.reg.set(e,[c]))}}}if(this.store&&(!n||!this.store.has(e))){let r;if(this.h){r=R();for(let e=0,i;e<this.h.length;e++){if(i=this.h[e],(n=i.G)&&!n(t))continue;let a;if(typeof i==`function`){if(a=i(t),!a)continue;i=[i.O]}else if(ge(i)||i.constructor===String){r[i]=t[i];continue}$e(t,r,i,0,i[0],a)}}this.store.set(e,r||t)}this.worker&&(this.fastupdate||this.reg.add(e))}return this};function $e(e,t,n,r,i,a){if(e=e[i],r===n.length-1)t[i]=a||e;else if(e)if(e.constructor===Array)for(t=t[i]=Array(e.length),i=0;i<e.length;i++)$e(e,t,n,r,i);else t=t[i]||(t[i]=R()),i=n[++r],$e(e,t,n,r,i)}function et(e,t,n,r,i,a,o,s){if(e=e[o])if(r===t.length-1){if(e.constructor===Array){if(n[r]){for(t=0;t<e.length;t++)i.add(a,e[t],!0,!0);return}e=e.join(` `)}i.add(a,e,s,!0)}else if(e.constructor===Array)for(o=0;o<e.length;o++)et(e,t,n,r,i,a,o,s);else o=t[++r],et(e,t,n,r,i,a,o,s)}function tt(e,t,n,r){if(!e.length)return e;if(e.length===1)return e=e[0],e=n||e.length>t?e.slice(n,n+t):e,r?ht.call(this,e):e;let i=[];for(let a=0,o,s;a<e.length;a++)if((o=e[a])&&(s=o.length)){if(n){if(n>=s){n-=s;continue}o=o.slice(n,n+t),s=o.length,n=0}if(s>t&&(o=o.slice(0,t),s=t),!i.length&&s>=t)return r?ht.call(this,o):o;if(i.push(o),t-=s,!t)break}return i=i.length>1?[].concat.apply([],i):i[0],r?ht.call(this,i):i}function nt(e,t,n,r){var i=r[0];if(i[0]&&i[0].query)return e[t].apply(e,i);if(!(t!==`and`&&t!==`not`||e.result.length||e.await||i.suggest))return r.length>1&&(i=r[r.length-1]),(r=i.resolve)?e.await||e.result:e;let a=[],o=0,s=0,c,l,u,d,f;for(t=0;t<r.length;t++)if(i=r[t]){var p=void 0;if(i.constructor===B)p=i.await||i.result;else if(i.then||i.constructor===Array)p=i;else{o=i.limit||0,s=i.offset||0,u=i.suggest,l=i.resolve,c=((d=i.highlight||e.highlight)||i.enrich)&&l,p=i.queue;let n=i.async||p,r=i.index,m=i.query;if(r?e.index||=r:r=e.index,m||i.tag){let o=i.field||i.pluck;if(o&&(!m||e.query&&!d||(e.query=m,e.field=o,e.highlight=d),r=r.index.get(o)),p&&(f||e.await)){f=1;let o,s=e.C.length,c=new Promise(function(e){o=e});(function(t,r){c.h=function(){r.index=null,r.resolve=!1;let i=n?t.searchAsync(r):t.search(r);return i.then?i.then(function(t){return e.C[s]=t=t.result||t,o(t),t}):(i=i.result||i,o(i),i)}})(r,Object.assign({},i)),e.C.push(c),a[t]=c;continue}else i.resolve=!1,i.index=null,p=n?r.searchAsync(i):r.search(i),i.resolve=l,i.index=r}else if(i.and)p=rt(i,`and`,r);else if(i.or)p=rt(i,`or`,r);else if(i.not)p=rt(i,`not`,r);else if(i.xor)p=rt(i,`xor`,r);else continue}p.await?(f=1,p=p.await):p.then?(f=1,p=p.then(function(e){return e.result||e})):p=p.result||p,a[t]=p}if(f&&!e.await&&(e.await=new Promise(function(t){e.return=t})),f){let t=Promise.all(a).then(function(r){for(let i=0;i<e.C.length;i++)if(e.C[i]===t){e.C[i]=function(){return n.call(e,r,o,s,c,l,u,d)};break}lt(e)});e.C.push(t)}else if(e.await)e.C.push(function(){return n.call(e,a,o,s,c,l,u,d)});else return n.call(e,a,o,s,c,l,u,d);return l?e.await||e.result:e}function rt(e,t,n){e=e[t];let r=e[0]||e;return r.index||=n,n=new B(r),e.length>1&&(n=n[t].apply(n,e.slice(1))),n}B.prototype.or=function(){return nt(this,`or`,it,arguments)};function it(e,t,n,r,i,a,o){return e.length&&(this.result.length&&e.push(this.result),e.length<2?this.result=e[0]:(this.result=dt(e,t,n,!1,this.h),n=0)),i&&(this.await=null),i?this.resolve(t,n,r,o):this}B.prototype.and=function(){return nt(this,`and`,at,arguments)};function at(e,t,n,r,i,a,o){if(!a&&!this.result.length)return i?this.result:this;let s;if(e.length)if(this.result.length&&e.unshift(this.result),e.length<2)this.result=e[0];else{let r=0;for(let t=0,n,i;t<e.length;t++)if((n=e[t])&&(i=n.length))r<i&&(r=i);else if(!a){r=0;break}r?(this.result=ut(e,r,t,n,a,this.h,i),s=!0):this.result=[]}else a||(this.result=e);return i&&(this.await=null),i?this.resolve(t,n,r,o,s):this}B.prototype.xor=function(){return nt(this,`xor`,ot,arguments)};function ot(e,t,n,r,i,a,o){if(e.length)if(this.result.length&&e.unshift(this.result),e.length<2)this.result=e[0];else{a:{a=n;var s=this.h;let r=[],o=R(),c=0;for(let t=0,n;t<e.length;t++)if(n=e[t]){c<n.length&&(c=n.length);for(let e=0,t;e<n.length;e++)if(t=n[e])for(let e=0,n;e<t.length;e++)n=t[e],o[n]=o[n]?2:1}for(let n=0,l,u=0;n<c;n++)for(let c=0,d;c<e.length;c++)if((d=e[c])&&(l=d[n])){for(let d=0,f;d<l.length;d++)if(f=l[d],o[f]===1)if(a)a--;else if(i){if(r.push(f),r.length===t){e=r;break a}}else{let i=n+(c?s:0);if(r[i]||(r[i]=[]),r[i].push(f),++u===t){e=r;break a}}}e=r}this.result=e,s=!0}else a||(this.result=e);return i&&(this.await=null),i?this.resolve(t,n,r,o,s):this}B.prototype.not=function(){return nt(this,`not`,st,arguments)};function st(e,t,n,r,i,a,o){if(!a&&!this.result.length)return i?this.result:this;if(e.length&&this.result.length){a:{a=n;var s=[];e=new Set(e.flat().flat());for(let n=0,r,o=0;n<this.result.length;n++)if(r=this.result[n]){for(let c=0,l;c<r.length;c++)if(l=r[c],!e.has(l)){if(a)a--;else if(i){if(s.push(l),s.length===t){e=s;break a}}else if(s[n]||(s[n]=[]),s[n].push(l),++o===t){e=s;break a}}}e=s}this.result=e,s=!0}return i&&(this.await=null),i?this.resolve(t,n,r,o,s):this}function ct(e,t,n,r,i){let a,o,s;typeof i==`string`?(a=i,i=``):a=i.template,o=a.indexOf(`$1`),s=a.substring(o+2),o=a.substring(0,o);let c=i&&i.boundary,l=!i||i.clip!==!1,u=i&&i.merge&&s&&o&&RegExp(s+` `+o,`g`);i&&=i.ellipsis;var d=0;if(typeof i==`object`){var f=i.template;d=f.length-2,i=i.pattern}typeof i!=`string`&&(i=i===!1?``:`...`),d&&(i=f.replace(`$1`,i)),f=i.length-d;let p,m;typeof c==`object`&&(p=c.before,p===0&&(p=-1),m=c.after,m===0&&(m=-1),c=c.total||9e5),d=new Map;for(let N=0,P,ee,te;N<t.length;N++){let ne;if(r)ne=t,te=r;else{var h=t[N];if(te=h.field,!te)continue;ne=h.result}ee=n.get(te),P=ee.encoder,h=d.get(P),typeof h!=`string`&&(h=P.encode(e),d.set(P,h));for(let e=0;e<ne.length;e++){var g=ne[e].doc;if(!g||(g=ve(g,te),!g))continue;var _=g.trim().split(/\s+/);if(!_.length)continue;g=``;var v=[];let t=[];for(var y=-1,b=-1,x=0,S=0;S<_.length;S++){var C=_[S],w=P.encode(C);w=w.length>1?w.join(` `):w[0];let e;if(w&&C){for(var T=C.length,E=(P.split?C.replace(P.split,``):C).length-w.length,D=``,O=0,k=0;k<h.length;k++){var A=h[k];if(A){var j=A.length;j+=E<0?0:E,O&&j<=O||(A=w.indexOf(A),A>-1&&(D=(A?C.substring(0,A):``)+o+C.substring(A,A+j)+s+(A+j<T?C.substring(A+j):``),O=j,e=!0))}}D&&(c&&(y<0&&(y=g.length+ +!!g),b=g.length+ +!!g+D.length,x+=T,t.push(v.length),v.push({match:D})),g+=(g?` `:``)+D)}if(!e)C=_[S],g+=(g?` `:``)+C,c&&v.push({text:C});else if(c&&x>=c)break}if(x=t.length*(a.length-2),p||m||c&&g.length-x>c)if(x=c+x-f*2,S=b-y,p>0&&(S+=p),m>0&&(S+=m),S<=x)_=p?y-(p>0?p:0):y-((x-S)/2|0),v=m?b+(m>0?m:0):_+x,l||(_>0&&g.charAt(_)!==` `&&g.charAt(_-1)!==` `&&(_=g.indexOf(` `,_),_<0&&(_=0)),v<g.length&&g.charAt(v-1)!==` `&&g.charAt(v)!==` `&&(v=g.lastIndexOf(` `,v),v<b?v=b:++v)),g=(_?i:``)+g.substring(_,v)+(v<g.length?i:``);else{for(b=[],y={},x={},S={},C={},w={},D=E=T=0,k=O=1;;){var M=void 0;for(let e=0,n;e<t.length;e++){if(n=t[e],D)if(E!==D){if(S[e+1])continue;if(n+=D,y[n]){T-=f,x[e+1]=1,S[e+1]=1;continue}if(n>=v.length-1){if(n>=v.length){S[e+1]=1,n>=_.length&&(x[e+1]=1);continue}T-=f}if(g=v[n].text,j=m&&w[e])if(j>0){if(g.length>j)if(S[e+1]=1,l)g=g.substring(0,j);else continue;(j-=g.length)||(j=-1),w[e]=j}else{S[e+1]=1;continue}if(T+g.length+1<=c)g=` `+g,b[e]+=g;else if(l)M=c-T-1,M>0&&(g=` `+g.substring(0,M),b[e]+=g),S[e+1]=1;else{S[e+1]=1;continue}}else{if(S[e])continue;if(n-=E,y[n]){T-=f,S[e]=1,x[e]=1;continue}if(n<=0){if(n<0){S[e]=1,x[e]=1;continue}T-=f}if(g=v[n].text,j=p&&C[e])if(j>0){if(g.length>j)if(S[e]=1,l)g=g.substring(g.length-j);else continue;(j-=g.length)||(j=-1),C[e]=j}else{S[e]=1;continue}if(T+g.length+1<=c)g+=` `,b[e]=g+b[e];else if(l)M=g.length+1-(c-T),M>=0&&M<g.length&&(g=g.substring(M)+` `,b[e]=g+b[e]),S[e]=1;else{S[e]=1;continue}}else{g=v[n].match,p&&(C[e]=p),m&&(w[e]=m),e&&T++;let t;if(n?!e&&f&&(T+=f):(x[e]=1,S[e]=1),n>=_.length-1||n<v.length-1&&v[n+1].match?t=1:f&&(T+=f),T-=a.length-2,!e||T+g.length<=c)b[e]=g;else{M=O=k=x[e]=0;break}t&&(x[e+1]=1,S[e+1]=1)}T+=g.length,M=y[n]=1}if(M)E===D?D++:E++;else{if(E===D?O=0:k=0,!O&&!k)break;O?(E++,D=E):D++}}g=``;for(let e=0,t;e<b.length;e++)t=(x[e]?e?` `:``:(e&&!i?` `:``)+i)+b[e],g+=t;i&&!x[b.length]&&(g+=i)}u&&(g=g.replace(u,` `)),ne[e].highlight=g}if(r)break}return t}function B(e,t){if(!this||this.constructor!==B)return new B(e,t);let n=0,r,i,a,o,s,c;if(e&&e.index){let r=e;if(t=r.index,n=r.boost||0,i=r.query){a=r.field||r.pluck,o=r.highlight;let n=r.resolve;e=r.async||r.queue,r.resolve=!1,r.index=null,e=e?t.searchAsync(r):t.search(r),r.resolve=n,r.index=t,e=e.result||e}else e=[]}if(e&&e.then){let t=this;e=e.then(function(e){t.C[0]=t.result=e.result||e,lt(t)}),r=[e],e=[],s=new Promise(function(e){c=e})}this.index=t||null,this.result=e||[],this.h=n,this.C=r||[],this.await=s||null,this.return=c||null,this.highlight=o||null,this.query=i||``,this.field=a||``}I=B.prototype,I.limit=function(e){if(this.await){let t=this;this.C.push(function(){return t.limit(e).result})}else if(this.result.length){let t=[];for(let n=0,r;n<this.result.length;n++)if(r=this.result[n])if(r.length<=e){if(t[n]=r,e-=r.length,!e)break}else{t[n]=r.slice(0,e);break}this.result=t}return this},I.offset=function(e){if(this.await){let t=this;this.C.push(function(){return t.offset(e).result})}else if(this.result.length){let t=[];for(let n=0,r;n<this.result.length;n++)(r=this.result[n])&&(r.length<=e?e-=r.length:(t[n]=r.slice(e),e=0));this.result=t}return this},I.boost=function(e){if(this.await){let t=this;this.C.push(function(){return t.boost(e).result})}else this.h+=e;return this};function lt(e,t){let n=e.result;var r=e.await;e.await=null;for(let t=0,i;t<e.C.length;t++)if(i=e.C[t]){if(typeof i==`function`)n=i(),e.C[t]=n=n.result||n,t--;else if(i.h)n=i.h(),e.C[t]=n=n.result||n,t--;else if(i.then)return e.await=r}return r=e.return,e.C=[],e.return=null,t||r(n),n}I.resolve=function(e,t,n,r,i){let a=this.await?lt(this,!0):this.result;if(a.then){let o=this;return a.then(function(){return o.resolve(e,t,n,r,i)})}return a.length&&(typeof e==`object`?(r=e.highlight||this.highlight,n=!!r||e.enrich,t=e.offset,e=e.limit):(r||=this.highlight,n=!!r||n),a=i?n?ht.call(this.index,a):a:tt.call(this.index,a,e||100,t,n)),this.finalize(a,r)},I.finalize=function(e,t){if(e.then){let n=this;return e.then(function(e){return n.finalize(e,t)})}t&&e.length&&this.query&&(e=ct(this.query,e,this.index.index,this.field,t));let n=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field=``,n&&n(e),e};function ut(e,t,n,r,i,a,o){let s=e.length,c=[],l,u;l=R();for(let d=0,f,p,m,h;d<t;d++)for(let t=0;t<s;t++)if(m=e[t],d<m.length&&(f=m[d]))for(let e=0;e<f.length;e++){if(p=f[e],(u=l[p])?l[p]++:(u=0,l[p]=1),h=c[u]||(c[u]=[]),!o){let e=d+(t||!i?0:a||0);h=h[e]||(h[e]=[])}if(h.push(p),o&&n&&u===s-1&&h.length-r===n)return r?h.slice(r):h}if(e=c.length)if(i)c=c.length>1?dt(c,n,r,o,a):(c=c[0])&&n&&c.length>n||r?c.slice(r,n+r):c;else{if(e<s)return[];if(c=c[e-1],n||r)if(o)(c.length>n||r)&&(c=c.slice(r,n+r));else{i=[];for(let e=0,t;e<c.length;e++)if(t=c[e]){if(r&&t.length>r)r-=t.length;else if((n&&t.length>n||r)&&(t=t.slice(r,n+r),n-=t.length,r&&(r-=t.length)),i.push(t),!n)break}c=i}}return c}function dt(e,t,n,r,i){let a=[],o=R(),s;var c=e.length;let l;if(r){for(i=c-1;i>=0;i--)if(l=(r=e[i])&&r.length){for(c=0;c<l;c++)if(s=r[c],!o[s]){if(o[s]=1,n)n--;else if(a.push(s),a.length===t)return a}}}else for(let u=c-1,d,f=0;u>=0;u--){d=e[u];for(let e=0;e<d.length;e++)if(l=(r=d[e])&&r.length){for(let d=0;d<l;d++)if(s=r[d],!o[s])if(o[s]=1,n)n--;else{let n=(e+(u<c-1&&i||0))/(u+1)|0;if((a[n]||(a[n]=[])).push(s),++f===t)return a}}}return a}function ft(e,t,n,r,i){let a=R(),o=[];for(let e=0,n;e<t.length;e++){n=t[e];for(let e=0;e<n.length;e++)a[n[e]]=1}if(i){for(let t=0,i;t<e.length;t++)if(i=e[t],a[i]){if(r)r--;else if(o.push(i),a[i]=0,n&&--n===0)break}}else for(let n=0,r,i;n<e.result.length;n++)for(r=e.result[n],t=0;t<r.length;t++)i=r[t],a[i]&&((o[n]||(o[n]=[])).push(i),a[i]=0);return o}gt.prototype.search=function(e,t,n,r){n||(!t&&_e(e)?(n=e,e=``):_e(t)&&(n=t,t=0));let i=[];var a=[];let o,s,c,l,u,d,f=0,p=!0,m;if(n){n.constructor===Array&&(n={index:n}),e=n.query||e,o=n.pluck,s=n.merge,l=n.boost,d=o||n.field||(d=n.index)&&(d.index?null:d);var h=this.tag&&n.tag;c=n.suggest,p=n.resolve!==!1,u=n.cache,m=p&&this.store&&n.highlight;var g=!!m||p&&this.store&&n.enrich;t=n.limit||t;var _=n.offset||0;if(t||=p?100:0,h&&(!this.db||!r)){h.constructor!==Array&&(h=[h]);var v=[];for(let e=0,t;e<h.length;e++)if(t=h[e],t.field&&t.tag){var y=t.tag;if(y.constructor===Array)for(var b=0;b<y.length;b++)v.push(t.field,y[b]);else v.push(t.field,y)}else{y=Object.keys(t);for(let e=0,n,r;e<y.length;e++)if(n=y[e],r=t[n],r.constructor===Array)for(b=0;b<r.length;b++)v.push(n,r[b]);else v.push(n,r)}if(h=v,!e){if(a=[],v.length)for(h=0;h<v.length;h+=2){if(this.db){if(r=this.index.get(v[h]),!r)continue;a.push(r=r.db.tag(v[h+1],t,_,g))}else r=mt.call(this,v[h],v[h+1],t,_,g);i.push(p?{field:v[h],tag:v[h+1],result:r}:[r])}if(a.length){let e=this;return Promise.all(a).then(function(t){for(let e=0;e<t.length;e++)p?i[e].result=t[e]:i[e]=t[e];return p?i:new B(i.length>1?ut(i,1,0,0,c,l):i[0],e)})}return p?i:new B(i.length>1?ut(i,1,0,0,c,l):i[0],this)}}p||o||!(d||=this.field)||(ge(d)?o=d:(d.constructor===Array&&d.length===1&&(d=d[0]),o=d.field||d.index)),d&&d.constructor!==Array&&(d=[d])}d||=this.field;let x;v=(this.worker||this.db)&&!r&&[];for(let o=0,s,l,C;o<d.length;o++){if(l=d[o],this.db&&this.tag&&!this.B[o])continue;let w;if(ge(l)||(w=l,l=w.field,e=w.query||e,t=he(w.limit,t),_=he(w.offset,_),c=he(w.suggest,c),m=p&&this.store&&he(w.highlight,m),g=!!m||p&&this.store&&he(w.enrich,g),u=he(w.cache,u)),r)s=r[o];else{y=w||n||{},b=y.enrich;var S=this.index.get(l);if(h&&(this.db&&(y.tag=h,y.field=d,x=S.db.support_tag_search),!x&&b&&(y.enrich=!1),x||(y.limit=0,y.offset=0)),s=u?S.searchCache(e,h&&!x?0:t,y):S.search(e,h&&!x?0:t,y),h&&!x&&(y.limit=t,y.offset=_),b&&(y.enrich=b),v){v[o]=s;continue}}if(C=(s=s.result||s)&&s.length,h&&C){if(y=[],b=0,this.db&&r){if(!x)for(S=d.length;S<r.length;S++){let e=r[S];if(e&&e.length)b++,y.push(e);else if(!c)return p?i:new B(i,this)}}else for(let e=0,t,n;e<h.length;e+=2){if(t=this.tag.get(h[e]),!t){if(c)continue;return p?i:new B(i,this)}if((t&&=t.get(h[e+1]))&&t.length)b++,y.push(t);else if(!c)return p?i:new B(i,this)}if(b){if(s=ft(s,y,t,_,p),C=s.length,!C&&!c)return p?s:new B(s,this);b--}}if(C)a[f]=l,i.push(s),f++;else if(d.length===1)return p?i:new B(i,this)}if(v){if(this.db&&h&&h.length&&!x)for(g=0;g<h.length;g+=2){if(a=this.index.get(h[g]),!a){if(c)continue;return p?i:new B(i,this)}v.push(a.db.tag(h[g+1],t,_,!1))}let r=this;return Promise.all(v).then(function(i){return n&&(n.resolve=p),i.length&&(i=r.search(e,t,n,i)),i})}if(!f)return p?i:new B(i,this);if(o&&(!g||!this.store))return i=i[0],p?i:new B(i,this);for(v=[],_=0;_<a.length;_++){if(h=i[_],g&&h.length&&h[0].doc===void 0&&(this.db?v.push(h=this.index.get(this.field[0]).db.enrich(h)):h=ht.call(this,h)),o)return p?m?ct(e,h,this.index,o,m):h:new B(h,this);i[_]={field:a[_],result:h}}if(g&&this.db&&v.length){let t=this;return Promise.all(v).then(function(n){for(let e=0;e<n.length;e++)i[e].result=n[e];return m&&(i=ct(e,i,t.index,o,m)),s?pt(i):i})}return m&&(i=ct(e,i,this.index,o,m)),s?pt(i):i};function pt(e){let t=[],n=R(),r=R();for(let i=0,a,o,s,c,l,u,d;i<e.length;i++){a=e[i],o=a.field,s=a.result;for(let e=0;e<s.length;e++)l=s[e],typeof l==`object`?c=l.id:l={id:c=l},(u=n[c])?u.push(o):(l.field=n[c]=[o],t.push(l)),(d=l.highlight)&&(u=r[c],u||(r[c]=u={},l.highlight=u),u[o]=d)}return t}function mt(e,t,n,r,i){return e=this.tag.get(e),!e||(e=e.get(t),!e)?[]:(t=e.length-r,t>0&&((n&&t>n||r)&&(e=e.slice(r,r+n)),i&&(e=ht.call(this,e))),e)}function ht(e){if(!this||!this.store)return e;if(this.db)return this.index.get(this.field[0]).db.enrich(e);let t=Array(e.length);for(let n=0,r;n<e.length;n++)r=e[n],t[n]={id:r,doc:this.store.get(r)};return t}function gt(e){if(!this||this.constructor!==gt)return new gt(e);let t=e.document||e.doc||e,n,r;if(this.B=[],this.field=[],this.D=[],this.key=(n=t.key||t.id)&&vt(n,this.D)||`id`,(r=e.keystore||0)&&(this.keystore=r),this.fastupdate=!!e.fastupdate,this.reg=!this.fastupdate||e.worker||e.db?r?new Le(r):new Set:r?new z(r):new Map,this.h=(n=t.store||null)&&n&&n!==!0&&[],this.store=n?r?new z(r):new Map:null,this.cache=(n=e.cache||null)&&new De(n),e.cache=!1,this.worker=e.worker||!1,this.priority=e.priority||4,this.index=_t.call(this,e,t),this.tag=null,(n=t.tag)&&(typeof n==`string`&&(n=[n]),n.length)){this.tag=new Map,this.A=[],this.F=[];for(let e=0,t,r;e<n.length;e++){if(t=n[e],r=t.field||t,!r)throw Error(`The tag field from the document descriptor is undefined.`);t.custom?this.A[e]=t.custom:(this.A[e]=vt(r,this.D),t.filter&&(typeof this.A[e]==`string`&&(this.A[e]=new String(this.A[e])),this.A[e].G=t.filter)),this.F[e]=r,this.tag.set(r,new Map)}}if(this.worker){this.fastupdate=!1,e=[];for(let t of this.index.values())t.then&&e.push(t);if(e.length){let t=this;return Promise.all(e).then(function(e){let n=0;for(let r of t.index.entries()){let i=r[0],a=r[1];a.then&&(a=e[n],t.index.set(i,a),n++)}return t})}}else e.db&&(this.fastupdate=!1,this.mount(e.db))}I=gt.prototype,I.mount=function(e){let t=this.field;if(this.tag)for(let e=0,r;e<this.F.length;e++){r=this.F[e];var n=void 0;this.index.set(r,n=new Lt({},this.reg)),t===this.field&&(t=t.slice(0)),t.push(r),n.tag=this.tag.get(r)}n=[];let r={db:e.db,type:e.type,fastupdate:e.fastupdate};for(let i=0,a,o;i<t.length;i++){r.field=o=t[i],a=this.index.get(o);let s=new e.constructor(e.id,r);s.id=e.id,n[i]=s.mount(a),a.document=!0,i?a.bypass=!0:a.store=this.store}let i=this;return this.db=Promise.all(n).then(function(){i.db=!0})},I.commit=async function(){let e=[];for(let t of this.index.values())e.push(t.commit());await Promise.all(e),this.reg.clear()},I.destroy=function(){let e=[];for(let t of this.index.values())e.push(t.destroy());return Promise.all(e)};function _t(e,t){let n=new Map,r=t.index||t.field||t;ge(r)&&(r=[r]);for(let t=0,a,o;t<r.length;t++){if(a=r[t],ge(a)||(o=a,a=a.field),o=_e(o)?Object.assign({},e,o):e,this.worker){var i=void 0;i=(i=o.encoder)&&i.encode?i:new we(typeof i==`string`?Pe[i]:i||{}),i=new Xe(o,i),n.set(a,i)}this.worker||n.set(a,new Lt(o,this.reg)),o.custom?this.B[t]=o.custom:(this.B[t]=vt(a,this.D),o.filter&&(typeof this.B[t]==`string`&&(this.B[t]=new String(this.B[t])),this.B[t].G=o.filter)),this.field[t]=a}if(this.h){e=t.store,ge(e)&&(e=[e]);for(let t=0,n,r;t<e.length;t++)n=e[t],r=n.field||n,n.custom?(this.h[t]=n.custom,n.custom.O=r):(this.h[t]=vt(r,this.D),n.filter&&(typeof this.h[t]==`string`&&(this.h[t]=new String(this.h[t])),this.h[t].G=n.filter))}return n}function vt(e,t){let n=e.split(`:`),r=0;for(let i=0;i<n.length;i++)e=n[i],e[e.length-1]===`]`&&(e=e.substring(0,e.length-2))&&(t[r]=!0),e&&(n[r++]=e);return r<n.length&&(n.length=r),r>1?n:n[0]}I.append=function(e,t){return this.add(e,t,!0)},I.update=function(e,t){return this.remove(e).add(e,t)},I.remove=function(e){_e(e)&&(e=ve(e,this.key));for(var t of this.index.values())t.remove(e,!0);if(this.reg.has(e)){if(this.tag&&!this.fastupdate)for(let n of this.tag.values())for(let r of n){t=r[0];let i=r[1],a=i.indexOf(e);a>-1&&(i.length>1?i.splice(a,1):n.delete(t))}this.store&&this.store.delete(e),this.reg.delete(e)}return this.cache&&this.cache.remove(e),this},I.clear=function(){let e=[];for(let t of this.index.values()){let n=t.clear();n.then&&e.push(n)}if(this.tag)for(let e of this.tag.values())e.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),e.length?Promise.all(e):this},I.contain=function(e){return this.db?this.index.get(this.field[0]).db.has(e):this.reg.has(e)},I.cleanup=function(){for(let e of this.index.values())e.cleanup();return this},I.get=function(e){return this.db?this.index.get(this.field[0]).db.enrich(e).then(function(e){return e[0]&&e[0].doc||null}):this.store.get(e)||null},I.set=function(e,t){return typeof e==`object`&&(t=e,e=ve(t,this.key)),this.store.set(e,t),this},I.searchCache=Ee,I.export=Et,I.import=Dt,Ue(gt.prototype);function yt(e,t=0){let n=[],r=[];t&&=25e4/t*5e3|0;for(let i of e.entries())r.push(i),r.length===t&&(n.push(r),r=[]);return r.length&&n.push(r),n}function bt(e,t){t||=new Map;for(let n=0,r;n<e.length;n++)r=e[n],t.set(r[0],r[1]);return t}function xt(e,t=0){let n=[],r=[];t&&=25e4/t*1e3|0;for(let i of e.entries())r.push([i[0],yt(i[1])[0]||[]]),r.length===t&&(n.push(r),r=[]);return r.length&&n.push(r),n}function St(e,t){t||=new Map;for(let n=0,r,i;n<e.length;n++)r=e[n],i=t.get(r[0]),t.set(r[0],bt(r[1],i));return t}function Ct(e){let t=[],n=[];for(let r of e.keys())n.push(r),n.length===25e4&&(t.push(n),n=[]);return n.length&&t.push(n),t}function wt(e,t){t||=new Set;for(let n=0;n<e.length;n++)t.add(e[n]);return t}function Tt(e,t,n,r,i,a,o=0){let s=r&&r.constructor===Array;var c=s?r.shift():r;if(!c)return this.export(e,t,i,a+1);if((c=e((t?t+`.`:``)+(o+1)+`.`+n,JSON.stringify(c)))&&c.then){let l=this;return c.then(function(){return Tt.call(l,e,t,n,s?r:null,i,a,o+1)})}return Tt.call(this,e,t,n,s?r:null,i,a,o+1)}function Et(e,t,n=0,r=0){if(n<this.field.length){let i=this.field[n];if((t=this.index.get(i).export(e,i,n,r=1))&&t.then){let r=this;return t.then(function(){return r.export(e,i,n+1)})}return this.export(e,i,n+1)}let i,a;switch(r){case 0:i=`reg`,a=Ct(this.reg),t=null;break;case 1:i=`tag`,a=this.tag&&xt(this.tag,this.reg.size),t=null;break;case 2:i=`doc`,a=this.store&&yt(this.store),t=null;break;default:return}return Tt.call(this,e,t,i,a||null,n,r)}function Dt(e,t){var n=e.split(`.`);n[n.length-1]===`json`&&n.pop();let r=n.length>2?n[0]:``;if(n=n.length>2?n[2]:n[1],this.worker&&r)return this.index.get(r).import(e);if(t){if(typeof t==`string`&&(t=JSON.parse(t)),r)return this.index.get(r).import(n,t);switch(n){case`reg`:this.fastupdate=!1,this.reg=wt(t,this.reg);for(let e=0,t;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){t=[];for(let n of this.index.values())t.push(n.import(e));return Promise.all(t)}break;case`tag`:this.tag=St(t,this.tag);break;case`doc`:this.store=bt(t,this.store)}}}function Ot(e,t){let n=``;for(let r of e.entries()){e=r[0];let i=r[1],a=``;for(let e=0,n;e<i.length;e++){n=i[e]||[``];let r=``;for(let e=0;e<n.length;e++)r+=(r?`,`:``)+(t===`string`?`"`+n[e]+`"`:n[e]);r=`[`+r+`]`,a+=(a?`,`:``)+r}a=`["`+e+`",[`+a+`]]`,n+=(n?`,`:``)+a}return n}Lt.prototype.remove=function(e,t){let n=this.reg.size&&(this.fastupdate?this.reg.get(e):this.reg.has(e));if(n){if(this.fastupdate){for(let t=0,r,i;t<n.length;t++)if((r=n[t])&&(i=r.length))if(r[i-1]===e)r.pop();else{let t=r.indexOf(e);t>=0&&r.splice(t,1)}}else kt(this.map,e),this.depth&&kt(this.ctx,e);t||this.reg.delete(e)}return this.db&&(this.commit_task.push({del:e}),this.M&&Rt(this)),this.cache&&this.cache.remove(e),this};function kt(e,t){let n=0;var r=t===void 0;if(e.constructor===Array){for(let i=0,a,o,s;i<e.length;i++)if((a=e[i])&&a.length){if(r)return 1;if(o=a.indexOf(t),o>=0){if(a.length>1)return a.splice(o,1),1;if(delete e[i],n)return 1;s=1}else{if(s)return 1;n++}}}else for(let i of e.entries())r=i[0],kt(i[1],t)?n++:e.delete(r);return n}var At={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:`forward`},score:{resolution:9,context:{depth:2,resolution:3}}};Lt.prototype.add=function(e,t,n,r){if(t&&(e||e===0)){if(!r&&!n&&this.reg.has(e))return this.update(e,t);r=this.depth,t=this.encoder.encode(t,!r);let l=t.length;if(l){let u=R(),d=R(),f=this.resolution;for(let p=0;p<l;p++){let m=t[this.rtl?l-1-p:p];var i=m.length;if(i&&(r||!d[m])){var a=this.score?this.score(t,m,p,null,0):Mt(f,l,p),o=``;switch(this.tokenize){case`tolerant`:if(jt(this,d,m,a,e,n),i>2){for(let t=1,r,s,c,l;t<i-1;t++)r=m.charAt(t),s=m.charAt(t+1),c=m.substring(0,t)+s,l=m.substring(t+2),o=c+r+l,jt(this,d,o,a,e,n),o=c+l,jt(this,d,o,a,e,n);jt(this,d,m.substring(0,m.length-1),a,e,n)}break;case`full`:if(i>2){for(let r=0,c;r<i;r++)for(a=i;a>r;a--){o=m.substring(r,a),c=this.rtl?i-1-r:r;var s=this.score?this.score(t,m,p,o,c):Mt(f,l,p,i,c);jt(this,d,o,s,e,n)}break}case`bidirectional`:case`reverse`:if(i>1){for(s=i-1;s>0;s--){o=m[this.rtl?i-1-s:s]+o;var c=this.score?this.score(t,m,p,o,s):Mt(f,l,p,i,s);jt(this,d,o,c,e,n)}o=``}case`forward`:if(i>1){for(s=0;s<i;s++)o+=m[this.rtl?i-1-s:s],jt(this,d,o,a,e,n);break}default:if(jt(this,d,m,a,e,n),r&&l>1&&p<l-1)for(i=this.N,o=m,a=Math.min(r+1,this.rtl?p+1:l-p),s=1;s<a;s++){m=t[this.rtl?l-1-p-s:p+s],c=this.bidirectional&&m>o;let r=this.score?this.score(t,o,p,m,s-1):Mt(i+(l/2>i?0:1),l,p,a-1,s-1);jt(this,u,c?o:m,r,e,n,c?m:o)}}}}this.fastupdate||this.reg.add(e)}}return this.db&&(this.commit_task.push(n?{ins:e}:{del:e}),this.M&&Rt(this)),this};function jt(e,t,n,r,i,a,o){let s,c;if(!(s=t[n])||o&&!s[o]){if(o?(t=s||(t[n]=R()),t[o]=1,c=e.ctx,(s=c.get(o))?c=s:c.set(o,c=e.keystore?new z(e.keystore):new Map)):(c=e.map,t[n]=1),(s=c.get(n))?c=s:c.set(n,c=s=[]),a){for(let n=0,a;n<s.length;n++)if((a=s[n])&&a.includes(i)){if(n<=r)return;a.splice(a.indexOf(i),1),e.fastupdate&&(t=e.reg.get(i))&&t.splice(t.indexOf(a),1);break}}if(c=c[r]||(c[r]=[]),c.push(i),c.length===2**31-1){if(t=new Ie(c),e.fastupdate)for(let n of e.reg.values())n.includes(c)&&(n[n.indexOf(c)]=t);s[r]=c=t}e.fastupdate&&((r=e.reg.get(i))?r.push(c):e.reg.set(i,[c]))}}function Mt(e,t,n,r,i){return n&&e>1?t+(r||0)<=e?n+(i||0):(e-1)/(t+(r||0))*(n+(i||0))+1|0:0}Lt.prototype.search=function(e,t,n){if(n||(t||typeof e!=`object`?typeof t==`object`&&(n=t,t=0):(n=e,e=``)),n&&n.cache)return n.cache=!1,e=this.searchCache(e,t,n),n.cache=!0,e;let r=[],i,a,o,s=0,c,l,u,d,f;n&&(e=n.query||e,t=n.limit||t,s=n.offset||0,a=n.context,o=n.suggest,f=(c=n.resolve)&&n.enrich,u=n.boost,d=n.resolution,l=this.db&&n.tag),c===void 0&&(c=this.resolve),a=this.depth&&a!==!1;let p=this.encoder.encode(e,!a);if(i=p.length,t||=c?100:0,i===1)return Pt.call(this,p[0],``,t,s,c,f,l);if(i===2&&a&&!o)return Pt.call(this,p[1],p[0],t,s,c,f,l);let m=R(),h=0,g;if(a&&(g=p[0],h=1),d||d===0||(d=g?this.N:this.resolution),this.db){if(this.db.search&&(n=this.db.search(this,p,t,s,o,c,f,l),n!==!1))return n;let e=this;return async function(){for(let t,n;h<i;h++){if((n=p[h])&&!m[n]){if(m[n]=1,t=await It(e,n,g,0,0,!1,!1),t=Ft(t,r,o,d)){r=t;break}g&&(o&&t&&r.length||(g=n))}o&&g&&h===i-1&&!r.length&&(d=e.resolution,g=``,h=-1,m=R())}return Nt(r,d,t,s,o,u,c)}()}for(let e,t;h<i;h++){if((t=p[h])&&!m[t]){if(m[t]=1,e=It(this,t,g,0,0,!1,!1),e=Ft(e,r,o,d)){r=e;break}g&&(o&&e&&r.length||(g=t))}o&&g&&h===i-1&&!r.length&&(d=this.resolution,g=``,h=-1,m=R())}return Nt(r,d,t,s,o,u,c)};function Nt(e,t,n,r,i,a,o){let s=e.length,c=e;if(s>1)c=ut(e,t,n,r,i,a,o);else if(s===1)return o?tt.call(null,e[0],n,r):new B(e[0],this);return o?c:new B(c,this)}function Pt(e,t,n,r,i,a,o){return e=It(this,e,t,n,r,i,a,o),this.db?e.then(function(e){return i?e||[]:new B(e,this)}):e&&e.length?i?tt.call(this,e,n,r):new B(e,this):i?[]:new B([],this)}function Ft(e,t,n,r){let i=[];if(e&&e.length){if(e.length<=r){t.push(e);return}for(let t=0,n;t<r;t++)(n=e[t])&&(i[t]=n);if(i.length){t.push(i);return}}if(!n)return i}function It(e,t,n,r,i,a,o,s){let c;return n&&(c=e.bidirectional&&t>n)&&(c=n,n=t,t=c),e.db?e.db.get(t,n,r,i,a,o,s):(e=n?(e=e.ctx.get(n))&&e.get(t):e.map.get(t),e)}function Lt(e,t){if(!this||this.constructor!==Lt)return new Lt(e);if(e){var n=ge(e)?e:e.preset;n&&(e=Object.assign({},At[n],e))}else e={};n=e.context;let r=n===!0?{depth:1}:n||{},i=ge(e.encoder)?Pe[e.encoder]:e.encode||e.encoder||{};this.encoder=i.encode?i:typeof i==`object`?new we(i):{encode:i},this.resolution=e.resolution||9,this.tokenize=n=(n=e.tokenize)&&n!=="default"&&n!==`exact`&&n||`strict`,this.depth=n===`strict`&&r.depth||0,this.bidirectional=r.bidirectional!==!1,this.fastupdate=!!e.fastupdate,this.score=e.score||null,(n=e.keystore||0)&&(this.keystore=n),this.map=n?new z(n):new Map,this.ctx=n?new z(n):new Map,this.reg=t||(this.fastupdate?n?new z(n):new Map:n?new Le(n):new Set),this.N=r.resolution||3,this.rtl=i.rtl||e.rtl||!1,this.cache=(n=e.cache||null)&&new De(n),this.resolve=e.resolve!==!1,(n=e.db)&&(this.db=this.mount(n)),this.M=e.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=e.priority||4}I=Lt.prototype,I.mount=function(e){return this.commit_timer&&=(clearTimeout(this.commit_timer),null),e.mount(this)},I.commit=function(){return this.commit_timer&&=(clearTimeout(this.commit_timer),null),this.db.commit(this)},I.destroy=function(){return this.commit_timer&&=(clearTimeout(this.commit_timer),null),this.db.destroy()};function Rt(e){e.commit_timer||=setTimeout(function(){e.commit_timer=null,e.db.commit(e)},1)}I.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},I.append=function(e,t){return this.add(e,t,!0)},I.contain=function(e){return this.db?this.db.has(e):this.reg.has(e)},I.update=function(e,t){let n=this,r=this.remove(e);return r&&r.then?r.then(()=>n.add(e,t)):this.add(e,t)},I.cleanup=function(){return this.fastupdate?(kt(this.map),this.depth&&kt(this.ctx),this):this},I.searchCache=Ee,I.export=function(e,t,n=0,r=0){let i,a;switch(r){case 0:i=`reg`,a=Ct(this.reg);break;case 1:i=`cfg`,a=null;break;case 2:i=`map`,a=yt(this.map,this.reg.size);break;case 3:i=`ctx`,a=xt(this.ctx,this.reg.size);break;default:return}return Tt.call(this,e,t,i,a,n,r)},I.import=function(e,t){if(t)switch(typeof t==`string`&&(t=JSON.parse(t)),e=e.split(`.`),e[e.length-1]===`json`&&e.pop(),e.length===3&&e.shift(),e=e.length>1?e[1]:e[0],e){case`reg`:this.fastupdate=!1,this.reg=wt(t,this.reg);break;case`map`:this.map=bt(t,this.map);break;case`ctx`:this.ctx=St(t,this.ctx)}},I.serialize=function(e=!0){let t=``,n=``,r=``;if(this.reg.size){let e;for(var i of this.reg.keys())e||=typeof i,t+=(t?`,`:``)+(e===`string`?`"`+i+`"`:i);t=`index.reg=new Set([`+t+`]);`,n=Ot(this.map,e),n=`index.map=new Map([`+n+`]);`;for(let t of this.ctx.entries()){i=t[0];let n=Ot(t[1],e);n=`new Map([`+n+`])`,n=`["`+i+`",`+n+`]`,r+=(r?`,`:``)+n}r=`index.ctx=new Map([`+r+`]);`}return e?`function inject(index){`+t+n+r+`}`:t+n+r},Ue(Lt.prototype);var zt=typeof window<`u`&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Bt=[`map`,`ctx`,`tag`,`reg`,`cfg`],Vt=R();function Ht(e,t={}){if(!this||this.constructor!==Ht)return new Ht(e,t);typeof e==`object`&&(t=e,e=e.name),e||console.info(`Default storage space was used, because a name was not passed.`),this.id=`flexsearch`+(e?`:`+e.toLowerCase().replace(/[^a-z0-9_\-]/g,``):``),this.field=t.field?t.field.toLowerCase().replace(/[^a-z0-9_\-]/g,``):``,this.type=t.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}I=Ht.prototype,I.mount=function(e){return e.index?e.mount(this):(e.db=this,this.open())},I.open=function(){if(this.db)return this.db;let e=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Vt[e.id]||(Vt[e.id]=[]),Vt[e.id].push(e.field);let t=zt.open(e.id,1);return t.onupgradeneeded=function(){let t=e.db=this.result;for(let n=0,r;n<Bt.length;n++){r=Bt[n];for(let n=0,i;n<Vt[e.id].length;n++)i=Vt[e.id][n],t.objectStoreNames.contains(r+(r===`reg`?``:i?`:`+i:``))||t.createObjectStore(r+(r===`reg`?``:i?`:`+i:``))}},e.db=Wt(t,function(t){e.db=t,e.db.onversionchange=function(){e.close()}})},I.close=function(){this.db&&this.db.close(),this.db=null},I.destroy=function(){return Wt(zt.deleteDatabase(this.id))},I.clear=function(){let e=[];for(let t=0,n;t<Bt.length;t++){n=Bt[t];for(let t=0,r;t<Vt[this.id].length;t++)r=Vt[this.id][t],e.push(n+(n===`reg`?``:r?`:`+r:``))}let t=this.db.transaction(e,`readwrite`);for(let n=0;n<e.length;n++)t.objectStore(e[n]).clear();return Wt(t)},I.get=function(e,t,n=0,r=0,i=!0,a=!1){e=this.db.transaction((t?`ctx`:`map`)+(this.field?`:`+this.field:``),`readonly`).objectStore((t?`ctx`:`map`)+(this.field?`:`+this.field:``)).get(t?t+`:`+e:e);let o=this;return Wt(e).then(function(e){let t=[];if(!e||!e.length)return t;if(i){if(!n&&!r&&e.length===1)return e[0];for(let i=0,a;i<e.length;i++)if((a=e[i])&&a.length){if(r>=a.length){r-=a.length;continue}let e=n?r+Math.min(a.length-r,n):a.length;for(let n=r;n<e;n++)t.push(a[n]);if(r=0,t.length===n)break}return a?o.enrich(t):t}return e})},I.tag=function(e,t=0,n=0,r=!1){e=this.db.transaction(`tag`+(this.field?`:`+this.field:``),`readonly`).objectStore(`tag`+(this.field?`:`+this.field:``)).get(e);let i=this;return Wt(e).then(function(e){return!e||!e.length||n>=e.length?[]:!t&&!n?e:(e=e.slice(n,n+t),r?i.enrich(e):e)})},I.enrich=function(e){typeof e!=`object`&&(e=[e]);let t=this.db.transaction(`reg`,`readonly`).objectStore(`reg`),n=[];for(let r=0;r<e.length;r++)n[r]=Wt(t.get(e[r]));return Promise.all(n).then(function(t){for(let n=0;n<t.length;n++)t[n]={id:e[n],doc:t[n]?JSON.parse(t[n]):null};return t})},I.has=function(e){return e=this.db.transaction(`reg`,`readonly`).objectStore(`reg`).getKey(e),Wt(e).then(function(e){return!!e})},I.search=null,I.info=function(){},I.transaction=function(e,t,n){e+=e===`reg`?``:this.field?`:`+this.field:``;let r=this.h[e+`:`+t];if(r)return n.call(this,r);let i=this.db.transaction(e,t);this.h[e+`:`+t]=r=i.objectStore(e);let a=n.call(this,r);return this.h[e+`:`+t]=null,Wt(i).finally(function(){return a})},I.commit=async function(e){let t=e.commit_task,n=[];e.commit_task=[];for(let e=0,r;e<t.length;e++)r=t[e],r.del&&n.push(r.del);n.length&&await this.remove(n),e.reg.size&&(await this.transaction(`map`,`readwrite`,function(t){for(let n of e.map){let e=n[0],r=n[1];r.length&&(t.get(e).onsuccess=function(){let n=this.result;var i;if(n&&n.length){let e=Math.max(n.length,r.length);for(let t=0,a,o;t<e;t++)if((o=r[t])&&o.length){if((a=n[t])&&a.length)for(i=0;i<o.length;i++)a.push(o[i]);else n[t]=o;i=1}}else n=r,i=1;i&&t.put(n,e)})}}),await this.transaction(`ctx`,`readwrite`,function(t){for(let n of e.ctx){let e=n[0],r=n[1];for(let n of r){let r=n[0],i=n[1];i.length&&(t.get(e+`:`+r).onsuccess=function(){let n=this.result;var a;if(n&&n.length){let e=Math.max(n.length,i.length);for(let t=0,r,o;t<e;t++)if((o=i[t])&&o.length){if((r=n[t])&&r.length)for(a=0;a<o.length;a++)r.push(o[a]);else n[t]=o;a=1}}else n=i,a=1;a&&t.put(n,e+`:`+r)})}}}),e.store?await this.transaction(`reg`,`readwrite`,function(t){for(let n of e.store){let e=n[0],r=n[1];t.put(typeof r==`object`?JSON.stringify(r):1,e)}}):e.bypass||await this.transaction(`reg`,`readwrite`,function(t){for(let n of e.reg.keys())t.put(1,n)}),e.tag&&await this.transaction(`tag`,`readwrite`,function(t){for(let n of e.tag){let e=n[0],r=n[1];r.length&&(t.get(e).onsuccess=function(){let n=this.result;n=n&&n.length?n.concat(r):r,t.put(n,e)})}}),e.map.clear(),e.ctx.clear(),e.tag&&e.tag.clear(),e.store&&e.store.clear(),e.document||e.reg.clear())};function Ut(e,t,n){let r=e.value,i,a=0;for(let e=0,o;e<r.length;e++){if(o=n?r:r[e]){for(let n=0,a,s;n<t.length;n++)if(s=t[n],a=o.indexOf(s),a>=0)if(i=1,o.length>1)o.splice(a,1);else{r[e]=[];break}a+=o.length}if(n)break}a?i&&e.update(r):e.delete(),e.continue()}I.remove=function(e){return typeof e!=`object`&&(e=[e]),Promise.all([this.transaction(`map`,`readwrite`,function(t){t.openCursor().onsuccess=function(){let t=this.result;t&&Ut(t,e)}}),this.transaction(`ctx`,`readwrite`,function(t){t.openCursor().onsuccess=function(){let t=this.result;t&&Ut(t,e)}}),this.transaction(`tag`,`readwrite`,function(t){t.openCursor().onsuccess=function(){let t=this.result;t&&Ut(t,e,!0)}}),this.transaction(`reg`,`readwrite`,function(t){for(let n=0;n<e.length;n++)t.delete(e[n])})])};function Wt(e,t){return new Promise((n,r)=>{e.onsuccess=e.oncomplete=function(){t&&t(this.result),t=null,n(this.result)},e.onerror=e.onblocked=r,e=null})}var Gt={Index:Lt,Charset:Pe,Encoder:we,Document:gt,Worker:Xe,Resolver:B,IndexedDB:Ht,Language:{}},Kt=Pe,qt={finalize:e=>{let t=[];for(let n of e)t.push(...Yt(n));return t}};function Jt(e){return e>=19968&&e<=40959||e>=12352&&e<=12543||e>=44032&&e<=55203||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=191471||e>=196608&&e<=205743||e>=191472&&e<=192095||e>=63744&&e<=64255||e>=194560&&e<=195103}function Yt(e){let t=[],n=``;for(let r of e)Jt(r.codePointAt(0))?(n&&=(t.push(n),``),t.push(r)):n+=r;return n&&t.push(n),t}var Xt=new Gt.Encoder(Kt.Default,qt),Zt=class{constructor({adminUrl:e,apiKey:t,dir:n}){let r=n===`rtl`?`reverse`:`forward`;this.apiUrl=e,this.apiKey=t,this.postsIndex=new Gt.Document({tokenize:r,document:{id:`id`,index:[`title`,`excerpt`],store:!0},encoder:Xt}),this.authorsIndex=new Gt.Document({tokenize:r,document:{id:`id`,index:[`name`],store:!0},encoder:Xt}),this.tagsIndex=new Gt.Document({tokenize:r,document:{id:`id`,index:[`name`],store:!0},encoder:Xt}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async#e(){let e=await this.#t();e.length>0&&this.#n(e)}async#t(){try{let e=`${this.apiUrl}/ghost/api/content/search-index/posts/?key=${this.apiKey}`;return(await(await fetch(e)).json()).posts}catch(e){return console.error(`Error fetching posts:`,e),[]}}#n(e){e.forEach(e=>{this.postsIndex.add(e)})}async#r(){let e=await this.#i();e.length>0&&this.#a(e)}async#i(){try{let e=`${this.apiUrl}/ghost/api/content/search-index/authors/?key=${this.apiKey}`;return(await(await fetch(e)).json()).authors}catch(e){return console.error(`Error fetching authors:`,e),[]}}#a(e){e.forEach(e=>{this.authorsIndex.add(e)})}async#o(){let e=await this.#s();e.length>0&&this.#c(e)}async#s(){try{let e=`${this.apiUrl}/ghost/api/content/search-index/tags/?key=${this.apiKey}`;return(await(await fetch(e)).json()).tags}catch(e){return console.error(`Error fetching tags:`,e),[]}}#c(e){e.forEach(e=>{this.tagsIndex.add(e)})}async init(){await this.#e(),await this.#r(),await this.#o()}#l(e){let t=[],n={};return e.forEach(e=>{e.result.forEach(e=>{n[e.id]||(t.push(e.doc),n[e.id]=!0)})}),t}search(e){let t=this.postsIndex.search(e,{enrich:!0}),n=this.authorsIndex.search(e,{enrich:!0}),r=this.tagsIndex.search(e,{enrich:!0});return{posts:this.#l(t),authors:this.#l(n),tags:this.#l(r)}}},Qt={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},$t={Authors:`الكتّاب`,Cancel:`إلغاء`,"No matches found":`لا يوجد نتائج مطابقة`,Posts:`منشورات`,"Search posts, tags and authors":`قم بالبحث عن المنشورات، الوسوم و الكتّاب`,"Show more results":`اظهر المزيد من النتائج`,Tags:`الوسوم`},en={Authors:`Автори`,Cancel:`Отказ`,"No matches found":`Няма съвпадения`,Posts:`Публикации`,"Search posts, tags and authors":`Търсене в публикации, етикети и автори`,"Show more results":`Покажи още резултати`,Tags:`Етикети`},tn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},nn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},rn={Authors:`Autors`,Cancel:`Cancel·la`,"No matches found":`No s'ha trobat cap resultat`,Posts:`Articles`,"Search posts, tags and authors":`Cerca articles, etiquetes i autors`,"Show more results":`Mostra més resultats`,Tags:`Etiquetes`},V={Authors:`Autoři`,Cancel:`Zrušit`,"No matches found":`Nenalezeno`,Posts:`Články`,"Search posts, tags and authors":`Prohledat články, štítky a autory`,"Show more results":`Zobrazit více výsledků`,Tags:`Štítky`},an={Authors:`Forfattere`,Cancel:`Annuller`,"No matches found":`Ingen resultater fundet`,Posts:`Indlæg`,"Search posts, tags and authors":`Søg i indlæg, tags og forfattere`,"Show more results":`Vis flere resultater`,Tags:`Tags`},on={Authors:`Autor*innen`,Cancel:`Abbrechen`,"No matches found":`Keine Treffer gefunden`,Posts:`Posts`,"Search posts, tags and authors":`Posts, Tags und Autor*innen durchsuchen`,"Show more results":`Mehr Ergebnisse anzeigen`,Tags:`Tags`},sn={Authors:`Autoren`,Cancel:`Abbrechen`,"No matches found":`Keine Treffer gefunden`,Posts:`Beiträge`,"Search posts, tags and authors":`Nach Posts, Tags und Autoren suchen`,"Show more results":`Mehr Ergebnisse anzeigen`,Tags:`Tags`},cn={Authors:`ΣΥΓΓΡΑΦΕΙΣ`,Cancel:`Ακύρωση`,"No matches found":`Δεν βρέθηκαν αποτελέσματα`,Posts:`ΑΝΑΡΤΗΣΕΙΣ`,"Search posts, tags and authors":`Αναζήτηση αναρτήσεων, ετικετών και συγγραφέων`,"Show more results":`Εμφάνιση περισσότερων αποτελεσμάτων`,Tags:`ΕΤΙΚΕΤΕΣ`},ln={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},un={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},dn={Authors:`Autores`,Cancel:`Cancelar`,"No matches found":`No se encontraron resultados`,Posts:`Publicaciones`,"Search posts, tags and authors":`Buscar publicaciones, etiquetas y autores`,"Show more results":`Mostrar más resultados`,Tags:`Etiquetas`},fn={Authors:`Autorid`,Cancel:`Tühista`,"No matches found":`Vasteid ei leitud`,Posts:`Postitused`,"Search posts, tags and authors":`Otsi postitusi, silte ja autoreid`,"Show more results":`Näita rohkem tulemusi`,Tags:`Sildid`},pn={Authors:`Autoreak`,Cancel:`Utzi`,"No matches found":`Ez da bat datorren ezer topatu`,Posts:`Artikuluak`,"Search posts, tags and authors":`Bilatu artikuluak, etiketak eta autoreak`,"Show more results":`Erakutsi emaitza gehiago`,Tags:`Etiketak`},mn={Authors:`نویسندگان`,Cancel:`لغو`,"No matches found":`موردی یافت نشد`,Posts:`نوشتهها`,"Search posts, tags and authors":`جستوجوی نوشتهها، برچسبها و نویسندگان`,"Show more results":`نمایش نتایج بیشتر`,Tags:`برچسبها`},hn={Authors:`Kirjoittajat`,Cancel:`Peruuta`,"No matches found":`Ei hakutuloksia`,Posts:`Kirjoitukset`,"Search posts, tags and authors":`Etsi kirjoituksia, tunnisteita ja kirjoittajia`,"Show more results":`Näytä enemmän tuloksia`,Tags:`Tunnisteet`},gn={Authors:`Auteurs`,Cancel:`Annuler`,"No matches found":`Aucun résultat trouvé`,Posts:`Articles`,"Search posts, tags and authors":`Rechercher des articles, des catégories et des auteurs`,"Show more results":`Plus de résultats`,Tags:`Catégories`},_n={Authors:`Ùghdaran`,Cancel:`Sguir dheth`,"No matches found":`Cha deach dad a lorg a fhreagras ris na lorg thu`,Posts:`Postaichean`,"Search posts, tags and authors":`Lorg sna postaichean, tagaichean agus ùghdaran`,"Show more results":`Seall barrachd thoraidhean`,Tags:`Tagaichean`},vn={Authors:`מחברים`,Cancel:`ביטול`,"No matches found":`לא נמצאו התאמות`,Posts:`פוסטים`,"Search posts, tags and authors":`חיפוש פוסטים, תגיות ומחברים`,"Show more results":`הצגת תוצאות נוספות`,Tags:`תגיות`},yn={Authors:`लेखक`,Cancel:`रद्द करें`,"No matches found":`कोई मैच नहीं मिला`,Posts:`पोस्ट`,"Search posts, tags and authors":`पोस्ट, टैग और लेखक की तलाश करें`,"Show more results":`और परिणाम दिखाएं`,Tags:`टैग`},bn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},xn={Authors:`Szerzők`,Cancel:`Mégse`,"No matches found":`Nincs találat`,Posts:`Bejegyzések`,"Search posts, tags and authors":`Keresés a bejegyzések, a címkék és a szerzők között`,"Show more results":`További találatok megjelenítése`,Tags:`Címkék`},Sn={Authors:`Penulis`,Cancel:`Batalkan`,"No matches found":`Tidak ada hasil yang ditemukan`,Posts:`Postingan`,"Search posts, tags and authors":`Cari postingan, tag, dan penulis`,"Show more results":`Tampilkan lebih banyak hasil`,Tags:`Tag`},Cn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},wn={Authors:`Autori`,Cancel:`Annulla`,"No matches found":`Nessun risultato trovato`,Posts:`Articoli`,"Search posts, tags and authors":`Cerca articoli, tag e autori`,"Show more results":`Mostra più risultati`,Tags:`Tag`},Tn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},En={Authors:`작성자`,Cancel:`취소`,"No matches found":`일치하는 결과가 없어요`,Posts:`게시물`,"Search posts, tags and authors":`게시물, 태그, 작성자 검색`,"Show more results":`더 많은 결과 보기`,Tags:`태그`},Dn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},On={Authors:`Autoriai`,Cancel:`Atšaukti`,"No matches found":`Atitikmenų nerasta`,Posts:`Įrašai`,"Search posts, tags and authors":`Ieškoti įrašų, žymų ir autorių`,"Show more results":`Rodyti daugiau rezultatų`,Tags:`Žymos`},kn={Authors:`Autori`,Cancel:`Atcelt`,"No matches found":`Nav atrasta neviena atbilstība`,Posts:`Ziņas`,"Search posts, tags and authors":`Meklēt ziņas, atzīmes un autorus`,"Show more results":`Rādīt vairāk rezultātu`,Tags:`Tagi`},An={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},jn={Authors:`Нийтлэгчид`,Cancel:`Цуцлах`,"No matches found":`Тохирох хайлтын үр дүн олдсонгүй`,Posts:`Нийтлэлүүд`,"Search posts, tags and authors":`Нийтлэл, ангилал, нийтлэгчдээр хайх`,"Show more results":`Илүү олон үр дүн харуулах`,Tags:`Ангилалууд`},Mn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Nn={Authors:`Forfattere`,Cancel:`Avbryt`,"No matches found":`Ingen treff funnet`,Posts:`Innlegg`,"Search posts, tags and authors":`Søk i innlegg, etiketter og forfattere`,"Show more results":`Vis flere resultater`,Tags:`Etiketter`},Pn={Authors:`लेखकहरू`,Cancel:`रद्द गर्नुहोस्`,"No matches found":`कुनै परिणाम भेटिएन`,Posts:`पोस्टहरू`,"Search posts, tags and authors":`पोस्टहरू, ट्यागहरू र लेखकहरू खोज्नुहोस्`,"Show more results":`थप परिणामहरू देखाउनुहोस्`,Tags:`ट्यागहरू`},Fn={Authors:`Auteurs`,Cancel:`Annuleren`,"No matches found":`Geen resultaten gevonden`,Posts:`Berichten`,"Search posts, tags and authors":`Zoek berichten, tags en auteurs`,"Show more results":`Meer resultaten weergeven`,Tags:`Tags`},In={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Ln={Authors:`ਲੇਖਕ`,Cancel:`ਰੱਦ ਕਰੋ`,"No matches found":`ਕੋਈ ਮੇਲ ਨਹੀਂ ਮਿਲਿਆ`,Posts:`ਪੋਸਟਾਂ`,"Search posts, tags and authors":`ਪੋਸਟਾਂ, ਟੈਗ ਅਤੇ ਲੇਖਕ ਖੋਜੋ`,"Show more results":`ਹੋਰ ਨਤੀਜੇ ਦਿਖਾਓ`,Tags:`ਟੈਗ`},Rn={Authors:`Autorzy`,Cancel:`Anuluj`,"No matches found":`Nie znaleziono dopasowań`,Posts:`Posty`,"Search posts, tags and authors":`Szukaj postów, tagów lub autorów`,"Show more results":`Pokaż więcej wyników`,Tags:`Tagi`},zn={Authors:`Autores`,Cancel:`Cancelar`,"No matches found":`Nenhum resultado encontrado`,Posts:`Publicações`,"Search posts, tags and authors":`Procurar publicações, marcadores e autores`,"Show more results":`Mostrar mais resultados`,Tags:`Marcadores`},Bn={Authors:`Autores`,Cancel:`Cancelar`,"No matches found":`Nenhum resultado encontrado`,Posts:`Publicações`,"Search posts, tags and authors":`Buscar posts, tags e autores`,"Show more results":`Mostrar mais resultados`,Tags:`Tags`},Vn={Authors:`Autori`,Cancel:`Anulează`,"No matches found":`Nu s-au găsit rezultate`,Posts:`Postări`,"Search posts, tags and authors":`Caută postări, etichete și autori`,"Show more results":`Afișează mai multe rezultate`,Tags:`Etichete`},Hn={Authors:`Авторы`,Cancel:`Отмена`,"No matches found":`Совпадений не найдено`,Posts:`Записи`,"Search posts, tags and authors":`Поиск по записям, тегам и авторам`,"Show more results":`Показать больше результатов`,Tags:`Теги`},Un={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Wn={Authors:`Autori`,Cancel:`Zrušiť`,"No matches found":`Nenašli sa žiadne výsledky`,Posts:`Príspevky`,"Search posts, tags and authors":`Vyhľadajte príspevky, tagy a autorov`,"Show more results":`Zobraziť viac výsledkov`,Tags:`Tagy`},Gn={Authors:`Avtorji`,Cancel:`Prekliči`,"No matches found":`Ni najdenih zadetkov`,Posts:`Članki`,"Search posts, tags and authors":`Iščite članke, oznake in avtorje`,"Show more results":`Prikaži več rezultatov`,Tags:`Oznake`},Kn={Authors:`Autorët`,Cancel:`Anulo`,"No matches found":`Nuk u gjet asnjë rezultat`,Posts:`Postimet`,"Search posts, tags and authors":`Kërko postime, etiketa dhe autorë`,"Show more results":`Shfaq më shumë rezultate`,Tags:`Etiketat`},qn={Authors:`Autori`,Cancel:`Otkažite`,"No matches found":`Nema rezultata`,Posts:`Objave`,"Search posts, tags and authors":`Pretražite objave, tag-ove i autore`,"Show more results":`Prikažite više rezultata`,Tags:`Tag-ovi`},Jn={Authors:`Аутори`,Cancel:`Откажите`,"No matches found":`Нема резултата`,Posts:`Објаве`,"Search posts, tags and authors":`Претражите објаве, tag-ове и ауторе`,"Show more results":`Прикажите више резултата`,Tags:`Tag-ови`},Yn={Authors:`Författare`,Cancel:`Avbryt`,"No matches found":`Inga träffar hittade`,Posts:`Inlägg`,"Search posts, tags and authors":`Sök inlägg, taggar och författare`,"Show more results":`Visa fler resultat`,Tags:`Taggar`},Xn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Zn={Authors:`ஆசிரியர்கள்`,Cancel:`ரத்து செய்`,"No matches found":`பொருத்தங்கள் எதுவும் இல்லை`,Posts:`பதிவுகள்`,"Search posts, tags and authors":`பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்`,"Show more results":`மேலும் முடிவுகளைக் காட்டு`,Tags:`குறிச்சொற்கள்`},Qn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},$n={Authors:`Yazarlar`,Cancel:`İptal`,"No matches found":`Eşleşme bulunamadı`,Posts:`Yazılar`,"Search posts, tags and authors":`Yazıları, etiketleri ve yazarları ara`,"Show more results":`Daha fazla sonuç göster`,Tags:`Etiketler`},er={Authors:`Автори`,Cancel:`Скасувати`,"No matches found":`Збігів не знайдено`,Posts:`Публікації`,"Search posts, tags and authors":`Шукайте публікацій, теги та авторів`,"Show more results":`Показати більше результатів`,Tags:`Теги`},tr={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},nr={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},rr={Authors:`Tác giả`,Cancel:`Hủy`,"No matches found":`Không tìm thấy`,Posts:`Bài viết`,"Search posts, tags and authors":`Tìm bài viết, thẻ và tác giả`,"Show more results":`Xem thêm kết quả`,Tags:`Thẻ`},ir={Authors:`作者`,Cancel:`取消`,"No matches found":`未找到匹配项`,Posts:`文章`,"Search posts, tags and authors":`搜索文章、标签和作者`,"Show more results":`显示更多结果`,Tags:`标签`},ar={Authors:`作者`,Cancel:`取消`,"No matches found":`無相符結果`,Posts:`文章`,"Search posts, tags and authors":`搜尋文章、標籤與作者`,"Show more results":`更多結果`,Tags:`標籤`},H=e=>typeof e==`string`,or=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},sr=e=>e==null?``:``+e,cr=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},lr=/###/g,ur=e=>e&&e.indexOf(`###`)>-1?e.replace(lr,`.`):e,dr=e=>!e||H(e),fr=(e,t,n)=>{let r=H(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(dr(e))return{};let t=ur(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return dr(e)?{}:{obj:e,k:ur(r[i])}},pr=(e,t,n)=>{let{obj:r,k:i}=fr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=fr(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=fr(e,o,Object),s&&s.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},mr=(e,t,n,r)=>{let{obj:i,k:a}=fr(e,t,Object);i[a]=i[a]||[],i[a].push(n)},hr=(e,t)=>{let{obj:n,k:r}=fr(e,t);if(n)return n[r]},gr=(e,t,n)=>{let r=hr(e,n);return r===void 0?hr(t,n):r},_r=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?H(e[r])||e[r]instanceof String||H(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):_r(e[r],t[r],n):e[r]=t[r]);return e},vr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),yr={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},br=e=>H(e)?e.replace(/[&<>"'\/]/g,e=>yr[e]):e,xr=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Sr=[` `,`,`,`?`,`!`,`;`],Cr=new xr(20),wr=(e,t,n)=>{t||=``,n||=``;let r=Sr.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Cr.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Tr=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`.`;if(!e)return;if(e[t])return e[t];let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Er=e=>e&&e.replace(`_`,`-`),Dr={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}},Or=new class e{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||`i18next:`,this.logger=e||Dr,this.options=t,this.debug=t.debug}log(){var e=[...arguments];return this.forward(e,`log`,``,!0)}warn(){var e=[...arguments];return this.forward(e,`warn`,``,!0)}error(){var e=[...arguments];return this.forward(e,`error`,``)}deprecate(){var e=[...arguments];return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(H(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},kr=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){var t=[...arguments].slice(1);this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[n,r]=e;for(let e=0;e<r;e++)n(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(n=>{let[r,i]=n;for(let n=0;n<i;n++)r.apply(r,[e,...t])})}},Ar=class extends kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:[`translation`],defaultNS:`translation`};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):H(n)&&i?o.push(...n.split(i)):o.push(n)));let s=hr(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!H(n)?s:Tr(this.data&&this.data[e]&&this.data[e][t],n,i)}addResource(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),pr(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let r in n)(H(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=hr(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?_r(s,n,i):s={...s,...n},pr(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.options.compatibilityAPI===`v1`?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},jr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))}),t}},Mr={},Nr=class e extends kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),cr([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Or.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let n=this.resolve(e,t);return n&&n.res!==void 0}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!wr(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:H(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:H(i)?[i]:i}}translate(t,n,r){if(typeof n!=`object`&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n==`object`&&(n={...n}),n||={},t==null)return``;Array.isArray(t)||(t=[String(t)]);let i=n.returnDetails===void 0?this.options.returnDetails:n.returnDetails,a=n.keySeparator===void 0?this.options.keySeparator:n.keySeparator,{key:o,namespaces:s}=this.extractFromKey(t[t.length-1],n),c=s[s.length-1],l=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&l.toLowerCase()===`cimode`){if(u){let e=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${e}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}let d=this.resolve(t,n),f=d&&d.res,p=d&&d.usedKey||o,m=d&&d.exactUsedKey||o,h=Object.prototype.toString.apply(f),g=[`[object Number]`,`[object Function]`,`[object RegExp]`],_=n.joinArrays===void 0?this.options.joinArrays:n.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!H(f)&&typeof f!=`boolean`&&typeof f!=`number`;if(v&&f&&y&&g.indexOf(h)<0&&!(H(_)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(d.res=e,d.usedParams=this.getUsedParamsDetails(n),d):e}if(a){let e=Array.isArray(f),t=e?[]:{},r=e?m:p;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${a}${e}`;t[e]=this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=f[e])}f=t}}else if(v&&H(_)&&Array.isArray(f))f=f.join(_),f&&=this.extendTranslation(f,t,n,r);else{let i=!1,s=!1,u=n.count!==void 0&&!H(n.count),p=e.hasDefaultValue(n),m=u?this.pluralResolver.getSuffix(l,n.count,n):``,h=n.ordinal&&u?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):``,g=u&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),_=g&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${m}`]||n[`defaultValue${h}`]||n.defaultValue;!this.isValidLookup(f)&&p&&(i=!0,f=_),this.isValidLookup(f)||(s=!0,f=o);let v=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:f,y=p&&_!==f&&this.options.updateMissing;if(s||i||y){if(this.logger.log(y?`updateKey`:`missingKey`,l,c,o,y?_:f),a){let e=this.resolve(o,{...n,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=p&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,i,y,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,c,t,i,y,n),this.emit(`missingKey`,e,c,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);g&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],o+t,n[`defaultValue${t}`]||_)})}):r(e,o,_))}f=this.extendTranslation(f,t,n,d,r),s&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(s||i)&&this.options.parseMissingKeyHandler&&(f=this.options.compatibilityAPI===`v1`?this.options.parseMissingKeyHandler(f):this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,i?f:void 0))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(e,t,n,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let o=H(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=n.replace&&!H(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),o){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;s<r&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!==`v1`&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){var e=[...arguments];return i&&i[0]===e[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):a.translate(...e,t)},n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,s=H(o)?[o]:o;return e!=null&&s&&s.length&&n.applyPostProcessor!==!1&&(e=jr.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,r,i,a,o;return H(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!H(t.count),d=u&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),f=t.context!==void 0&&(H(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!Mr[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(Mr[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(o.push(c+e),t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator}${t.context}`;o.push(r),u&&(o.push(r+e),t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!H(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},Pr=e=>e.charAt(0).toUpperCase()+e.slice(1),Fr=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Or.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Er(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Er(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(H(e)&&e.indexOf(`-`)>-1){if(typeof Intl<`u`&&Intl.getCanonicalLocales!==void 0)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch{}let t=[`hans`,`hant`,`latn`,`cyrl`,`cans`,`mong`,`arab`],n=e.split(`-`);return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Pr(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!==`sgn`&&n[2].length===2&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Pr(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Pr(n[2].toLowerCase()))),n.join(`-`)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(e.indexOf(`-`)<0&&n.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&n.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===n||e.indexOf(n)===0&&n.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),H(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return H(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):H(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ir=[{lngs:[`ach`,`ak`,`am`,`arn`,`br`,`fil`,`gun`,`ln`,`mfe`,`mg`,`mi`,`oc`,`pt`,`pt-BR`,`tg`,`tl`,`ti`,`tr`,`uz`,`wa`],nr:[1,2],fc:1},{lngs:`af.an.ast.az.bg.bn.ca.da.de.dev.el.en.eo.es.et.eu.fi.fo.fur.fy.gl.gu.ha.hi.hu.hy.ia.it.kk.kn.ku.lb.mai.ml.mn.mr.nah.nap.nb.ne.nl.nn.no.nso.pa.pap.pms.ps.pt-PT.rm.sco.se.si.so.son.sq.sv.sw.ta.te.tk.ur.yo`.split(`.`),nr:[1,2],fc:2},{lngs:[`ay`,`bo`,`cgg`,`fa`,`ht`,`id`,`ja`,`jbo`,`ka`,`km`,`ko`,`ky`,`lo`,`ms`,`sah`,`su`,`th`,`tt`,`ug`,`vi`,`wo`,`zh`],nr:[1],fc:3},{lngs:[`be`,`bs`,`cnr`,`dz`,`hr`,`ru`,`sr`,`uk`],nr:[1,2,5],fc:4},{lngs:[`ar`],nr:[0,1,2,3,11,100],fc:5},{lngs:[`cs`,`sk`],nr:[1,2,5],fc:6},{lngs:[`csb`,`pl`],nr:[1,2,5],fc:7},{lngs:[`cy`],nr:[1,2,3,8],fc:8},{lngs:[`fr`],nr:[1,2],fc:9},{lngs:[`ga`],nr:[1,2,3,7,11],fc:10},{lngs:[`gd`],nr:[1,2,3,20],fc:11},{lngs:[`is`],nr:[1,2],fc:12},{lngs:[`jv`],nr:[0,1],fc:13},{lngs:[`kw`],nr:[1,2,3,4],fc:14},{lngs:[`lt`],nr:[1,2,10],fc:15},{lngs:[`lv`],nr:[1,2,0],fc:16},{lngs:[`mk`],nr:[1,2],fc:17},{lngs:[`mnk`],nr:[0,1,2],fc:18},{lngs:[`mt`],nr:[1,2,11,20],fc:19},{lngs:[`or`],nr:[2,1],fc:2},{lngs:[`ro`],nr:[1,2,20],fc:20},{lngs:[`sl`],nr:[5,1,2,3],fc:21},{lngs:[`he`,`iw`],nr:[1,2,20,21],fc:22}],Lr={1:e=>Number(e>1),2:e=>Number(e!=1),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(e==1?0:e>=2&&e<=4?1:2),7:e=>Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(e==1?0:e==2?1:e!=8&&e!=11?2:3),9:e=>Number(e>=2),10:e=>Number(e==1?0:e==2?1:e<7?2:e<11?3:4),11:e=>Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(e!==0),14:e=>Number(e==1?0:e==2?1:e==3?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:e===0?2:1),17:e=>Number(e==1||e%10==1&&e%100!=11?0:1),18:e=>Number(e==0?0:e==1?1:2),19:e=>Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(e==1?0:e==0||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)},Rr=[`v1`,`v2`,`v3`],zr=[`v4`],Br={zero:0,one:1,two:2,few:3,many:4,other:5},Vr=()=>{let e={};return Ir.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Lr[t.fc]}})}),e},Hr=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Or.create(`pluralResolver`),(!this.options.compatibilityJSON||zr.includes(this.options.compatibilityJSON))&&(typeof Intl>`u`||!Intl.PluralRules)&&(this.options.compatibilityJSON=`v3`,this.logger.error(`Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.`)),this.rules=Vr(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){let n=Er(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(!e.match(/-|_/))return;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Br[e]-Br[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),``)}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r=`plural`:r===1&&(r=``));let i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON===`v1`?r===1?``:typeof r==`number`?`_plural_${r.toString()}`:i():this.options.compatibilityJSON===`v2`||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Rr.includes(this.options.compatibilityJSON)}},Ur=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`.`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=gr(e,t,n);return!a&&i&&H(n)&&(a=Tr(e,n,r),a===void 0&&(a=Tr(t,n,r))),a},Wr=e=>e.replace(/\$/g,`$$$$`),Gr=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Or.create(`interpolator`),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?br:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?vr(i):a||`{{`,this.suffix=o?vr(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?vr(d):f||vr(`$t(`),this.nestingSuffix=p?vr(p):m||vr(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Ur(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ur(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Wr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Wr(this.escape(e)):Wr(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=H(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!H(a)&&!this.useRawValueToEscape&&(a=sr(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!H(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){let e=r[1].split(this.formatSeparator).map(e=>e.trim());r[1]=e.shift(),s=e,c=!0}if(i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!H(i))return i;H(i)||(i=sr(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),c&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Kr=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},qr=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Er(r),i),t[o]=s),s(n)}},Jr=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Or.create(`formatter`),this.options=e,this.formats={number:qr((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:qr((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:qr((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:qr((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:qr((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||`,`}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=qr(t)}format(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Kr(t);if(this.formats[i]){let t=e;try{let o=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Yr=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Xr=class extends kr{constructor(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Or.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{mr(n.loaded,[i],a),Yr(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();H(e)&&(e=this.languageUtils.toResolveHierarchy(e)),H(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend&&this.backend.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Zr=()=>({debug:!1,initImmediate:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),H(e[1])&&(t.defaultValue=e[1]),H(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0}}),Qr=e=>(H(e.ns)&&(e.ns=[e.ns]),H(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),H(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),U=()=>{},$r=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ei=class e extends kr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Qr(e),this.services={},this.logger=Or,this.modules={external:[]},$r(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t==`function`&&(n=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(H(t.ns)?t.defaultNS=t.ns:t.ns.indexOf(`translation`)<0&&(t.defaultNS=t.ns[0]));let r=Zr();this.options={...r,...this.options,...Qr(t)},this.options.compatibilityAPI!==`v1`&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);let i=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Or.init(i(this.modules.logger),this.options):Or.init(null,this.options);let t;this.modules.formatter?t=this.modules.formatter:typeof Intl<`u`&&(t=Jr);let n=new Fr(this.options);this.store=new Ar(this.options.resources,this.options);let a=this.services;a.logger=Or,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new Hr(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=i(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Gr(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Xr(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Nr(this.services,this.options),this.translator.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||=U,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=or(),o=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),a.resolve(t),n(e,t)};if(this.languages&&this.options.compatibilityAPI!==`v1`&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?o():setTimeout(o,0),a}loadResources(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U,n=H(e)?e:this.language;if(typeof e==`function`&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return t();let e=[],r=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e)),this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){let r=or();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=U,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&jr.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=or();this.emit(`languageChanging`,e);let i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},o=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=H(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{a(e,n)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,t,n){var r=this;let i=function(e,t){let a;if(typeof t!=`object`){var o=[...arguments].slice(2);a=r.options.overloadTranslationOptionHandler([e,t].concat(o))}else a={...t};a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||i.keyPrefix);let s=r.options.keySeparator||`.`,c;return c=a.keyPrefix&&Array.isArray(e)?e.map(e=>`${a.keyPrefix}${s}${e}`):a.keyPrefix?`${a.keyPrefix}${s}${e}`:e,r.t(c,a)};return H(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=or();return this.options.ns?(H(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=or();H(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return`rtl`;let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services&&this.services.languageUtils||new Fr(Zr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new e(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U,r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Ar(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Nr(a.services,i),a.translator.on(`*`,function(e){var t=[...arguments].slice(1);a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},W=ei.createInstance();W.createInstance=ei.createInstance,W.createInstance,W.dir,W.init,W.loadResources,W.reloadResources,W.use,W.changeLanguage,W.getFixedT,W.t,W.exists,W.setDefaultNamespace,W.hasLoadedNamespace,W.loadNamespaces,W.loadLanguages;var ti=[{code:`af`,label:`Afrikaans`},{code:`ar`,label:`Arabic`},{code:`bg`,label:`Bulgarian`},{code:`bn`,label:`Bengali`},{code:`bs`,label:`Bosnian`},{code:`ca`,label:`Catalan`},{code:`cs`,label:`Czech`},{code:`da`,label:`Danish`},{code:`de`,label:`German`},{code:`de-CH`,label:`Swiss German`},{code:`el`,label:`Greek`},{code:`en`,label:`English`},{code:`eo`,label:`Esperanto`},{code:`es`,label:`Spanish`},{code:`et`,label:`Estonian`},{code:`eu`,label:`Basque`},{code:`fa`,label:`Persian/Farsi`},{code:`fi`,label:`Finnish`},{code:`fr`,label:`French`},{code:`gd`,label:`Gaelic (Scottish)`},{code:`he`,label:`Hebrew`},{code:`hi`,label:`Hindi`},{code:`hr`,label:`Croatian`},{code:`hu`,label:`Hungarian`},{code:`id`,label:`Indonesian`},{code:`is`,label:`Icelandic`},{code:`it`,label:`Italian`},{code:`ja`,label:`Japanese`},{code:`ko`,label:`Korean`},{code:`kz`,label:`Kazakh`},{code:`lt`,label:`Lithuanian`},{code:`lv`,label:`Latvian`},{code:`mk`,label:`Macedonian`},{code:`mn`,label:`Mongolian`},{code:`ms`,label:`Malay`},{code:`nb`,label:`Norwegian Bokmål`},{code:`ne`,label:`Nepali`},{code:`nl`,label:`Dutch`},{code:`nn`,label:`Norwegian Nynorsk`},{code:`pa`,label:`Punjabi`},{code:`pl`,label:`Polish`},{code:`pt`,label:`Portuguese`},{code:`pt-BR`,label:`Portuguese (Brazil)`},{code:`ro`,label:`Romanian`},{code:`ru`,label:`Russian`},{code:`si`,label:`Sinhala`},{code:`sk`,label:`Slovak`},{code:`sl`,label:`Slovenian`},{code:`sq`,label:`Albanian`},{code:`sr`,label:`Serbian`},{code:`sr-Cyrl`,label:`Serbian (Cyrillic)`},{code:`sv`,label:`Swedish`},{code:`sw`,label:`Swahili`},{code:`ta`,label:`Tamil`},{code:`th`,label:`Thai`},{code:`tr`,label:`Turkish`},{code:`uk`,label:`Ukrainian`},{code:`ur`,label:`Urdu`},{code:`uz`,label:`Uzbek`},{code:`vi`,label:`Vietnamese`},{code:`zh`,label:`Chinese`},{code:`zh-Hant`,label:`Traditional Chinese`}],ni=ti.map(e=>e.code);function ri(e){let t=e.default;return{...e,...t&&typeof t==`object`?t:{}}}function ii(e){return function(t,n){return t.reduce((t,r)=>{let i=e(r,n);return i===void 0&&(i=e(`en`,n)),t[r]={[n]:ri(i??{})},t},{})}}function ai({generateThemeResources:e,generateResources:t}){return(n=`en`,r=`portal`,i={})=>{let a=W.createInstance(),o={prefix:`{`,suffix:`}`};(r===`theme`||r===`portal`)&&(o.escapeValue=!1);let s;return s=r===`theme`?e(n,i):t(ni,r),a.init({lng:n,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:[`nb`,`en`],default:[`en`]},ns:r,defaultNS:r,interpolation:o,resources:s}),a}}function oi(e,t){let n={};for(let[t,r]of Object.entries(e)){let e=/\/locales\/([^/]+)\//.exec(t)?.[1];e&&(n[e]=r)}return si(n,t)}function si(e,t){let n=ii(t=>e[t]),r=Object.assign(ai({generateResources:n,generateThemeResources:e=>({[e]:{theme:{}}})}),{LOCALE_DATA:ti,SUPPORTED_LOCALES:ni,generateResources:n,namespace:t});return r.default=r,r}var ci=oi(Object.assign({"../../locales/af/search.json":Qt,"../../locales/ar/search.json":$t,"../../locales/bg/search.json":en,"../../locales/bn/search.json":tn,"../../locales/bs/search.json":nn,"../../locales/ca/search.json":rn,"../../locales/cs/search.json":V,"../../locales/da/search.json":an,"../../locales/de/search.json":on,"../../locales/de-CH/search.json":sn,"../../locales/el/search.json":cn,"../../locales/en/search.json":ln,"../../locales/eo/search.json":un,"../../locales/es/search.json":dn,"../../locales/et/search.json":fn,"../../locales/eu/search.json":pn,"../../locales/fa/search.json":mn,"../../locales/fi/search.json":hn,"../../locales/fr/search.json":gn,"../../locales/gd/search.json":_n,"../../locales/he/search.json":vn,"../../locales/hi/search.json":yn,"../../locales/hr/search.json":bn,"../../locales/hu/search.json":xn,"../../locales/id/search.json":Sn,"../../locales/is/search.json":Cn,"../../locales/it/search.json":wn,"../../locales/ja/search.json":Tn,"../../locales/ko/search.json":En,"../../locales/kz/search.json":Dn,"../../locales/lt/search.json":On,"../../locales/lv/search.json":kn,"../../locales/mk/search.json":An,"../../locales/mn/search.json":jn,"../../locales/ms/search.json":Mn,"../../locales/nb/search.json":Nn,"../../locales/ne/search.json":Pn,"../../locales/nl/search.json":Fn,"../../locales/nn/search.json":In,"../../locales/pa/search.json":Ln,"../../locales/pl/search.json":Rn,"../../locales/pt/search.json":zn,"../../locales/pt-BR/search.json":Bn,"../../locales/ro/search.json":Vn,"../../locales/ru/search.json":Hn,"../../locales/si/search.json":Un,"../../locales/sk/search.json":Wn,"../../locales/sl/search.json":Gn,"../../locales/sq/search.json":Kn,"../../locales/sr/search.json":qn,"../../locales/sr-Cyrl/search.json":Jn,"../../locales/sv/search.json":Yn,"../../locales/sw/search.json":Xn,"../../locales/ta/search.json":Zn,"../../locales/th/search.json":Qn,"../../locales/tr/search.json":$n,"../../locales/uk/search.json":er,"../../locales/ur/search.json":tr,"../../locales/uz/search.json":nr,"../../locales/vi/search.json":rr,"../../locales/zh/search.json":ir,"../../locales/zh-Hant/search.json":ar}),`search`),{LOCALE_DATA:li,SUPPORTED_LOCALES:ui,generateResources:di}=ci,fi=class extends g.Component{constructor(e){super(e);let t=ci(this.props.locale||`en`,`search`),n=t.dir()||`ltr`,r=new Zt({adminUrl:e.adminUrl,apiKey:e.apiKey,dir:n});this.state={searchIndex:r,showPopup:!1,indexStarted:!1,indexComplete:!1,t:t.t,dir:n,scrollbarWidth:0},this.inputRef=g.createRef()}componentDidMount(){let e=this.getScrollbarWidth();this.setState({scrollbarWidth:e}),this.initSetup()}componentDidUpdate(e,t){if(t.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=window.document?.body?.style?.overflow,this.bodyMargin=window.getComputedStyle(document.body).getPropertyValue(`margin-right`),window.document.body.style.overflow=`hidden`,this.state.scrollbarWidth&&document.body.scrollHeight>window.innerHeight&&(window.document.body.style.marginRight=`calc(${this.bodyMargin} + ${this.state.scrollbarWidth}px)`)):(window.document.body.style.overflow=this.bodyScroll||``,!this.bodyMargin||this.bodyMargin===`0px`?window.document.body.style.marginRight=``:window.document.body.style.marginRight=this.bodyMargin)}catch{}this.state.showPopup!==t?.showPopup&&!this.state.showPopup&&this.setState({searchValue:``}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener(`hashchange`,this.hashHandler,!1),window.removeEventListener(`keydown`,this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener(`hashchange`,this.hashHandler,!1)}getScrollbarWidth(){let e=document.createElement(`div`);e.style.visibility=`hidden`,e.style.overflow=`scroll`,document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}setupCustomTriggerButton(){this.clickHandler=e=>{e.preventDefault(),this.setState({showPopup:!0});let t=document.createElement(`input`);t.style.opacity=`0`,t.style.position=`fixed`,t.style.top=`0`,document.body.appendChild(t),t.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(t)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(e=>{e.removeEventListener(`click`,this.clickHandler),e.addEventListener(`click`,this.clickHandler)})}getCustomTriggerButtons(){return document.querySelectorAll(`[data-ghost-search]`)||[]}handleSearchUrl(){let[e]=window.location.hash.substr(1).split(`?`);(e===`/search`||e===`/search/`)&&(this.setState({showPopup:!0}),window.history.replaceState(``,document.title,window.location.pathname))}addKeyboardShortcuts(){this.getCustomTriggerButtons()?.length&&(this.handleKeyDown=e=>{if(e.key===`k`&&e.metaKey)return this.setState({showPopup:!0}),e.preventDefault(),e.stopPropagation(),!1},document.addEventListener(`keydown`,this.handleKeyDown))}render(){return(0,b.jsx)(v.Provider,{value:{page:`search`,showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(e,t)=>{e===`update`&&this.setState({...this.state,...t})},t:this.state.t,dir:this.state.dir},children:(0,b.jsx)(pe,{})})}},pi=`sodo-search-root`;function mi(){let e=document.createElement(`div`);e.id=pi,document.body.appendChild(e)}function hi(){let e=document.querySelector(`script[data-sodo-search]`);return e?{adminUrl:e.dataset.sodoSearch,apiKey:e.dataset.key,stylesUrl:e.dataset.styles,locale:e.dataset.locale||`en`}:{}}function gi(){mi()}function _i(){let{adminUrl:e,apiKey:t,stylesUrl:n,locale:r}=hi(),i=(e||window.location.origin)?.replace(/\/+$/,``);gi(),_.render((0,b.jsx)(g.default.StrictMode,{children:(0,b.jsx)(fi,{adminUrl:i,apiKey:t,stylesUrl:n,locale:r})}),document.getElementById(pi))}_i()});
|
|
17
|
+
`,t=this.context.stylesUrl;return t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`link`,{rel:`stylesheet`,href:t}),(0,b.jsx)(`style`,{dangerouslySetInnerHTML:{__html:e}}),(0,b.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1, maximum-scale=1`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`style`,{dangerouslySetInnerHTML:{__html:e}}),(0,b.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1, maximum-scale=1`})]})}renderFrameContainer(){let e=D(),t={...e.frame.common};return(0,b.jsx)(`div`,{style:e.modalContainer,className:`gh-root-frame`,children:(0,b.jsxs)(C,{style:t,title:`portal-popup`,head:this.renderFrameStyles(),searchdir:this.context.dir,children:[(0,b.jsx)(`div`,{onClick:e=>this.handlePopupClose(e),className:`absolute top-0 bottom-0 left-0 right-0 block backdrop-blur-[2px] animate-fadein z-0 bg-gradient-to-br from-[rgba(0,0,0,0.2)] to-[rgba(0,0,0,0.1)]`}),(0,b.jsx)(O,{})]})})}render(){let{showPopup:e}=this.context;return e?this.renderFrameContainer():null}},me=o(((e,t)=>{t.exports={}})),I;function L(e,t,n){let r=typeof n,i=typeof e;if(r!==`undefined`){if(i!==`undefined`){if(n){if(i===`function`&&r===i)return function(t){return e(n(t))};if(t=e.constructor,t===n.constructor){if(t===Array)return n.concat(e);if(t===Map){var a=new Map(n);for(var o of e)a.set(o[0],o[1]);return a}if(t===Set){o=new Set(n);for(a of e.values())o.add(a);return o}}}return e}return n}return i===`undefined`?t:e}function he(e,t){return e===void 0?t:e}function R(){return Object.create(null)}function ge(e){return typeof e==`string`}function _e(e){return typeof e==`object`}function ve(e,t){if(ge(t))e=e[t];else for(let n=0;e&&n<t.length;n++)e=e[t[n]];return e}var ye=/[^\p{L}\p{N}]+/u,be=/(\d{3})/g,xe=/(\D)(\d{3})/g,Se=/(\d{3})(\D)/g,Ce=/[\u0300-\u036f]/g;function we(e={}){if(!this||this.constructor!==we)return new we(...arguments);if(arguments.length)for(e=0;e<arguments.length;e++)this.assign(arguments[e]);else this.assign(e)}I=we.prototype,I.assign=function(e){this.normalize=L(e.normalize,!0,this.normalize);let t=e.include,n=t||e.exclude||e.split,r;if(n||n===``){if(typeof n==`object`&&n.constructor!==RegExp){let e=``;r=!t,t||(e+=`\\p{Z}`),n.letter&&(e+=`\\p{L}`),n.number&&(e+=`\\p{N}`,r=!!t),n.symbol&&(e+=`\\p{S}`),n.punctuation&&(e+=`\\p{P}`),n.control&&(e+=`\\p{C}`),(n=n.char)&&(e+=typeof n==`object`?n.join(``):n);try{this.split=RegExp(`[`+(t?`^`:``)+e+`]+`,`u`)}catch{this.split=/\s+/}}else this.split=n,r=n===!1||`a1a`.split(n).length<2;this.numeric=L(e.numeric,r)}else{try{this.split=L(this.split,ye)}catch{this.split=/\s+/}this.numeric=L(e.numeric,L(this.numeric,!0))}if(this.prepare=L(e.prepare,null,this.prepare),this.finalize=L(e.finalize,null,this.finalize),n=e.filter,this.filter=typeof n==`function`?n:L(n&&new Set(n),null,this.filter),this.dedupe=L(e.dedupe,!0,this.dedupe),this.matcher=L((n=e.matcher)&&new Map(n),null,this.matcher),this.mapper=L((n=e.mapper)&&new Map(n),null,this.mapper),this.stemmer=L((n=e.stemmer)&&new Map(n),null,this.stemmer),this.replacer=L(e.replacer,null,this.replacer),this.minlength=L(e.minlength,1,this.minlength),this.maxlength=L(e.maxlength,1024,this.maxlength),this.rtl=L(e.rtl,!1,this.rtl),(this.cache=n=L(e.cache,!0,this.cache))&&(this.F=null,this.L=typeof n==`number`?n:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h=``,this.J=null,this.A=``,this.K=null,this.matcher)for(let e of this.matcher.keys())this.h+=(this.h?`|`:``)+e;if(this.stemmer)for(let e of this.stemmer.keys())this.A+=(this.A?`|`:``)+e;return this},I.addStemmer=function(e,t){return this.stemmer||=new Map,this.stemmer.set(e,t),this.A+=(this.A?`|`:``)+e,this.K=null,this.cache&&Te(this),this},I.addFilter=function(e){return typeof e==`function`?this.filter=e:(this.filter||=new Set,this.filter.add(e)),this.cache&&Te(this),this},I.addMapper=function(e,t){return typeof e==`object`?this.addReplacer(e,t):e.length>1?this.addMatcher(e,t):(this.mapper||=new Map,this.mapper.set(e,t),this.cache&&Te(this),this)},I.addMatcher=function(e,t){return typeof e==`object`?this.addReplacer(e,t):e.length<2&&(this.dedupe||this.mapper)?this.addMapper(e,t):(this.matcher||=new Map,this.matcher.set(e,t),this.h+=(this.h?`|`:``)+e,this.J=null,this.cache&&Te(this),this)},I.addReplacer=function(e,t){return typeof e==`string`?this.addMatcher(e,t):(this.replacer||=[],this.replacer.push(e,t),this.cache&&Te(this),this)},I.encode=function(e,t){if(this.cache&&e.length<=this.H)if(this.F){if(this.B.has(e))return this.B.get(e)}else this.F=setTimeout(Te,50,this);this.normalize&&(e=typeof this.normalize==`function`?this.normalize(e):Ce?e.normalize(`NFKD`).replace(Ce,``).toLowerCase():e.toLowerCase()),this.prepare&&(e=this.prepare(e)),this.numeric&&e.length>3&&(e=e.replace(xe,`$1 $2`).replace(Se,`$1 $2`).replace(be,`$1 `));let n=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer),r=[],i=R(),a,o,s=this.split||this.split===``?e.split(this.split):[e];for(let e=0,l,u;e<s.length;e++)if((l=u=s[e])&&!(l.length<this.minlength||l.length>this.maxlength)){if(t){if(i[l])continue;i[l]=1}else{if(a===l)continue;a=l}if(n)r.push(l);else if(!this.filter||(typeof this.filter==`function`?this.filter(l):!this.filter.has(l))){if(this.cache&&l.length<=this.I)if(this.F){var c=this.D.get(l);if(c||c===``){c&&r.push(c);continue}}else this.F=setTimeout(Te,50,this);if(this.stemmer){this.K||=RegExp(`(?!^)(`+this.A+`)$`);let e;for(;e!==l&&l.length>2;)e=l,l=l.replace(this.K,e=>this.stemmer.get(e))}if(l&&(this.mapper||this.dedupe&&l.length>1)){c=``;for(let e=0,t=``,n,r;e<l.length;e++)n=l.charAt(e),n===t&&this.dedupe||((r=this.mapper&&this.mapper.get(n))||r===``?r===t&&this.dedupe||!(t=r)||(c+=r):c+=t=n);l=c}if(this.matcher&&l.length>1&&(this.J||=RegExp(`(`+this.h+`)`,`g`),l=l.replace(this.J,e=>this.matcher.get(e))),l&&this.replacer)for(c=0;l&&c<this.replacer.length;c+=2)l=l.replace(this.replacer[c],this.replacer[c+1]);if(this.cache&&u.length<=this.I&&(this.D.set(u,l),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),l){if(l!==u)if(t){if(i[l])continue;i[l]=1}else{if(o===l)continue;o=l}r.push(l)}}}return this.finalize&&(r=this.finalize(r)||r),this.cache&&e.length<=this.H&&(this.B.set(e,r),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),r};function Te(e){e.F=null,e.B.clear(),e.D.clear()}function Ee(e,t,n){n||(t||typeof e!=`object`?typeof t==`object`&&(n=t,t=0):n=e),n&&(e=n.query||e,t=n.limit||t);let r=``+(t||0);n&&(r+=(n.offset||0)+!!n.context+!!n.suggest+(n.resolve!==!1)+(n.resolution||this.resolution)+(n.boost||0)),e=(``+e).toLowerCase(),this.cache||=new De;let i=this.cache.get(e+r);if(!i){let a=n&&n.cache;a&&(n.cache=!1),i=this.search(e,t,n),a&&(n.cache=a),this.cache.set(e+r,i)}return i}function De(e){this.limit=e&&e!==!0?e:1e3,this.cache=new Map,this.h=``}De.prototype.set=function(e,t){this.cache.set(this.h=e,t),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},De.prototype.get=function(e){let t=this.cache.get(e);return t&&this.h!==e&&(this.cache.delete(e),this.cache.set(this.h=e,t)),t},De.prototype.remove=function(e){for(let t of this.cache){let n=t[0];t[1].includes(e)&&this.cache.delete(n)}},De.prototype.clear=function(){this.cache.clear(),this.h=``};var Oe={normalize:!1,numeric:!1,dedupe:!1},ke={},Ae=new Map([[`b`,`p`],[`v`,`f`],[`w`,`f`],[`z`,`s`],[`x`,`s`],[`d`,`t`],[`n`,`m`],[`c`,`k`],[`g`,`k`],[`j`,`k`],[`q`,`k`],[`i`,`e`],[`y`,`e`],[`u`,`o`]]),je=new Map([[`ae`,`a`],[`oe`,`o`],[`sh`,`s`],[`kh`,`k`],[`th`,`t`],[`ph`,`f`],[`pf`,`f`]]),Me=[/([^aeo])h(.)/g,`$1$2`,/([aeo])h([^aeo]|$)/g,`$1$2`,/(.)\1+/g,`$1`],Ne={a:``,e:``,i:``,o:``,u:``,y:``,b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6},Pe={Exact:Oe,Default:ke,Normalize:ke,LatinBalance:{mapper:Ae},LatinAdvanced:{mapper:Ae,matcher:je,replacer:Me},LatinExtra:{mapper:Ae,replacer:Me.concat([/(?!^)[aeo]/g,``]),matcher:je},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(e){for(let n=0;n<e.length;n++){var t=e[n];let r=t.charAt(0),i=Ne[r];for(let e=1,n;e<t.length&&(n=t.charAt(e),n===`h`||n===`w`||!(n=Ne[n])||n===i||(r+=n,i=n,r.length!==4));e++);e[n]=r}}},CJK:{split:``},LatinExact:Oe,LatinDefault:ke,LatinSimple:ke};function Fe(e,t,n,r){let i=[];for(let a=0,o;a<e.index.length;a++)if(o=e.index[a],t>=o.length)t-=o.length;else{t=o[r?`splice`:`slice`](t,n);let a=t.length;if(a&&(i=i.length?i.concat(t):t,n-=a,r&&(e.length-=a),!n))break;t=0}return i}function Ie(e){if(!this||this.constructor!==Ie)return new Ie(e);this.index=e?[e]:[],this.length=e?e.length:0;let t=this;return new Proxy([],{get(e,n){if(n===`length`)return t.length;if(n===`push`)return function(e){t.index[t.index.length-1].push(e),t.length++};if(n===`pop`)return function(){if(t.length)return t.length--,t.index[t.index.length-1].pop()};if(n===`indexOf`)return function(e){let n=0;for(let r=0,i,a;r<t.index.length;r++){if(i=t.index[r],a=i.indexOf(e),a>=0)return n+a;n+=i.length}return-1};if(n===`includes`)return function(e){for(let n=0;n<t.index.length;n++)if(t.index[n].includes(e))return!0;return!1};if(n===`slice`)return function(e,n){return Fe(t,e||0,n||t.length,!1)};if(n===`splice`)return function(e,n){return Fe(t,e||0,n||t.length,!0)};if(n===`constructor`)return Array;if(typeof n!=`symbol`)return(e=t.index[n/2**31|0])&&e[n]},set(e,n,r){return e=n/2**31|0,(t.index[e]||(t.index[e]=[]))[n]=r,t.length++,!0}})}Ie.prototype.clear=function(){this.index.length=0},Ie.prototype.push=function(){};function z(e=8){if(!this||this.constructor!==z)return new z(e);this.index=R(),this.h=[],this.size=0,e>32?(this.B=ze,this.A=BigInt(e)):(this.B=Re,this.A=e)}z.prototype.get=function(e){let t=this.index[this.B(e)];return t&&t.get(e)},z.prototype.set=function(e,t){var n=this.B(e);let r=this.index[n];r?(n=r.size,r.set(e,t),(n-=r.size)&&this.size++):(this.index[n]=r=new Map([[e,t]]),this.h.push(r),this.size++)};function Le(e=8){if(!this||this.constructor!==Le)return new Le(e);this.index=R(),this.h=[],this.size=0,e>32?(this.B=ze,this.A=BigInt(e)):(this.B=Re,this.A=e)}Le.prototype.add=function(e){var t=this.B(e);let n=this.index[t];n?(t=n.size,n.add(e),(t-=n.size)&&this.size++):(this.index[t]=n=new Set([e]),this.h.push(n),this.size++)},I=z.prototype,I.has=Le.prototype.has=function(e){let t=this.index[this.B(e)];return t&&t.has(e)},I.delete=Le.prototype.delete=function(e){let t=this.index[this.B(e)];t&&t.delete(e)&&this.size--},I.clear=Le.prototype.clear=function(){this.index=R(),this.h=[],this.size=0},I.values=Le.prototype.values=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].values())yield t},I.keys=Le.prototype.keys=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].keys())yield t},I.entries=Le.prototype.entries=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].entries())yield t};function Re(e){let t=2**this.A-1;if(typeof e==`number`)return e&t;let n=0,r=this.A+1;for(let i=0;i<e.length;i++)n=(n*r^e.charCodeAt(i))&t;return this.A===32?n+2**31:n}function ze(e){let t=BigInt(2)**this.A-BigInt(1);var n=typeof e;if(n===`bigint`)return e&t;if(n===`number`)return BigInt(e)&t;n=BigInt(0);let r=this.A+BigInt(1);for(let i=0;i<e.length;i++)n=(n*r^BigInt(e.charCodeAt(i)))&t;return n}var Be,Ve;async function He(e){e=e.data;var t=e.task;let n=e.id,r=e.args;switch(t){case`init`:Ve=e.options||{},(t=e.factory)?(Function(`return `+t)()(self),Be=new self.FlexSearch.Index(Ve),delete self.FlexSearch):Be=new Lt(Ve),postMessage({id:n});break;default:let i;t===`export`&&(r[1]?(r[0]=Ve.export,r[2]=0,r[3]=1):r=null),t===`import`?r[0]&&(e=await Ve.import.call(Be,r[0]),Be.import(r[0],e)):((i=r&&Be[t].apply(Be,r))&&i.then&&(i=await i),i&&i.await&&(i=await i.await),t===`search`&&i.result&&(i=i.result)),postMessage(t===`search`?{id:n,msg:i}:{id:n})}}function Ue(e){Je.call(e,`add`),Je.call(e,`append`),Je.call(e,`search`),Je.call(e,`update`),Je.call(e,`remove`),Je.call(e,`searchCache`)}var We,Ge,Ke;function qe(){We=Ke=0}function Je(e){this[e+`Async`]=function(){let t=arguments;var n=t[t.length-1];let r;if(typeof n==`function`&&(r=n,delete t[t.length-1]),We?Ke||=Date.now()-Ge>=this.priority*this.priority*3:(We=setTimeout(qe,0),Ge=Date.now()),Ke){let n=this;return new Promise(r=>{setTimeout(function(){r(n[e+`Async`].apply(n,t))},0)})}let i=this[e].apply(this,t);return n=i.then?i:new Promise(e=>e(i)),r&&n.then(r),n}}var Ye=0;function Xe(e={},t){function n(n){function o(e){e=e.data||e;let t=e.id,n=t&&a.h[t];n&&(n(e.msg),delete a.h[t])}if(this.worker=n,this.h=R(),this.worker)return i?this.worker.on(`message`,o):this.worker.onmessage=o,e.config?new Promise(function(t){Ye>1e9&&(Ye=0),a.h[++Ye]=function(){t(a)},a.worker.postMessage({id:Ye,task:`init`,factory:r,options:e})}):(this.priority=e.priority||4,this.encoder=t||null,this.worker.postMessage({task:`init`,factory:r,options:e}),this)}if(!this||this.constructor!==Xe)return new Xe(e);let r=typeof self<`u`?self._factory:typeof window<`u`?window._factory:null;r&&=r.toString();let i=typeof window>`u`,a=this,o=Qe(r,i,e.worker);return o.then?o.then(function(e){return n.call(a,e)}):n.call(this,o)}Ze(`add`),Ze(`append`),Ze(`search`),Ze(`update`),Ze(`remove`),Ze(`clear`),Ze(`export`),Ze(`import`),Xe.prototype.searchCache=Ee,Ue(Xe.prototype);function Ze(e){Xe.prototype[e]=function(){let t=this,n=[].slice.call(arguments);var r=n[n.length-1];let i;return typeof r==`function`&&(i=r,n.pop()),r=new Promise(function(r){e===`export`&&typeof n[0]==`function`&&(n[0]=null),Ye>1e9&&(Ye=0),t.h[++Ye]=r,t.worker.postMessage({task:e,id:Ye,args:n})}),i?(r.then(i),this):r}}function Qe(e,t,n){return t?typeof module<`u`?new(me()).Worker(__dirname+`/worker/node.js`):Promise.resolve().then(()=>c(me(),1)).then(function(e){return new e.Worker({}.dirname+`/node/node.mjs`)}):e?new window.Worker(URL.createObjectURL(new Blob([`onmessage=`+He.toString()],{type:`text/javascript`}))):new window.Worker(typeof n==`string`?n:{}.url.replace(`/worker.js`,`/worker/worker.js`).replace(`flexsearch.bundle.module.min.js`,`module/worker/worker.js`).replace(`flexsearch.bundle.module.min.mjs`,`module/worker/worker.js`),{type:`module`})}gt.prototype.add=function(e,t,n){if(_e(e)&&(t=e,e=ve(t,this.key)),t&&(e||e===0)){if(!n&&this.reg.has(e))return this.update(e,t);for(let a=0,o;a<this.field.length;a++){o=this.B[a];var r=this.index.get(this.field[a]);if(typeof o==`function`){var i=o(t);i&&r.add(e,i,n,!0)}else i=o.G,(!i||i(t))&&(o.constructor===String?o=[``+o]:ge(o)&&(o=[o]),et(t,o,this.D,0,r,e,o[0],n))}if(this.tag)for(r=0;r<this.A.length;r++){var a=this.A[r];i=this.tag.get(this.F[r]);let s=R();if(typeof a==`function`){if(a=a(t),!a)continue}else{var o=a.G;if(o&&!o(t))continue;a.constructor===String&&(a=``+a),a=ve(t,a)}if(i&&a){ge(a)&&(a=[a]);for(let t=0,r,c;t<a.length;t++)if(r=a[t],!s[r]&&(s[r]=1,(o=i.get(r))?c=o:i.set(r,c=[]),!n||!c.includes(e))){if(c.length===2**31-1){if(o=new Ie(c),this.fastupdate)for(let e of this.reg.values())e.includes(c)&&(e[e.indexOf(c)]=o);i.set(r,c=o)}c.push(e),this.fastupdate&&((o=this.reg.get(e))?o.push(c):this.reg.set(e,[c]))}}}if(this.store&&(!n||!this.store.has(e))){let r;if(this.h){r=R();for(let e=0,i;e<this.h.length;e++){if(i=this.h[e],(n=i.G)&&!n(t))continue;let a;if(typeof i==`function`){if(a=i(t),!a)continue;i=[i.O]}else if(ge(i)||i.constructor===String){r[i]=t[i];continue}$e(t,r,i,0,i[0],a)}}this.store.set(e,r||t)}this.worker&&(this.fastupdate||this.reg.add(e))}return this};function $e(e,t,n,r,i,a){if(e=e[i],r===n.length-1)t[i]=a||e;else if(e)if(e.constructor===Array)for(t=t[i]=Array(e.length),i=0;i<e.length;i++)$e(e,t,n,r,i);else t=t[i]||(t[i]=R()),i=n[++r],$e(e,t,n,r,i)}function et(e,t,n,r,i,a,o,s){if(e=e[o])if(r===t.length-1){if(e.constructor===Array){if(n[r]){for(t=0;t<e.length;t++)i.add(a,e[t],!0,!0);return}e=e.join(` `)}i.add(a,e,s,!0)}else if(e.constructor===Array)for(o=0;o<e.length;o++)et(e,t,n,r,i,a,o,s);else o=t[++r],et(e,t,n,r,i,a,o,s)}function tt(e,t,n,r){if(!e.length)return e;if(e.length===1)return e=e[0],e=n||e.length>t?e.slice(n,n+t):e,r?ht.call(this,e):e;let i=[];for(let a=0,o,s;a<e.length;a++)if((o=e[a])&&(s=o.length)){if(n){if(n>=s){n-=s;continue}o=o.slice(n,n+t),s=o.length,n=0}if(s>t&&(o=o.slice(0,t),s=t),!i.length&&s>=t)return r?ht.call(this,o):o;if(i.push(o),t-=s,!t)break}return i=i.length>1?[].concat.apply([],i):i[0],r?ht.call(this,i):i}function nt(e,t,n,r){var i=r[0];if(i[0]&&i[0].query)return e[t].apply(e,i);if(!(t!==`and`&&t!==`not`||e.result.length||e.await||i.suggest))return r.length>1&&(i=r[r.length-1]),(r=i.resolve)?e.await||e.result:e;let a=[],o=0,s=0,c,l,u,d,f;for(t=0;t<r.length;t++)if(i=r[t]){var p=void 0;if(i.constructor===B)p=i.await||i.result;else if(i.then||i.constructor===Array)p=i;else{o=i.limit||0,s=i.offset||0,u=i.suggest,l=i.resolve,c=((d=i.highlight||e.highlight)||i.enrich)&&l,p=i.queue;let n=i.async||p,r=i.index,m=i.query;if(r?e.index||=r:r=e.index,m||i.tag){let o=i.field||i.pluck;if(o&&(!m||e.query&&!d||(e.query=m,e.field=o,e.highlight=d),r=r.index.get(o)),p&&(f||e.await)){f=1;let o,s=e.C.length,c=new Promise(function(e){o=e});(function(t,r){c.h=function(){r.index=null,r.resolve=!1;let i=n?t.searchAsync(r):t.search(r);return i.then?i.then(function(t){return e.C[s]=t=t.result||t,o(t),t}):(i=i.result||i,o(i),i)}})(r,Object.assign({},i)),e.C.push(c),a[t]=c;continue}else i.resolve=!1,i.index=null,p=n?r.searchAsync(i):r.search(i),i.resolve=l,i.index=r}else if(i.and)p=rt(i,`and`,r);else if(i.or)p=rt(i,`or`,r);else if(i.not)p=rt(i,`not`,r);else if(i.xor)p=rt(i,`xor`,r);else continue}p.await?(f=1,p=p.await):p.then?(f=1,p=p.then(function(e){return e.result||e})):p=p.result||p,a[t]=p}if(f&&!e.await&&(e.await=new Promise(function(t){e.return=t})),f){let t=Promise.all(a).then(function(r){for(let i=0;i<e.C.length;i++)if(e.C[i]===t){e.C[i]=function(){return n.call(e,r,o,s,c,l,u,d)};break}lt(e)});e.C.push(t)}else if(e.await)e.C.push(function(){return n.call(e,a,o,s,c,l,u,d)});else return n.call(e,a,o,s,c,l,u,d);return l?e.await||e.result:e}function rt(e,t,n){e=e[t];let r=e[0]||e;return r.index||=n,n=new B(r),e.length>1&&(n=n[t].apply(n,e.slice(1))),n}B.prototype.or=function(){return nt(this,`or`,it,arguments)};function it(e,t,n,r,i,a,o){return e.length&&(this.result.length&&e.push(this.result),e.length<2?this.result=e[0]:(this.result=dt(e,t,n,!1,this.h),n=0)),i&&(this.await=null),i?this.resolve(t,n,r,o):this}B.prototype.and=function(){return nt(this,`and`,at,arguments)};function at(e,t,n,r,i,a,o){if(!a&&!this.result.length)return i?this.result:this;let s;if(e.length)if(this.result.length&&e.unshift(this.result),e.length<2)this.result=e[0];else{let r=0;for(let t=0,n,i;t<e.length;t++)if((n=e[t])&&(i=n.length))r<i&&(r=i);else if(!a){r=0;break}r?(this.result=ut(e,r,t,n,a,this.h,i),s=!0):this.result=[]}else a||(this.result=e);return i&&(this.await=null),i?this.resolve(t,n,r,o,s):this}B.prototype.xor=function(){return nt(this,`xor`,ot,arguments)};function ot(e,t,n,r,i,a,o){if(e.length)if(this.result.length&&e.unshift(this.result),e.length<2)this.result=e[0];else{a:{a=n;var s=this.h;let r=[],o=R(),c=0;for(let t=0,n;t<e.length;t++)if(n=e[t]){c<n.length&&(c=n.length);for(let e=0,t;e<n.length;e++)if(t=n[e])for(let e=0,n;e<t.length;e++)n=t[e],o[n]=o[n]?2:1}for(let n=0,l,u=0;n<c;n++)for(let c=0,d;c<e.length;c++)if((d=e[c])&&(l=d[n])){for(let d=0,f;d<l.length;d++)if(f=l[d],o[f]===1)if(a)a--;else if(i){if(r.push(f),r.length===t){e=r;break a}}else{let i=n+(c?s:0);if(r[i]||(r[i]=[]),r[i].push(f),++u===t){e=r;break a}}}e=r}this.result=e,s=!0}else a||(this.result=e);return i&&(this.await=null),i?this.resolve(t,n,r,o,s):this}B.prototype.not=function(){return nt(this,`not`,st,arguments)};function st(e,t,n,r,i,a,o){if(!a&&!this.result.length)return i?this.result:this;if(e.length&&this.result.length){a:{a=n;var s=[];e=new Set(e.flat().flat());for(let n=0,r,o=0;n<this.result.length;n++)if(r=this.result[n]){for(let c=0,l;c<r.length;c++)if(l=r[c],!e.has(l)){if(a)a--;else if(i){if(s.push(l),s.length===t){e=s;break a}}else if(s[n]||(s[n]=[]),s[n].push(l),++o===t){e=s;break a}}}e=s}this.result=e,s=!0}return i&&(this.await=null),i?this.resolve(t,n,r,o,s):this}function ct(e,t,n,r,i){let a,o,s;typeof i==`string`?(a=i,i=``):a=i.template,o=a.indexOf(`$1`),s=a.substring(o+2),o=a.substring(0,o);let c=i&&i.boundary,l=!i||i.clip!==!1,u=i&&i.merge&&s&&o&&RegExp(s+` `+o,`g`);i&&=i.ellipsis;var d=0;if(typeof i==`object`){var f=i.template;d=f.length-2,i=i.pattern}typeof i!=`string`&&(i=i===!1?``:`...`),d&&(i=f.replace(`$1`,i)),f=i.length-d;let p,m;typeof c==`object`&&(p=c.before,p===0&&(p=-1),m=c.after,m===0&&(m=-1),c=c.total||9e5),d=new Map;for(let N=0,P,ee,te;N<t.length;N++){let ne;if(r)ne=t,te=r;else{var h=t[N];if(te=h.field,!te)continue;ne=h.result}ee=n.get(te),P=ee.encoder,h=d.get(P),typeof h!=`string`&&(h=P.encode(e),d.set(P,h));for(let e=0;e<ne.length;e++){var g=ne[e].doc;if(!g||(g=ve(g,te),!g))continue;var _=g.trim().split(/\s+/);if(!_.length)continue;g=``;var v=[];let t=[];for(var y=-1,b=-1,x=0,S=0;S<_.length;S++){var C=_[S],w=P.encode(C);w=w.length>1?w.join(` `):w[0];let e;if(w&&C){for(var T=C.length,E=(P.split?C.replace(P.split,``):C).length-w.length,D=``,O=0,k=0;k<h.length;k++){var A=h[k];if(A){var j=A.length;j+=E<0?0:E,O&&j<=O||(A=w.indexOf(A),A>-1&&(D=(A?C.substring(0,A):``)+o+C.substring(A,A+j)+s+(A+j<T?C.substring(A+j):``),O=j,e=!0))}}D&&(c&&(y<0&&(y=g.length+ +!!g),b=g.length+ +!!g+D.length,x+=T,t.push(v.length),v.push({match:D})),g+=(g?` `:``)+D)}if(!e)C=_[S],g+=(g?` `:``)+C,c&&v.push({text:C});else if(c&&x>=c)break}if(x=t.length*(a.length-2),p||m||c&&g.length-x>c)if(x=c+x-f*2,S=b-y,p>0&&(S+=p),m>0&&(S+=m),S<=x)_=p?y-(p>0?p:0):y-((x-S)/2|0),v=m?b+(m>0?m:0):_+x,l||(_>0&&g.charAt(_)!==` `&&g.charAt(_-1)!==` `&&(_=g.indexOf(` `,_),_<0&&(_=0)),v<g.length&&g.charAt(v-1)!==` `&&g.charAt(v)!==` `&&(v=g.lastIndexOf(` `,v),v<b?v=b:++v)),g=(_?i:``)+g.substring(_,v)+(v<g.length?i:``);else{for(b=[],y={},x={},S={},C={},w={},D=E=T=0,k=O=1;;){var M=void 0;for(let e=0,n;e<t.length;e++){if(n=t[e],D)if(E!==D){if(S[e+1])continue;if(n+=D,y[n]){T-=f,x[e+1]=1,S[e+1]=1;continue}if(n>=v.length-1){if(n>=v.length){S[e+1]=1,n>=_.length&&(x[e+1]=1);continue}T-=f}if(g=v[n].text,j=m&&w[e])if(j>0){if(g.length>j)if(S[e+1]=1,l)g=g.substring(0,j);else continue;(j-=g.length)||(j=-1),w[e]=j}else{S[e+1]=1;continue}if(T+g.length+1<=c)g=` `+g,b[e]+=g;else if(l)M=c-T-1,M>0&&(g=` `+g.substring(0,M),b[e]+=g),S[e+1]=1;else{S[e+1]=1;continue}}else{if(S[e])continue;if(n-=E,y[n]){T-=f,S[e]=1,x[e]=1;continue}if(n<=0){if(n<0){S[e]=1,x[e]=1;continue}T-=f}if(g=v[n].text,j=p&&C[e])if(j>0){if(g.length>j)if(S[e]=1,l)g=g.substring(g.length-j);else continue;(j-=g.length)||(j=-1),C[e]=j}else{S[e]=1;continue}if(T+g.length+1<=c)g+=` `,b[e]=g+b[e];else if(l)M=g.length+1-(c-T),M>=0&&M<g.length&&(g=g.substring(M)+` `,b[e]=g+b[e]),S[e]=1;else{S[e]=1;continue}}else{g=v[n].match,p&&(C[e]=p),m&&(w[e]=m),e&&T++;let t;if(n?!e&&f&&(T+=f):(x[e]=1,S[e]=1),n>=_.length-1||n<v.length-1&&v[n+1].match?t=1:f&&(T+=f),T-=a.length-2,!e||T+g.length<=c)b[e]=g;else{M=O=k=x[e]=0;break}t&&(x[e+1]=1,S[e+1]=1)}T+=g.length,M=y[n]=1}if(M)E===D?D++:E++;else{if(E===D?O=0:k=0,!O&&!k)break;O?(E++,D=E):D++}}g=``;for(let e=0,t;e<b.length;e++)t=(x[e]?e?` `:``:(e&&!i?` `:``)+i)+b[e],g+=t;i&&!x[b.length]&&(g+=i)}u&&(g=g.replace(u,` `)),ne[e].highlight=g}if(r)break}return t}function B(e,t){if(!this||this.constructor!==B)return new B(e,t);let n=0,r,i,a,o,s,c;if(e&&e.index){let r=e;if(t=r.index,n=r.boost||0,i=r.query){a=r.field||r.pluck,o=r.highlight;let n=r.resolve;e=r.async||r.queue,r.resolve=!1,r.index=null,e=e?t.searchAsync(r):t.search(r),r.resolve=n,r.index=t,e=e.result||e}else e=[]}if(e&&e.then){let t=this;e=e.then(function(e){t.C[0]=t.result=e.result||e,lt(t)}),r=[e],e=[],s=new Promise(function(e){c=e})}this.index=t||null,this.result=e||[],this.h=n,this.C=r||[],this.await=s||null,this.return=c||null,this.highlight=o||null,this.query=i||``,this.field=a||``}I=B.prototype,I.limit=function(e){if(this.await){let t=this;this.C.push(function(){return t.limit(e).result})}else if(this.result.length){let t=[];for(let n=0,r;n<this.result.length;n++)if(r=this.result[n])if(r.length<=e){if(t[n]=r,e-=r.length,!e)break}else{t[n]=r.slice(0,e);break}this.result=t}return this},I.offset=function(e){if(this.await){let t=this;this.C.push(function(){return t.offset(e).result})}else if(this.result.length){let t=[];for(let n=0,r;n<this.result.length;n++)(r=this.result[n])&&(r.length<=e?e-=r.length:(t[n]=r.slice(e),e=0));this.result=t}return this},I.boost=function(e){if(this.await){let t=this;this.C.push(function(){return t.boost(e).result})}else this.h+=e;return this};function lt(e,t){let n=e.result;var r=e.await;e.await=null;for(let t=0,i;t<e.C.length;t++)if(i=e.C[t]){if(typeof i==`function`)n=i(),e.C[t]=n=n.result||n,t--;else if(i.h)n=i.h(),e.C[t]=n=n.result||n,t--;else if(i.then)return e.await=r}return r=e.return,e.C=[],e.return=null,t||r(n),n}I.resolve=function(e,t,n,r,i){let a=this.await?lt(this,!0):this.result;if(a.then){let o=this;return a.then(function(){return o.resolve(e,t,n,r,i)})}return a.length&&(typeof e==`object`?(r=e.highlight||this.highlight,n=!!r||e.enrich,t=e.offset,e=e.limit):(r||=this.highlight,n=!!r||n),a=i?n?ht.call(this.index,a):a:tt.call(this.index,a,e||100,t,n)),this.finalize(a,r)},I.finalize=function(e,t){if(e.then){let n=this;return e.then(function(e){return n.finalize(e,t)})}t&&e.length&&this.query&&(e=ct(this.query,e,this.index.index,this.field,t));let n=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field=``,n&&n(e),e};function ut(e,t,n,r,i,a,o){let s=e.length,c=[],l,u;l=R();for(let d=0,f,p,m,h;d<t;d++)for(let t=0;t<s;t++)if(m=e[t],d<m.length&&(f=m[d]))for(let e=0;e<f.length;e++){if(p=f[e],(u=l[p])?l[p]++:(u=0,l[p]=1),h=c[u]||(c[u]=[]),!o){let e=d+(t||!i?0:a||0);h=h[e]||(h[e]=[])}if(h.push(p),o&&n&&u===s-1&&h.length-r===n)return r?h.slice(r):h}if(e=c.length)if(i)c=c.length>1?dt(c,n,r,o,a):(c=c[0])&&n&&c.length>n||r?c.slice(r,n+r):c;else{if(e<s)return[];if(c=c[e-1],n||r)if(o)(c.length>n||r)&&(c=c.slice(r,n+r));else{i=[];for(let e=0,t;e<c.length;e++)if(t=c[e]){if(r&&t.length>r)r-=t.length;else if((n&&t.length>n||r)&&(t=t.slice(r,n+r),n-=t.length,r&&(r-=t.length)),i.push(t),!n)break}c=i}}return c}function dt(e,t,n,r,i){let a=[],o=R(),s;var c=e.length;let l;if(r){for(i=c-1;i>=0;i--)if(l=(r=e[i])&&r.length){for(c=0;c<l;c++)if(s=r[c],!o[s]){if(o[s]=1,n)n--;else if(a.push(s),a.length===t)return a}}}else for(let u=c-1,d,f=0;u>=0;u--){d=e[u];for(let e=0;e<d.length;e++)if(l=(r=d[e])&&r.length){for(let d=0;d<l;d++)if(s=r[d],!o[s])if(o[s]=1,n)n--;else{let n=(e+(u<c-1&&i||0))/(u+1)|0;if((a[n]||(a[n]=[])).push(s),++f===t)return a}}}return a}function ft(e,t,n,r,i){let a=R(),o=[];for(let e=0,n;e<t.length;e++){n=t[e];for(let e=0;e<n.length;e++)a[n[e]]=1}if(i){for(let t=0,i;t<e.length;t++)if(i=e[t],a[i]){if(r)r--;else if(o.push(i),a[i]=0,n&&--n===0)break}}else for(let n=0,r,i;n<e.result.length;n++)for(r=e.result[n],t=0;t<r.length;t++)i=r[t],a[i]&&((o[n]||(o[n]=[])).push(i),a[i]=0);return o}gt.prototype.search=function(e,t,n,r){n||(!t&&_e(e)?(n=e,e=``):_e(t)&&(n=t,t=0));let i=[];var a=[];let o,s,c,l,u,d,f=0,p=!0,m;if(n){n.constructor===Array&&(n={index:n}),e=n.query||e,o=n.pluck,s=n.merge,l=n.boost,d=o||n.field||(d=n.index)&&(d.index?null:d);var h=this.tag&&n.tag;c=n.suggest,p=n.resolve!==!1,u=n.cache,m=p&&this.store&&n.highlight;var g=!!m||p&&this.store&&n.enrich;t=n.limit||t;var _=n.offset||0;if(t||=p?100:0,h&&(!this.db||!r)){h.constructor!==Array&&(h=[h]);var v=[];for(let e=0,t;e<h.length;e++)if(t=h[e],t.field&&t.tag){var y=t.tag;if(y.constructor===Array)for(var b=0;b<y.length;b++)v.push(t.field,y[b]);else v.push(t.field,y)}else{y=Object.keys(t);for(let e=0,n,r;e<y.length;e++)if(n=y[e],r=t[n],r.constructor===Array)for(b=0;b<r.length;b++)v.push(n,r[b]);else v.push(n,r)}if(h=v,!e){if(a=[],v.length)for(h=0;h<v.length;h+=2){if(this.db){if(r=this.index.get(v[h]),!r)continue;a.push(r=r.db.tag(v[h+1],t,_,g))}else r=mt.call(this,v[h],v[h+1],t,_,g);i.push(p?{field:v[h],tag:v[h+1],result:r}:[r])}if(a.length){let e=this;return Promise.all(a).then(function(t){for(let e=0;e<t.length;e++)p?i[e].result=t[e]:i[e]=t[e];return p?i:new B(i.length>1?ut(i,1,0,0,c,l):i[0],e)})}return p?i:new B(i.length>1?ut(i,1,0,0,c,l):i[0],this)}}p||o||!(d||=this.field)||(ge(d)?o=d:(d.constructor===Array&&d.length===1&&(d=d[0]),o=d.field||d.index)),d&&d.constructor!==Array&&(d=[d])}d||=this.field;let x;v=(this.worker||this.db)&&!r&&[];for(let o=0,s,l,C;o<d.length;o++){if(l=d[o],this.db&&this.tag&&!this.B[o])continue;let w;if(ge(l)||(w=l,l=w.field,e=w.query||e,t=he(w.limit,t),_=he(w.offset,_),c=he(w.suggest,c),m=p&&this.store&&he(w.highlight,m),g=!!m||p&&this.store&&he(w.enrich,g),u=he(w.cache,u)),r)s=r[o];else{y=w||n||{},b=y.enrich;var S=this.index.get(l);if(h&&(this.db&&(y.tag=h,y.field=d,x=S.db.support_tag_search),!x&&b&&(y.enrich=!1),x||(y.limit=0,y.offset=0)),s=u?S.searchCache(e,h&&!x?0:t,y):S.search(e,h&&!x?0:t,y),h&&!x&&(y.limit=t,y.offset=_),b&&(y.enrich=b),v){v[o]=s;continue}}if(C=(s=s.result||s)&&s.length,h&&C){if(y=[],b=0,this.db&&r){if(!x)for(S=d.length;S<r.length;S++){let e=r[S];if(e&&e.length)b++,y.push(e);else if(!c)return p?i:new B(i,this)}}else for(let e=0,t,n;e<h.length;e+=2){if(t=this.tag.get(h[e]),!t){if(c)continue;return p?i:new B(i,this)}if((t&&=t.get(h[e+1]))&&t.length)b++,y.push(t);else if(!c)return p?i:new B(i,this)}if(b){if(s=ft(s,y,t,_,p),C=s.length,!C&&!c)return p?s:new B(s,this);b--}}if(C)a[f]=l,i.push(s),f++;else if(d.length===1)return p?i:new B(i,this)}if(v){if(this.db&&h&&h.length&&!x)for(g=0;g<h.length;g+=2){if(a=this.index.get(h[g]),!a){if(c)continue;return p?i:new B(i,this)}v.push(a.db.tag(h[g+1],t,_,!1))}let r=this;return Promise.all(v).then(function(i){return n&&(n.resolve=p),i.length&&(i=r.search(e,t,n,i)),i})}if(!f)return p?i:new B(i,this);if(o&&(!g||!this.store))return i=i[0],p?i:new B(i,this);for(v=[],_=0;_<a.length;_++){if(h=i[_],g&&h.length&&h[0].doc===void 0&&(this.db?v.push(h=this.index.get(this.field[0]).db.enrich(h)):h=ht.call(this,h)),o)return p?m?ct(e,h,this.index,o,m):h:new B(h,this);i[_]={field:a[_],result:h}}if(g&&this.db&&v.length){let t=this;return Promise.all(v).then(function(n){for(let e=0;e<n.length;e++)i[e].result=n[e];return m&&(i=ct(e,i,t.index,o,m)),s?pt(i):i})}return m&&(i=ct(e,i,this.index,o,m)),s?pt(i):i};function pt(e){let t=[],n=R(),r=R();for(let i=0,a,o,s,c,l,u,d;i<e.length;i++){a=e[i],o=a.field,s=a.result;for(let e=0;e<s.length;e++)l=s[e],typeof l==`object`?c=l.id:l={id:c=l},(u=n[c])?u.push(o):(l.field=n[c]=[o],t.push(l)),(d=l.highlight)&&(u=r[c],u||(r[c]=u={},l.highlight=u),u[o]=d)}return t}function mt(e,t,n,r,i){return e=this.tag.get(e),!e||(e=e.get(t),!e)?[]:(t=e.length-r,t>0&&((n&&t>n||r)&&(e=e.slice(r,r+n)),i&&(e=ht.call(this,e))),e)}function ht(e){if(!this||!this.store)return e;if(this.db)return this.index.get(this.field[0]).db.enrich(e);let t=Array(e.length);for(let n=0,r;n<e.length;n++)r=e[n],t[n]={id:r,doc:this.store.get(r)};return t}function gt(e){if(!this||this.constructor!==gt)return new gt(e);let t=e.document||e.doc||e,n,r;if(this.B=[],this.field=[],this.D=[],this.key=(n=t.key||t.id)&&vt(n,this.D)||`id`,(r=e.keystore||0)&&(this.keystore=r),this.fastupdate=!!e.fastupdate,this.reg=!this.fastupdate||e.worker||e.db?r?new Le(r):new Set:r?new z(r):new Map,this.h=(n=t.store||null)&&n&&n!==!0&&[],this.store=n?r?new z(r):new Map:null,this.cache=(n=e.cache||null)&&new De(n),e.cache=!1,this.worker=e.worker||!1,this.priority=e.priority||4,this.index=_t.call(this,e,t),this.tag=null,(n=t.tag)&&(typeof n==`string`&&(n=[n]),n.length)){this.tag=new Map,this.A=[],this.F=[];for(let e=0,t,r;e<n.length;e++){if(t=n[e],r=t.field||t,!r)throw Error(`The tag field from the document descriptor is undefined.`);t.custom?this.A[e]=t.custom:(this.A[e]=vt(r,this.D),t.filter&&(typeof this.A[e]==`string`&&(this.A[e]=new String(this.A[e])),this.A[e].G=t.filter)),this.F[e]=r,this.tag.set(r,new Map)}}if(this.worker){this.fastupdate=!1,e=[];for(let t of this.index.values())t.then&&e.push(t);if(e.length){let t=this;return Promise.all(e).then(function(e){let n=0;for(let r of t.index.entries()){let i=r[0],a=r[1];a.then&&(a=e[n],t.index.set(i,a),n++)}return t})}}else e.db&&(this.fastupdate=!1,this.mount(e.db))}I=gt.prototype,I.mount=function(e){let t=this.field;if(this.tag)for(let e=0,r;e<this.F.length;e++){r=this.F[e];var n=void 0;this.index.set(r,n=new Lt({},this.reg)),t===this.field&&(t=t.slice(0)),t.push(r),n.tag=this.tag.get(r)}n=[];let r={db:e.db,type:e.type,fastupdate:e.fastupdate};for(let i=0,a,o;i<t.length;i++){r.field=o=t[i],a=this.index.get(o);let s=new e.constructor(e.id,r);s.id=e.id,n[i]=s.mount(a),a.document=!0,i?a.bypass=!0:a.store=this.store}let i=this;return this.db=Promise.all(n).then(function(){i.db=!0})},I.commit=async function(){let e=[];for(let t of this.index.values())e.push(t.commit());await Promise.all(e),this.reg.clear()},I.destroy=function(){let e=[];for(let t of this.index.values())e.push(t.destroy());return Promise.all(e)};function _t(e,t){let n=new Map,r=t.index||t.field||t;ge(r)&&(r=[r]);for(let t=0,a,o;t<r.length;t++){if(a=r[t],ge(a)||(o=a,a=a.field),o=_e(o)?Object.assign({},e,o):e,this.worker){var i=void 0;i=(i=o.encoder)&&i.encode?i:new we(typeof i==`string`?Pe[i]:i||{}),i=new Xe(o,i),n.set(a,i)}this.worker||n.set(a,new Lt(o,this.reg)),o.custom?this.B[t]=o.custom:(this.B[t]=vt(a,this.D),o.filter&&(typeof this.B[t]==`string`&&(this.B[t]=new String(this.B[t])),this.B[t].G=o.filter)),this.field[t]=a}if(this.h){e=t.store,ge(e)&&(e=[e]);for(let t=0,n,r;t<e.length;t++)n=e[t],r=n.field||n,n.custom?(this.h[t]=n.custom,n.custom.O=r):(this.h[t]=vt(r,this.D),n.filter&&(typeof this.h[t]==`string`&&(this.h[t]=new String(this.h[t])),this.h[t].G=n.filter))}return n}function vt(e,t){let n=e.split(`:`),r=0;for(let i=0;i<n.length;i++)e=n[i],e[e.length-1]===`]`&&(e=e.substring(0,e.length-2))&&(t[r]=!0),e&&(n[r++]=e);return r<n.length&&(n.length=r),r>1?n:n[0]}I.append=function(e,t){return this.add(e,t,!0)},I.update=function(e,t){return this.remove(e).add(e,t)},I.remove=function(e){_e(e)&&(e=ve(e,this.key));for(var t of this.index.values())t.remove(e,!0);if(this.reg.has(e)){if(this.tag&&!this.fastupdate)for(let n of this.tag.values())for(let r of n){t=r[0];let i=r[1],a=i.indexOf(e);a>-1&&(i.length>1?i.splice(a,1):n.delete(t))}this.store&&this.store.delete(e),this.reg.delete(e)}return this.cache&&this.cache.remove(e),this},I.clear=function(){let e=[];for(let t of this.index.values()){let n=t.clear();n.then&&e.push(n)}if(this.tag)for(let e of this.tag.values())e.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),e.length?Promise.all(e):this},I.contain=function(e){return this.db?this.index.get(this.field[0]).db.has(e):this.reg.has(e)},I.cleanup=function(){for(let e of this.index.values())e.cleanup();return this},I.get=function(e){return this.db?this.index.get(this.field[0]).db.enrich(e).then(function(e){return e[0]&&e[0].doc||null}):this.store.get(e)||null},I.set=function(e,t){return typeof e==`object`&&(t=e,e=ve(t,this.key)),this.store.set(e,t),this},I.searchCache=Ee,I.export=Et,I.import=Dt,Ue(gt.prototype);function yt(e,t=0){let n=[],r=[];t&&=25e4/t*5e3|0;for(let i of e.entries())r.push(i),r.length===t&&(n.push(r),r=[]);return r.length&&n.push(r),n}function bt(e,t){t||=new Map;for(let n=0,r;n<e.length;n++)r=e[n],t.set(r[0],r[1]);return t}function xt(e,t=0){let n=[],r=[];t&&=25e4/t*1e3|0;for(let i of e.entries())r.push([i[0],yt(i[1])[0]||[]]),r.length===t&&(n.push(r),r=[]);return r.length&&n.push(r),n}function St(e,t){t||=new Map;for(let n=0,r,i;n<e.length;n++)r=e[n],i=t.get(r[0]),t.set(r[0],bt(r[1],i));return t}function Ct(e){let t=[],n=[];for(let r of e.keys())n.push(r),n.length===25e4&&(t.push(n),n=[]);return n.length&&t.push(n),t}function wt(e,t){t||=new Set;for(let n=0;n<e.length;n++)t.add(e[n]);return t}function Tt(e,t,n,r,i,a,o=0){let s=r&&r.constructor===Array;var c=s?r.shift():r;if(!c)return this.export(e,t,i,a+1);if((c=e((t?t+`.`:``)+(o+1)+`.`+n,JSON.stringify(c)))&&c.then){let l=this;return c.then(function(){return Tt.call(l,e,t,n,s?r:null,i,a,o+1)})}return Tt.call(this,e,t,n,s?r:null,i,a,o+1)}function Et(e,t,n=0,r=0){if(n<this.field.length){let i=this.field[n];if((t=this.index.get(i).export(e,i,n,r=1))&&t.then){let r=this;return t.then(function(){return r.export(e,i,n+1)})}return this.export(e,i,n+1)}let i,a;switch(r){case 0:i=`reg`,a=Ct(this.reg),t=null;break;case 1:i=`tag`,a=this.tag&&xt(this.tag,this.reg.size),t=null;break;case 2:i=`doc`,a=this.store&&yt(this.store),t=null;break;default:return}return Tt.call(this,e,t,i,a||null,n,r)}function Dt(e,t){var n=e.split(`.`);n[n.length-1]===`json`&&n.pop();let r=n.length>2?n[0]:``;if(n=n.length>2?n[2]:n[1],this.worker&&r)return this.index.get(r).import(e);if(t){if(typeof t==`string`&&(t=JSON.parse(t)),r)return this.index.get(r).import(n,t);switch(n){case`reg`:this.fastupdate=!1,this.reg=wt(t,this.reg);for(let e=0,t;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){t=[];for(let n of this.index.values())t.push(n.import(e));return Promise.all(t)}break;case`tag`:this.tag=St(t,this.tag);break;case`doc`:this.store=bt(t,this.store)}}}function Ot(e,t){let n=``;for(let r of e.entries()){e=r[0];let i=r[1],a=``;for(let e=0,n;e<i.length;e++){n=i[e]||[``];let r=``;for(let e=0;e<n.length;e++)r+=(r?`,`:``)+(t===`string`?`"`+n[e]+`"`:n[e]);r=`[`+r+`]`,a+=(a?`,`:``)+r}a=`["`+e+`",[`+a+`]]`,n+=(n?`,`:``)+a}return n}Lt.prototype.remove=function(e,t){let n=this.reg.size&&(this.fastupdate?this.reg.get(e):this.reg.has(e));if(n){if(this.fastupdate){for(let t=0,r,i;t<n.length;t++)if((r=n[t])&&(i=r.length))if(r[i-1]===e)r.pop();else{let t=r.indexOf(e);t>=0&&r.splice(t,1)}}else kt(this.map,e),this.depth&&kt(this.ctx,e);t||this.reg.delete(e)}return this.db&&(this.commit_task.push({del:e}),this.M&&Rt(this)),this.cache&&this.cache.remove(e),this};function kt(e,t){let n=0;var r=t===void 0;if(e.constructor===Array){for(let i=0,a,o,s;i<e.length;i++)if((a=e[i])&&a.length){if(r)return 1;if(o=a.indexOf(t),o>=0){if(a.length>1)return a.splice(o,1),1;if(delete e[i],n)return 1;s=1}else{if(s)return 1;n++}}}else for(let i of e.entries())r=i[0],kt(i[1],t)?n++:e.delete(r);return n}var At={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:`forward`},score:{resolution:9,context:{depth:2,resolution:3}}};Lt.prototype.add=function(e,t,n,r){if(t&&(e||e===0)){if(!r&&!n&&this.reg.has(e))return this.update(e,t);r=this.depth,t=this.encoder.encode(t,!r);let l=t.length;if(l){let u=R(),d=R(),f=this.resolution;for(let p=0;p<l;p++){let m=t[this.rtl?l-1-p:p];var i=m.length;if(i&&(r||!d[m])){var a=this.score?this.score(t,m,p,null,0):Mt(f,l,p),o=``;switch(this.tokenize){case`tolerant`:if(jt(this,d,m,a,e,n),i>2){for(let t=1,r,s,c,l;t<i-1;t++)r=m.charAt(t),s=m.charAt(t+1),c=m.substring(0,t)+s,l=m.substring(t+2),o=c+r+l,jt(this,d,o,a,e,n),o=c+l,jt(this,d,o,a,e,n);jt(this,d,m.substring(0,m.length-1),a,e,n)}break;case`full`:if(i>2){for(let r=0,c;r<i;r++)for(a=i;a>r;a--){o=m.substring(r,a),c=this.rtl?i-1-r:r;var s=this.score?this.score(t,m,p,o,c):Mt(f,l,p,i,c);jt(this,d,o,s,e,n)}break}case`bidirectional`:case`reverse`:if(i>1){for(s=i-1;s>0;s--){o=m[this.rtl?i-1-s:s]+o;var c=this.score?this.score(t,m,p,o,s):Mt(f,l,p,i,s);jt(this,d,o,c,e,n)}o=``}case`forward`:if(i>1){for(s=0;s<i;s++)o+=m[this.rtl?i-1-s:s],jt(this,d,o,a,e,n);break}default:if(jt(this,d,m,a,e,n),r&&l>1&&p<l-1)for(i=this.N,o=m,a=Math.min(r+1,this.rtl?p+1:l-p),s=1;s<a;s++){m=t[this.rtl?l-1-p-s:p+s],c=this.bidirectional&&m>o;let r=this.score?this.score(t,o,p,m,s-1):Mt(i+(l/2>i?0:1),l,p,a-1,s-1);jt(this,u,c?o:m,r,e,n,c?m:o)}}}}this.fastupdate||this.reg.add(e)}}return this.db&&(this.commit_task.push(n?{ins:e}:{del:e}),this.M&&Rt(this)),this};function jt(e,t,n,r,i,a,o){let s,c;if(!(s=t[n])||o&&!s[o]){if(o?(t=s||(t[n]=R()),t[o]=1,c=e.ctx,(s=c.get(o))?c=s:c.set(o,c=e.keystore?new z(e.keystore):new Map)):(c=e.map,t[n]=1),(s=c.get(n))?c=s:c.set(n,c=s=[]),a){for(let n=0,a;n<s.length;n++)if((a=s[n])&&a.includes(i)){if(n<=r)return;a.splice(a.indexOf(i),1),e.fastupdate&&(t=e.reg.get(i))&&t.splice(t.indexOf(a),1);break}}if(c=c[r]||(c[r]=[]),c.push(i),c.length===2**31-1){if(t=new Ie(c),e.fastupdate)for(let n of e.reg.values())n.includes(c)&&(n[n.indexOf(c)]=t);s[r]=c=t}e.fastupdate&&((r=e.reg.get(i))?r.push(c):e.reg.set(i,[c]))}}function Mt(e,t,n,r,i){return n&&e>1?t+(r||0)<=e?n+(i||0):(e-1)/(t+(r||0))*(n+(i||0))+1|0:0}Lt.prototype.search=function(e,t,n){if(n||(t||typeof e!=`object`?typeof t==`object`&&(n=t,t=0):(n=e,e=``)),n&&n.cache)return n.cache=!1,e=this.searchCache(e,t,n),n.cache=!0,e;let r=[],i,a,o,s=0,c,l,u,d,f;n&&(e=n.query||e,t=n.limit||t,s=n.offset||0,a=n.context,o=n.suggest,f=(c=n.resolve)&&n.enrich,u=n.boost,d=n.resolution,l=this.db&&n.tag),c===void 0&&(c=this.resolve),a=this.depth&&a!==!1;let p=this.encoder.encode(e,!a);if(i=p.length,t||=c?100:0,i===1)return Pt.call(this,p[0],``,t,s,c,f,l);if(i===2&&a&&!o)return Pt.call(this,p[1],p[0],t,s,c,f,l);let m=R(),h=0,g;if(a&&(g=p[0],h=1),d||d===0||(d=g?this.N:this.resolution),this.db){if(this.db.search&&(n=this.db.search(this,p,t,s,o,c,f,l),n!==!1))return n;let e=this;return async function(){for(let t,n;h<i;h++){if((n=p[h])&&!m[n]){if(m[n]=1,t=await It(e,n,g,0,0,!1,!1),t=Ft(t,r,o,d)){r=t;break}g&&(o&&t&&r.length||(g=n))}o&&g&&h===i-1&&!r.length&&(d=e.resolution,g=``,h=-1,m=R())}return Nt(r,d,t,s,o,u,c)}()}for(let e,t;h<i;h++){if((t=p[h])&&!m[t]){if(m[t]=1,e=It(this,t,g,0,0,!1,!1),e=Ft(e,r,o,d)){r=e;break}g&&(o&&e&&r.length||(g=t))}o&&g&&h===i-1&&!r.length&&(d=this.resolution,g=``,h=-1,m=R())}return Nt(r,d,t,s,o,u,c)};function Nt(e,t,n,r,i,a,o){let s=e.length,c=e;if(s>1)c=ut(e,t,n,r,i,a,o);else if(s===1)return o?tt.call(null,e[0],n,r):new B(e[0],this);return o?c:new B(c,this)}function Pt(e,t,n,r,i,a,o){return e=It(this,e,t,n,r,i,a,o),this.db?e.then(function(e){return i?e||[]:new B(e,this)}):e&&e.length?i?tt.call(this,e,n,r):new B(e,this):i?[]:new B([],this)}function Ft(e,t,n,r){let i=[];if(e&&e.length){if(e.length<=r){t.push(e);return}for(let t=0,n;t<r;t++)(n=e[t])&&(i[t]=n);if(i.length){t.push(i);return}}if(!n)return i}function It(e,t,n,r,i,a,o,s){let c;return n&&(c=e.bidirectional&&t>n)&&(c=n,n=t,t=c),e.db?e.db.get(t,n,r,i,a,o,s):(e=n?(e=e.ctx.get(n))&&e.get(t):e.map.get(t),e)}function Lt(e,t){if(!this||this.constructor!==Lt)return new Lt(e);if(e){var n=ge(e)?e:e.preset;n&&(e=Object.assign({},At[n],e))}else e={};n=e.context;let r=n===!0?{depth:1}:n||{},i=ge(e.encoder)?Pe[e.encoder]:e.encode||e.encoder||{};this.encoder=i.encode?i:typeof i==`object`?new we(i):{encode:i},this.resolution=e.resolution||9,this.tokenize=n=(n=e.tokenize)&&n!=="default"&&n!==`exact`&&n||`strict`,this.depth=n===`strict`&&r.depth||0,this.bidirectional=r.bidirectional!==!1,this.fastupdate=!!e.fastupdate,this.score=e.score||null,(n=e.keystore||0)&&(this.keystore=n),this.map=n?new z(n):new Map,this.ctx=n?new z(n):new Map,this.reg=t||(this.fastupdate?n?new z(n):new Map:n?new Le(n):new Set),this.N=r.resolution||3,this.rtl=i.rtl||e.rtl||!1,this.cache=(n=e.cache||null)&&new De(n),this.resolve=e.resolve!==!1,(n=e.db)&&(this.db=this.mount(n)),this.M=e.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=e.priority||4}I=Lt.prototype,I.mount=function(e){return this.commit_timer&&=(clearTimeout(this.commit_timer),null),e.mount(this)},I.commit=function(){return this.commit_timer&&=(clearTimeout(this.commit_timer),null),this.db.commit(this)},I.destroy=function(){return this.commit_timer&&=(clearTimeout(this.commit_timer),null),this.db.destroy()};function Rt(e){e.commit_timer||=setTimeout(function(){e.commit_timer=null,e.db.commit(e)},1)}I.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},I.append=function(e,t){return this.add(e,t,!0)},I.contain=function(e){return this.db?this.db.has(e):this.reg.has(e)},I.update=function(e,t){let n=this,r=this.remove(e);return r&&r.then?r.then(()=>n.add(e,t)):this.add(e,t)},I.cleanup=function(){return this.fastupdate?(kt(this.map),this.depth&&kt(this.ctx),this):this},I.searchCache=Ee,I.export=function(e,t,n=0,r=0){let i,a;switch(r){case 0:i=`reg`,a=Ct(this.reg);break;case 1:i=`cfg`,a=null;break;case 2:i=`map`,a=yt(this.map,this.reg.size);break;case 3:i=`ctx`,a=xt(this.ctx,this.reg.size);break;default:return}return Tt.call(this,e,t,i,a,n,r)},I.import=function(e,t){if(t)switch(typeof t==`string`&&(t=JSON.parse(t)),e=e.split(`.`),e[e.length-1]===`json`&&e.pop(),e.length===3&&e.shift(),e=e.length>1?e[1]:e[0],e){case`reg`:this.fastupdate=!1,this.reg=wt(t,this.reg);break;case`map`:this.map=bt(t,this.map);break;case`ctx`:this.ctx=St(t,this.ctx)}},I.serialize=function(e=!0){let t=``,n=``,r=``;if(this.reg.size){let e;for(var i of this.reg.keys())e||=typeof i,t+=(t?`,`:``)+(e===`string`?`"`+i+`"`:i);t=`index.reg=new Set([`+t+`]);`,n=Ot(this.map,e),n=`index.map=new Map([`+n+`]);`;for(let t of this.ctx.entries()){i=t[0];let n=Ot(t[1],e);n=`new Map([`+n+`])`,n=`["`+i+`",`+n+`]`,r+=(r?`,`:``)+n}r=`index.ctx=new Map([`+r+`]);`}return e?`function inject(index){`+t+n+r+`}`:t+n+r},Ue(Lt.prototype);var zt=typeof window<`u`&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Bt=[`map`,`ctx`,`tag`,`reg`,`cfg`],Vt=R();function Ht(e,t={}){if(!this||this.constructor!==Ht)return new Ht(e,t);typeof e==`object`&&(t=e,e=e.name),e||console.info(`Default storage space was used, because a name was not passed.`),this.id=`flexsearch`+(e?`:`+e.toLowerCase().replace(/[^a-z0-9_\-]/g,``):``),this.field=t.field?t.field.toLowerCase().replace(/[^a-z0-9_\-]/g,``):``,this.type=t.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}I=Ht.prototype,I.mount=function(e){return e.index?e.mount(this):(e.db=this,this.open())},I.open=function(){if(this.db)return this.db;let e=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Vt[e.id]||(Vt[e.id]=[]),Vt[e.id].push(e.field);let t=zt.open(e.id,1);return t.onupgradeneeded=function(){let t=e.db=this.result;for(let n=0,r;n<Bt.length;n++){r=Bt[n];for(let n=0,i;n<Vt[e.id].length;n++)i=Vt[e.id][n],t.objectStoreNames.contains(r+(r===`reg`?``:i?`:`+i:``))||t.createObjectStore(r+(r===`reg`?``:i?`:`+i:``))}},e.db=Wt(t,function(t){e.db=t,e.db.onversionchange=function(){e.close()}})},I.close=function(){this.db&&this.db.close(),this.db=null},I.destroy=function(){return Wt(zt.deleteDatabase(this.id))},I.clear=function(){let e=[];for(let t=0,n;t<Bt.length;t++){n=Bt[t];for(let t=0,r;t<Vt[this.id].length;t++)r=Vt[this.id][t],e.push(n+(n===`reg`?``:r?`:`+r:``))}let t=this.db.transaction(e,`readwrite`);for(let n=0;n<e.length;n++)t.objectStore(e[n]).clear();return Wt(t)},I.get=function(e,t,n=0,r=0,i=!0,a=!1){e=this.db.transaction((t?`ctx`:`map`)+(this.field?`:`+this.field:``),`readonly`).objectStore((t?`ctx`:`map`)+(this.field?`:`+this.field:``)).get(t?t+`:`+e:e);let o=this;return Wt(e).then(function(e){let t=[];if(!e||!e.length)return t;if(i){if(!n&&!r&&e.length===1)return e[0];for(let i=0,a;i<e.length;i++)if((a=e[i])&&a.length){if(r>=a.length){r-=a.length;continue}let e=n?r+Math.min(a.length-r,n):a.length;for(let n=r;n<e;n++)t.push(a[n]);if(r=0,t.length===n)break}return a?o.enrich(t):t}return e})},I.tag=function(e,t=0,n=0,r=!1){e=this.db.transaction(`tag`+(this.field?`:`+this.field:``),`readonly`).objectStore(`tag`+(this.field?`:`+this.field:``)).get(e);let i=this;return Wt(e).then(function(e){return!e||!e.length||n>=e.length?[]:!t&&!n?e:(e=e.slice(n,n+t),r?i.enrich(e):e)})},I.enrich=function(e){typeof e!=`object`&&(e=[e]);let t=this.db.transaction(`reg`,`readonly`).objectStore(`reg`),n=[];for(let r=0;r<e.length;r++)n[r]=Wt(t.get(e[r]));return Promise.all(n).then(function(t){for(let n=0;n<t.length;n++)t[n]={id:e[n],doc:t[n]?JSON.parse(t[n]):null};return t})},I.has=function(e){return e=this.db.transaction(`reg`,`readonly`).objectStore(`reg`).getKey(e),Wt(e).then(function(e){return!!e})},I.search=null,I.info=function(){},I.transaction=function(e,t,n){e+=e===`reg`?``:this.field?`:`+this.field:``;let r=this.h[e+`:`+t];if(r)return n.call(this,r);let i=this.db.transaction(e,t);this.h[e+`:`+t]=r=i.objectStore(e);let a=n.call(this,r);return this.h[e+`:`+t]=null,Wt(i).finally(function(){return a})},I.commit=async function(e){let t=e.commit_task,n=[];e.commit_task=[];for(let e=0,r;e<t.length;e++)r=t[e],r.del&&n.push(r.del);n.length&&await this.remove(n),e.reg.size&&(await this.transaction(`map`,`readwrite`,function(t){for(let n of e.map){let e=n[0],r=n[1];r.length&&(t.get(e).onsuccess=function(){let n=this.result;var i;if(n&&n.length){let e=Math.max(n.length,r.length);for(let t=0,a,o;t<e;t++)if((o=r[t])&&o.length){if((a=n[t])&&a.length)for(i=0;i<o.length;i++)a.push(o[i]);else n[t]=o;i=1}}else n=r,i=1;i&&t.put(n,e)})}}),await this.transaction(`ctx`,`readwrite`,function(t){for(let n of e.ctx){let e=n[0],r=n[1];for(let n of r){let r=n[0],i=n[1];i.length&&(t.get(e+`:`+r).onsuccess=function(){let n=this.result;var a;if(n&&n.length){let e=Math.max(n.length,i.length);for(let t=0,r,o;t<e;t++)if((o=i[t])&&o.length){if((r=n[t])&&r.length)for(a=0;a<o.length;a++)r.push(o[a]);else n[t]=o;a=1}}else n=i,a=1;a&&t.put(n,e+`:`+r)})}}}),e.store?await this.transaction(`reg`,`readwrite`,function(t){for(let n of e.store){let e=n[0],r=n[1];t.put(typeof r==`object`?JSON.stringify(r):1,e)}}):e.bypass||await this.transaction(`reg`,`readwrite`,function(t){for(let n of e.reg.keys())t.put(1,n)}),e.tag&&await this.transaction(`tag`,`readwrite`,function(t){for(let n of e.tag){let e=n[0],r=n[1];r.length&&(t.get(e).onsuccess=function(){let n=this.result;n=n&&n.length?n.concat(r):r,t.put(n,e)})}}),e.map.clear(),e.ctx.clear(),e.tag&&e.tag.clear(),e.store&&e.store.clear(),e.document||e.reg.clear())};function Ut(e,t,n){let r=e.value,i,a=0;for(let e=0,o;e<r.length;e++){if(o=n?r:r[e]){for(let n=0,a,s;n<t.length;n++)if(s=t[n],a=o.indexOf(s),a>=0)if(i=1,o.length>1)o.splice(a,1);else{r[e]=[];break}a+=o.length}if(n)break}a?i&&e.update(r):e.delete(),e.continue()}I.remove=function(e){return typeof e!=`object`&&(e=[e]),Promise.all([this.transaction(`map`,`readwrite`,function(t){t.openCursor().onsuccess=function(){let t=this.result;t&&Ut(t,e)}}),this.transaction(`ctx`,`readwrite`,function(t){t.openCursor().onsuccess=function(){let t=this.result;t&&Ut(t,e)}}),this.transaction(`tag`,`readwrite`,function(t){t.openCursor().onsuccess=function(){let t=this.result;t&&Ut(t,e,!0)}}),this.transaction(`reg`,`readwrite`,function(t){for(let n=0;n<e.length;n++)t.delete(e[n])})])};function Wt(e,t){return new Promise((n,r)=>{e.onsuccess=e.oncomplete=function(){t&&t(this.result),t=null,n(this.result)},e.onerror=e.onblocked=r,e=null})}var Gt={Index:Lt,Charset:Pe,Encoder:we,Document:gt,Worker:Xe,Resolver:B,IndexedDB:Ht,Language:{}},Kt=Pe,qt={finalize:e=>{let t=[];for(let n of e)t.push(...Yt(n));return t}};function Jt(e){return e>=19968&&e<=40959||e>=12352&&e<=12543||e>=44032&&e<=55203||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=191471||e>=196608&&e<=205743||e>=191472&&e<=192095||e>=63744&&e<=64255||e>=194560&&e<=195103}function Yt(e){let t=[],n=``;for(let r of e)Jt(r.codePointAt(0))?(n&&=(t.push(n),``),t.push(r)):n+=r;return n&&t.push(n),t}var Xt=new Gt.Encoder(Kt.Default,qt),Zt=class{constructor({adminUrl:e,apiKey:t,dir:n}){let r=n===`rtl`?`reverse`:`forward`;this.apiUrl=e,this.apiKey=t,this.postsIndex=new Gt.Document({tokenize:r,document:{id:`id`,index:[`title`,`excerpt`],store:!0},encoder:Xt}),this.authorsIndex=new Gt.Document({tokenize:r,document:{id:`id`,index:[`name`],store:!0},encoder:Xt}),this.tagsIndex=new Gt.Document({tokenize:r,document:{id:`id`,index:[`name`],store:!0},encoder:Xt}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async#e(){let e=await this.#t();e.length>0&&this.#n(e)}async#t(){try{let e=`${this.apiUrl}/ghost/api/content/search-index/posts/?key=${this.apiKey}`;return(await(await fetch(e)).json()).posts}catch(e){return console.error(`Error fetching posts:`,e),[]}}#n(e){e.forEach(e=>{this.postsIndex.add(e)})}async#r(){let e=await this.#i();e.length>0&&this.#a(e)}async#i(){try{let e=`${this.apiUrl}/ghost/api/content/search-index/authors/?key=${this.apiKey}`;return(await(await fetch(e)).json()).authors}catch(e){return console.error(`Error fetching authors:`,e),[]}}#a(e){e.forEach(e=>{this.authorsIndex.add(e)})}async#o(){let e=await this.#s();e.length>0&&this.#c(e)}async#s(){try{let e=`${this.apiUrl}/ghost/api/content/search-index/tags/?key=${this.apiKey}`;return(await(await fetch(e)).json()).tags}catch(e){return console.error(`Error fetching tags:`,e),[]}}#c(e){e.forEach(e=>{this.tagsIndex.add(e)})}async init(){await this.#e(),await this.#r(),await this.#o()}#l(e){let t=[],n={};return e.forEach(e=>{e.result.forEach(e=>{n[e.id]||(t.push(e.doc),n[e.id]=!0)})}),t}search(e){let t=this.postsIndex.search(e,{enrich:!0}),n=this.authorsIndex.search(e,{enrich:!0}),r=this.tagsIndex.search(e,{enrich:!0});return{posts:this.#l(t),authors:this.#l(n),tags:this.#l(r)}}},Qt={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},$t={Authors:`الكتّاب`,Cancel:`إلغاء`,"No matches found":`لا يوجد نتائج مطابقة`,Posts:`منشورات`,"Search posts, tags and authors":`قم بالبحث عن المنشورات، الوسوم و الكتّاب`,"Show more results":`اظهر المزيد من النتائج`,Tags:`الوسوم`},en={Authors:`Автори`,Cancel:`Отказ`,"No matches found":`Няма съвпадения`,Posts:`Публикации`,"Search posts, tags and authors":`Търсене в публикации, етикети и автори`,"Show more results":`Покажи още резултати`,Tags:`Етикети`},tn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},nn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},rn={Authors:`Autors`,Cancel:`Cancel·la`,"No matches found":`No s'ha trobat cap resultat`,Posts:`Articles`,"Search posts, tags and authors":`Cerca articles, etiquetes i autors`,"Show more results":`Mostra més resultats`,Tags:`Etiquetes`},V={Authors:`Autoři`,Cancel:`Zrušit`,"No matches found":`Nenalezeno`,Posts:`Články`,"Search posts, tags and authors":`Prohledat články, štítky a autory`,"Show more results":`Zobrazit více výsledků`,Tags:`Štítky`},an={Authors:`Forfattere`,Cancel:`Annuller`,"No matches found":`Ingen resultater fundet`,Posts:`Indlæg`,"Search posts, tags and authors":`Søg i indlæg, tags og forfattere`,"Show more results":`Vis flere resultater`,Tags:`Tags`},on={Authors:`Autor*innen`,Cancel:`Abbrechen`,"No matches found":`Keine Treffer gefunden`,Posts:`Posts`,"Search posts, tags and authors":`Posts, Tags und Autor*innen durchsuchen`,"Show more results":`Mehr Ergebnisse anzeigen`,Tags:`Tags`},sn={Authors:`Autoren`,Cancel:`Abbrechen`,"No matches found":`Keine Treffer gefunden`,Posts:`Beiträge`,"Search posts, tags and authors":`Nach Posts, Tags und Autoren suchen`,"Show more results":`Mehr Ergebnisse anzeigen`,Tags:`Tags`},cn={Authors:`ΣΥΓΓΡΑΦΕΙΣ`,Cancel:`Ακύρωση`,"No matches found":`Δεν βρέθηκαν αποτελέσματα`,Posts:`ΑΝΑΡΤΗΣΕΙΣ`,"Search posts, tags and authors":`Αναζήτηση αναρτήσεων, ετικετών και συγγραφέων`,"Show more results":`Εμφάνιση περισσότερων αποτελεσμάτων`,Tags:`ΕΤΙΚΕΤΕΣ`},ln={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},un={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},dn={Authors:`Autores`,Cancel:`Cancelar`,"No matches found":`No se encontraron resultados`,Posts:`Publicaciones`,"Search posts, tags and authors":`Buscar publicaciones, etiquetas y autores`,"Show more results":`Mostrar más resultados`,Tags:`Etiquetas`},fn={Authors:`Autorid`,Cancel:`Tühista`,"No matches found":`Vasteid ei leitud`,Posts:`Postitused`,"Search posts, tags and authors":`Otsi postitusi, silte ja autoreid`,"Show more results":`Näita rohkem tulemusi`,Tags:`Sildid`},pn={Authors:`Autoreak`,Cancel:`Utzi`,"No matches found":`Ez da bat datorren ezer topatu`,Posts:`Artikuluak`,"Search posts, tags and authors":`Bilatu artikuluak, etiketak eta autoreak`,"Show more results":`Erakutsi emaitza gehiago`,Tags:`Etiketak`},mn={Authors:`نویسندگان`,Cancel:`لغو`,"No matches found":`موردی یافت نشد`,Posts:`نوشتهها`,"Search posts, tags and authors":`جستوجوی نوشتهها، برچسبها و نویسندگان`,"Show more results":`نمایش نتایج بیشتر`,Tags:`برچسبها`},hn={Authors:`Kirjoittajat`,Cancel:`Peruuta`,"No matches found":`Ei hakutuloksia`,Posts:`Kirjoitukset`,"Search posts, tags and authors":`Etsi kirjoituksia, tunnisteita ja kirjoittajia`,"Show more results":`Näytä enemmän tuloksia`,Tags:`Tunnisteet`},gn={Authors:`Auteurs`,Cancel:`Annuler`,"No matches found":`Aucun résultat trouvé`,Posts:`Articles`,"Search posts, tags and authors":`Rechercher des articles, des catégories et des auteurs`,"Show more results":`Plus de résultats`,Tags:`Catégories`},_n={Authors:`Ùghdaran`,Cancel:`Sguir dheth`,"No matches found":`Cha deach dad a lorg a fhreagras ris na lorg thu`,Posts:`Postaichean`,"Search posts, tags and authors":`Lorg sna postaichean, tagaichean agus ùghdaran`,"Show more results":`Seall barrachd thoraidhean`,Tags:`Tagaichean`},vn={Authors:`מחברים`,Cancel:`ביטול`,"No matches found":`לא נמצאו התאמות`,Posts:`פוסטים`,"Search posts, tags and authors":`חיפוש פוסטים, תגיות ומחברים`,"Show more results":`הצגת תוצאות נוספות`,Tags:`תגיות`},yn={Authors:`लेखक`,Cancel:`रद्द करें`,"No matches found":`कोई मैच नहीं मिला`,Posts:`पोस्ट`,"Search posts, tags and authors":`पोस्ट, टैग और लेखक की तलाश करें`,"Show more results":`और परिणाम दिखाएं`,Tags:`टैग`},bn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},xn={Authors:`Szerzők`,Cancel:`Mégse`,"No matches found":`Nincs találat`,Posts:`Bejegyzések`,"Search posts, tags and authors":`Keresés a bejegyzések, a címkék és a szerzők között`,"Show more results":`További találatok megjelenítése`,Tags:`Címkék`},Sn={Authors:`Penulis`,Cancel:`Batalkan`,"No matches found":`Tidak ada hasil yang ditemukan`,Posts:`Postingan`,"Search posts, tags and authors":`Cari postingan, tag, dan penulis`,"Show more results":`Tampilkan lebih banyak hasil`,Tags:`Tag`},Cn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},wn={Authors:`Autori`,Cancel:`Annulla`,"No matches found":`Nessun risultato trovato`,Posts:`Articoli`,"Search posts, tags and authors":`Cerca articoli, tag e autori`,"Show more results":`Mostra più risultati`,Tags:`Tag`},Tn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},En={Authors:`작성자`,Cancel:`취소`,"No matches found":`일치하는 결과가 없어요`,Posts:`게시물`,"Search posts, tags and authors":`게시물, 태그, 작성자 검색`,"Show more results":`더 많은 결과 보기`,Tags:`태그`},Dn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},On={Authors:`Autoriai`,Cancel:`Atšaukti`,"No matches found":`Atitikmenų nerasta`,Posts:`Įrašai`,"Search posts, tags and authors":`Ieškoti įrašų, žymų ir autorių`,"Show more results":`Rodyti daugiau rezultatų`,Tags:`Žymos`},kn={Authors:`Autori`,Cancel:`Atcelt`,"No matches found":`Nav atrasta neviena atbilstība`,Posts:`Ziņas`,"Search posts, tags and authors":`Meklēt ziņas, atzīmes un autorus`,"Show more results":`Rādīt vairāk rezultātu`,Tags:`Tagi`},An={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},jn={Authors:`Нийтлэгчид`,Cancel:`Цуцлах`,"No matches found":`Тохирох хайлтын үр дүн олдсонгүй`,Posts:`Нийтлэлүүд`,"Search posts, tags and authors":`Нийтлэл, ангилал, нийтлэгчдээр хайх`,"Show more results":`Илүү олон үр дүн харуулах`,Tags:`Ангилалууд`},Mn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Nn={Authors:`Forfattere`,Cancel:`Avbryt`,"No matches found":`Ingen treff funnet`,Posts:`Innlegg`,"Search posts, tags and authors":`Søk i innlegg, etiketter og forfattere`,"Show more results":`Vis flere resultater`,Tags:`Etiketter`},Pn={Authors:`लेखकहरू`,Cancel:`रद्द गर्नुहोस्`,"No matches found":`कुनै परिणाम भेटिएन`,Posts:`पोस्टहरू`,"Search posts, tags and authors":`पोस्टहरू, ट्यागहरू र लेखकहरू खोज्नुहोस्`,"Show more results":`थप परिणामहरू देखाउनुहोस्`,Tags:`ट्यागहरू`},Fn={Authors:`Auteurs`,Cancel:`Annuleren`,"No matches found":`Geen resultaten gevonden`,Posts:`Berichten`,"Search posts, tags and authors":`Zoek berichten, tags en auteurs`,"Show more results":`Meer resultaten weergeven`,Tags:`Tags`},In={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Ln={Authors:`ਲੇਖਕ`,Cancel:`ਰੱਦ ਕਰੋ`,"No matches found":`ਕੋਈ ਮੇਲ ਨਹੀਂ ਮਿਲਿਆ`,Posts:`ਪੋਸਟਾਂ`,"Search posts, tags and authors":`ਪੋਸਟਾਂ, ਟੈਗ ਅਤੇ ਲੇਖਕ ਖੋਜੋ`,"Show more results":`ਹੋਰ ਨਤੀਜੇ ਦਿਖਾਓ`,Tags:`ਟੈਗ`},Rn={Authors:`Autorzy`,Cancel:`Anuluj`,"No matches found":`Nie znaleziono dopasowań`,Posts:`Posty`,"Search posts, tags and authors":`Szukaj postów, tagów lub autorów`,"Show more results":`Pokaż więcej wyników`,Tags:`Tagi`},zn={Authors:`Autores`,Cancel:`Cancelar`,"No matches found":`Nenhum resultado encontrado`,Posts:`Publicações`,"Search posts, tags and authors":`Procurar publicações, marcadores e autores`,"Show more results":`Mostrar mais resultados`,Tags:`Marcadores`},Bn={Authors:`Autores`,Cancel:`Cancelar`,"No matches found":`Nenhum resultado encontrado`,Posts:`Publicações`,"Search posts, tags and authors":`Buscar posts, tags e autores`,"Show more results":`Mostrar mais resultados`,Tags:`Tags`},Vn={Authors:`Autori`,Cancel:`Anulează`,"No matches found":`Nu s-au găsit rezultate`,Posts:`Postări`,"Search posts, tags and authors":`Caută postări, etichete și autori`,"Show more results":`Afișează mai multe rezultate`,Tags:`Etichete`},Hn={Authors:`Авторы`,Cancel:`Отмена`,"No matches found":`Совпадений не найдено`,Posts:`Записи`,"Search posts, tags and authors":`Поиск по записям, тегам и авторам`,"Show more results":`Показать больше результатов`,Tags:`Теги`},Un={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Wn={Authors:`Autori`,Cancel:`Zrušiť`,"No matches found":`Nenašli sa žiadne výsledky`,Posts:`Príspevky`,"Search posts, tags and authors":`Vyhľadajte príspevky, tagy a autorov`,"Show more results":`Zobraziť viac výsledkov`,Tags:`Tagy`},Gn={Authors:`Avtorji`,Cancel:`Prekliči`,"No matches found":`Ni najdenih zadetkov`,Posts:`Članki`,"Search posts, tags and authors":`Iščite članke, oznake in avtorje`,"Show more results":`Prikaži več rezultatov`,Tags:`Oznake`},Kn={Authors:`Autorët`,Cancel:`Anulo`,"No matches found":`Nuk u gjet asnjë rezultat`,Posts:`Postimet`,"Search posts, tags and authors":`Kërko postime, etiketa dhe autorë`,"Show more results":`Shfaq më shumë rezultate`,Tags:`Etiketat`},qn={Authors:`Autori`,Cancel:`Otkažite`,"No matches found":`Nema rezultata`,Posts:`Objave`,"Search posts, tags and authors":`Pretražite objave, tag-ove i autore`,"Show more results":`Prikažite više rezultata`,Tags:`Tag-ovi`},Jn={Authors:`Аутори`,Cancel:`Откажите`,"No matches found":`Нема резултата`,Posts:`Објаве`,"Search posts, tags and authors":`Претражите објаве, tag-ове и ауторе`,"Show more results":`Прикажите више резултата`,Tags:`Tag-ови`},Yn={Authors:`Författare`,Cancel:`Avbryt`,"No matches found":`Inga träffar hittade`,Posts:`Inlägg`,"Search posts, tags and authors":`Sök inlägg, taggar och författare`,"Show more results":`Visa fler resultat`,Tags:`Taggar`},Xn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},Zn={Authors:`ஆசிரியர்கள்`,Cancel:`ரத்து செய்`,"No matches found":`பொருத்தங்கள் எதுவும் இல்லை`,Posts:`பதிவுகள்`,"Search posts, tags and authors":`பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்`,"Show more results":`மேலும் முடிவுகளைக் காட்டு`,Tags:`குறிச்சொற்கள்`},Qn={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},$n={Authors:`Yazarlar`,Cancel:`İptal`,"No matches found":`Eşleşme bulunamadı`,Posts:`Yazılar`,"Search posts, tags and authors":`Yazıları, etiketleri ve yazarları ara`,"Show more results":`Daha fazla sonuç göster`,Tags:`Etiketler`},er={Authors:`Автори`,Cancel:`Скасувати`,"No matches found":`Збігів не знайдено`,Posts:`Публікації`,"Search posts, tags and authors":`Шукайте публікацій, теги та авторів`,"Show more results":`Показати більше результатів`,Tags:`Теги`},tr={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},nr={Authors:``,Cancel:``,"No matches found":``,Posts:``,"Search posts, tags and authors":``,"Show more results":``,Tags:``},rr={Authors:`Tác giả`,Cancel:`Hủy`,"No matches found":`Không tìm thấy`,Posts:`Bài viết`,"Search posts, tags and authors":`Tìm bài viết, thẻ và tác giả`,"Show more results":`Xem thêm kết quả`,Tags:`Thẻ`},ir={Authors:`作者`,Cancel:`取消`,"No matches found":`未找到匹配项`,Posts:`文章`,"Search posts, tags and authors":`搜索文章、标签和作者`,"Show more results":`显示更多结果`,Tags:`标签`},ar={Authors:`作者`,Cancel:`取消`,"No matches found":`無相符結果`,Posts:`文章`,"Search posts, tags and authors":`搜尋文章、標籤與作者`,"Show more results":`更多結果`,Tags:`標籤`},H=e=>typeof e==`string`,or=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},sr=e=>e==null?``:``+e,cr=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},lr=/###/g,ur=e=>e&&e.indexOf(`###`)>-1?e.replace(lr,`.`):e,dr=e=>!e||H(e),fr=(e,t,n)=>{let r=H(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(dr(e))return{};let t=ur(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return dr(e)?{}:{obj:e,k:ur(r[i])}},pr=(e,t,n)=>{let{obj:r,k:i}=fr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=fr(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=fr(e,o,Object),s&&s.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},mr=(e,t,n,r)=>{let{obj:i,k:a}=fr(e,t,Object);i[a]=i[a]||[],i[a].push(n)},hr=(e,t)=>{let{obj:n,k:r}=fr(e,t);if(n)return n[r]},gr=(e,t,n)=>{let r=hr(e,n);return r===void 0?hr(t,n):r},_r=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?H(e[r])||e[r]instanceof String||H(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):_r(e[r],t[r],n):e[r]=t[r]);return e},vr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),yr={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},br=e=>H(e)?e.replace(/[&<>"'\/]/g,e=>yr[e]):e,xr=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Sr=[` `,`,`,`?`,`!`,`;`],Cr=new xr(20),wr=(e,t,n)=>{t||=``,n||=``;let r=Sr.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Cr.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Tr=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`.`;if(!e)return;if(e[t])return e[t];let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Er=e=>e&&e.replace(`_`,`-`),Dr={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}},Or=new class e{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||`i18next:`,this.logger=e||Dr,this.options=t,this.debug=t.debug}log(){var e=[...arguments];return this.forward(e,`log`,``,!0)}warn(){var e=[...arguments];return this.forward(e,`warn`,``,!0)}error(){var e=[...arguments];return this.forward(e,`error`,``)}deprecate(){var e=[...arguments];return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(H(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},kr=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){var t=[...arguments].slice(1);this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[n,r]=e;for(let e=0;e<r;e++)n(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(n=>{let[r,i]=n;for(let n=0;n<i;n++)r.apply(r,[e,...t])})}},Ar=class extends kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:[`translation`],defaultNS:`translation`};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):H(n)&&i?o.push(...n.split(i)):o.push(n)));let s=hr(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!H(n)?s:Tr(this.data&&this.data[e]&&this.data[e][t],n,i)}addResource(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),pr(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let r in n)(H(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=hr(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?_r(s,n,i):s={...s,...n},pr(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.options.compatibilityAPI===`v1`?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},jr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))}),t}},Mr={},Nr=class e extends kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),cr([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Or.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let n=this.resolve(e,t);return n&&n.res!==void 0}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!wr(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:H(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:H(i)?[i]:i}}translate(t,n,r){if(typeof n!=`object`&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n==`object`&&(n={...n}),n||={},t==null)return``;Array.isArray(t)||(t=[String(t)]);let i=n.returnDetails===void 0?this.options.returnDetails:n.returnDetails,a=n.keySeparator===void 0?this.options.keySeparator:n.keySeparator,{key:o,namespaces:s}=this.extractFromKey(t[t.length-1],n),c=s[s.length-1],l=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&l.toLowerCase()===`cimode`){if(u){let e=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${e}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}let d=this.resolve(t,n),f=d&&d.res,p=d&&d.usedKey||o,m=d&&d.exactUsedKey||o,h=Object.prototype.toString.apply(f),g=[`[object Number]`,`[object Function]`,`[object RegExp]`],_=n.joinArrays===void 0?this.options.joinArrays:n.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!H(f)&&typeof f!=`boolean`&&typeof f!=`number`;if(v&&f&&y&&g.indexOf(h)<0&&!(H(_)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(d.res=e,d.usedParams=this.getUsedParamsDetails(n),d):e}if(a){let e=Array.isArray(f),t=e?[]:{},r=e?m:p;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${a}${e}`;t[e]=this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=f[e])}f=t}}else if(v&&H(_)&&Array.isArray(f))f=f.join(_),f&&=this.extendTranslation(f,t,n,r);else{let i=!1,s=!1,u=n.count!==void 0&&!H(n.count),p=e.hasDefaultValue(n),m=u?this.pluralResolver.getSuffix(l,n.count,n):``,h=n.ordinal&&u?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):``,g=u&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),_=g&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${m}`]||n[`defaultValue${h}`]||n.defaultValue;!this.isValidLookup(f)&&p&&(i=!0,f=_),this.isValidLookup(f)||(s=!0,f=o);let v=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:f,y=p&&_!==f&&this.options.updateMissing;if(s||i||y){if(this.logger.log(y?`updateKey`:`missingKey`,l,c,o,y?_:f),a){let e=this.resolve(o,{...n,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=p&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,i,y,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,c,t,i,y,n),this.emit(`missingKey`,e,c,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);g&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],o+t,n[`defaultValue${t}`]||_)})}):r(e,o,_))}f=this.extendTranslation(f,t,n,d,r),s&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(s||i)&&this.options.parseMissingKeyHandler&&(f=this.options.compatibilityAPI===`v1`?this.options.parseMissingKeyHandler(f):this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,i?f:void 0))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(e,t,n,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let o=H(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=n.replace&&!H(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),o){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;s<r&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!==`v1`&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){var e=[...arguments];return i&&i[0]===e[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):a.translate(...e,t)},n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,s=H(o)?[o]:o;return e!=null&&s&&s.length&&n.applyPostProcessor!==!1&&(e=jr.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,r,i,a,o;return H(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!H(t.count),d=u&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),f=t.context!==void 0&&(H(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!Mr[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(Mr[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(o.push(c+e),t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator}${t.context}`;o.push(r),u&&(o.push(r+e),t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!H(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},Pr=e=>e.charAt(0).toUpperCase()+e.slice(1),Fr=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Or.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Er(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Er(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(H(e)&&e.indexOf(`-`)>-1){if(typeof Intl<`u`&&Intl.getCanonicalLocales!==void 0)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch{}let t=[`hans`,`hant`,`latn`,`cyrl`,`cans`,`mong`,`arab`],n=e.split(`-`);return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Pr(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!==`sgn`&&n[2].length===2&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Pr(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Pr(n[2].toLowerCase()))),n.join(`-`)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(e.indexOf(`-`)<0&&n.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&n.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===n||e.indexOf(n)===0&&n.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),H(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return H(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):H(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ir=[{lngs:[`ach`,`ak`,`am`,`arn`,`br`,`fil`,`gun`,`ln`,`mfe`,`mg`,`mi`,`oc`,`pt`,`pt-BR`,`tg`,`tl`,`ti`,`tr`,`uz`,`wa`],nr:[1,2],fc:1},{lngs:`af.an.ast.az.bg.bn.ca.da.de.dev.el.en.eo.es.et.eu.fi.fo.fur.fy.gl.gu.ha.hi.hu.hy.ia.it.kk.kn.ku.lb.mai.ml.mn.mr.nah.nap.nb.ne.nl.nn.no.nso.pa.pap.pms.ps.pt-PT.rm.sco.se.si.so.son.sq.sv.sw.ta.te.tk.ur.yo`.split(`.`),nr:[1,2],fc:2},{lngs:[`ay`,`bo`,`cgg`,`fa`,`ht`,`id`,`ja`,`jbo`,`ka`,`km`,`ko`,`ky`,`lo`,`ms`,`sah`,`su`,`th`,`tt`,`ug`,`vi`,`wo`,`zh`],nr:[1],fc:3},{lngs:[`be`,`bs`,`cnr`,`dz`,`hr`,`ru`,`sr`,`uk`],nr:[1,2,5],fc:4},{lngs:[`ar`],nr:[0,1,2,3,11,100],fc:5},{lngs:[`cs`,`sk`],nr:[1,2,5],fc:6},{lngs:[`csb`,`pl`],nr:[1,2,5],fc:7},{lngs:[`cy`],nr:[1,2,3,8],fc:8},{lngs:[`fr`],nr:[1,2],fc:9},{lngs:[`ga`],nr:[1,2,3,7,11],fc:10},{lngs:[`gd`],nr:[1,2,3,20],fc:11},{lngs:[`is`],nr:[1,2],fc:12},{lngs:[`jv`],nr:[0,1],fc:13},{lngs:[`kw`],nr:[1,2,3,4],fc:14},{lngs:[`lt`],nr:[1,2,10],fc:15},{lngs:[`lv`],nr:[1,2,0],fc:16},{lngs:[`mk`],nr:[1,2],fc:17},{lngs:[`mnk`],nr:[0,1,2],fc:18},{lngs:[`mt`],nr:[1,2,11,20],fc:19},{lngs:[`or`],nr:[2,1],fc:2},{lngs:[`ro`],nr:[1,2,20],fc:20},{lngs:[`sl`],nr:[5,1,2,3],fc:21},{lngs:[`he`,`iw`],nr:[1,2,20,21],fc:22}],Lr={1:e=>Number(e>1),2:e=>Number(e!=1),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(e==1?0:e>=2&&e<=4?1:2),7:e=>Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(e==1?0:e==2?1:e!=8&&e!=11?2:3),9:e=>Number(e>=2),10:e=>Number(e==1?0:e==2?1:e<7?2:e<11?3:4),11:e=>Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(e!==0),14:e=>Number(e==1?0:e==2?1:e==3?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:e===0?2:1),17:e=>Number(e==1||e%10==1&&e%100!=11?0:1),18:e=>Number(e==0?0:e==1?1:2),19:e=>Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(e==1?0:e==0||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)},Rr=[`v1`,`v2`,`v3`],zr=[`v4`],Br={zero:0,one:1,two:2,few:3,many:4,other:5},Vr=()=>{let e={};return Ir.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Lr[t.fc]}})}),e},Hr=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Or.create(`pluralResolver`),(!this.options.compatibilityJSON||zr.includes(this.options.compatibilityJSON))&&(typeof Intl>`u`||!Intl.PluralRules)&&(this.options.compatibilityJSON=`v3`,this.logger.error(`Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.`)),this.rules=Vr(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){let n=Er(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(!e.match(/-|_/))return;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Br[e]-Br[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),``)}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r=`plural`:r===1&&(r=``));let i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON===`v1`?r===1?``:typeof r==`number`?`_plural_${r.toString()}`:i():this.options.compatibilityJSON===`v2`||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Rr.includes(this.options.compatibilityJSON)}},Ur=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`.`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=gr(e,t,n);return!a&&i&&H(n)&&(a=Tr(e,n,r),a===void 0&&(a=Tr(t,n,r))),a},Wr=e=>e.replace(/\$/g,`$$$$`),Gr=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Or.create(`interpolator`),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?br:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?vr(i):a||`{{`,this.suffix=o?vr(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?vr(d):f||vr(`$t(`),this.nestingSuffix=p?vr(p):m||vr(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Ur(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ur(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Wr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Wr(this.escape(e)):Wr(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=H(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!H(a)&&!this.useRawValueToEscape&&(a=sr(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!H(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){let e=r[1].split(this.formatSeparator).map(e=>e.trim());r[1]=e.shift(),s=e,c=!0}if(i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!H(i))return i;H(i)||(i=sr(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),c&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Kr=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},qr=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Er(r),i),t[o]=s),s(n)}},Jr=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Or.create(`formatter`),this.options=e,this.formats={number:qr((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:qr((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:qr((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:qr((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:qr((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||`,`}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=qr(t)}format(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Kr(t);if(this.formats[i]){let t=e;try{let o=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Yr=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Xr=class extends kr{constructor(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Or.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{mr(n.loaded,[i],a),Yr(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();H(e)&&(e=this.languageUtils.toResolveHierarchy(e)),H(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend&&this.backend.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Zr=()=>({debug:!1,initImmediate:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),H(e[1])&&(t.defaultValue=e[1]),H(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0}}),Qr=e=>(H(e.ns)&&(e.ns=[e.ns]),H(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),H(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),U=()=>{},$r=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ei=class e extends kr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Qr(e),this.services={},this.logger=Or,this.modules={external:[]},$r(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t==`function`&&(n=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(H(t.ns)?t.defaultNS=t.ns:t.ns.indexOf(`translation`)<0&&(t.defaultNS=t.ns[0]));let r=Zr();this.options={...r,...this.options,...Qr(t)},this.options.compatibilityAPI!==`v1`&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);let i=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Or.init(i(this.modules.logger),this.options):Or.init(null,this.options);let t;this.modules.formatter?t=this.modules.formatter:typeof Intl<`u`&&(t=Jr);let n=new Fr(this.options);this.store=new Ar(this.options.resources,this.options);let a=this.services;a.logger=Or,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new Hr(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=i(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Gr(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Xr(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Nr(this.services,this.options),this.translator.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||=U,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=or(),o=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),a.resolve(t),n(e,t)};if(this.languages&&this.options.compatibilityAPI!==`v1`&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?o():setTimeout(o,0),a}loadResources(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U,n=H(e)?e:this.language;if(typeof e==`function`&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return t();let e=[],r=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e)),this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){let r=or();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=U,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&jr.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=or();this.emit(`languageChanging`,e);let i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},o=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=H(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{a(e,n)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,t,n){var r=this;let i=function(e,t){let a;if(typeof t!=`object`){var o=[...arguments].slice(2);a=r.options.overloadTranslationOptionHandler([e,t].concat(o))}else a={...t};a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||i.keyPrefix);let s=r.options.keySeparator||`.`,c;return c=a.keyPrefix&&Array.isArray(e)?e.map(e=>`${a.keyPrefix}${s}${e}`):a.keyPrefix?`${a.keyPrefix}${s}${e}`:e,r.t(c,a)};return H(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=or();return this.options.ns?(H(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=or();H(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return`rtl`;let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services&&this.services.languageUtils||new Fr(Zr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new e(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U,r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Ar(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Nr(a.services,i),a.translator.on(`*`,function(e){var t=[...arguments].slice(1);a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},W=ei.createInstance();W.createInstance=ei.createInstance,W.createInstance,W.dir,W.init,W.loadResources,W.reloadResources,W.use,W.changeLanguage,W.getFixedT,W.t,W.exists,W.setDefaultNamespace,W.hasLoadedNamespace,W.loadNamespaces,W.loadLanguages;var ti=[{code:`af`,label:`Afrikaans`},{code:`ar`,label:`Arabic`},{code:`bg`,label:`Bulgarian`},{code:`bn`,label:`Bengali`},{code:`bs`,label:`Bosnian`},{code:`ca`,label:`Catalan`},{code:`cs`,label:`Czech`},{code:`da`,label:`Danish`},{code:`de`,label:`German`},{code:`de-CH`,label:`Swiss German`},{code:`el`,label:`Greek`},{code:`en`,label:`English`},{code:`eo`,label:`Esperanto`},{code:`es`,label:`Spanish`},{code:`et`,label:`Estonian`},{code:`eu`,label:`Basque`},{code:`fa`,label:`Persian/Farsi`},{code:`fi`,label:`Finnish`},{code:`fr`,label:`French`},{code:`gd`,label:`Gaelic (Scottish)`},{code:`he`,label:`Hebrew`},{code:`hi`,label:`Hindi`},{code:`hr`,label:`Croatian`},{code:`hu`,label:`Hungarian`},{code:`id`,label:`Indonesian`},{code:`is`,label:`Icelandic`},{code:`it`,label:`Italian`},{code:`ja`,label:`Japanese`},{code:`ko`,label:`Korean`},{code:`kz`,label:`Kazakh`},{code:`lt`,label:`Lithuanian`},{code:`lv`,label:`Latvian`},{code:`mk`,label:`Macedonian`},{code:`mn`,label:`Mongolian`},{code:`ms`,label:`Malay`},{code:`nb`,label:`Norwegian Bokmål`},{code:`ne`,label:`Nepali`},{code:`nl`,label:`Dutch`},{code:`nn`,label:`Norwegian Nynorsk`},{code:`pa`,label:`Punjabi`},{code:`pl`,label:`Polish`},{code:`pt`,label:`Portuguese`},{code:`pt-BR`,label:`Portuguese (Brazil)`},{code:`ro`,label:`Romanian`},{code:`ru`,label:`Russian`},{code:`si`,label:`Sinhala`},{code:`sk`,label:`Slovak`},{code:`sl`,label:`Slovenian`},{code:`sq`,label:`Albanian`},{code:`sr`,label:`Serbian`},{code:`sr-Cyrl`,label:`Serbian (Cyrillic)`},{code:`sv`,label:`Swedish`},{code:`sw`,label:`Swahili`},{code:`ta`,label:`Tamil`},{code:`th`,label:`Thai`},{code:`tr`,label:`Turkish`},{code:`uk`,label:`Ukrainian`},{code:`ur`,label:`Urdu`},{code:`uz`,label:`Uzbek`},{code:`vi`,label:`Vietnamese`},{code:`zh`,label:`Chinese`},{code:`zh-Hant`,label:`Traditional Chinese`}],ni=ti.map(e=>e.code);function ri(e){let t=e.default;return{...e,...t&&typeof t==`object`?t:{}}}function ii(e){return function(t,n){return t.reduce((t,r)=>{let i=e(r,n);return i===void 0&&(i=e(`en`,n)),t[r]={[n]:ri(i??{})},t},{})}}function ai({generateThemeResources:e,generateResources:t}){return(n=`en`,r=`portal`,i={})=>{let a=W.createInstance(),o={prefix:`{`,suffix:`}`};(r===`theme`||r===`portal`)&&(o.escapeValue=!1);let s=e=>{let n=a.services.languageUtils;for(let i of n.toResolveHierarchy(e))if(!(!ni.includes(i)||a.hasResourceBundle(i,r)))for(let[e,n]of Object.entries(t([i],r)))a.addResourceBundle(e,r,n[r])},c;return r===`theme`?c=e(n,i):(c={},a.on(`languageChanging`,s)),a.init({lng:n,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:[`nb`,`en`],default:[`en`]},ns:r,defaultNS:r,interpolation:o,resources:c}),a}}function oi(e,t){let n={};for(let[t,r]of Object.entries(e)){let e=/\/locales\/([^/]+)\//.exec(t)?.[1];e&&(n[e]=r)}return si(n,t)}function si(e,t){let n=ii(t=>e[t]),r=Object.assign(ai({generateResources:n,generateThemeResources:e=>({[e]:{theme:{}}})}),{LOCALE_DATA:ti,SUPPORTED_LOCALES:ni,generateResources:n,namespace:t});return r.default=r,r}var ci=oi(Object.assign({"../../locales/af/search.json":Qt,"../../locales/ar/search.json":$t,"../../locales/bg/search.json":en,"../../locales/bn/search.json":tn,"../../locales/bs/search.json":nn,"../../locales/ca/search.json":rn,"../../locales/cs/search.json":V,"../../locales/da/search.json":an,"../../locales/de/search.json":on,"../../locales/de-CH/search.json":sn,"../../locales/el/search.json":cn,"../../locales/en/search.json":ln,"../../locales/eo/search.json":un,"../../locales/es/search.json":dn,"../../locales/et/search.json":fn,"../../locales/eu/search.json":pn,"../../locales/fa/search.json":mn,"../../locales/fi/search.json":hn,"../../locales/fr/search.json":gn,"../../locales/gd/search.json":_n,"../../locales/he/search.json":vn,"../../locales/hi/search.json":yn,"../../locales/hr/search.json":bn,"../../locales/hu/search.json":xn,"../../locales/id/search.json":Sn,"../../locales/is/search.json":Cn,"../../locales/it/search.json":wn,"../../locales/ja/search.json":Tn,"../../locales/ko/search.json":En,"../../locales/kz/search.json":Dn,"../../locales/lt/search.json":On,"../../locales/lv/search.json":kn,"../../locales/mk/search.json":An,"../../locales/mn/search.json":jn,"../../locales/ms/search.json":Mn,"../../locales/nb/search.json":Nn,"../../locales/ne/search.json":Pn,"../../locales/nl/search.json":Fn,"../../locales/nn/search.json":In,"../../locales/pa/search.json":Ln,"../../locales/pl/search.json":Rn,"../../locales/pt/search.json":zn,"../../locales/pt-BR/search.json":Bn,"../../locales/ro/search.json":Vn,"../../locales/ru/search.json":Hn,"../../locales/si/search.json":Un,"../../locales/sk/search.json":Wn,"../../locales/sl/search.json":Gn,"../../locales/sq/search.json":Kn,"../../locales/sr/search.json":qn,"../../locales/sr-Cyrl/search.json":Jn,"../../locales/sv/search.json":Yn,"../../locales/sw/search.json":Xn,"../../locales/ta/search.json":Zn,"../../locales/th/search.json":Qn,"../../locales/tr/search.json":$n,"../../locales/uk/search.json":er,"../../locales/ur/search.json":tr,"../../locales/uz/search.json":nr,"../../locales/vi/search.json":rr,"../../locales/zh/search.json":ir,"../../locales/zh-Hant/search.json":ar}),`search`),{LOCALE_DATA:li,SUPPORTED_LOCALES:ui,generateResources:di}=ci,fi=class extends g.Component{constructor(e){super(e);let t=ci(this.props.locale||`en`,`search`),n=t.dir()||`ltr`,r=new Zt({adminUrl:e.adminUrl,apiKey:e.apiKey,dir:n});this.state={searchIndex:r,showPopup:!1,indexStarted:!1,indexComplete:!1,t:t.t,dir:n,scrollbarWidth:0},this.inputRef=g.createRef()}componentDidMount(){let e=this.getScrollbarWidth();this.setState({scrollbarWidth:e}),this.initSetup()}componentDidUpdate(e,t){if(t.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=window.document?.body?.style?.overflow,this.bodyMargin=window.getComputedStyle(document.body).getPropertyValue(`margin-right`),window.document.body.style.overflow=`hidden`,this.state.scrollbarWidth&&document.body.scrollHeight>window.innerHeight&&(window.document.body.style.marginRight=`calc(${this.bodyMargin} + ${this.state.scrollbarWidth}px)`)):(window.document.body.style.overflow=this.bodyScroll||``,!this.bodyMargin||this.bodyMargin===`0px`?window.document.body.style.marginRight=``:window.document.body.style.marginRight=this.bodyMargin)}catch{}this.state.showPopup!==t?.showPopup&&!this.state.showPopup&&this.setState({searchValue:``}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener(`hashchange`,this.hashHandler,!1),window.removeEventListener(`keydown`,this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener(`hashchange`,this.hashHandler,!1)}getScrollbarWidth(){let e=document.createElement(`div`);e.style.visibility=`hidden`,e.style.overflow=`scroll`,document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}setupCustomTriggerButton(){this.clickHandler=e=>{e.preventDefault(),this.setState({showPopup:!0});let t=document.createElement(`input`);t.style.opacity=`0`,t.style.position=`fixed`,t.style.top=`0`,document.body.appendChild(t),t.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(t)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(e=>{e.removeEventListener(`click`,this.clickHandler),e.addEventListener(`click`,this.clickHandler)})}getCustomTriggerButtons(){return document.querySelectorAll(`[data-ghost-search]`)||[]}handleSearchUrl(){let[e]=window.location.hash.substr(1).split(`?`);(e===`/search`||e===`/search/`)&&(this.setState({showPopup:!0}),window.history.replaceState(``,document.title,window.location.pathname))}addKeyboardShortcuts(){this.getCustomTriggerButtons()?.length&&(this.handleKeyDown=e=>{if(e.key===`k`&&e.metaKey)return this.setState({showPopup:!0}),e.preventDefault(),e.stopPropagation(),!1},document.addEventListener(`keydown`,this.handleKeyDown))}render(){return(0,b.jsx)(v.Provider,{value:{page:`search`,showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(e,t)=>{e===`update`&&this.setState({...this.state,...t})},t:this.state.t,dir:this.state.dir},children:(0,b.jsx)(pe,{})})}},pi=`sodo-search-root`;function mi(){let e=document.createElement(`div`);e.id=pi,document.body.appendChild(e)}function hi(){let e=document.querySelector(`script[data-sodo-search]`);return e?{adminUrl:e.dataset.sodoSearch,apiKey:e.dataset.key,stylesUrl:e.dataset.styles,locale:e.dataset.locale||`en`}:{}}function gi(){mi()}function _i(){let{adminUrl:e,apiKey:t,stylesUrl:n,locale:r}=hi(),i=(e||window.location.origin)?.replace(/\/+$/,``);gi(),_.render((0,b.jsx)(g.default.StrictMode,{children:(0,b.jsx)(fi,{adminUrl:i,apiKey:t,stylesUrl:n,locale:r})}),document.getElementById(pi))}_i()});
|