UNPKG

@digital-blueprint/checkin-app

Version:

[GitHub Repository](https://github.com/digital-blueprint/checkin-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/checkin-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/checkin-app/) | [Checkin Bundle](https://github

27 lines 127 kB
let e,t,o,r,s,n,i,a,l,d,c,u,h,p,g,f,b,v,m,y,k,w=e=>e;function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},x.apply(this,arguments)} /*! * License: LGPL-2.1-or-later * Dependencies: * * @webcomponents/scoped-custom-element-registry: 0.0.9 (BSD-3-Clause) * @dbp-toolkit/app-shell: 0.3.4 (LGPL-2.1-or-later) * @dbp-toolkit/language-select: 0.3.2 (LGPL-2.1-or-later) * @dbp-toolkit/common: 0.3.5 (LGPL-2.1-or-later) * @dbp-toolkit/auth: 0.3.2 (LGPL-2.1-or-later) * event-target-shim: 6.0.2 (MIT) * @dbp-toolkit/notification: 0.3.2 (LGPL-2.1-or-later) * @dbp-toolkit/theme-switcher: 0.0.6 (LGPL-2.1-or-later) * path-to-regexp: 6.2.0 (MIT) * universal-router: 9.1.0 (MIT) * generateUrls: 9.1.0 (MIT) * @dbp-toolkit/matomo: 0.2.7 (LGPL-2.1-or-later) * @dbp-toolkit/qr-code-scanner: 0.3.3 (LGPL-2.1-or-later) * async-mutex: 0.4.0 (MIT) * select2: 4.0.13 (MIT) * @lit/reactive-element: 1.6.1 (BSD-3-Clause) * lit-element: 3.3.1 (BSD-3-Clause) * i18next: 23.7.13 (MIT) * lit-html: 2.8.0 (BSD-3-Clause) * @open-wc/dedupe-mixin: 1.4.0 (MIT) * @open-wc/scoped-elements: 2.2.4 (MIT) */const S={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)}};var $=new class e{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||S,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,x({},{prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}};class C{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)})),this}off(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((e=>e!==t)):delete this.observers[e])}emit(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];if(this.observers[e]){[].concat(this.observers[e]).forEach((e=>{e(...o)}))}if(this.observers["*"]){[].concat(this.observers["*"]).forEach((t=>{t.apply(t,[e,...o])}))}}}function A(){let e,t;const o=new Promise(((o,r)=>{e=o,t=r}));return o.resolve=e,o.reject=t,o}function E(e){return null==e?"":""+e}function _(e,t,o){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function s(){return!e||"string"==typeof e}const n="string"!=typeof t?[].concat(t):t.split(".");for(;n.length>1;){if(s())return{};const t=r(n.shift());!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return s()?{}:{obj:e,k:r(n.shift())}}function O(e,t,o){const{obj:r,k:s}=_(e,t,Object);r[s]=o}function L(e,t){const{obj:o,k:r}=_(e,t);if(o)return o[r]}function N(e,t,o){for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?o&&(e[r]=t[r]):N(e[r],t[r],o):e[r]=t[r]);return e}function P(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var R={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function j(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(e=>R[e])):e}const T=[" ",",","?","!",";"];function F(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(o);let s=e;for(let e=0;e<r.length;++e){if(!s)return;if("string"==typeof s[r[e]]&&e+1<r.length)return;if(void 0===s[r[e]]){let n=2,i=r.slice(e,e+n).join(o),a=s[i];for(;void 0===a&&r.length>e+n;)n++,i=r.slice(e,e+n).join(o),a=s[i];if(void 0===a)return;if(null===a)return null;if(t.endsWith(i)){if("string"==typeof a)return a;if(i&&"string"==typeof a[i])return a[i]}const l=r.slice(e+n).join(o);return l?F(a,l,o):void 0}s=s[r[e]]}return s}function U(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class D extends C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,n=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let i=[e,t];o&&"string"!=typeof o&&(i=i.concat(o)),o&&"string"==typeof o&&(i=i.concat(s?o.split(s):o)),e.indexOf(".")>-1&&(i=e.split("."));const a=L(this.data,i);return a||!n||"string"!=typeof o?a:F(this.data&&this.data[e]&&this.data[e][t],o,s)}addResource(e,t,o,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let i=[e,t];o&&(i=i.concat(n?o.split(n):o)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),O(this.data,i,r),s.silent||this.emit("added",e,t,o,r)}addResources(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in o)"string"!=typeof o[r]&&"[object Array]"!==Object.prototype.toString.apply(o[r])||this.addResource(e,t,r,o[r],{silent:!0});r.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,o,r,s){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=o,o=t,t=i[1]),this.addNamespaces(t);let a=L(this.data,i)||{};r?N(a,o,s):a=x({},a,o),O(this.data,i,a),n.silent||this.emit("added",e,t,o)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?x({},{},this.getResource(e,t)):this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var M={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,r,s){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,o,r,s))})),t}};const I={};class z extends C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,o){e.forEach((e=>{t[e]&&(o[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=$.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const o=this.resolve(e,t);return o&&void 0!==o.res}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let s=t.ns||this.options.defaultNS||[];const n=o&&e.indexOf(o)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,o){t=t||"",o=o||"";const r=T.filter((e=>t.indexOf(e)<0&&o.indexOf(e)<0));if(0===r.length)return!0;const s=new RegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let n=!s.test(e);if(!n){const t=e.indexOf(o);t>0&&!s.test(e.substring(0,t))&&(n=!0)}return n}(e,o,r));if(n&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:s};const n=e.split(o);(o!==r||o===r&&this.options.ns.indexOf(n[0])>-1)&&(s=n.shift()),e=n.join(r)}return"string"==typeof s&&(s=[s]),{key:e,namespaces:s}}translate(e,t,o){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t=x({},t)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:n,namespaces:i}=this.extractFromKey(e[e.length-1],t),a=i[i.length-1],l=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(d){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${a}${e}${n}`,usedKey:n,exactUsedKey:n,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${n}`}return r?{res:n,usedKey:n,exactUsedKey:n,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:n}const c=this.resolve(e,t);let u=c&&c.res;const h=c&&c.usedKey||n,p=c&&c.exactUsedKey||n,g=Object.prototype.toString.apply(u),f=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&u&&("string"!=typeof u&&"boolean"!=typeof u&&"number"!=typeof u)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0&&("string"!=typeof f||"[object Array]"!==g)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,u,x({},t,{ns:i})):`key '${n} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(s){const e="[object Array]"===g,o=e?[]:{},r=e?p:h;for(const e in u)if(Object.prototype.hasOwnProperty.call(u,e)){const n=`${r}${s}${e}`;o[e]=this.translate(n,x({},t,{joinArrays:!1,ns:i})),o[e]===n&&(o[e]=u[e])}u=o}}else if(b&&"string"==typeof f&&"[object Array]"===g)u=u.join(f),u&&(u=this.extendTranslation(u,e,t,o));else{let r=!1,i=!1;const d=void 0!==t.count&&"string"!=typeof t.count,h=z.hasDefaultValue(t),p=d?this.pluralResolver.getSuffix(l,t.count,t):"",g=t.ordinal&&d?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",f=t[`defaultValue${p}`]||t[`defaultValue${g}`]||t.defaultValue;!this.isValidLookup(u)&&h&&(r=!0,u=f),this.isValidLookup(u)||(i=!0,u=n);const b=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:u,v=h&&f!==u&&this.options.updateMissing;if(i||r||v){if(this.logger.log(v?"updateKey":"missingKey",l,a,n,v?f:u),s){const e=this.resolve(n,x({},t,{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=[];const o=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&o&&o[0])for(let t=0;t<o.length;t++)e.push(o[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,o,r)=>{const s=h&&r!==u?r:b;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,o,s,v,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,a,o,s,v,t),this.emit("missingKey",e,a,o,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&d?e.forEach((e=>{this.pluralResolver.getSuffixes(e,t).forEach((o=>{r([e],n+o,t[`defaultValue${o}`]||f)}))})):r(e,n,f))}u=this.extendTranslation(u,e,t,c,o),i&&u===n&&this.options.appendNamespaceToMissingKey&&(u=`${a}:${n}`),(i||r)&&this.options.parseMissingKeyHandler&&(u="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${n}`:n,r?u:void 0):this.options.parseMissingKeyHandler(u))}return r?(c.res=u,c.usedParams=this.getUsedParamsDetails(t),c):u}extendTranslation(e,t,o,r,s){var n=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,x({},this.options.interpolation.defaultVariables,o),o.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(x({},o,{interpolation:x({},this.options.interpolation,o.interpolation)}));const i="string"==typeof e&&(o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(i){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=o.replace&&"string"!=typeof o.replace?o.replace:o;if(this.options.interpolation.defaultVariables&&(l=x({},this.options.interpolation.defaultVariables,l)),e=this.interpolator.interpolate(e,l,o.lng||this.language,o),i){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(o.nest=!1)}!o.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(o.lng=r.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return s&&s[0]===r[0]&&!o.context?(n.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):n.translate(...r,t)}),o)),o.interpolation&&this.interpolator.reset()}const i=o.postProcess||this.options.postProcess,a="string"==typeof i?[i]:i;return null!=e&&a&&a.length&&!1!==o.applyPostProcessor&&(e=M.handle(a,e,t,this.options&&this.options.postProcessPassResolved?x({i18nResolved:x({},r,{usedParams:this.getUsedParamsDetails(o)})},o):o,this)),e}resolve(e){let t,o,r,s,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,i),l=a.key;o=l;let d=a.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const c=void 0!==i.count&&"string"!=typeof i.count,u=c&&!i.ordinal&&0===i.count&&this.pluralResolver.shouldUseIntlApi(),h=void 0!==i.context&&("string"==typeof i.context||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);d.forEach((e=>{this.isValidLookup(t)||(n=e,!I[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(n)&&(I[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${p.join(", ")}" won't get resolved as namespace "${n}" 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((o=>{if(this.isValidLookup(t))return;s=o;const n=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(n,l,o,e,i);else{let e;c&&(e=this.pluralResolver.getSuffix(o,i.count,i));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(n.push(l+e),i.ordinal&&0===e.indexOf(r)&&n.push(l+e.replace(r,this.options.pluralSeparator)),u&&n.push(l+t)),h){const o=`${l}${this.options.contextSeparator}${i.context}`;n.push(o),c&&(n.push(o+e),i.ordinal&&0===e.indexOf(r)&&n.push(o+e.replace(r,this.options.pluralSeparator)),u&&n.push(o+t))}}let a;for(;a=n.pop();)this.isValidLookup(t)||(r=a,t=this.getResource(o,e,a,i))})))}))})),{res:t,usedKey:o,exactUsedKey:r,usedLng:s,usedNS:n}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,o,r):this.resourceStore.getResource(e,t,o,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&"string"!=typeof e.replace;let r=o?e.replace:e;if(o&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r=x({},this.options.interpolation.defaultVariables,r)),!o){r=x({},r);for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,12)&&void 0!==e[o])return!0;return!1}}function B(e){return e.charAt(0).toUpperCase()+e.slice(1)}class H{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}getScriptPartFromCode(e){if(!(e=U(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=U(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let o=e.split("-");return this.options.lowerCaseLng?o=o.map((e=>e.toLowerCase())):2===o.length?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=B(o[1].toLowerCase()))):3===o.length&&(o[0]=o[0].toLowerCase(),2===o[1].length&&(o[1]=o[1].toUpperCase()),"sgn"!==o[0]&&2===o[2].length&&(o[2]=o[2].toUpperCase()),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=B(o[1].toLowerCase())),t.indexOf(o[2].toLowerCase())>-1&&(o[2]=B(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||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;const o=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(o)||(t=o)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find((e=>e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:0===e.indexOf(o)?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],s=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),o.forEach((e=>{r.indexOf(e)<0&&s(this.formatLanguageCode(e))})),r}}let V=[{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"],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}],K={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};const q=["v1","v2","v3"],J=["v4"],W={zero:0,one:1,two:2,few:3,many:4,other:5};class Y{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=$.create("pluralResolver"),this.options.compatibilityJSON&&!J.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&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=function(){const e={};return V.forEach((t=>{t.lngs.forEach((o=>{e[o]={numbers:t.nr,plurals:K[t.fc]}}))})),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(U(e),{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=this.getRule(e,t);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}getPluralFormsOfKey(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,o).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=this.getRule(e,t);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(((e,t)=>W[e]-W[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):o.numbers.map((o=>this.getSuffix(e,o,t))):[]}getSuffix(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,o);return r?this.shouldUseIntlApi()?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const o=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[o];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const s=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}shouldUseIntlApi(){return!q.includes(this.options.compatibilityJSON)}}function G(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],n=function(e,t,o){const r=L(e,o);return void 0!==r?r:L(t,o)}(e,t,o);return!n&&s&&"string"==typeof o&&(n=F(e,o,r),void 0===n&&(n=F(t,o,r))),n}class X{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=$.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=void 0!==t.escape?t.escape:j,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?P(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?P(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?P(t.nestingPrefix):t.nestingPrefixEscaped||P("$t("),this.nestingSuffix=t.nestingSuffix?P(t.nestingSuffix):t.nestingSuffixEscaped||P(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const o=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(o,"g")}interpolate(e,t,o,r){let s,n,i;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}const d=e=>{if(e.indexOf(this.formatSeparator)<0){const s=G(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,o,x({},r,t,{interpolationkey:e})):s}const s=e.split(this.formatSeparator),n=s.shift().trim(),i=s.join(this.formatSeparator).trim();return this.format(G(t,a,n,this.options.keySeparator,this.options.ignoreJSONStructure),i,o,x({},r,t,{interpolationkey:n}))};this.resetRegExp();const c=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>l(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?l(this.escape(e)):l(e)}].forEach((t=>{for(i=0;s=t.regex.exec(e);){const o=s[1].trim();if(n=d(o),void 0===n)if("function"==typeof c){const t=c(e,s,r);n="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,o))n="";else{if(u){n=s[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),n=""}else"string"==typeof n||this.useRawValueToEscape||(n=E(n));const a=t.safeValue(n);if(e=e.replace(s[0],a),u?(t.regex.lastIndex+=n.length,t.regex.lastIndex-=s[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}})),e}nest(e,t){let o,r,s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function i(e,t){const o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;const r=e.split(new RegExp(`${o}[ ]*{`));let n=`{${r[1]}`;e=r[0],n=this.interpolate(n,s);const i=n.match(/'/g),a=n.match(/"/g);(i&&i.length%2==0&&!a||a.length%2!=0)&&(n=n.replace(/'/g,'"'));try{s=JSON.parse(n),t&&(s=x({},t,s))}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${o}${n}`}return delete s.defaultValue,e}for(;o=this.nestingRegexp.exec(e);){let a=[];s=x({},n),s=s.replace&&"string"!=typeof s.replace?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let l=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){const e=o[1].split(this.formatSeparator).map((e=>e.trim()));o[1]=e.shift(),a=e,l=!0}if(r=t(i.call(this,o[1].trim(),s),s),r&&o[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=E(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),l&&(r=a.reduce(((e,t)=>this.format(e,t,n.lng,x({},n,{interpolationkey:o[1].trim()}))),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}function Z(e){const t={};return function(o,r,s){const n=r+JSON.stringify(s);let i=t[n];return i||(i=e(U(r),s),t[n]=i),i(o)}}class Q{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=$.create("formatter"),this.options=e,this.formats={number:Z(((e,t)=>{const o=new Intl.NumberFormat(e,x({},t));return e=>o.format(e)})),currency:Z(((e,t)=>{const o=new Intl.NumberFormat(e,x({},t,{style:"currency"}));return e=>o.format(e)})),datetime:Z(((e,t)=>{const o=new Intl.DateTimeFormat(e,x({},t));return e=>o.format(e)})),relativetime:Z(((e,t)=>{const o=new Intl.RelativeTimeFormat(e,x({},t));return e=>o.format(e,t.range||"day")})),list:Z(((e,t)=>{const o=new Intl.ListFormat(e,x({},t));return e=>o.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Z(t)}format(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=t.split(this.formatSeparator).reduce(((e,t)=>{const{formatName:s,formatOptions:n}=function(e){let t=e.toLowerCase().trim();const o={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);"currency"===t&&s.indexOf(":")<0?o.currency||(o.currency=s.trim()):"relativetime"===t&&s.indexOf(":")<0?o.range||(o.range=s.trim()):s.split(";").forEach((e=>{if(!e)return;const[t,...r]=e.split(":"),s=r.join(":").trim().replace(/^'+|'+$/g,"");o[t.trim()]||(o[t.trim()]=s),"false"===s&&(o[t.trim()]=!1),"true"===s&&(o[t.trim()]=!0),isNaN(s)||(o[t.trim()]=parseInt(s,10))}))}return{formatName:t,formatOptions:o}}(t);if(this.formats[s]){let t=e;try{const i=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},a=i.locale||i.lng||r.locale||r.lng||o;t=this.formats[s](e,a,x({},n,r,i))}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${s}`),e}),e);return s}}class ee extends C{constructor(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=r,this.logger=$.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(o,r.backend,r)}queueLoad(e,t,o,r){const s={},n={},i={},a={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const i=`${e}|${t}`;!o.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===n[i]&&(n[i]=!0):(this.state[i]=1,r=!1,void 0===n[i]&&(n[i]=!0),void 0===s[i]&&(s[i]=!0),void 0===a[t]&&(a[t]=!0)))})),r||(i[e]=!0)})),(Object.keys(s).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(n),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const r=e.split("|"),s=r[0],n=r[1];t&&this.emit("failedLoading",s,n,t),o&&this.store.addResourceBundle(s,n,o),this.state[e]=t?-1:2;const i={};this.queue.forEach((o=>{!function(e,t,o,r){const{obj:s,k:n}=_(e,t,Object);s[n]=s[n]||[],r&&(s[n]=s[n].concat(o)),r||s[n].push(o)}(o.loaded,[s],n),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach((e=>{i[e]||(i[e]={});const t=o.loaded[e];t.length&&t.forEach((t=>{void 0===i[e][t]&&(i[e][t]=!0)}))})),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((e=>!e.done))}read(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,n=arguments.length>5?arguments[5]:void 0;if(!e.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:r,wait:s,callback:n});this.readingCalls++;const i=(i,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&a&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,o,r+1,2*s,n)}),s):n(i,a)},a=this.backend[o].bind(this.backend);if(2!==a.length)return a(e,t,i);try{const o=a(e,t);o&&"function"==typeof o.then?o.then((e=>i(null,e))).catch(i):i(null,o)}catch(e){i(e)}}prepareLoading(e,t){let o=arguments.length>2&&void 0!==arguments[2]?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();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);const s=this.queueLoad(e,t,o,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,o){this.prepareLoading(e,t,{},o)}reload(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=e.split("|"),r=o[0],s=o[1];this.read(r,s,"read",void 0,void 0,((o,n)=>{o&&this.logger.warn(`${t}loading namespace ${s} for language ${r} failed`,o),!o&&n&&this.logger.log(`${t}loaded namespace ${s} for language ${r}`,n),this.loaded(e,o,n)}))}saveMissing(e,t,o,r,s){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${o}" 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!!!");else if(null!=o&&""!==o){if(this.backend&&this.backend.create){const a=x({},n,{isUpdate:s}),l=this.backend.create.bind(this.backend);if(l.length<6)try{let s;s=5===l.length?l(e,t,o,r,a):l(e,t,o,r),s&&"function"==typeof s.then?s.then((e=>i(null,e))).catch(i):i(null,s)}catch(e){i(e)}else l(e,t,o,r,i,a)}e&&e[0]&&this.store.addResource(e[0],t,o,r)}}}function te(){return{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:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const o=e[3]||e[2];Object.keys(o).forEach((e=>{t[e]=o[e]}))}return t},interpolation:{escapeValue:!0,format:(e,t,o,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function oe(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function re(){}class se extends C{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var o;if(super(),this.options=oe(e),this.services={},this.logger=$,this.modules={external:[]},o=this,Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((e=>{"function"==typeof o[e]&&(o[e]=o[e].bind(o))})),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&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(o=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=te();function s(e){return e?"function"==typeof e?new e:e:null}if(this.options=x({},r,this.options,oe(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=x({},r.interpolation,this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?$.init(s(this.modules.logger),this.options):$.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=Q);const o=new H(this.options);this.store=new D(this.options.resources,this.options);const n=this.services;n.logger=$,n.resourceStore=this.store,n.languageUtils=o,n.pluralResolver=new Y(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(n.formatter=s(t),n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new X(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new ee(s(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];e.emit(t,...r)})),this.modules.languageDetector&&(n.languageDetector=s(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=s(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new z(this.services,this.options),this.translator.on("*",(function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,o||(o=re),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(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}}));const n=A(),i=()=>{const e=(e,t)=>{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),n.resolve(t),o(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),n}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:re;const o="string"==typeof e?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(o)r(o);else{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,o){const r=A();return e||(e=this.languages),t||(t=this.options.ns),o||(o=re),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),o(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&M.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&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++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var o=this;this.isLanguageChangingTo=e;const r=A();this.emit("languageChanging",e);const s=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(e,n)=>{n?(s(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,r.resolve((function(){return o.t(...arguments)})),t&&t(e,(function(){return o.t(...arguments)}))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const o="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);o&&(this.language||s(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(o)),this.loadResources(o,(e=>{n(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}getFixedT(e,t,o){var r=this;const s=function e(t,s){let n;if("object"!=typeof s){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l<i;l++)a[l-2]=arguments[l];n=r.options.overloadTranslationOptionHandler([t,s].concat(a))}else n=x({},s);n.lng=n.lng||e.lng,n.lngs=n.lngs||e.lngs,n.ns=n.ns||e.ns,n.keyPrefix=n.keyPrefix||o||e.keyPrefix;const d=r.options.keySeparator||".";let c;return c=n.keyPrefix&&Array.isArray(t)?t.map((e=>`${n.keyPrefix}${d}${e}`)):n.keyPrefix?`${n.keyPrefix}${d}${t}`:t,r.t(c,n)};return"string"==typeof e?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=o,s}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&&void 0!==arguments[1]?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;const o=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;const n=(e,t)=>{const o=this.services.backendConnector.state[`${e}|${t}`];return-1===o||2===o};if(t.precheck){const e=t.precheck(this,n);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!n(o,e)||r&&!n(s,e)))}loadNamespaces(e,t){const o=A();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}loadLanguages(e,t){const o=A();"string"==typeof e&&(e=[e]);const r=this.options.preload||[],s=e.filter((e=>r.indexOf(e)<0));return s.length?(this.options.preload=r.concat(s),this.loadResources((e=>{o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new H(te());return["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"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new se(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:re;const o=e.forkResourceStore;o&&delete e.forkResourceStore;const r=x({},this.options,e,{isClone:!0}),s=new se(r);void 0===e.debug&&void 0===e.prefix||(s.logger=s.logger.clone(e));return["store","services","language"].forEach((e=>{s[e]=this[e]})),s.services=x({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},o&&(s.store=new D(this.store.data,r),s.services.resourceStore=s.store),s.translator=new z(s.services,r),s.translator.on("*",(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];s.emit(e,...o)})),s.init(r,t),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ne=se.createInstance();ne.createInstance=se.createInstance,ne.createInstance,ne.dir,ne.init,ne.loadResources,ne.reloadResources,ne.use,ne.changeLanguage,ne.getFixedT,ne.t,ne.exists,ne.setDefaultNamespace,ne.hasLoadedNamespace,ne.loadNamespaces,ne.loadLanguages;const ie={};async function ae(e,t){if(void 0===ie[t]){let o=async function(e,t){let o=await fetch(e+t+"/translation.json",{headers:{"Content-Type":"application/json"}});return await o.json()}(e,t);return ie[t]=o,o}return ie[t]}function le(e){return"--"+e+"-override"}function de(e,t,o,r){void 0===r&&(r="translation");let s=le(r);var n={lng:t,fallbackLng:[o,t,...Object.keys(e)],debug:!1,ns:[s,r],defaultNS:r,fallbackNS:r,initImmediate:!1,resources:{},compatibilityJSON:"v4"};Object.keys(e).forEach((function(t){n.resources[t]={[r]:e[t]}}));var i=ne.createInstance();return i.init(n),console.assert(i.isInitialized),i}async function ce(e,t){let o=(t.dataset&&t.dataset.tagName||t.tagName).toLowerCase(),r=e.options.fallbackN