text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.i18next=e()}(this,function(){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},f=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],o=!0,r=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(o=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);o=!0);}catch(t){r=!0,i=t}finally{try{!o&&a.return&&a.return()}finally{if(r)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){var n;console&&console[t]&&(n=console)[t].apply(n,function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(e))}};function n(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};i(this,n),this.init(t,e)}var l=new(n.prototype.init=function(t,e){var n=1<arguments.length&&void 0!==e?e:{};this.prefix=n.prefix||"i18next:",this.logger=t||o,this.options=n,this.debug=n.debug},n.prototype.setDebug=function(t){this.debug=t},n.prototype.log=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)},n.prototype.warn=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)},n.prototype.error=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")},n.prototype.deprecate=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)},n.prototype.forward=function(t,e,n,o){return o&&!this.debug?null:("string"==typeof t[0]&&(t[0]=""+n+this.prefix+" "+t[0]),this.logger[e](t))},n.prototype.create=function(t){return new n(this.logger,E({prefix:this.prefix+":"+t+":"},this.options))},n),e=(r.prototype.on=function(t,e){var n=this;return t.split(" ").forEach(function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(e)}),this},r.prototype.off=function(e,n){var o=this;this.observers[e]&&this.observers[e].forEach(function(){if(n){var t=o.observers[e].indexOf(n);-1<t&&o.observers[e].splice(t,1)}else delete o.observers[e]})},r.prototype.emit=function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];this.observers[e]&&[].concat(this.observers[e]).forEach(function(t){t.apply(void 0,n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(t){t.apply(t,[e].concat(n))})},r);function r(){i(this,r),this.observers={}}function h(t){return null==t?"":""+t}function g(t,e,n){function o(t){return t&&-1<t.indexOf("###")?t.replace(/###/g,"."):t}function r(){return!t||"string"==typeof t}for(var i="string"!=typeof e?[].concat(e):e.split(".");1<i.length;){if(r())return{};var s=o(i.shift());!t[s]&&n&&(t[s]=new n),t=t[s]}return r()?{}:{obj:t,k:o(i.shift())}}function p(t,e,n){var o=g(t,e,Object);o.obj[o.k]=n}function d(t,e){var n=g(t,e),o=n.obj,r=n.k;if(o)return o[r]}function a(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function c(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return u[t]}):t}var y,v=(t(m,y=e),m.prototype.addNamespaces=function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)},m.prototype.removeNamespaces=function(t){var e=this.options.ns.indexOf(t);-1<e&&this.options.ns.splice(e,1)},m.prototype.getResource=function(t,e,n,o){var r=3<arguments.length&&void 0!==o?o:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=[t,e];return n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),-1<t.indexOf(".")&&(s=t.split(".")),d(this.data,s)},m.prototype.addResource=function(t,e,n,o,r){var i=4<arguments.length&&void 0!==r?r:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[t,e];n&&(a=a.concat(s?n.split(s):n)),-1<t.indexOf(".")&&(o=e,e=(a=t.split("."))[1]),this.addNamespaces(e),p(this.data,a,o),i.silent||this.emit("added",t,e,n,o)},m.prototype.addResources=function(t,e,n,o){var r=3<arguments.length&&void 0!==o?o:{silent:!1};for(var i in n)"string"==typeof n[i]&&this.addResource(t,e,i,n[i],{silent:!0});r.silent||this.emit("added",t,e,n)},m.prototype.addResourceBundle=function(t,e,n,o,r,i){var s=5<arguments.length&&void 0!==i?i:{silent:!1},a=[t,e];-1<t.indexOf(".")&&(o=n,n=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var u=d(this.data,a)||{};o?function t(e,n,o){for(var r in n)r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof n[r]||n[r]instanceof String?o&&(e[r]=n[r]):t(e[r],n[r],o):e[r]=n[r];return e}(u,n,r):u=E({},u,n),p(this.data,a,u),s.silent||this.emit("added",t,e,n)},m.prototype.removeResourceBundle=function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)},m.prototype.hasResourceBundle=function(t,e){return void 0!==this.getResource(t,e)},m.prototype.getResourceBundle=function(t,e){return e=e||this.options.defaultNS,"v1"===this.options.compatibilityAPI?E({},this.getResource(t,e)):this.getResource(t,e)},m.prototype.getDataByLanguage=function(t){return this.data[t]},m.prototype.toJSON=function(){return this.data},m);function m(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};i(this,m);var n=s(this,y.call(this));return n.data=t||{},n.options=e,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}var b,x={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,o,r){var i=this;return t.forEach(function(t){i.processors[t]&&(e=i.processors[t].process(e,n,o,r))}),e}},S=(t(k,b=e),k.prototype.changeLanguage=function(t){t&&(this.language=t)},k.prototype.exists=function(t,e){var n=1<arguments.length&&void 0!==e?e:{interpolation:{}},o=this.resolve(t,n);return o&&void 0!==o.res},k.prototype.extractFromKey=function(t,e){var n=e.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,r=e.ns||this.options.defaultNS;if(n&&-1<t.indexOf(n)){var i=t.split(n);(n!==o||n===o&&-1<this.options.ns.indexOf(i[0]))&&(r=i.shift()),t=i.join(o)}return"string"==typeof r&&(r=[r]),{key:t,namespaces:r}},k.prototype.translate=function(t,n){var o=this;if("object"!==(void 0===n?"undefined":j(n))&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n=n||{},null==t||""===t)return"";"number"==typeof t&&(t=String(t)),"string"==typeof t&&(t=[t]);var e=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,r=this.extractFromKey(t[t.length-1],n),i=r.key,s=r.namespaces,a=s[s.length-1],u=n.lng||this.language,l=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){var p=n.nsSeparator||this.options.nsSeparator;return a+p+i}return i}var c=this.resolve(t,n),f=c&&c.res,h=c&&c.usedKey||i,g=Object.prototype.toString.apply(f),d=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&"string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0&&(!d||"[object Array]"!==g)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,n):"key '"+i+" ("+this.language+")' returned an object instead of string.";if(e){var v="[object Array]"===g?[]:{};for(var m in f)if(Object.prototype.hasOwnProperty.call(f,m)){var b=""+h+e+m;v[m]=this.translate(b,E({},n,{joinArrays:!1,ns:s})),v[m]===b&&(v[m]=f[m])}f=v}}else if(y&&d&&"[object Array]"===g)f=(f=f.join(d))&&this.extendTranslation(f,t,n);else{var x=!1,S=!1;if(!this.isValidLookup(f)&&void 0!==n.defaultValue){if(x=!0,void 0!==n.count){var k=this.pluralResolver.getSuffix(u,n.count);f=n["defaultValue"+k]}f=f||n.defaultValue}this.isValidLookup(f)||(S=!0,f=i);var w=n.defaultValue&&n.defaultValue!==f&&this.options.updateMissing;if(S||x||w){this.logger.log(w?"updateKey":"missingKey",u,a,i,w?n.defaultValue:f);var O=[],R=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&R&&R[0])for(var L=0;L<R.length;L++)O.push(R[L]);else"all"===this.options.saveMissingTo?O=this.languageUtils.toResolveHierarchy(n.lng||this.language):O.push(n.lng||this.language);var N=function(t,e){o.options.missingKeyHandler?o.options.missingKeyHandler(t,a,e,w?n.defaultValue:f,w,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,a,e,w?n.defaultValue:f,w,n),o.emit("missingKey",t,a,e,f)};if(this.options.saveMissing){var C=void 0!==n.count&&"string"!=typeof n.count;this.options.saveMissingPlurals&&C?O.forEach(function(e){o.pluralResolver.getPluralFormsOfKey(e,i).forEach(function(t){return N([e],t)})}):N(O,i)}}f=this.extendTranslation(f,t,n,c),S&&f===i&&this.options.appendNamespaceToMissingKey&&(f=a+":"+i),S&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(f))}return f},k.prototype.extendTranslation=function(t,e,n,o){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(E({},n,{interpolation:E({},this.options.interpolation,n.interpolation)}));var i=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(i=E({},this.options.interpolation.defaultVariables,i)),t=this.interpolator.interpolate(t,i,n.lng||this.language,n),!1!==n.nest&&(t=this.interpolator.nest(t,function(){return r.translate.apply(r,arguments)},n)),n.interpolation&&this.interpolator.reset()}var s=n.postProcess||this.options.postProcess,a="string"==typeof s?[s]:s;return null!=t&&a&&a.length&&!1!==n.applyPostProcessor&&(t=x.handle(a,t,e,n,this)),t},k.prototype.resolve=function(t,e){var l=this,p=1<arguments.length&&void 0!==e?e:{},c=void 0,r=void 0,f=void 0,h=void 0;return"string"==typeof t&&(t=[t]),t.forEach(function(t){if(!l.isValidLookup(c)){var e=l.extractFromKey(t,p),s=e.key;r=s;var n=e.namespaces;l.options.fallbackNS&&(n=n.concat(l.options.fallbackNS));var a=void 0!==p.count&&"string"!=typeof p.count,u=void 0!==p.context&&"string"==typeof p.context&&""!==p.context,o=p.lngs?p.lngs:l.languageUtils.toResolveHierarchy(p.lng||l.language,p.fallbackLng);n.forEach(function(i){l.isValidLookup(c)||(h=i,o.forEach(function(t){if(!l.isValidLookup(c)){f=t;var e=s,n=[e];if(l.i18nFormat&&l.i18nFormat.addLookupKeys)l.i18nFormat.addLookupKeys(n,s,t,i,p);else{var o=void 0;a&&(o=l.pluralResolver.getSuffix(t,p.count)),a&&u&&n.push(e+o),u&&n.push(e+=""+l.options.contextSeparator+p.context),a&&n.push(e+=o)}for(var r=void 0;r=n.pop();)l.isValidLookup(c)||(c=l.getResource(t,i,r,p))}}))})}}),{res:c,usedKey:r,usedLng:f,usedNS:h}},k.prototype.isValidLookup=function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)},k.prototype.getResource=function(t,e,n,o){var r=3<arguments.length&&void 0!==o?o:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)},k);function k(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};i(this,k);var n,o,r=s(this,b.call(this));return n=t,o=r,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"].forEach(function(t){n[t]&&(o[t]=n[t])}),r.options=e,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=l.create("translator"),r}function w(t){return t.charAt(0).toUpperCase()+t.slice(1)}var O=(R.prototype.getScriptPartFromCode=function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),this.formatLanguageCode(e.join("-")))},R.prototype.getLanguagePartFromCode=function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])},R.prototype.formatLanguageCode=function(t){if("string"==typeof t&&-1<t.indexOf("-")){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(t){return t.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),-1<e.indexOf(n[1].toLowerCase())&&(n[1]=w(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),-1<e.indexOf(n[1].toLowerCase())&&(n[1]=w(n[1].toLowerCase())),-1<e.indexOf(n[2].toLowerCase())&&(n[2]=w(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t},R.prototype.isWhitelisted=function(t){return"languageOnly"!==this.options.load&&!this.options.nonExplicitWhitelist||(t=this.getLanguagePartFromCode(t)),!this.whitelist||!this.whitelist.length||-1<this.whitelist.indexOf(t)},R.prototype.getFallbackCodes=function(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||[];var n=t[e];return(n=(n=(n=n||t[this.getScriptPartFromCode(e)])||t[this.formatLanguageCode(e)])||t.default)||[]},R.prototype.toResolveHierarchy=function(t,e){function n(t){t&&(o.isWhitelisted(t)?i.push(t):o.logger.warn("rejecting non-whitelisted language code: "+t))}var o=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),i=[];return"string"==typeof t&&-1<t.indexOf("-")?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(t))):"string"==typeof t&&n(this.formatLanguageCode(t)),r.forEach(function(t){i.indexOf(t)<0&&n(o.formatLanguageCode(t))}),i},R);function R(t){i(this,R),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=l.create("languageUtils")}var L=[{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}],N={1:function(t){return Number(1<t)},2:function(t){return Number(1!=t)},3:function(){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:2<=t%10&&t%10<=4&&(t%100<10||20<=t%100)?1:2)},5:function(t){return Number(0===t?0:1==t?1:2==t?2:3<=t%100&&t%100<=10?3:11<=t%100?4:5)},6:function(t){return Number(1==t?0:2<=t&&t<=4?1:2)},7:function(t){return Number(1==t?0:2<=t%10&&t%10<=4&&(t%100<10||20<=t%100)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(2<=t)},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:2<t&&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:2<=t%10&&(t%100<10||20<=t%100)?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||1<t%100&&t%100<11?1:10<t%100&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0===t||0<t%100&&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||10<t)&&t%10==0?2:3)}};var C=(P.prototype.addRule=function(t,e){this.rules[t]=e},P.prototype.getRule=function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]},P.prototype.needsPlural=function(t){var e=this.getRule(t);return e&&1<e.numbers.length},P.prototype.getPluralFormsOfKey=function(n,o){var r=this,i=[],t=this.getRule(n);return t&&t.numbers.forEach(function(t){var e=r.getSuffix(n,t);i.push(""+o+e)}),i},P.prototype.getSuffix=function(t,e){var n=this,o=this.getRule(t);if(o){var r=o.noAbs?o.plurals(e):o.plurals(Math.abs(e)),i=o.numbers[r];this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var s=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_"+i.toString():s():"v2"===this.options.compatibilityJSON&&2===o.numbers.length&&1===o.numbers[0]||this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn("no plural rule found for: "+t),""},P);function P(t){var n,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};i(this,P),this.languageUtils=t,this.options=e,this.logger=l.create("pluralResolver"),this.rules=(n={},L.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:N[e.fc]}})}),n)}var F=(A.prototype.init=function(t,e){var n=0<arguments.length&&void 0!==t?t:{};e&&(this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t}),n.interpolation||(n.interpolation={escapeValue:!0});var o=n.interpolation;this.escape=void 0!==o.escape?o.escape:c,this.escapeValue=void 0===o.escapeValue||o.escapeValue,this.useRawValueToEscape=void 0!==o.useRawValueToEscape&&o.useRawValueToEscape,this.prefix=o.prefix?a(o.prefix):o.prefixEscaped||"{{",this.suffix=o.suffix?a(o.suffix):o.suffixEscaped||"}}",this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||",",this.unescapePrefix=o.unescapeSuffix?"":o.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":o.unescapeSuffix||"",this.nestingPrefix=o.nestingPrefix?a(o.nestingPrefix):o.nestingPrefixEscaped||a("$t("),this.nestingSuffix=o.nestingSuffix?a(o.nestingSuffix):o.nestingSuffixEscaped||a(")"),this.maxReplaces=o.maxReplaces?o.maxReplaces:1e3,this.resetRegExp()},A.prototype.reset=function(){this.options&&this.init(this.options)},A.prototype.resetRegExp=function(){var t=this.prefix+"(.+?)"+this.suffix;this.regexp=new RegExp(t,"g");var e=""+this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(e,"g");var n=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(n,"g")},A.prototype.interpolate=function(t,r,i,e){var s=this,n=void 0,o=void 0,a=void 0;function u(t){return t.replace(/\$/g,"$$$$")}function l(t){if(t.indexOf(s.formatSeparator)<0)return d(r,t);var e=t.split(s.formatSeparator),n=e.shift().trim(),o=e.join(s.formatSeparator).trim();return s.format(d(r,n),o,i)}this.resetRegExp();var p=e&&e.missingInterpolationHandler||this.options.missingInterpolationHandler;for(a=0;(n=this.regexpUnescape.exec(t))&&(o=l(n[1].trim()),t=t.replace(n[0],o),this.regexpUnescape.lastIndex=0,!(++a>=this.maxReplaces)););for(a=0;n=this.regexp.exec(t);){if(void 0===(o=l(n[1].trim())))if("function"==typeof p){var c=p(t,n);o="string"==typeof c?c:""}else this.logger.warn("missed to pass in variable "+n[1]+" for interpolating "+t),o="";else"string"==typeof o||this.useRawValueToEscape||(o=h(o));if(o=this.escapeValue?u(this.escape(o)):u(o),t=t.replace(n[0],o),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return t},A.prototype.nest=function(t,e,n){var o=void 0,r=void 0,i=E({},2<arguments.length&&void 0!==n?n:{});function s(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var o=n.join(",");o=(o=this.interpolate(o,i)).replace(/'/g,'"');try{i=JSON.parse(o),t&&(i=E({},t,i))}catch(t){this.logger.error("failed parsing options string in nesting for key "+e,t)}return e}for(i.applyPostProcessor=!1;o=this.nestingRegexp.exec(t);){if((r=e(s.call(this,o[1].trim(),i),i))&&o[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=h(r)),r||(this.logger.warn("missed to resolve "+o[1]+" for nesting "+t),r=""),t=t.replace(o[0],r),this.regexp.lastIndex=0}return t},A);function A(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};i(this,A),this.logger=l.create("interpolator"),this.init(t,!0)}var T,V,U=(t(H,T=e),H.prototype.queueLoad=function(t,e,r,n){var i=this,s=[],a=[],u=[],l=[];return t.forEach(function(n){var o=!0;e.forEach(function(t){var e=n+"|"+t;!r.reload&&i.store.hasResourceBundle(n,t)?i.state[e]=2:i.state[e]<0||(1===i.state[e]?a.indexOf(e)<0&&a.push(e):(i.state[e]=1,o=!1,a.indexOf(e)<0&&a.push(e),s.indexOf(e)<0&&s.push(e),l.indexOf(t)<0&&l.push(t)))}),o||u.push(n)}),(s.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:n}),{toLoad:s,pending:a,toLoadLanguages:u,toLoadNamespaces:l}},H.prototype.loaded=function(a,u,t){var e=a.split("|"),n=f(e,2),l=n[0],p=n[1];u&&this.emit("failedLoading",l,p,u),t&&this.store.addResourceBundle(l,p,t),this.state[a]=u?-1:2;var c={};this.queue.forEach(function(t){var e,n,o,r,i,s;e=t.loaded,n=p,r=g(e,[l],Object),i=r.obj,s=r.k,i[s]=i[s]||[],o&&(i[s]=i[s].concat(n)),o||i[s].push(n),function(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}(t.pending,a),u&&t.errors.push(u),0!==t.pending.length||t.done||(Object.keys(t.loaded).forEach(function(e){c[e]||(c[e]=[]),t.loaded[e].length&&t.loaded[e].forEach(function(t){c[e].indexOf(t)<0&&c[e].push(t)})}),t.done=!0,t.errors.length?t.callback(t.errors):t.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(t){return!t.done})},H.prototype.read=function(n,o,r,t,e,i){var s=3<arguments.length&&void 0!==t?t:0,a=this,u=4<arguments.length&&void 0!==e?e:250,l=i;return n.length?this.backend[r](n,o,function(t,e){t&&e&&s<5?setTimeout(function(){a.read.call(a,n,o,r,s+1,2*u,l)},u):l(t,e)}):l(null,{})},H.prototype.prepareLoading=function(t,e,n,o){var r=this,i=2<arguments.length&&void 0!==n?n:{},s=o;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var a=this.queueLoad(t,e,i,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(function(t){r.loadOne(t)})},H.prototype.load=function(t,e,n){this.prepareLoading(t,e,{},n)},H.prototype.reload=function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)},H.prototype.loadOne=function(n,t){var o=this,r=1<arguments.length&&void 0!==t?t:"",e=n.split("|"),i=f(e,2),s=i[0],a=i[1];this.read(s,a,"read",null,null,function(t,e){t&&o.logger.warn(r+"loading namespace "+a+" for language "+s+" failed",t),!t&&e&&o.logger.log(r+"loaded namespace "+a+" for language "+s,e),o.loaded(n,t,e)})},H.prototype.saveMissing=function(t,e,n,o,r,i){var s=5<arguments.length&&void 0!==i?i:{};this.backend&&this.backend.create&&this.backend.create(t,e,n,o,null,E({},s,{isUpdate:r})),t&&t[0]&&this.store.addResource(t[0],e,n,o)},H);function H(t,e,n){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};i(this,H);var r=s(this,T.call(this));return r.backend=t,r.store=e,r.languageUtils=n.languageUtils,r.options=o,r.logger=l.create("backendConnector"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(n,o.backend,o),r}function D(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 K(){}function M(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];i(this,M);var n=s(this,V.call(this));if(n.options=D(t),n.services={},n.logger=l,n.modules={external:[]},e&&!n.isInitialized&&!t.isClone){var o;if(!n.options.initImmediate)return o=n.init(t,e),s(n,o);setTimeout(function(){n.init(t,e)},0)}return n}return new(t(M,V=e),M.prototype.init=function(t,e){var r=this,n=0<arguments.length&&void 0!==t?t:{},o=e;function i(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof n&&(o=n,n={}),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:"_",saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};return t[1]&&(e.defaultValue=t[1]),t[2]&&(e.tDescription=t[2]),e},interpolation:{escapeValue:!0,format:function(t){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,D(n)),this.format=this.options.interpolation.format,o=o||K,!this.options.isClone){this.modules.logger?l.init(i(this.modules.logger),this.options):l.init(null,this.options);var s=new O(this.options);this.store=new v(this.options.resources,this.options);var a=this.services;a.logger=l,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new C(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new F(this.options),a.backendConnector=new U(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",function(t){for(var e=arguments.length,n=Array(1<e?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];r.emit.apply(r,[t].concat(n))}),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new S(this.services,this.options),this.translator.on("*",function(t){for(var e=arguments.length,n=Array(1<e?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];r.emit.apply(r,[t].concat(n))}),this.modules.external.forEach(function(t){t.init&&t.init(r)})}function u(){r.changeLanguage(r.options.lng,function(t,e){r.isInitialized=!0,r.logger.log("initialized",r.options),r.emit("initialized",r.options),o(t,e)})}return["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(e){r[e]=function(){var t;return(t=r.store)[e].apply(t,arguments)}}),this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),this},M.prototype.loadResources=function(t){var e=this,n=0<arguments.length&&void 0!==t?t:K;if(this.options.resources)n(null);else{if(this.language&&"cimode"===this.language.toLowerCase())return n();var o=[],r=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach(function(t){o.indexOf(t)<0&&o.push(t)})};this.language?r(this.language):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(t){return r(t)}),this.options.preload&&this.options.preload.forEach(function(t){return r(t)}),this.services.backendConnector.load(o,this.options.ns,n)}},M.prototype.reloadResources=function(t,e,n){t=t||this.languages,e=e||this.options.ns,n=n||function(){},this.services.backendConnector.reload(t,e,n)},M.prototype.use=function(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&&x.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this},M.prototype.changeLanguage=function(t,r){function e(o){o&&(i.language=o,i.languages=i.services.languageUtils.toResolveHierarchy(o),i.translator.language||i.translator.changeLanguage(o),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(o)),i.loadResources(function(t){var e,n;e=t,n=o,i.translator.changeLanguage(n),n&&(i.emit("languageChanged",n),i.logger.log("languageChanged",n)),r&&r(e,function(){return i.t.apply(i,arguments)})})}var i=this;t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(e):e(t):e(this.services.languageDetector.detect())},M.prototype.getFixedT=function(t,e){function s(t,e){for(var n=arguments.length,o=Array(2<n?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];var i=E({},e);return"object"!==(void 0===e?"undefined":j(e))&&(i=a.options.overloadTranslationOptionHandler([t,e].concat(o))),i.lng=i.lng||s.lng,i.lngs=i.lngs||s.lngs,i.ns=i.ns||s.ns,a.t(t,i)}var a=this;return"string"==typeof t?s.lng=t:s.lngs=t,s.ns=e,s},M.prototype.t=function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)},M.prototype.exists=function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)},M.prototype.setDefaultNamespace=function(t){this.options.defaultNS=t},M.prototype.loadNamespaces=function(t,e){var n=this;if(!this.options.ns)return e&&e();"string"==typeof t&&(t=[t]),t.forEach(function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)}),this.loadResources(e)},M.prototype.loadLanguages=function(t,e){"string"==typeof t&&(t=[t]);var n=this.options.preload||[],o=t.filter(function(t){return n.indexOf(t)<0});if(!o.length)return e();this.options.preload=n.concat(o),this.loadResources(e)},M.prototype.dir=function(t){return(t=t||(this.languages&&0<this.languages.length?this.languages[0]:this.language))?0<=["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))?"rtl":"ltr":"rtl"},M.prototype.createInstance=function(t,e){return new M(0<arguments.length&&void 0!==t?t:{},e)},M.prototype.cloneInstance=function(t,e){var n=this,o=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length&&void 0!==e?e:K,i=E({},this.options,o,{isClone:!0}),s=new M(i);return["store","services","language"].forEach(function(t){s[t]=n[t]}),s.translator=new S(s.services,s.options),s.translator.on("*",function(t){for(var e=arguments.length,n=Array(1<e?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];s.emit.apply(s,[t].concat(n))}),s.init(i,r),s.translator.options=s.options,s},M)});