From 56f9f421948f035f3aad02b1cea0a326218c6dc3 Mon Sep 17 00:00:00 2001 From: Jan Muehlemann Date: Sun, 10 Feb 2019 16:54:55 +0100 Subject: [PATCH] rebuild --- CHANGELOG.md | 4 ++++ i18next.js | 2 +- i18next.min.js | 2 +- rollup.config.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19e237fa6..0e4995e1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 15.0.1 + +- fix export name on global (typo) + ### 15.0.0 - update build process (while all test passes feeling more save making this a major release) diff --git a/i18next.js b/i18next.js index 81f6571a9..79a3c7b03 100644 --- a/i18next.js +++ b/i18next.js @@ -1,7 +1,7 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.iI18next = factory()); + (global = global || self, global.i18next = factory()); }(this, function () { 'use strict'; function _defineProperty(obj, key, value) { diff --git a/i18next.min.js b/i18next.min.js index 011aa3e1c..01f0a4d8b 100644 --- a/i18next.min.js +++ b/i18next.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).iI18next=e()}(this,function(){"use strict";function t(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function e(e){for(var s=1;s1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||n,this.options=e,this.debug=e.debug}setDebug(t){this.debug=t}log(){for(var t=arguments.length,e=new Array(t),s=0;s{this.observers[t]=this.observers[t]||[],this.observers[t].push(e)}),this}off(t,e){this.observers[t]&&this.observers[t].forEach(()=>{if(e){const s=this.observers[t].indexOf(e);s>-1&&this.observers[t].splice(s,1)}else delete this.observers[t]})}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n{t(...s)})}if(this.observers["*"]){[].concat(this.observers["*"]).forEach(e=>{e.apply(e,[t,...s])})}}}function a(){let t,e;const s=new Promise((s,n)=>{t=s,e=n});return s.resolve=t,s.reject=e,s}function l(t){return null==t?"":""+t}function u(t,e,s){function n(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}const o="string"!=typeof e?[].concat(e):e.split(".");for(;o.length>1;){if(i())return{};const e=n(o.shift());!t[e]&&s&&(t[e]=new s),t=t[e]}return i()?{}:{obj:t,k:n(o.shift())}}function h(t,e,s){const n=u(t,e,Object);n.obj[n.k]=s}function c(t,e){const s=u(t,e),n=s.obj,i=s.k;if(n)return n[i]}function p(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var g={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function f(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,t=>g[t]):t}class d extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator=".")}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let o=[t,e];return s&&"string"!=typeof s&&(o=o.concat(s)),s&&"string"==typeof s&&(o=o.concat(i?s.split(i):s)),t.indexOf(".")>-1&&(o=t.split(".")),c(this.data,o)}addResource(t,e,s,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");let r=[t,e];s&&(r=r.concat(o?s.split(o):s)),t.indexOf(".")>-1&&(n=e,e=(r=t.split("."))[1]),this.addNamespaces(e),h(this.data,r,n),i.silent||this.emit("added",t,e,s,n)}addResources(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const n in s)"string"==typeof s[n]&&this.addResource(t,e,n,s[n],{silent:!0});n.silent||this.emit("added",t,e,s)}addResourceBundle(t,s,n,i,o){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,s];t.indexOf(".")>-1&&(i=n,n=s,s=(a=t.split("."))[1]),this.addNamespaces(s);let l=c(this.data,a)||{};i?function t(e,s,n){for(const i in s)i in e?"string"==typeof e[i]||e[i]instanceof String||"string"==typeof s[i]||s[i]instanceof String?n&&(e[i]=s[i]):t(e[i],s[i],n):e[i]=s[i];return e}(l,n,o):l=e({},l,n),h(this.data,a,l),r.silent||this.emit("added",t,s,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,s){return s||(s=this.options.defaultNS),"v1"===this.options.compatibilityAPI?e({},{},this.getResource(t,s)):this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}toJSON(){return this.data}}var m={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,s,n,i){return t.forEach(t=>{this.processors[t]&&(e=this.processors[t].process(e,s,n,i))}),e}};class y extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s,n;super(),s=t,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"].forEach(t=>{s[t]&&(n[t]=s[t])}),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=o.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};const s=this.resolve(t,e);return s&&void 0!==s.res}extractFromKey(t,e){let s=e.nsSeparator||this.options.nsSeparator;void 0===s&&(s=":");const n=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS;if(s&&t.indexOf(s)>-1){const e=t.split(s);(s!==n||s===n&&this.options.ns.indexOf(e[0])>-1)&&(i=e.shift()),t=e.join(n)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}translate(t,s){if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),s||(s={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,i=this.extractFromKey(t[t.length-1],s),o=i.key,r=i.namespaces,a=r[r.length-1],l=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(u){const t=s.nsSeparator||this.options.nsSeparator;return a+t+o}return o}const h=this.resolve(t,s);let c=h&&h.res;const p=h&&h.usedKey||o,g=h&&h.exactUsedKey||o,f=Object.prototype.toString.apply(c),d=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&c&&("string"!=typeof c&&"boolean"!=typeof c&&"number"!=typeof c)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(f)<0&&("string"!=typeof d||"[object Array]"!==f)){if(!s.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,c,s):`key '${o} (${this.language})' returned an object instead of string.`;if(n){const t="[object Array]"===f,i=t?[]:{};let o=t?g:p;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t)){const a=`${o}${n}${t}`;i[t]=this.translate(a,e({},s,{joinArrays:!1,ns:r})),i[t]===a&&(i[t]=c[t])}c=i}}else if(m&&"string"==typeof d&&"[object Array]"===f)(c=c.join(d))&&(c=this.extendTranslation(c,t,s));else{let e=!1,n=!1;if(!this.isValidLookup(c)&&void 0!==s.defaultValue){if(e=!0,void 0!==s.count){const t=this.pluralResolver.getSuffix(l,s.count);c=s[`defaultValue${t}`]}c||(c=s.defaultValue)}this.isValidLookup(c)||(n=!0,c=o);const i=s.defaultValue&&s.defaultValue!==c&&this.options.updateMissing;if(n||e||i){this.logger.log(i?"updateKey":"missingKey",l,a,o,i?s.defaultValue:c);let t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let s=0;s{this.options.missingKeyHandler?this.options.missingKeyHandler(t,a,e,i?s.defaultValue:c,i,s):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,a,e,i?s.defaultValue:c,i,s),this.emit("missingKey",t,a,e,c)};if(this.options.saveMissing){const e=void 0!==s.count&&"string"!=typeof s.count;this.options.saveMissingPlurals&&e?t.forEach(t=>{this.pluralResolver.getPluralFormsOfKey(t,o).forEach(e=>n([t],e))}):n(t,o)}}c=this.extendTranslation(c,t,s,h),n&&c===o&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${o}`),n&&this.options.parseMissingKeyHandler&&(c=this.options.parseMissingKeyHandler(c))}return c}extendTranslation(t,s,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n,i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(e({},n,{interpolation:e({},this.options.interpolation,n.interpolation)}));let s=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(s=e({},this.options.interpolation.defaultVariables,s)),t=this.interpolator.interpolate(t,s,n.lng||this.language,n),!1!==n.nest&&(t=this.interpolator.nest(t,function(){return o.translate(...arguments)},n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,a="string"==typeof r?[r]:r;return null!=t&&a&&a.length&&!1!==n.applyPostProcessor&&(t=m.handle(a,t,s,n,this)),t}resolve(t){let e,s,n,i,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,r),l=a.key;s=l;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const h=void 0!==r.count&&"string"!=typeof r.count,c=void 0!==r.context&&"string"==typeof r.context&&""!==r.context,p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach(t=>{this.isValidLookup(e)||(o=t,p.forEach(s=>{if(this.isValidLookup(e))return;i=s;let o=l;const a=[o];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,s,t,r);else{let t;h&&(t=this.pluralResolver.getSuffix(s,r.count)),h&&c&&a.push(o+t),c&&a.push(o+=`${this.options.contextSeparator}${r.context}`),h&&a.push(o+=t)}let u;for(;u=a.pop();)this.isValidLookup(e)||(n=u,e=this.getResource(s,t,u,r))}))})}),{res:e,usedKey:s,exactUsedKey:n,usedLng:i,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,s,n):this.resourceStore.getResource(t,e,s,n)}}function b(t){return t.charAt(0).toUpperCase()+t.slice(1)}class v{constructor(t){this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=o.create("languageUtils")}getScriptPartFromCode(t){if(!t||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!t||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let s=t.split("-");return this.options.lowerCaseLng?s=s.map(t=>t.toLowerCase()):2===s.length?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=b(s[1].toLowerCase()))):3===s.length&&(s[0]=s[0].toLowerCase(),2===s[1].length&&(s[1]=s[1].toUpperCase()),"sgn"!==s[0]&&2===s[2].length&&(s[2]=s[2].toUpperCase()),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=b(s[1].toLowerCase())),e.indexOf(s[2].toLowerCase())>-1&&(s[2]=b(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isWhitelisted(t){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(t=this.getLanguagePartFromCode(t)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(t)>-1}getFallbackCodes(t,e){if(!t)return[];if("string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];let s=t[e];return s||(s=t[this.getScriptPartFromCode(e)]),s||(s=t[this.formatLanguageCode(e)]),s||(s=t.default),s||[]}toResolveHierarchy(t,e){const s=this.getFallbackCodes(e||this.options.fallbackLng||[],t),n=[],i=t=>{t&&(this.isWhitelisted(t)?n.push(t):this.logger.warn(`rejecting non-whitelisted language code: ${t}`))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),s.forEach(t=>{n.indexOf(t)<0&&i(this.formatLanguageCode(t))}),n}}let x=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","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","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","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","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"],nr:[1,2,20,21],fc:22}],k={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0===t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0===t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0===t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1===t?0:2===t?1:(t<0||t>10)&&t%10==0?2:3)}};class S{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=o.create("pluralResolver"),this.rules=function(){const t={};return x.forEach(e=>{e.lngs.forEach(s=>{t[s]={numbers:e.nr,plurals:k[e.fc]}})}),t}()}addRule(t,e){this.rules[t]=e}getRule(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){const e=this.getRule(t);return e&&e.numbers.length>1}getPluralFormsOfKey(t,e){const s=[],n=this.getRule(t);return n?(n.numbers.forEach(n=>{const i=this.getSuffix(t,n);s.push(`${e}${i}`)}),s):s}getSuffix(t,e){const s=this.getRule(t);if(s){const t=s.noAbs?s.plurals(e):s.plurals(Math.abs(e));let n=s.numbers[t];this.options.simplifyPluralSuffix&&2===s.numbers.length&&1===s.numbers[0]&&(2===n?n="plural":1===n&&(n=""));const i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:i():"v2"===this.options.compatibilityJSON?i():this.options.simplifyPluralSuffix&&2===s.numbers.length&&1===s.numbers[0]?i():this.options.prepend&&t.toString()?this.options.prepend+t.toString():t.toString()}return this.logger.warn(`no plural rule found for: ${t}`),""}}class w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=o.create("interpolator"),this.init(t,!0)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(arguments.length>1?arguments[1]:void 0)&&(this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t)),t.interpolation||(t.interpolation={escapeValue:!0});const e=t.interpolation;this.escape=void 0!==e.escape?e.escape:f,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?p(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?p(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?p(e.nestingPrefix):e.nestingPrefixEscaped||p("$t("),this.nestingSuffix=e.nestingSuffix?p(e.nestingSuffix):e.nestingSuffixEscaped||p(")"),this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const e=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(e,"g");const s=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(s,"g")}interpolate(t,e,s,n){let i,o,r;function a(t){return t.replace(/\$/g,"$$$$")}const u=t=>{if(t.indexOf(this.formatSeparator)<0)return c(e,t);const n=t.split(this.formatSeparator),i=n.shift().trim(),o=n.join(this.formatSeparator).trim();return this.format(c(e,i),o,s)};this.resetRegExp();const h=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;for(r=0;(i=this.regexpUnescape.exec(t))&&(o=u(i[1].trim()),t=t.replace(i[0],o),this.regexpUnescape.lastIndex=0,!(++r>=this.maxReplaces)););for(r=0;i=this.regexp.exec(t);){if(void 0===(o=u(i[1].trim())))if("function"==typeof h){const e=h(t,i,n);o="string"==typeof e?e:""}else this.logger.warn(`missed to pass in variable ${i[1]} for interpolating ${t}`),o="";else"string"==typeof o||this.useRawValueToEscape||(o=l(o));if(o=this.escapeValue?a(this.escape(o)):a(o),t=t.replace(i[0],o),this.regexp.lastIndex=0,++r>=this.maxReplaces)break}return t}nest(t,s){let n,i,o=e({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});function r(t,s){if(t.indexOf(",")<0)return t;const n=t.split(",");t=n.shift();let i=n.join(",");i=(i=this.interpolate(i,o)).replace(/'/g,'"');try{o=JSON.parse(i),s&&(o=e({},s,o))}catch(e){this.logger.error(`failed parsing options string in nesting for key ${t}`,e)}return t}for(o.applyPostProcessor=!1;n=this.nestingRegexp.exec(t);){if((i=s(r.call(this,n[1].trim(),o),o))&&n[0]===t&&"string"!=typeof i)return i;"string"!=typeof i&&(i=l(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),i=""),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}class O extends r{constructor(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.languageUtils=s.languageUtils,this.options=n,this.logger=o.create("backendConnector"),this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,n.backend,n)}queueLoad(t,e,s,n){const i=[],o=[],r=[],a=[];return t.forEach(t=>{let n=!0;e.forEach(e=>{const r=`${t}|${e}`;!s.reload&&this.store.hasResourceBundle(t,e)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?o.indexOf(r)<0&&o.push(r):(this.state[r]=1,n=!1,o.indexOf(r)<0&&o.push(r),i.indexOf(r)<0&&i.push(r),a.indexOf(e)<0&&a.push(e)))}),n||r.push(t)}),(i.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:n}),{toLoad:i,pending:o,toLoadLanguages:r,toLoadNamespaces:a}}loaded(t,e,n){const i=s(t.split("|"),2),o=i[0],r=i[1];e&&this.emit("failedLoading",o,r,e),n&&this.store.addResourceBundle(o,r,n),this.state[t]=e?-1:2;const a={};this.queue.forEach(s=>{!function(t,e,s,n){const i=u(t,e,Object),o=i.obj,r=i.k;o[r]=o[r]||[],n&&(o[r]=o[r].concat(s)),n||o[r].push(s)}(s.loaded,[o],r),function(t,e){let s=t.indexOf(e);for(;-1!==s;)t.splice(s,1),s=t.indexOf(e)}(s.pending,t),e&&s.errors.push(e),0!==s.pending.length||s.done||(Object.keys(s.loaded).forEach(t=>{a[t]||(a[t]=[]),s.loaded[t].length&&s.loaded[t].forEach(e=>{a[t].indexOf(e)<0&&a[t].push(e)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(t=>!t.done)}read(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[s](t,e,(r,a)=>{r&&a&&n<5?setTimeout(()=>{this.read.call(this,t,e,s,n+1,2*i,o)},i):o(r,a)}):o(null,{})}prepareLoading(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=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."),n&&n();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const i=this.queueLoad(t,e,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(t=>{this.loadOne(t)})}load(t,e,s){this.prepareLoading(t,e,{},s)}reload(t,e,s){this.prepareLoading(t,e,{reload:!0},s)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=s(t.split("|"),2),i=n[0],o=n[1];this.read(i,o,"read",null,null,(s,n)=>{s&&this.logger.warn(`${e}loading namespace ${o} for language ${i} failed`,s),!s&&n&&this.logger.log(`${e}loaded namespace ${o} for language ${i}`,n),this.loaded(t,s,n)})}saveMissing(t,s,n,i,o){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(t,s,n,i,null,e({},r,{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],s,n,i)}}function R(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t}function L(){}class N extends r{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(super(),this.options=R(t),this.services={},this.logger=o,this.modules={external:[]},e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout(()=>{this.init(t,e)},0)}}init(){var t=this;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof s&&(n=s,s={}),this.options=e({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:()=>{},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){var s=t[3]||t[2];Object.keys(s).forEach(function(t){e[t]=s[t]})}return e},interpolation:{escapeValue:!0,format:(t,e,s)=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,R(s)),this.format=this.options.interpolation.format,n||(n=L),!this.options.isClone){this.modules.logger?o.init(i(this.modules.logger),this.options):o.init(null,this.options);const e=new v(this.options);this.store=new d(this.options.resources,this.options);const s=this.services;s.logger=o,s.resourceStore=this.store,s.languageUtils=e,s.pluralResolver=new S(e,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new w(this.options),s.backendConnector=new O(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i1?s-1:0),i=1;i{t.init&&t.init(this)})}["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=function(){return t.store[e](...arguments)}});const r=a(),l=()=>{this.changeLanguage(this.options.lng,(t,e)=>{this.isInitialized=!0,this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(e),n(t,e)})};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),r}loadResources(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();const e=[],s=t=>{if(!t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{e.indexOf(t)<0&&e.push(t)})};if(this.language)s(this.language);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>s(t))}this.options.preload&&this.options.preload.forEach(t=>s(t)),this.services.backendConnector.load(e,this.options.ns,t)}else t(null)}reloadResources(t,e,s){const n=a();return t||(t=this.languages),e||(e=this.options.ns),s||(s=L),this.services.backendConnector.reload(t,e,()=>{n.resolve(),s(null)}),n}use(t){return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&m.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}changeLanguage(t,e){var s=this;const n=a(),i=(t,i)=>{this.translator.changeLanguage(i),i&&(this.emit("languageChanged",i),this.logger.log("languageChanged",i)),n.resolve(function(){return s.t(...arguments)}),e&&e(t,function(){return s.t(...arguments)})},o=t=>{t&&(this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.translator.language||this.translator.changeLanguage(t),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage(t)),this.loadResources(e=>{i(e,t)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),n}getFixedT(t,s){var n=this;const i=function t(s,i){let o=e({},i);if("object"!=typeof i){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}),this.loadResources(t=>{s.resolve(),e&&e(t)}),s):(e&&e(),Promise.resolve())}loadLanguages(t,e){const s=a();"string"==typeof t&&(t=[t]);const n=this.options.preload||[],i=t.filter(t=>n.indexOf(t)<0);return i.length?(this.options.preload=n.concat(i),this.loadResources(t=>{s.resolve(),e&&e(t)}),s):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),!t)return"rtl";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","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}createInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new N(t,e)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L;const n=e({},this.options,t,{isClone:!0}),i=new N(n);return["store","services","language"].forEach(t=>{i[t]=this[t]}),i.translator=new y(i.services,i.options),i.translator.on("*",function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||n,this.options=e,this.debug=e.debug}setDebug(t){this.debug=t}log(){for(var t=arguments.length,e=new Array(t),s=0;s{this.observers[t]=this.observers[t]||[],this.observers[t].push(e)}),this}off(t,e){this.observers[t]&&this.observers[t].forEach(()=>{if(e){const s=this.observers[t].indexOf(e);s>-1&&this.observers[t].splice(s,1)}else delete this.observers[t]})}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n{t(...s)})}if(this.observers["*"]){[].concat(this.observers["*"]).forEach(e=>{e.apply(e,[t,...s])})}}}function a(){let t,e;const s=new Promise((s,n)=>{t=s,e=n});return s.resolve=t,s.reject=e,s}function l(t){return null==t?"":""+t}function u(t,e,s){function n(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}const o="string"!=typeof e?[].concat(e):e.split(".");for(;o.length>1;){if(i())return{};const e=n(o.shift());!t[e]&&s&&(t[e]=new s),t=t[e]}return i()?{}:{obj:t,k:n(o.shift())}}function h(t,e,s){const n=u(t,e,Object);n.obj[n.k]=s}function c(t,e){const s=u(t,e),n=s.obj,i=s.k;if(n)return n[i]}function p(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var g={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function f(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,t=>g[t]):t}class d extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator=".")}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let o=[t,e];return s&&"string"!=typeof s&&(o=o.concat(s)),s&&"string"==typeof s&&(o=o.concat(i?s.split(i):s)),t.indexOf(".")>-1&&(o=t.split(".")),c(this.data,o)}addResource(t,e,s,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");let r=[t,e];s&&(r=r.concat(o?s.split(o):s)),t.indexOf(".")>-1&&(n=e,e=(r=t.split("."))[1]),this.addNamespaces(e),h(this.data,r,n),i.silent||this.emit("added",t,e,s,n)}addResources(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const n in s)"string"==typeof s[n]&&this.addResource(t,e,n,s[n],{silent:!0});n.silent||this.emit("added",t,e,s)}addResourceBundle(t,s,n,i,o){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,s];t.indexOf(".")>-1&&(i=n,n=s,s=(a=t.split("."))[1]),this.addNamespaces(s);let l=c(this.data,a)||{};i?function t(e,s,n){for(const i in s)i in e?"string"==typeof e[i]||e[i]instanceof String||"string"==typeof s[i]||s[i]instanceof String?n&&(e[i]=s[i]):t(e[i],s[i],n):e[i]=s[i];return e}(l,n,o):l=e({},l,n),h(this.data,a,l),r.silent||this.emit("added",t,s,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,s){return s||(s=this.options.defaultNS),"v1"===this.options.compatibilityAPI?e({},{},this.getResource(t,s)):this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}toJSON(){return this.data}}var m={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,s,n,i){return t.forEach(t=>{this.processors[t]&&(e=this.processors[t].process(e,s,n,i))}),e}};class y extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s,n;super(),s=t,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"].forEach(t=>{s[t]&&(n[t]=s[t])}),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=o.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};const s=this.resolve(t,e);return s&&void 0!==s.res}extractFromKey(t,e){let s=e.nsSeparator||this.options.nsSeparator;void 0===s&&(s=":");const n=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS;if(s&&t.indexOf(s)>-1){const e=t.split(s);(s!==n||s===n&&this.options.ns.indexOf(e[0])>-1)&&(i=e.shift()),t=e.join(n)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}translate(t,s){if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),s||(s={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,i=this.extractFromKey(t[t.length-1],s),o=i.key,r=i.namespaces,a=r[r.length-1],l=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(u){const t=s.nsSeparator||this.options.nsSeparator;return a+t+o}return o}const h=this.resolve(t,s);let c=h&&h.res;const p=h&&h.usedKey||o,g=h&&h.exactUsedKey||o,f=Object.prototype.toString.apply(c),d=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&c&&("string"!=typeof c&&"boolean"!=typeof c&&"number"!=typeof c)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(f)<0&&("string"!=typeof d||"[object Array]"!==f)){if(!s.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,c,s):`key '${o} (${this.language})' returned an object instead of string.`;if(n){const t="[object Array]"===f,i=t?[]:{};let o=t?g:p;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t)){const a=`${o}${n}${t}`;i[t]=this.translate(a,e({},s,{joinArrays:!1,ns:r})),i[t]===a&&(i[t]=c[t])}c=i}}else if(m&&"string"==typeof d&&"[object Array]"===f)(c=c.join(d))&&(c=this.extendTranslation(c,t,s));else{let e=!1,n=!1;if(!this.isValidLookup(c)&&void 0!==s.defaultValue){if(e=!0,void 0!==s.count){const t=this.pluralResolver.getSuffix(l,s.count);c=s[`defaultValue${t}`]}c||(c=s.defaultValue)}this.isValidLookup(c)||(n=!0,c=o);const i=s.defaultValue&&s.defaultValue!==c&&this.options.updateMissing;if(n||e||i){this.logger.log(i?"updateKey":"missingKey",l,a,o,i?s.defaultValue:c);let t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let s=0;s{this.options.missingKeyHandler?this.options.missingKeyHandler(t,a,e,i?s.defaultValue:c,i,s):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,a,e,i?s.defaultValue:c,i,s),this.emit("missingKey",t,a,e,c)};if(this.options.saveMissing){const e=void 0!==s.count&&"string"!=typeof s.count;this.options.saveMissingPlurals&&e?t.forEach(t=>{this.pluralResolver.getPluralFormsOfKey(t,o).forEach(e=>n([t],e))}):n(t,o)}}c=this.extendTranslation(c,t,s,h),n&&c===o&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${o}`),n&&this.options.parseMissingKeyHandler&&(c=this.options.parseMissingKeyHandler(c))}return c}extendTranslation(t,s,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n,i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(e({},n,{interpolation:e({},this.options.interpolation,n.interpolation)}));let s=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(s=e({},this.options.interpolation.defaultVariables,s)),t=this.interpolator.interpolate(t,s,n.lng||this.language,n),!1!==n.nest&&(t=this.interpolator.nest(t,function(){return o.translate(...arguments)},n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,a="string"==typeof r?[r]:r;return null!=t&&a&&a.length&&!1!==n.applyPostProcessor&&(t=m.handle(a,t,s,n,this)),t}resolve(t){let e,s,n,i,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,r),l=a.key;s=l;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const h=void 0!==r.count&&"string"!=typeof r.count,c=void 0!==r.context&&"string"==typeof r.context&&""!==r.context,p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach(t=>{this.isValidLookup(e)||(o=t,p.forEach(s=>{if(this.isValidLookup(e))return;i=s;let o=l;const a=[o];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,s,t,r);else{let t;h&&(t=this.pluralResolver.getSuffix(s,r.count)),h&&c&&a.push(o+t),c&&a.push(o+=`${this.options.contextSeparator}${r.context}`),h&&a.push(o+=t)}let u;for(;u=a.pop();)this.isValidLookup(e)||(n=u,e=this.getResource(s,t,u,r))}))})}),{res:e,usedKey:s,exactUsedKey:n,usedLng:i,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,s,n):this.resourceStore.getResource(t,e,s,n)}}function b(t){return t.charAt(0).toUpperCase()+t.slice(1)}class v{constructor(t){this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=o.create("languageUtils")}getScriptPartFromCode(t){if(!t||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!t||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let s=t.split("-");return this.options.lowerCaseLng?s=s.map(t=>t.toLowerCase()):2===s.length?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=b(s[1].toLowerCase()))):3===s.length&&(s[0]=s[0].toLowerCase(),2===s[1].length&&(s[1]=s[1].toUpperCase()),"sgn"!==s[0]&&2===s[2].length&&(s[2]=s[2].toUpperCase()),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=b(s[1].toLowerCase())),e.indexOf(s[2].toLowerCase())>-1&&(s[2]=b(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isWhitelisted(t){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(t=this.getLanguagePartFromCode(t)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(t)>-1}getFallbackCodes(t,e){if(!t)return[];if("string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];let s=t[e];return s||(s=t[this.getScriptPartFromCode(e)]),s||(s=t[this.formatLanguageCode(e)]),s||(s=t.default),s||[]}toResolveHierarchy(t,e){const s=this.getFallbackCodes(e||this.options.fallbackLng||[],t),n=[],i=t=>{t&&(this.isWhitelisted(t)?n.push(t):this.logger.warn(`rejecting non-whitelisted language code: ${t}`))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),s.forEach(t=>{n.indexOf(t)<0&&i(this.formatLanguageCode(t))}),n}}let x=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","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","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","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","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"],nr:[1,2,20,21],fc:22}],k={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0===t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0===t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0===t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1===t?0:2===t?1:(t<0||t>10)&&t%10==0?2:3)}};class S{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=o.create("pluralResolver"),this.rules=function(){const t={};return x.forEach(e=>{e.lngs.forEach(s=>{t[s]={numbers:e.nr,plurals:k[e.fc]}})}),t}()}addRule(t,e){this.rules[t]=e}getRule(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){const e=this.getRule(t);return e&&e.numbers.length>1}getPluralFormsOfKey(t,e){const s=[],n=this.getRule(t);return n?(n.numbers.forEach(n=>{const i=this.getSuffix(t,n);s.push(`${e}${i}`)}),s):s}getSuffix(t,e){const s=this.getRule(t);if(s){const t=s.noAbs?s.plurals(e):s.plurals(Math.abs(e));let n=s.numbers[t];this.options.simplifyPluralSuffix&&2===s.numbers.length&&1===s.numbers[0]&&(2===n?n="plural":1===n&&(n=""));const i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:i():"v2"===this.options.compatibilityJSON?i():this.options.simplifyPluralSuffix&&2===s.numbers.length&&1===s.numbers[0]?i():this.options.prepend&&t.toString()?this.options.prepend+t.toString():t.toString()}return this.logger.warn(`no plural rule found for: ${t}`),""}}class w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=o.create("interpolator"),this.init(t,!0)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(arguments.length>1?arguments[1]:void 0)&&(this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t)),t.interpolation||(t.interpolation={escapeValue:!0});const e=t.interpolation;this.escape=void 0!==e.escape?e.escape:f,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?p(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?p(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?p(e.nestingPrefix):e.nestingPrefixEscaped||p("$t("),this.nestingSuffix=e.nestingSuffix?p(e.nestingSuffix):e.nestingSuffixEscaped||p(")"),this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const e=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(e,"g");const s=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(s,"g")}interpolate(t,e,s,n){let i,o,r;function a(t){return t.replace(/\$/g,"$$$$")}const u=t=>{if(t.indexOf(this.formatSeparator)<0)return c(e,t);const n=t.split(this.formatSeparator),i=n.shift().trim(),o=n.join(this.formatSeparator).trim();return this.format(c(e,i),o,s)};this.resetRegExp();const h=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;for(r=0;(i=this.regexpUnescape.exec(t))&&(o=u(i[1].trim()),t=t.replace(i[0],o),this.regexpUnescape.lastIndex=0,!(++r>=this.maxReplaces)););for(r=0;i=this.regexp.exec(t);){if(void 0===(o=u(i[1].trim())))if("function"==typeof h){const e=h(t,i,n);o="string"==typeof e?e:""}else this.logger.warn(`missed to pass in variable ${i[1]} for interpolating ${t}`),o="";else"string"==typeof o||this.useRawValueToEscape||(o=l(o));if(o=this.escapeValue?a(this.escape(o)):a(o),t=t.replace(i[0],o),this.regexp.lastIndex=0,++r>=this.maxReplaces)break}return t}nest(t,s){let n,i,o=e({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});function r(t,s){if(t.indexOf(",")<0)return t;const n=t.split(",");t=n.shift();let i=n.join(",");i=(i=this.interpolate(i,o)).replace(/'/g,'"');try{o=JSON.parse(i),s&&(o=e({},s,o))}catch(e){this.logger.error(`failed parsing options string in nesting for key ${t}`,e)}return t}for(o.applyPostProcessor=!1;n=this.nestingRegexp.exec(t);){if((i=s(r.call(this,n[1].trim(),o),o))&&n[0]===t&&"string"!=typeof i)return i;"string"!=typeof i&&(i=l(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),i=""),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}class O extends r{constructor(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.languageUtils=s.languageUtils,this.options=n,this.logger=o.create("backendConnector"),this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,n.backend,n)}queueLoad(t,e,s,n){const i=[],o=[],r=[],a=[];return t.forEach(t=>{let n=!0;e.forEach(e=>{const r=`${t}|${e}`;!s.reload&&this.store.hasResourceBundle(t,e)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?o.indexOf(r)<0&&o.push(r):(this.state[r]=1,n=!1,o.indexOf(r)<0&&o.push(r),i.indexOf(r)<0&&i.push(r),a.indexOf(e)<0&&a.push(e)))}),n||r.push(t)}),(i.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:n}),{toLoad:i,pending:o,toLoadLanguages:r,toLoadNamespaces:a}}loaded(t,e,n){const i=s(t.split("|"),2),o=i[0],r=i[1];e&&this.emit("failedLoading",o,r,e),n&&this.store.addResourceBundle(o,r,n),this.state[t]=e?-1:2;const a={};this.queue.forEach(s=>{!function(t,e,s,n){const i=u(t,e,Object),o=i.obj,r=i.k;o[r]=o[r]||[],n&&(o[r]=o[r].concat(s)),n||o[r].push(s)}(s.loaded,[o],r),function(t,e){let s=t.indexOf(e);for(;-1!==s;)t.splice(s,1),s=t.indexOf(e)}(s.pending,t),e&&s.errors.push(e),0!==s.pending.length||s.done||(Object.keys(s.loaded).forEach(t=>{a[t]||(a[t]=[]),s.loaded[t].length&&s.loaded[t].forEach(e=>{a[t].indexOf(e)<0&&a[t].push(e)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(t=>!t.done)}read(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[s](t,e,(r,a)=>{r&&a&&n<5?setTimeout(()=>{this.read.call(this,t,e,s,n+1,2*i,o)},i):o(r,a)}):o(null,{})}prepareLoading(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=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."),n&&n();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const i=this.queueLoad(t,e,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(t=>{this.loadOne(t)})}load(t,e,s){this.prepareLoading(t,e,{},s)}reload(t,e,s){this.prepareLoading(t,e,{reload:!0},s)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=s(t.split("|"),2),i=n[0],o=n[1];this.read(i,o,"read",null,null,(s,n)=>{s&&this.logger.warn(`${e}loading namespace ${o} for language ${i} failed`,s),!s&&n&&this.logger.log(`${e}loaded namespace ${o} for language ${i}`,n),this.loaded(t,s,n)})}saveMissing(t,s,n,i,o){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(t,s,n,i,null,e({},r,{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],s,n,i)}}function R(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t}function L(){}class N extends r{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(super(),this.options=R(t),this.services={},this.logger=o,this.modules={external:[]},e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout(()=>{this.init(t,e)},0)}}init(){var t=this;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof s&&(n=s,s={}),this.options=e({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:()=>{},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){var s=t[3]||t[2];Object.keys(s).forEach(function(t){e[t]=s[t]})}return e},interpolation:{escapeValue:!0,format:(t,e,s)=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,R(s)),this.format=this.options.interpolation.format,n||(n=L),!this.options.isClone){this.modules.logger?o.init(i(this.modules.logger),this.options):o.init(null,this.options);const e=new v(this.options);this.store=new d(this.options.resources,this.options);const s=this.services;s.logger=o,s.resourceStore=this.store,s.languageUtils=e,s.pluralResolver=new S(e,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new w(this.options),s.backendConnector=new O(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i1?s-1:0),i=1;i{t.init&&t.init(this)})}["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=function(){return t.store[e](...arguments)}});const r=a(),l=()=>{this.changeLanguage(this.options.lng,(t,e)=>{this.isInitialized=!0,this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(e),n(t,e)})};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),r}loadResources(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();const e=[],s=t=>{if(!t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{e.indexOf(t)<0&&e.push(t)})};if(this.language)s(this.language);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>s(t))}this.options.preload&&this.options.preload.forEach(t=>s(t)),this.services.backendConnector.load(e,this.options.ns,t)}else t(null)}reloadResources(t,e,s){const n=a();return t||(t=this.languages),e||(e=this.options.ns),s||(s=L),this.services.backendConnector.reload(t,e,()=>{n.resolve(),s(null)}),n}use(t){return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&m.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}changeLanguage(t,e){var s=this;const n=a(),i=(t,i)=>{this.translator.changeLanguage(i),i&&(this.emit("languageChanged",i),this.logger.log("languageChanged",i)),n.resolve(function(){return s.t(...arguments)}),e&&e(t,function(){return s.t(...arguments)})},o=t=>{t&&(this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.translator.language||this.translator.changeLanguage(t),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage(t)),this.loadResources(e=>{i(e,t)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),n}getFixedT(t,s){var n=this;const i=function t(s,i){let o=e({},i);if("object"!=typeof i){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}),this.loadResources(t=>{s.resolve(),e&&e(t)}),s):(e&&e(),Promise.resolve())}loadLanguages(t,e){const s=a();"string"==typeof t&&(t=[t]);const n=this.options.preload||[],i=t.filter(t=>n.indexOf(t)<0);return i.length?(this.options.preload=n.concat(i),this.loadResources(t=>{s.resolve(),e&&e(t)}),s):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),!t)return"rtl";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","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}createInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new N(t,e)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L;const n=e({},this.options,t,{isClone:!0}),i=new N(n);return["store","services","language"].forEach(t=>{i[t]=this[t]}),i.translator=new y(i.services,i.options),i.translator.on("*",function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n