(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.i18next=t()})(this,function(){"use strict";function p(n){return n==null?"":""+n}function et(n,t,i){n.forEach(function(n){t[n]&&(i[n]=t[n])})}function l(n,t,i){function f(n){return n&&n.indexOf("###")>-1?n.replace(/###/g,"."):n}for(var u=typeof t!="string"?[].concat(t):t.split("."),r;u.length>1;){if(!n)return{};r=f(u.shift());!n[r]&&i&&(n[r]=new i);n=n[r]}return n?{obj:n,k:f(u.shift())}:{}}function w(n,t,i){var r=l(n,t,Object),u=r.obj,f=r.k;u[f]=i}function ot(n,t,i,r){var e=l(n,t,Object),u=e.obj,f=e.k;u[f]=u[f]||[];r&&(u[f]=u[f].concat(i));r||u[f].push(i)}function u(n,t){var i=l(n,t),r=i.obj,u=i.k;return r?r[u]:undefined}function b(n,t,i){for(var r in t)r in n?typeof n[r]=="string"||n[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?i&&(n[r]=t[r]):b(n[r],t[r],i):n[r]=t[r];return n}function r(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function k(n){return typeof n=="string"?n.replace(/[&<>"'\/]/g,function(n){return st[n]}):n}function a(n){return n.interpolation={unescapeSuffix:"HTML"},n.interpolation.prefix=n.interpolationPrefix||"__",n.interpolation.suffix=n.interpolationSuffix||"__",n.interpolation.escapeValue=n.escapeInterpolation||!1,n.interpolation.nestingPrefix=n.reusePrefix||"$t(",n.interpolation.nestingSuffix=n.reuseSuffix||")",n}function ct(n){return n.resStore&&(n.resources=n.resStore),n.ns&&n.ns.defaultNs?(n.defaultNS=n.ns.defaultNs,n.ns=n.ns.namespaces):n.defaultNS=n.ns||"translation",n.fallbackToDefaultNS&&n.defaultNS&&(n.fallbackNS=n.defaultNS),n.saveMissing=n.sendMissing,n.saveMissingTo=n.sendMissingTo||"current",n.returnNull=n.fallbackOnNull?!1:!0,n.returnEmptyString=n.fallbackOnEmpty?!1:!0,n.returnObjects=n.returnObjectTrees,n.joinArrays="\n",n.returnedObjectHandler=n.objectTreeKeyHandler,n.parseMissingKeyHandler=n.parseMissingKey,n.appendNamespaceToMissingKey=!0,n.nsSeparator=n.nsseparator,n.keySeparator=n.keyseparator,n.shortcutFunction==="sprintf"&&(n.overloadTranslationOptionHandler=function(n){for(var i=[],t=1;t1&&arguments[1]!==undefined?arguments[1]:{};i(this,t);this.init(n,r)}return t.prototype.init=function(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=t.prefix||"i18next:";this.logger=n||ut;this.options=t;this.debug=t.debug===!1?!1:!0},t.prototype.setDebug=function(n){this.debug=n},t.prototype.log=function(){this.forward(arguments,"log","",!0)},t.prototype.warn=function(){this.forward(arguments,"warn","",!0)},t.prototype.error=function(){this.forward(arguments,"error","")},t.prototype.deprecate=function(){this.forward(arguments,"warn","WARNING DEPRECATED: ",!0)},t.prototype.forward=function(n,t,i,r){(!r||this.debug)&&(typeof n[0]=="string"&&(n[0]=i+this.prefix+" "+n[0]),this.logger[t](n))},t.prototype.create=function(i){return new t(this.logger,n({prefix:this.prefix+":"+i+":"},this.options))},t}(),t=new ft,o=function(){function n(){i(this,n);this.observers={}}return n.prototype.on=function(n,t){var i=this;n.split(" ").forEach(function(n){i.observers[n]=i.observers[n]||[];i.observers[n].push(t)})},n.prototype.off=function(n,t){var i=this;this.observers[n]&&this.observers[n].forEach(function(){if(t){var r=i.observers[n].indexOf(t);r>-1&&i.observers[n].splice(r,1)}else delete i.observers[n]})},n.prototype.emit=function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),t=1;t":">",'"':""","'":"'","/":"/"},ht=function(t){function r(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"},n;return i(this,r),n=e(this,t.call(this)),n.data=u,n.options=f,n}return f(r,t),r.prototype.addNamespaces=function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)},r.prototype.removeNamespaces=function(n){var t=this.options.ns.indexOf(n);t>-1&&this.options.ns.splice(t,1)},r.prototype.getResource=function(n,t,i){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},f=e.keySeparator||this.options.keySeparator,r;return f===undefined&&(f="."),r=[n,t],i&&typeof i!="string"&&(r=r.concat(i)),i&&typeof i=="string"&&(r=r.concat(f?i.split(f):i)),n.indexOf(".")>-1&&(r=n.split(".")),u(this.data,r)},r.prototype.addResource=function(n,t,i,r){var e=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:!1},f=this.options.keySeparator,u;f===undefined&&(f=".");u=[n,t];i&&(u=u.concat(f?i.split(f):i));n.indexOf(".")>-1&&(u=n.split("."),r=t,t=u[1]);this.addNamespaces(t);w(this.data,u,r);e.silent||this.emit("added",n,t,i,r)},r.prototype.addResources=function(n,t,i){for(var r in i)typeof i[r]=="string"&&this.addResource(n,t,r,i[r],{silent:!0});this.emit("added",n,t,i)},r.prototype.addResourceBundle=function(t,i,r,f,e){var s=[t,i],o;t.indexOf(".")>-1&&(s=t.split("."),f=r,r=i,i=s[1]);this.addNamespaces(i);o=u(this.data,s)||{};f?b(o,r,e):o=n({},o,r);w(this.data,s,o);this.emit("added",t,i,r)},r.prototype.removeResourceBundle=function(n,t){this.hasResourceBundle(n,t)&&delete this.data[n][t];this.removeNamespaces(t);this.emit("removed",n,t)},r.prototype.hasResourceBundle=function(n,t){return this.getResource(n,t)!==undefined},r.prototype.getResourceBundle=function(t,i){return(i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1")?n({},this.getResource(t,i)):this.getResource(t,i)},r.prototype.toJSON=function(){return this.data},r}(o),d={processors:{},addPostProcessor:function(n){this.processors[n.name]=n},handle:function(n,t,i,r,u){var f=this;return n.forEach(function(n){f.processors[n]&&(t=f.processors[n].process(t,i,r,u))}),t}},nt=function(r){function u(n){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},f;return i(this,u),f=e(this,r.call(this)),et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector"],n,f),f.options=o,f.logger=t.create("translator"),f}return f(u,r),u.prototype.changeLanguage=function(n){n&&(this.language=n)},u.prototype.exists=function(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};return this.options.compatibilityAPI==="v1"&&(t=g(t)),this.resolve(n,t)!==undefined},u.prototype.extractFromKey=function(n,t){var r=t.nsSeparator||this.options.nsSeparator,i,u;return r===undefined&&(r=":"),i=t.ns||this.options.defaultNS,r&&n.indexOf(r)>-1&&(u=n.split(r),i=u[0],n=u[1]),typeof i=="string"&&(i=[i]),{key:n,namespaces:i}},u.prototype.translate=function(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},h,p,w,b,o,f,s,a;if((typeof r=="undefined"?"undefined":c(r))!=="object"?r=this.options.overloadTranslationOptionHandler(arguments):this.options.compatibilityAPI==="v1"&&(r=g(r)),t===undefined||t===null||t==="")return"";if(typeof t=="number"&&(t=String(t)),typeof t=="string"&&(t=[t]),h=r.lng||this.language,h&&h.toLowerCase()==="cimode")return t[t.length-1];var d=r.keySeparator||this.options.keySeparator||".",k=this.extractFromKey(t[t.length-1],r),u=k.key,v=k.namespaces,e=v[v.length-1],i=this.resolve(t,r),l=Object.prototype.toString.apply(i),y=r.joinArrays!==undefined?r.joinArrays:this.options.joinArrays;if(i&&typeof i!="string"&&["[object Number]","[object Function]","[object RegExp]"].indexOf(l)<0&&!(y&&l==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(u,i,r):"key '"+u+" ("+this.language+")' returned an object instead of string.";p=l==="[object Array]"?[]:{};for(w in i)p[w]=this.translate(""+u+d+w,n({joinArrays:!1,ns:v},r));i=p}else if(y&&l==="[object Array]")i=i.join(y),i&&(i=this.extendTranslation(i,u,r));else{if(b=!1,o=!1,this.isValidLookup(i)||r.defaultValue===undefined||(b=!0,i=r.defaultValue),this.isValidLookup(i)||(o=!0,i=u),o||b){if(this.logger.log("missingKey",h,e,u,i),f=[],s=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language),this.options.saveMissingTo==="fallback"&&s&&s[0])for(a=0;a1&&arguments[1]!==undefined?arguments[1]:{},r=void 0;return typeof n=="string"&&(n=[n]),n.forEach(function(n){if(!t.isValidLookup(r)){var e=t.extractFromKey(n,i),s=e.key,u=e.namespaces;t.options.fallbackNS&&(u=u.concat(t.options.fallbackNS));var f=i.count!==undefined&&typeof i.count!="string",o=i.context!==undefined&&typeof i.context=="string"&&i.context!=="",h=i.lngs?i.lngs:t.languageUtils.toResolveHierarchy(i.lng||t.language);u.forEach(function(n){t.isValidLookup(r)||h.forEach(function(u){var l;if(!t.isValidLookup(r)){var e=s,h=[e],c=void 0;for(f&&(c=t.pluralResolver.getSuffix(u,i.count)),f&&o&&h.push(e+c),o&&h.push(e+=""+t.options.contextSeparator+i.context),f&&h.push(e+=c),l=void 0;l=h.pop();)t.isValidLookup(r)||(r=t.getResource(u,n,l,i))}})})}}),r},u.prototype.isValidLookup=function(n){return n!==undefined&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")},u.prototype.getResource=function(n,t,i){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return this.resourceStore.getResource(n,t,i,r)},u}(o),vt=function(){function n(r){i(this,n);this.options=r;this.whitelist=this.options.whitelist||!1;this.logger=t.create("languageUtils")}return n.prototype.getLanguagePartFromCode=function(n){if(n.indexOf("-")<0)return n;var t=n.split("-");return this.formatLanguageCode(["NB-NO","NN-NO","nb-NO","nn-NO","nb-no","nn-no"].indexOf(n)>-1?t[1].toLowerCase():t[0])},n.prototype.getScriptPartFromCode=function(n){if(n.indexOf("-")<0)return null;var t=n.split("-");return t.length===2?null:(t.pop(),this.formatLanguageCode(t.join("-")))},n.prototype.getLanguagePartFromCode=function(n){if(n.indexOf("-")<0)return n;var t=n.split("-");return this.formatLanguageCode(["NB-NO","NN-NO","nb-NO","nn-NO","nb-no","nn-no"].indexOf(n)>-1?t[1].toLowerCase():t[0])},n.prototype.formatLanguageCode=function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],t=n.split("-");return this.options.lowerCaseLng?t=t.map(function(n){return n.toLowerCase()}):t.length===2?(t[0]=t[0].toLowerCase(),t[1]=t[1].toUpperCase(),i.indexOf(t[1].toLowerCase())>-1&&(t[1]=v(t[1].toLowerCase()))):t.length===3&&(t[0]=t[0].toLowerCase(),t[1].length===2&&(t[1]=t[1].toUpperCase()),t[0]!=="sgn"&&t[2].length===2&&(t[2]=t[2].toUpperCase()),i.indexOf(t[1].toLowerCase())>-1&&(t[1]=v(t[1].toLowerCase())),i.indexOf(t[2].toLowerCase())>-1&&(t[2]=v(t[2].toLowerCase()))),t.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n},n.prototype.isWhitelisted=function(n,t){return(this.options.load==="languageOnly"||this.options.nonExplicitWhitelist&&!t)&&(n=this.getLanguagePartFromCode(n)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(n)>-1?!0:!1},n.prototype.getFallbackCodes=function(n,t){if(!n)return[];if(typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;var i=n[t];return i||(i=n[this.getScriptPartFromCode(t)]),i||(i=n[this.formatLanguageCode(t)]),i||(i=n.default),i||[]},n.prototype.toResolveHierarchy=function(n,t){var r=this,f=this.getFallbackCodes(t||this.options.fallbackLng||[],n),u=[],i=function(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;n&&(r.isWhitelisted(n,t)?u.push(n):r.logger.warn("rejecting non-whitelisted language code: "+n))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(n),!0),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(n),!0),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(n))):typeof n=="string"&&i(this.formatLanguageCode(n)),f.forEach(function(n){u.indexOf(n)<0&&i(r.formatLanguageCode(n))}),u},n}(),yt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","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","es_ar","et","eu","fi","fo","fur","fy","gl","gu","ha","he","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_br","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}],pt={1:function(n){return Number(n>1)},2:function(n){return Number(n!=1)},3:function(){return 0},4:function(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},5:function(n){return Number(n===0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5)},6:function(n){return Number(n==1?0:n>=2&&n<=4?1:2)},7:function(n){return Number(n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},8:function(n){return Number(n==1?0:n==2?1:n!=8&&n!=11?2:3)},9:function(n){return Number(n>=2)},10:function(n){return Number(n==1?0:n==2?1:n<7?2:n<11?3:4)},11:function(n){return Number(n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3)},12:function(n){return Number(n%10!=1||n%100==11)},13:function(n){return Number(n!==0)},14:function(n){return Number(n==1?0:n==2?1:n==3?2:3)},15:function(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2)},16:function(n){return Number(n%10==1&&n%100!=11?0:n!==0?1:2)},17:function(n){return Number(n==1||n%10==1?0:1)},18:function(n){return Number(n==0?0:n==1?1:2)},19:function(n){return Number(n==1?0:n===0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3)},20:function(n){return Number(n==1?0:n===0||n%100>0&&n%100<20?1:2)},21:function(n){return Number(n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0)}},bt=function(){function n(r){var u=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};i(this,n);this.languageUtils=r;this.options=u;this.logger=t.create("pluralResolver");this.rules=wt()}return n.prototype.addRule=function(n,t){this.rules[n]=t},n.prototype.getRule=function(n){return this.rules[this.languageUtils.getLanguagePartFromCode(n)]},n.prototype.needsPlural=function(n){var t=this.getRule(n);return t&&t.numbers.length<=1?!1:!0},n.prototype.getSuffix=function(n,t){var r=this,i=this.getRule(n),u;if(i){if(u=function(){var u,n,f;return i.numbers.length===1?{v:""}:(u=i.noAbs?i.plurals(t):i.plurals(Math.abs(t)),n=i.numbers[u],i.numbers.length===2&&i.numbers[0]===1&&(n===2?n="plural":n===1&&(n="")),f=function(){return r.options.prepend&&n.toString()?r.options.prepend+n.toString():n.toString()},r.options.compatibilityJSON==="v1")?n===1?{v:""}:typeof n=="number"?{v:"_plural_"+n.toString()}:{v:f()}:r.options.compatibilityJSON==="v2"||i.numbers.length===2&&i.numbers[0]===1?{v:f()}:i.numbers.length===2&&i.numbers[0]===1?{v:f()}:{v:r.options.prepend&&u.toString()?r.options.prepend+u.toString():u.toString()}}(),(typeof u=="undefined"?"undefined":c(u))==="object")return u.v}else return this.logger.warn("no plural rule found for: "+n),""},n}(),kt=function(){function n(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};i(this,n);this.logger=t.create("interpolator");this.init(r,!0)}return n.prototype.init=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=arguments[1],n;i&&(this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.escape=t.interpolation&&t.interpolation.escape||k);t.interpolation||(t.interpolation={escapeValue:!0});n=t.interpolation;this.escapeValue=n.escapeValue!==undefined?n.escapeValue:!0;this.prefix=n.prefix?r(n.prefix):n.prefixEscaped||"{{";this.suffix=n.suffix?r(n.suffix):n.suffixEscaped||"}}";this.formatSeparator=n.formatSeparator?r(n.formatSeparator):n.formatSeparator||",";this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"";this.nestingPrefix=n.nestingPrefix?r(n.nestingPrefix):n.nestingPrefixEscaped||r("$t(");this.nestingSuffix=n.nestingSuffix?r(n.nestingSuffix):n.nestingSuffixEscaped||r(")");this.resetRegExp()},n.prototype.reset=function(){this.options&&this.init(this.options)},n.prototype.resetRegExp=function(){var i=this.prefix+"(.+?)"+this.suffix,n,t;this.regexp=new RegExp(i,"g");n=this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(n,"g");t=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(t,"g")},n.prototype.interpolate=function(n,t,i){function o(n){return n.replace(/\$/g,"$$$$")}var e=this,f=void 0,r=void 0,s=function(n){if(n.indexOf(e.formatSeparator)<0)return u(t,n);var r=n.split(e.formatSeparator),f=r.shift().trim(),o=r.join(e.formatSeparator).trim();return e.format(u(t,f),o,i)},h;for(this.resetRegExp();f=this.regexpUnescape.exec(n);)h=s(f[1].trim()),n=n.replace(f[0],h),this.regexpUnescape.lastIndex=0;while(f=this.regexp.exec(n))r=s(f[1].trim()),typeof r!="string"&&(r=p(r)),r||(this.logger.warn("missed to pass in variable "+f[1]+" for interpolating "+n),r=""),r=this.escapeValue?o(this.escape(r)):o(r),n=n.replace(f[0],r),this.regexp.lastIndex=0;return n},n.prototype.nest=function(n,t){function f(n){return n.replace(/\$/g,"$$$$")}function o(n){var i,t;if(n.indexOf(",")<0)return n;i=n.split(",");n=i.shift();t=i.join(",");t=this.interpolate(t,u);t=t.replace(/'/g,'"');try{u=JSON.parse(t)}catch(r){this.logger.error("failed parsing options string in nesting for key "+n,r)}return n}var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},r=void 0,i=void 0,u=JSON.parse(JSON.stringify(e));for(u.applyPostProcessor=!1;r=this.nestingRegexp.exec(n);)i=t(o.call(this,r[1].trim()),u),typeof i!="string"&&(i=p(i)),i||(this.logger.warn("missed to pass in variable "+r[1]+" for interpolating "+n),i=""),i=this.escapeValue?f(k(i)):f(i),n=n.replace(r[0],i),this.regexp.lastIndex=0;return n},n}(),gt=function(r){function o(n,u,f){var h=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},s;return i(this,o),s=e(this,r.call(this)),s.backend=n,s.store=u,s.services=f,s.options=h,s.logger=t.create("backendConnector"),s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(f,h.backend,h),s}return f(o,r),o.prototype.queueLoad=function(n,t,i){var u=this,f=[],r=[],o=[],e=[];return n.forEach(function(n){var i=!0;t.forEach(function(t){var o=n+"|"+t;u.store.hasResourceBundle(n,t)?u.state[o]=2:u.state[o]<0||(u.state[o]===1?r.indexOf(o)<0&&r.push(o):(u.state[o]=1,i=!1,r.indexOf(o)<0&&r.push(o),f.indexOf(o)<0&&f.push(o),e.indexOf(t)<0&&e.push(t)))});i||o.push(n)}),(f.length||r.length)&&this.queue.push({pending:r,loaded:{},errors:[],callback:i}),{toLoad:f,pending:r,toLoadLanguages:o,toLoadNamespaces:e}},o.prototype.loaded=function(n,t,i){var e=this,o=n.split("|"),f=s(o,2),r=f[0],u=f[1];t&&this.emit("failedLoading",r,u,t);i&&this.store.addResourceBundle(r,u,i);this.state[n]=t?-1:2;this.queue.forEach(function(i){ot(i.loaded,[r],u);dt(i.pending,n);t&&i.errors.push(t);i.pending.length!==0||i.done||(i.errors.length?i.callback(i.errors):i.callback(),e.emit("loaded",i.loaded),i.done=!0)});this.queue=this.queue.filter(function(n){return!n.done})},o.prototype.read=function(n,t,i,r,u,f){var e=this;if(r||(r=0),u||(u=250),!n.length)return f(null,{});this.backend[i](n,t,function(o,s){if(o&&s&&r<5){setTimeout(function(){e.read.call(e,n,t,i,++r,u*2,f)},u);return}f(o,s)})},o.prototype.load=function(t,i,r){var e=this,o,f;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();if(o=n({},this.backend.options,this.options.backend),typeof t=="string"&&(t=this.services.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]),f=this.queueLoad(t,i,r),!f.toLoad.length){f.pending.length||r();return}o.allowMultiLoading&&this.backend.readMulti?this.read(f.toLoadLanguages,f.toLoadNamespaces,"readMulti",null,null,function(n,t){n&&e.logger.warn("loading namespaces "+f.toLoadNamespaces.join(", ")+" for languages "+f.toLoadLanguages.join(", ")+" via multiloading failed",n);!n&&t&&e.logger.log("loaded namespaces "+f.toLoadNamespaces.join(", ")+" for languages "+f.toLoadLanguages.join(", ")+" via multiloading",t);f.toLoad.forEach(function(i){var l=i.split("|"),f=s(l,2),o=f[0],h=f[1],c=u(t,[o,h]),r;c?e.loaded(i,n,c):(r="loading namespace "+h+" for language "+o+" via multiloading failed",e.loaded(i,r),e.logger.error(r))})}):function(){var n=function(n){var t=this,f=n.split("|"),u=s(f,2),i=u[0],r=u[1];this.read(i,r,"read",null,null,function(u,f){u&&t.logger.warn("loading namespace "+r+" for language "+i+" failed",u);!u&&f&&t.logger.log("loaded namespace "+r+" for language "+i,f);t.loaded(n,u,f)})};f.toLoad.forEach(function(t){n.call(e,t)})}()},o.prototype.reload=function(t,i){var r=this,f;this.backend||this.logger.warn("No backend was added via i18next.use. Will not load resources.");f=n({},this.backend.options,this.options.backend);typeof t=="string"&&(t=this.services.languageUtils.toResolveHierarchy(t));typeof i=="string"&&(i=[i]);f.allowMultiLoading&&this.backend.readMulti?this.read(t,i,"readMulti",null,null,function(n,f){n&&r.logger.warn("reloading namespaces "+i.join(", ")+" for languages "+t.join(", ")+" via multiloading failed",n);!n&&f&&r.logger.log("reloaded namespaces "+i.join(", ")+" for languages "+t.join(", ")+" via multiloading",f);t.forEach(function(t){i.forEach(function(i){var o=u(f,[t,i]),e;o?r.loaded(t+"|"+i,n,o):(e="reloading namespace "+i+" for language "+t+" via multiloading failed",r.loaded(t+"|"+i,e),r.logger.error(e))})})}):function(){var n=function(n){var t=this,f=n.split("|"),u=s(f,2),i=u[0],r=u[1];this.read(i,r,"read",null,null,function(u,f){u&&t.logger.warn("reloading namespace "+r+" for language "+i+" failed",u);!u&&f&&t.logger.log("reloaded namespace "+r+" for language "+i,f);t.loaded(n,u,f)})};t.forEach(function(t){i.forEach(function(i){n.call(r,t+"|"+i)})})}()},o.prototype.saveMissing=function(n,t,i,r){(this.backend&&this.backend.create&&this.backend.create(n,t,i,r),n&&n[0])&&this.store.addResource(n[0],t,i,r)},o}(o),ni=function(r){function u(n,f,o){var h=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},s;return i(this,u),s=e(this,r.call(this)),s.cache=n,s.store=f,s.services=o,s.options=h,s.logger=t.create("cacheConnector"),s.cache&&s.cache.init&&s.cache.init(o,h.cache,h),s}return f(u,r),u.prototype.load=function(t,i,r){var u=this,f;if(!this.cache)return r&&r();f=n({},this.cache.options,this.options.cache);typeof t=="string"&&(t=this.services.languageUtils.toResolveHierarchy(t));typeof i=="string"&&(i=[i]);f.enabled?this.cache.load(t,function(n,i){var f,e,o;if(n&&u.logger.error("loading languages "+t.join(", ")+" from cache failed",n),i)for(f in i)for(e in i[f])e!=="i18nStamp"&&(o=i[f][e],o&&u.store.addResourceBundle(f,e,o));r&&r()}):r&&r()},u.prototype.save=function(){this.cache&&this.options.cache&&this.options.cache.enabled&&this.cache.save(this.store.data)},u}(o),ti=function(r){function u(){var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},o=arguments[1],n;return i(this,u),n=e(this,r.call(this)),n.options=h(f),n.services={},n.logger=t,n.modules={},o&&!n.isInitialized&&n.init(f,o),n}return f(u,r),u.prototype.init=function(i,r){function e(n){if(n)return typeof n=="function"?new n:n}var f=this,o,u,c,s;if(typeof i=="function"&&(r=i,i={}),i||(i={}),this.options=i.compatibilityAPI==="v1"?n({},y(),h(ct(i)),{}):i.compatibilityJSON==="v1"?n({},y(),h(lt(i)),{}):n({},y(),this.options,h(i)),r||(r=tt),!this.options.isClone){this.modules.logger?t.init(e(this.modules.logger),this.options):t.init(null,this.options);o=new vt(this.options);this.store=new ht(this.options.resources,this.options);u=this.services;u.logger=t;u.resourceStore=this.store;u.resourceStore.on("added removed",function(){u.cacheConnector.save()});u.languageUtils=o;u.pluralResolver=new bt(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON});u.interpolator=new kt(this.options);u.backendConnector=new gt(e(this.modules.backend),u.resourceStore,u,this.options);u.backendConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),t=1;t1?i-1:0),t=1;t1?i-1:0),t=1;t1&&arguments[1]!==undefined?arguments[1]:{},i=n({},f);return i.lng=i.lng||r.lng,i.ns=i.ns||r.ns,u.t(t,i)};return r.lng=t,r.ns=i,r},u.prototype.t=function(){return this.translator&&this.translator.translate.apply(this.translator,arguments)},u.prototype.exists=function(){return this.translator&&this.translator.exists.apply(this.translator,arguments)},u.prototype.setDefaultNamespace=function(n){this.options.defaultNS=n},u.prototype.loadNamespaces=function(n,t){var i=this;if(!this.options.ns)return t&&t();typeof n=="string"&&(n=[n]);n.forEach(function(n){i.options.ns.indexOf(n)<0&&i.options.ns.push(n)});this.loadResources(t)},u.prototype.loadLanguages=function(n,t){typeof n=="string"&&(n=[n]);var i=this.options.preload||[],r=n.filter(function(n){return i.indexOf(n)<0});if(!r.length)return t();this.options.preload=i.concat(r);this.loadResources(t)},u.prototype.dir=function(n){if(n||(n=this.language),!n)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(n))>=0?"rtl":"ltr"},u.prototype.createInstance=function(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=arguments[1];return new u(n,t)},u.prototype.cloneInstance=function(){var i=this,r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},f=arguments[1],t=new u(n({},r,this.options,{isClone:!0}),f);["store","services","language"].forEach(function(n){t[n]=i[n]});t.translator=new nt(t.services,t.options);t.translator.on("*",function(n){for(var r=arguments.length,u=Array(r>1?r-1:0),i=1;i