// Language detector i18n V6.0.1!function(e,o){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=o():"function"==typeofdefine&&define.amd?define(o):(e=e||self).i18nextBrowserLanguageDetector=o()}(this,(function(){"use strict";functione(e,o){for(vart=0;t<o.length;t++){varn=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}varo=[],t=o.forEach,n=o.slice;functioni(e){returnt.call(n.call(arguments,1),(function(o){if(o)for(vartino)void0===e[t]&&(e[t]=o[t])})),e}vara=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,r=function(e,o,t){varn=t||{};n.path=n.path||"/";vari=e+"="+encodeURIComponent(o);if(n.maxAge>0){varr=n.maxAge-0;if(isNaN(r))thrownewError("maxAge should be a Number");i+="; Max-Age="+Math.floor(r)}if(n.domain){if(!a.test(n.domain))thrownewTypeError("option domain is invalid");i+="; Domain="+n.domain}if(n.path){if(!a.test(n.path))thrownewTypeError("option path is invalid");i+="; Path="+n.path}if(n.expires){if("function"!=typeofn.expires.toUTCString)thrownewTypeError("option expires is invalid");i+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.sameSite)switch("string"==typeofn.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:thrownewTypeError("option sameSite is invalid")}returni},s=function(e,o,t,n){vari=arguments.length>4&&void0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=newDate,i.expires.setTime(i.expires.getTime()+60*t*1e3)),n&&(i.domain=n),document.cookie=r(e,encodeURIComponent(o),i)},u=function(e){for(varo=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(vari=t[n];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(o))returni.substring(o.length,i.length)}returnnull},l={name:"cookie",lookup:function(e){varo;if(e.lookupCookie&&"undefined"!=typeofdocument){vart=u(e.lookupCookie);t&&(o=t)}returno},cacheUserLanguage:function(e,o){o.lookupCookie&&"undefined"!=typeofdocument&&s(o.lookupCookie,e,o.cookieMinutes,o.cookieDomain,o.cookieOptions)}},c={name:"querystring",lookup:function(e){varo;if("undefined"!=typeofwindow)for(vart=window.location.search.substring(1).split("&"),n=0;n<t.length;n++){vari=t[n].indexOf("=");if(i>0)t[n].substring(0,i)===e.lookupQuerystring&&(o=t[n].substring(i+1))}returno}},p=null,d=function(){if(null!==p)returnp;try{p="undefined"!==window&&null!==window.localStorage;window.localStorage.setItem("i18next.translate.boo","foo"),window.localStorage.removeItem("i18next.translate.boo")}catch(e){p=!1}returnp},f={name:"localStorage",lookup:function(e){varo;if(e.lookupLocalStorage&&d()){vart=window.localStorage.getItem(e.lookupLocalStorage);t&&(o=t)}returno},cacheUserLanguage:function(e,o){o.lookupLocalStorage&&d()&&window.localStorage.setItem(o.lookupLocalStorage,e)}},g=null,h=function(){if(null!==g)returng;try{g="undefined"!==window&&null!==window.sessionStorage;window.sessionStorage.setItem("i18next.translate.boo","foo"),window.sessionStorage.removeItem("i18next.translate.boo")}catch(e){g=!1}returng},m={name:"sessionStorage",lookup:function(e){varo;if(e.lookupSessionStorage&&h()){vart=window.sessionStorage.getItem(e.lookupSessionStorage);t&&(o=t)}returno},cacheUserLanguage:function(e,o){o.lookupSessionStorage&&h()&&window.sessionStorage.setItem(o.lookupSessionStorage,e)}},v={name:"navigator",lookup:function(e){varo=[];if("undefined"!=typeofnavigator){if(navigator.languages)for(vart=0;t<navigator.languages.length;t++)o.push(navigator.languages[t]);navigator.userLanguage&&o.push(navigator.userLanguage),navigator.language&&o.push(navigator.language)}returno.length>0?o:void0}},k={name:"htmlTag",lookup:function(e){varo,t=e.htmlTag||("undefined"!=typeofdocument?document.documentElement:null);returnt&&"function"==typeoft.getAttribute&&(o=t.getAttribute("lang")),o}},w={name:"path",lookup:function(e){varo;if("undefined"!=typeofwindow){vart=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(tinstanceofArray)if("number"==typeofe.lookupFromPathIndex){if("string"!=typeoft[e.lookupFromPathIndex])return;o=t[e.lookupFromPathIndex].replace("/","")}elseo=t[0].replace("/","")}returno}},S={name:"subdomain",lookup:function(e){varo;if("undefined"!=typeofwindow){vart=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);tinstanceofArray&&(o="number"==typeofe.lookupFromSubdomainIndex?t[e.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):t[0].replace("http://","").replace("https://","").replace(".",""))}returno}};vary=function(){functiono(e){vart=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};!function(e,o){if(!(einstanceofo))thrownewTypeError("Cannot call a class as a function")}(this,o),this.type="languageDetector",this.detectors={},this.init(e,t)}vart,n,a;returnt=o,(n=[{key:"init",value:function(e){varo=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void0!==arguments[2]?arguments[2]:{};this.services=e,this.options=i(o,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=t,this.addDetector(l),this.addDetector(c),this.addDetector(f),this.addDetector(m),this.addDetector(v),this.addDetector(k),this.addDetector(w),this.addDetector(S)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){varo=this;e||(e=this.options.order);vart=[];returne.forEach((function(e){if(o.detectors[e]){varn=o.detectors[e].lookup(o.options);n&&"string"==typeofn&&(n=[n]),n&&(t=t.concat(n))}})),this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}},{key:"cacheUserLanguage",value:function(e,o){vart=this;o||(o=this.options.caches),o&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||o.forEach((function(o){t.detectors[o]&&t.detectors[o].cacheUserLanguage(e,t.options)})))}}])&&e(t.prototype,n),a&&e(t,a),o}();returny.type="languageDetector",y}));