UNPKG

ocearo-ui

Version:

Ocean Robot UI: 3D visualization dashboard for signalk

1 lines 50.8 kB
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2008,(e,t,s)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},85269,45141,2607,22831,71,e=>{"use strict";let t;var s=e.i(71645);let i=e=>"string"==typeof e,a=()=>{let e,t,s=new Promise((s,i)=>{e=s,t=i});return s.resolve=e,s.reject=t,s},r=e=>null==e?"":""+e,o=/###/g,n=e=>e&&e.indexOf("###")>-1?e.replace(o,"."):e,l=e=>!e||i(e),u=(e,t,s)=>{let a=i(t)?t.split("."):t,r=0;for(;r<a.length-1;){if(l(e))return{};let t=n(a[r]);!e[t]&&s&&(e[t]=new s),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return l(e)?{}:{obj:e,k:n(a[r])}},p=(e,t,s)=>{let{obj:i,k:a}=u(e,t,Object);if(void 0!==i||1===t.length){i[a]=s;return}let r=t[t.length-1],o=t.slice(0,t.length-1),n=u(e,o,Object);for(;void 0===n.obj&&o.length;)r=`${o[o.length-1]}.${r}`,n=u(e,o=o.slice(0,o.length-1),Object),n?.obj&&void 0!==n.obj[`${n.k}.${r}`]&&(n.obj=void 0);n.obj[`${n.k}.${r}`]=s},h=(e,t)=>{let{obj:s,k:i}=u(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},g=(e,t,s)=>{for(let a in t)"__proto__"!==a&&"constructor"!==a&&(a in e?i(e[a])||e[a]instanceof String||i(t[a])||t[a]instanceof String?s&&(e[a]=t[a]):g(e[a],t[a],s):e[a]=t[a]);return e};var c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let d=e=>i(e)?e.replace(/[&<>"'\/]/g,e=>c[e]):e,f=[" ",",","?","!",";"],m=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}(20),y=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let i=t.split(s),a=e;for(let e=0;e<i.length;){let t;if(!a||"object"!=typeof a)return;let r="";for(let o=e;o<i.length;++o)if(o!==e&&(r+=s),r+=i[o],void 0!==(t=a[r])){if(["string","number","boolean"].indexOf(typeof t)>-1&&o<i.length-1)continue;e+=o-e+1;break}a=t}return a},b=e=>e?.replace("_","-"),x={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class v{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||x,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,a){return a&&!this.debug?null:(i(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new v(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new v(this.logger,e)}}var O=new v;class k{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,s])=>{for(let i=0;i<s;i++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let a=0;a<i;a++)s.apply(s,[e,...t])})}}class S extends k{constructor(e,t={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){0>this.options.ns.indexOf(e)&&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,s,a={}){let r,o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,n=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],s&&(Array.isArray(s)?r.push(...s):i(s)&&o?r.push(...s.split(o)):r.push(s)));let l=h(this.data,r);return(!l&&!t&&!s&&e.indexOf(".")>-1&&(e=r[0],t=r[1],s=r.slice(2).join(".")),!l&&n&&i(s))?y(this.data?.[e]?.[t],s,o):l}addResource(e,t,s,i,a={silent:!1}){let r=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,o=[e,t];s&&(o=o.concat(r?s.split(r):s)),e.indexOf(".")>-1&&(o=e.split("."),i=t,t=o[1]),this.addNamespaces(t),p(this.data,o,i),a.silent||this.emit("added",e,t,s,i)}addResources(e,t,s,a={silent:!1}){for(let a in s)(i(s[a])||Array.isArray(s[a]))&&this.addResource(e,t,a,s[a],{silent:!0});a.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,a,r={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),i=s,s=t,t=o[1]),this.addNamespaces(t);let n=h(this.data,o)||{};r.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?g(n,s,a):n={...n,...s},p(this.data,o,n),r.silent||this.emit("added",e,t,s)}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),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}}var L={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,i,a){return e.forEach(e=>{t=this.processors[e]?.process(t,s,i,a)??t}),t}};let $=Symbol("i18next/PATH_KEY");function w(e,t){let s,i,a,{[$]:r}=e((i=[],(a=Object.create(null)).get=(e,t)=>(s?.revoke?.(),t===$)?i:(i.push(t),(s=Proxy.revocable(e,a)).proxy),Proxy.revocable(Object.create(null),a).proxy));return r.join(t?.keySeparator??".")}let R={},C=e=>!i(e)&&"boolean"!=typeof e&&"number"!=typeof e;class N extends k{constructor(e,t={}){super(),((e,t,s)=>{e.forEach(e=>{t[e]&&(s[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=O.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let s={...t};if(null==e)return!1;let i=this.resolve(e,s);if(i?.res===void 0)return!1;let a=C(i.res);return!1!==s.returnObjects||!a}extractFromKey(e,t){let s=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===s&&(s=":");let a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],o=s&&e.indexOf(s)>-1,n=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,s)=>{t=t||"",s=s||"";let i=f.filter(e=>0>t.indexOf(e)&&0>s.indexOf(e));if(0===i.length)return!0;let a=m.getRegExp(`(${i.map(e=>"?"===e?"\\?":e).join("|")})`),r=!a.test(e);if(!r){let t=e.indexOf(s);t>0&&!a.test(e.substring(0,t))&&(r=!0)}return r})(e,s,a);if(o&&!n){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i(r)?[r]:r};let o=e.split(s);(s!==a||s===a&&this.options.ns.indexOf(o[0])>-1)&&(r=o.shift()),e=o.join(a)}return{key:e,namespaces:i(r)?[r]:r}}translate(e,t,s){let a="object"==typeof t?{...t}:t;if("object"!=typeof a&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof a&&(a={...a}),a||(a={}),null==e)return"";"function"==typeof e&&(e=w(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]);let r=void 0!==a.returnDetails?a.returnDetails:this.options.returnDetails,o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,{key:n,namespaces:l}=this.extractFromKey(e[e.length-1],a),u=l[l.length-1],p=void 0!==a.nsSeparator?a.nsSeparator:this.options.nsSeparator;void 0===p&&(p=":");let h=a.lng||this.language,g=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return g?r?{res:`${u}${p}${n}`,usedKey:n,exactUsedKey:n,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${p}${n}`:r?{res:n,usedKey:n,exactUsedKey:n,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:n;let c=this.resolve(e,a),d=c?.res,f=c?.usedKey||n,m=c?.exactUsedKey||n,y=void 0!==a.joinArrays?a.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==a.count&&!i(a.count),v=N.hasDefaultValue(a),O=x?this.pluralResolver.getSuffix(h,a.count,a):"",k=a.ordinal&&x?this.pluralResolver.getSuffix(h,a.count,{ordinal:!1}):"",S=x&&!a.ordinal&&0===a.count,L=S&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${O}`]||a[`defaultValue${k}`]||a.defaultValue,$=d;b&&!d&&v&&($=L);let R=C($),P=Object.prototype.toString.apply($);if(b&&$&&R&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(P)&&!(i(y)&&Array.isArray($))){if(!a.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(f,$,{...a,ns:l}):`key '${n} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(a),c):e}if(o){let e=Array.isArray($),t=e?[]:{},s=e?m:f;for(let e in $)if(Object.prototype.hasOwnProperty.call($,e)){let i=`${s}${o}${e}`;v&&!d?t[e]=this.translate(i,{...a,defaultValue:C(L)?L[e]:void 0,...{joinArrays:!1,ns:l}}):t[e]=this.translate(i,{...a,joinArrays:!1,ns:l}),t[e]===i&&(t[e]=$[e])}d=t}}else if(b&&i(y)&&Array.isArray(d))(d=d.join(y))&&(d=this.extendTranslation(d,e,a,s));else{let t=!1,i=!1;!this.isValidLookup(d)&&v&&(t=!0,d=L),this.isValidLookup(d)||(i=!0,d=n);let r=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:d,l=v&&L!==d&&this.options.updateMissing;if(i||t||l){if(this.logger.log(l?"updateKey":"missingKey",h,u,n,l?L:d),o){let e=this.resolve(n,{...a,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,a.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);let s=(e,t,s)=>{let i=v&&s!==d?s:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,t,i,l,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,u,t,i,l,a),this.emit("missingKey",e,u,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,a);S&&a[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{s([e],n+t,a[`defaultValue${t}`]||L)})}):s(e,n,L))}d=this.extendTranslation(d,e,a,c,s),i&&d===n&&this.options.appendNamespaceToMissingKey&&(d=`${u}${p}${n}`),(i||t)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${p}${n}`:n,t?d:void 0,a))}return r?(c.res=d,c.usedParams=this.getUsedParamsDetails(a),c):d}extendTranslation(e,t,s,a,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){let o;s.interpolation&&this.interpolator.init({...s,...{interpolation:{...this.options.interpolation,...s.interpolation}}});let n=i(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(n){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let l=s.replace&&!i(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,s.lng||this.language||a.usedLng,s),n){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(s.nest=!1)}!s.lng&&a&&a.res&&(s.lng=this.language||a.usedLng),!1!==s.nest&&(e=this.interpolator.nest(e,(...e)=>r?.[0]!==e[0]||s.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),s)),s.interpolation&&this.interpolator.reset()}let o=s.postProcess||this.options.postProcess,n=i(o)?[o]:o;return null!=e&&n?.length&&!1!==s.applyPostProcessor&&(e=L.handle(n,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,a,r,o,n;return i(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(s))return;let l=this.extractFromKey(e,t),u=l.key;a=u;let p=l.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));let h=void 0!==t.count&&!i(t.count),g=h&&!t.ordinal&&0===t.count,c=void 0!==t.context&&(i(t.context)||"number"==typeof t.context)&&""!==t.context,d=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);p.forEach(e=>{this.isValidLookup(s)||(n=e,!R[`${d[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(n)&&(R[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${a}" for languages "${d.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!!!")),d.forEach(i=>{let a;if(this.isValidLookup(s))return;o=i;let n=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(n,u,i,e,t);else{let e;h&&(e=this.pluralResolver.getSuffix(i,t.count,t));let s=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(t.ordinal&&0===e.indexOf(a)&&n.push(u+e.replace(a,this.options.pluralSeparator)),n.push(u+e),g&&n.push(u+s)),c){let i=`${u}${this.options.contextSeparator||"_"}${t.context}`;n.push(i),h&&(t.ordinal&&0===e.indexOf(a)&&n.push(i+e.replace(a,this.options.pluralSeparator)),n.push(i+e),g&&n.push(i+s))}}for(;a=n.pop();)this.isValidLookup(s)||(r=a,s=this.getResource(i,e,a,t))}))})}),{res:s,usedKey:a,exactUsedKey:r,usedLng:o,usedNS:n}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(e={}){let t=e.replace&&!i(e.replace),s=t?e.replace:e;if(t&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!t)for(let e of(s={...s},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete s[e];return s}static hasDefaultValue(e){let t="defaultValue";for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&void 0!==e[s])return!0;return!1}}class P{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=O.create("languageUtils")}getScriptPartFromCode(e){if(!(e=b(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=b(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(i(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}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){let t;return e?(e.forEach(e=>{if(t)return;let s=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;let i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(e=>{if(e===i||!(0>e.indexOf("-")&&0>i.indexOf("-"))&&(e.indexOf("-")>0&&0>i.indexOf("-")&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),i(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){let s=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),a=[],r=e=>{e&&(this.isSupportedCode(e)?a.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return i(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):i(e)&&r(this.formatLanguageCode(e)),s.forEach(e=>{0>a.indexOf(e)&&r(this.formatLanguageCode(e))}),a}}let j={zero:0,one:1,two:2,few:3,many:4,other:5},E={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class I{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=O.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let s,i=b("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:i,type:a});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];try{s=new Intl.PluralRules(i,{type:a})}catch(a){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),E;if(!e.match(/-|_/))return E;let i=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(i,t)}return this.pluralRulesCache[r]=s,s}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return(s||(s=this.getRule("dev",t)),s)?s.resolvedOptions().pluralCategories.sort((e,t)=>j[e]-j[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,s={}){let i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}let T=(e,t,s,a=".",r=!0)=>{let o,n=void 0!==(o=h(e,s))?o:h(t,s);return!n&&r&&i(s)&&void 0===(n=y(e,s,a))&&(n=y(t,s,a)),n};class F{constructor(e={}){this.logger=O.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:a,prefixEscaped:r,suffix:o,suffixEscaped:n,formatSeparator:l,unescapeSuffix:u,unescapePrefix:p,nestingPrefix:h,nestingPrefixEscaped:g,nestingSuffix:c,nestingSuffixEscaped:f,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:d,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==i&&i,this.prefix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):r||"{{",this.suffix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):n||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):g||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=c?c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):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,s,a){let o,n,l,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=e=>{if(0>e.indexOf(this.formatSeparator)){let i=T(t,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,s,{...a,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),r=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(T(t,u,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,s,{...a,...t,interpolationkey:r})};this.resetRegExp();let h=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(l=0;o=t.regex.exec(e);){let s=o[1].trim();if(void 0===(n=p(s)))if("function"==typeof h){let t=h(e,o,a);n=i(t)?t:""}else if(a&&Object.prototype.hasOwnProperty.call(a,s))n="";else if(g){n=o[0];continue}else this.logger.warn(`missed to pass in variable ${s} for interpolating ${e}`),n="";else i(n)||this.useRawValueToEscape||(n=r(n));let u=t.safeValue(n);if(e=e.replace(o[0],u),g?(t.regex.lastIndex+=n.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++l>=this.maxReplaces)break}}),e}nest(e,t,s={}){let a,o,n,l=(e,t)=>{let s=this.nestingOptionsSeparator;if(0>e.indexOf(s))return e;let i=e.split(RegExp(`${s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),a=`{${i[1]}`;e=i[0];let r=(a=this.interpolate(a,n)).match(/'/g),o=a.match(/"/g);((r?.length??0)%2!=0||o)&&o.length%2==0||(a=a.replace(/'/g,'"'));try{n=JSON.parse(a),t&&(n={...t,...n})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${a}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,e};for(;a=this.nestingRegexp.exec(e);){let u=[];(n=(n={...s}).replace&&!i(n.replace)?n.replace:n).applyPostProcessor=!1,delete n.defaultValue;let p=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(-1!==p&&(u=a[1].slice(p).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),a[1]=a[1].slice(0,p)),(o=t(l.call(this,a[1].trim(),n),n))&&a[0]===e&&!i(o))return o;i(o)||(o=r(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),o=""),u.length&&(o=u.reduce((e,t)=>this.format(e,t,s.lng,{...s,interpolationkey:a[1].trim()}),o.trim())),e=e.replace(a[0],o),this.regexp.lastIndex=0}return e}}let A=e=>{let t={};return(s,i,a)=>{let r=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(r={...r,[a.interpolationkey]:void 0});let o=i+JSON.stringify(r),n=t[o];return n||(n=e(b(i),a),t[o]=n),n(s)}},D=e=>(t,s,i)=>e(b(s),i)(t);class V{constructor(e={}){this.logger=O.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let s=t.cacheInBuiltFormats?A:D;this.formats={number:s((e,t)=>{let s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)}),currency:s((e,t)=>{let s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)}),datetime:s((e,t)=>{let s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)}),relativetime:s((e,t)=>{let s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")}),list:s((e,t)=>{let s=new Intl.ListFormat(e,{...t});return e=>s.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=A(t)}format(e,t,s,i={}){let a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&0>a[0].indexOf(")")&&a.find(e=>e.indexOf(")")>-1)){let e=a.findIndex(e=>e.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce((e,t)=>{let{formatName:a,formatOptions:r}=(e=>{let t=e.toLowerCase().trim(),s={};if(e.indexOf("(")>-1){let i=e.split("(");t=i[0].toLowerCase().trim();let a=i[1].substring(0,i[1].length-1);"currency"===t&&0>a.indexOf(":")?s.currency||(s.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?s.range||(s.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...i]=e.split(":"),a=i.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();s[r]||(s[r]=a),"false"===a&&(s[r]=!1),"true"===a&&(s[r]=!0),isNaN(a)||(s[r]=parseInt(a,10))}})}return{formatName:t,formatOptions:s}})(t);if(this.formats[a]){let t=e;try{let o=i?.formatParams?.[i.interpolationkey]||{},n=o.locale||o.lng||i.locale||i.lng||s;t=this.formats[a](e,n,{...r,...i,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class U extends k{constructor(e,t,s,i={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=O.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,i.backend,i)}queueLoad(e,t,s,i){let a={},r={},o={},n={};return e.forEach(e=>{let i=!0;t.forEach(t=>{let o=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,i=!1,void 0===r[o]&&(r[o]=!0),void 0===a[o]&&(a[o]=!0),void 0===n[t]&&(n[t]=!0)))}),i||(o[e]=!0)}),(Object.keys(a).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(n)}}loaded(e,t,s){let i=e.split("|"),a=i[0],r=i[1];t&&this.emit("failedLoading",a,r,t),!t&&s&&this.store.addResourceBundle(a,r,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);let o={};this.queue.forEach(s=>{((e,t,s,i)=>{let{obj:a,k:r}=u(e,t,Object);a[r]=a[r]||[],a[r].push(s)})(s.loaded,[a],r),void 0!==s.pending[e]&&(delete s.pending[e],s.pendingCount--),t&&s.errors.push(t),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach(e=>{o[e]||(o[e]={});let t=s.loaded[e];t.length&&t.forEach(t=>{void 0===o[e][t]&&(o[e][t]=!0)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,s,i=0,a=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:a,callback:r});this.readingCalls++;let o=(o,n)=>{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)}o&&n&&i<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,s,i+1,2*a,r)},a):r(o,n)},n=this.backend[s].bind(this.backend);if(2===n.length){try{let s=n(e,t);s&&"function"==typeof s.then?s.then(e=>o(null,e)).catch(o):o(null,s)}catch(e){o(e)}return}return n(e,t,o)}prepareLoading(e,t,s={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();i(e)&&(e=this.languageUtils.toResolveHierarchy(e)),i(t)&&(t=[t]);let r=this.queueLoad(e,t,s,a);if(!r.toLoad.length)return r.pending.length||a(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){let s=e.split("|"),i=s[0],a=s[1];this.read(i,a,"read",void 0,void 0,(s,r)=>{s&&this.logger.warn(`${t}loading namespace ${a} for language ${i} failed`,s),!s&&r&&this.logger.log(`${t}loaded namespace ${a} for language ${i}`,r),this.loaded(e,s,r)})}saveMissing(e,t,s,i,a,r={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${s}" 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!!!");if(null!=s&&""!==s){if(this.backend?.create){let n={...r,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;(a=5===l.length?l(e,t,s,i,n):l(e,t,s,i))&&"function"==typeof a.then?a.then(e=>o(null,e)).catch(o):o(null,a)}catch(e){o(e)}else l(e,t,s,i,o,n)}e&&e[0]&&this.store.addResource(e[0],t,s,i)}}}let z=()=>({debug:!1,initAsync:!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("object"==typeof e[1]&&(t=e[1]),i(e[1])&&(t.defaultValue=e[1]),i(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let s=e[3]||e[2];Object.keys(s).forEach(e=>{t[e]=s[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),K=e=>(i(e.ns)&&(e.ns=[e.ns]),i(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),i(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),M=()=>{},H=!1;class B extends k{constructor(e={},t){if(super(),this.options=K(e),this.services={},this.logger=O,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(i(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let s=z();this.options={...s,...this.options,...K(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||this?.modules?.backend?.name?.indexOf("Locize")>0||this?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||this?.options?.backend?.backends&&this.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||0||H||("u">typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),H=!0);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?O.init(r(this.modules.logger),this.options):O.init(null,this.options),e=this.modules.formatter?this.modules.formatter:V;let t=new P(this.options);this.store=new S(this.options.resources,this.options);let i=this.services;i.logger=O,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new I(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new F(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new U(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=M),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let 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(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=a(),n=()=>{let e=(e,s)=>{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),o.resolve(s),t(e,s)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?n():setTimeout(n,0),o}loadResources(e,t=M){let s=t,a=i(e)?e:this.language;if("function"==typeof e&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(a?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return s();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};a?t(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),s(e)})}else s(null)}reloadResources(e,t,s){let i=a();return"function"==typeof e&&(s=e,e=void 0),"function"==typeof t&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=M),this.services.backendConnector.reload(e,t,e=>{i.resolve(),s(e)}),i}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"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&&L.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++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let s=a();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,s.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},n=t=>{e||t||!this.services.languageDetector||(t=[]);let s=i(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(s)?s:this.services.languageUtils.getBestMatchFromCodes(i(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{o(e,a)})};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(n):this.services.languageDetector.detect(n):n(e):n(this.services.languageDetector.detect()),s}getFixedT(e,t,s){let a=(e,t,...i)=>{let r,o;(r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=r.lng||a.lng,r.lngs=r.lngs||a.lngs,r.ns=r.ns||a.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||s||a.keyPrefix);let n=this.options.keySeparator||".";return r.keyPrefix&&Array.isArray(e)?o=e.map(e=>("function"==typeof e&&(e=w(e,{...this.options,...t})),`${r.keyPrefix}${n}${e}`)):("function"==typeof e&&(e=w(e,{...this.options,...t})),o=r.keyPrefix?`${r.keyPrefix}${n}${e}`:e),this.t(o,r)};return i(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=s,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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 s=t.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;let r=(e,t)=>{let s=this.services.backendConnector.state[`${e}|${t}`];return -1===s||0===s||2===s};if(t.precheck){let e=t.precheck(this,r);if(void 0!==e)return e}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(s,e)&&(!i||r(a,e)))}loadNamespaces(e,t){let s=a();return this.options.ns?(i(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{s.resolve(),t&&t(e)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){let s=a();i(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{s.resolve(),t&&t(e)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new P(z());return e.toLowerCase().indexOf("-latn")>1?"ltr":["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(e={},t){let s=new B(e,t);return s.createInstance=B.createInstance,s}cloneInstance(e={},t=M){let s=e.forkResourceStore;s&&delete e.forkResourceStore;let i={...this.options,...e,isClone:!0},a=new B(i);if((void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},s&&(a.store=new S(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((s,i)=>(s[i]={...e[t][i]},s),e[t]),e),{}),i),a.services.resourceStore=a.store),e.interpolation){let t={...z().interpolation,...this.options.interpolation,...e.interpolation},s={...i,interpolation:t};a.services.interpolator=new F(s)}return a.translator=new N(a.services,i),a.translator.on("*",(e,...t)=>{a.emit(e,...t)}),a.init(i,t),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}}}let _=B.createInstance();_.createInstance,_.dir,_.init,_.loadResources,_.reloadResources,_.use,_.changeLanguage,_.getFixedT,_.t,_.exists,_.setDefaultNamespace,_.hasLoadedNamespace,_.loadNamespaces,_.loadLanguages,e.s(["default",()=>_],45141),e.i(2008),Object.create(null);let q=(e,t,s,i)=>{let a=[s,{code:t,...i||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);X(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...a):console?.warn&&console.warn(...a)},J={},Y=(e,t,s,i)=>{X(s)&&J[s]||(X(s)&&(J[s]=new Date),q(e,t,s,i))},W=(e,t)=>()=>{if(e.isInitialized)t();else{let s=()=>{setTimeout(()=>{e.off("initialized",s)},0),t()};e.on("initialized",s)}},G=(e,t,s)=>{e.loadNamespaces(t,W(e,s))},Q=(e,t,s,i)=>{if(X(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return G(e,s,i);s.forEach(t=>{0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,W(e,i))},X=e=>"string"==typeof e,Z=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ee={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},et=e=>ee[e],es={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Z,et),transDefaultProps:void 0};e.s(["initReactI18next",0,{type:"3rdParty",init(e){((e={})=>{es={...es,...e}})(e.options.react),t=e}}],2607);let ei=(0,s.createContext)();class ea{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}let er={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&copy;":"©","&reg;":"®","&trade;":"™","&hellip;":"…","&ndash;":"–","&mdash;":"—","&lsquo;":"‘","&rsquo;":"’","&sbquo;":"‚","&ldquo;":"“","&rdquo;":"”","&bdquo;":"„","&dagger;":"†","&Dagger;":"‡","&bull;":"•","&prime;":"′","&Prime;":"″","&lsaquo;":"‹","&rsaquo;":"›","&sect;":"§","&para;":"¶","&middot;":"·","&ensp;":" ","&emsp;":" ","&thinsp;":" ","&euro;":"€","&pound;":"£","&yen;":"¥","&cent;":"¢","&curren;":"¤","&times;":"×","&divide;":"÷","&minus;":"−","&plusmn;":"±","&ne;":"≠","&le;":"≤","&ge;":"≥","&asymp;":"≈","&equiv;":"≡","&infin;":"∞","&int;":"∫","&sum;":"∑","&prod;":"∏","&radic;":"√","&part;":"∂","&permil;":"‰","&deg;":"°","&micro;":"µ","&larr;":"←","&uarr;":"↑","&rarr;":"→","&darr;":"↓","&harr;":"↔","&crarr;":"↵","&lArr;":"⇐","&uArr;":"⇑","&rArr;":"⇒","&dArr;":"⇓","&hArr;":"⇔","&alpha;":"α","&beta;":"β","&gamma;":"γ","&delta;":"δ","&epsilon;":"ε","&zeta;":"ζ","&eta;":"η","&theta;":"θ","&iota;":"ι","&kappa;":"κ","&lambda;":"λ","&mu;":"μ","&nu;":"ν","&xi;":"ξ","&omicron;":"ο","&pi;":"π","&rho;":"ρ","&sigma;":"σ","&tau;":"τ","&upsilon;":"υ","&phi;":"φ","&chi;":"χ","&psi;":"ψ","&omega;":"ω","&Alpha;":"Α","&Beta;":"Β","&Gamma;":"Γ","&Delta;":"Δ","&Epsilon;":"Ε","&Zeta;":"Ζ","&Eta;":"Η","&Theta;":"Θ","&Iota;":"Ι","&Kappa;":"Κ","&Lambda;":"Λ","&Mu;":"Μ","&Nu;":"Ν","&Xi;":"Ξ","&Omicron;":"Ο","&Pi;":"Π","&Rho;":"Ρ","&Sigma;":"Σ","&Tau;":"Τ","&Upsilon;":"Υ","&Phi;":"Φ","&Chi;":"Χ","&Psi;":"Ψ","&Omega;":"Ω","&Agrave;":"À","&Aacute;":"Á","&Acirc;":"Â","&Atilde;":"Ã","&Auml;":"Ä","&Aring;":"Å","&AElig;":"Æ","&Ccedil;":"Ç","&Egrave;":"È","&Eacute;":"É","&Ecirc;":"Ê","&Euml;":"Ë","&Igrave;":"Ì","&Iacute;":"Í","&Icirc;":"Î","&Iuml;":"Ï","&ETH;":"Ð","&Ntilde;":"Ñ","&Ograve;":"Ò","&Oacute;":"Ó","&Ocirc;":"Ô","&Otilde;":"Õ","&Ouml;":"Ö","&Oslash;":"Ø","&Ugrave;":"Ù","&Uacute;":"Ú","&Ucirc;":"Û","&Uuml;":"Ü","&Yacute;":"Ý","&THORN;":"Þ","&szlig;":"ß","&agrave;":"à","&aacute;":"á","&acirc;":"â","&atilde;":"ã","&auml;":"ä","&aring;":"å","&aelig;":"æ","&ccedil;":"ç","&egrave;":"è","&eacute;":"é","&ecirc;":"ê","&euml;":"ë","&igrave;":"ì","&iacute;":"í","&icirc;":"î","&iuml;":"ï","&eth;":"ð","&ntilde;":"ñ","&ograve;":"ò","&oacute;":"ó","&ocirc;":"ô","&otilde;":"õ","&ouml;":"ö","&oslash;":"ø","&ugrave;":"ù","&uacute;":"ú","&ucirc;":"û","&uuml;":"ü","&yacute;":"ý","&thorn;":"þ","&yuml;":"ÿ","&iexcl;":"¡","&iquest;":"¿","&fnof;":"ƒ","&circ;":"ˆ","&tilde;":"˜","&OElig;":"Œ","&oelig;":"œ","&Scaron;":"Š","&scaron;":"š","&Yuml;":"Ÿ","&ordf;":"ª","&ordm;":"º","&macr;":"¯","&acute;":"´","&cedil;":"¸","&sup1;":"¹","&sup2;":"²","&sup3;":"³","&frac14;":"¼","&frac12;":"½","&frac34;":"¾","&spades;":"♠","&clubs;":"♣","&hearts;":"♥","&diams;":"♦","&loz;":"◊","&oline;":"‾","&frasl;":"⁄","&weierp;":"℘","&image;":"ℑ","&real;":"ℜ","&alefsym;":"ℵ"},eo=RegExp(Object.keys(er).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),"g");var en=e.i(2239);let el={t:(e,t)=>{let s;return X(t)?t:"object"==typeof(s=t)&&null!==s&&X(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},ready:!1},eu=()=>()=>{};function ep({i18n:e,defaultNS:t,children:i}){let a=(0,s.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,s.createElement)(ei.Provider,{value:a},i)}e.s(["useTranslation",0,(e,i={})=>{let{i18n:a}=i,{i18n:r,defaultNS:o}=(0,s.useContext)(ei)||{},n=a||r||t;n&&!n.reportNamespaces&&(n.reportNamespaces=new ea),n||Y(n,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");let l=(0,s.useMemo)(()=>({...es,...n?.options?.react,...i}),[n,i]),{useSuspense:u,keyPrefix:p}=l,h=e||o||n?.options?.defaultNS,g=X(h)?[h]:h||["translation"],c=(0,s.useMemo)(()=>g,g);n?.reportNamespaces?.addUsedNamespaces?.(c);let d=(0,s.useRef)(0),f=(0,s.useCallback)(e=>{if(!n)return eu;let{bindI18n:t,bindI18nStore:s}=l,i=()=>{d.current+=1,e()};return t&&n.on(t,i),s&&n.store.on(s,i),()=>{t&&t.split(" ").forEach(e=>n.off(e,i)),s&&s.split(" ").forEach(e=>n.store.off(e,i))}},[n,l]),m=(0,s.useRef)(),y=(0,s.useCallback)(()=>{if(!n)return el;let e=!!(n.isInitialized||n.initializedStoreOnce)&&c.every(e=>((e,t,s={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:s.lng,precheck:(t,i)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e))return!1}}):(Y(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,n,l)),t=i.lng||n.language,s=d.current,a=m.current;if(a&&a.ready===e&&a.lng===t&&a.keyPrefix===p&&a.revision===s)return a;let r={t:n.getFixedT(t,"fallback"===l.nsMode?c:c[0],p),ready:e,lng:t,keyPrefix:p,revision:s};return m.current=r,r},[n,c,p,l,i.lng]),[b,x]=(0,s.useState)(0),{t:v,ready:O}=(0,en.useSyncExternalStore)(f,y,y);(0,s.useEffect)(()=>{if(n&&!O&&!u){let e=()=>x(e=>e+1);i.lng?Q(n,i.lng,c,e):G(n,c,e)}},[n,i.lng,c,O,u,b]);let k=n||{},S=(0,s.useRef)(null),L=(0,s.useRef)(),$=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let s=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(s,"__original"))t