@incodetech/web 0.0.0-dev-20261002-e5d75fb5 → 0.0.0-dev-20261002-897723cb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.txt +0 -3
- package/dist/{GeolocationPermissionDenied-D-uZBv2j.js → GeolocationPermissionDenied-VmHdNm5T.js} +5 -5
- package/dist/ae-signature/ae-signature.es.js +3 -3
- package/dist/{ageVerification-D6zKIlMr.js → ageVerification-CFJHxEc6.js} +4 -4
- package/dist/antifraud/antifraud.es.js +3 -3
- package/dist/authentication/authentication.es.js +4 -4
- package/dist/{autoFocusTitle-piNL1Mnu.js → autoFocusTitle-KqPvkt75.js} +1 -1
- package/dist/{baseTutorial-Bfn8-8es.js → baseTutorial-Cy_zbBSY.js} +3 -3
- package/dist/{bottomSheet-ChTw2eLc.js → bottomSheet-BbqZGtch.js} +2 -2
- package/dist/cameraOverlay-yHWyI1d1.js +2 -0
- package/dist/{cameraOverlayHeader-DRFkVU2x.js → cameraOverlayHeader-DyjP6s5U.js} +4 -4
- package/dist/{cameraView-C57sWFcq.js → cameraView-4Yqz5tQq.js} +1 -1
- package/dist/certificate-issuance/certificate-issuance.es.js +9 -9
- package/dist/{checkbox-DdioH_m8.js → checkbox-C6LQBgyJ.js} +2 -2
- package/dist/{connectionError-DxrO4amB.js → connectionError-CmJtZarR.js} +3 -3
- package/dist/consent/consent.es.js +7 -7
- package/dist/{countrySelector-BoSrDvLp.js → countrySelector-BSHenn7T.js} +2 -2
- package/dist/cross-document-data-match/cross-document-data-match.es.js +3 -3
- package/dist/curp-validation/curp-validation.es.js +13 -13
- package/dist/{customFields-DL2Vq1rg.js → customFields-nJRYME1H.js} +10 -10
- package/dist/{customWatchlist-BO96DTaM.js → customWatchlist-CyuxDKLF.js} +6 -6
- package/dist/{dashboardTheme-DoglW0_y.js → dashboardTheme-ChyluL8-.js} +1 -1
- package/dist/{dateInputComposed-oL9jEU4i.js → dateInputComposed-CGRSDjDB.js} +4 -4
- package/dist/dateInputComposed-Dz8fOTA4.js +1 -0
- package/dist/{denied-ksDI2b0H.js → denied-aIhbTnBe.js} +5 -5
- package/dist/{deviceWallet-DK5qfJ9N.js → deviceWallet-CT8GSh36.js} +3 -3
- package/dist/{digitalIdRedirect-Dhnebtjs.js → digitalIdRedirect-BIYl1DV7.js} +3 -3
- package/dist/{digitalIdUpload-DwF1eyTt.js → digitalIdUpload-sEjFWHs8.js} +6 -6
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/documentCapture-DO9FcI6j.js +2 -0
- package/dist/{documentCapture-DkseYhd4.js → documentCapture-oPHlc4-z.js} +18 -18
- package/dist/{dropdownComposed-D8tnnFsr.js → dropdownComposed-4zLnMCBz.js} +2 -2
- package/dist/dropdownComposed-6aTSnTiL.js +1 -0
- package/dist/dynamic-forms/dynamic-forms.es.js +11 -11
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/{ekybModule-B-0NiGD_.js → ekybModule-DgWC5Lqm.js} +13 -13
- package/dist/ekybModule-zgfnt9qM.js +2 -0
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekycModule-BPBp9byv.js +2 -0
- package/dist/{ekycModule-Bgvx2WWP.js → ekycModule-Eb8IPLVg.js} +14 -14
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/{electronic-signature-Cyl9Cj8P.js → electronic-signature-BUmHlFOB.js} +9 -9
- package/dist/email/email.es.js +8 -8
- package/dist/{emailInput-BrWenbdS.js → emailInput-Dd5hOKRH.js} +3 -3
- package/dist/{errorContent-CJRySsQi.js → errorContent-p2bQiqts.js} +5 -5
- package/dist/esm-15CISqPe.js +430 -0
- package/dist/{expiredId-pDTJSrl3.js → expiredId-yEEqIaul.js} +5 -5
- package/dist/extensibility.es.js +36 -36
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/faceMatch-CdiKM3Jw.js +2 -0
- package/dist/{faceMatch-rfCThaHW.js → faceMatch-DeTbR6tt.js} +8 -8
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/fieldComparison-7vQzgPSp.js +2 -0
- package/dist/{fieldComparison-BxezYIOb.js → fieldComparison-DGLz8B-i.js} +8 -8
- package/dist/{finalSuccessScreen-BJOdRcKM.js → finalSuccessScreen-lVpvFwTN.js} +11 -11
- package/dist/fiscal-qr/fiscal-qr.es.js +13 -13
- package/dist/{flipAnimation-DmUeePlk.js → flipAnimation-BQioRUVm.js} +22 -22
- package/dist/flow/flow.es.js +8 -8
- package/dist/{formField-C47l9Ntr.js → formField-DuiodgKi.js} +2 -2
- package/dist/geolocation/geolocation.es.js +8 -8
- package/dist/government-validation/government-validation.es.js +5 -5
- package/dist/{homeScreen-BYmV7SXN.js → homeScreen-BbLehumf.js} +6 -6
- package/dist/{icons-BRrid7Uo.js → icons-fjweFku7.js} +1 -1
- package/dist/id/id.es.js +25 -25
- package/dist/id-selfie-flow/id-selfie-flow.es.js +10 -10
- package/dist/id-verification/id-verification.es.js +4 -4
- package/dist/{idOcr-CpY2601r.js → idOcr-DX8Ac172.js} +12 -12
- package/dist/identity-reuse/identity-reuse.es.js +8 -8
- package/dist/{incode-logo-B4ngnf6T.js → incode-logo-BHqdOP1R.js} +2 -2
- package/dist/{incodeComponent-CdC4kGp9.js → incodeComponent-B70dnIJf.js} +8 -8
- package/dist/{incodeModule-BRWWqx2v.js → incodeModule-D3Id0VT2.js} +2 -2
- package/dist/index.es.js +2 -2
- package/dist/{inputComposed-awRBaOd1.js → inputComposed-BdQ6uKS0.js} +2 -2
- package/dist/inputComposed-C2Jc59mq.js +1 -0
- package/dist/{mandatoryConsent-BLNIC1Un.js → mandatoryConsent-D-kWUEjz.js} +7 -7
- package/dist/{manualCaptureButton-pu22oz_P.js → manualCaptureButton-DcsFOdLX.js} +8 -8
- package/dist/{manualCaptureButton-nMbRB_QU.js → manualCaptureButton-UkF7sWqx.js} +3 -3
- package/dist/{optionAccessibleLabel-V9JSyywh.js → optionAccessibleLabel-TxHCtdBw.js} +5 -5
- package/dist/{otpInput-CBFfVXQR.js → otpInput-B5rhH5Kb.js} +6 -6
- package/dist/{page-DqZ2jsCx.js → page-BzO7gw-C.js} +4 -4
- package/dist/{passwordInputComposed-CQts5nBl.js → passwordInputComposed-CztWoyOU.js} +4 -4
- package/dist/pdfViewer-DOutXwzZ.js +2 -0
- package/dist/{pdfViewer-duaokKko.js → pdfViewer-eqJrmPlS.js} +3 -3
- package/dist/{permissions-BGrbV21B.js → permissions-BUL58wrw.js} +10 -10
- package/dist/phone/phone.es.js +9 -9
- package/dist/{phoneInputComposed-Bd4-1cHA.js → phoneInputComposed-xhe2XSr9.js} +3 -3
- package/dist/{processing-CtzTuc0i.js → processing-BUNr6i3b.js} +1 -1
- package/dist/{progressBar-BlwK11AP.js → progressBar-DjPEZ0Ps.js} +1 -1
- package/dist/qe-signature/qe-signature.es.js +3 -3
- package/dist/radioGroupComposed-B9hsj3i9.js +1 -0
- package/dist/{radioGroupComposed-DSeNbwqc.js → radioGroupComposed-SWCj4eZ2.js} +2 -2
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +9 -9
- package/dist/{resendTimer-D2WC6pv7.js → resendTimer-YambUCwP.js} +1 -1
- package/dist/{resolveApiKey-BQS1OYXu.js → resolveApiKey-B0S0-EEY.js} +17 -17
- package/dist/selfie/selfie.es.js +7 -7
- package/dist/signature/signature.es.js +7 -7
- package/dist/{smsTabContent-BOtaNF_V.js → smsTabContent-C9trzhuH.js} +6 -6
- package/dist/{spacer-BL8vuQIS.js → spacer-Cx0mCV3F.js} +10 -10
- package/dist/{spinner-DFijNGa8.js → spinner-CmAKrNTM.js} +2 -2
- package/dist/{statusPage-CCuZr5b5.js → statusPage-C0ZqitBj.js} +3 -3
- package/dist/{transitionSpinner-BBvTGBMM.js → transitionSpinner-Dno6yo90.js} +3 -3
- package/dist/{tutorial-DaXn39GX.js → tutorial-BvF0aJGH.js} +10 -10
- package/dist/{typography-DGLMnfln.js → typography-PO57vCw8.js} +1 -1
- package/dist/{uiConfig-B3CKNIjt.js → uiConfig-yps4LLiW.js} +160 -799
- package/dist/{useCaptureHelpButton-B7Bw5_WQ.js → useCaptureHelpButton-IvuPh0dj.js} +5 -5
- package/dist/{verificationResult-BniPFUdn.js → verificationResult-mjCatQMR.js} +6 -6
- package/dist/video-selfie/video-selfie.es.js +12 -12
- package/dist/watchlist/watchlist.es.js +6 -6
- package/dist/{watchlistForBusiness-ieyWOJmO.js → watchlistForBusiness-vJ34hyDm.js} +9 -9
- package/dist/workflow/workflow.es.js +9 -9
- package/package.json +2 -3
- package/dist/cameraOverlay-CQVe4LyR.js +0 -2
- package/dist/dateInputComposed-BM4VeGq8.js +0 -1
- package/dist/documentCapture-oTno7SFO.js +0 -2
- package/dist/dropdownComposed-B06puKQ1.js +0 -1
- package/dist/ekybModule-Ddpkdwsk.js +0 -2
- package/dist/ekycModule-DuzD3AAy.js +0 -2
- package/dist/faceMatch-cdvixWXP.js +0 -2
- package/dist/fieldComparison-D5Sk3C89.js +0 -2
- package/dist/inputComposed-DrqLG1Yw.js +0 -1
- package/dist/pdfViewer-CMJaB9s5.js +0 -2
- package/dist/radioGroupComposed-CTJtZkLp.js +0 -1
- /package/dist/{aligndevicelottie-DHKTZF5e.js → aligndevicelottie-BARt-rhe.js} +0 -0
- /package/dist/{back-horizontal-hint-BEM9Dhrn.js → back-horizontal-hint-BztyPanp.js} +0 -0
- /package/dist/{back-tutorial-DGppPidx.js → back-tutorial-CZrMmj1_.js} +0 -0
- /package/dist/{back-vertical-hint-H30G9BjS.js → back-vertical-hint-BSzA4QbJ.js} +0 -0
- /package/dist/{backdevicelottie-Dl0sBsqU.js → backdevicelottie-CIM3ekd8.js} +0 -0
- /package/dist/{blurdevicelottie-ZmX2BIk0.js → blurdevicelottie-BRyXfLB6.js} +0 -0
- /package/dist/{flip-animation-BIkBJX6p.js → flip-animation-BU5LNKYx.js} +0 -0
- /package/dist/{front-horizontal-hint-Be--Id5l.js → front-horizontal-hint-DEHmtcdg.js} +0 -0
- /package/dist/{front-vertical-hint-yGppU-_1.js → front-vertical-hint-Cb1NO-xT.js} +0 -0
- /package/dist/{frontdevicelottie-DQD4kEOR.js → frontdevicelottie-arpyu_Fz.js} +0 -0
- /package/dist/{glaredevicelottie-DT8y84py.js → glaredevicelottie-TwTFxe7h.js} +0 -0
- /package/dist/{id-laser-h-CZ_EhoMe.js → id-laser-h-Dr-hBxrq.js} +0 -0
- /package/dist/{id-laser-v-Dg6Huksl.js → id-laser-v-D_r0QNY8.js} +0 -0
- /package/dist/{id-tutorial-DXQVBoFu.js → id-tutorial-DM9Pkfs-.js} +0 -0
- /package/dist/{lottie_light-CqGqwsMf.js → lottie_light-aMg9Q9iO.js} +0 -0
- /package/dist/{numberedStep-CWKgVkGl.js → numberedStep-CvbL3ht2.js} +0 -0
- /package/dist/{passport-horizontal-hint-Cy_fZ-M1.js → passport-horizontal-hint-DgNc6F0-.js} +0 -0
- /package/dist/{passport-tutorial-BdFqc7sl.js → passport-tutorial-CKZZuDf_.js} +0 -0
- /package/dist/{passport-vertical-hint-tVVhPnkR.js → passport-vertical-hint-B-toVsfT.js} +0 -0
- /package/dist/{pdf-DROm8bn0.js → pdf-BKHLi5Ac.js} +0 -0
- /package/dist/{pdf.worker.min-DvTIgyJP.js → pdf.worker.min-BM1b2w9V.js} +0 -0
- /package/dist/{sanitizeSvg-CLOEl_gT.js → sanitizeSvg-BC-qLUgS.js} +0 -0
- /package/dist/{selfieTutorial-Ce542llv.js → selfieTutorial-Dz6lDFMn.js} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { r as __toESM } from "./rolldown-runtime--E5BIlTp.js";
|
|
2
1
|
import { S as k, _ as y, f as d, h as q, r as C, u as T, v as u, y as K } from "./vendor-preact-C0jX1Cbq.js";
|
|
3
2
|
//#region ../../node_modules/.pnpm/i18next@25.7.1_typescript@5.9.3/node_modules/i18next/dist/esm/i18next.js
|
|
4
3
|
var isString = (obj) => typeof obj === "string";
|
|
@@ -1943,761 +1942,6 @@ instance.hasLoadedNamespace;
|
|
|
1943
1942
|
instance.loadNamespaces;
|
|
1944
1943
|
instance.loadLanguages;
|
|
1945
1944
|
//#endregion
|
|
1946
|
-
//#region ../../node_modules/.pnpm/i18next-browser-languagedetector@8.2.0/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js
|
|
1947
|
-
var { slice: slice$1, forEach } = [];
|
|
1948
|
-
function defaults(obj) {
|
|
1949
|
-
forEach.call(slice$1.call(arguments, 1), (source) => {
|
|
1950
|
-
if (source) {
|
|
1951
|
-
for (const prop in source) if (obj[prop] === void 0) obj[prop] = source[prop];
|
|
1952
|
-
}
|
|
1953
|
-
});
|
|
1954
|
-
return obj;
|
|
1955
|
-
}
|
|
1956
|
-
function hasXSS(input) {
|
|
1957
|
-
if (typeof input !== "string") return false;
|
|
1958
|
-
return [
|
|
1959
|
-
/<\s*script.*?>/i,
|
|
1960
|
-
/<\s*\/\s*script\s*>/i,
|
|
1961
|
-
/<\s*img.*?on\w+\s*=/i,
|
|
1962
|
-
/<\s*\w+\s*on\w+\s*=.*?>/i,
|
|
1963
|
-
/javascript\s*:/i,
|
|
1964
|
-
/vbscript\s*:/i,
|
|
1965
|
-
/expression\s*\(/i,
|
|
1966
|
-
/eval\s*\(/i,
|
|
1967
|
-
/alert\s*\(/i,
|
|
1968
|
-
/document\.cookie/i,
|
|
1969
|
-
/document\.write\s*\(/i,
|
|
1970
|
-
/window\.location/i,
|
|
1971
|
-
/innerHTML/i
|
|
1972
|
-
].some((pattern) => pattern.test(input));
|
|
1973
|
-
}
|
|
1974
|
-
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
1975
|
-
var serializeCookie = function(name, val) {
|
|
1976
|
-
const opt = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { path: "/" };
|
|
1977
|
-
let str = `${name}=${encodeURIComponent(val)}`;
|
|
1978
|
-
if (opt.maxAge > 0) {
|
|
1979
|
-
const maxAge = opt.maxAge - 0;
|
|
1980
|
-
if (Number.isNaN(maxAge)) throw new Error("maxAge should be a Number");
|
|
1981
|
-
str += `; Max-Age=${Math.floor(maxAge)}`;
|
|
1982
|
-
}
|
|
1983
|
-
if (opt.domain) {
|
|
1984
|
-
if (!fieldContentRegExp.test(opt.domain)) throw new TypeError("option domain is invalid");
|
|
1985
|
-
str += `; Domain=${opt.domain}`;
|
|
1986
|
-
}
|
|
1987
|
-
if (opt.path) {
|
|
1988
|
-
if (!fieldContentRegExp.test(opt.path)) throw new TypeError("option path is invalid");
|
|
1989
|
-
str += `; Path=${opt.path}`;
|
|
1990
|
-
}
|
|
1991
|
-
if (opt.expires) {
|
|
1992
|
-
if (typeof opt.expires.toUTCString !== "function") throw new TypeError("option expires is invalid");
|
|
1993
|
-
str += `; Expires=${opt.expires.toUTCString()}`;
|
|
1994
|
-
}
|
|
1995
|
-
if (opt.httpOnly) str += "; HttpOnly";
|
|
1996
|
-
if (opt.secure) str += "; Secure";
|
|
1997
|
-
if (opt.sameSite) switch (typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite) {
|
|
1998
|
-
case true:
|
|
1999
|
-
str += "; SameSite=Strict";
|
|
2000
|
-
break;
|
|
2001
|
-
case "lax":
|
|
2002
|
-
str += "; SameSite=Lax";
|
|
2003
|
-
break;
|
|
2004
|
-
case "strict":
|
|
2005
|
-
str += "; SameSite=Strict";
|
|
2006
|
-
break;
|
|
2007
|
-
case "none":
|
|
2008
|
-
str += "; SameSite=None";
|
|
2009
|
-
break;
|
|
2010
|
-
default: throw new TypeError("option sameSite is invalid");
|
|
2011
|
-
}
|
|
2012
|
-
if (opt.partitioned) str += "; Partitioned";
|
|
2013
|
-
return str;
|
|
2014
|
-
};
|
|
2015
|
-
var cookie = {
|
|
2016
|
-
create(name, value, minutes, domain) {
|
|
2017
|
-
let cookieOptions = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
2018
|
-
path: "/",
|
|
2019
|
-
sameSite: "strict"
|
|
2020
|
-
};
|
|
2021
|
-
if (minutes) {
|
|
2022
|
-
cookieOptions.expires = /* @__PURE__ */ new Date();
|
|
2023
|
-
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1e3);
|
|
2024
|
-
}
|
|
2025
|
-
if (domain) cookieOptions.domain = domain;
|
|
2026
|
-
document.cookie = serializeCookie(name, value, cookieOptions);
|
|
2027
|
-
},
|
|
2028
|
-
read(name) {
|
|
2029
|
-
const nameEQ = `${name}=`;
|
|
2030
|
-
const ca = document.cookie.split(";");
|
|
2031
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2032
|
-
let c = ca[i];
|
|
2033
|
-
while (c.charAt(0) === " ") c = c.substring(1, c.length);
|
|
2034
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
2035
|
-
}
|
|
2036
|
-
return null;
|
|
2037
|
-
},
|
|
2038
|
-
remove(name, domain) {
|
|
2039
|
-
this.create(name, "", -1, domain);
|
|
2040
|
-
}
|
|
2041
|
-
};
|
|
2042
|
-
var cookie$1 = {
|
|
2043
|
-
name: "cookie",
|
|
2044
|
-
lookup(_ref) {
|
|
2045
|
-
let { lookupCookie } = _ref;
|
|
2046
|
-
if (lookupCookie && typeof document !== "undefined") return cookie.read(lookupCookie) || void 0;
|
|
2047
|
-
},
|
|
2048
|
-
cacheUserLanguage(lng, _ref2) {
|
|
2049
|
-
let { lookupCookie, cookieMinutes, cookieDomain, cookieOptions } = _ref2;
|
|
2050
|
-
if (lookupCookie && typeof document !== "undefined") cookie.create(lookupCookie, lng, cookieMinutes, cookieDomain, cookieOptions);
|
|
2051
|
-
}
|
|
2052
|
-
};
|
|
2053
|
-
var querystring = {
|
|
2054
|
-
name: "querystring",
|
|
2055
|
-
lookup(_ref) {
|
|
2056
|
-
let { lookupQuerystring } = _ref;
|
|
2057
|
-
let found;
|
|
2058
|
-
if (typeof window !== "undefined") {
|
|
2059
|
-
let { search } = window.location;
|
|
2060
|
-
if (!window.location.search && window.location.hash?.indexOf("?") > -1) search = window.location.hash.substring(window.location.hash.indexOf("?"));
|
|
2061
|
-
const params = search.substring(1).split("&");
|
|
2062
|
-
for (let i = 0; i < params.length; i++) {
|
|
2063
|
-
const pos = params[i].indexOf("=");
|
|
2064
|
-
if (pos > 0) {
|
|
2065
|
-
if (params[i].substring(0, pos) === lookupQuerystring) found = params[i].substring(pos + 1);
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
return found;
|
|
2070
|
-
}
|
|
2071
|
-
};
|
|
2072
|
-
var hash = {
|
|
2073
|
-
name: "hash",
|
|
2074
|
-
lookup(_ref) {
|
|
2075
|
-
let { lookupHash, lookupFromHashIndex } = _ref;
|
|
2076
|
-
let found;
|
|
2077
|
-
if (typeof window !== "undefined") {
|
|
2078
|
-
const { hash } = window.location;
|
|
2079
|
-
if (hash && hash.length > 2) {
|
|
2080
|
-
const query = hash.substring(1);
|
|
2081
|
-
if (lookupHash) {
|
|
2082
|
-
const params = query.split("&");
|
|
2083
|
-
for (let i = 0; i < params.length; i++) {
|
|
2084
|
-
const pos = params[i].indexOf("=");
|
|
2085
|
-
if (pos > 0) {
|
|
2086
|
-
if (params[i].substring(0, pos) === lookupHash) found = params[i].substring(pos + 1);
|
|
2087
|
-
}
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
if (found) return found;
|
|
2091
|
-
if (!found && lookupFromHashIndex > -1) {
|
|
2092
|
-
const language = hash.match(/\/([a-zA-Z-]*)/g);
|
|
2093
|
-
if (!Array.isArray(language)) return void 0;
|
|
2094
|
-
return language[typeof lookupFromHashIndex === "number" ? lookupFromHashIndex : 0]?.replace("/", "");
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
}
|
|
2098
|
-
return found;
|
|
2099
|
-
}
|
|
2100
|
-
};
|
|
2101
|
-
var hasLocalStorageSupport = null;
|
|
2102
|
-
var localStorageAvailable = () => {
|
|
2103
|
-
if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
|
|
2104
|
-
try {
|
|
2105
|
-
hasLocalStorageSupport = typeof window !== "undefined" && window.localStorage !== null;
|
|
2106
|
-
if (!hasLocalStorageSupport) return false;
|
|
2107
|
-
const testKey = "i18next.translate.boo";
|
|
2108
|
-
window.localStorage.setItem(testKey, "foo");
|
|
2109
|
-
window.localStorage.removeItem(testKey);
|
|
2110
|
-
} catch (e) {
|
|
2111
|
-
hasLocalStorageSupport = false;
|
|
2112
|
-
}
|
|
2113
|
-
return hasLocalStorageSupport;
|
|
2114
|
-
};
|
|
2115
|
-
var localStorage$1 = {
|
|
2116
|
-
name: "localStorage",
|
|
2117
|
-
lookup(_ref) {
|
|
2118
|
-
let { lookupLocalStorage } = _ref;
|
|
2119
|
-
if (lookupLocalStorage && localStorageAvailable()) return window.localStorage.getItem(lookupLocalStorage) || void 0;
|
|
2120
|
-
},
|
|
2121
|
-
cacheUserLanguage(lng, _ref2) {
|
|
2122
|
-
let { lookupLocalStorage } = _ref2;
|
|
2123
|
-
if (lookupLocalStorage && localStorageAvailable()) window.localStorage.setItem(lookupLocalStorage, lng);
|
|
2124
|
-
}
|
|
2125
|
-
};
|
|
2126
|
-
var hasSessionStorageSupport = null;
|
|
2127
|
-
var sessionStorageAvailable = () => {
|
|
2128
|
-
if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
|
|
2129
|
-
try {
|
|
2130
|
-
hasSessionStorageSupport = typeof window !== "undefined" && window.sessionStorage !== null;
|
|
2131
|
-
if (!hasSessionStorageSupport) return false;
|
|
2132
|
-
const testKey = "i18next.translate.boo";
|
|
2133
|
-
window.sessionStorage.setItem(testKey, "foo");
|
|
2134
|
-
window.sessionStorage.removeItem(testKey);
|
|
2135
|
-
} catch (e) {
|
|
2136
|
-
hasSessionStorageSupport = false;
|
|
2137
|
-
}
|
|
2138
|
-
return hasSessionStorageSupport;
|
|
2139
|
-
};
|
|
2140
|
-
var sessionStorage = {
|
|
2141
|
-
name: "sessionStorage",
|
|
2142
|
-
lookup(_ref) {
|
|
2143
|
-
let { lookupSessionStorage } = _ref;
|
|
2144
|
-
if (lookupSessionStorage && sessionStorageAvailable()) return window.sessionStorage.getItem(lookupSessionStorage) || void 0;
|
|
2145
|
-
},
|
|
2146
|
-
cacheUserLanguage(lng, _ref2) {
|
|
2147
|
-
let { lookupSessionStorage } = _ref2;
|
|
2148
|
-
if (lookupSessionStorage && sessionStorageAvailable()) window.sessionStorage.setItem(lookupSessionStorage, lng);
|
|
2149
|
-
}
|
|
2150
|
-
};
|
|
2151
|
-
var navigator$1 = {
|
|
2152
|
-
name: "navigator",
|
|
2153
|
-
lookup(options) {
|
|
2154
|
-
const found = [];
|
|
2155
|
-
if (typeof navigator !== "undefined") {
|
|
2156
|
-
const { languages, userLanguage, language } = navigator;
|
|
2157
|
-
if (languages) for (let i = 0; i < languages.length; i++) found.push(languages[i]);
|
|
2158
|
-
if (userLanguage) found.push(userLanguage);
|
|
2159
|
-
if (language) found.push(language);
|
|
2160
|
-
}
|
|
2161
|
-
return found.length > 0 ? found : void 0;
|
|
2162
|
-
}
|
|
2163
|
-
};
|
|
2164
|
-
var htmlTag = {
|
|
2165
|
-
name: "htmlTag",
|
|
2166
|
-
lookup(_ref) {
|
|
2167
|
-
let { htmlTag } = _ref;
|
|
2168
|
-
let found;
|
|
2169
|
-
const internalHtmlTag = htmlTag || (typeof document !== "undefined" ? document.documentElement : null);
|
|
2170
|
-
if (internalHtmlTag && typeof internalHtmlTag.getAttribute === "function") found = internalHtmlTag.getAttribute("lang");
|
|
2171
|
-
return found;
|
|
2172
|
-
}
|
|
2173
|
-
};
|
|
2174
|
-
var path = {
|
|
2175
|
-
name: "path",
|
|
2176
|
-
lookup(_ref) {
|
|
2177
|
-
let { lookupFromPathIndex } = _ref;
|
|
2178
|
-
if (typeof window === "undefined") return void 0;
|
|
2179
|
-
const language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
2180
|
-
if (!Array.isArray(language)) return void 0;
|
|
2181
|
-
return language[typeof lookupFromPathIndex === "number" ? lookupFromPathIndex : 0]?.replace("/", "");
|
|
2182
|
-
}
|
|
2183
|
-
};
|
|
2184
|
-
var subdomain = {
|
|
2185
|
-
name: "subdomain",
|
|
2186
|
-
lookup(_ref) {
|
|
2187
|
-
let { lookupFromSubdomainIndex } = _ref;
|
|
2188
|
-
const internalLookupFromSubdomainIndex = typeof lookupFromSubdomainIndex === "number" ? lookupFromSubdomainIndex + 1 : 1;
|
|
2189
|
-
const language = typeof window !== "undefined" && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
|
2190
|
-
if (!language) return void 0;
|
|
2191
|
-
return language[internalLookupFromSubdomainIndex];
|
|
2192
|
-
}
|
|
2193
|
-
};
|
|
2194
|
-
var canCookies = false;
|
|
2195
|
-
try {
|
|
2196
|
-
document.cookie;
|
|
2197
|
-
canCookies = true;
|
|
2198
|
-
} catch (e) {}
|
|
2199
|
-
var order = [
|
|
2200
|
-
"querystring",
|
|
2201
|
-
"cookie",
|
|
2202
|
-
"localStorage",
|
|
2203
|
-
"sessionStorage",
|
|
2204
|
-
"navigator",
|
|
2205
|
-
"htmlTag"
|
|
2206
|
-
];
|
|
2207
|
-
if (!canCookies) order.splice(1, 1);
|
|
2208
|
-
var getDefaults$1 = () => ({
|
|
2209
|
-
order,
|
|
2210
|
-
lookupQuerystring: "lng",
|
|
2211
|
-
lookupCookie: "i18next",
|
|
2212
|
-
lookupLocalStorage: "i18nextLng",
|
|
2213
|
-
lookupSessionStorage: "i18nextLng",
|
|
2214
|
-
caches: ["localStorage"],
|
|
2215
|
-
excludeCacheFor: ["cimode"],
|
|
2216
|
-
convertDetectedLanguage: (l) => l
|
|
2217
|
-
});
|
|
2218
|
-
var Browser = class {
|
|
2219
|
-
constructor(services) {
|
|
2220
|
-
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2221
|
-
this.type = "languageDetector";
|
|
2222
|
-
this.detectors = {};
|
|
2223
|
-
this.init(services, options);
|
|
2224
|
-
}
|
|
2225
|
-
init() {
|
|
2226
|
-
let services = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { languageUtils: {} };
|
|
2227
|
-
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2228
|
-
let i18nOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2229
|
-
this.services = services;
|
|
2230
|
-
this.options = defaults(options, this.options || {}, getDefaults$1());
|
|
2231
|
-
if (typeof this.options.convertDetectedLanguage === "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1) this.options.convertDetectedLanguage = (l) => l.replace("-", "_");
|
|
2232
|
-
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
|
2233
|
-
this.i18nOptions = i18nOptions;
|
|
2234
|
-
this.addDetector(cookie$1);
|
|
2235
|
-
this.addDetector(querystring);
|
|
2236
|
-
this.addDetector(localStorage$1);
|
|
2237
|
-
this.addDetector(sessionStorage);
|
|
2238
|
-
this.addDetector(navigator$1);
|
|
2239
|
-
this.addDetector(htmlTag);
|
|
2240
|
-
this.addDetector(path);
|
|
2241
|
-
this.addDetector(subdomain);
|
|
2242
|
-
this.addDetector(hash);
|
|
2243
|
-
}
|
|
2244
|
-
addDetector(detector) {
|
|
2245
|
-
this.detectors[detector.name] = detector;
|
|
2246
|
-
return this;
|
|
2247
|
-
}
|
|
2248
|
-
detect() {
|
|
2249
|
-
let detectionOrder = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order;
|
|
2250
|
-
let detected = [];
|
|
2251
|
-
detectionOrder.forEach((detectorName) => {
|
|
2252
|
-
if (this.detectors[detectorName]) {
|
|
2253
|
-
let lookup = this.detectors[detectorName].lookup(this.options);
|
|
2254
|
-
if (lookup && typeof lookup === "string") lookup = [lookup];
|
|
2255
|
-
if (lookup) detected = detected.concat(lookup);
|
|
2256
|
-
}
|
|
2257
|
-
});
|
|
2258
|
-
detected = detected.filter((d) => d !== void 0 && d !== null && !hasXSS(d)).map((d) => this.options.convertDetectedLanguage(d));
|
|
2259
|
-
if (this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes) return detected;
|
|
2260
|
-
return detected.length > 0 ? detected[0] : null;
|
|
2261
|
-
}
|
|
2262
|
-
cacheUserLanguage(lng) {
|
|
2263
|
-
let caches = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
|
|
2264
|
-
if (!caches) return;
|
|
2265
|
-
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
|
|
2266
|
-
caches.forEach((cacheName) => {
|
|
2267
|
-
if (this.detectors[cacheName]) this.detectors[cacheName].cacheUserLanguage(lng, this.options);
|
|
2268
|
-
});
|
|
2269
|
-
}
|
|
2270
|
-
};
|
|
2271
|
-
Browser.type = "languageDetector";
|
|
2272
|
-
//#endregion
|
|
2273
|
-
//#region ../../node_modules/.pnpm/i18next-http-backend@3.0.2/node_modules/i18next-http-backend/esm/utils.js
|
|
2274
|
-
function _typeof$2(o) {
|
|
2275
|
-
"@babel/helpers - typeof";
|
|
2276
|
-
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
2277
|
-
return typeof o;
|
|
2278
|
-
} : function(o) {
|
|
2279
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2280
|
-
}, _typeof$2(o);
|
|
2281
|
-
}
|
|
2282
|
-
var arr = [];
|
|
2283
|
-
arr.forEach;
|
|
2284
|
-
arr.slice;
|
|
2285
|
-
function hasXMLHttpRequest() {
|
|
2286
|
-
return typeof XMLHttpRequest === "function" || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof$2(XMLHttpRequest)) === "object";
|
|
2287
|
-
}
|
|
2288
|
-
function isPromise(maybePromise) {
|
|
2289
|
-
return !!maybePromise && typeof maybePromise.then === "function";
|
|
2290
|
-
}
|
|
2291
|
-
function makePromise(maybePromise) {
|
|
2292
|
-
if (isPromise(maybePromise)) return maybePromise;
|
|
2293
|
-
return Promise.resolve(maybePromise);
|
|
2294
|
-
}
|
|
2295
|
-
//#endregion
|
|
2296
|
-
//#region ../../node_modules/.pnpm/i18next-http-backend@3.0.2/node_modules/i18next-http-backend/esm/request.js
|
|
2297
|
-
function ownKeys$1(e, r) {
|
|
2298
|
-
var t = Object.keys(e);
|
|
2299
|
-
if (Object.getOwnPropertySymbols) {
|
|
2300
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
2301
|
-
r && (o = o.filter(function(r) {
|
|
2302
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
2303
|
-
})), t.push.apply(t, o);
|
|
2304
|
-
}
|
|
2305
|
-
return t;
|
|
2306
|
-
}
|
|
2307
|
-
function _objectSpread$1(e) {
|
|
2308
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
2309
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
2310
|
-
r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
|
|
2311
|
-
_defineProperty$1(e, r, t[r]);
|
|
2312
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
|
|
2313
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
2314
|
-
});
|
|
2315
|
-
}
|
|
2316
|
-
return e;
|
|
2317
|
-
}
|
|
2318
|
-
function _defineProperty$1(e, r, t) {
|
|
2319
|
-
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
2320
|
-
value: t,
|
|
2321
|
-
enumerable: !0,
|
|
2322
|
-
configurable: !0,
|
|
2323
|
-
writable: !0
|
|
2324
|
-
}) : e[r] = t, e;
|
|
2325
|
-
}
|
|
2326
|
-
function _toPropertyKey$1(t) {
|
|
2327
|
-
var i = _toPrimitive$1(t, "string");
|
|
2328
|
-
return "symbol" == _typeof$1(i) ? i : i + "";
|
|
2329
|
-
}
|
|
2330
|
-
function _toPrimitive$1(t, r) {
|
|
2331
|
-
if ("object" != _typeof$1(t) || !t) return t;
|
|
2332
|
-
var e = t[Symbol.toPrimitive];
|
|
2333
|
-
if (void 0 !== e) {
|
|
2334
|
-
var i = e.call(t, r || "default");
|
|
2335
|
-
if ("object" != _typeof$1(i)) return i;
|
|
2336
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2337
|
-
}
|
|
2338
|
-
return ("string" === r ? String : Number)(t);
|
|
2339
|
-
}
|
|
2340
|
-
function _typeof$1(o) {
|
|
2341
|
-
"@babel/helpers - typeof";
|
|
2342
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
2343
|
-
return typeof o;
|
|
2344
|
-
} : function(o) {
|
|
2345
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2346
|
-
}, _typeof$1(o);
|
|
2347
|
-
}
|
|
2348
|
-
var fetchApi = typeof fetch === "function" ? fetch : void 0;
|
|
2349
|
-
if (typeof global !== "undefined" && global.fetch) fetchApi = global.fetch;
|
|
2350
|
-
else if (typeof window !== "undefined" && window.fetch) fetchApi = window.fetch;
|
|
2351
|
-
var XmlHttpRequestApi;
|
|
2352
|
-
if (hasXMLHttpRequest()) {
|
|
2353
|
-
if (typeof global !== "undefined" && global.XMLHttpRequest) XmlHttpRequestApi = global.XMLHttpRequest;
|
|
2354
|
-
else if (typeof window !== "undefined" && window.XMLHttpRequest) XmlHttpRequestApi = window.XMLHttpRequest;
|
|
2355
|
-
}
|
|
2356
|
-
var ActiveXObjectApi;
|
|
2357
|
-
if (typeof ActiveXObject === "function") {
|
|
2358
|
-
if (typeof global !== "undefined" && global.ActiveXObject) ActiveXObjectApi = global.ActiveXObject;
|
|
2359
|
-
else if (typeof window !== "undefined" && window.ActiveXObject) ActiveXObjectApi = window.ActiveXObject;
|
|
2360
|
-
}
|
|
2361
|
-
if (typeof fetchApi !== "function") fetchApi = void 0;
|
|
2362
|
-
if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) try {
|
|
2363
|
-
import("./browser-ponyfill-DT11p-Ob.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)).then(function(mod) {
|
|
2364
|
-
fetchApi = mod.default;
|
|
2365
|
-
}).catch(function() {});
|
|
2366
|
-
} catch (e) {}
|
|
2367
|
-
var addQueryString = function addQueryString(url, params) {
|
|
2368
|
-
if (params && _typeof$1(params) === "object") {
|
|
2369
|
-
var queryString = "";
|
|
2370
|
-
for (var paramName in params) queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
|
|
2371
|
-
if (!queryString) return url;
|
|
2372
|
-
url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
|
|
2373
|
-
}
|
|
2374
|
-
return url;
|
|
2375
|
-
};
|
|
2376
|
-
var fetchIt = function fetchIt(url, fetchOptions, callback, altFetch) {
|
|
2377
|
-
var resolver = function resolver(response) {
|
|
2378
|
-
if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
|
|
2379
|
-
response.text().then(function(data) {
|
|
2380
|
-
callback(null, {
|
|
2381
|
-
status: response.status,
|
|
2382
|
-
data
|
|
2383
|
-
});
|
|
2384
|
-
}).catch(callback);
|
|
2385
|
-
};
|
|
2386
|
-
if (altFetch) {
|
|
2387
|
-
var altResponse = altFetch(url, fetchOptions);
|
|
2388
|
-
if (altResponse instanceof Promise) {
|
|
2389
|
-
altResponse.then(resolver).catch(callback);
|
|
2390
|
-
return;
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
|
|
2394
|
-
else fetchApi(url, fetchOptions).then(resolver).catch(callback);
|
|
2395
|
-
};
|
|
2396
|
-
var omitFetchOptions = false;
|
|
2397
|
-
var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
|
|
2398
|
-
if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
|
|
2399
|
-
var headers = _objectSpread$1({}, typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders);
|
|
2400
|
-
if (typeof window === "undefined" && typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node) headers["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")");
|
|
2401
|
-
if (payload) headers["Content-Type"] = "application/json";
|
|
2402
|
-
var reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
|
|
2403
|
-
var fetchOptions = _objectSpread$1({
|
|
2404
|
-
method: payload ? "POST" : "GET",
|
|
2405
|
-
body: payload ? options.stringify(payload) : void 0,
|
|
2406
|
-
headers
|
|
2407
|
-
}, omitFetchOptions ? {} : reqOptions);
|
|
2408
|
-
var altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
|
|
2409
|
-
try {
|
|
2410
|
-
fetchIt(url, fetchOptions, callback, altFetch);
|
|
2411
|
-
} catch (e) {
|
|
2412
|
-
if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
|
|
2413
|
-
try {
|
|
2414
|
-
Object.keys(reqOptions).forEach(function(opt) {
|
|
2415
|
-
delete fetchOptions[opt];
|
|
2416
|
-
});
|
|
2417
|
-
fetchIt(url, fetchOptions, callback, altFetch);
|
|
2418
|
-
omitFetchOptions = true;
|
|
2419
|
-
} catch (err) {
|
|
2420
|
-
callback(err);
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
};
|
|
2424
|
-
var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
|
|
2425
|
-
if (payload && _typeof$1(payload) === "object") payload = addQueryString("", payload).slice(1);
|
|
2426
|
-
if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
|
|
2427
|
-
try {
|
|
2428
|
-
var x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
|
|
2429
|
-
x.open(payload ? "POST" : "GET", url, 1);
|
|
2430
|
-
if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
|
2431
|
-
x.withCredentials = !!options.withCredentials;
|
|
2432
|
-
if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
2433
|
-
if (x.overrideMimeType) x.overrideMimeType("application/json");
|
|
2434
|
-
var h = options.customHeaders;
|
|
2435
|
-
h = typeof h === "function" ? h() : h;
|
|
2436
|
-
if (h) for (var i in h) x.setRequestHeader(i, h[i]);
|
|
2437
|
-
x.onreadystatechange = function() {
|
|
2438
|
-
x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
|
|
2439
|
-
status: x.status,
|
|
2440
|
-
data: x.responseText
|
|
2441
|
-
});
|
|
2442
|
-
};
|
|
2443
|
-
x.send(payload);
|
|
2444
|
-
} catch (e) {
|
|
2445
|
-
console && console.log(e);
|
|
2446
|
-
}
|
|
2447
|
-
};
|
|
2448
|
-
var request = function request(options, url, payload, callback) {
|
|
2449
|
-
if (typeof payload === "function") {
|
|
2450
|
-
callback = payload;
|
|
2451
|
-
payload = void 0;
|
|
2452
|
-
}
|
|
2453
|
-
callback = callback || function() {};
|
|
2454
|
-
if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
|
|
2455
|
-
if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
|
|
2456
|
-
callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
|
|
2457
|
-
};
|
|
2458
|
-
//#endregion
|
|
2459
|
-
//#region ../../node_modules/.pnpm/i18next-http-backend@3.0.2/node_modules/i18next-http-backend/esm/index.js
|
|
2460
|
-
function _typeof(o) {
|
|
2461
|
-
"@babel/helpers - typeof";
|
|
2462
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
2463
|
-
return typeof o;
|
|
2464
|
-
} : function(o) {
|
|
2465
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2466
|
-
}, _typeof(o);
|
|
2467
|
-
}
|
|
2468
|
-
function ownKeys(e, r) {
|
|
2469
|
-
var t = Object.keys(e);
|
|
2470
|
-
if (Object.getOwnPropertySymbols) {
|
|
2471
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
2472
|
-
r && (o = o.filter(function(r) {
|
|
2473
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
2474
|
-
})), t.push.apply(t, o);
|
|
2475
|
-
}
|
|
2476
|
-
return t;
|
|
2477
|
-
}
|
|
2478
|
-
function _objectSpread(e) {
|
|
2479
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
2480
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
2481
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
2482
|
-
_defineProperty(e, r, t[r]);
|
|
2483
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
2484
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
2485
|
-
});
|
|
2486
|
-
}
|
|
2487
|
-
return e;
|
|
2488
|
-
}
|
|
2489
|
-
function _classCallCheck(a, n) {
|
|
2490
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
2491
|
-
}
|
|
2492
|
-
function _defineProperties(e, r) {
|
|
2493
|
-
for (var t = 0; t < r.length; t++) {
|
|
2494
|
-
var o = r[t];
|
|
2495
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
function _createClass(e, r, t) {
|
|
2499
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
2500
|
-
}
|
|
2501
|
-
function _defineProperty(e, r, t) {
|
|
2502
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2503
|
-
value: t,
|
|
2504
|
-
enumerable: !0,
|
|
2505
|
-
configurable: !0,
|
|
2506
|
-
writable: !0
|
|
2507
|
-
}) : e[r] = t, e;
|
|
2508
|
-
}
|
|
2509
|
-
function _toPropertyKey(t) {
|
|
2510
|
-
var i = _toPrimitive(t, "string");
|
|
2511
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
2512
|
-
}
|
|
2513
|
-
function _toPrimitive(t, r) {
|
|
2514
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
2515
|
-
var e = t[Symbol.toPrimitive];
|
|
2516
|
-
if (void 0 !== e) {
|
|
2517
|
-
var i = e.call(t, r || "default");
|
|
2518
|
-
if ("object" != _typeof(i)) return i;
|
|
2519
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2520
|
-
}
|
|
2521
|
-
return ("string" === r ? String : Number)(t);
|
|
2522
|
-
}
|
|
2523
|
-
var getDefaults = function getDefaults() {
|
|
2524
|
-
return {
|
|
2525
|
-
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
|
2526
|
-
addPath: "/locales/add/{{lng}}/{{ns}}",
|
|
2527
|
-
parse: function parse(data) {
|
|
2528
|
-
return JSON.parse(data);
|
|
2529
|
-
},
|
|
2530
|
-
stringify: JSON.stringify,
|
|
2531
|
-
parsePayload: function parsePayload(namespace, key, fallbackValue) {
|
|
2532
|
-
return _defineProperty({}, key, fallbackValue || "");
|
|
2533
|
-
},
|
|
2534
|
-
parseLoadPayload: function parseLoadPayload(languages, namespaces) {},
|
|
2535
|
-
request,
|
|
2536
|
-
reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
|
|
2537
|
-
customHeaders: {},
|
|
2538
|
-
queryStringParams: {},
|
|
2539
|
-
crossDomain: false,
|
|
2540
|
-
withCredentials: false,
|
|
2541
|
-
overrideMimeType: false,
|
|
2542
|
-
requestOptions: {
|
|
2543
|
-
mode: "cors",
|
|
2544
|
-
credentials: "same-origin",
|
|
2545
|
-
cache: "default"
|
|
2546
|
-
}
|
|
2547
|
-
};
|
|
2548
|
-
};
|
|
2549
|
-
var Backend = function() {
|
|
2550
|
-
function Backend(services) {
|
|
2551
|
-
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2552
|
-
var allOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2553
|
-
_classCallCheck(this, Backend);
|
|
2554
|
-
this.services = services;
|
|
2555
|
-
this.options = options;
|
|
2556
|
-
this.allOptions = allOptions;
|
|
2557
|
-
this.type = "backend";
|
|
2558
|
-
this.init(services, options, allOptions);
|
|
2559
|
-
}
|
|
2560
|
-
return _createClass(Backend, [
|
|
2561
|
-
{
|
|
2562
|
-
key: "init",
|
|
2563
|
-
value: function init(services) {
|
|
2564
|
-
var _this = this;
|
|
2565
|
-
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2566
|
-
var allOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2567
|
-
this.services = services;
|
|
2568
|
-
this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
|
|
2569
|
-
this.allOptions = allOptions;
|
|
2570
|
-
if (this.services && this.options.reloadInterval) {
|
|
2571
|
-
var timer = setInterval(function() {
|
|
2572
|
-
return _this.reload();
|
|
2573
|
-
}, this.options.reloadInterval);
|
|
2574
|
-
if (_typeof(timer) === "object" && typeof timer.unref === "function") timer.unref();
|
|
2575
|
-
}
|
|
2576
|
-
}
|
|
2577
|
-
},
|
|
2578
|
-
{
|
|
2579
|
-
key: "readMulti",
|
|
2580
|
-
value: function readMulti(languages, namespaces, callback) {
|
|
2581
|
-
this._readAny(languages, languages, namespaces, namespaces, callback);
|
|
2582
|
-
}
|
|
2583
|
-
},
|
|
2584
|
-
{
|
|
2585
|
-
key: "read",
|
|
2586
|
-
value: function read(language, namespace, callback) {
|
|
2587
|
-
this._readAny([language], language, [namespace], namespace, callback);
|
|
2588
|
-
}
|
|
2589
|
-
},
|
|
2590
|
-
{
|
|
2591
|
-
key: "_readAny",
|
|
2592
|
-
value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
|
|
2593
|
-
var _this2 = this;
|
|
2594
|
-
var loadPath = this.options.loadPath;
|
|
2595
|
-
if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
|
|
2596
|
-
loadPath = makePromise(loadPath);
|
|
2597
|
-
loadPath.then(function(resolvedLoadPath) {
|
|
2598
|
-
if (!resolvedLoadPath) return callback(null, {});
|
|
2599
|
-
var url = _this2.services.interpolator.interpolate(resolvedLoadPath, {
|
|
2600
|
-
lng: languages.join("+"),
|
|
2601
|
-
ns: namespaces.join("+")
|
|
2602
|
-
});
|
|
2603
|
-
_this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
|
|
2604
|
-
});
|
|
2605
|
-
}
|
|
2606
|
-
},
|
|
2607
|
-
{
|
|
2608
|
-
key: "loadUrl",
|
|
2609
|
-
value: function loadUrl(url, callback, languages, namespaces) {
|
|
2610
|
-
var _this3 = this;
|
|
2611
|
-
var lng = typeof languages === "string" ? [languages] : languages;
|
|
2612
|
-
var ns = typeof namespaces === "string" ? [namespaces] : namespaces;
|
|
2613
|
-
var payload = this.options.parseLoadPayload(lng, ns);
|
|
2614
|
-
this.options.request(this.options, url, payload, function(err, res) {
|
|
2615
|
-
if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + url + "; status code: " + res.status, true);
|
|
2616
|
-
if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + url + "; status code: " + res.status, false);
|
|
2617
|
-
if (!res && err && err.message) {
|
|
2618
|
-
var errorMessage = err.message.toLowerCase();
|
|
2619
|
-
if ([
|
|
2620
|
-
"failed",
|
|
2621
|
-
"fetch",
|
|
2622
|
-
"network",
|
|
2623
|
-
"load"
|
|
2624
|
-
].find(function(term) {
|
|
2625
|
-
return errorMessage.indexOf(term) > -1;
|
|
2626
|
-
})) return callback("failed loading " + url + ": " + err.message, true);
|
|
2627
|
-
}
|
|
2628
|
-
if (err) return callback(err, false);
|
|
2629
|
-
var ret, parseErr;
|
|
2630
|
-
try {
|
|
2631
|
-
if (typeof res.data === "string") ret = _this3.options.parse(res.data, languages, namespaces);
|
|
2632
|
-
else ret = res.data;
|
|
2633
|
-
} catch (e) {
|
|
2634
|
-
parseErr = "failed parsing " + url + " to json";
|
|
2635
|
-
}
|
|
2636
|
-
if (parseErr) return callback(parseErr, false);
|
|
2637
|
-
callback(null, ret);
|
|
2638
|
-
});
|
|
2639
|
-
}
|
|
2640
|
-
},
|
|
2641
|
-
{
|
|
2642
|
-
key: "create",
|
|
2643
|
-
value: function create(languages, namespace, key, fallbackValue, callback) {
|
|
2644
|
-
var _this4 = this;
|
|
2645
|
-
if (!this.options.addPath) return;
|
|
2646
|
-
if (typeof languages === "string") languages = [languages];
|
|
2647
|
-
var payload = this.options.parsePayload(namespace, key, fallbackValue);
|
|
2648
|
-
var finished = 0;
|
|
2649
|
-
var dataArray = [];
|
|
2650
|
-
var resArray = [];
|
|
2651
|
-
languages.forEach(function(lng) {
|
|
2652
|
-
var addPath = _this4.options.addPath;
|
|
2653
|
-
if (typeof _this4.options.addPath === "function") addPath = _this4.options.addPath(lng, namespace);
|
|
2654
|
-
var url = _this4.services.interpolator.interpolate(addPath, {
|
|
2655
|
-
lng,
|
|
2656
|
-
ns: namespace
|
|
2657
|
-
});
|
|
2658
|
-
_this4.options.request(_this4.options, url, payload, function(data, res) {
|
|
2659
|
-
finished += 1;
|
|
2660
|
-
dataArray.push(data);
|
|
2661
|
-
resArray.push(res);
|
|
2662
|
-
if (finished === languages.length) {
|
|
2663
|
-
if (typeof callback === "function") callback(dataArray, resArray);
|
|
2664
|
-
}
|
|
2665
|
-
});
|
|
2666
|
-
});
|
|
2667
|
-
}
|
|
2668
|
-
},
|
|
2669
|
-
{
|
|
2670
|
-
key: "reload",
|
|
2671
|
-
value: function reload() {
|
|
2672
|
-
var _this5 = this;
|
|
2673
|
-
var _this$services = this.services, backendConnector = _this$services.backendConnector, languageUtils = _this$services.languageUtils, logger = _this$services.logger;
|
|
2674
|
-
var currentLanguage = backendConnector.language;
|
|
2675
|
-
if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
|
|
2676
|
-
var toLoad = [];
|
|
2677
|
-
var append = function append(lng) {
|
|
2678
|
-
languageUtils.toResolveHierarchy(lng).forEach(function(l) {
|
|
2679
|
-
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
|
2680
|
-
});
|
|
2681
|
-
};
|
|
2682
|
-
append(currentLanguage);
|
|
2683
|
-
if (this.allOptions.preload) this.allOptions.preload.forEach(function(l) {
|
|
2684
|
-
return append(l);
|
|
2685
|
-
});
|
|
2686
|
-
toLoad.forEach(function(lng) {
|
|
2687
|
-
_this5.allOptions.ns.forEach(function(ns) {
|
|
2688
|
-
backendConnector.read(lng, ns, "read", null, null, function(err, data) {
|
|
2689
|
-
if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
|
|
2690
|
-
if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
|
|
2691
|
-
backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
|
|
2692
|
-
});
|
|
2693
|
-
});
|
|
2694
|
-
});
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
]);
|
|
2698
|
-
}();
|
|
2699
|
-
Backend.type = "backend";
|
|
2700
|
-
//#endregion
|
|
2701
1945
|
//#region src/i18n/bundledTranslationLoaders.ts
|
|
2702
1946
|
var bundledTranslationLoaders = {
|
|
2703
1947
|
"en": () => import("./en-4q1x56vs.js"),
|
|
@@ -2801,8 +2045,91 @@ var bundledTranslationsBackend = {
|
|
|
2801
2045
|
load().then(({ default: translations }) => callback(null, translations), (error) => callback(asError(error), false));
|
|
2802
2046
|
}
|
|
2803
2047
|
};
|
|
2804
|
-
|
|
2805
|
-
|
|
2048
|
+
var supportedLanguages = [
|
|
2049
|
+
"en",
|
|
2050
|
+
"en-DG",
|
|
2051
|
+
"es",
|
|
2052
|
+
"es-ES",
|
|
2053
|
+
"sr",
|
|
2054
|
+
"sr-Latn",
|
|
2055
|
+
"fr",
|
|
2056
|
+
"pt-BR",
|
|
2057
|
+
"pt",
|
|
2058
|
+
"bn",
|
|
2059
|
+
"zh",
|
|
2060
|
+
"hi",
|
|
2061
|
+
"id",
|
|
2062
|
+
"ms",
|
|
2063
|
+
"tr",
|
|
2064
|
+
"vi",
|
|
2065
|
+
"ht",
|
|
2066
|
+
"it",
|
|
2067
|
+
"de",
|
|
2068
|
+
"nl",
|
|
2069
|
+
"tl-PH",
|
|
2070
|
+
"pl",
|
|
2071
|
+
"hu",
|
|
2072
|
+
"ro",
|
|
2073
|
+
"hmn",
|
|
2074
|
+
"so",
|
|
2075
|
+
"ca",
|
|
2076
|
+
"af-ZA",
|
|
2077
|
+
"ar",
|
|
2078
|
+
"ar-EG",
|
|
2079
|
+
"ar-AE",
|
|
2080
|
+
"zh-CN",
|
|
2081
|
+
"zh-TW",
|
|
2082
|
+
"zh-HANT",
|
|
2083
|
+
"cs-CZ",
|
|
2084
|
+
"da-DK",
|
|
2085
|
+
"fi-FI",
|
|
2086
|
+
"fr-CA",
|
|
2087
|
+
"el-GR",
|
|
2088
|
+
"he",
|
|
2089
|
+
"ja",
|
|
2090
|
+
"ja-JP",
|
|
2091
|
+
"ko-KP",
|
|
2092
|
+
"nb-NO",
|
|
2093
|
+
"fa-IR",
|
|
2094
|
+
"pt-PT",
|
|
2095
|
+
"ru-RU",
|
|
2096
|
+
"sr-YU",
|
|
2097
|
+
"es-419",
|
|
2098
|
+
"es-MX",
|
|
2099
|
+
"sv-SE",
|
|
2100
|
+
"th-TH",
|
|
2101
|
+
"uk-UA",
|
|
2102
|
+
"am",
|
|
2103
|
+
"az",
|
|
2104
|
+
"bs",
|
|
2105
|
+
"my",
|
|
2106
|
+
"ceb",
|
|
2107
|
+
"cs",
|
|
2108
|
+
"et",
|
|
2109
|
+
"ka",
|
|
2110
|
+
"el",
|
|
2111
|
+
"jv",
|
|
2112
|
+
"kk",
|
|
2113
|
+
"km",
|
|
2114
|
+
"ko",
|
|
2115
|
+
"ky",
|
|
2116
|
+
"lo",
|
|
2117
|
+
"lv",
|
|
2118
|
+
"lt",
|
|
2119
|
+
"mk",
|
|
2120
|
+
"mn",
|
|
2121
|
+
"ne",
|
|
2122
|
+
"ru",
|
|
2123
|
+
"sk",
|
|
2124
|
+
"sl",
|
|
2125
|
+
"sw",
|
|
2126
|
+
"tl",
|
|
2127
|
+
"th",
|
|
2128
|
+
"uk",
|
|
2129
|
+
"ur",
|
|
2130
|
+
"uz",
|
|
2131
|
+
"hr"
|
|
2132
|
+
];
|
|
2806
2133
|
var languageMetadata = {
|
|
2807
2134
|
en: { emoji: "🇺🇸" },
|
|
2808
2135
|
"en-DG": { emoji: "🇬🇧" },
|
|
@@ -2888,13 +2215,51 @@ var languageMetadata = {
|
|
|
2888
2215
|
uz: { emoji: "🇺🇿" },
|
|
2889
2216
|
hr: { emoji: "🇭🇷" }
|
|
2890
2217
|
};
|
|
2891
|
-
var supportedLanguages = Object.keys(languageMetadata);
|
|
2892
2218
|
function getLanguageEmoji(language) {
|
|
2893
2219
|
const directMatch = languageMetadata[language];
|
|
2894
2220
|
if (directMatch) return directMatch.emoji;
|
|
2895
2221
|
return languageMetadata[language.split("-")[0] || language]?.emoji ?? "🌐";
|
|
2896
2222
|
}
|
|
2897
2223
|
//#endregion
|
|
2224
|
+
//#region src/i18n/lazyHttpBackend.ts
|
|
2225
|
+
var _LazyHttpBackend;
|
|
2226
|
+
/**
|
|
2227
|
+
* Loads i18next-http-backend on the first read, so sessions that use the
|
|
2228
|
+
* bundled catalogs do not download it. i18next creates one instance of this
|
|
2229
|
+
* class for each i18n instance.
|
|
2230
|
+
*/
|
|
2231
|
+
var LazyHttpBackend = class {
|
|
2232
|
+
constructor() {
|
|
2233
|
+
this.type = "backend";
|
|
2234
|
+
}
|
|
2235
|
+
init(services, backendOptions, i18nextOptions) {
|
|
2236
|
+
this.initArgs = [
|
|
2237
|
+
services,
|
|
2238
|
+
backendOptions,
|
|
2239
|
+
i18nextOptions
|
|
2240
|
+
];
|
|
2241
|
+
}
|
|
2242
|
+
read(language, namespace, callback) {
|
|
2243
|
+
this.backend ??= import("./esm-15CISqPe.js").then(({ default: RealHttpBackend }) => {
|
|
2244
|
+
const backend = new RealHttpBackend();
|
|
2245
|
+
backend.init(...this.initArgs);
|
|
2246
|
+
return backend;
|
|
2247
|
+
});
|
|
2248
|
+
this.backend.then((backend) => {
|
|
2249
|
+
try {
|
|
2250
|
+
backend.read(language, namespace, callback);
|
|
2251
|
+
} catch (error) {
|
|
2252
|
+
callback(error, false);
|
|
2253
|
+
}
|
|
2254
|
+
}, (error) => {
|
|
2255
|
+
this.backend = void 0;
|
|
2256
|
+
callback(error, false);
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
};
|
|
2260
|
+
_LazyHttpBackend = LazyHttpBackend;
|
|
2261
|
+
_LazyHttpBackend.type = "backend";
|
|
2262
|
+
//#endregion
|
|
2898
2263
|
//#region src/i18n/setup.ts
|
|
2899
2264
|
var LANGUAGE_STORAGE_KEY = "incode:i18n:language";
|
|
2900
2265
|
var camelToStartCase = (text) => {
|
|
@@ -2907,41 +2272,53 @@ var keyToStartCase = (key, defaultValue) => {
|
|
|
2907
2272
|
const missingKey = splitKey[splitKey.length - 1];
|
|
2908
2273
|
return camelToStartCase(missingKey || "missing key");
|
|
2909
2274
|
};
|
|
2275
|
+
function readNavigatorLanguage() {
|
|
2276
|
+
if (typeof navigator === "undefined") return "en";
|
|
2277
|
+
const languageFromBrowser = navigator.language;
|
|
2278
|
+
if (!languageFromBrowser) return null;
|
|
2279
|
+
if (supportedLanguages.includes(languageFromBrowser)) return languageFromBrowser;
|
|
2280
|
+
return languageFromBrowser.split("-")[0];
|
|
2281
|
+
}
|
|
2282
|
+
function readHtmlLanguage() {
|
|
2283
|
+
if (typeof document === "undefined") return null;
|
|
2284
|
+
return document.documentElement?.getAttribute("lang") ?? null;
|
|
2285
|
+
}
|
|
2910
2286
|
function createLanguageDetector(skipInitialLanguageCache) {
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
languageDetector.cacheUserLanguage = (language, caches) => {
|
|
2925
|
-
if (isInitialLanguage) {
|
|
2926
|
-
isInitialLanguage = false;
|
|
2287
|
+
let skipNextCache = skipInitialLanguageCache;
|
|
2288
|
+
return {
|
|
2289
|
+
type: "languageDetector",
|
|
2290
|
+
detect: () => [
|
|
2291
|
+
readQueryLanguage(),
|
|
2292
|
+
readStoredLanguage(),
|
|
2293
|
+
readStorageLanguage(() => sessionStorage),
|
|
2294
|
+
readNavigatorLanguage(),
|
|
2295
|
+
readHtmlLanguage()
|
|
2296
|
+
].filter((language) => !!language),
|
|
2297
|
+
cacheUserLanguage(language) {
|
|
2298
|
+
if (skipNextCache) {
|
|
2299
|
+
skipNextCache = false;
|
|
2927
2300
|
return;
|
|
2928
2301
|
}
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2302
|
+
if (language === "cimode") return;
|
|
2303
|
+
try {
|
|
2304
|
+
localStorage.setItem(LANGUAGE_STORAGE_KEY, language);
|
|
2305
|
+
} catch {}
|
|
2306
|
+
}
|
|
2307
|
+
};
|
|
2933
2308
|
}
|
|
2934
2309
|
function applyOverrides(i18nInstance, translations) {
|
|
2935
2310
|
for (const [langCode, value] of Object.entries(translations)) if (value) i18nInstance.addResourceBundle(langCode, "default", value, true, true);
|
|
2936
2311
|
}
|
|
2937
|
-
function
|
|
2312
|
+
function readStorageLanguage(getStorage) {
|
|
2938
2313
|
try {
|
|
2939
|
-
|
|
2940
|
-
return localStorage.getItem(LANGUAGE_STORAGE_KEY);
|
|
2314
|
+
return getStorage().getItem(LANGUAGE_STORAGE_KEY);
|
|
2941
2315
|
} catch {
|
|
2942
2316
|
return null;
|
|
2943
2317
|
}
|
|
2944
2318
|
}
|
|
2319
|
+
function readStoredLanguage() {
|
|
2320
|
+
return readStorageLanguage(() => localStorage);
|
|
2321
|
+
}
|
|
2945
2322
|
function readQueryLanguage() {
|
|
2946
2323
|
if (typeof window === "undefined") return null;
|
|
2947
2324
|
return new URLSearchParams(window.location.search).get("lang") || null;
|
|
@@ -2954,7 +2331,7 @@ function createI18n(options = {}) {
|
|
|
2954
2331
|
const storedLang = readStoredLanguage();
|
|
2955
2332
|
const resolvedLoadPath = loadPath ?? void 0;
|
|
2956
2333
|
const remoteLoadEnabled = skipRemoteLoad !== true && resolvedLoadPath !== void 0;
|
|
2957
|
-
if (remoteLoadEnabled) i18nInstance.use(
|
|
2334
|
+
if (remoteLoadEnabled) i18nInstance.use(LazyHttpBackend);
|
|
2958
2335
|
else i18nInstance.use(bundledTranslationsBackend);
|
|
2959
2336
|
i18nInstance.use(languageDetector).init({
|
|
2960
2337
|
lng: queryLang ?? storedLang ?? lang,
|
|
@@ -2967,22 +2344,6 @@ function createI18n(options = {}) {
|
|
|
2967
2344
|
keySeparator: ".",
|
|
2968
2345
|
interpolation: { escapeValue: false },
|
|
2969
2346
|
backend: remoteLoadEnabled ? { loadPath: resolvedLoadPath } : void 0,
|
|
2970
|
-
detection: {
|
|
2971
|
-
order: [
|
|
2972
|
-
"querystring",
|
|
2973
|
-
"cookie",
|
|
2974
|
-
"localStorage",
|
|
2975
|
-
"sessionStorage",
|
|
2976
|
-
"navigatorOnlyLanguage",
|
|
2977
|
-
"htmlTag",
|
|
2978
|
-
"path",
|
|
2979
|
-
"subdomain"
|
|
2980
|
-
],
|
|
2981
|
-
lookupQuerystring: "lang",
|
|
2982
|
-
lookupLocalStorage: LANGUAGE_STORAGE_KEY,
|
|
2983
|
-
lookupSessionStorage: LANGUAGE_STORAGE_KEY,
|
|
2984
|
-
caches: ["localStorage"]
|
|
2985
|
-
},
|
|
2986
2347
|
initImmediate: false,
|
|
2987
2348
|
parseMissingKeyHandler: keyToStartCase
|
|
2988
2349
|
});
|