@incodetech/welcome 1.76.1-rc.20241128172746 → 1.76.1
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/dist/onBoarding.mjs +2 -2
- package/dist/onBoarding.umd.js +2 -2
- package/package.json +2 -4
package/dist/onBoarding.mjs
CHANGED
|
@@ -6654,7 +6654,7 @@ class OnboardingAnalytics {
|
|
|
6654
6654
|
}
|
|
6655
6655
|
}
|
|
6656
6656
|
const OnboardingAnalytics$1 = OnboardingAnalytics.getInstance();
|
|
6657
|
-
var define_import_meta_env_default = { BASE_URL: "/", DEV: !1, MODE: "production", PACKAGE_VERSION: "1.76.1
|
|
6657
|
+
var define_import_meta_env_default = { BASE_URL: "/", DEV: !1, MODE: "production", PACKAGE_VERSION: "1.76.1", PROD: !0, SSR: !1 };
|
|
6658
6658
|
class DetectionSetup {
|
|
6659
6659
|
constructor() {
|
|
6660
6660
|
this.setupDetectPromise = null, this.isSetupDetect = !1, this.profiles = null;
|
|
@@ -55487,7 +55487,7 @@ function renderUserConsent(me, {
|
|
|
55487
55487
|
Je
|
|
55488
55488
|
);
|
|
55489
55489
|
}
|
|
55490
|
-
const version$1 = "1.76.1
|
|
55490
|
+
const version$1 = "1.76.1";
|
|
55491
55491
|
function r$1(me) {
|
|
55492
55492
|
for (var ue = "", Ue = 0; Ue < me.length; ++Ue) if (Ue > 0) {
|
|
55493
55493
|
var Ze = me[Ue].toLowerCase();
|
package/dist/onBoarding.umd.js
CHANGED
|
@@ -77,7 +77,7 @@ See https://s-c.sh/2BAXzed for more info.`),window["__styled-components-init__"]
|
|
|
77
77
|
justify-content: center;
|
|
78
78
|
align-items: center;
|
|
79
79
|
flex-direction: column;
|
|
80
|
-
`,typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let me,ue;return{promise:new Promise((Ze,Qe)=>{me=Ze,ue=Qe}),resolve:me,reject:ue}});const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,E164_PHONE_NUMBER:/^\+?[1-9]\d{7,14}$/,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};exports.api=void 0;function setApi(me){exports.api=me}function setToken(me){exports.api.defaults.headers["X-Incode-Hardware-Id"]=me}const eventsQueue=[];function addEvent(me){const{token:ue,code:Ue,module:Ze,screen:Qe,clientTimestamp:Ge,payload:Je={}}=me;if(!ue){eventsQueue.push(me);return}return exports.api.post("/omni/interview-events",[{code:Ue,module:Ze,screen:Qe,clientTimestamp:Ge??new Date().getTime(),payload:Je}],{headers:{"X-Incode-Hardware-Id":ue}}).catch(()=>{})}function emptyQueue(me){eventsQueue.forEach(ue=>{addEvent({...ue,token:me})})}const state={token:null};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu"};const setOptions=me=>(options={...options,...me},options);var PipelineProfileName=(me=>(me[me.IdCapture_2_01=0]="IdCapture_2_01",me[me.IdCapture_3_01=1]="IdCapture_3_01",me[me.IdVideoSelfie_2_01=2]="IdVideoSelfie_2_01",me[me.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",me))(PipelineProfileName||{});class PipelineProfile{constructor(ue,Ue,Ze,Qe,Ge,Je=null,Xe=""){this.pipelineType=ue,this.name=Ue,this.detectionType=Ze,this.modelNames=Qe,this.parameters=Ge,this.paramsConfigurator=Je,this.description=Xe}reconfigureParams(ue=null){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,ue)}}var DetectionType=(me=>(me[me.IDCapture=0]="IDCapture",me[me.Selfie=1]="Selfie",me[me.IdVideoSelfie=2]="IdVideoSelfie",me))(DetectionType||{}),WasmPipelineType=(me=>(me[me.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",me[me.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",me[me.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",me[me.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",me[me.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",me))(WasmPipelineType||{}),IdCaptureModelType=(me=>(me[me.IdCaptureV1x=0]="IdCaptureV1x",me[me.IdCaptureV2x=1]="IdCaptureV2x",me[me.IdCaptureV3x=2]="IdCaptureV3x",me))(IdCaptureModelType||{});function IdCaptureParamsConfigurator(me,ue,Ue){Object.assign(me,{areaDown:Ue?55e3:25e3,areaUp:Ue?75e3:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:ue==WasmPipelineType.IdBlurGlarePipeline||WasmPipelineType.IdBarcodeAndTextQualityPipeline?125:180,widthIOSDown:ue==WasmPipelineType.IdBlurGlarePipeline||WasmPipelineType.IdBarcodeAndTextQualityPipeline?85:150,widthDown:Ue?185:135,widthUp:Ue?255:205})}const SelfieFaceDetectionPipelineParams={frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.95,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.5,minFaceQualityScore:.65},pipelineProfiles=[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_01,DetectionType.IDCapture,["id_capture_3_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x},IdCaptureParamsConfigurator,"Pipeline with test and barcode quality checks for AB tests: https://www.notion.so/FE-ML-Integrate-new-ID-processing-model-that-offers-text-and-barcode-readability-1124c3caef49800c9843f029288ad726"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.9,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x},IdCaptureParamsConfigurator,"Current Prod - Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Current Prod - Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with quality metrics for AB tests")];function getProfile(me){const ue=pipelineProfiles.find(Ue=>Ue.name===me);if(!ue)throw new Error(`Profile not found for type: ${me}`);return ue}var src$2={},StatsigClient$1={},src$1={},$_StatsigGlobal={},Log={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.Log=me.LogLevel=void 0;const ue=" DEBUG ",Ue=" INFO ",Ze=" WARN ",Qe=" ERROR ";function Ge(Xe){return Xe.unshift("[Statsig]"),Xe}me.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class Je{static info(...Ke){this.level>=me.LogLevel.Info&&console.info(Ue,...Ge(Ke))}static debug(...Ke){this.level>=me.LogLevel.Debug&&console.debug(ue,...Ge(Ke))}static warn(...Ke){this.level>=me.LogLevel.Warn&&console.warn(Ze,...Ge(Ke))}static error(...Ke){this.level>=me.LogLevel.Error&&console.error(Qe,...Ge(Ke))}}me.Log=Je,Je.level=me.LogLevel.Warn})(Log),function(me){var ue,Ue,Ze;Object.defineProperty(me,"__esModule",{value:!0}),me._getInstance=me._getStatsigGlobalFlag=me._getStatsigGlobal=void 0;const Qe=Log,Ge=()=>__STATSIG__||et;me._getStatsigGlobal=Ge;const Je=nt=>(0,me._getStatsigGlobal)()[nt];me._getStatsigGlobalFlag=Je;const Xe=nt=>{const it=(0,me._getStatsigGlobal)();return nt?it.instances&&it.instances[nt]:(it.instances&&Object.keys(it.instances).length>1&&Qe.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),it.firstInstance)};me._getInstance=Xe;const Ke="__STATSIG__",He=typeof window<"u"?window:{},$e=typeof commonjsGlobal<"u"?commonjsGlobal:{},tt=typeof globalThis<"u"?globalThis:{},et=(Ze=(Ue=(ue=He[Ke])!==null&&ue!==void 0?ue:$e[Ke])!==null&&Ue!==void 0?Ue:tt[Ke])!==null&&Ze!==void 0?Ze:{instance:me._getInstance};He[Ke]=et,$e[Ke]=et,tt[Ke]=et}($_StatsigGlobal);var Diagnostics={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.Diagnostics=void 0;const ue=new Map,Ue="start",Ze="end",Qe="statsig::diagnostics";me.Diagnostics={_getMarkers:He=>ue.get(He),_markInitOverallStart:He=>{Xe(He,Ge({},Ue,"overall"))},_markInitOverallEnd:(He,$e,tt)=>{Xe(He,Ge({success:$e,error:$e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:tt},Ze,"overall"))},_markInitNetworkReqStart:(He,$e)=>{Xe(He,Ge($e,Ue,"initialize","network_request"))},_markInitNetworkReqEnd:(He,$e)=>{Xe(He,Ge($e,Ze,"initialize","network_request"))},_markInitProcessStart:He=>{Xe(He,Ge({},Ue,"initialize","process"))},_markInitProcessEnd:(He,$e)=>{Xe(He,Ge($e,Ze,"initialize","process"))},_clearMarkers:He=>{ue.delete(He)},_formatError(He){if(He&&typeof He=="object")return{code:Ke(He,"code"),name:Ke(He,"name"),message:Ke(He,"message")}},_getDiagnosticsData(He,$e,tt,et){var nt;return{success:(He==null?void 0:He.ok)===!0,statusCode:He==null?void 0:He.status,sdkRegion:(nt=He==null?void 0:He.headers)===null||nt===void 0?void 0:nt.get("x-statsig-region"),isDelta:tt.includes('"is_delta":true')===!0?!0:void 0,attempt:$e,error:me.Diagnostics._formatError(et)}},_enqueueDiagnosticsEvent(He,$e,tt,et){const nt=me.Diagnostics._getMarkers(tt);if(nt==null||nt.length<=0)return;me.Diagnostics._clearMarkers(tt);const it=Je(He,{context:"initialize",markers:nt.slice(),statsigOptions:et});$e.enqueue(it)}};function Ge(He,$e,tt,et){return Object.assign({key:tt,action:$e,step:et,timestamp:Date.now()},He)}function Je(He,$e){return{eventName:Qe,user:He,value:null,metadata:$e,time:Date.now()}}function Xe(He,$e){var tt;const et=(tt=ue.get(He))!==null&&tt!==void 0?tt:[];et.push($e),ue.set(He,et)}function Ke(He,$e){if($e in He)return He[$e]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(me){return Array.isArray(me)?"array":typeof me}TypingUtils._typeOf=_typeOf;function _isTypeMatch(me,ue){const Ue=Ze=>Array.isArray(Ze)?"array":typeof Ze;return Ue(me)===Ue(ue)}TypingUtils._isTypeMatch=_isTypeMatch,function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._getSortedObject=me._DJB2Object=me._DJB2=void 0;const ue=TypingUtils,Ue=Ge=>{let Je=0;for(let Xe=0;Xe<Ge.length;Xe++){const Ke=Ge.charCodeAt(Xe);Je=(Je<<5)-Je+Ke,Je=Je&Je}return String(Je>>>0)};me._DJB2=Ue;const Ze=(Ge,Je)=>(0,me._DJB2)(JSON.stringify((0,me._getSortedObject)(Ge,Je)));me._DJB2Object=Ze;const Qe=(Ge,Je)=>{if(Ge==null)return null;const Xe=Object.keys(Ge).sort(),Ke={};return Xe.forEach(He=>{const $e=Ge[He];if(Je===0||(0,ue._typeOf)($e)!=="object"){Ke[He]=$e;return}Ke[He]=(0,me._getSortedObject)($e,Je!=null?Je-1:Je)}),Ke};me._getSortedObject=Qe}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$2=Hashing;function _getUserStorageKey(me,ue,Ue){var Ze;if(Ue)return Ue(me,ue);const Qe=ue&&ue.customIDs?ue.customIDs:{},Ge=[`uid:${(Ze=ue==null?void 0:ue.userID)!==null&&Ze!==void 0?Ze:""}`,`cids:${Object.keys(Qe).sort((Je,Xe)=>Je.localeCompare(Xe)).map(Je=>`${Je}-${Qe[Je]}`).join(",")}`,`k:${me}`];return(0,Hashing_1$2._DJB2)(Ge.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(me,ue,Ue){return ue?_getUserStorageKey(me,ue,Ue):(0,Hashing_1$2._DJB2)(`k:${me}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};Object.defineProperty(NetworkConfig,"__esModule",{value:!0}),NetworkConfig.NetworkParam=NetworkConfig.NetworkDefault=void 0,NetworkConfig.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},NetworkConfig.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"};var SafeJs={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._getCurrentPageUrlSafe=me._addDocumentEventListenerSafe=me._addWindowEventListenerSafe=me._isServerEnv=me._getDocumentSafe=me._getWindowSafe=void 0;const ue=()=>typeof window<"u"?window:null;me._getWindowSafe=ue;const Ue=()=>{var Xe;const Ke=(0,me._getWindowSafe)();return(Xe=Ke==null?void 0:Ke.document)!==null&&Xe!==void 0?Xe:null};me._getDocumentSafe=Ue;const Ze=()=>{if((0,me._getDocumentSafe)()!==null)return!1;const Xe=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||Xe};me._isServerEnv=Ze;const Qe=(Xe,Ke)=>{const He=(0,me._getWindowSafe)();typeof(He==null?void 0:He.addEventListener)=="function"&&He.addEventListener(Xe,Ke)};me._addWindowEventListenerSafe=Qe;const Ge=(Xe,Ke)=>{const He=(0,me._getDocumentSafe)();typeof(He==null?void 0:He.addEventListener)=="function"&&He.addEventListener(Xe,Ke)};me._addDocumentEventListenerSafe=Ge;const Je=()=>{var Xe;try{return(Xe=(0,me._getWindowSafe)())===null||Xe===void 0?void 0:Xe.location.href.split(/[?#]/)[0]}catch{return}};me._getCurrentPageUrlSafe=Je})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._createGateExposure=StatsigEvent._isExposureEvent=void 0;const CONFIG_EXPOSURE_NAME="statsig::config_exposure",GATE_EXPOSURE_NAME="statsig::gate_exposure",LAYER_EXPOSURE_NAME="statsig::layer_exposure",_createExposure=(me,ue,Ue,Ze,Qe)=>(Ue.bootstrapMetadata&&(Ze.bootstrapMetadata=Ue.bootstrapMetadata),{eventName:me,user:ue,value:null,metadata:_addEvaluationDetailsToMetadata(Ue,Ze),secondaryExposures:Qe,time:Date.now()}),_isExposureEvent=({eventName:me})=>me===GATE_EXPOSURE_NAME||me===CONFIG_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(me,ue)=>{var Ue,Ze;return _createExposure(GATE_EXPOSURE_NAME,me,ue.details,{gate:ue.name,gateValue:String(ue.value),ruleID:ue.ruleID},(Ze=(Ue=ue.__evaluation)===null||Ue===void 0?void 0:Ue.secondary_exposures)!==null&&Ze!==void 0?Ze:[])};StatsigEvent._createGateExposure=_createGateExposure;const _createConfigExposure=(me,ue)=>{var Ue,Ze;return _createExposure(CONFIG_EXPOSURE_NAME,me,ue.details,{config:ue.name,ruleID:ue.ruleID},(Ze=(Ue=ue.__evaluation)===null||Ue===void 0?void 0:Ue.secondary_exposures)!==null&&Ze!==void 0?Ze:[])};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(me,ue,Ue)=>{var Ze,Qe,Ge;const Je=ue.__evaluation,Xe=((Ze=Je==null?void 0:Je.explicit_parameters)===null||Ze===void 0?void 0:Ze.includes(Ue))===!0;let Ke="",He=(Qe=Je==null?void 0:Je.undelegated_secondary_exposures)!==null&&Qe!==void 0?Qe:[];return Xe&&(Ke=(Ge=Je.allocated_experiment_name)!==null&&Ge!==void 0?Ge:"",He=Je.secondary_exposures),_createExposure(LAYER_EXPOSURE_NAME,me,ue.details,{config:ue.name,parameterName:Ue,ruleID:ue.ruleID,allocatedExperiment:Ke,isExplicitParameter:String(Xe)},He)};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(me,ue)=>(ue.reason=me.reason,me.lcut&&(ue.lcut=String(me.lcut)),me.receivedAt&&(ue.receivedAt=String(me.receivedAt)),ue);var StorageProvider={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._setObjectInStorage=me._getObjectFromStorage=me.Storage=void 0;const ue=Log,Ue=SafeJs,Ze={},Qe={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:tt=>Ze[tt]?Ze[tt]:null,setItem:(tt,et)=>{Ze[tt]=et},removeItem:tt=>{delete Ze[tt]},getAllKeys:()=>Object.keys(Ze)};let Ge=null;try{const tt=(0,Ue._getWindowSafe)();tt&&tt.localStorage&&typeof tt.localStorage.getItem=="function"&&(Ge={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:et=>tt.localStorage.getItem(et),setItem:(et,nt)=>tt.localStorage.setItem(et,nt),removeItem:et=>tt.localStorage.removeItem(et),getAllKeys:()=>Object.keys(tt.localStorage)})}catch{ue.Log.warn("Failed to setup localStorageProvider.")}let Je=Ge??Qe,Xe=Je;function Ke(tt){try{return tt()}catch(et){if(et instanceof Error&&et.name==="SecurityError")return me.Storage._setProvider(Qe),null;throw et}}me.Storage={isReady:()=>Xe.isReady(),isReadyResolver:()=>Xe.isReadyResolver(),getProviderName:()=>Xe.getProviderName(),getItem:tt=>Ke(()=>Xe.getItem(tt)),setItem:(tt,et)=>Xe.setItem(tt,et),removeItem:tt=>Xe.removeItem(tt),getAllKeys:()=>Xe.getAllKeys(),_setProvider:tt=>{Je=tt,Xe=tt},_setDisabled:tt=>{tt?Xe=Qe:Xe=Je}};function He(tt){const et=me.Storage.getItem(tt);return JSON.parse(et??"null")}me._getObjectFromStorage=He;function $e(tt,et){me.Storage.setItem(tt,JSON.stringify(et))}me._setObjectInStorage=$e})(StorageProvider);var UrlOverrides={};Object.defineProperty(UrlOverrides,"__esModule",{value:!0}),UrlOverrides._getOverridableUrl=void 0;function _getOverridableUrl(me,ue,Ue,Ze){return me||(ue?`${ue}${Ue}`:`${Ze}${Ue}`)}UrlOverrides._getOverridableUrl=_getOverridableUrl;var VisibilityObserving={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._notifyVisibilityChanged=me._subscribeToVisiblityChanged=me._isUnloading=me._isCurrentlyVisible=void 0;const ue=SafeJs,Ue="foreground",Ze="background",Qe=[];let Ge=Ue,Je=!1;const Xe=()=>Ge===Ue;me._isCurrentlyVisible=Xe;const Ke=()=>Je;me._isUnloading=Ke;const He=tt=>{Qe.unshift(tt)};me._subscribeToVisiblityChanged=He;const $e=tt=>{tt!==Ge&&(Ge=tt,Qe.forEach(et=>et(tt)))};me._notifyVisibilityChanged=$e,(0,ue._addWindowEventListenerSafe)("focus",()=>{Je=!1,(0,me._notifyVisibilityChanged)(Ue)}),(0,ue._addWindowEventListenerSafe)("blur",()=>(0,me._notifyVisibilityChanged)(Ze)),(0,ue._addWindowEventListenerSafe)("beforeunload",()=>{Je=!0,(0,me._notifyVisibilityChanged)(Ze)}),(0,ue._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,me._notifyVisibilityChanged)(document.visibilityState==="visible"?Ue:Ze)})})(VisibilityObserving);var __awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$1=Hashing,Log_1$7=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$2=SafeJs,StatsigEvent_1=StatsigEvent,StorageProvider_1$3=StorageProvider,UrlOverrides_1=UrlOverrides,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=50,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e4,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(ue){var Ue;(Ue=EVENT_LOGGER_MAP[ue])===null||Ue===void 0||Ue.flush().catch(()=>{})}static _safeRetryFailedLogs(ue){var Ue;(Ue=EVENT_LOGGER_MAP[ue])===null||Ue===void 0||Ue._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(ue,Ue,Ze,Qe){var Ge;this._sdkKey=ue,this._emitter=Ue,this._network=Ze,this._options=Qe,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._isLoggingDisabled=(Qe==null?void 0:Qe.disableLogging)===!0,this._maxQueueSize=(Ge=Qe==null?void 0:Qe.loggingBufferMaxSize)!==null&&Ge!==void 0?Ge:DEFAULT_QUEUE_SIZE;const Je=Qe==null?void 0:Qe.networkConfig;this._logEventUrl=(0,UrlOverrides_1._getOverridableUrl)(Je==null?void 0:Je.logEventUrl,Je==null?void 0:Je.api,"/rgstr",NetworkConfig_1$1.NetworkDefault.eventsApi)}setLoggingDisabled(ue){this._isLoggingDisabled=ue}enqueue(ue){this._shouldLogEvent(ue)&&(this._normalizeAndAppendEvent(ue),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(ue){var Ue;const Ze=(Ue=this._nonExposedChecks[ue])!==null&&Ue!==void 0?Ue:0;this._nonExposedChecks[ue]=Ze+1}reset(){this._lastExposureTimeMap={}}start(){(0,SafeJs_1$2._isServerEnv)()||(EVENT_LOGGER_MAP[this._sdkKey]=this,(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(ue=>{ue==="background"?EventLogger._safeFlushAndForget(this._sdkKey):ue==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$d(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete EVENT_LOGGER_MAP[this._sdkKey],yield this.flush()})}flush(){return __awaiter$d(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const ue=this._queue;this._queue=[],yield this._sendEvents(ue)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(ue){if((0,SafeJs_1$2._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(ue))return!0;const Ue=ue.user?ue.user:{statsigEnvironment:void 0},Ze=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,Ue),Qe=ue.metadata?ue.metadata:{},Ge=[ue.eventName,Ze,Qe.gate,Qe.config,Qe.ruleID].join("|"),Je=this._lastExposureTimeMap[Ge],Xe=Date.now();return Je&&Xe-Je<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[Ge]=Xe,!0)}_sendEvents(ue){var Ue,Ze;return __awaiter$d(this,void 0,void 0,function*(){if(this._isLoggingDisabled)return this._saveFailedLogsToStorage(ue),!1;try{return((0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((Ze=(Ue=this._options)===null||Ue===void 0?void 0:Ue.networkConfig)===null||Ze===void 0?void 0:Ze.networkOverrideFunc)==null?yield this._sendEventsViaBeacon(ue):yield this._sendEventsViaPost(ue)).success?(this._emitter({name:"logs_flushed",events:ue}),!0):(Log_1$7.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(ue),!1)}catch{return Log_1$7.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(ue){var Ue;return __awaiter$d(this,void 0,void 0,function*(){const Ze=yield this._network.post(this._getRequestData(ue)),Qe=(Ue=Ze==null?void 0:Ze.code)!==null&&Ue!==void 0?Ue:-1;return{success:Qe>=200&&Qe<300}})}_sendEventsViaBeacon(ue){return __awaiter$d(this,void 0,void 0,function*(){return{success:yield this._network.beacon(this._getRequestData(ue))}})}_getRequestData(ue){return{sdkKey:this._sdkKey,data:{events:ue},url:this._logEventUrl,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(ue.length)}}}_saveFailedLogsToStorage(ue){for(;ue.length>MAX_FAILED_LOGS;)ue.shift();const Ue=this._getStorageKey();try{(0,StorageProvider_1$3._setObjectInStorage)(Ue,ue)}catch{Log_1$7.Log.warn("Unable to save failed logs to storage")}}_retryFailedLogs(ue){const Ue=this._getStorageKey();__awaiter$d(this,void 0,void 0,function*(){StorageProvider_1$3.Storage.isReady()||(yield StorageProvider_1$3.Storage.isReadyResolver());const Ze=(0,StorageProvider_1$3._getObjectFromStorage)(Ue);if(!Ze)return;ue===RetryFailedLogsTrigger.Startup&&StorageProvider_1$3.Storage.removeItem(Ue),(yield this._sendEvents(Ze))&&ue===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$3.Storage.removeItem(Ue)}).catch(()=>{Log_1$7.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$1._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(ue){ue.user&&(ue.user=Object.assign({},ue.user),delete ue.user.privateAttributes);const Ue={},Ze=this._getCurrentPageUrl();Ze&&(Ue.statsigMetadata={currentPage:Ze});const Qe=Object.assign(Object.assign({},ue),Ue);Log_1$7.Log.debug("Enqueued Event:",Qe),this._queue.push(Qe)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var ue;if(((ue=this._options)===null||ue===void 0?void 0:ue.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$2._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var ue,Ue;const Ze=(Ue=(ue=this._options)===null||ue===void 0?void 0:ue.loggingIntervalMs)!==null&&Ue!==void 0?Ue:DEFAULT_FLUSH_INTERVAL_MS,Qe=setInterval(()=>{EVENT_LOGGER_MAP[this._sdkKey]._flushIntervalId!==Qe?clearInterval(Qe):EventLogger._safeFlushAndForget(this._sdkKey)},Ze);this._flushIntervalId=Qe}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.StatsigMetadataProvider=me.SDK_VERSION=void 0,me.SDK_VERSION="3.4.0";let ue={sdkVersion:me.SDK_VERSION,sdkType:"js-mono"};me.StatsigMetadataProvider={get:()=>ue,add:Ue=>{ue=Object.assign(Object.assign({},ue),Ue)}}})(StatsigMetadata);var ClientInterfaces={};Object.defineProperty(ClientInterfaces,"__esModule",{value:!0});var DataAdapterCore$1={},StableID={},UUID={};Object.defineProperty(UUID,"__esModule",{value:!0}),UUID.getUUID=void 0;function getUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let me=new Date().getTime(),ue=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,Ze=>{let Qe=Math.random()*16;return me>0?(Qe=(me+Qe)%16|0,me=Math.floor(me/16)):(Qe=(ue+Qe)%16|0,ue=Math.floor(ue/16)),(Ze==="x"?Qe:Qe&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$6=Log,StorageProvider_1$2=StorageProvider,UUID_1=UUID,PROMISE_MAP={};StableID.StableID={get:me=>{if(PROMISE_MAP[me]==null){let ue=_loadFromStorage(me);ue==null&&(ue=(0,UUID_1.getUUID)(),_persistToStorage(ue,me)),PROMISE_MAP[me]=ue}return PROMISE_MAP[me]},setOverride:(me,ue)=>{PROMISE_MAP[ue]=me,_persistToStorage(me,ue)}};function _getStableIDStorageKey(me){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(me)}`}function _persistToStorage(me,ue){const Ue=_getStableIDStorageKey(ue);try{(0,StorageProvider_1$2._setObjectInStorage)(Ue,me)}catch{Log_1$6.Log.warn("Failed to save StableID")}}function _loadFromStorage(me){const ue=_getStableIDStorageKey(me);return(0,StorageProvider_1$2._getObjectFromStorage)(ue)}var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1=Hashing,Log_1$5=Log;function _normalizeUser(me,ue){try{const Ue=JSON.parse(JSON.stringify(me));return ue!=null&&ue.environment!=null&&(Ue.statsigEnvironment=ue.environment),Ue}catch{return Log_1$5.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(me){return me?(0,Hashing_1._DJB2Object)(me):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$4=Log;function _typedJsonParse(me,ue,Ue){try{const Ze=JSON.parse(me);return typeof Ze=="object"&&ue in Ze,Ze}catch{}return Log_1$4.Log.error(`Failed to parse ${Ue}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$3=Log,StableID_1$1=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$1=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10;class DataAdapterCore{constructor(ue,Ue){this._adapterName=ue,this._cacheSuffix=Ue,this._options=null,this._sdkKey=null,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ue}`,this._inMemoryCache=new InMemoryCache}attach(ue,Ue){this._sdkKey=ue,this._options=Ue}getDataSync(ue){const Ue=ue&&(0,StatsigUser_1._normalizeUser)(ue,this._options),Ze=this._getCacheKey(Ue),Qe=this._inMemoryCache.get(Ze,Ue);if(Qe)return Qe;const Ge=this._loadFromCache(Ze);return Ge?(this._inMemoryCache.add(Ze,Ge),this._inMemoryCache.get(Ze,Ue)):null}setData(ue,Ue){const Ze=Ue&&(0,StatsigUser_1._normalizeUser)(Ue,this._options),Qe=this._getCacheKey(Ze);this._inMemoryCache.add(Qe,_makeDataAdapterResult("Bootstrap",ue,null,Ze))}_getDataAsyncImpl(ue,Ue,Ze){return __awaiter$c(this,void 0,void 0,function*(){StorageProvider_1$1.Storage.isReady()||(yield StorageProvider_1$1.Storage.isReadyResolver());const Qe=ue??this.getDataSync(Ue),Ge=[this._fetchAndPrepFromNetwork(Qe,Ue,Ze)];return Ze!=null&&Ze.timeoutMs&&Ge.push(new Promise(Je=>setTimeout(Je,Ze.timeoutMs)).then(()=>(Log_1$3.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(Ge)})}_prefetchDataImpl(ue,Ue){return __awaiter$c(this,void 0,void 0,function*(){const Ze=ue&&(0,StatsigUser_1._normalizeUser)(ue,this._options),Qe=this._getCacheKey(Ze),Ge=yield this._getDataAsyncImpl(null,Ze,Ue);Ge&&this._inMemoryCache.add(Qe,Object.assign(Object.assign({},Ge),{source:"Prefetch"}))})}_fetchAndPrepFromNetwork(ue,Ue,Ze){return __awaiter$c(this,void 0,void 0,function*(){let Qe=null;ue&&this._isCachedResultValidFor204(ue,Ue)&&(Qe=ue.data);const Ge=yield this._fetchFromNetwork(Qe,Ue,Ze);if(!Ge)return Log_1$3.Log.debug("No response returned for latest value"),null;const Je=(0,TypedJsonParse_1._typedJsonParse)(Ge,"has_updates","Response"),Xe=this._getSdkKey(),Ke=StableID_1$1.StableID.get(Xe);let He=null;if((Je==null?void 0:Je.has_updates)===!0)He=_makeDataAdapterResult("Network",Ge,Ke,Ue);else if(Qe&&(Je==null?void 0:Je.has_updates)===!1)He=_makeDataAdapterResult("NetworkNotModified",Qe,Ke,Ue);else return null;const $e=this._getCacheKey(Ue);return this._inMemoryCache.add($e,He),this._writeToCache($e,He),He})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$3.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(ue){var Ue;const Ze=(Ue=StorageProvider_1$1.Storage.getItem)===null||Ue===void 0?void 0:Ue.call(StorageProvider_1$1.Storage,ue);if(Ze==null)return null;const Qe=(0,TypedJsonParse_1._typedJsonParse)(Ze,"source","Cached Result");return Qe?Object.assign(Object.assign({},Qe),{source:"Cache"}):null}_writeToCache(ue,Ue){StorageProvider_1$1.Storage.setItem(ue,JSON.stringify(Ue)),this._runLocalStorageCacheEviction(ue)}_runLocalStorageCacheEviction(ue){var Ue;const Ze=(Ue=(0,StorageProvider_1$1._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&Ue!==void 0?Ue:{};Ze[ue]=Date.now();const Qe=_getEvictableKey(Ze,CACHE_LIMIT);Qe&&(delete Ze[Qe],StorageProvider_1$1.Storage.removeItem(Qe)),(0,StorageProvider_1$1._setObjectInStorage)(this._lastModifiedStoreKey,Ze)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(me,ue,Ue,Ze){return{source:me,data:ue,receivedAt:Date.now(),stableID:Ue,fullUserHash:(0,StatsigUser_1._getFullUserHash)(Ze)}}class InMemoryCache{constructor(){this._data={}}get(ue,Ue){var Ze;const Qe=this._data[ue],Ge=Qe==null?void 0:Qe.stableID,Je=(Ze=Ue==null?void 0:Ue.customIDs)===null||Ze===void 0?void 0:Ze.stableID;return Je&&Ge&&Je!==Ge?(Log_1$3.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):Qe}add(ue,Ue){const Ze=_getEvictableKey(this._data,CACHE_LIMIT-1);Ze&&delete this._data[Ze],this._data[ue]=Ue}merge(ue){this._data=Object.assign(Object.assign({},this._data),ue)}}function _getEvictableKey(me,ue){const Ue=Object.keys(me);return Ue.length<=ue?null:Ue.reduce((Ze,Qe)=>{const Ge=me[Ze],Je=me[Qe];return typeof Ge=="object"&&typeof Je=="object"?Je.receivedAt<Ge.receivedAt?Qe:Ze:Je<Ge?Qe:Ze})}var DownloadConfigSpecsResponse={};Object.defineProperty(DownloadConfigSpecsResponse,"__esModule",{value:!0});var ErrorBoundary={},SDKType={};Object.defineProperty(SDKType,"__esModule",{value:!0}),SDKType.SDKType=void 0;const SDK_CLIENT={};let suffix;SDKType.SDKType={_get:me=>{var ue;return((ue=SDK_CLIENT[me])!==null&&ue!==void 0?ue:"js-mono")+(suffix??"")},_setClientType(me,ue){SDK_CLIENT[me]=ue},_setBindingType(me){(!suffix||suffix==="-react")&&(suffix="-"+me)}},function(me){var ue=commonjsGlobal&&commonjsGlobal.__awaiter||function(He,$e,tt,et){function nt(it){return it instanceof tt?it:new tt(function(at){at(it)})}return new(tt||(tt=Promise))(function(it,at){function st(lt){try{ot(et.next(lt))}catch(dt){at(dt)}}function rt(lt){try{ot(et.throw(lt))}catch(dt){at(dt)}}function ot(lt){lt.done?it(lt.value):nt(lt.value).then(st,rt)}ot((et=et.apply(He,$e||[])).next())})};Object.defineProperty(me,"__esModule",{value:!0}),me.ErrorBoundary=me.EXCEPTION_ENDPOINT=void 0;const Ue=Log,Ze=SDKType,Qe=StatsigMetadata;me.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const Ge="[Statsig] UnknownError";class Je{constructor($e,tt,et){this._sdkKey=$e,this._options=tt,this._emitter=et,this._seen=new Set}wrap($e){try{const tt=$e;Ke(tt).forEach(et=>{const nt=tt[et];"$EB"in nt||(tt[et]=(...it)=>this._capture(et,()=>nt.apply($e,it)),tt[et].$EB=!0)})}catch(tt){this._onError("eb:wrap",tt)}}logError($e,tt){this._onError($e,tt)}_capture($e,tt){try{const et=tt();return et&&et instanceof Promise?et.catch(nt=>this._onError($e,nt)):et}catch(et){return this._onError($e,et),null}}_onError($e,tt){try{Ue.Log.warn(`Caught error in ${$e}`,{error:tt}),ue(this,void 0,void 0,function*(){var nt,it,at,st,rt,ot,lt;const dt=tt||Error(Ge),ut=dt instanceof Error,Ut=ut?dt.name:"No Name";if(this._seen.has(Ut))return;if(this._seen.add(Ut),!((it=(nt=this._options)===null||nt===void 0?void 0:nt.networkConfig)===null||it===void 0)&&it.preventAllNetworkTraffic){(at=this._emitter)===null||at===void 0||at.call(this,{name:"error",error:tt,tag:$e});return}const ht=Ze.SDKType._get(this._sdkKey),pt=Qe.StatsigMetadataProvider.get(),Vt=ut?dt.stack:Xe(dt),Tt=JSON.stringify(Object.assign({tag:$e,exception:Ut,info:Vt},Object.assign(Object.assign({},pt),{sdkType:ht})));yield((ot=(rt=(st=this._options)===null||st===void 0?void 0:st.networkConfig)===null||rt===void 0?void 0:rt.networkOverrideFunc)!==null&&ot!==void 0?ot:fetch)(me.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(ht),"STATSIG-SDK-VERSION":String(pt.sdkVersion),"Content-Type":"application/json"},body:Tt}),(lt=this._emitter)===null||lt===void 0||lt.call(this,{name:"error",error:tt,tag:$e})}).then(()=>{}).catch(()=>{})}catch{}}}me.ErrorBoundary=Je;function Xe(He){try{return JSON.stringify(He)}catch{return Ge}}function Ke(He){const $e=new Set;let tt=Object.getPrototypeOf(He);for(;tt&&tt!==Object.prototype;)Object.getOwnPropertyNames(tt).filter(et=>typeof(tt==null?void 0:tt[et])=="function").forEach(et=>$e.add(et)),tt=Object.getPrototypeOf(tt);return Array.from($e)}}(ErrorBoundary);var EvaluationOptions={};Object.defineProperty(EvaluationOptions,"__esModule",{value:!0});var EvaluationTypes={};Object.defineProperty(EvaluationTypes,"__esModule",{value:!0});var InitializeResponse={};Object.defineProperty(InitializeResponse,"__esModule",{value:!0});var NetworkCore$1={},SessionID={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.StatsigSession=me.SessionID=void 0;const ue=CacheKey,Ue=Log,Ze=StorageProvider,Qe=UUID,Ge=30*60*1e3,Je=4*60*60*1e3,Xe={};me.SessionID={get:rt=>me.StatsigSession.get(rt).data.sessionID},me.StatsigSession={get:rt=>{Xe[rt]==null&&(Xe[rt]=Ke(rt));const ot=Xe[rt];return $e(ot)},overrideInitialSessionID:(rt,ot)=>{Xe[ot]=He(rt,ot)}};function Ke(rt){let ot=st(rt);const lt=Date.now();return ot||(ot={sessionID:(0,Qe.getUUID)(),startTime:lt,lastUpdate:lt}),{data:ot,sdkKey:rt}}function He(rt,ot){const lt=Date.now();return{data:{sessionID:rt,startTime:lt,lastUpdate:lt},sdkKey:ot}}function $e(rt){const ot=Date.now(),lt=rt.data;(et(lt)||nt(lt))&&(lt.sessionID=(0,Qe.getUUID)(),lt.startTime=ot),lt.lastUpdate=ot,at(lt,rt.sdkKey),clearTimeout(rt.idleTimeoutID),clearTimeout(rt.ageTimeoutID);const dt=ot-lt.startTime,ut=rt.sdkKey;return rt.idleTimeoutID=tt(ut,Ge),rt.ageTimeoutID=tt(ut,Je-dt),rt}function tt(rt,ot){return setTimeout(()=>{const lt=__STATSIG__==null?void 0:__STATSIG__.instance(rt);lt&<.$emt({name:"session_expired"})},ot)}function et({lastUpdate:rt}){return Date.now()-rt>Ge}function nt({startTime:rt}){return Date.now()-rt>Je}function it(rt){return`statsig.session_id.${(0,ue._getStorageKey)(rt)}`}function at(rt,ot){const lt=it(ot);try{(0,Ze._setObjectInStorage)(lt,rt)}catch{Ue.Log.warn("Failed to save SessionID")}}function st(rt){const ot=it(rt);return(0,Ze._getObjectFromStorage)(ot)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(NetworkCore$1,"__esModule",{value:!0}),NetworkCore$1.NetworkCore=void 0;const __StatsigGlobal_1$1=$_StatsigGlobal,Diagnostics_1=Diagnostics,Log_1$2=Log,NetworkConfig_1=NetworkConfig,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(ue,Ue){this._emitter=Ue,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},ue&&(this._options=ue),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs)}post(ue){return __awaiter$b(this,void 0,void 0,function*(){let Ue=yield this._getPopulatedBody(ue);return ue.isStatsigEncodable&&(Ue=this._attemptToEncodeString(ue,Ue)),this._sendRequest(Object.assign({method:"POST",body:Ue},ue))})}get(ue){return this._sendRequest(Object.assign({method:"GET"},ue))}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}beacon(ue){return __awaiter$b(this,void 0,void 0,function*(){if(!_ensureValidSdkKey(ue))return!1;const Ue=yield this._getPopulatedBody(ue),Ze=yield this._getPopulatedURL(ue),Qe=navigator;return Qe.sendBeacon.bind(Qe)(Ze,Ue)})}_sendRequest(ue){var Ue,Ze,Qe;return __awaiter$b(this,void 0,void 0,function*(){if(!_ensureValidSdkKey(ue)||this._netConfig.preventAllNetworkTraffic)return null;const{method:Ge,body:Je,retries:Xe,attempt:Ke}=ue,He=Ke??1,$e=typeof AbortController<"u"?new AbortController:null,tt=setTimeout(()=>$e==null?void 0:$e.abort(`Timeout of ${this._timeout}ms expired.`),this._timeout),et=yield this._getPopulatedURL(ue);let nt=null;const it=(0,VisibilityObserving_1._isUnloading)();try{const at={method:Ge,body:Je,headers:Object.assign({},ue.headers),signal:$e==null?void 0:$e.signal,priority:ue.priority,keepalive:it};if(ue.isInitialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(ue.sdkKey,{attempt:He}),nt=yield((Ue=this._netConfig.networkOverrideFunc)!==null&&Ue!==void 0?Ue:fetch)(et,at),clearTimeout(tt),!nt.ok){const ot=yield nt.text().catch(()=>"No Text"),lt=new Error(`NetworkError: ${et} ${ot}`);throw lt.name="NetworkError",lt}const rt=yield nt.text();return ue.isInitialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(ue.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(nt,He,rt)),{body:rt,code:nt.status}}catch(at){const st=_getErrorMessage($e,at);return ue.isInitialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(ue.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(nt,He,"",at)),!Xe||He>Xe||!RETRYABLE_CODES.has((Ze=nt==null?void 0:nt.status)!==null&&Ze!==void 0?Ze:500)?((Qe=this._emitter)===null||Qe===void 0||Qe.call(this,{name:"error",error:at,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:ue}),Log_1$2.Log.error(`A networking error occured during ${Ge} request to ${et}.`,st,at),null):this._sendRequest(Object.assign(Object.assign({},ue),{retries:Xe,attempt:He+1}))}})}_getPopulatedURL(ue){return __awaiter$b(this,void 0,void 0,function*(){const Ue=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:ue.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(ue.sdkKey),[NetworkConfig_1.NetworkParam.SdkVersion]:StatsigMetadata_1.SDK_VERSION,[NetworkConfig_1.NetworkParam.Time]:String(Date.now()),[NetworkConfig_1.NetworkParam.SessionID]:SessionID_1$1.SessionID.get(ue.sdkKey)},ue.params),Ze=Object.keys(Ue).map(Qe=>`${encodeURIComponent(Qe)}=${encodeURIComponent(Ue[Qe])}`).join("&");return`${ue.url}${Ze?`?${Ze}`:""}`})}_getPopulatedBody(ue){return __awaiter$b(this,void 0,void 0,function*(){const{data:Ue,sdkKey:Ze}=ue,Qe=StableID_1.StableID.get(Ze),Ge=SessionID_1$1.SessionID.get(Ze),Je=SDKType_1.SDKType._get(Ze);return JSON.stringify(Object.assign(Object.assign({},Ue),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:Qe,sessionID:Ge,sdkType:Je})}))})}_attemptToEncodeString(ue,Ue){var Ze,Qe;const Ge=(0,SafeJs_1$1._getWindowSafe)();if(!ue.isStatsigEncodable||this._options.disableStatsigEncoding||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(Ge!=null&&Ge.btoa))return Ue;try{const Je=(Ze=Ge.btoa(Ue).split("").reverse().join(""))!==null&&Ze!==void 0?Ze:Ue;return ue.params=Object.assign(Object.assign({},(Qe=ue.params)!==null&&Qe!==void 0?Qe:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"}),Je}catch{return Log_1$2.Log.warn("/initialize request encoding failed"),Ue}}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=me=>me.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1);function _getErrorMessage(me,ue){return me!=null&&me.signal.aborted&&typeof me.signal.reason=="string"?me.signal.reason:typeof ue=="string"?ue:ue instanceof Error?`${ue.name}: ${ue.message}`:"Unknown Error"}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(StatsigClientBase$1,"__esModule",{value:!0}),StatsigClientBase$1.StatsigClientBase=void 0;const __StatsigGlobal_1=$_StatsigGlobal,ErrorBoundary_1=ErrorBoundary,EventLogger_1=EventLogger$1,Log_1$1=Log,SafeJs_1=SafeJs,SessionID_1=SessionID,StorageProvider_1=StorageProvider;class StatsigClientBase{constructor(ue,Ue,Ze,Qe){var Ge;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const Je=this.$emt.bind(this);(Qe==null?void 0:Qe.logLevel)!=null&&(Log_1$1.Log.level=Qe.logLevel),Qe!=null&&Qe.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),Qe!=null&&Qe.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(Qe.initialSessionID,ue),Qe!=null&&Qe.storageProvider&&StorageProvider_1.Storage._setProvider(Qe.storageProvider),this._sdkKey=ue,this._options=Qe??{},this.overrideAdapter=(Ge=Qe==null?void 0:Qe.overrideAdapter)!==null&&Ge!==void 0?Ge:null,this._logger=new EventLogger_1.EventLogger(ue,Je,Ze,Qe),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(ue,Qe,Je),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ze),this._errorBoundary.wrap(Ue),this._errorBoundary.wrap(this._logger),this.dataAdapter=Ue,this.dataAdapter.attach(ue,Qe),this.storageProvider=StorageProvider_1.Storage,this._primeReadyRipcord(),_assignGlobalInstance(ue,this)}updateRuntimeOptions(ue){ue.disableLogging!=null&&(this._options.disableLogging=ue.disableLogging,this._logger.setLoggingDisabled(ue.disableLogging)),ue.disableStorage!=null&&(this._options.disableStorage=ue.disableStorage,StorageProvider_1.Storage._setDisabled(ue.disableStorage))}flush(){return this._logger.flush()}shutdown(){return __awaiter$a(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(ue,Ue){this._listeners[ue]||(this._listeners[ue]=[]),this._listeners[ue].push(Ue)}off(ue,Ue){if(this._listeners[ue]){const Ze=this._listeners[ue].indexOf(Ue);Ze!==-1&&this._listeners[ue].splice(Ze,1)}}$on(ue,Ue){Ue.__isInternal=!0,this.on(ue,Ue)}$emt(ue){var Ue;const Ze=Qe=>{try{Qe(ue)}catch(Ge){if(Qe.__isInternal===!0){this._errorBoundary.logError(`__emit:${ue.name}`,Ge);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",ue)}};this._listeners[ue.name]&&this._listeners[ue.name].forEach(Qe=>Ze(Qe)),(Ue=this._listeners["*"])===null||Ue===void 0||Ue.forEach(Ze)}_setStatus(ue,Ue){this.loadingStatus=ue,this.$emt({name:"values_updated",status:ue,values:Ue})}_enqueueExposure(ue,Ue,Ze){if((Ze==null?void 0:Ze.disableExposureLog)===!0){this._logger.incrementNonExposureCount(ue);return}this._logger.enqueue(Ue)}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(me,ue){var Ue;if((0,SafeJs_1._isServerEnv)())return;const Ze=(0,__StatsigGlobal_1._getStatsigGlobal)(),Qe=(Ue=Ze.instances)!==null&&Ue!==void 0?Ue:{},Ge=ue;Qe[me]!=null&&Log_1$1.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),Qe[me]=Ge,Ze.firstInstance||(Ze.firstInstance=Ge),Ze.instances=Qe,__STATSIG__=Ze}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0});var StatsigPlugin={};Object.defineProperty(StatsigPlugin,"__esModule",{value:!0});var StatsigTypeFactories={};Object.defineProperty(StatsigTypeFactories,"__esModule",{value:!0}),StatsigTypeFactories._makeTypedGet=StatsigTypeFactories._mergeOverride=StatsigTypeFactories._makeLayer=StatsigTypeFactories._makeExperiment=StatsigTypeFactories._makeDynamicConfig=StatsigTypeFactories._makeFeatureGate=void 0;const Log_1=Log,TypingUtils_1=TypingUtils,DEFAULT_RULE="default";function _makeEvaluation(me,ue,Ue,Ze){var Qe;return{name:me,details:ue,ruleID:(Qe=Ue==null?void 0:Ue.rule_id)!==null&&Qe!==void 0?Qe:DEFAULT_RULE,__evaluation:Ue,value:Ze}}function _makeFeatureGate(me,ue,Ue){return _makeEvaluation(me,ue,Ue,(Ue==null?void 0:Ue.value)===!0)}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(me,ue,Ue){var Ze;const Qe=(Ze=Ue==null?void 0:Ue.value)!==null&&Ze!==void 0?Ze:{};return Object.assign(Object.assign({},_makeEvaluation(me,ue,Ue,Qe)),{get:_makeTypedGet(me,Ue==null?void 0:Ue.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(me,ue,Ue){var Ze;const Qe=_makeDynamicConfig(me,ue,Ue);return Object.assign(Object.assign({},Qe),{groupName:(Ze=Ue==null?void 0:Ue.group_name)!==null&&Ze!==void 0?Ze:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(me,ue,Ue,Ze){var Qe,Ge;return Object.assign(Object.assign({},_makeEvaluation(me,ue,Ue,void 0)),{get:_makeTypedGet(me,Ue==null?void 0:Ue.value,Ze),groupName:(Qe=Ue==null?void 0:Ue.group_name)!==null&&Qe!==void 0?Qe:null,__value:(Ge=Ue==null?void 0:Ue.value)!==null&&Ge!==void 0?Ge:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(me,ue,Ue,Ze){return Object.assign(Object.assign(Object.assign({},me),ue),{get:_makeTypedGet(me.name,Ue,Ze)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(me,ue,Ue){return(Ze,Qe)=>{var Ge;const Je=(Ge=ue==null?void 0:ue[Ze])!==null&&Ge!==void 0?Ge:null;return Je==null?Qe??null:Qe!=null&&!(0,TypingUtils_1._isTypeMatch)(Je,Qe)?(Log_1.Log.warn(`Parameter type mismatch. '${me}.${Ze}' was found to be type '${typeof Je}' but fallback/return type is '${typeof Qe}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),Qe??null):(Ue==null||Ue(Ze),Je)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0}),function(me){var ue=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Ke,He,$e,tt){tt===void 0&&(tt=$e);var et=Object.getOwnPropertyDescriptor(He,$e);(!et||("get"in et?!He.__esModule:et.writable||et.configurable))&&(et={enumerable:!0,get:function(){return He[$e]}}),Object.defineProperty(Ke,tt,et)}:function(Ke,He,$e,tt){tt===void 0&&(tt=$e),Ke[tt]=He[$e]}),Ue=commonjsGlobal&&commonjsGlobal.__exportStar||function(Ke,He){for(var $e in Ke)$e!=="default"&&!Object.prototype.hasOwnProperty.call(He,$e)&&ue(He,Ke,$e)};Object.defineProperty(me,"__esModule",{value:!0}),me.Diagnostics=me.Log=me.Storage=me.EventLogger=void 0;const Ze=Diagnostics;Object.defineProperty(me,"Diagnostics",{enumerable:!0,get:function(){return Ze.Diagnostics}});const Qe=EventLogger$1;Object.defineProperty(me,"EventLogger",{enumerable:!0,get:function(){return Qe.EventLogger}});const Ge=Log;Object.defineProperty(me,"Log",{enumerable:!0,get:function(){return Ge.Log}});const Je=StatsigMetadata,Xe=StorageProvider;Object.defineProperty(me,"Storage",{enumerable:!0,get:function(){return Xe.Storage}}),Ue($_StatsigGlobal,me),Ue(CacheKey,me),Ue(ClientInterfaces,me),Ue(DataAdapterCore$1,me),Ue(Diagnostics,me),Ue(DownloadConfigSpecsResponse,me),Ue(ErrorBoundary,me),Ue(EvaluationOptions,me),Ue(EvaluationTypes,me),Ue(Hashing,me),Ue(InitializeResponse,me),Ue(Log,me),Ue(NetworkConfig,me),Ue(NetworkCore$1,me),Ue(OverrideAdapter,me),Ue(ParamStoreTypes,me),Ue(SafeJs,me),Ue(SDKType,me),Ue(SessionID,me),Ue(StableID,me),Ue(StatsigClientBase$1,me),Ue(StatsigClientEventEmitter,me),Ue(StatsigDataAdapter,me),Ue(StatsigEvent,me),Ue(StatsigMetadata,me),Ue(StatsigOptionsCommon,me),Ue(StatsigPlugin,me),Ue(StatsigTypeFactories,me),Ue(StatsigTypes,me),Ue(StatsigUser,me),Ue(StorageProvider,me),Ue(TypedJsonParse,me),Ue(TypingUtils,me),Ue(UrlOverrides,me),Ue(UUID,me),Ue(VisibilityObserving,me),__STATSIG__=Object.assign(Object.assign({},__STATSIG__!=null?__STATSIG__:{}),{Log:Ge.Log,SDK_VERSION:Je.SDK_VERSION})}(src$1);var EvaluationStore$1={};Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1;class EvaluationStore{constructor(ue){this._sdkKey=ue,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(ue,Ue){if(!ue)return!1;const Ze=(0,client_core_1$5._typedJsonParse)(ue.data,"has_updates","EvaluationResponse");return Ze==null?!1:(this._source=ue.source,(Ze==null?void 0:Ze.has_updates)!==!0||(this._rawValues=ue.data,this._lcut=Ze.time,this._receivedAt=ue.receivedAt,this._values=Ze,this._bootstrapMetadata=this._extractBootstrapMetadata(ue.source,Ze),ue.source&&Ze.user&&this._setWarningState(Ue,Ze)),!0)}getGate(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.feature_gates,ue)}getConfig(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.dynamic_configs,ue)}getLayer(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.layer_configs,ue)}getParamStore(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.param_stores,ue)}_extractBootstrapMetadata(ue,Ue){if(ue!=="Bootstrap")return null;const Ze={};return Ue.user&&(Ze.user=Ue.user),Ue.sdkInfo&&(Ze.generatorSDKInfo=Ue.sdkInfo),Ze.lcut=Ue.time,Ze}_getDetailedStoreResult(ue,Ue){let Ze=null;return ue&&(Ze=ue[Ue]?ue[Ue]:ue[(0,client_core_1$5._DJB2)(Ue)]),{result:Ze,details:this._getDetails(Ze==null)}}_setWarningState(ue,Ue){var Ze;const Qe=client_core_1$5.StableID.get(this._sdkKey);if(((Ze=ue.customIDs)===null||Ze===void 0?void 0:Ze.stableID)!==Qe){this._warnings.add("StableIDMismatch");return}if("user"in Ue){const Ge=Ue.user;(0,client_core_1$5._getFullUserHash)(ue)!==(0,client_core_1$5._getFullUserHash)(Ge)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const ue={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(ue.warnings=Array.from(this._warnings)),ue}_getDetails(ue){var Ue,Ze;const Qe=this.getCurrentSourceDetails();let Ge=Qe.reason;const Je=(Ue=Qe.warnings)!==null&&Ue!==void 0?Ue:[];this._source==="Bootstrap"&&Je.length>0&&(Ge=Ge+Je[0]),Ge!=="Uninitialized"&&Ge!=="NoValues"&&(Ge=`${Ge}:${ue?"Unrecognized":"Recognized"}`);const Xe=this._source==="Bootstrap"&&(Ze=this._bootstrapMetadata)!==null&&Ze!==void 0?Ze:void 0;return Xe&&(Qe.bootstrapMetadata=Xe),Object.assign(Object.assign({},Qe),{reason:Ge})}}EvaluationStore$1.default=EvaluationStore;var Network={},EvaluationResponseDeltas={};Object.defineProperty(EvaluationResponseDeltas,"__esModule",{value:!0}),EvaluationResponseDeltas._resolveDeltasResponse=void 0;const client_core_1$4=src$1,MAX_DELTAS_SORT_DEPTH=2;function _resolveDeltasResponse(me,ue){const Ue=(0,client_core_1$4._typedJsonParse)(ue,"checksum","DeltasEvaluationResponse");if(!Ue)return{hadBadDeltaChecksum:!0};const Ze=_mergeDeltasIntoCache(me,Ue),Qe=_handleDeletedEntries(Ze),Ge=(0,client_core_1$4._DJB2Object)({feature_gates:Qe.feature_gates,dynamic_configs:Qe.dynamic_configs,layer_configs:Qe.layer_configs},MAX_DELTAS_SORT_DEPTH);return Ge===Ue.checksumV2?JSON.stringify(Qe):{hadBadDeltaChecksum:!0,badChecksum:Ge,badMergedConfigs:Qe,badFullResponse:Ue.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(me,ue){return Object.assign(Object.assign(Object.assign({},me),ue),{feature_gates:Object.assign(Object.assign({},me.feature_gates),ue.feature_gates),layer_configs:Object.assign(Object.assign({},me.layer_configs),ue.layer_configs),dynamic_configs:Object.assign(Object.assign({},me.dynamic_configs),ue.dynamic_configs)})}function _handleDeletedEntries(me){const ue=me;return _deleteEntriesInRecord(me.deleted_gates,ue.feature_gates),delete ue.deleted_gates,_deleteEntriesInRecord(me.deleted_configs,ue.dynamic_configs),delete ue.deleted_configs,_deleteEntriesInRecord(me.deleted_layers,ue.layer_configs),delete ue.deleted_layers,ue}function _deleteEntriesInRecord(me,ue){me==null||me.forEach(Ue=>{delete ue[Ue]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(Network,"__esModule",{value:!0});const client_core_1$3=src$1,EvaluationResponseDeltas_1=EvaluationResponseDeltas;class StatsigNetwork extends client_core_1$3.NetworkCore{constructor(ue,Ue){super(ue,Ue);const Ze=ue==null?void 0:ue.networkConfig;this._initializeUrl=(0,client_core_1$3._getOverridableUrl)(Ze==null?void 0:Ze.initializeUrl,Ze==null?void 0:Ze.api,"/initialize",client_core_1$3.NetworkDefault.initializeApi)}fetchEvaluations(ue,Ue,Ze,Qe){return __awaiter$9(this,void 0,void 0,function*(){const Ge=Ue?(0,client_core_1$3._typedJsonParse)(Ue,"has_updates","InitializeResponse"):null;let Je={user:Qe,hash:"djb2",deltasResponseRequested:!1};return Ge!=null&&Ge.has_updates&&(Je=Object.assign(Object.assign({},Je),{sinceTime:Ge.time,previousDerivedFields:"derived_fields"in Ge?Ge.derived_fields:{},deltasResponseRequested:!0})),this._fetchEvaluations(ue,Ge,Je,Ze)})}_fetchEvaluations(ue,Ue,Ze,Qe){var Ge,Je;return __awaiter$9(this,void 0,void 0,function*(){const Xe=yield this.post({sdkKey:ue,url:this._initializeUrl,data:Ze,retries:2,isStatsigEncodable:!0,priority:Qe,isInitialize:!0});if((Xe==null?void 0:Xe.code)===204)return'{"has_updates": false}';if((Xe==null?void 0:Xe.code)!==200)return(Ge=Xe==null?void 0:Xe.body)!==null&&Ge!==void 0?Ge:null;if((Ue==null?void 0:Ue.has_updates)!==!0||((Je=Xe.body)===null||Je===void 0?void 0:Je.includes('"is_delta":true'))!==!0||Ze.deltasResponseRequested!==!0)return Xe.body;const Ke=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ue,Xe.body);return typeof Ke=="string"?Ke:this._fetchEvaluations(ue,Ue,Object.assign(Object.assign(Object.assign({},Ze),Ke),{deltasResponseRequested:!1}),Qe)})}}Network.default=StatsigNetwork;var ParamStoreGetterFactory={};Object.defineProperty(ParamStoreGetterFactory,"__esModule",{value:!0}),ParamStoreGetterFactory._makeParamStoreGetter=void 0;const client_core_1$2=src$1,NO_EXPOSURE_OPT={disableExposureLog:!0};function _shouldLogExposure(me){return me==null||me.disableExposureLog===!1}function _shouldReturnFallback(me,ue){return ue!=null&&!(0,client_core_1$2._isTypeMatch)(me,ue)}function _getMappedStaticValue(me,ue){return me.value}function _getMappedGateValue(me,ue,Ue){return me.getFeatureGate(ue.gate_name,_shouldLogExposure(Ue)?void 0:NO_EXPOSURE_OPT).value?ue.pass_value:ue.fail_value}function _getMappedDynamicConfigValue(me,ue,Ue,Ze){const Ge=me.getDynamicConfig(ue.config_name,NO_EXPOSURE_OPT).get(ue.param_name);return _shouldReturnFallback(Ge,Ue)?Ue:(_shouldLogExposure(Ze)&&me.getDynamicConfig(ue.config_name),Ge)}function _getMappedExperimentValue(me,ue,Ue,Ze){const Ge=me.getExperiment(ue.experiment_name,NO_EXPOSURE_OPT).get(ue.param_name);return _shouldReturnFallback(Ge,Ue)?Ue:(_shouldLogExposure(Ze)&&me.getExperiment(ue.experiment_name),Ge)}function _getMappedLayerValue(me,ue,Ue,Ze){const Ge=me.getLayer(ue.layer_name,NO_EXPOSURE_OPT).get(ue.param_name);return _shouldReturnFallback(Ge,Ue)?Ue:(_shouldLogExposure(Ze)&&me.getLayer(ue.layer_name).get(ue.param_name),Ge)}function _makeParamStoreGetter(me,ue,Ue){return(Ze,Qe)=>{if(ue==null)return Qe;const Ge=ue[Ze];if(Ge==null||Qe!=null&&(0,client_core_1$2._typeOf)(Qe)!==Ge.param_type)return Qe;switch(Ge.ref_type){case"static":return _getMappedStaticValue(Ge);case"gate":return _getMappedGateValue(me,Ge,Ue);case"dynamic_config":return _getMappedDynamicConfigValue(me,Ge,Qe,Ue);case"experiment":return _getMappedExperimentValue(me,Ge,Qe,Ue);case"layer":return _getMappedLayerValue(me,Ge,Qe,Ue);default:return Qe}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(StatsigEvaluationsDataAdapter$1,"__esModule",{value:!0}),StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=void 0;const client_core_1$1=src$1,Network_1$1=Network;class StatsigEvaluationsDataAdapter extends client_core_1$1.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(ue,Ue){super.attach(ue,Ue),this._network=new Network_1$1.default(Ue??{})}getDataAsync(ue,Ue,Ze){return this._getDataAsyncImpl(ue,(0,client_core_1$1._normalizeUser)(Ue,this._options),Ze)}prefetchData(ue,Ue){return this._prefetchDataImpl(ue,Ue)}setData(ue){const Ue=(0,client_core_1$1._typedJsonParse)(ue,"has_updates","data");Ue&&"user"in Ue?super.setData(ue,Ue.user):client_core_1$1.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(ue,Ue){super.setData(ue,Ue)}_fetchFromNetwork(ue,Ue,Ze){var Qe;return __awaiter$8(this,void 0,void 0,function*(){const Ge=yield(Qe=this._network)===null||Qe===void 0?void 0:Qe.fetchEvaluations(this._getSdkKey(),ue,Ze==null?void 0:Ze.priority,Ue);return Ge??null})}_getCacheKey(ue){var Ue;const Ze=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),ue,(Ue=this._options)===null||Ue===void 0?void 0:Ue.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${Ze}`}_isCachedResultValidFor204(ue,Ue){return ue.fullUserHash!=null&&ue.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ue)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(StatsigClient$1,"__esModule",{value:!0});const client_core_1=src$1,EvaluationStore_1=EvaluationStore$1,Network_1=Network,ParamStoreGetterFactory_1=ParamStoreGetterFactory,StatsigEvaluationsDataAdapter_1=StatsigEvaluationsDataAdapter$1;class StatsigClient extends client_core_1.StatsigClientBase{static instance(ue){const Ue=(0,client_core_1._getStatsigGlobal)().instance(ue);return Ue instanceof StatsigClient?Ue:(client_core_1.Log.warn((0,client_core_1._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new StatsigClient(ue??"",{}))}constructor(ue,Ue,Ze=null){var Qe,Ge;client_core_1.SDKType._setClientType(ue,"javascript-client");const Je=new Network_1.default(Ze,Ke=>{this.$emt(Ke)});super(ue,(Qe=Ze==null?void 0:Ze.dataAdapter)!==null&&Qe!==void 0?Qe:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,Je,Ze),this._store=new EvaluationStore_1.default(ue),this._user=(0,client_core_1._normalizeUser)(Ue,Ze);const Xe=(Ge=Ze==null?void 0:Ze.plugins)!==null&&Ge!==void 0?Ge:[];for(const Ke of Xe)Ke.bind(this)}initializeSync(ue){this.loadingStatus==="Uninitialized"&&(this._logger.start(),this.updateUserSync(this._user,ue))}initializeAsync(ue){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(ue),this._initializePromise)})}updateUserSync(ue,Ue){this._resetForUser(ue);const Ze=this.dataAdapter.getDataSync(this._user);this._store.setValues(Ze,this._user),this._finalizeUpdate(Ze);const Qe=Ue==null?void 0:Ue.disableBackgroundCacheRefresh;Qe===!0||Qe==null&&(Ze==null?void 0:Ze.source)==="Bootstrap"||this._runPostUpdate(Ze??null,this._user)}updateUserAsync(ue,Ue){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(ue);const Ze=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let Qe=this.dataAdapter.getDataSync(Ze);if(this._store.setValues(Qe,this._user),this._setStatus("Loading",Qe),Qe=yield this.dataAdapter.getDataAsync(Qe,Ze,Ue),Ze!==this._user)return;let Ge=!1;Qe!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),Ge=this._store.setValues(Qe,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:Ge})),this._finalizeUpdate(Qe),Ge||this.$emt({name:"initialization_failure"}),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,Ge,this._store.getCurrentSourceDetails()),client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options)})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:client_core_1.StatsigSession.get(this._sdkKey),stableID:client_core_1.StableID.get(this._sdkKey)}}checkGate(ue,Ue){return this.getFeatureGate(ue,Ue).value}getFeatureGate(ue,Ue){var Ze,Qe;const{result:Ge,details:Je}=this._store.getGate(ue),Xe=(0,client_core_1._makeFeatureGate)(ue,Je,Ge),Ke=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getGateOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Xe,this._user,Ue),He=Ke??Xe;return this._enqueueExposure(ue,(0,client_core_1._createGateExposure)(this._user,He),Ue),this.$emt({name:"gate_evaluation",gate:He}),He}getDynamicConfig(ue,Ue){var Ze,Qe;const{result:Ge,details:Je}=this._store.getConfig(ue),Xe=(0,client_core_1._makeDynamicConfig)(ue,Je,Ge),Ke=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getDynamicConfigOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Xe,this._user,Ue),He=Ke??Xe;return this._enqueueExposure(ue,(0,client_core_1._createConfigExposure)(this._user,He),Ue),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:He}),He}getExperiment(ue,Ue){var Ze,Qe;const{result:Ge,details:Je}=this._store.getConfig(ue),Xe=(0,client_core_1._makeExperiment)(ue,Je,Ge),Ke=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getExperimentOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Xe,this._user,Ue),He=Ke??Xe;return this._enqueueExposure(ue,(0,client_core_1._createConfigExposure)(this._user,He),Ue),this.$emt({name:"experiment_evaluation",experiment:He}),He}getLayer(ue,Ue){var Ze,Qe,Ge;const{result:Je,details:Xe}=this._store.getLayer(ue),Ke=(0,client_core_1._makeLayer)(ue,Xe,Je),He=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getLayerOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Ke,this._user,Ue),$e=(0,client_core_1._mergeOverride)(Ke,He,(Ge=He==null?void 0:He.__value)!==null&&Ge!==void 0?Ge:Ke.__value,tt=>{this._enqueueExposure(ue,(0,client_core_1._createLayerParameterExposure)(this._user,$e,tt),Ue)});return this.$emt({name:"layer_evaluation",layer:$e}),$e}getParameterStore(ue,Ue){const{result:Ze,details:Qe}=this._store.getParamStore(ue);return this._logger.incrementNonExposureCount(ue),{name:ue,details:Qe,__configuration:Ze,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,Ze,Ue)}}logEvent(ue,Ue,Ze){const Qe=typeof ue=="string"?{eventName:ue,value:Ue,metadata:Ze}:ue;this._logger.enqueue(Object.assign(Object.assign({},Qe),{user:this._user,time:Date.now()}))}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(ue){return __awaiter$7(this,void 0,void 0,function*(){return client_core_1.Storage.isReady()||(yield client_core_1.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,ue)})}_finalizeUpdate(ue){this._store.finalize(),this._setStatus("Ready",ue)}_runPostUpdate(ue,Ue){this.dataAdapter.getDataAsync(ue,Ue,{priority:"low"}).catch(Ze=>{client_core_1.Log.error("An error occurred after update.",Ze)})}_resetForUser(ue){var Ue;this._logger.reset(),this._store.reset(),this._user=(0,client_core_1._normalizeUser)(ue,this._options);const Ze=(Ue=this._user.customIDs)===null||Ue===void 0?void 0:Ue.stableID;Ze&&client_core_1.StableID.setOverride(Ze,this._sdkKey)}}StatsigClient$1.default=StatsigClient,function(me){var ue=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Qe,Ge,Je,Xe){Xe===void 0&&(Xe=Je);var Ke=Object.getOwnPropertyDescriptor(Ge,Je);(!Ke||("get"in Ke?!Ge.__esModule:Ke.writable||Ke.configurable))&&(Ke={enumerable:!0,get:function(){return Ge[Je]}}),Object.defineProperty(Qe,Xe,Ke)}:function(Qe,Ge,Je,Xe){Xe===void 0&&(Xe=Je),Qe[Xe]=Ge[Je]}),Ue=commonjsGlobal&&commonjsGlobal.__exportStar||function(Qe,Ge){for(var Je in Qe)Je!=="default"&&!Object.prototype.hasOwnProperty.call(Ge,Je)&&ue(Ge,Qe,Je)};Object.defineProperty(me,"__esModule",{value:!0}),me.StatsigClient=void 0;const Ze=StatsigClient$1;me.StatsigClient=Ze.default,Ue(src$1,me),__STATSIG__=Object.assign(Object.assign({},__STATSIG__!=null?__STATSIG__:{}),{StatsigClient:Ze.default}),me.default=__STATSIG__}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability"];function getStatsigEnvironment(me){return isStageK8sEnv(me)?{tier:"development"}:isStageEnv(me)||isDemoEnv(me)?{tier:"staging"}:isSaasEnv(me)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1},initializeStatsig=async({apiKey:me,apiURL:ue,interviewId:Ue})=>{const Ze={customIDs:{client_api_key:me,interviewId:Ue}},Qe=new src$2.StatsigClient(clientApiKey,Ze,{environment:getStatsigEnvironment(ue)});await Qe.initializeAsync(),FEATURE_FLAGS.forEach(Ge=>{featureFlagsValues[Ge]=Qe.checkGate(Ge)})},getFeatureFlag=me=>featureFlagsValues[me]??!1,getAllFeatureFlags=()=>featureFlagsValues,wasmVersion="v1.9.7";function generateBundle(me){const Ue=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_01:PipelineProfileName.IdCapture_2_01,Ze=me?Math.random()<.9?PipelineProfileName.SelfieWithAggregationMetrics:PipelineProfileName.SelfieWithQualityMetrics:PipelineProfileName.SelfieWithAggregationMetrics,Qe=PipelineProfileName.IdVideoSelfie_2_01;return[Ue,Qe,Ze]}function getInitializationParams(me){const Ue=generateBundle(me),Ze="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",Qe=`${Ze}/${wasmVersion}/webLib.wasm`,Ge=`${Ze}/${wasmVersion}/webLibSimd.wasm`,Je=`${Ze}/${wasmVersion}/webLib.js`,Xe=`${Ze}/${wasmVersion}/versions.json`;let Ke=new Map,He=new Map;for(const $e of Ue){const tt=getProfile($e);if(!tt)throw new Error(`Profile not found: ${$e}`);const et=tt.modelNames;let nt=[];for(const it of et)nt.push(`${Ze}/${wasmVersion}/models/${it}`);Ke.set(tt.pipelineType,nt),He.set(tt.detectionType,tt)}return{wasmModulePath:Qe,wasmSimdModulePath:Ge,glueCodePath:Je,versionsFilePath:Xe,pipelineModels:Ke,enableSIMD:!0,profiles:He,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.wasmApiHelpers=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.Module=null,this.loadModule=async ue=>{this.Module=(await import(ue)).Module}}async initialize(ue,Ue,Ze,Qe,Ge,Je){await this.freeResources(),this.pipelines_=Je,this.versionsFile=Ge,await this.loadModule(Ze);const Xe=await this.loadWasm(Qe,ue,Ue);return this.wasmApiHelpers=new this.wasmModule.MlWasmApiHelpers,this.idCaptureWasmApi=new this.wasmModule.IdCaptureWasmApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionWasmApi,this.isInitialized_=!0,Xe}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.wasmApiHelpers!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(ue,Ue){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(ue&&Ue&&ue==this.imageWidth_&&Ue==this.imageHeight_&&this.inputImageBuffer&&ue*Ue*4===this.inputImageBuffer.length)&&(this.imageWidth_=ue,this.imageHeight_=Ue,this.inputImageBuffer=this.wasmApiHelpers.allocateInputImageBuffer(ue,Ue,4))}async handleDetectionCallAndUpdateState(ue){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(ue))}async encryptImage(ue){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.wasmApiHelpers.encryptImage(ue)}isVirtualCamera(ue){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),ue)return this.wasmApiHelpers.isVirtualCamera(ue)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.wasmApiHelpers.estimatePerformance()}async analyzeFrame(ue){return this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(ue.width,ue.height),this.inputImageBuffer.set(ue.data),this.wasmApiHelpers.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.wasmApiHelpers&&typeof this.wasmApiHelpers.delete=="function"&&(this.wasmApiHelpers.delete(),this.wasmApiHelpers=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(ue){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.wasmApiHelpers.resetPipeline(this.pipelineTypeToWasmEnum(ue))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[ue,Ue]of this.pipelines_)this.resetPipeline(ue)}async process(ue,Ue){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(ue.data),Ue){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ue));case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.pipelineTypeToWasmEnum(Ue));default:throw new Error("Unknown pipeline type")}}async runIdCapture(ue){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(ue){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(ue,Ue,Ze,Qe,Ge){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge)}async setFaceDetectionThresholds(ue,Ue,Ze,Qe,Ge,Je,Xe){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe)}async setFaceAttributesThresholds(ue,Ue,Ze,Qe,Ge){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge)}async setFaceAttributesEnabled(ue,Ue,Ze,Qe,Ge){this.checkWasmInitialization("Unable to set face attributes enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesEnabled(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge)}async setFaceDetectionMode(ue,Ue){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(ue),Ue)}async setFaceDetectionCallbacks(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt,it,at,st,rt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt,it,at,st,rt)}async setIdCaptureThresholds(ue,Ue,Ze,Qe,Ge,Je,Xe){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe)}async setIdCaptureCallbacks(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt)}async setIdCaptureGeometryParams(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt)}async setIdCaptureConfigParams(ue,Ue,Ze,Qe,Ge,Je){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je)}setIdCaptureModelType(ue,Ue){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(ue),this.IdCaptureModelTypeToWasmEnum(Ue))}async getVersions(){const Ue=await(await fetch(this.versionsFile)).text();return JSON.parse(Ue)}async loadWasm(ue,Ue,Ze){const Qe=ue?Ze:Ue;try{window.wasmArrayBuffer=await fetch(Qe).then(Ge=>Ge.arrayBuffer()).then(Ge=>new Uint8Array(Ge)),this.wasmModule=await this.Module()}catch(Ge){if(console.log(Ge,ue,"useSmd"),ue)return await this.loadWasm(!1,Ue,Ze);throw Ge}return ue}async loadModels(){var Qe;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let ue=new this.wasmModule.PipelineTypeToIntMap,Ue=new Map,Ze=new Map;for(let[Ge,Je]of this.pipelines_){let Xe=this.pipelineTypeToWasmEnum(Ge),Ke=[],He=new this.wasmModule.VectorInt;for(let $e of Je){if(!Ze.has($e)){let et=await fetch($e).then(nt=>nt.arrayBuffer()).then(nt=>new Uint8Array(nt));Ze.set($e,et)}let tt=Ze.get($e);He.push_back(tt.byteLength),Ke.push(tt)}ue.set(Xe,He),Ue.set(Xe,Ke)}this.modelsBuffers=this.wasmApiHelpers.allocateModelsBuffers(ue);for(let[Ge,Je]of Ue){let Xe=(Qe=this.modelsBuffers)==null?void 0:Qe.get(Ge);for(let Ke=0;Ke<Xe.size();Ke++){let He=Xe==null?void 0:Xe.get(Ke);if(He)He.set(Je[Ke]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.wasmApiHelpers.initializePipelines()}async setProductionMode(ue){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.wasmApiHelpers.setProductionMode(ue)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.wasmApiHelpers.getCurrentPipeline())}pipelineTypeToWasmEnum(ue){switch(ue){case WasmPipelineType.IdBlurGlarePipeline:return this.wasmModule.PipelineType.IdBlurGlarePipeline;case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.wasmModule.PipelineType.IdBarcodeAndTextQualityPipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}pipelineTypeFromWasmEnum(ue){switch(ue){case this.wasmModule.PipelineType.IdBlurGlarePipeline:return WasmPipelineType.IdBlurGlarePipeline;case this.wasmModule.IdBarcodeAndTextQualityPipeline:return WasmPipelineType.IdBarcodeAndTextQualityPipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}IdCaptureModelTypeToWasmEnum(ue){switch(ue){case IdCaptureModelType.IdCaptureV1x:return this.wasmModule.IdCaptureModelType.IdCaptureV1x;case IdCaptureModelType.IdCaptureV2x:return this.wasmModule.IdCaptureModelType.IdCaptureV2x;case IdCaptureModelType.IdCaptureV3x:return this.wasmModule.IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}IdCaptureModelTypeFromWasmEnum(ue){switch(ue){case this.wasmModule.IdCaptureModelType.IdCaptureV1x:return IdCaptureModelType.IdCaptureV1x;case this.wasmModule.IdCaptureModelType.IdCaptureV2x:return IdCaptureModelType.IdCaptureV2x;case this.wasmModule.IdCaptureModelType.IdCaptureV3x:return IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}checkWasmInitialization(ue){if(!this.isInitialized())throw new Error(ue)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance();class MotionStatusCheck{constructor(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.waitForClick=()=>new Promise(nt=>{document.addEventListener("click",async()=>{const it=await this.requestMotionPermission();nt(it)},{once:!0})}),this.deviceMotionListener=nt=>{if(nt.accelerationIncludingGravity){const it={x:nt.accelerationIncludingGravity.x,y:nt.accelerationIncludingGravity.y,z:nt.accelerationIncludingGravity.z};this.checkFields(it)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,it))}if(nt.acceleration){const it={x:nt.acceleration.x,y:nt.acceleration.y,z:nt.acceleration.z};this.checkFields(it)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,it))}if(nt.rotationRate){const it={x:nt.rotationRate.alpha,y:nt.rotationRate.beta,z:nt.rotationRate.gamma};this.checkFields(it)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,it))}},this.deviceOrientationListener=nt=>{const it={x:nt.alpha,y:nt.beta,z:nt.gamma};this.checkFields(it)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,it))},this.accThreshold_=ue,this.gyroThreshold_=Ue,this.accGrOldThreshold_=Ze,this.accOldThreshold_=Qe,this.gyroscopeOldThreshold_=Ge,this.orientationOldThreshold_=Je,this.maeAccThreshold_=Xe,this.maeGyroThreshold_=Ke,this.maeAccGrOldThreshold_=He,this.maeAccOldThreshold_=$e,this.maeGyroscopeOldThreshold_=tt,this.maeOrientationOldThreshold_=et}async requestMotionPermission(){DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"&&DeviceMotionEvent.requestPermission().then(ue=>{ue!=="granted"&&(this.permission_=!1)}).catch(console.error)}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const ue={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(ue)&&this.updateParams(this.paramsAcc_,ue)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const ue={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(ue)&&this.updateParams(this.paramsGyro_,ue)}}check(){if(!this.permission_)return"UNCLEAR";const ue=this.checkStability();return ue===null?"UNCLEAR":ue?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const Ue=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(Xe=>Xe!==null),Ze=Ue.length>0?Ue.every(Xe=>Xe):null,Ge=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(Xe=>Xe!==null),Je=Ge.length>0?Ge.every(Xe=>Xe):null;return Ze===null?Je===null?null:Je:Je!==null?Ze&&Je:Ze}updateParams(ue,Ue){const Ze=Ue.x-ue.meanX,Qe=Ue.y-ue.meanY,Ge=Ue.z-ue.meanZ;ue.meanX+=Ze/ue.ptsNum,ue.meanY+=Qe/ue.ptsNum,ue.meanZ+=Ge/ue.ptsNum,ue.m2X+=Ze*(Ue.x-ue.meanX),ue.m2Y+=Qe*(Ue.y-ue.meanY),ue.m2Z+=Ge*(Ue.z-ue.meanZ),ue.cumulativeAbsErrorX+=Math.abs(Ue.x-ue.meanX),ue.cumulativeAbsErrorY+=Math.abs(Ue.y-ue.meanY),ue.cumulativeAbsErrorZ+=Math.abs(Ue.z-ue.meanZ)}calculateStd(ue){const Ue={x:ue.m2X/ue.ptsNum,y:ue.m2Y/ue.ptsNum,z:ue.m2Z/ue.ptsNum};return{x:Math.sqrt(Ue.x),y:Math.sqrt(Ue.y),z:Math.sqrt(Ue.z)}}calculateMae(ue){return{x:ue.cumulativeAbsErrorX/ue.ptsNum,y:ue.cumulativeAbsErrorY/ue.ptsNum,z:ue.cumulativeAbsErrorZ/ue.ptsNum}}checkFields(ue){return ue.x!==null&&ue.y!==null&&ue.z!==null}isBelowStdThreshold(ue,Ue){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ze=this.calculateStd(ue);return Ze.x<Ue&&Ze.y<Ue&&Ze.z<Ue}isBelowMaeThreshold(ue,Ue){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ze=this.calculateMae(ue);return Ze.x<Ue&&Ze.y<Ue&&Ze.z<Ue}}class OnboardingAnalytics{constructor(){this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.isVirtualCameraDetectedByLabel=!1,this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setSimdIsEnabled(ue){this.simdIsEnabled=ue}setWasmVersion(ue){this.wasmVersion=ue}setProfiles(ue){this.profiles=ue}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}async analyzeFrame(ue){const Ue=await base64ToImageData(ue);await MlWasmJSApi$1.analyzeFrame(Ue),this.updatePipelineStats()}async checkForVirtualCameraByLabel(ue=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!ue){const Ze=await getDeviceCapabilities();for(const Qe of Object.keys(Ze)){const Ge=Ze[Qe];if(MlWasmJSApi$1.isVirtualCamera(Ge==null?void 0:Ge.label)){const Je={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Je}}}const Ue=getChosenCameraInfo(ue);if(MlWasmJSApi$1.isVirtualCamera(Ue==null?void 0:Ue.label)){const Ze={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Ze}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(Ue){console.log(`Exception: ${Ue}`)}return null}async startOnboardingCheck(){this.motionStatusCheck.start()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}updatePipelineStats(){if(MlWasmJSApi$1.isInitialized())try{const ue=MlWasmJSApi$1.getPipelineState();if(ue!==""){const Ue=JSON.parse(ue);this.analysisStatus=Ue.statsAnalysisStatus,Ue.profiles=Array.from(this.profiles.values()).map(Ze=>PipelineProfileName[Ze.name]),Ue.estimatedPerformance=this.estimatedPerformance,Ue.simdIsEnabled=this.simdIsEnabled,Ue.wasmVersion=this.wasmVersion,this.pipelineLogs=Ue,this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check())}}catch(ue){console.error(`Exception: ${ue}`)}}}const OnboardingAnalytics$1=OnboardingAnalytics.getInstance();var define_import_meta_env_default={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"1.76.1-rc.20241128172746",PROD:!0,SSR:!1};class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(),this.setupDetectPromise)}getProfiles(){return this.profiles}getProfile(ue){var Ue;return((Ue=this.profiles)==null?void 0:Ue.get(ue))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(ue=>setTimeout(ue,100))}async _runSetupDetect(){var Qe,Ge;if(this.isSetupDetect)return;addEvent({token:(Qe=state.token)==null?void 0:Qe.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const ue=getInitializationParams(options.hostingApp==="Incode ID");this.profiles=ue.profiles,OnboardingAnalytics$1.setProfiles(this.profiles),OnboardingAnalytics$1.startOnboardingCheck();const Ue=await MlWasmJSApi$1.initialize(ue.wasmModulePath,ue.wasmSimdModulePath,ue.glueCodePath,ue.enableSIMD,ue.versionsFilePath,ue.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise(Je=>setTimeout(Je,100));OnboardingAnalytics$1.estimatePerformance(),OnboardingAnalytics$1.setWasmVersion(ue.wasmVersion),OnboardingAnalytics$1.setSimdIsEnabled(Ue),await MlWasmJSApi$1.initializePipelines();const Ze=define_import_meta_env_default.VITE_WASM_PRODUCTION_MODE==="true";try{await MlWasmJSApi$1.setProductionMode(Ze)}catch(Je){console.error(`Exception: ${Je}`)}this.isSetupDetect=!0,addEvent({token:(Ge=state.token)==null?void 0:Ge.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$a(me){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$a(me)}function _classCallCheck$m(me,ue){if(!(me instanceof ue))throw new TypeError("Cannot call a class as a function")}function toPrimitive(me,ue){if(_typeof$a(me)!="object"||!me)return me;var Ue=me[Symbol.toPrimitive];if(Ue!==void 0){var Ze=Ue.call(me,ue||"default");if(_typeof$a(Ze)!="object")return Ze;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ue==="string"?String:Number)(me)}function toPropertyKey(me){var ue=toPrimitive(me,"string");return _typeof$a(ue)=="symbol"?ue:String(ue)}function _defineProperties$9(me,ue){for(var Ue=0;Ue<ue.length;Ue++){var Ze=ue[Ue];Ze.enumerable=Ze.enumerable||!1,Ze.configurable=!0,"value"in Ze&&(Ze.writable=!0),Object.defineProperty(me,toPropertyKey(Ze.key),Ze)}}function _createClass$l(me,ue,Ue){return ue&&_defineProperties$9(me.prototype,ue),Ue&&_defineProperties$9(me,Ue),Object.defineProperty(me,"prototype",{writable:!1}),me}function _assertThisInitialized$1(me){if(me===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return me}function _setPrototypeOf$1(me,ue){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,Qe){return Ze.__proto__=Qe,Ze},_setPrototypeOf$1(me,ue)}function _inherits$c(me,ue){if(typeof ue!="function"&&ue!==null)throw new TypeError("Super expression must either be null or a function");me.prototype=Object.create(ue&&ue.prototype,{constructor:{value:me,writable:!0,configurable:!0}}),Object.defineProperty(me,"prototype",{writable:!1}),ue&&_setPrototypeOf$1(me,ue)}function _possibleConstructorReturn$c(me,ue){if(ue&&(_typeof$a(ue)==="object"||typeof ue=="function"))return ue;if(ue!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(me)}function _getPrototypeOf$1(me){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ue){return Ue.__proto__||Object.getPrototypeOf(Ue)},_getPrototypeOf$1(me)}function _defineProperty$6(me,ue,Ue){return ue=toPropertyKey(ue),ue in me?Object.defineProperty(me,ue,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):me[ue]=Ue,me}function _arrayWithHoles$3(me){if(Array.isArray(me))return me}function _iterableToArray(me){if(typeof Symbol<"u"&&me[Symbol.iterator]!=null||me["@@iterator"]!=null)return Array.from(me)}function _arrayLikeToArray$b(me,ue){(ue==null||ue>me.length)&&(ue=me.length);for(var Ue=0,Ze=new Array(ue);Ue<ue;Ue++)Ze[Ue]=me[Ue];return Ze}function _unsupportedIterableToArray$b(me,ue){if(me){if(typeof me=="string")return _arrayLikeToArray$b(me,ue);var Ue=Object.prototype.toString.call(me).slice(8,-1);if(Ue==="Object"&&me.constructor&&(Ue=me.constructor.name),Ue==="Map"||Ue==="Set")return Array.from(me);if(Ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ue))return _arrayLikeToArray$b(me,ue)}}function _nonIterableRest$3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
80
|
+
`,typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let me,ue;return{promise:new Promise((Ze,Qe)=>{me=Ze,ue=Qe}),resolve:me,reject:ue}});const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,E164_PHONE_NUMBER:/^\+?[1-9]\d{7,14}$/,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};exports.api=void 0;function setApi(me){exports.api=me}function setToken(me){exports.api.defaults.headers["X-Incode-Hardware-Id"]=me}const eventsQueue=[];function addEvent(me){const{token:ue,code:Ue,module:Ze,screen:Qe,clientTimestamp:Ge,payload:Je={}}=me;if(!ue){eventsQueue.push(me);return}return exports.api.post("/omni/interview-events",[{code:Ue,module:Ze,screen:Qe,clientTimestamp:Ge??new Date().getTime(),payload:Je}],{headers:{"X-Incode-Hardware-Id":ue}}).catch(()=>{})}function emptyQueue(me){eventsQueue.forEach(ue=>{addEvent({...ue,token:me})})}const state={token:null};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu"};const setOptions=me=>(options={...options,...me},options);var PipelineProfileName=(me=>(me[me.IdCapture_2_01=0]="IdCapture_2_01",me[me.IdCapture_3_01=1]="IdCapture_3_01",me[me.IdVideoSelfie_2_01=2]="IdVideoSelfie_2_01",me[me.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",me))(PipelineProfileName||{});class PipelineProfile{constructor(ue,Ue,Ze,Qe,Ge,Je=null,Xe=""){this.pipelineType=ue,this.name=Ue,this.detectionType=Ze,this.modelNames=Qe,this.parameters=Ge,this.paramsConfigurator=Je,this.description=Xe}reconfigureParams(ue=null){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,ue)}}var DetectionType=(me=>(me[me.IDCapture=0]="IDCapture",me[me.Selfie=1]="Selfie",me[me.IdVideoSelfie=2]="IdVideoSelfie",me))(DetectionType||{}),WasmPipelineType=(me=>(me[me.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",me[me.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",me[me.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",me[me.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",me[me.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",me))(WasmPipelineType||{}),IdCaptureModelType=(me=>(me[me.IdCaptureV1x=0]="IdCaptureV1x",me[me.IdCaptureV2x=1]="IdCaptureV2x",me[me.IdCaptureV3x=2]="IdCaptureV3x",me))(IdCaptureModelType||{});function IdCaptureParamsConfigurator(me,ue,Ue){Object.assign(me,{areaDown:Ue?55e3:25e3,areaUp:Ue?75e3:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:ue==WasmPipelineType.IdBlurGlarePipeline||WasmPipelineType.IdBarcodeAndTextQualityPipeline?125:180,widthIOSDown:ue==WasmPipelineType.IdBlurGlarePipeline||WasmPipelineType.IdBarcodeAndTextQualityPipeline?85:150,widthDown:Ue?185:135,widthUp:Ue?255:205})}const SelfieFaceDetectionPipelineParams={frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.95,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.5,minFaceQualityScore:.65},pipelineProfiles=[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_01,DetectionType.IDCapture,["id_capture_3_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x},IdCaptureParamsConfigurator,"Pipeline with test and barcode quality checks for AB tests: https://www.notion.so/FE-ML-Integrate-new-ID-processing-model-that-offers-text-and-barcode-readability-1124c3caef49800c9843f029288ad726"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.9,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x},IdCaptureParamsConfigurator,"Current Prod - Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Current Prod - Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with quality metrics for AB tests")];function getProfile(me){const ue=pipelineProfiles.find(Ue=>Ue.name===me);if(!ue)throw new Error(`Profile not found for type: ${me}`);return ue}var src$2={},StatsigClient$1={},src$1={},$_StatsigGlobal={},Log={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.Log=me.LogLevel=void 0;const ue=" DEBUG ",Ue=" INFO ",Ze=" WARN ",Qe=" ERROR ";function Ge(Xe){return Xe.unshift("[Statsig]"),Xe}me.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class Je{static info(...Ke){this.level>=me.LogLevel.Info&&console.info(Ue,...Ge(Ke))}static debug(...Ke){this.level>=me.LogLevel.Debug&&console.debug(ue,...Ge(Ke))}static warn(...Ke){this.level>=me.LogLevel.Warn&&console.warn(Ze,...Ge(Ke))}static error(...Ke){this.level>=me.LogLevel.Error&&console.error(Qe,...Ge(Ke))}}me.Log=Je,Je.level=me.LogLevel.Warn})(Log),function(me){var ue,Ue,Ze;Object.defineProperty(me,"__esModule",{value:!0}),me._getInstance=me._getStatsigGlobalFlag=me._getStatsigGlobal=void 0;const Qe=Log,Ge=()=>__STATSIG__||et;me._getStatsigGlobal=Ge;const Je=nt=>(0,me._getStatsigGlobal)()[nt];me._getStatsigGlobalFlag=Je;const Xe=nt=>{const it=(0,me._getStatsigGlobal)();return nt?it.instances&&it.instances[nt]:(it.instances&&Object.keys(it.instances).length>1&&Qe.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),it.firstInstance)};me._getInstance=Xe;const Ke="__STATSIG__",He=typeof window<"u"?window:{},$e=typeof commonjsGlobal<"u"?commonjsGlobal:{},tt=typeof globalThis<"u"?globalThis:{},et=(Ze=(Ue=(ue=He[Ke])!==null&&ue!==void 0?ue:$e[Ke])!==null&&Ue!==void 0?Ue:tt[Ke])!==null&&Ze!==void 0?Ze:{instance:me._getInstance};He[Ke]=et,$e[Ke]=et,tt[Ke]=et}($_StatsigGlobal);var Diagnostics={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.Diagnostics=void 0;const ue=new Map,Ue="start",Ze="end",Qe="statsig::diagnostics";me.Diagnostics={_getMarkers:He=>ue.get(He),_markInitOverallStart:He=>{Xe(He,Ge({},Ue,"overall"))},_markInitOverallEnd:(He,$e,tt)=>{Xe(He,Ge({success:$e,error:$e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:tt},Ze,"overall"))},_markInitNetworkReqStart:(He,$e)=>{Xe(He,Ge($e,Ue,"initialize","network_request"))},_markInitNetworkReqEnd:(He,$e)=>{Xe(He,Ge($e,Ze,"initialize","network_request"))},_markInitProcessStart:He=>{Xe(He,Ge({},Ue,"initialize","process"))},_markInitProcessEnd:(He,$e)=>{Xe(He,Ge($e,Ze,"initialize","process"))},_clearMarkers:He=>{ue.delete(He)},_formatError(He){if(He&&typeof He=="object")return{code:Ke(He,"code"),name:Ke(He,"name"),message:Ke(He,"message")}},_getDiagnosticsData(He,$e,tt,et){var nt;return{success:(He==null?void 0:He.ok)===!0,statusCode:He==null?void 0:He.status,sdkRegion:(nt=He==null?void 0:He.headers)===null||nt===void 0?void 0:nt.get("x-statsig-region"),isDelta:tt.includes('"is_delta":true')===!0?!0:void 0,attempt:$e,error:me.Diagnostics._formatError(et)}},_enqueueDiagnosticsEvent(He,$e,tt,et){const nt=me.Diagnostics._getMarkers(tt);if(nt==null||nt.length<=0)return;me.Diagnostics._clearMarkers(tt);const it=Je(He,{context:"initialize",markers:nt.slice(),statsigOptions:et});$e.enqueue(it)}};function Ge(He,$e,tt,et){return Object.assign({key:tt,action:$e,step:et,timestamp:Date.now()},He)}function Je(He,$e){return{eventName:Qe,user:He,value:null,metadata:$e,time:Date.now()}}function Xe(He,$e){var tt;const et=(tt=ue.get(He))!==null&&tt!==void 0?tt:[];et.push($e),ue.set(He,et)}function Ke(He,$e){if($e in He)return He[$e]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(me){return Array.isArray(me)?"array":typeof me}TypingUtils._typeOf=_typeOf;function _isTypeMatch(me,ue){const Ue=Ze=>Array.isArray(Ze)?"array":typeof Ze;return Ue(me)===Ue(ue)}TypingUtils._isTypeMatch=_isTypeMatch,function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._getSortedObject=me._DJB2Object=me._DJB2=void 0;const ue=TypingUtils,Ue=Ge=>{let Je=0;for(let Xe=0;Xe<Ge.length;Xe++){const Ke=Ge.charCodeAt(Xe);Je=(Je<<5)-Je+Ke,Je=Je&Je}return String(Je>>>0)};me._DJB2=Ue;const Ze=(Ge,Je)=>(0,me._DJB2)(JSON.stringify((0,me._getSortedObject)(Ge,Je)));me._DJB2Object=Ze;const Qe=(Ge,Je)=>{if(Ge==null)return null;const Xe=Object.keys(Ge).sort(),Ke={};return Xe.forEach(He=>{const $e=Ge[He];if(Je===0||(0,ue._typeOf)($e)!=="object"){Ke[He]=$e;return}Ke[He]=(0,me._getSortedObject)($e,Je!=null?Je-1:Je)}),Ke};me._getSortedObject=Qe}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$2=Hashing;function _getUserStorageKey(me,ue,Ue){var Ze;if(Ue)return Ue(me,ue);const Qe=ue&&ue.customIDs?ue.customIDs:{},Ge=[`uid:${(Ze=ue==null?void 0:ue.userID)!==null&&Ze!==void 0?Ze:""}`,`cids:${Object.keys(Qe).sort((Je,Xe)=>Je.localeCompare(Xe)).map(Je=>`${Je}-${Qe[Je]}`).join(",")}`,`k:${me}`];return(0,Hashing_1$2._DJB2)(Ge.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(me,ue,Ue){return ue?_getUserStorageKey(me,ue,Ue):(0,Hashing_1$2._DJB2)(`k:${me}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};Object.defineProperty(NetworkConfig,"__esModule",{value:!0}),NetworkConfig.NetworkParam=NetworkConfig.NetworkDefault=void 0,NetworkConfig.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},NetworkConfig.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"};var SafeJs={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._getCurrentPageUrlSafe=me._addDocumentEventListenerSafe=me._addWindowEventListenerSafe=me._isServerEnv=me._getDocumentSafe=me._getWindowSafe=void 0;const ue=()=>typeof window<"u"?window:null;me._getWindowSafe=ue;const Ue=()=>{var Xe;const Ke=(0,me._getWindowSafe)();return(Xe=Ke==null?void 0:Ke.document)!==null&&Xe!==void 0?Xe:null};me._getDocumentSafe=Ue;const Ze=()=>{if((0,me._getDocumentSafe)()!==null)return!1;const Xe=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||Xe};me._isServerEnv=Ze;const Qe=(Xe,Ke)=>{const He=(0,me._getWindowSafe)();typeof(He==null?void 0:He.addEventListener)=="function"&&He.addEventListener(Xe,Ke)};me._addWindowEventListenerSafe=Qe;const Ge=(Xe,Ke)=>{const He=(0,me._getDocumentSafe)();typeof(He==null?void 0:He.addEventListener)=="function"&&He.addEventListener(Xe,Ke)};me._addDocumentEventListenerSafe=Ge;const Je=()=>{var Xe;try{return(Xe=(0,me._getWindowSafe)())===null||Xe===void 0?void 0:Xe.location.href.split(/[?#]/)[0]}catch{return}};me._getCurrentPageUrlSafe=Je})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._createGateExposure=StatsigEvent._isExposureEvent=void 0;const CONFIG_EXPOSURE_NAME="statsig::config_exposure",GATE_EXPOSURE_NAME="statsig::gate_exposure",LAYER_EXPOSURE_NAME="statsig::layer_exposure",_createExposure=(me,ue,Ue,Ze,Qe)=>(Ue.bootstrapMetadata&&(Ze.bootstrapMetadata=Ue.bootstrapMetadata),{eventName:me,user:ue,value:null,metadata:_addEvaluationDetailsToMetadata(Ue,Ze),secondaryExposures:Qe,time:Date.now()}),_isExposureEvent=({eventName:me})=>me===GATE_EXPOSURE_NAME||me===CONFIG_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(me,ue)=>{var Ue,Ze;return _createExposure(GATE_EXPOSURE_NAME,me,ue.details,{gate:ue.name,gateValue:String(ue.value),ruleID:ue.ruleID},(Ze=(Ue=ue.__evaluation)===null||Ue===void 0?void 0:Ue.secondary_exposures)!==null&&Ze!==void 0?Ze:[])};StatsigEvent._createGateExposure=_createGateExposure;const _createConfigExposure=(me,ue)=>{var Ue,Ze;return _createExposure(CONFIG_EXPOSURE_NAME,me,ue.details,{config:ue.name,ruleID:ue.ruleID},(Ze=(Ue=ue.__evaluation)===null||Ue===void 0?void 0:Ue.secondary_exposures)!==null&&Ze!==void 0?Ze:[])};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(me,ue,Ue)=>{var Ze,Qe,Ge;const Je=ue.__evaluation,Xe=((Ze=Je==null?void 0:Je.explicit_parameters)===null||Ze===void 0?void 0:Ze.includes(Ue))===!0;let Ke="",He=(Qe=Je==null?void 0:Je.undelegated_secondary_exposures)!==null&&Qe!==void 0?Qe:[];return Xe&&(Ke=(Ge=Je.allocated_experiment_name)!==null&&Ge!==void 0?Ge:"",He=Je.secondary_exposures),_createExposure(LAYER_EXPOSURE_NAME,me,ue.details,{config:ue.name,parameterName:Ue,ruleID:ue.ruleID,allocatedExperiment:Ke,isExplicitParameter:String(Xe)},He)};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(me,ue)=>(ue.reason=me.reason,me.lcut&&(ue.lcut=String(me.lcut)),me.receivedAt&&(ue.receivedAt=String(me.receivedAt)),ue);var StorageProvider={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._setObjectInStorage=me._getObjectFromStorage=me.Storage=void 0;const ue=Log,Ue=SafeJs,Ze={},Qe={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:tt=>Ze[tt]?Ze[tt]:null,setItem:(tt,et)=>{Ze[tt]=et},removeItem:tt=>{delete Ze[tt]},getAllKeys:()=>Object.keys(Ze)};let Ge=null;try{const tt=(0,Ue._getWindowSafe)();tt&&tt.localStorage&&typeof tt.localStorage.getItem=="function"&&(Ge={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:et=>tt.localStorage.getItem(et),setItem:(et,nt)=>tt.localStorage.setItem(et,nt),removeItem:et=>tt.localStorage.removeItem(et),getAllKeys:()=>Object.keys(tt.localStorage)})}catch{ue.Log.warn("Failed to setup localStorageProvider.")}let Je=Ge??Qe,Xe=Je;function Ke(tt){try{return tt()}catch(et){if(et instanceof Error&&et.name==="SecurityError")return me.Storage._setProvider(Qe),null;throw et}}me.Storage={isReady:()=>Xe.isReady(),isReadyResolver:()=>Xe.isReadyResolver(),getProviderName:()=>Xe.getProviderName(),getItem:tt=>Ke(()=>Xe.getItem(tt)),setItem:(tt,et)=>Xe.setItem(tt,et),removeItem:tt=>Xe.removeItem(tt),getAllKeys:()=>Xe.getAllKeys(),_setProvider:tt=>{Je=tt,Xe=tt},_setDisabled:tt=>{tt?Xe=Qe:Xe=Je}};function He(tt){const et=me.Storage.getItem(tt);return JSON.parse(et??"null")}me._getObjectFromStorage=He;function $e(tt,et){me.Storage.setItem(tt,JSON.stringify(et))}me._setObjectInStorage=$e})(StorageProvider);var UrlOverrides={};Object.defineProperty(UrlOverrides,"__esModule",{value:!0}),UrlOverrides._getOverridableUrl=void 0;function _getOverridableUrl(me,ue,Ue,Ze){return me||(ue?`${ue}${Ue}`:`${Ze}${Ue}`)}UrlOverrides._getOverridableUrl=_getOverridableUrl;var VisibilityObserving={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me._notifyVisibilityChanged=me._subscribeToVisiblityChanged=me._isUnloading=me._isCurrentlyVisible=void 0;const ue=SafeJs,Ue="foreground",Ze="background",Qe=[];let Ge=Ue,Je=!1;const Xe=()=>Ge===Ue;me._isCurrentlyVisible=Xe;const Ke=()=>Je;me._isUnloading=Ke;const He=tt=>{Qe.unshift(tt)};me._subscribeToVisiblityChanged=He;const $e=tt=>{tt!==Ge&&(Ge=tt,Qe.forEach(et=>et(tt)))};me._notifyVisibilityChanged=$e,(0,ue._addWindowEventListenerSafe)("focus",()=>{Je=!1,(0,me._notifyVisibilityChanged)(Ue)}),(0,ue._addWindowEventListenerSafe)("blur",()=>(0,me._notifyVisibilityChanged)(Ze)),(0,ue._addWindowEventListenerSafe)("beforeunload",()=>{Je=!0,(0,me._notifyVisibilityChanged)(Ze)}),(0,ue._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,me._notifyVisibilityChanged)(document.visibilityState==="visible"?Ue:Ze)})})(VisibilityObserving);var __awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$1=Hashing,Log_1$7=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$2=SafeJs,StatsigEvent_1=StatsigEvent,StorageProvider_1$3=StorageProvider,UrlOverrides_1=UrlOverrides,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=50,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e4,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(ue){var Ue;(Ue=EVENT_LOGGER_MAP[ue])===null||Ue===void 0||Ue.flush().catch(()=>{})}static _safeRetryFailedLogs(ue){var Ue;(Ue=EVENT_LOGGER_MAP[ue])===null||Ue===void 0||Ue._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(ue,Ue,Ze,Qe){var Ge;this._sdkKey=ue,this._emitter=Ue,this._network=Ze,this._options=Qe,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._isLoggingDisabled=(Qe==null?void 0:Qe.disableLogging)===!0,this._maxQueueSize=(Ge=Qe==null?void 0:Qe.loggingBufferMaxSize)!==null&&Ge!==void 0?Ge:DEFAULT_QUEUE_SIZE;const Je=Qe==null?void 0:Qe.networkConfig;this._logEventUrl=(0,UrlOverrides_1._getOverridableUrl)(Je==null?void 0:Je.logEventUrl,Je==null?void 0:Je.api,"/rgstr",NetworkConfig_1$1.NetworkDefault.eventsApi)}setLoggingDisabled(ue){this._isLoggingDisabled=ue}enqueue(ue){this._shouldLogEvent(ue)&&(this._normalizeAndAppendEvent(ue),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(ue){var Ue;const Ze=(Ue=this._nonExposedChecks[ue])!==null&&Ue!==void 0?Ue:0;this._nonExposedChecks[ue]=Ze+1}reset(){this._lastExposureTimeMap={}}start(){(0,SafeJs_1$2._isServerEnv)()||(EVENT_LOGGER_MAP[this._sdkKey]=this,(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(ue=>{ue==="background"?EventLogger._safeFlushAndForget(this._sdkKey):ue==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$d(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete EVENT_LOGGER_MAP[this._sdkKey],yield this.flush()})}flush(){return __awaiter$d(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const ue=this._queue;this._queue=[],yield this._sendEvents(ue)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(ue){if((0,SafeJs_1$2._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(ue))return!0;const Ue=ue.user?ue.user:{statsigEnvironment:void 0},Ze=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,Ue),Qe=ue.metadata?ue.metadata:{},Ge=[ue.eventName,Ze,Qe.gate,Qe.config,Qe.ruleID].join("|"),Je=this._lastExposureTimeMap[Ge],Xe=Date.now();return Je&&Xe-Je<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[Ge]=Xe,!0)}_sendEvents(ue){var Ue,Ze;return __awaiter$d(this,void 0,void 0,function*(){if(this._isLoggingDisabled)return this._saveFailedLogsToStorage(ue),!1;try{return((0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((Ze=(Ue=this._options)===null||Ue===void 0?void 0:Ue.networkConfig)===null||Ze===void 0?void 0:Ze.networkOverrideFunc)==null?yield this._sendEventsViaBeacon(ue):yield this._sendEventsViaPost(ue)).success?(this._emitter({name:"logs_flushed",events:ue}),!0):(Log_1$7.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(ue),!1)}catch{return Log_1$7.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(ue){var Ue;return __awaiter$d(this,void 0,void 0,function*(){const Ze=yield this._network.post(this._getRequestData(ue)),Qe=(Ue=Ze==null?void 0:Ze.code)!==null&&Ue!==void 0?Ue:-1;return{success:Qe>=200&&Qe<300}})}_sendEventsViaBeacon(ue){return __awaiter$d(this,void 0,void 0,function*(){return{success:yield this._network.beacon(this._getRequestData(ue))}})}_getRequestData(ue){return{sdkKey:this._sdkKey,data:{events:ue},url:this._logEventUrl,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(ue.length)}}}_saveFailedLogsToStorage(ue){for(;ue.length>MAX_FAILED_LOGS;)ue.shift();const Ue=this._getStorageKey();try{(0,StorageProvider_1$3._setObjectInStorage)(Ue,ue)}catch{Log_1$7.Log.warn("Unable to save failed logs to storage")}}_retryFailedLogs(ue){const Ue=this._getStorageKey();__awaiter$d(this,void 0,void 0,function*(){StorageProvider_1$3.Storage.isReady()||(yield StorageProvider_1$3.Storage.isReadyResolver());const Ze=(0,StorageProvider_1$3._getObjectFromStorage)(Ue);if(!Ze)return;ue===RetryFailedLogsTrigger.Startup&&StorageProvider_1$3.Storage.removeItem(Ue),(yield this._sendEvents(Ze))&&ue===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$3.Storage.removeItem(Ue)}).catch(()=>{Log_1$7.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$1._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(ue){ue.user&&(ue.user=Object.assign({},ue.user),delete ue.user.privateAttributes);const Ue={},Ze=this._getCurrentPageUrl();Ze&&(Ue.statsigMetadata={currentPage:Ze});const Qe=Object.assign(Object.assign({},ue),Ue);Log_1$7.Log.debug("Enqueued Event:",Qe),this._queue.push(Qe)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var ue;if(((ue=this._options)===null||ue===void 0?void 0:ue.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$2._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var ue,Ue;const Ze=(Ue=(ue=this._options)===null||ue===void 0?void 0:ue.loggingIntervalMs)!==null&&Ue!==void 0?Ue:DEFAULT_FLUSH_INTERVAL_MS,Qe=setInterval(()=>{EVENT_LOGGER_MAP[this._sdkKey]._flushIntervalId!==Qe?clearInterval(Qe):EventLogger._safeFlushAndForget(this._sdkKey)},Ze);this._flushIntervalId=Qe}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.StatsigMetadataProvider=me.SDK_VERSION=void 0,me.SDK_VERSION="3.4.0";let ue={sdkVersion:me.SDK_VERSION,sdkType:"js-mono"};me.StatsigMetadataProvider={get:()=>ue,add:Ue=>{ue=Object.assign(Object.assign({},ue),Ue)}}})(StatsigMetadata);var ClientInterfaces={};Object.defineProperty(ClientInterfaces,"__esModule",{value:!0});var DataAdapterCore$1={},StableID={},UUID={};Object.defineProperty(UUID,"__esModule",{value:!0}),UUID.getUUID=void 0;function getUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let me=new Date().getTime(),ue=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,Ze=>{let Qe=Math.random()*16;return me>0?(Qe=(me+Qe)%16|0,me=Math.floor(me/16)):(Qe=(ue+Qe)%16|0,ue=Math.floor(ue/16)),(Ze==="x"?Qe:Qe&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$6=Log,StorageProvider_1$2=StorageProvider,UUID_1=UUID,PROMISE_MAP={};StableID.StableID={get:me=>{if(PROMISE_MAP[me]==null){let ue=_loadFromStorage(me);ue==null&&(ue=(0,UUID_1.getUUID)(),_persistToStorage(ue,me)),PROMISE_MAP[me]=ue}return PROMISE_MAP[me]},setOverride:(me,ue)=>{PROMISE_MAP[ue]=me,_persistToStorage(me,ue)}};function _getStableIDStorageKey(me){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(me)}`}function _persistToStorage(me,ue){const Ue=_getStableIDStorageKey(ue);try{(0,StorageProvider_1$2._setObjectInStorage)(Ue,me)}catch{Log_1$6.Log.warn("Failed to save StableID")}}function _loadFromStorage(me){const ue=_getStableIDStorageKey(me);return(0,StorageProvider_1$2._getObjectFromStorage)(ue)}var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1=Hashing,Log_1$5=Log;function _normalizeUser(me,ue){try{const Ue=JSON.parse(JSON.stringify(me));return ue!=null&&ue.environment!=null&&(Ue.statsigEnvironment=ue.environment),Ue}catch{return Log_1$5.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(me){return me?(0,Hashing_1._DJB2Object)(me):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$4=Log;function _typedJsonParse(me,ue,Ue){try{const Ze=JSON.parse(me);return typeof Ze=="object"&&ue in Ze,Ze}catch{}return Log_1$4.Log.error(`Failed to parse ${Ue}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$3=Log,StableID_1$1=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$1=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10;class DataAdapterCore{constructor(ue,Ue){this._adapterName=ue,this._cacheSuffix=Ue,this._options=null,this._sdkKey=null,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ue}`,this._inMemoryCache=new InMemoryCache}attach(ue,Ue){this._sdkKey=ue,this._options=Ue}getDataSync(ue){const Ue=ue&&(0,StatsigUser_1._normalizeUser)(ue,this._options),Ze=this._getCacheKey(Ue),Qe=this._inMemoryCache.get(Ze,Ue);if(Qe)return Qe;const Ge=this._loadFromCache(Ze);return Ge?(this._inMemoryCache.add(Ze,Ge),this._inMemoryCache.get(Ze,Ue)):null}setData(ue,Ue){const Ze=Ue&&(0,StatsigUser_1._normalizeUser)(Ue,this._options),Qe=this._getCacheKey(Ze);this._inMemoryCache.add(Qe,_makeDataAdapterResult("Bootstrap",ue,null,Ze))}_getDataAsyncImpl(ue,Ue,Ze){return __awaiter$c(this,void 0,void 0,function*(){StorageProvider_1$1.Storage.isReady()||(yield StorageProvider_1$1.Storage.isReadyResolver());const Qe=ue??this.getDataSync(Ue),Ge=[this._fetchAndPrepFromNetwork(Qe,Ue,Ze)];return Ze!=null&&Ze.timeoutMs&&Ge.push(new Promise(Je=>setTimeout(Je,Ze.timeoutMs)).then(()=>(Log_1$3.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(Ge)})}_prefetchDataImpl(ue,Ue){return __awaiter$c(this,void 0,void 0,function*(){const Ze=ue&&(0,StatsigUser_1._normalizeUser)(ue,this._options),Qe=this._getCacheKey(Ze),Ge=yield this._getDataAsyncImpl(null,Ze,Ue);Ge&&this._inMemoryCache.add(Qe,Object.assign(Object.assign({},Ge),{source:"Prefetch"}))})}_fetchAndPrepFromNetwork(ue,Ue,Ze){return __awaiter$c(this,void 0,void 0,function*(){let Qe=null;ue&&this._isCachedResultValidFor204(ue,Ue)&&(Qe=ue.data);const Ge=yield this._fetchFromNetwork(Qe,Ue,Ze);if(!Ge)return Log_1$3.Log.debug("No response returned for latest value"),null;const Je=(0,TypedJsonParse_1._typedJsonParse)(Ge,"has_updates","Response"),Xe=this._getSdkKey(),Ke=StableID_1$1.StableID.get(Xe);let He=null;if((Je==null?void 0:Je.has_updates)===!0)He=_makeDataAdapterResult("Network",Ge,Ke,Ue);else if(Qe&&(Je==null?void 0:Je.has_updates)===!1)He=_makeDataAdapterResult("NetworkNotModified",Qe,Ke,Ue);else return null;const $e=this._getCacheKey(Ue);return this._inMemoryCache.add($e,He),this._writeToCache($e,He),He})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$3.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(ue){var Ue;const Ze=(Ue=StorageProvider_1$1.Storage.getItem)===null||Ue===void 0?void 0:Ue.call(StorageProvider_1$1.Storage,ue);if(Ze==null)return null;const Qe=(0,TypedJsonParse_1._typedJsonParse)(Ze,"source","Cached Result");return Qe?Object.assign(Object.assign({},Qe),{source:"Cache"}):null}_writeToCache(ue,Ue){StorageProvider_1$1.Storage.setItem(ue,JSON.stringify(Ue)),this._runLocalStorageCacheEviction(ue)}_runLocalStorageCacheEviction(ue){var Ue;const Ze=(Ue=(0,StorageProvider_1$1._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&Ue!==void 0?Ue:{};Ze[ue]=Date.now();const Qe=_getEvictableKey(Ze,CACHE_LIMIT);Qe&&(delete Ze[Qe],StorageProvider_1$1.Storage.removeItem(Qe)),(0,StorageProvider_1$1._setObjectInStorage)(this._lastModifiedStoreKey,Ze)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(me,ue,Ue,Ze){return{source:me,data:ue,receivedAt:Date.now(),stableID:Ue,fullUserHash:(0,StatsigUser_1._getFullUserHash)(Ze)}}class InMemoryCache{constructor(){this._data={}}get(ue,Ue){var Ze;const Qe=this._data[ue],Ge=Qe==null?void 0:Qe.stableID,Je=(Ze=Ue==null?void 0:Ue.customIDs)===null||Ze===void 0?void 0:Ze.stableID;return Je&&Ge&&Je!==Ge?(Log_1$3.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):Qe}add(ue,Ue){const Ze=_getEvictableKey(this._data,CACHE_LIMIT-1);Ze&&delete this._data[Ze],this._data[ue]=Ue}merge(ue){this._data=Object.assign(Object.assign({},this._data),ue)}}function _getEvictableKey(me,ue){const Ue=Object.keys(me);return Ue.length<=ue?null:Ue.reduce((Ze,Qe)=>{const Ge=me[Ze],Je=me[Qe];return typeof Ge=="object"&&typeof Je=="object"?Je.receivedAt<Ge.receivedAt?Qe:Ze:Je<Ge?Qe:Ze})}var DownloadConfigSpecsResponse={};Object.defineProperty(DownloadConfigSpecsResponse,"__esModule",{value:!0});var ErrorBoundary={},SDKType={};Object.defineProperty(SDKType,"__esModule",{value:!0}),SDKType.SDKType=void 0;const SDK_CLIENT={};let suffix;SDKType.SDKType={_get:me=>{var ue;return((ue=SDK_CLIENT[me])!==null&&ue!==void 0?ue:"js-mono")+(suffix??"")},_setClientType(me,ue){SDK_CLIENT[me]=ue},_setBindingType(me){(!suffix||suffix==="-react")&&(suffix="-"+me)}},function(me){var ue=commonjsGlobal&&commonjsGlobal.__awaiter||function(He,$e,tt,et){function nt(it){return it instanceof tt?it:new tt(function(at){at(it)})}return new(tt||(tt=Promise))(function(it,at){function st(lt){try{ot(et.next(lt))}catch(dt){at(dt)}}function rt(lt){try{ot(et.throw(lt))}catch(dt){at(dt)}}function ot(lt){lt.done?it(lt.value):nt(lt.value).then(st,rt)}ot((et=et.apply(He,$e||[])).next())})};Object.defineProperty(me,"__esModule",{value:!0}),me.ErrorBoundary=me.EXCEPTION_ENDPOINT=void 0;const Ue=Log,Ze=SDKType,Qe=StatsigMetadata;me.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const Ge="[Statsig] UnknownError";class Je{constructor($e,tt,et){this._sdkKey=$e,this._options=tt,this._emitter=et,this._seen=new Set}wrap($e){try{const tt=$e;Ke(tt).forEach(et=>{const nt=tt[et];"$EB"in nt||(tt[et]=(...it)=>this._capture(et,()=>nt.apply($e,it)),tt[et].$EB=!0)})}catch(tt){this._onError("eb:wrap",tt)}}logError($e,tt){this._onError($e,tt)}_capture($e,tt){try{const et=tt();return et&&et instanceof Promise?et.catch(nt=>this._onError($e,nt)):et}catch(et){return this._onError($e,et),null}}_onError($e,tt){try{Ue.Log.warn(`Caught error in ${$e}`,{error:tt}),ue(this,void 0,void 0,function*(){var nt,it,at,st,rt,ot,lt;const dt=tt||Error(Ge),ut=dt instanceof Error,Ut=ut?dt.name:"No Name";if(this._seen.has(Ut))return;if(this._seen.add(Ut),!((it=(nt=this._options)===null||nt===void 0?void 0:nt.networkConfig)===null||it===void 0)&&it.preventAllNetworkTraffic){(at=this._emitter)===null||at===void 0||at.call(this,{name:"error",error:tt,tag:$e});return}const ht=Ze.SDKType._get(this._sdkKey),pt=Qe.StatsigMetadataProvider.get(),Vt=ut?dt.stack:Xe(dt),Tt=JSON.stringify(Object.assign({tag:$e,exception:Ut,info:Vt},Object.assign(Object.assign({},pt),{sdkType:ht})));yield((ot=(rt=(st=this._options)===null||st===void 0?void 0:st.networkConfig)===null||rt===void 0?void 0:rt.networkOverrideFunc)!==null&&ot!==void 0?ot:fetch)(me.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(ht),"STATSIG-SDK-VERSION":String(pt.sdkVersion),"Content-Type":"application/json"},body:Tt}),(lt=this._emitter)===null||lt===void 0||lt.call(this,{name:"error",error:tt,tag:$e})}).then(()=>{}).catch(()=>{})}catch{}}}me.ErrorBoundary=Je;function Xe(He){try{return JSON.stringify(He)}catch{return Ge}}function Ke(He){const $e=new Set;let tt=Object.getPrototypeOf(He);for(;tt&&tt!==Object.prototype;)Object.getOwnPropertyNames(tt).filter(et=>typeof(tt==null?void 0:tt[et])=="function").forEach(et=>$e.add(et)),tt=Object.getPrototypeOf(tt);return Array.from($e)}}(ErrorBoundary);var EvaluationOptions={};Object.defineProperty(EvaluationOptions,"__esModule",{value:!0});var EvaluationTypes={};Object.defineProperty(EvaluationTypes,"__esModule",{value:!0});var InitializeResponse={};Object.defineProperty(InitializeResponse,"__esModule",{value:!0});var NetworkCore$1={},SessionID={};(function(me){Object.defineProperty(me,"__esModule",{value:!0}),me.StatsigSession=me.SessionID=void 0;const ue=CacheKey,Ue=Log,Ze=StorageProvider,Qe=UUID,Ge=30*60*1e3,Je=4*60*60*1e3,Xe={};me.SessionID={get:rt=>me.StatsigSession.get(rt).data.sessionID},me.StatsigSession={get:rt=>{Xe[rt]==null&&(Xe[rt]=Ke(rt));const ot=Xe[rt];return $e(ot)},overrideInitialSessionID:(rt,ot)=>{Xe[ot]=He(rt,ot)}};function Ke(rt){let ot=st(rt);const lt=Date.now();return ot||(ot={sessionID:(0,Qe.getUUID)(),startTime:lt,lastUpdate:lt}),{data:ot,sdkKey:rt}}function He(rt,ot){const lt=Date.now();return{data:{sessionID:rt,startTime:lt,lastUpdate:lt},sdkKey:ot}}function $e(rt){const ot=Date.now(),lt=rt.data;(et(lt)||nt(lt))&&(lt.sessionID=(0,Qe.getUUID)(),lt.startTime=ot),lt.lastUpdate=ot,at(lt,rt.sdkKey),clearTimeout(rt.idleTimeoutID),clearTimeout(rt.ageTimeoutID);const dt=ot-lt.startTime,ut=rt.sdkKey;return rt.idleTimeoutID=tt(ut,Ge),rt.ageTimeoutID=tt(ut,Je-dt),rt}function tt(rt,ot){return setTimeout(()=>{const lt=__STATSIG__==null?void 0:__STATSIG__.instance(rt);lt&<.$emt({name:"session_expired"})},ot)}function et({lastUpdate:rt}){return Date.now()-rt>Ge}function nt({startTime:rt}){return Date.now()-rt>Je}function it(rt){return`statsig.session_id.${(0,ue._getStorageKey)(rt)}`}function at(rt,ot){const lt=it(ot);try{(0,Ze._setObjectInStorage)(lt,rt)}catch{Ue.Log.warn("Failed to save SessionID")}}function st(rt){const ot=it(rt);return(0,Ze._getObjectFromStorage)(ot)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(NetworkCore$1,"__esModule",{value:!0}),NetworkCore$1.NetworkCore=void 0;const __StatsigGlobal_1$1=$_StatsigGlobal,Diagnostics_1=Diagnostics,Log_1$2=Log,NetworkConfig_1=NetworkConfig,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(ue,Ue){this._emitter=Ue,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},ue&&(this._options=ue),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs)}post(ue){return __awaiter$b(this,void 0,void 0,function*(){let Ue=yield this._getPopulatedBody(ue);return ue.isStatsigEncodable&&(Ue=this._attemptToEncodeString(ue,Ue)),this._sendRequest(Object.assign({method:"POST",body:Ue},ue))})}get(ue){return this._sendRequest(Object.assign({method:"GET"},ue))}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}beacon(ue){return __awaiter$b(this,void 0,void 0,function*(){if(!_ensureValidSdkKey(ue))return!1;const Ue=yield this._getPopulatedBody(ue),Ze=yield this._getPopulatedURL(ue),Qe=navigator;return Qe.sendBeacon.bind(Qe)(Ze,Ue)})}_sendRequest(ue){var Ue,Ze,Qe;return __awaiter$b(this,void 0,void 0,function*(){if(!_ensureValidSdkKey(ue)||this._netConfig.preventAllNetworkTraffic)return null;const{method:Ge,body:Je,retries:Xe,attempt:Ke}=ue,He=Ke??1,$e=typeof AbortController<"u"?new AbortController:null,tt=setTimeout(()=>$e==null?void 0:$e.abort(`Timeout of ${this._timeout}ms expired.`),this._timeout),et=yield this._getPopulatedURL(ue);let nt=null;const it=(0,VisibilityObserving_1._isUnloading)();try{const at={method:Ge,body:Je,headers:Object.assign({},ue.headers),signal:$e==null?void 0:$e.signal,priority:ue.priority,keepalive:it};if(ue.isInitialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(ue.sdkKey,{attempt:He}),nt=yield((Ue=this._netConfig.networkOverrideFunc)!==null&&Ue!==void 0?Ue:fetch)(et,at),clearTimeout(tt),!nt.ok){const ot=yield nt.text().catch(()=>"No Text"),lt=new Error(`NetworkError: ${et} ${ot}`);throw lt.name="NetworkError",lt}const rt=yield nt.text();return ue.isInitialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(ue.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(nt,He,rt)),{body:rt,code:nt.status}}catch(at){const st=_getErrorMessage($e,at);return ue.isInitialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(ue.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(nt,He,"",at)),!Xe||He>Xe||!RETRYABLE_CODES.has((Ze=nt==null?void 0:nt.status)!==null&&Ze!==void 0?Ze:500)?((Qe=this._emitter)===null||Qe===void 0||Qe.call(this,{name:"error",error:at,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:ue}),Log_1$2.Log.error(`A networking error occured during ${Ge} request to ${et}.`,st,at),null):this._sendRequest(Object.assign(Object.assign({},ue),{retries:Xe,attempt:He+1}))}})}_getPopulatedURL(ue){return __awaiter$b(this,void 0,void 0,function*(){const Ue=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:ue.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(ue.sdkKey),[NetworkConfig_1.NetworkParam.SdkVersion]:StatsigMetadata_1.SDK_VERSION,[NetworkConfig_1.NetworkParam.Time]:String(Date.now()),[NetworkConfig_1.NetworkParam.SessionID]:SessionID_1$1.SessionID.get(ue.sdkKey)},ue.params),Ze=Object.keys(Ue).map(Qe=>`${encodeURIComponent(Qe)}=${encodeURIComponent(Ue[Qe])}`).join("&");return`${ue.url}${Ze?`?${Ze}`:""}`})}_getPopulatedBody(ue){return __awaiter$b(this,void 0,void 0,function*(){const{data:Ue,sdkKey:Ze}=ue,Qe=StableID_1.StableID.get(Ze),Ge=SessionID_1$1.SessionID.get(Ze),Je=SDKType_1.SDKType._get(Ze);return JSON.stringify(Object.assign(Object.assign({},Ue),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:Qe,sessionID:Ge,sdkType:Je})}))})}_attemptToEncodeString(ue,Ue){var Ze,Qe;const Ge=(0,SafeJs_1$1._getWindowSafe)();if(!ue.isStatsigEncodable||this._options.disableStatsigEncoding||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(Ge!=null&&Ge.btoa))return Ue;try{const Je=(Ze=Ge.btoa(Ue).split("").reverse().join(""))!==null&&Ze!==void 0?Ze:Ue;return ue.params=Object.assign(Object.assign({},(Qe=ue.params)!==null&&Qe!==void 0?Qe:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"}),Je}catch{return Log_1$2.Log.warn("/initialize request encoding failed"),Ue}}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=me=>me.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1);function _getErrorMessage(me,ue){return me!=null&&me.signal.aborted&&typeof me.signal.reason=="string"?me.signal.reason:typeof ue=="string"?ue:ue instanceof Error?`${ue.name}: ${ue.message}`:"Unknown Error"}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(StatsigClientBase$1,"__esModule",{value:!0}),StatsigClientBase$1.StatsigClientBase=void 0;const __StatsigGlobal_1=$_StatsigGlobal,ErrorBoundary_1=ErrorBoundary,EventLogger_1=EventLogger$1,Log_1$1=Log,SafeJs_1=SafeJs,SessionID_1=SessionID,StorageProvider_1=StorageProvider;class StatsigClientBase{constructor(ue,Ue,Ze,Qe){var Ge;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const Je=this.$emt.bind(this);(Qe==null?void 0:Qe.logLevel)!=null&&(Log_1$1.Log.level=Qe.logLevel),Qe!=null&&Qe.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),Qe!=null&&Qe.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(Qe.initialSessionID,ue),Qe!=null&&Qe.storageProvider&&StorageProvider_1.Storage._setProvider(Qe.storageProvider),this._sdkKey=ue,this._options=Qe??{},this.overrideAdapter=(Ge=Qe==null?void 0:Qe.overrideAdapter)!==null&&Ge!==void 0?Ge:null,this._logger=new EventLogger_1.EventLogger(ue,Je,Ze,Qe),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(ue,Qe,Je),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ze),this._errorBoundary.wrap(Ue),this._errorBoundary.wrap(this._logger),this.dataAdapter=Ue,this.dataAdapter.attach(ue,Qe),this.storageProvider=StorageProvider_1.Storage,this._primeReadyRipcord(),_assignGlobalInstance(ue,this)}updateRuntimeOptions(ue){ue.disableLogging!=null&&(this._options.disableLogging=ue.disableLogging,this._logger.setLoggingDisabled(ue.disableLogging)),ue.disableStorage!=null&&(this._options.disableStorage=ue.disableStorage,StorageProvider_1.Storage._setDisabled(ue.disableStorage))}flush(){return this._logger.flush()}shutdown(){return __awaiter$a(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(ue,Ue){this._listeners[ue]||(this._listeners[ue]=[]),this._listeners[ue].push(Ue)}off(ue,Ue){if(this._listeners[ue]){const Ze=this._listeners[ue].indexOf(Ue);Ze!==-1&&this._listeners[ue].splice(Ze,1)}}$on(ue,Ue){Ue.__isInternal=!0,this.on(ue,Ue)}$emt(ue){var Ue;const Ze=Qe=>{try{Qe(ue)}catch(Ge){if(Qe.__isInternal===!0){this._errorBoundary.logError(`__emit:${ue.name}`,Ge);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",ue)}};this._listeners[ue.name]&&this._listeners[ue.name].forEach(Qe=>Ze(Qe)),(Ue=this._listeners["*"])===null||Ue===void 0||Ue.forEach(Ze)}_setStatus(ue,Ue){this.loadingStatus=ue,this.$emt({name:"values_updated",status:ue,values:Ue})}_enqueueExposure(ue,Ue,Ze){if((Ze==null?void 0:Ze.disableExposureLog)===!0){this._logger.incrementNonExposureCount(ue);return}this._logger.enqueue(Ue)}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(me,ue){var Ue;if((0,SafeJs_1._isServerEnv)())return;const Ze=(0,__StatsigGlobal_1._getStatsigGlobal)(),Qe=(Ue=Ze.instances)!==null&&Ue!==void 0?Ue:{},Ge=ue;Qe[me]!=null&&Log_1$1.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),Qe[me]=Ge,Ze.firstInstance||(Ze.firstInstance=Ge),Ze.instances=Qe,__STATSIG__=Ze}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0});var StatsigPlugin={};Object.defineProperty(StatsigPlugin,"__esModule",{value:!0});var StatsigTypeFactories={};Object.defineProperty(StatsigTypeFactories,"__esModule",{value:!0}),StatsigTypeFactories._makeTypedGet=StatsigTypeFactories._mergeOverride=StatsigTypeFactories._makeLayer=StatsigTypeFactories._makeExperiment=StatsigTypeFactories._makeDynamicConfig=StatsigTypeFactories._makeFeatureGate=void 0;const Log_1=Log,TypingUtils_1=TypingUtils,DEFAULT_RULE="default";function _makeEvaluation(me,ue,Ue,Ze){var Qe;return{name:me,details:ue,ruleID:(Qe=Ue==null?void 0:Ue.rule_id)!==null&&Qe!==void 0?Qe:DEFAULT_RULE,__evaluation:Ue,value:Ze}}function _makeFeatureGate(me,ue,Ue){return _makeEvaluation(me,ue,Ue,(Ue==null?void 0:Ue.value)===!0)}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(me,ue,Ue){var Ze;const Qe=(Ze=Ue==null?void 0:Ue.value)!==null&&Ze!==void 0?Ze:{};return Object.assign(Object.assign({},_makeEvaluation(me,ue,Ue,Qe)),{get:_makeTypedGet(me,Ue==null?void 0:Ue.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(me,ue,Ue){var Ze;const Qe=_makeDynamicConfig(me,ue,Ue);return Object.assign(Object.assign({},Qe),{groupName:(Ze=Ue==null?void 0:Ue.group_name)!==null&&Ze!==void 0?Ze:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(me,ue,Ue,Ze){var Qe,Ge;return Object.assign(Object.assign({},_makeEvaluation(me,ue,Ue,void 0)),{get:_makeTypedGet(me,Ue==null?void 0:Ue.value,Ze),groupName:(Qe=Ue==null?void 0:Ue.group_name)!==null&&Qe!==void 0?Qe:null,__value:(Ge=Ue==null?void 0:Ue.value)!==null&&Ge!==void 0?Ge:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(me,ue,Ue,Ze){return Object.assign(Object.assign(Object.assign({},me),ue),{get:_makeTypedGet(me.name,Ue,Ze)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(me,ue,Ue){return(Ze,Qe)=>{var Ge;const Je=(Ge=ue==null?void 0:ue[Ze])!==null&&Ge!==void 0?Ge:null;return Je==null?Qe??null:Qe!=null&&!(0,TypingUtils_1._isTypeMatch)(Je,Qe)?(Log_1.Log.warn(`Parameter type mismatch. '${me}.${Ze}' was found to be type '${typeof Je}' but fallback/return type is '${typeof Qe}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),Qe??null):(Ue==null||Ue(Ze),Je)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0}),function(me){var ue=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Ke,He,$e,tt){tt===void 0&&(tt=$e);var et=Object.getOwnPropertyDescriptor(He,$e);(!et||("get"in et?!He.__esModule:et.writable||et.configurable))&&(et={enumerable:!0,get:function(){return He[$e]}}),Object.defineProperty(Ke,tt,et)}:function(Ke,He,$e,tt){tt===void 0&&(tt=$e),Ke[tt]=He[$e]}),Ue=commonjsGlobal&&commonjsGlobal.__exportStar||function(Ke,He){for(var $e in Ke)$e!=="default"&&!Object.prototype.hasOwnProperty.call(He,$e)&&ue(He,Ke,$e)};Object.defineProperty(me,"__esModule",{value:!0}),me.Diagnostics=me.Log=me.Storage=me.EventLogger=void 0;const Ze=Diagnostics;Object.defineProperty(me,"Diagnostics",{enumerable:!0,get:function(){return Ze.Diagnostics}});const Qe=EventLogger$1;Object.defineProperty(me,"EventLogger",{enumerable:!0,get:function(){return Qe.EventLogger}});const Ge=Log;Object.defineProperty(me,"Log",{enumerable:!0,get:function(){return Ge.Log}});const Je=StatsigMetadata,Xe=StorageProvider;Object.defineProperty(me,"Storage",{enumerable:!0,get:function(){return Xe.Storage}}),Ue($_StatsigGlobal,me),Ue(CacheKey,me),Ue(ClientInterfaces,me),Ue(DataAdapterCore$1,me),Ue(Diagnostics,me),Ue(DownloadConfigSpecsResponse,me),Ue(ErrorBoundary,me),Ue(EvaluationOptions,me),Ue(EvaluationTypes,me),Ue(Hashing,me),Ue(InitializeResponse,me),Ue(Log,me),Ue(NetworkConfig,me),Ue(NetworkCore$1,me),Ue(OverrideAdapter,me),Ue(ParamStoreTypes,me),Ue(SafeJs,me),Ue(SDKType,me),Ue(SessionID,me),Ue(StableID,me),Ue(StatsigClientBase$1,me),Ue(StatsigClientEventEmitter,me),Ue(StatsigDataAdapter,me),Ue(StatsigEvent,me),Ue(StatsigMetadata,me),Ue(StatsigOptionsCommon,me),Ue(StatsigPlugin,me),Ue(StatsigTypeFactories,me),Ue(StatsigTypes,me),Ue(StatsigUser,me),Ue(StorageProvider,me),Ue(TypedJsonParse,me),Ue(TypingUtils,me),Ue(UrlOverrides,me),Ue(UUID,me),Ue(VisibilityObserving,me),__STATSIG__=Object.assign(Object.assign({},__STATSIG__!=null?__STATSIG__:{}),{Log:Ge.Log,SDK_VERSION:Je.SDK_VERSION})}(src$1);var EvaluationStore$1={};Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1;class EvaluationStore{constructor(ue){this._sdkKey=ue,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(ue,Ue){if(!ue)return!1;const Ze=(0,client_core_1$5._typedJsonParse)(ue.data,"has_updates","EvaluationResponse");return Ze==null?!1:(this._source=ue.source,(Ze==null?void 0:Ze.has_updates)!==!0||(this._rawValues=ue.data,this._lcut=Ze.time,this._receivedAt=ue.receivedAt,this._values=Ze,this._bootstrapMetadata=this._extractBootstrapMetadata(ue.source,Ze),ue.source&&Ze.user&&this._setWarningState(Ue,Ze)),!0)}getGate(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.feature_gates,ue)}getConfig(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.dynamic_configs,ue)}getLayer(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.layer_configs,ue)}getParamStore(ue){var Ue;return this._getDetailedStoreResult((Ue=this._values)===null||Ue===void 0?void 0:Ue.param_stores,ue)}_extractBootstrapMetadata(ue,Ue){if(ue!=="Bootstrap")return null;const Ze={};return Ue.user&&(Ze.user=Ue.user),Ue.sdkInfo&&(Ze.generatorSDKInfo=Ue.sdkInfo),Ze.lcut=Ue.time,Ze}_getDetailedStoreResult(ue,Ue){let Ze=null;return ue&&(Ze=ue[Ue]?ue[Ue]:ue[(0,client_core_1$5._DJB2)(Ue)]),{result:Ze,details:this._getDetails(Ze==null)}}_setWarningState(ue,Ue){var Ze;const Qe=client_core_1$5.StableID.get(this._sdkKey);if(((Ze=ue.customIDs)===null||Ze===void 0?void 0:Ze.stableID)!==Qe){this._warnings.add("StableIDMismatch");return}if("user"in Ue){const Ge=Ue.user;(0,client_core_1$5._getFullUserHash)(ue)!==(0,client_core_1$5._getFullUserHash)(Ge)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const ue={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(ue.warnings=Array.from(this._warnings)),ue}_getDetails(ue){var Ue,Ze;const Qe=this.getCurrentSourceDetails();let Ge=Qe.reason;const Je=(Ue=Qe.warnings)!==null&&Ue!==void 0?Ue:[];this._source==="Bootstrap"&&Je.length>0&&(Ge=Ge+Je[0]),Ge!=="Uninitialized"&&Ge!=="NoValues"&&(Ge=`${Ge}:${ue?"Unrecognized":"Recognized"}`);const Xe=this._source==="Bootstrap"&&(Ze=this._bootstrapMetadata)!==null&&Ze!==void 0?Ze:void 0;return Xe&&(Qe.bootstrapMetadata=Xe),Object.assign(Object.assign({},Qe),{reason:Ge})}}EvaluationStore$1.default=EvaluationStore;var Network={},EvaluationResponseDeltas={};Object.defineProperty(EvaluationResponseDeltas,"__esModule",{value:!0}),EvaluationResponseDeltas._resolveDeltasResponse=void 0;const client_core_1$4=src$1,MAX_DELTAS_SORT_DEPTH=2;function _resolveDeltasResponse(me,ue){const Ue=(0,client_core_1$4._typedJsonParse)(ue,"checksum","DeltasEvaluationResponse");if(!Ue)return{hadBadDeltaChecksum:!0};const Ze=_mergeDeltasIntoCache(me,Ue),Qe=_handleDeletedEntries(Ze),Ge=(0,client_core_1$4._DJB2Object)({feature_gates:Qe.feature_gates,dynamic_configs:Qe.dynamic_configs,layer_configs:Qe.layer_configs},MAX_DELTAS_SORT_DEPTH);return Ge===Ue.checksumV2?JSON.stringify(Qe):{hadBadDeltaChecksum:!0,badChecksum:Ge,badMergedConfigs:Qe,badFullResponse:Ue.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(me,ue){return Object.assign(Object.assign(Object.assign({},me),ue),{feature_gates:Object.assign(Object.assign({},me.feature_gates),ue.feature_gates),layer_configs:Object.assign(Object.assign({},me.layer_configs),ue.layer_configs),dynamic_configs:Object.assign(Object.assign({},me.dynamic_configs),ue.dynamic_configs)})}function _handleDeletedEntries(me){const ue=me;return _deleteEntriesInRecord(me.deleted_gates,ue.feature_gates),delete ue.deleted_gates,_deleteEntriesInRecord(me.deleted_configs,ue.dynamic_configs),delete ue.deleted_configs,_deleteEntriesInRecord(me.deleted_layers,ue.layer_configs),delete ue.deleted_layers,ue}function _deleteEntriesInRecord(me,ue){me==null||me.forEach(Ue=>{delete ue[Ue]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(Network,"__esModule",{value:!0});const client_core_1$3=src$1,EvaluationResponseDeltas_1=EvaluationResponseDeltas;class StatsigNetwork extends client_core_1$3.NetworkCore{constructor(ue,Ue){super(ue,Ue);const Ze=ue==null?void 0:ue.networkConfig;this._initializeUrl=(0,client_core_1$3._getOverridableUrl)(Ze==null?void 0:Ze.initializeUrl,Ze==null?void 0:Ze.api,"/initialize",client_core_1$3.NetworkDefault.initializeApi)}fetchEvaluations(ue,Ue,Ze,Qe){return __awaiter$9(this,void 0,void 0,function*(){const Ge=Ue?(0,client_core_1$3._typedJsonParse)(Ue,"has_updates","InitializeResponse"):null;let Je={user:Qe,hash:"djb2",deltasResponseRequested:!1};return Ge!=null&&Ge.has_updates&&(Je=Object.assign(Object.assign({},Je),{sinceTime:Ge.time,previousDerivedFields:"derived_fields"in Ge?Ge.derived_fields:{},deltasResponseRequested:!0})),this._fetchEvaluations(ue,Ge,Je,Ze)})}_fetchEvaluations(ue,Ue,Ze,Qe){var Ge,Je;return __awaiter$9(this,void 0,void 0,function*(){const Xe=yield this.post({sdkKey:ue,url:this._initializeUrl,data:Ze,retries:2,isStatsigEncodable:!0,priority:Qe,isInitialize:!0});if((Xe==null?void 0:Xe.code)===204)return'{"has_updates": false}';if((Xe==null?void 0:Xe.code)!==200)return(Ge=Xe==null?void 0:Xe.body)!==null&&Ge!==void 0?Ge:null;if((Ue==null?void 0:Ue.has_updates)!==!0||((Je=Xe.body)===null||Je===void 0?void 0:Je.includes('"is_delta":true'))!==!0||Ze.deltasResponseRequested!==!0)return Xe.body;const Ke=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ue,Xe.body);return typeof Ke=="string"?Ke:this._fetchEvaluations(ue,Ue,Object.assign(Object.assign(Object.assign({},Ze),Ke),{deltasResponseRequested:!1}),Qe)})}}Network.default=StatsigNetwork;var ParamStoreGetterFactory={};Object.defineProperty(ParamStoreGetterFactory,"__esModule",{value:!0}),ParamStoreGetterFactory._makeParamStoreGetter=void 0;const client_core_1$2=src$1,NO_EXPOSURE_OPT={disableExposureLog:!0};function _shouldLogExposure(me){return me==null||me.disableExposureLog===!1}function _shouldReturnFallback(me,ue){return ue!=null&&!(0,client_core_1$2._isTypeMatch)(me,ue)}function _getMappedStaticValue(me,ue){return me.value}function _getMappedGateValue(me,ue,Ue){return me.getFeatureGate(ue.gate_name,_shouldLogExposure(Ue)?void 0:NO_EXPOSURE_OPT).value?ue.pass_value:ue.fail_value}function _getMappedDynamicConfigValue(me,ue,Ue,Ze){const Ge=me.getDynamicConfig(ue.config_name,NO_EXPOSURE_OPT).get(ue.param_name);return _shouldReturnFallback(Ge,Ue)?Ue:(_shouldLogExposure(Ze)&&me.getDynamicConfig(ue.config_name),Ge)}function _getMappedExperimentValue(me,ue,Ue,Ze){const Ge=me.getExperiment(ue.experiment_name,NO_EXPOSURE_OPT).get(ue.param_name);return _shouldReturnFallback(Ge,Ue)?Ue:(_shouldLogExposure(Ze)&&me.getExperiment(ue.experiment_name),Ge)}function _getMappedLayerValue(me,ue,Ue,Ze){const Ge=me.getLayer(ue.layer_name,NO_EXPOSURE_OPT).get(ue.param_name);return _shouldReturnFallback(Ge,Ue)?Ue:(_shouldLogExposure(Ze)&&me.getLayer(ue.layer_name).get(ue.param_name),Ge)}function _makeParamStoreGetter(me,ue,Ue){return(Ze,Qe)=>{if(ue==null)return Qe;const Ge=ue[Ze];if(Ge==null||Qe!=null&&(0,client_core_1$2._typeOf)(Qe)!==Ge.param_type)return Qe;switch(Ge.ref_type){case"static":return _getMappedStaticValue(Ge);case"gate":return _getMappedGateValue(me,Ge,Ue);case"dynamic_config":return _getMappedDynamicConfigValue(me,Ge,Qe,Ue);case"experiment":return _getMappedExperimentValue(me,Ge,Qe,Ue);case"layer":return _getMappedLayerValue(me,Ge,Qe,Ue);default:return Qe}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(StatsigEvaluationsDataAdapter$1,"__esModule",{value:!0}),StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=void 0;const client_core_1$1=src$1,Network_1$1=Network;class StatsigEvaluationsDataAdapter extends client_core_1$1.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(ue,Ue){super.attach(ue,Ue),this._network=new Network_1$1.default(Ue??{})}getDataAsync(ue,Ue,Ze){return this._getDataAsyncImpl(ue,(0,client_core_1$1._normalizeUser)(Ue,this._options),Ze)}prefetchData(ue,Ue){return this._prefetchDataImpl(ue,Ue)}setData(ue){const Ue=(0,client_core_1$1._typedJsonParse)(ue,"has_updates","data");Ue&&"user"in Ue?super.setData(ue,Ue.user):client_core_1$1.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(ue,Ue){super.setData(ue,Ue)}_fetchFromNetwork(ue,Ue,Ze){var Qe;return __awaiter$8(this,void 0,void 0,function*(){const Ge=yield(Qe=this._network)===null||Qe===void 0?void 0:Qe.fetchEvaluations(this._getSdkKey(),ue,Ze==null?void 0:Ze.priority,Ue);return Ge??null})}_getCacheKey(ue){var Ue;const Ze=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),ue,(Ue=this._options)===null||Ue===void 0?void 0:Ue.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${Ze}`}_isCachedResultValidFor204(ue,Ue){return ue.fullUserHash!=null&&ue.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ue)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(me,ue,Ue,Ze){function Qe(Ge){return Ge instanceof Ue?Ge:new Ue(function(Je){Je(Ge)})}return new(Ue||(Ue=Promise))(function(Ge,Je){function Xe($e){try{He(Ze.next($e))}catch(tt){Je(tt)}}function Ke($e){try{He(Ze.throw($e))}catch(tt){Je(tt)}}function He($e){$e.done?Ge($e.value):Qe($e.value).then(Xe,Ke)}He((Ze=Ze.apply(me,ue||[])).next())})};Object.defineProperty(StatsigClient$1,"__esModule",{value:!0});const client_core_1=src$1,EvaluationStore_1=EvaluationStore$1,Network_1=Network,ParamStoreGetterFactory_1=ParamStoreGetterFactory,StatsigEvaluationsDataAdapter_1=StatsigEvaluationsDataAdapter$1;class StatsigClient extends client_core_1.StatsigClientBase{static instance(ue){const Ue=(0,client_core_1._getStatsigGlobal)().instance(ue);return Ue instanceof StatsigClient?Ue:(client_core_1.Log.warn((0,client_core_1._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new StatsigClient(ue??"",{}))}constructor(ue,Ue,Ze=null){var Qe,Ge;client_core_1.SDKType._setClientType(ue,"javascript-client");const Je=new Network_1.default(Ze,Ke=>{this.$emt(Ke)});super(ue,(Qe=Ze==null?void 0:Ze.dataAdapter)!==null&&Qe!==void 0?Qe:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,Je,Ze),this._store=new EvaluationStore_1.default(ue),this._user=(0,client_core_1._normalizeUser)(Ue,Ze);const Xe=(Ge=Ze==null?void 0:Ze.plugins)!==null&&Ge!==void 0?Ge:[];for(const Ke of Xe)Ke.bind(this)}initializeSync(ue){this.loadingStatus==="Uninitialized"&&(this._logger.start(),this.updateUserSync(this._user,ue))}initializeAsync(ue){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(ue),this._initializePromise)})}updateUserSync(ue,Ue){this._resetForUser(ue);const Ze=this.dataAdapter.getDataSync(this._user);this._store.setValues(Ze,this._user),this._finalizeUpdate(Ze);const Qe=Ue==null?void 0:Ue.disableBackgroundCacheRefresh;Qe===!0||Qe==null&&(Ze==null?void 0:Ze.source)==="Bootstrap"||this._runPostUpdate(Ze??null,this._user)}updateUserAsync(ue,Ue){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(ue);const Ze=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let Qe=this.dataAdapter.getDataSync(Ze);if(this._store.setValues(Qe,this._user),this._setStatus("Loading",Qe),Qe=yield this.dataAdapter.getDataAsync(Qe,Ze,Ue),Ze!==this._user)return;let Ge=!1;Qe!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),Ge=this._store.setValues(Qe,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:Ge})),this._finalizeUpdate(Qe),Ge||this.$emt({name:"initialization_failure"}),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,Ge,this._store.getCurrentSourceDetails()),client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options)})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:client_core_1.StatsigSession.get(this._sdkKey),stableID:client_core_1.StableID.get(this._sdkKey)}}checkGate(ue,Ue){return this.getFeatureGate(ue,Ue).value}getFeatureGate(ue,Ue){var Ze,Qe;const{result:Ge,details:Je}=this._store.getGate(ue),Xe=(0,client_core_1._makeFeatureGate)(ue,Je,Ge),Ke=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getGateOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Xe,this._user,Ue),He=Ke??Xe;return this._enqueueExposure(ue,(0,client_core_1._createGateExposure)(this._user,He),Ue),this.$emt({name:"gate_evaluation",gate:He}),He}getDynamicConfig(ue,Ue){var Ze,Qe;const{result:Ge,details:Je}=this._store.getConfig(ue),Xe=(0,client_core_1._makeDynamicConfig)(ue,Je,Ge),Ke=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getDynamicConfigOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Xe,this._user,Ue),He=Ke??Xe;return this._enqueueExposure(ue,(0,client_core_1._createConfigExposure)(this._user,He),Ue),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:He}),He}getExperiment(ue,Ue){var Ze,Qe;const{result:Ge,details:Je}=this._store.getConfig(ue),Xe=(0,client_core_1._makeExperiment)(ue,Je,Ge),Ke=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getExperimentOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Xe,this._user,Ue),He=Ke??Xe;return this._enqueueExposure(ue,(0,client_core_1._createConfigExposure)(this._user,He),Ue),this.$emt({name:"experiment_evaluation",experiment:He}),He}getLayer(ue,Ue){var Ze,Qe,Ge;const{result:Je,details:Xe}=this._store.getLayer(ue),Ke=(0,client_core_1._makeLayer)(ue,Xe,Je),He=(Qe=(Ze=this.overrideAdapter)===null||Ze===void 0?void 0:Ze.getLayerOverride)===null||Qe===void 0?void 0:Qe.call(Ze,Ke,this._user,Ue),$e=(0,client_core_1._mergeOverride)(Ke,He,(Ge=He==null?void 0:He.__value)!==null&&Ge!==void 0?Ge:Ke.__value,tt=>{this._enqueueExposure(ue,(0,client_core_1._createLayerParameterExposure)(this._user,$e,tt),Ue)});return this.$emt({name:"layer_evaluation",layer:$e}),$e}getParameterStore(ue,Ue){const{result:Ze,details:Qe}=this._store.getParamStore(ue);return this._logger.incrementNonExposureCount(ue),{name:ue,details:Qe,__configuration:Ze,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,Ze,Ue)}}logEvent(ue,Ue,Ze){const Qe=typeof ue=="string"?{eventName:ue,value:Ue,metadata:Ze}:ue;this._logger.enqueue(Object.assign(Object.assign({},Qe),{user:this._user,time:Date.now()}))}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(ue){return __awaiter$7(this,void 0,void 0,function*(){return client_core_1.Storage.isReady()||(yield client_core_1.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,ue)})}_finalizeUpdate(ue){this._store.finalize(),this._setStatus("Ready",ue)}_runPostUpdate(ue,Ue){this.dataAdapter.getDataAsync(ue,Ue,{priority:"low"}).catch(Ze=>{client_core_1.Log.error("An error occurred after update.",Ze)})}_resetForUser(ue){var Ue;this._logger.reset(),this._store.reset(),this._user=(0,client_core_1._normalizeUser)(ue,this._options);const Ze=(Ue=this._user.customIDs)===null||Ue===void 0?void 0:Ue.stableID;Ze&&client_core_1.StableID.setOverride(Ze,this._sdkKey)}}StatsigClient$1.default=StatsigClient,function(me){var ue=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Qe,Ge,Je,Xe){Xe===void 0&&(Xe=Je);var Ke=Object.getOwnPropertyDescriptor(Ge,Je);(!Ke||("get"in Ke?!Ge.__esModule:Ke.writable||Ke.configurable))&&(Ke={enumerable:!0,get:function(){return Ge[Je]}}),Object.defineProperty(Qe,Xe,Ke)}:function(Qe,Ge,Je,Xe){Xe===void 0&&(Xe=Je),Qe[Xe]=Ge[Je]}),Ue=commonjsGlobal&&commonjsGlobal.__exportStar||function(Qe,Ge){for(var Je in Qe)Je!=="default"&&!Object.prototype.hasOwnProperty.call(Ge,Je)&&ue(Ge,Qe,Je)};Object.defineProperty(me,"__esModule",{value:!0}),me.StatsigClient=void 0;const Ze=StatsigClient$1;me.StatsigClient=Ze.default,Ue(src$1,me),__STATSIG__=Object.assign(Object.assign({},__STATSIG__!=null?__STATSIG__:{}),{StatsigClient:Ze.default}),me.default=__STATSIG__}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability"];function getStatsigEnvironment(me){return isStageK8sEnv(me)?{tier:"development"}:isStageEnv(me)||isDemoEnv(me)?{tier:"staging"}:isSaasEnv(me)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1},initializeStatsig=async({apiKey:me,apiURL:ue,interviewId:Ue})=>{const Ze={customIDs:{client_api_key:me,interviewId:Ue}},Qe=new src$2.StatsigClient(clientApiKey,Ze,{environment:getStatsigEnvironment(ue)});await Qe.initializeAsync(),FEATURE_FLAGS.forEach(Ge=>{featureFlagsValues[Ge]=Qe.checkGate(Ge)})},getFeatureFlag=me=>featureFlagsValues[me]??!1,getAllFeatureFlags=()=>featureFlagsValues,wasmVersion="v1.9.7";function generateBundle(me){const Ue=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_01:PipelineProfileName.IdCapture_2_01,Ze=me?Math.random()<.9?PipelineProfileName.SelfieWithAggregationMetrics:PipelineProfileName.SelfieWithQualityMetrics:PipelineProfileName.SelfieWithAggregationMetrics,Qe=PipelineProfileName.IdVideoSelfie_2_01;return[Ue,Qe,Ze]}function getInitializationParams(me){const Ue=generateBundle(me),Ze="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",Qe=`${Ze}/${wasmVersion}/webLib.wasm`,Ge=`${Ze}/${wasmVersion}/webLibSimd.wasm`,Je=`${Ze}/${wasmVersion}/webLib.js`,Xe=`${Ze}/${wasmVersion}/versions.json`;let Ke=new Map,He=new Map;for(const $e of Ue){const tt=getProfile($e);if(!tt)throw new Error(`Profile not found: ${$e}`);const et=tt.modelNames;let nt=[];for(const it of et)nt.push(`${Ze}/${wasmVersion}/models/${it}`);Ke.set(tt.pipelineType,nt),He.set(tt.detectionType,tt)}return{wasmModulePath:Qe,wasmSimdModulePath:Ge,glueCodePath:Je,versionsFilePath:Xe,pipelineModels:Ke,enableSIMD:!0,profiles:He,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.wasmApiHelpers=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.Module=null,this.loadModule=async ue=>{this.Module=(await import(ue)).Module}}async initialize(ue,Ue,Ze,Qe,Ge,Je){await this.freeResources(),this.pipelines_=Je,this.versionsFile=Ge,await this.loadModule(Ze);const Xe=await this.loadWasm(Qe,ue,Ue);return this.wasmApiHelpers=new this.wasmModule.MlWasmApiHelpers,this.idCaptureWasmApi=new this.wasmModule.IdCaptureWasmApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionWasmApi,this.isInitialized_=!0,Xe}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.wasmApiHelpers!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(ue,Ue){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(ue&&Ue&&ue==this.imageWidth_&&Ue==this.imageHeight_&&this.inputImageBuffer&&ue*Ue*4===this.inputImageBuffer.length)&&(this.imageWidth_=ue,this.imageHeight_=Ue,this.inputImageBuffer=this.wasmApiHelpers.allocateInputImageBuffer(ue,Ue,4))}async handleDetectionCallAndUpdateState(ue){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(ue))}async encryptImage(ue){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.wasmApiHelpers.encryptImage(ue)}isVirtualCamera(ue){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),ue)return this.wasmApiHelpers.isVirtualCamera(ue)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.wasmApiHelpers.estimatePerformance()}async analyzeFrame(ue){return this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(ue.width,ue.height),this.inputImageBuffer.set(ue.data),this.wasmApiHelpers.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.wasmApiHelpers&&typeof this.wasmApiHelpers.delete=="function"&&(this.wasmApiHelpers.delete(),this.wasmApiHelpers=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(ue){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.wasmApiHelpers.resetPipeline(this.pipelineTypeToWasmEnum(ue))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[ue,Ue]of this.pipelines_)this.resetPipeline(ue)}async process(ue,Ue){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(ue.data),Ue){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ue));case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.pipelineTypeToWasmEnum(Ue));default:throw new Error("Unknown pipeline type")}}async runIdCapture(ue){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(ue){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(ue,Ue,Ze,Qe,Ge){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge)}async setFaceDetectionThresholds(ue,Ue,Ze,Qe,Ge,Je,Xe){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe)}async setFaceAttributesThresholds(ue,Ue,Ze,Qe,Ge){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge)}async setFaceAttributesEnabled(ue,Ue,Ze,Qe,Ge){this.checkWasmInitialization("Unable to set face attributes enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesEnabled(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge)}async setFaceDetectionMode(ue,Ue){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(ue),Ue)}async setFaceDetectionCallbacks(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt,it,at,st,rt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt,it,at,st,rt)}async setIdCaptureThresholds(ue,Ue,Ze,Qe,Ge,Je,Xe){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe)}async setIdCaptureCallbacks(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt)}async setIdCaptureGeometryParams(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et,nt)}async setIdCaptureConfigParams(ue,Ue,Ze,Qe,Ge,Je){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(ue),Ue,Ze,Qe,Ge,Je)}setIdCaptureModelType(ue,Ue){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(ue),this.IdCaptureModelTypeToWasmEnum(Ue))}async getVersions(){const Ue=await(await fetch(this.versionsFile)).text();return JSON.parse(Ue)}async loadWasm(ue,Ue,Ze){const Qe=ue?Ze:Ue;try{window.wasmArrayBuffer=await fetch(Qe).then(Ge=>Ge.arrayBuffer()).then(Ge=>new Uint8Array(Ge)),this.wasmModule=await this.Module()}catch(Ge){if(console.log(Ge,ue,"useSmd"),ue)return await this.loadWasm(!1,Ue,Ze);throw Ge}return ue}async loadModels(){var Qe;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let ue=new this.wasmModule.PipelineTypeToIntMap,Ue=new Map,Ze=new Map;for(let[Ge,Je]of this.pipelines_){let Xe=this.pipelineTypeToWasmEnum(Ge),Ke=[],He=new this.wasmModule.VectorInt;for(let $e of Je){if(!Ze.has($e)){let et=await fetch($e).then(nt=>nt.arrayBuffer()).then(nt=>new Uint8Array(nt));Ze.set($e,et)}let tt=Ze.get($e);He.push_back(tt.byteLength),Ke.push(tt)}ue.set(Xe,He),Ue.set(Xe,Ke)}this.modelsBuffers=this.wasmApiHelpers.allocateModelsBuffers(ue);for(let[Ge,Je]of Ue){let Xe=(Qe=this.modelsBuffers)==null?void 0:Qe.get(Ge);for(let Ke=0;Ke<Xe.size();Ke++){let He=Xe==null?void 0:Xe.get(Ke);if(He)He.set(Je[Ke]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.wasmApiHelpers.initializePipelines()}async setProductionMode(ue){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.wasmApiHelpers.setProductionMode(ue)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.wasmApiHelpers.getCurrentPipeline())}pipelineTypeToWasmEnum(ue){switch(ue){case WasmPipelineType.IdBlurGlarePipeline:return this.wasmModule.PipelineType.IdBlurGlarePipeline;case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.wasmModule.PipelineType.IdBarcodeAndTextQualityPipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}pipelineTypeFromWasmEnum(ue){switch(ue){case this.wasmModule.PipelineType.IdBlurGlarePipeline:return WasmPipelineType.IdBlurGlarePipeline;case this.wasmModule.IdBarcodeAndTextQualityPipeline:return WasmPipelineType.IdBarcodeAndTextQualityPipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}IdCaptureModelTypeToWasmEnum(ue){switch(ue){case IdCaptureModelType.IdCaptureV1x:return this.wasmModule.IdCaptureModelType.IdCaptureV1x;case IdCaptureModelType.IdCaptureV2x:return this.wasmModule.IdCaptureModelType.IdCaptureV2x;case IdCaptureModelType.IdCaptureV3x:return this.wasmModule.IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}IdCaptureModelTypeFromWasmEnum(ue){switch(ue){case this.wasmModule.IdCaptureModelType.IdCaptureV1x:return IdCaptureModelType.IdCaptureV1x;case this.wasmModule.IdCaptureModelType.IdCaptureV2x:return IdCaptureModelType.IdCaptureV2x;case this.wasmModule.IdCaptureModelType.IdCaptureV3x:return IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}checkWasmInitialization(ue){if(!this.isInitialized())throw new Error(ue)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance();class MotionStatusCheck{constructor(ue,Ue,Ze,Qe,Ge,Je,Xe,Ke,He,$e,tt,et){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.waitForClick=()=>new Promise(nt=>{document.addEventListener("click",async()=>{const it=await this.requestMotionPermission();nt(it)},{once:!0})}),this.deviceMotionListener=nt=>{if(nt.accelerationIncludingGravity){const it={x:nt.accelerationIncludingGravity.x,y:nt.accelerationIncludingGravity.y,z:nt.accelerationIncludingGravity.z};this.checkFields(it)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,it))}if(nt.acceleration){const it={x:nt.acceleration.x,y:nt.acceleration.y,z:nt.acceleration.z};this.checkFields(it)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,it))}if(nt.rotationRate){const it={x:nt.rotationRate.alpha,y:nt.rotationRate.beta,z:nt.rotationRate.gamma};this.checkFields(it)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,it))}},this.deviceOrientationListener=nt=>{const it={x:nt.alpha,y:nt.beta,z:nt.gamma};this.checkFields(it)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,it))},this.accThreshold_=ue,this.gyroThreshold_=Ue,this.accGrOldThreshold_=Ze,this.accOldThreshold_=Qe,this.gyroscopeOldThreshold_=Ge,this.orientationOldThreshold_=Je,this.maeAccThreshold_=Xe,this.maeGyroThreshold_=Ke,this.maeAccGrOldThreshold_=He,this.maeAccOldThreshold_=$e,this.maeGyroscopeOldThreshold_=tt,this.maeOrientationOldThreshold_=et}async requestMotionPermission(){DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"&&DeviceMotionEvent.requestPermission().then(ue=>{ue!=="granted"&&(this.permission_=!1)}).catch(console.error)}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const ue={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(ue)&&this.updateParams(this.paramsAcc_,ue)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const ue={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(ue)&&this.updateParams(this.paramsGyro_,ue)}}check(){if(!this.permission_)return"UNCLEAR";const ue=this.checkStability();return ue===null?"UNCLEAR":ue?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const Ue=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(Xe=>Xe!==null),Ze=Ue.length>0?Ue.every(Xe=>Xe):null,Ge=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(Xe=>Xe!==null),Je=Ge.length>0?Ge.every(Xe=>Xe):null;return Ze===null?Je===null?null:Je:Je!==null?Ze&&Je:Ze}updateParams(ue,Ue){const Ze=Ue.x-ue.meanX,Qe=Ue.y-ue.meanY,Ge=Ue.z-ue.meanZ;ue.meanX+=Ze/ue.ptsNum,ue.meanY+=Qe/ue.ptsNum,ue.meanZ+=Ge/ue.ptsNum,ue.m2X+=Ze*(Ue.x-ue.meanX),ue.m2Y+=Qe*(Ue.y-ue.meanY),ue.m2Z+=Ge*(Ue.z-ue.meanZ),ue.cumulativeAbsErrorX+=Math.abs(Ue.x-ue.meanX),ue.cumulativeAbsErrorY+=Math.abs(Ue.y-ue.meanY),ue.cumulativeAbsErrorZ+=Math.abs(Ue.z-ue.meanZ)}calculateStd(ue){const Ue={x:ue.m2X/ue.ptsNum,y:ue.m2Y/ue.ptsNum,z:ue.m2Z/ue.ptsNum};return{x:Math.sqrt(Ue.x),y:Math.sqrt(Ue.y),z:Math.sqrt(Ue.z)}}calculateMae(ue){return{x:ue.cumulativeAbsErrorX/ue.ptsNum,y:ue.cumulativeAbsErrorY/ue.ptsNum,z:ue.cumulativeAbsErrorZ/ue.ptsNum}}checkFields(ue){return ue.x!==null&&ue.y!==null&&ue.z!==null}isBelowStdThreshold(ue,Ue){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ze=this.calculateStd(ue);return Ze.x<Ue&&Ze.y<Ue&&Ze.z<Ue}isBelowMaeThreshold(ue,Ue){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ze=this.calculateMae(ue);return Ze.x<Ue&&Ze.y<Ue&&Ze.z<Ue}}class OnboardingAnalytics{constructor(){this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.isVirtualCameraDetectedByLabel=!1,this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setSimdIsEnabled(ue){this.simdIsEnabled=ue}setWasmVersion(ue){this.wasmVersion=ue}setProfiles(ue){this.profiles=ue}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}async analyzeFrame(ue){const Ue=await base64ToImageData(ue);await MlWasmJSApi$1.analyzeFrame(Ue),this.updatePipelineStats()}async checkForVirtualCameraByLabel(ue=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!ue){const Ze=await getDeviceCapabilities();for(const Qe of Object.keys(Ze)){const Ge=Ze[Qe];if(MlWasmJSApi$1.isVirtualCamera(Ge==null?void 0:Ge.label)){const Je={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Je}}}const Ue=getChosenCameraInfo(ue);if(MlWasmJSApi$1.isVirtualCamera(Ue==null?void 0:Ue.label)){const Ze={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Ze}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(Ue){console.log(`Exception: ${Ue}`)}return null}async startOnboardingCheck(){this.motionStatusCheck.start()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}updatePipelineStats(){if(MlWasmJSApi$1.isInitialized())try{const ue=MlWasmJSApi$1.getPipelineState();if(ue!==""){const Ue=JSON.parse(ue);this.analysisStatus=Ue.statsAnalysisStatus,Ue.profiles=Array.from(this.profiles.values()).map(Ze=>PipelineProfileName[Ze.name]),Ue.estimatedPerformance=this.estimatedPerformance,Ue.simdIsEnabled=this.simdIsEnabled,Ue.wasmVersion=this.wasmVersion,this.pipelineLogs=Ue,this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check())}}catch(ue){console.error(`Exception: ${ue}`)}}}const OnboardingAnalytics$1=OnboardingAnalytics.getInstance();var define_import_meta_env_default={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"1.76.1",PROD:!0,SSR:!1};class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(),this.setupDetectPromise)}getProfiles(){return this.profiles}getProfile(ue){var Ue;return((Ue=this.profiles)==null?void 0:Ue.get(ue))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(ue=>setTimeout(ue,100))}async _runSetupDetect(){var Qe,Ge;if(this.isSetupDetect)return;addEvent({token:(Qe=state.token)==null?void 0:Qe.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const ue=getInitializationParams(options.hostingApp==="Incode ID");this.profiles=ue.profiles,OnboardingAnalytics$1.setProfiles(this.profiles),OnboardingAnalytics$1.startOnboardingCheck();const Ue=await MlWasmJSApi$1.initialize(ue.wasmModulePath,ue.wasmSimdModulePath,ue.glueCodePath,ue.enableSIMD,ue.versionsFilePath,ue.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise(Je=>setTimeout(Je,100));OnboardingAnalytics$1.estimatePerformance(),OnboardingAnalytics$1.setWasmVersion(ue.wasmVersion),OnboardingAnalytics$1.setSimdIsEnabled(Ue),await MlWasmJSApi$1.initializePipelines();const Ze=define_import_meta_env_default.VITE_WASM_PRODUCTION_MODE==="true";try{await MlWasmJSApi$1.setProductionMode(Ze)}catch(Je){console.error(`Exception: ${Je}`)}this.isSetupDetect=!0,addEvent({token:(Ge=state.token)==null?void 0:Ge.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$a(me){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$a(me)}function _classCallCheck$m(me,ue){if(!(me instanceof ue))throw new TypeError("Cannot call a class as a function")}function toPrimitive(me,ue){if(_typeof$a(me)!="object"||!me)return me;var Ue=me[Symbol.toPrimitive];if(Ue!==void 0){var Ze=Ue.call(me,ue||"default");if(_typeof$a(Ze)!="object")return Ze;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ue==="string"?String:Number)(me)}function toPropertyKey(me){var ue=toPrimitive(me,"string");return _typeof$a(ue)=="symbol"?ue:String(ue)}function _defineProperties$9(me,ue){for(var Ue=0;Ue<ue.length;Ue++){var Ze=ue[Ue];Ze.enumerable=Ze.enumerable||!1,Ze.configurable=!0,"value"in Ze&&(Ze.writable=!0),Object.defineProperty(me,toPropertyKey(Ze.key),Ze)}}function _createClass$l(me,ue,Ue){return ue&&_defineProperties$9(me.prototype,ue),Ue&&_defineProperties$9(me,Ue),Object.defineProperty(me,"prototype",{writable:!1}),me}function _assertThisInitialized$1(me){if(me===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return me}function _setPrototypeOf$1(me,ue){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,Qe){return Ze.__proto__=Qe,Ze},_setPrototypeOf$1(me,ue)}function _inherits$c(me,ue){if(typeof ue!="function"&&ue!==null)throw new TypeError("Super expression must either be null or a function");me.prototype=Object.create(ue&&ue.prototype,{constructor:{value:me,writable:!0,configurable:!0}}),Object.defineProperty(me,"prototype",{writable:!1}),ue&&_setPrototypeOf$1(me,ue)}function _possibleConstructorReturn$c(me,ue){if(ue&&(_typeof$a(ue)==="object"||typeof ue=="function"))return ue;if(ue!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(me)}function _getPrototypeOf$1(me){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ue){return Ue.__proto__||Object.getPrototypeOf(Ue)},_getPrototypeOf$1(me)}function _defineProperty$6(me,ue,Ue){return ue=toPropertyKey(ue),ue in me?Object.defineProperty(me,ue,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):me[ue]=Ue,me}function _arrayWithHoles$3(me){if(Array.isArray(me))return me}function _iterableToArray(me){if(typeof Symbol<"u"&&me[Symbol.iterator]!=null||me["@@iterator"]!=null)return Array.from(me)}function _arrayLikeToArray$b(me,ue){(ue==null||ue>me.length)&&(ue=me.length);for(var Ue=0,Ze=new Array(ue);Ue<ue;Ue++)Ze[Ue]=me[Ue];return Ze}function _unsupportedIterableToArray$b(me,ue){if(me){if(typeof me=="string")return _arrayLikeToArray$b(me,ue);var Ue=Object.prototype.toString.call(me).slice(8,-1);if(Ue==="Object"&&me.constructor&&(Ue=me.constructor.name),Ue==="Map"||Ue==="Set")return Array.from(me);if(Ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ue))return _arrayLikeToArray$b(me,ue)}}function _nonIterableRest$3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
81
81
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _toArray(me){return _arrayWithHoles$3(me)||_iterableToArray(me)||_unsupportedIterableToArray$b(me)||_nonIterableRest$3()}function ownKeys$8(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$8(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$8(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$8(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}var consoleLogger={type:"logger",log:function(ue){this.output("log",ue)},warn:function(ue){this.output("warn",ue)},error:function(ue){this.output("error",ue)},output:function(ue,Ue){console&&console[ue]&&console[ue].apply(console,Ue)}},Logger=function(){function me(ue){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,me),this.init(ue,Ue)}return _createClass$l(me,[{key:"init",value:function(Ue){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=Ze.prefix||"i18next:",this.logger=Ue||consoleLogger,this.options=Ze,this.debug=Ze.debug}},{key:"setDebug",value:function(Ue){this.debug=Ue}},{key:"log",value:function(){for(var Ue=arguments.length,Ze=new Array(Ue),Qe=0;Qe<Ue;Qe++)Ze[Qe]=arguments[Qe];return this.forward(Ze,"log","",!0)}},{key:"warn",value:function(){for(var Ue=arguments.length,Ze=new Array(Ue),Qe=0;Qe<Ue;Qe++)Ze[Qe]=arguments[Qe];return this.forward(Ze,"warn","",!0)}},{key:"error",value:function(){for(var Ue=arguments.length,Ze=new Array(Ue),Qe=0;Qe<Ue;Qe++)Ze[Qe]=arguments[Qe];return this.forward(Ze,"error","")}},{key:"deprecate",value:function(){for(var Ue=arguments.length,Ze=new Array(Ue),Qe=0;Qe<Ue;Qe++)Ze[Qe]=arguments[Qe];return this.forward(Ze,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(Ue,Ze,Qe,Ge){return Ge&&!this.debug?null:(typeof Ue[0]=="string"&&(Ue[0]="".concat(Qe).concat(this.prefix," ").concat(Ue[0])),this.logger[Ze](Ue))}},{key:"create",value:function(Ue){return new me(this.logger,_objectSpread$8(_objectSpread$8({},{prefix:"".concat(this.prefix,":").concat(Ue,":")}),this.options))}},{key:"clone",value:function(Ue){return Ue=Ue||this.options,Ue.prefix=Ue.prefix||this.prefix,new me(this.logger,Ue)}}]),me}(),baseLogger=new Logger,EventEmitter$6=function(){function me(){_classCallCheck$m(this,me),this.observers={}}return _createClass$l(me,[{key:"on",value:function(Ue,Ze){var Qe=this;return Ue.split(" ").forEach(function(Ge){Qe.observers[Ge]=Qe.observers[Ge]||[],Qe.observers[Ge].push(Ze)}),this}},{key:"off",value:function(Ue,Ze){if(this.observers[Ue]){if(!Ze){delete this.observers[Ue];return}this.observers[Ue]=this.observers[Ue].filter(function(Qe){return Qe!==Ze})}}},{key:"emit",value:function(Ue){for(var Ze=arguments.length,Qe=new Array(Ze>1?Ze-1:0),Ge=1;Ge<Ze;Ge++)Qe[Ge-1]=arguments[Ge];if(this.observers[Ue]){var Je=[].concat(this.observers[Ue]);Je.forEach(function(Ke){Ke.apply(void 0,Qe)})}if(this.observers["*"]){var Xe=[].concat(this.observers["*"]);Xe.forEach(function(Ke){Ke.apply(Ke,[Ue].concat(Qe))})}}}]),me}();function defer(){var me,ue,Ue=new Promise(function(Ze,Qe){me=Ze,ue=Qe});return Ue.resolve=me,Ue.reject=ue,Ue}function makeString(me){return me==null?"":""+me}function copy(me,ue,Ue){me.forEach(function(Ze){ue[Ze]&&(Ue[Ze]=ue[Ze])})}function getLastOfPath(me,ue,Ue){function Ze(Xe){return Xe&&Xe.indexOf("###")>-1?Xe.replace(/###/g,"."):Xe}function Qe(){return!me||typeof me=="string"}for(var Ge=typeof ue!="string"?[].concat(ue):ue.split(".");Ge.length>1;){if(Qe())return{};var Je=Ze(Ge.shift());!me[Je]&&Ue&&(me[Je]=new Ue),Object.prototype.hasOwnProperty.call(me,Je)?me=me[Je]:me={}}return Qe()?{}:{obj:me,k:Ze(Ge.shift())}}function setPath(me,ue,Ue){var Ze=getLastOfPath(me,ue,Object),Qe=Ze.obj,Ge=Ze.k;Qe[Ge]=Ue}function pushPath(me,ue,Ue,Ze){var Qe=getLastOfPath(me,ue,Object),Ge=Qe.obj,Je=Qe.k;Ge[Je]=Ge[Je]||[],Ge[Je].push(Ue)}function getPath$1(me,ue){var Ue=getLastOfPath(me,ue),Ze=Ue.obj,Qe=Ue.k;if(Ze)return Ze[Qe]}function getPathWithDefaults(me,ue,Ue){var Ze=getPath$1(me,Ue);return Ze!==void 0?Ze:getPath$1(ue,Ue)}function deepExtend(me,ue,Ue){for(var Ze in ue)Ze!=="__proto__"&&Ze!=="constructor"&&(Ze in me?typeof me[Ze]=="string"||me[Ze]instanceof String||typeof ue[Ze]=="string"||ue[Ze]instanceof String?Ue&&(me[Ze]=ue[Ze]):deepExtend(me[Ze],ue[Ze],Ue):me[Ze]=ue[Ze]);return me}function regexEscape(me){return me.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape$1(me){return typeof me=="string"?me.replace(/[&<>"'\/]/g,function(ue){return _entityMap[ue]}):me}var isIE10=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars=[" ",",","?","!",";"];function looksLikeObjectPath(me,ue,Ue){ue=ue||"",Ue=Ue||"";var Ze=chars.filter(function(Xe){return ue.indexOf(Xe)<0&&Ue.indexOf(Xe)<0});if(Ze.length===0)return!0;var Qe=new RegExp("(".concat(Ze.map(function(Xe){return Xe==="?"?"\\?":Xe}).join("|"),")")),Ge=!Qe.test(me);if(!Ge){var Je=me.indexOf(Ue);Je>0&&!Qe.test(me.substring(0,Je))&&(Ge=!0)}return Ge}function ownKeys$1$1(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$1$1(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$1$1(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$1$1(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}function _createSuper$1(me){var ue=_isNativeReflectConstruct$1();return function(){var Ze=_getPrototypeOf$1(me),Qe;if(ue){var Ge=_getPrototypeOf$1(this).constructor;Qe=Reflect.construct(Ze,arguments,Ge)}else Qe=Ze.apply(this,arguments);return _possibleConstructorReturn$c(this,Qe)}}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function deepFind(me,ue){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(me){if(me[ue])return me[ue];for(var Ze=ue.split(Ue),Qe=me,Ge=0;Ge<Ze.length;++Ge){if(!Qe||typeof Qe[Ze[Ge]]=="string"&&Ge+1<Ze.length)return;if(Qe[Ze[Ge]]===void 0){for(var Je=2,Xe=Ze.slice(Ge,Ge+Je).join(Ue),Ke=Qe[Xe];Ke===void 0&&Ze.length>Ge+Je;)Je++,Xe=Ze.slice(Ge,Ge+Je).join(Ue),Ke=Qe[Xe];if(Ke===void 0)return;if(Ke===null)return null;if(ue.endsWith(Xe)){if(typeof Ke=="string")return Ke;if(Xe&&typeof Ke[Xe]=="string")return Ke[Xe]}var He=Ze.slice(Ge+Je).join(Ue);return He?deepFind(Ke,He,Ue):void 0}Qe=Qe[Ze[Ge]]}return Qe}}var ResourceStore=function(me){_inherits$c(Ue,me);var ue=_createSuper$1(Ue);function Ue(Ze){var Qe,Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck$m(this,Ue),Qe=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(Qe)),Qe.data=Ze||{},Qe.options=Ge,Qe.options.keySeparator===void 0&&(Qe.options.keySeparator="."),Qe.options.ignoreJSONStructure===void 0&&(Qe.options.ignoreJSONStructure=!0),Qe}return _createClass$l(Ue,[{key:"addNamespaces",value:function(Qe){this.options.ns.indexOf(Qe)<0&&this.options.ns.push(Qe)}},{key:"removeNamespaces",value:function(Qe){var Ge=this.options.ns.indexOf(Qe);Ge>-1&&this.options.ns.splice(Ge,1)}},{key:"getResource",value:function(Qe,Ge,Je){var Xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ke=Xe.keySeparator!==void 0?Xe.keySeparator:this.options.keySeparator,He=Xe.ignoreJSONStructure!==void 0?Xe.ignoreJSONStructure:this.options.ignoreJSONStructure,$e=[Qe,Ge];Je&&typeof Je!="string"&&($e=$e.concat(Je)),Je&&typeof Je=="string"&&($e=$e.concat(Ke?Je.split(Ke):Je)),Qe.indexOf(".")>-1&&($e=Qe.split("."));var tt=getPath$1(this.data,$e);return tt||!He||typeof Je!="string"?tt:deepFind(this.data&&this.data[Qe]&&this.data[Qe][Ge],Je,Ke)}},{key:"addResource",value:function(Qe,Ge,Je,Xe){var Ke=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},He=this.options.keySeparator;He===void 0&&(He=".");var $e=[Qe,Ge];Je&&($e=$e.concat(He?Je.split(He):Je)),Qe.indexOf(".")>-1&&($e=Qe.split("."),Xe=Ge,Ge=$e[1]),this.addNamespaces(Ge),setPath(this.data,$e,Xe),Ke.silent||this.emit("added",Qe,Ge,Je,Xe)}},{key:"addResources",value:function(Qe,Ge,Je){var Xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var Ke in Je)(typeof Je[Ke]=="string"||Object.prototype.toString.apply(Je[Ke])==="[object Array]")&&this.addResource(Qe,Ge,Ke,Je[Ke],{silent:!0});Xe.silent||this.emit("added",Qe,Ge,Je)}},{key:"addResourceBundle",value:function(Qe,Ge,Je,Xe,Ke){var He=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},$e=[Qe,Ge];Qe.indexOf(".")>-1&&($e=Qe.split("."),Xe=Je,Je=Ge,Ge=$e[1]),this.addNamespaces(Ge);var tt=getPath$1(this.data,$e)||{};Xe?deepExtend(tt,Je,Ke):tt=_objectSpread$1$1(_objectSpread$1$1({},tt),Je),setPath(this.data,$e,tt),He.silent||this.emit("added",Qe,Ge,Je)}},{key:"removeResourceBundle",value:function(Qe,Ge){this.hasResourceBundle(Qe,Ge)&&delete this.data[Qe][Ge],this.removeNamespaces(Ge),this.emit("removed",Qe,Ge)}},{key:"hasResourceBundle",value:function(Qe,Ge){return this.getResource(Qe,Ge)!==void 0}},{key:"getResourceBundle",value:function(Qe,Ge){return Ge||(Ge=this.options.defaultNS),this.options.compatibilityAPI==="v1"?_objectSpread$1$1(_objectSpread$1$1({},{}),this.getResource(Qe,Ge)):this.getResource(Qe,Ge)}},{key:"getDataByLanguage",value:function(Qe){return this.data[Qe]}},{key:"hasLanguageSomeTranslations",value:function(Qe){var Ge=this.getDataByLanguage(Qe),Je=Ge&&Object.keys(Ge)||[];return!!Je.find(function(Xe){return Ge[Xe]&&Object.keys(Ge[Xe]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),Ue}(EventEmitter$6),postProcessor={processors:{},addPostProcessor:function(ue){this.processors[ue.name]=ue},handle:function(ue,Ue,Ze,Qe,Ge){var Je=this;return ue.forEach(function(Xe){Je.processors[Xe]&&(Ue=Je.processors[Xe].process(Ue,Ze,Qe,Ge))}),Ue}};function ownKeys$2$1(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$2$1(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$2$1(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$2$1(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}function _createSuper$1$1(me){var ue=_isNativeReflectConstruct$1$1();return function(){var Ze=_getPrototypeOf$1(me),Qe;if(ue){var Ge=_getPrototypeOf$1(this).constructor;Qe=Reflect.construct(Ze,arguments,Ge)}else Qe=Ze.apply(this,arguments);return _possibleConstructorReturn$c(this,Qe)}}function _isNativeReflectConstruct$1$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var checkedLoadedFor={},Translator=function(me){_inherits$c(Ue,me);var ue=_createSuper$1$1(Ue);function Ue(Ze){var Qe,Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _classCallCheck$m(this,Ue),Qe=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(Qe)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],Ze,_assertThisInitialized$1(Qe)),Qe.options=Ge,Qe.options.keySeparator===void 0&&(Qe.options.keySeparator="."),Qe.logger=baseLogger.create("translator"),Qe}return _createClass$l(Ue,[{key:"changeLanguage",value:function(Qe){Qe&&(this.language=Qe)}},{key:"exists",value:function(Qe){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(Qe==null)return!1;var Je=this.resolve(Qe,Ge);return Je&&Je.res!==void 0}},{key:"extractFromKey",value:function(Qe,Ge){var Je=Ge.nsSeparator!==void 0?Ge.nsSeparator:this.options.nsSeparator;Je===void 0&&(Je=":");var Xe=Ge.keySeparator!==void 0?Ge.keySeparator:this.options.keySeparator,Ke=Ge.ns||this.options.defaultNS||[],He=Je&&Qe.indexOf(Je)>-1,$e=!this.options.userDefinedKeySeparator&&!Ge.keySeparator&&!this.options.userDefinedNsSeparator&&!Ge.nsSeparator&&!looksLikeObjectPath(Qe,Je,Xe);if(He&&!$e){var tt=Qe.match(this.interpolator.nestingRegexp);if(tt&&tt.length>0)return{key:Qe,namespaces:Ke};var et=Qe.split(Je);(Je!==Xe||Je===Xe&&this.options.ns.indexOf(et[0])>-1)&&(Ke=et.shift()),Qe=et.join(Xe)}return typeof Ke=="string"&&(Ke=[Ke]),{key:Qe,namespaces:Ke}}},{key:"translate",value:function(Qe,Ge,Je){var Xe=this;if(_typeof$a(Ge)!=="object"&&this.options.overloadTranslationOptionHandler&&(Ge=this.options.overloadTranslationOptionHandler(arguments)),Ge||(Ge={}),Qe==null)return"";Array.isArray(Qe)||(Qe=[String(Qe)]);var Ke=Ge.returnDetails!==void 0?Ge.returnDetails:this.options.returnDetails,He=Ge.keySeparator!==void 0?Ge.keySeparator:this.options.keySeparator,$e=this.extractFromKey(Qe[Qe.length-1],Ge),tt=$e.key,et=$e.namespaces,nt=et[et.length-1],it=Ge.lng||this.language,at=Ge.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(it&&it.toLowerCase()==="cimode"){if(at){var st=Ge.nsSeparator||this.options.nsSeparator;return Ke?(rt.res="".concat(nt).concat(st).concat(tt),rt):"".concat(nt).concat(st).concat(tt)}return Ke?(rt.res=tt,rt):tt}var rt=this.resolve(Qe,Ge),ot=rt&&rt.res,lt=rt&&rt.usedKey||tt,dt=rt&&rt.exactUsedKey||tt,ut=Object.prototype.toString.apply(ot),Ut=["[object Number]","[object Function]","[object RegExp]"],ht=Ge.joinArrays!==void 0?Ge.joinArrays:this.options.joinArrays,pt=!this.i18nFormat||this.i18nFormat.handleAsObject,Vt=typeof ot!="string"&&typeof ot!="boolean"&&typeof ot!="number";if(pt&&ot&&Vt&&Ut.indexOf(ut)<0&&!(typeof ht=="string"&&ut==="[object Array]")){if(!Ge.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var Tt=this.options.returnedObjectHandler?this.options.returnedObjectHandler(lt,ot,_objectSpread$2$1(_objectSpread$2$1({},Ge),{},{ns:et})):"key '".concat(tt," (").concat(this.language,")' returned an object instead of string.");return Ke?(rt.res=Tt,rt):Tt}if(He){var yt=ut==="[object Array]",Nt=yt?[]:{},Zt=yt?dt:lt;for(var mt in ot)if(Object.prototype.hasOwnProperty.call(ot,mt)){var Qt="".concat(Zt).concat(He).concat(mt);Nt[mt]=this.translate(Qt,_objectSpread$2$1(_objectSpread$2$1({},Ge),{joinArrays:!1,ns:et})),Nt[mt]===Qt&&(Nt[mt]=ot[mt])}ot=Nt}}else if(pt&&typeof ht=="string"&&ut==="[object Array]")ot=ot.join(ht),ot&&(ot=this.extendTranslation(ot,Qe,Ge,Je));else{var ft=!1,Rt=!1,gt=Ge.count!==void 0&&typeof Ge.count!="string",Ct=Ue.hasDefaultValue(Ge),St=gt?this.pluralResolver.getSuffix(it,Ge.count,Ge):"",xt=Ge["defaultValue".concat(St)]||Ge.defaultValue;!this.isValidLookup(ot)&&Ct&&(ft=!0,ot=xt),this.isValidLookup(ot)||(Rt=!0,ot=tt);var Dt=Ge.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Bt=Dt&&Rt?void 0:ot,Lt=Ct&&xt!==ot&&this.options.updateMissing;if(Rt||ft||Lt){if(this.logger.log(Lt?"updateKey":"missingKey",it,nt,tt,Lt?xt:ot),He){var zt=this.resolve(tt,_objectSpread$2$1(_objectSpread$2$1({},Ge),{},{keySeparator:!1}));zt&&zt.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Mt=[],_t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,Ge.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_t&&_t[0])for(var Kt=0;Kt<_t.length;Kt++)Mt.push(_t[Kt]);else this.options.saveMissingTo==="all"?Mt=this.languageUtils.toResolveHierarchy(Ge.lng||this.language):Mt.push(Ge.lng||this.language);var Jt=function(At,Ft,It){var Gt=Ct&&It!==ot?It:Bt;Xe.options.missingKeyHandler?Xe.options.missingKeyHandler(At,nt,Ft,Gt,Lt,Ge):Xe.backendConnector&&Xe.backendConnector.saveMissing&&Xe.backendConnector.saveMissing(At,nt,Ft,Gt,Lt,Ge),Xe.emit("missingKey",At,nt,Ft,ot)};this.options.saveMissing&&(this.options.saveMissingPlurals&>?Mt.forEach(function(wt){Xe.pluralResolver.getSuffixes(wt,Ge).forEach(function(At){Jt([wt],tt+At,Ge["defaultValue".concat(At)]||xt)})}):Jt(Mt,tt,xt))}ot=this.extendTranslation(ot,Qe,Ge,rt,Je),Rt&&ot===tt&&this.options.appendNamespaceToMissingKey&&(ot="".concat(nt,":").concat(tt)),(Rt||ft)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?ot=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(nt,":").concat(tt):tt,ft?ot:void 0):ot=this.options.parseMissingKeyHandler(ot))}return Ke?(rt.res=ot,rt):ot}},{key:"extendTranslation",value:function(Qe,Ge,Je,Xe,Ke){var He=this;if(this.i18nFormat&&this.i18nFormat.parse)Qe=this.i18nFormat.parse(Qe,_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),Je),Xe.usedLng,Xe.usedNS,Xe.usedKey,{resolved:Xe});else if(!Je.skipInterpolation){Je.interpolation&&this.interpolator.init(_objectSpread$2$1(_objectSpread$2$1({},Je),{interpolation:_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation),Je.interpolation)}));var $e=typeof Qe=="string"&&(Je&&Je.interpolation&&Je.interpolation.skipOnVariables!==void 0?Je.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),tt;if($e){var et=Qe.match(this.interpolator.nestingRegexp);tt=et&&et.length}var nt=Je.replace&&typeof Je.replace!="string"?Je.replace:Je;if(this.options.interpolation.defaultVariables&&(nt=_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),nt)),Qe=this.interpolator.interpolate(Qe,nt,Je.lng||this.language,Je),$e){var it=Qe.match(this.interpolator.nestingRegexp),at=it&&it.length;tt<at&&(Je.nest=!1)}Je.nest!==!1&&(Qe=this.interpolator.nest(Qe,function(){for(var ot=arguments.length,lt=new Array(ot),dt=0;dt<ot;dt++)lt[dt]=arguments[dt];return Ke&&Ke[0]===lt[0]&&!Je.context?(He.logger.warn("It seems you are nesting recursively key: ".concat(lt[0]," in key: ").concat(Ge[0])),null):He.translate.apply(He,lt.concat([Ge]))},Je)),Je.interpolation&&this.interpolator.reset()}var st=Je.postProcess||this.options.postProcess,rt=typeof st=="string"?[st]:st;return Qe!=null&&rt&&rt.length&&Je.applyPostProcessor!==!1&&(Qe=postProcessor.handle(rt,Qe,Ge,this.options&&this.options.postProcessPassResolved?_objectSpread$2$1({i18nResolved:Xe},Je):Je,this)),Qe}},{key:"resolve",value:function(Qe){var Ge=this,Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Xe,Ke,He,$e,tt;return typeof Qe=="string"&&(Qe=[Qe]),Qe.forEach(function(et){if(!Ge.isValidLookup(Xe)){var nt=Ge.extractFromKey(et,Je),it=nt.key;Ke=it;var at=nt.namespaces;Ge.options.fallbackNS&&(at=at.concat(Ge.options.fallbackNS));var st=Je.count!==void 0&&typeof Je.count!="string",rt=st&&!Je.ordinal&&Je.count===0&&Ge.pluralResolver.shouldUseIntlApi(),ot=Je.context!==void 0&&(typeof Je.context=="string"||typeof Je.context=="number")&&Je.context!=="",lt=Je.lngs?Je.lngs:Ge.languageUtils.toResolveHierarchy(Je.lng||Ge.language,Je.fallbackLng);at.forEach(function(dt){Ge.isValidLookup(Xe)||(tt=dt,!checkedLoadedFor["".concat(lt[0],"-").concat(dt)]&&Ge.utils&&Ge.utils.hasLoadedNamespace&&!Ge.utils.hasLoadedNamespace(tt)&&(checkedLoadedFor["".concat(lt[0],"-").concat(dt)]=!0,Ge.logger.warn('key "'.concat(Ke,'" for languages "').concat(lt.join(", "),`" won't get resolved as namespace "`).concat(tt,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),lt.forEach(function(ut){if(!Ge.isValidLookup(Xe)){$e=ut;var Ut=[it];if(Ge.i18nFormat&&Ge.i18nFormat.addLookupKeys)Ge.i18nFormat.addLookupKeys(Ut,it,ut,dt,Je);else{var ht;st&&(ht=Ge.pluralResolver.getSuffix(ut,Je.count,Je));var pt="".concat(Ge.options.pluralSeparator,"zero");if(st&&(Ut.push(it+ht),rt&&Ut.push(it+pt)),ot){var Vt="".concat(it).concat(Ge.options.contextSeparator).concat(Je.context);Ut.push(Vt),st&&(Ut.push(Vt+ht),rt&&Ut.push(Vt+pt))}}for(var Tt;Tt=Ut.pop();)Ge.isValidLookup(Xe)||(He=Tt,Xe=Ge.getResource(ut,dt,Tt,Je))}}))})}}),{res:Xe,usedKey:Ke,exactUsedKey:He,usedLng:$e,usedNS:tt}}},{key:"isValidLookup",value:function(Qe){return Qe!==void 0&&!(!this.options.returnNull&&Qe===null)&&!(!this.options.returnEmptyString&&Qe==="")}},{key:"getResource",value:function(Qe,Ge,Je){var Xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(Qe,Ge,Je,Xe):this.resourceStore.getResource(Qe,Ge,Je,Xe)}}],[{key:"hasDefaultValue",value:function(Qe){var Ge="defaultValue";for(var Je in Qe)if(Object.prototype.hasOwnProperty.call(Qe,Je)&&Ge===Je.substring(0,Ge.length)&&Qe[Je]!==void 0)return!0;return!1}}]),Ue}(EventEmitter$6);function capitalize(me){return me.charAt(0).toUpperCase()+me.slice(1)}var LanguageUtil=function(){function me(ue){_classCallCheck$m(this,me),this.options=ue,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass$l(me,[{key:"getScriptPartFromCode",value:function(Ue){if(!Ue||Ue.indexOf("-")<0)return null;var Ze=Ue.split("-");return Ze.length===2||(Ze.pop(),Ze[Ze.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(Ze.join("-"))}},{key:"getLanguagePartFromCode",value:function(Ue){if(!Ue||Ue.indexOf("-")<0)return Ue;var Ze=Ue.split("-");return this.formatLanguageCode(Ze[0])}},{key:"formatLanguageCode",value:function(Ue){if(typeof Ue=="string"&&Ue.indexOf("-")>-1){var Ze=["hans","hant","latn","cyrl","cans","mong","arab"],Qe=Ue.split("-");return this.options.lowerCaseLng?Qe=Qe.map(function(Ge){return Ge.toLowerCase()}):Qe.length===2?(Qe[0]=Qe[0].toLowerCase(),Qe[1]=Qe[1].toUpperCase(),Ze.indexOf(Qe[1].toLowerCase())>-1&&(Qe[1]=capitalize(Qe[1].toLowerCase()))):Qe.length===3&&(Qe[0]=Qe[0].toLowerCase(),Qe[1].length===2&&(Qe[1]=Qe[1].toUpperCase()),Qe[0]!=="sgn"&&Qe[2].length===2&&(Qe[2]=Qe[2].toUpperCase()),Ze.indexOf(Qe[1].toLowerCase())>-1&&(Qe[1]=capitalize(Qe[1].toLowerCase())),Ze.indexOf(Qe[2].toLowerCase())>-1&&(Qe[2]=capitalize(Qe[2].toLowerCase()))),Qe.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?Ue.toLowerCase():Ue}},{key:"isSupportedCode",value:function(Ue){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(Ue=this.getLanguagePartFromCode(Ue)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(Ue)>-1}},{key:"getBestMatchFromCodes",value:function(Ue){var Ze=this;if(!Ue)return null;var Qe;return Ue.forEach(function(Ge){if(!Qe){var Je=Ze.formatLanguageCode(Ge);(!Ze.options.supportedLngs||Ze.isSupportedCode(Je))&&(Qe=Je)}}),!Qe&&this.options.supportedLngs&&Ue.forEach(function(Ge){if(!Qe){var Je=Ze.getLanguagePartFromCode(Ge);if(Ze.isSupportedCode(Je))return Qe=Je;Qe=Ze.options.supportedLngs.find(function(Xe){if(Xe.indexOf(Je)===0)return Xe})}}),Qe||(Qe=this.getFallbackCodes(this.options.fallbackLng)[0]),Qe}},{key:"getFallbackCodes",value:function(Ue,Ze){if(!Ue)return[];if(typeof Ue=="function"&&(Ue=Ue(Ze)),typeof Ue=="string"&&(Ue=[Ue]),Object.prototype.toString.apply(Ue)==="[object Array]")return Ue;if(!Ze)return Ue.default||[];var Qe=Ue[Ze];return Qe||(Qe=Ue[this.getScriptPartFromCode(Ze)]),Qe||(Qe=Ue[this.formatLanguageCode(Ze)]),Qe||(Qe=Ue[this.getLanguagePartFromCode(Ze)]),Qe||(Qe=Ue.default),Qe||[]}},{key:"toResolveHierarchy",value:function(Ue,Ze){var Qe=this,Ge=this.getFallbackCodes(Ze||this.options.fallbackLng||[],Ue),Je=[],Xe=function(He){He&&(Qe.isSupportedCode(He)?Je.push(He):Qe.logger.warn("rejecting language code not found in supportedLngs: ".concat(He)))};return typeof Ue=="string"&&Ue.indexOf("-")>-1?(this.options.load!=="languageOnly"&&Xe(this.formatLanguageCode(Ue)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&Xe(this.getScriptPartFromCode(Ue)),this.options.load!=="currentOnly"&&Xe(this.getLanguagePartFromCode(Ue))):typeof Ue=="string"&&Xe(this.formatLanguageCode(Ue)),Ge.forEach(function(Ke){Je.indexOf(Ke)<0&&Xe(Qe.formatLanguageCode(Ke))}),Je}}]),me}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","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","kk","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","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","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","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(ue){return+(ue>1)},2:function(ue){return+(ue!=1)},3:function(ue){return 0},4:function(ue){return ue%10==1&&ue%100!=11?0:ue%10>=2&&ue%10<=4&&(ue%100<10||ue%100>=20)?1:2},5:function(ue){return ue==0?0:ue==1?1:ue==2?2:ue%100>=3&&ue%100<=10?3:ue%100>=11?4:5},6:function(ue){return ue==1?0:ue>=2&&ue<=4?1:2},7:function(ue){return ue==1?0:ue%10>=2&&ue%10<=4&&(ue%100<10||ue%100>=20)?1:2},8:function(ue){return ue==1?0:ue==2?1:ue!=8&&ue!=11?2:3},9:function(ue){return+(ue>=2)},10:function(ue){return ue==1?0:ue==2?1:ue<7?2:ue<11?3:4},11:function(ue){return ue==1||ue==11?0:ue==2||ue==12?1:ue>2&&ue<20?2:3},12:function(ue){return+(ue%10!=1||ue%100==11)},13:function(ue){return+(ue!==0)},14:function(ue){return ue==1?0:ue==2?1:ue==3?2:3},15:function(ue){return ue%10==1&&ue%100!=11?0:ue%10>=2&&(ue%100<10||ue%100>=20)?1:2},16:function(ue){return ue%10==1&&ue%100!=11?0:ue!==0?1:2},17:function(ue){return ue==1||ue%10==1&&ue%100!=11?0:1},18:function(ue){return ue==0?0:ue==1?1:2},19:function(ue){return ue==1?0:ue==0||ue%100>1&&ue%100<11?1:ue%100>10&&ue%100<20?2:3},20:function(ue){return ue==1?0:ue==0||ue%100>0&&ue%100<20?1:2},21:function(ue){return ue%100==1?1:ue%100==2?2:ue%100==3||ue%100==4?3:0},22:function(ue){return ue==1?0:ue==2?1:(ue<0||ue>10)&&ue%10==0?2:3}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var me={};return sets.forEach(function(ue){ue.lngs.forEach(function(Ue){me[Ue]={numbers:ue.nr,plurals:_rulesPluralsTypes[ue.fc]}})}),me}var PluralResolver=function(){function me(ue){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,me),this.languageUtils=ue,this.options=Ue,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass$l(me,[{key:"addRule",value:function(Ue,Ze){this.rules[Ue]=Ze}},{key:"getRule",value:function(Ue){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Ue,{type:Ze.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[Ue]||this.rules[this.languageUtils.getLanguagePartFromCode(Ue)]}},{key:"needsPlural",value:function(Ue){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=this.getRule(Ue,Ze);return this.shouldUseIntlApi()?Qe&&Qe.resolvedOptions().pluralCategories.length>1:Qe&&Qe.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(Ue,Ze){var Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(Ue,Qe).map(function(Ge){return"".concat(Ze).concat(Ge)})}},{key:"getSuffixes",value:function(Ue){var Ze=this,Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ge=this.getRule(Ue,Qe);return Ge?this.shouldUseIntlApi()?Ge.resolvedOptions().pluralCategories.sort(function(Je,Xe){return suffixesOrder[Je]-suffixesOrder[Xe]}).map(function(Je){return"".concat(Ze.options.prepend).concat(Je)}):Ge.numbers.map(function(Je){return Ze.getSuffix(Ue,Je,Qe)}):[]}},{key:"getSuffix",value:function(Ue,Ze){var Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ge=this.getRule(Ue,Qe);return Ge?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(Ge.select(Ze)):this.getSuffixRetroCompatible(Ge,Ze):(this.logger.warn("no plural rule found for: ".concat(Ue)),"")}},{key:"getSuffixRetroCompatible",value:function(Ue,Ze){var Qe=this,Ge=Ue.noAbs?Ue.plurals(Ze):Ue.plurals(Math.abs(Ze)),Je=Ue.numbers[Ge];this.options.simplifyPluralSuffix&&Ue.numbers.length===2&&Ue.numbers[0]===1&&(Je===2?Je="plural":Je===1&&(Je=""));var Xe=function(){return Qe.options.prepend&&Je.toString()?Qe.options.prepend+Je.toString():Je.toString()};return this.options.compatibilityJSON==="v1"?Je===1?"":typeof Je=="number"?"_plural_".concat(Je.toString()):Xe():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&Ue.numbers.length===2&&Ue.numbers[0]===1?Xe():this.options.prepend&&Ge.toString()?this.options.prepend+Ge.toString():Ge.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),me}();function ownKeys$3$1(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$3$1(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$3$1(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$3$1(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}var Interpolator=function(){function me(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,me),this.logger=baseLogger.create("interpolator"),this.options=ue,this.format=ue.interpolation&&ue.interpolation.format||function(Ue){return Ue},this.init(ue)}return _createClass$l(me,[{key:"init",value:function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ue.interpolation||(Ue.interpolation={escapeValue:!0});var Ze=Ue.interpolation;this.escape=Ze.escape!==void 0?Ze.escape:escape$1,this.escapeValue=Ze.escapeValue!==void 0?Ze.escapeValue:!0,this.useRawValueToEscape=Ze.useRawValueToEscape!==void 0?Ze.useRawValueToEscape:!1,this.prefix=Ze.prefix?regexEscape(Ze.prefix):Ze.prefixEscaped||"{{",this.suffix=Ze.suffix?regexEscape(Ze.suffix):Ze.suffixEscaped||"}}",this.formatSeparator=Ze.formatSeparator?Ze.formatSeparator:Ze.formatSeparator||",",this.unescapePrefix=Ze.unescapeSuffix?"":Ze.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":Ze.unescapeSuffix||"",this.nestingPrefix=Ze.nestingPrefix?regexEscape(Ze.nestingPrefix):Ze.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=Ze.nestingSuffix?regexEscape(Ze.nestingSuffix):Ze.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=Ze.nestingOptionsSeparator?Ze.nestingOptionsSeparator:Ze.nestingOptionsSeparator||",",this.maxReplaces=Ze.maxReplaces?Ze.maxReplaces:1e3,this.alwaysFormat=Ze.alwaysFormat!==void 0?Ze.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var Ue="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(Ue,"g");var Ze="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(Ze,"g");var Qe="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(Qe,"g")}},{key:"interpolate",value:function(Ue,Ze,Qe,Ge){var Je=this,Xe,Ke,He,$e=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function tt(st){return st.replace(/\$/g,"$$$$")}var et=function(rt){if(rt.indexOf(Je.formatSeparator)<0){var ot=getPathWithDefaults(Ze,$e,rt);return Je.alwaysFormat?Je.format(ot,void 0,Qe,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},Ge),Ze),{},{interpolationkey:rt})):ot}var lt=rt.split(Je.formatSeparator),dt=lt.shift().trim(),ut=lt.join(Je.formatSeparator).trim();return Je.format(getPathWithDefaults(Ze,$e,dt),ut,Qe,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},Ge),Ze),{},{interpolationkey:dt}))};this.resetRegExp();var nt=Ge&&Ge.missingInterpolationHandler||this.options.missingInterpolationHandler,it=Ge&&Ge.interpolation&&Ge.interpolation.skipOnVariables!==void 0?Ge.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,at=[{regex:this.regexpUnescape,safeValue:function(rt){return tt(rt)}},{regex:this.regexp,safeValue:function(rt){return Je.escapeValue?tt(Je.escape(rt)):tt(rt)}}];return at.forEach(function(st){for(He=0;Xe=st.regex.exec(Ue);){var rt=Xe[1].trim();if(Ke=et(rt),Ke===void 0)if(typeof nt=="function"){var ot=nt(Ue,Xe,Ge);Ke=typeof ot=="string"?ot:""}else if(Ge&&Ge.hasOwnProperty(rt))Ke="";else if(it){Ke=Xe[0];continue}else Je.logger.warn("missed to pass in variable ".concat(rt," for interpolating ").concat(Ue)),Ke="";else typeof Ke!="string"&&!Je.useRawValueToEscape&&(Ke=makeString(Ke));var lt=st.safeValue(Ke);if(Ue=Ue.replace(Xe[0],lt),it?(st.regex.lastIndex+=Ke.length,st.regex.lastIndex-=Xe[0].length):st.regex.lastIndex=0,He++,He>=Je.maxReplaces)break}}),Ue}},{key:"nest",value:function(Ue,Ze){var Qe=this,Ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Je,Xe,Ke=_objectSpread$3$1({},Ge);Ke.applyPostProcessor=!1,delete Ke.defaultValue;function He(nt,it){var at=this.nestingOptionsSeparator;if(nt.indexOf(at)<0)return nt;var st=nt.split(new RegExp("".concat(at,"[ ]*{"))),rt="{".concat(st[1]);nt=st[0],rt=this.interpolate(rt,Ke);var ot=rt.match(/'/g),lt=rt.match(/"/g);(ot&&ot.length%2===0&&!lt||lt.length%2!==0)&&(rt=rt.replace(/'/g,'"'));try{Ke=JSON.parse(rt),it&&(Ke=_objectSpread$3$1(_objectSpread$3$1({},it),Ke))}catch(dt){return this.logger.warn("failed parsing options string in nesting for key ".concat(nt),dt),"".concat(nt).concat(at).concat(rt)}return delete Ke.defaultValue,nt}for(;Je=this.nestingRegexp.exec(Ue);){var $e=[],tt=!1;if(Je[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(Je[1])){var et=Je[1].split(this.formatSeparator).map(function(nt){return nt.trim()});Je[1]=et.shift(),$e=et,tt=!0}if(Xe=Ze(He.call(this,Je[1].trim(),Ke),Ke),Xe&&Je[0]===Ue&&typeof Xe!="string")return Xe;typeof Xe!="string"&&(Xe=makeString(Xe)),Xe||(this.logger.warn("missed to resolve ".concat(Je[1]," for nesting ").concat(Ue)),Xe=""),tt&&(Xe=$e.reduce(function(nt,it){return Qe.format(nt,it,Ge.lng,_objectSpread$3$1(_objectSpread$3$1({},Ge),{},{interpolationkey:Je[1].trim()}))},Xe.trim())),Ue=Ue.replace(Je[0],Xe),this.regexp.lastIndex=0}return Ue}}]),me}();function ownKeys$4$1(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$4$1(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$4$1(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$4$1(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}function parseFormatStr(me){var ue=me.toLowerCase().trim(),Ue={};if(me.indexOf("(")>-1){var Ze=me.split("(");ue=Ze[0].toLowerCase().trim();var Qe=Ze[1].substring(0,Ze[1].length-1);if(ue==="currency"&&Qe.indexOf(":")<0)Ue.currency||(Ue.currency=Qe.trim());else if(ue==="relativetime"&&Qe.indexOf(":")<0)Ue.range||(Ue.range=Qe.trim());else{var Ge=Qe.split(";");Ge.forEach(function(Je){if(Je){var Xe=Je.split(":"),Ke=_toArray(Xe),He=Ke[0],$e=Ke.slice(1),tt=$e.join(":").trim().replace(/^'+|'+$/g,"");Ue[He.trim()]||(Ue[He.trim()]=tt),tt==="false"&&(Ue[He.trim()]=!1),tt==="true"&&(Ue[He.trim()]=!0),isNaN(tt)||(Ue[He.trim()]=parseInt(tt,10))}})}}return{formatName:ue,formatOptions:Ue}}function createCachedFormatter(me){var ue={};return function(Ze,Qe,Ge){var Je=Qe+JSON.stringify(Ge),Xe=ue[Je];return Xe||(Xe=me(Qe,Ge),ue[Je]=Xe),Xe(Ze)}}var Formatter$1=function(){function me(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,me),this.logger=baseLogger.create("formatter"),this.options=ue,this.formats={number:createCachedFormatter(function(Ue,Ze){var Qe=new Intl.NumberFormat(Ue,Ze);return function(Ge){return Qe.format(Ge)}}),currency:createCachedFormatter(function(Ue,Ze){var Qe=new Intl.NumberFormat(Ue,_objectSpread$4$1(_objectSpread$4$1({},Ze),{},{style:"currency"}));return function(Ge){return Qe.format(Ge)}}),datetime:createCachedFormatter(function(Ue,Ze){var Qe=new Intl.DateTimeFormat(Ue,_objectSpread$4$1({},Ze));return function(Ge){return Qe.format(Ge)}}),relativetime:createCachedFormatter(function(Ue,Ze){var Qe=new Intl.RelativeTimeFormat(Ue,_objectSpread$4$1({},Ze));return function(Ge){return Qe.format(Ge,Ze.range||"day")}}),list:createCachedFormatter(function(Ue,Ze){var Qe=new Intl.ListFormat(Ue,_objectSpread$4$1({},Ze));return function(Ge){return Qe.format(Ge)}})},this.init(ue)}return _createClass$l(me,[{key:"init",value:function(Ue){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},Qe=Ze.interpolation;this.formatSeparator=Qe.formatSeparator?Qe.formatSeparator:Qe.formatSeparator||","}},{key:"add",value:function(Ue,Ze){this.formats[Ue.toLowerCase().trim()]=Ze}},{key:"addCached",value:function(Ue,Ze){this.formats[Ue.toLowerCase().trim()]=createCachedFormatter(Ze)}},{key:"format",value:function(Ue,Ze,Qe,Ge){var Je=this,Xe=Ze.split(this.formatSeparator),Ke=Xe.reduce(function(He,$e){var tt=parseFormatStr($e),et=tt.formatName,nt=tt.formatOptions;if(Je.formats[et]){var it=He;try{var at=Ge&&Ge.formatParams&&Ge.formatParams[Ge.interpolationkey]||{},st=at.locale||at.lng||Ge.locale||Ge.lng||Qe;it=Je.formats[et](He,st,_objectSpread$4$1(_objectSpread$4$1(_objectSpread$4$1({},nt),Ge),at))}catch(rt){Je.logger.warn(rt)}return it}else Je.logger.warn("there was no format function for ".concat(et));return He},Ue);return Ke}}]),me}();function ownKeys$5$1(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$5$1(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$5$1(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$5$1(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}function _createSuper$2(me){var ue=_isNativeReflectConstruct$2();return function(){var Ze=_getPrototypeOf$1(me),Qe;if(ue){var Ge=_getPrototypeOf$1(this).constructor;Qe=Reflect.construct(Ze,arguments,Ge)}else Qe=Ze.apply(this,arguments);return _possibleConstructorReturn$c(this,Qe)}}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function removePending(me,ue){me.pending[ue]!==void 0&&(delete me.pending[ue],me.pendingCount--)}var Connector=function(me){_inherits$c(Ue,me);var ue=_createSuper$2(Ue);function Ue(Ze,Qe,Ge){var Je,Xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _classCallCheck$m(this,Ue),Je=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(Je)),Je.backend=Ze,Je.store=Qe,Je.services=Ge,Je.languageUtils=Ge.languageUtils,Je.options=Xe,Je.logger=baseLogger.create("backendConnector"),Je.waitingReads=[],Je.maxParallelReads=Xe.maxParallelReads||10,Je.readingCalls=0,Je.maxRetries=Xe.maxRetries>=0?Xe.maxRetries:5,Je.retryTimeout=Xe.retryTimeout>=1?Xe.retryTimeout:350,Je.state={},Je.queue=[],Je.backend&&Je.backend.init&&Je.backend.init(Ge,Xe.backend,Xe),Je}return _createClass$l(Ue,[{key:"queueLoad",value:function(Qe,Ge,Je,Xe){var Ke=this,He={},$e={},tt={},et={};return Qe.forEach(function(nt){var it=!0;Ge.forEach(function(at){var st="".concat(nt,"|").concat(at);!Je.reload&&Ke.store.hasResourceBundle(nt,at)?Ke.state[st]=2:Ke.state[st]<0||(Ke.state[st]===1?$e[st]===void 0&&($e[st]=!0):(Ke.state[st]=1,it=!1,$e[st]===void 0&&($e[st]=!0),He[st]===void 0&&(He[st]=!0),et[at]===void 0&&(et[at]=!0)))}),it||(tt[nt]=!0)}),(Object.keys(He).length||Object.keys($e).length)&&this.queue.push({pending:$e,pendingCount:Object.keys($e).length,loaded:{},errors:[],callback:Xe}),{toLoad:Object.keys(He),pending:Object.keys($e),toLoadLanguages:Object.keys(tt),toLoadNamespaces:Object.keys(et)}}},{key:"loaded",value:function(Qe,Ge,Je){var Xe=Qe.split("|"),Ke=Xe[0],He=Xe[1];Ge&&this.emit("failedLoading",Ke,He,Ge),Je&&this.store.addResourceBundle(Ke,He,Je),this.state[Qe]=Ge?-1:2;var $e={};this.queue.forEach(function(tt){pushPath(tt.loaded,[Ke],He),removePending(tt,Qe),Ge&&tt.errors.push(Ge),tt.pendingCount===0&&!tt.done&&(Object.keys(tt.loaded).forEach(function(et){$e[et]||($e[et]={});var nt=tt.loaded[et];nt.length&&nt.forEach(function(it){$e[et][it]===void 0&&($e[et][it]=!0)})}),tt.done=!0,tt.errors.length?tt.callback(tt.errors):tt.callback())}),this.emit("loaded",$e),this.queue=this.queue.filter(function(tt){return!tt.done})}},{key:"read",value:function(Qe,Ge,Je){var Xe=this,Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,He=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,$e=arguments.length>5?arguments[5]:void 0;if(!Qe.length)return $e(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:Qe,ns:Ge,fcName:Je,tried:Ke,wait:He,callback:$e});return}return this.readingCalls++,this.backend[Je](Qe,Ge,function(tt,et){if(Xe.readingCalls--,Xe.waitingReads.length>0){var nt=Xe.waitingReads.shift();Xe.read(nt.lng,nt.ns,nt.fcName,nt.tried,nt.wait,nt.callback)}if(tt&&et&&Ke<Xe.maxRetries){setTimeout(function(){Xe.read.call(Xe,Qe,Ge,Je,Ke+1,He*2,$e)},He);return}$e(tt,et)})}},{key:"prepareLoading",value:function(Qe,Ge){var Je=this,Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ke=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),Ke&&Ke();typeof Qe=="string"&&(Qe=this.languageUtils.toResolveHierarchy(Qe)),typeof Ge=="string"&&(Ge=[Ge]);var He=this.queueLoad(Qe,Ge,Xe,Ke);if(!He.toLoad.length)return He.pending.length||Ke(),null;He.toLoad.forEach(function($e){Je.loadOne($e)})}},{key:"load",value:function(Qe,Ge,Je){this.prepareLoading(Qe,Ge,{},Je)}},{key:"reload",value:function(Qe,Ge,Je){this.prepareLoading(Qe,Ge,{reload:!0},Je)}},{key:"loadOne",value:function(Qe){var Ge=this,Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",Xe=Qe.split("|"),Ke=Xe[0],He=Xe[1];this.read(Ke,He,"read",void 0,void 0,function($e,tt){$e&&Ge.logger.warn("".concat(Je,"loading namespace ").concat(He," for language ").concat(Ke," failed"),$e),!$e&&tt&&Ge.logger.log("".concat(Je,"loaded namespace ").concat(He," for language ").concat(Ke),tt),Ge.loaded(Qe,$e,tt)})}},{key:"saveMissing",value:function(Qe,Ge,Je,Xe,Ke){var He=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(Ge)){this.logger.warn('did not save key "'.concat(Je,'" as the namespace "').concat(Ge,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}Je==null||Je===""||(this.backend&&this.backend.create&&this.backend.create(Qe,Ge,Je,Xe,null,_objectSpread$5$1(_objectSpread$5$1({},He),{},{isUpdate:Ke})),!(!Qe||!Qe[0])&&this.store.addResource(Qe[0],Ge,Je,Xe))}}]),Ue}(EventEmitter$6);function get$1(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(ue){var Ue={};if(_typeof$a(ue[1])==="object"&&(Ue=ue[1]),typeof ue[1]=="string"&&(Ue.defaultValue=ue[1]),typeof ue[2]=="string"&&(Ue.tDescription=ue[2]),_typeof$a(ue[2])==="object"||_typeof$a(ue[3])==="object"){var Ze=ue[3]||ue[2];Object.keys(Ze).forEach(function(Qe){Ue[Qe]=Ze[Qe]})}return Ue},interpolation:{escapeValue:!0,format:function(ue,Ue,Ze,Qe){return ue},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(me){return typeof me.ns=="string"&&(me.ns=[me.ns]),typeof me.fallbackLng=="string"&&(me.fallbackLng=[me.fallbackLng]),typeof me.fallbackNS=="string"&&(me.fallbackNS=[me.fallbackNS]),me.supportedLngs&&me.supportedLngs.indexOf("cimode")<0&&(me.supportedLngs=me.supportedLngs.concat(["cimode"])),me}function ownKeys$6$1(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$6$1(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$6$1(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$6$1(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}function _createSuper$3(me){var ue=_isNativeReflectConstruct$3();return function(){var Ze=_getPrototypeOf$1(me),Qe;if(ue){var Ge=_getPrototypeOf$1(this).constructor;Qe=Reflect.construct(Ze,arguments,Ge)}else Qe=Ze.apply(this,arguments);return _possibleConstructorReturn$c(this,Qe)}}function _isNativeReflectConstruct$3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function noop$1(){}function bindMemberFunctions(me){var ue=Object.getOwnPropertyNames(Object.getPrototypeOf(me));ue.forEach(function(Ue){typeof me[Ue]=="function"&&(me[Ue]=me[Ue].bind(me))})}var I18n=function(me){_inherits$c(Ue,me);var ue=_createSuper$3(Ue);function Ue(){var Ze,Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ge=arguments.length>1?arguments[1]:void 0;if(_classCallCheck$m(this,Ue),Ze=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(Ze)),Ze.options=transformOptions(Qe),Ze.services={},Ze.logger=baseLogger,Ze.modules={external:[]},bindMemberFunctions(_assertThisInitialized$1(Ze)),Ge&&!Ze.isInitialized&&!Qe.isClone){if(!Ze.options.initImmediate)return Ze.init(Qe,Ge),_possibleConstructorReturn$c(Ze,_assertThisInitialized$1(Ze));setTimeout(function(){Ze.init(Qe,Ge)},0)}return Ze}return _createClass$l(Ue,[{key:"init",value:function(){var Qe=this,Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Je=arguments.length>1?arguments[1]:void 0;typeof Ge=="function"&&(Je=Ge,Ge={}),!Ge.defaultNS&&Ge.defaultNS!==!1&&Ge.ns&&(typeof Ge.ns=="string"?Ge.defaultNS=Ge.ns:Ge.ns.indexOf("translation")<0&&(Ge.defaultNS=Ge.ns[0]));var Xe=get$1();this.options=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},Xe),this.options),transformOptions(Ge)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=_objectSpread$6$1(_objectSpread$6$1({},Xe.interpolation),this.options.interpolation)),Ge.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=Ge.keySeparator),Ge.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=Ge.nsSeparator);function Ke(rt){return rt?typeof rt=="function"?new rt:rt:null}if(!this.options.isClone){this.modules.logger?baseLogger.init(Ke(this.modules.logger),this.options):baseLogger.init(null,this.options);var He;this.modules.formatter?He=this.modules.formatter:typeof Intl<"u"&&(He=Formatter$1);var $e=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var tt=this.services;tt.logger=baseLogger,tt.resourceStore=this.store,tt.languageUtils=$e,tt.pluralResolver=new PluralResolver($e,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),He&&(!this.options.interpolation.format||this.options.interpolation.format===Xe.interpolation.format)&&(tt.formatter=Ke(He),tt.formatter.init(tt,this.options),this.options.interpolation.format=tt.formatter.format.bind(tt.formatter)),tt.interpolator=new Interpolator(this.options),tt.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},tt.backendConnector=new Connector(Ke(this.modules.backend),tt.resourceStore,tt,this.options),tt.backendConnector.on("*",function(rt){for(var ot=arguments.length,lt=new Array(ot>1?ot-1:0),dt=1;dt<ot;dt++)lt[dt-1]=arguments[dt];Qe.emit.apply(Qe,[rt].concat(lt))}),this.modules.languageDetector&&(tt.languageDetector=Ke(this.modules.languageDetector),tt.languageDetector.init(tt,this.options.detection,this.options)),this.modules.i18nFormat&&(tt.i18nFormat=Ke(this.modules.i18nFormat),tt.i18nFormat.init&&tt.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(rt){for(var ot=arguments.length,lt=new Array(ot>1?ot-1:0),dt=1;dt<ot;dt++)lt[dt-1]=arguments[dt];Qe.emit.apply(Qe,[rt].concat(lt))}),this.modules.external.forEach(function(rt){rt.init&&rt.init(Qe)})}if(this.format=this.options.interpolation.format,Je||(Je=noop$1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var et=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);et.length>0&&et[0]!=="dev"&&(this.options.lng=et[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var nt=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];nt.forEach(function(rt){Qe[rt]=function(){var ot;return(ot=Qe.store)[rt].apply(ot,arguments)}});var it=["addResource","addResources","addResourceBundle","removeResourceBundle"];it.forEach(function(rt){Qe[rt]=function(){var ot;return(ot=Qe.store)[rt].apply(ot,arguments),Qe}});var at=defer(),st=function(){var ot=function(dt,ut){Qe.isInitialized&&!Qe.initializedStoreOnce&&Qe.logger.warn("init: i18next is already initialized. You should call init just once!"),Qe.isInitialized=!0,Qe.options.isClone||Qe.logger.log("initialized",Qe.options),Qe.emit("initialized",Qe.options),at.resolve(ut),Je(dt,ut)};if(Qe.languages&&Qe.options.compatibilityAPI!=="v1"&&!Qe.isInitialized)return ot(null,Qe.t.bind(Qe));Qe.changeLanguage(Qe.options.lng,ot)};return this.options.resources||!this.options.initImmediate?st():setTimeout(st,0),at}},{key:"loadResources",value:function(Qe){var Ge=this,Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1,Xe=Je,Ke=typeof Qe=="string"?Qe:this.language;if(typeof Qe=="function"&&(Xe=Qe),!this.options.resources||this.options.partialBundledLanguages){if(Ke&&Ke.toLowerCase()==="cimode")return Xe();var He=[],$e=function(nt){if(nt){var it=Ge.services.languageUtils.toResolveHierarchy(nt);it.forEach(function(at){He.indexOf(at)<0&&He.push(at)})}};if(Ke)$e(Ke);else{var tt=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);tt.forEach(function(et){return $e(et)})}this.options.preload&&this.options.preload.forEach(function(et){return $e(et)}),this.services.backendConnector.load(He,this.options.ns,function(et){!et&&!Ge.resolvedLanguage&&Ge.language&&Ge.setResolvedLanguage(Ge.language),Xe(et)})}else Xe(null)}},{key:"reloadResources",value:function(Qe,Ge,Je){var Xe=defer();return Qe||(Qe=this.languages),Ge||(Ge=this.options.ns),Je||(Je=noop$1),this.services.backendConnector.reload(Qe,Ge,function(Ke){Xe.resolve(),Je(Ke)}),Xe}},{key:"use",value:function(Qe){if(!Qe)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!Qe.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return Qe.type==="backend"&&(this.modules.backend=Qe),(Qe.type==="logger"||Qe.log&&Qe.warn&&Qe.error)&&(this.modules.logger=Qe),Qe.type==="languageDetector"&&(this.modules.languageDetector=Qe),Qe.type==="i18nFormat"&&(this.modules.i18nFormat=Qe),Qe.type==="postProcessor"&&postProcessor.addPostProcessor(Qe),Qe.type==="formatter"&&(this.modules.formatter=Qe),Qe.type==="3rdParty"&&this.modules.external.push(Qe),this}},{key:"setResolvedLanguage",value:function(Qe){if(!(!Qe||!this.languages)&&!(["cimode","dev"].indexOf(Qe)>-1))for(var Ge=0;Ge<this.languages.length;Ge++){var Je=this.languages[Ge];if(!(["cimode","dev"].indexOf(Je)>-1)&&this.store.hasLanguageSomeTranslations(Je)){this.resolvedLanguage=Je;break}}}},{key:"changeLanguage",value:function(Qe,Ge){var Je=this;this.isLanguageChangingTo=Qe;var Xe=defer();this.emit("languageChanging",Qe);var Ke=function(et){Je.language=et,Je.languages=Je.services.languageUtils.toResolveHierarchy(et),Je.resolvedLanguage=void 0,Je.setResolvedLanguage(et)},He=function(et,nt){nt?(Ke(nt),Je.translator.changeLanguage(nt),Je.isLanguageChangingTo=void 0,Je.emit("languageChanged",nt),Je.logger.log("languageChanged",nt)):Je.isLanguageChangingTo=void 0,Xe.resolve(function(){return Je.t.apply(Je,arguments)}),Ge&&Ge(et,function(){return Je.t.apply(Je,arguments)})},$e=function(et){!Qe&&!et&&Je.services.languageDetector&&(et=[]);var nt=typeof et=="string"?et:Je.services.languageUtils.getBestMatchFromCodes(et);nt&&(Je.language||Ke(nt),Je.translator.language||Je.translator.changeLanguage(nt),Je.services.languageDetector&&Je.services.languageDetector.cacheUserLanguage(nt)),Je.loadResources(nt,function(it){He(it,nt)})};return!Qe&&this.services.languageDetector&&!this.services.languageDetector.async?$e(this.services.languageDetector.detect()):!Qe&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect($e):$e(Qe),Xe}},{key:"getFixedT",value:function(Qe,Ge,Je){var Xe=this,Ke=function He($e,tt){var et;if(_typeof$a(tt)!=="object"){for(var nt=arguments.length,it=new Array(nt>2?nt-2:0),at=2;at<nt;at++)it[at-2]=arguments[at];et=Xe.options.overloadTranslationOptionHandler([$e,tt].concat(it))}else et=_objectSpread$6$1({},tt);et.lng=et.lng||He.lng,et.lngs=et.lngs||He.lngs,et.ns=et.ns||He.ns,et.keyPrefix=et.keyPrefix||Je||He.keyPrefix;var st=Xe.options.keySeparator||".",rt=et.keyPrefix?"".concat(et.keyPrefix).concat(st).concat($e):$e;return Xe.t(rt,et)};return typeof Qe=="string"?Ke.lng=Qe:Ke.lngs=Qe,Ke.ns=Ge,Ke.keyPrefix=Je,Ke}},{key:"t",value:function(){var Qe;return this.translator&&(Qe=this.translator).translate.apply(Qe,arguments)}},{key:"exists",value:function(){var Qe;return this.translator&&(Qe=this.translator).exists.apply(Qe,arguments)}},{key:"setDefaultNamespace",value:function(Qe){this.options.defaultNS=Qe}},{key:"hasLoadedNamespace",value:function(Qe){var Ge=this,Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var Xe=this.resolvedLanguage||this.languages[0],Ke=this.options?this.options.fallbackLng:!1,He=this.languages[this.languages.length-1];if(Xe.toLowerCase()==="cimode")return!0;var $e=function(nt,it){var at=Ge.services.backendConnector.state["".concat(nt,"|").concat(it)];return at===-1||at===2};if(Je.precheck){var tt=Je.precheck(this,$e);if(tt!==void 0)return tt}return!!(this.hasResourceBundle(Xe,Qe)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||$e(Xe,Qe)&&(!Ke||$e(He,Qe)))}},{key:"loadNamespaces",value:function(Qe,Ge){var Je=this,Xe=defer();return this.options.ns?(typeof Qe=="string"&&(Qe=[Qe]),Qe.forEach(function(Ke){Je.options.ns.indexOf(Ke)<0&&Je.options.ns.push(Ke)}),this.loadResources(function(Ke){Xe.resolve(),Ge&&Ge(Ke)}),Xe):(Ge&&Ge(),Promise.resolve())}},{key:"loadLanguages",value:function(Qe,Ge){var Je=defer();typeof Qe=="string"&&(Qe=[Qe]);var Xe=this.options.preload||[],Ke=Qe.filter(function(He){return Xe.indexOf(He)<0});return Ke.length?(this.options.preload=Xe.concat(Ke),this.loadResources(function(He){Je.resolve(),Ge&&Ge(He)}),Je):(Ge&&Ge(),Promise.resolve())}},{key:"dir",value:function(Qe){if(Qe||(Qe=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!Qe)return"rtl";var Ge=["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","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return Ge.indexOf(this.services.languageUtils.getLanguagePartFromCode(Qe))>-1||Qe.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var Qe=this,Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1,Xe=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},this.options),Ge),{isClone:!0}),Ke=new Ue(Xe);(Ge.debug!==void 0||Ge.prefix!==void 0)&&(Ke.logger=Ke.logger.clone(Ge));var He=["store","services","language"];return He.forEach(function($e){Ke[$e]=Qe[$e]}),Ke.services=_objectSpread$6$1({},this.services),Ke.services.utils={hasLoadedNamespace:Ke.hasLoadedNamespace.bind(Ke)},Ke.translator=new Translator(Ke.services,Ke.options),Ke.translator.on("*",function($e){for(var tt=arguments.length,et=new Array(tt>1?tt-1:0),nt=1;nt<tt;nt++)et[nt-1]=arguments[nt];Ke.emit.apply(Ke,[$e].concat(et))}),Ke.init(Xe,Je),Ke.translator.options=Ke.options,Ke.translator.backendConnector.services.utils={hasLoadedNamespace:Ke.hasLoadedNamespace.bind(Ke)},Ke}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),Ue}(EventEmitter$6);_defineProperty$6(I18n,"createInstance",function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ue=arguments.length>1?arguments[1]:void 0;return new I18n(me,ue)});var instance=I18n.createInstance();instance.createInstance=I18n.createInstance,instance.createInstance,instance.init,instance.loadResources,instance.reloadResources,instance.use,instance.changeLanguage,instance.getFixedT,instance.t,instance.exists,instance.setDefaultNamespace,instance.hasLoadedNamespace,instance.loadNamespaces,instance.loadLanguages;function _typeof$9(me){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$9(me)}var arr$1=[],each$1=arr$1.forEach,slice$1=arr$1.slice;function defaults$6(me){return each$1.call(slice$1.call(arguments,1),function(ue){if(ue)for(var Ue in ue)me[Ue]===void 0&&(me[Ue]=ue[Ue])}),me}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$9(XMLHttpRequest))==="object"}function isPromise(me){return!!me&&typeof me.then=="function"}function makePromise(me){return isPromise(me)?me:Promise.resolve(me)}function commonjsRequire(me){throw new Error('Could not dynamically require "'+me+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$1={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(me,ue){var Ue=typeof self<"u"?self:commonjsGlobal,Ze=function(){function Ge(){this.fetch=!1,this.DOMException=Ue.DOMException}return Ge.prototype=Ue,new Ge}();(function(Ge){(function(Je){var Xe={searchParams:"URLSearchParams"in Ge,iterable:"Symbol"in Ge&&"iterator"in Symbol,blob:"FileReader"in Ge&&"Blob"in Ge&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Ge,arrayBuffer:"ArrayBuffer"in Ge};function Ke(mt){return mt&&DataView.prototype.isPrototypeOf(mt)}if(Xe.arrayBuffer)var He=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],$e=ArrayBuffer.isView||function(mt){return mt&&He.indexOf(Object.prototype.toString.call(mt))>-1};function tt(mt){if(typeof mt!="string"&&(mt=String(mt)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(mt))throw new TypeError("Invalid character in header field name");return mt.toLowerCase()}function et(mt){return typeof mt!="string"&&(mt=String(mt)),mt}function nt(mt){var Qt={next:function(){var ft=mt.shift();return{done:ft===void 0,value:ft}}};return Xe.iterable&&(Qt[Symbol.iterator]=function(){return Qt}),Qt}function it(mt){this.map={},mt instanceof it?mt.forEach(function(Qt,ft){this.append(ft,Qt)},this):Array.isArray(mt)?mt.forEach(function(Qt){this.append(Qt[0],Qt[1])},this):mt&&Object.getOwnPropertyNames(mt).forEach(function(Qt){this.append(Qt,mt[Qt])},this)}it.prototype.append=function(mt,Qt){mt=tt(mt),Qt=et(Qt);var ft=this.map[mt];this.map[mt]=ft?ft+", "+Qt:Qt},it.prototype.delete=function(mt){delete this.map[tt(mt)]},it.prototype.get=function(mt){return mt=tt(mt),this.has(mt)?this.map[mt]:null},it.prototype.has=function(mt){return this.map.hasOwnProperty(tt(mt))},it.prototype.set=function(mt,Qt){this.map[tt(mt)]=et(Qt)},it.prototype.forEach=function(mt,Qt){for(var ft in this.map)this.map.hasOwnProperty(ft)&&mt.call(Qt,this.map[ft],ft,this)},it.prototype.keys=function(){var mt=[];return this.forEach(function(Qt,ft){mt.push(ft)}),nt(mt)},it.prototype.values=function(){var mt=[];return this.forEach(function(Qt){mt.push(Qt)}),nt(mt)},it.prototype.entries=function(){var mt=[];return this.forEach(function(Qt,ft){mt.push([ft,Qt])}),nt(mt)},Xe.iterable&&(it.prototype[Symbol.iterator]=it.prototype.entries);function at(mt){if(mt.bodyUsed)return Promise.reject(new TypeError("Already read"));mt.bodyUsed=!0}function st(mt){return new Promise(function(Qt,ft){mt.onload=function(){Qt(mt.result)},mt.onerror=function(){ft(mt.error)}})}function rt(mt){var Qt=new FileReader,ft=st(Qt);return Qt.readAsArrayBuffer(mt),ft}function ot(mt){var Qt=new FileReader,ft=st(Qt);return Qt.readAsText(mt),ft}function lt(mt){for(var Qt=new Uint8Array(mt),ft=new Array(Qt.length),Rt=0;Rt<Qt.length;Rt++)ft[Rt]=String.fromCharCode(Qt[Rt]);return ft.join("")}function dt(mt){if(mt.slice)return mt.slice(0);var Qt=new Uint8Array(mt.byteLength);return Qt.set(new Uint8Array(mt)),Qt.buffer}function ut(){return this.bodyUsed=!1,this._initBody=function(mt){this._bodyInit=mt,mt?typeof mt=="string"?this._bodyText=mt:Xe.blob&&Blob.prototype.isPrototypeOf(mt)?this._bodyBlob=mt:Xe.formData&&FormData.prototype.isPrototypeOf(mt)?this._bodyFormData=mt:Xe.searchParams&&URLSearchParams.prototype.isPrototypeOf(mt)?this._bodyText=mt.toString():Xe.arrayBuffer&&Xe.blob&&Ke(mt)?(this._bodyArrayBuffer=dt(mt.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Xe.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(mt)||$e(mt))?this._bodyArrayBuffer=dt(mt):this._bodyText=mt=Object.prototype.toString.call(mt):this._bodyText="",this.headers.get("content-type")||(typeof mt=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Xe.searchParams&&URLSearchParams.prototype.isPrototypeOf(mt)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Xe.blob&&(this.blob=function(){var mt=at(this);if(mt)return mt;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?at(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(rt)}),this.text=function(){var mt=at(this);if(mt)return mt;if(this._bodyBlob)return ot(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(lt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Xe.formData&&(this.formData=function(){return this.text().then(Vt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Ut=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ht(mt){var Qt=mt.toUpperCase();return Ut.indexOf(Qt)>-1?Qt:mt}function pt(mt,Qt){Qt=Qt||{};var ft=Qt.body;if(mt instanceof pt){if(mt.bodyUsed)throw new TypeError("Already read");this.url=mt.url,this.credentials=mt.credentials,Qt.headers||(this.headers=new it(mt.headers)),this.method=mt.method,this.mode=mt.mode,this.signal=mt.signal,!ft&&mt._bodyInit!=null&&(ft=mt._bodyInit,mt.bodyUsed=!0)}else this.url=String(mt);if(this.credentials=Qt.credentials||this.credentials||"same-origin",(Qt.headers||!this.headers)&&(this.headers=new it(Qt.headers)),this.method=ht(Qt.method||this.method||"GET"),this.mode=Qt.mode||this.mode||null,this.signal=Qt.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ft)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ft)}pt.prototype.clone=function(){return new pt(this,{body:this._bodyInit})};function Vt(mt){var Qt=new FormData;return mt.trim().split("&").forEach(function(ft){if(ft){var Rt=ft.split("="),gt=Rt.shift().replace(/\+/g," "),Ct=Rt.join("=").replace(/\+/g," ");Qt.append(decodeURIComponent(gt),decodeURIComponent(Ct))}}),Qt}function Tt(mt){var Qt=new it,ft=mt.replace(/\r?\n[\t ]+/g," ");return ft.split(/\r?\n/).forEach(function(Rt){var gt=Rt.split(":"),Ct=gt.shift().trim();if(Ct){var St=gt.join(":").trim();Qt.append(Ct,St)}}),Qt}ut.call(pt.prototype);function yt(mt,Qt){Qt||(Qt={}),this.type="default",this.status=Qt.status===void 0?200:Qt.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in Qt?Qt.statusText:"OK",this.headers=new it(Qt.headers),this.url=Qt.url||"",this._initBody(mt)}ut.call(yt.prototype),yt.prototype.clone=function(){return new yt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new it(this.headers),url:this.url})},yt.error=function(){var mt=new yt(null,{status:0,statusText:""});return mt.type="error",mt};var Nt=[301,302,303,307,308];yt.redirect=function(mt,Qt){if(Nt.indexOf(Qt)===-1)throw new RangeError("Invalid status code");return new yt(null,{status:Qt,headers:{location:mt}})},Je.DOMException=Ge.DOMException;try{new Je.DOMException}catch{Je.DOMException=function(Qt,ft){this.message=Qt,this.name=ft;var Rt=Error(Qt);this.stack=Rt.stack},Je.DOMException.prototype=Object.create(Error.prototype),Je.DOMException.prototype.constructor=Je.DOMException}function Zt(mt,Qt){return new Promise(function(ft,Rt){var gt=new pt(mt,Qt);if(gt.signal&>.signal.aborted)return Rt(new Je.DOMException("Aborted","AbortError"));var Ct=new XMLHttpRequest;function St(){Ct.abort()}Ct.onload=function(){var xt={status:Ct.status,statusText:Ct.statusText,headers:Tt(Ct.getAllResponseHeaders()||"")};xt.url="responseURL"in Ct?Ct.responseURL:xt.headers.get("X-Request-URL");var Dt="response"in Ct?Ct.response:Ct.responseText;ft(new yt(Dt,xt))},Ct.onerror=function(){Rt(new TypeError("Network request failed"))},Ct.ontimeout=function(){Rt(new TypeError("Network request failed"))},Ct.onabort=function(){Rt(new Je.DOMException("Aborted","AbortError"))},Ct.open(gt.method,gt.url,!0),gt.credentials==="include"?Ct.withCredentials=!0:gt.credentials==="omit"&&(Ct.withCredentials=!1),"responseType"in Ct&&Xe.blob&&(Ct.responseType="blob"),gt.headers.forEach(function(xt,Dt){Ct.setRequestHeader(Dt,xt)}),gt.signal&&(gt.signal.addEventListener("abort",St),Ct.onreadystatechange=function(){Ct.readyState===4&>.signal.removeEventListener("abort",St)}),Ct.send(typeof gt._bodyInit>"u"?null:gt._bodyInit)})}return Zt.polyfill=!0,Ge.fetch||(Ge.fetch=Zt,Ge.Headers=it,Ge.Request=pt,Ge.Response=yt),Je.Headers=it,Je.Request=pt,Je.Response=yt,Je.fetch=Zt,Object.defineProperty(Je,"__esModule",{value:!0}),Je})({})})(Ze),Ze.fetch.ponyfill=!0,delete Ze.fetch.polyfill;var Qe=Ze;ue=Qe.fetch,ue.default=Qe.fetch,ue.fetch=Qe.fetch,ue.Headers=Qe.Headers,ue.Request=Qe.Request,ue.Response=Qe.Response,me.exports=ue}(browserPonyfill,browserPonyfill.exports)),browserPonyfill.exports}(function(me,ue){var Ue;if(typeof fetch=="function"&&(typeof commonjsGlobal<"u"&&commonjsGlobal.fetch?Ue=commonjsGlobal.fetch:typeof window<"u"&&window.fetch?Ue=window.fetch:Ue=fetch),typeof commonjsRequire<"u"&&(typeof window>"u"||typeof window.document>"u")){var Ze=Ue||requireBrowserPonyfill();Ze.default&&(Ze=Ze.default),ue.default=Ze,me.exports=ue.default}})(getFetch$1,getFetch$1.exports);var getFetchExports=getFetch$1.exports;const getFetch=getDefaultExportFromCjs(getFetchExports),fetchNode=_mergeNamespaces({__proto__:null,default:getFetch},[getFetchExports]);function _typeof$8(me){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$8(me)}var fetchApi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?fetchApi=global.fetch:typeof window<"u"&&window.fetch?fetchApi=window.fetch:fetchApi=fetch);var XmlHttpRequestApi;hasXMLHttpRequest()&&(typeof global<"u"&&global.XMLHttpRequest?XmlHttpRequestApi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(XmlHttpRequestApi=window.XMLHttpRequest));var ActiveXObjectApi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ActiveXObjectApi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ActiveXObjectApi=window.ActiveXObject)),!fetchApi&&fetchNode&&!XmlHttpRequestApi&&!ActiveXObjectApi&&(fetchApi=getFetch||fetchNode),typeof fetchApi!="function"&&(fetchApi=void 0);var addQueryString=function(ue,Ue){if(Ue&&_typeof$8(Ue)==="object"){var Ze="";for(var Qe in Ue)Ze+="&"+encodeURIComponent(Qe)+"="+encodeURIComponent(Ue[Qe]);if(!Ze)return ue;ue=ue+(ue.indexOf("?")!==-1?"&":"?")+Ze.slice(1)}return ue},fetchIt=function(ue,Ue,Ze){fetchApi(ue,Ue).then(function(Qe){if(!Qe.ok)return Ze(Qe.statusText||"Error",{status:Qe.status});Qe.text().then(function(Ge){Ze(null,{status:Qe.status,data:Ge})}).catch(Ze)}).catch(Ze)},omitFetchOptions=!1,requestWithFetch=function(ue,Ue,Ze,Qe){ue.queryStringParams&&(Ue=addQueryString(Ue,ue.queryStringParams));var Ge=defaults$6({},typeof ue.customHeaders=="function"?ue.customHeaders():ue.customHeaders);Ze&&(Ge["Content-Type"]="application/json");var Je=typeof ue.requestOptions=="function"?ue.requestOptions(Ze):ue.requestOptions,Xe=defaults$6({method:Ze?"POST":"GET",body:Ze?ue.stringify(Ze):void 0,headers:Ge},omitFetchOptions?{}:Je);try{fetchIt(Ue,Xe,Qe)}catch(Ke){if(!Je||Object.keys(Je).length===0||!Ke.message||Ke.message.indexOf("not implemented")<0)return Qe(Ke);try{Object.keys(Je).forEach(function(He){delete Xe[He]}),fetchIt(Ue,Xe,Qe),omitFetchOptions=!0}catch(He){Qe(He)}}},requestWithXmlHttpRequest=function(ue,Ue,Ze,Qe){Ze&&_typeof$8(Ze)==="object"&&(Ze=addQueryString("",Ze).slice(1)),ue.queryStringParams&&(Ue=addQueryString(Ue,ue.queryStringParams));try{var Ge;XmlHttpRequestApi?Ge=new XmlHttpRequestApi:Ge=new ActiveXObjectApi("MSXML2.XMLHTTP.3.0"),Ge.open(Ze?"POST":"GET",Ue,1),ue.crossDomain||Ge.setRequestHeader("X-Requested-With","XMLHttpRequest"),Ge.withCredentials=!!ue.withCredentials,Ze&&Ge.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),Ge.overrideMimeType&&Ge.overrideMimeType("application/json");var Je=ue.customHeaders;if(Je=typeof Je=="function"?Je():Je,Je)for(var Xe in Je)Ge.setRequestHeader(Xe,Je[Xe]);Ge.onreadystatechange=function(){Ge.readyState>3&&Qe(Ge.status>=400?Ge.statusText:null,{status:Ge.status,data:Ge.responseText})},Ge.send(Ze)}catch(Ke){console&&console.log(Ke)}},request=function(ue,Ue,Ze,Qe){if(typeof Ze=="function"&&(Qe=Ze,Ze=void 0),Qe=Qe||function(){},fetchApi)return requestWithFetch(ue,Ue,Ze,Qe);if(hasXMLHttpRequest()||typeof ActiveXObject=="function")return requestWithXmlHttpRequest(ue,Ue,Ze,Qe);Qe(new Error("No fetch and no xhr implementation found!"))};function _classCallCheck$l(me,ue){if(!(me instanceof ue))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(me,ue){for(var Ue=0;Ue<ue.length;Ue++){var Ze=ue[Ue];Ze.enumerable=Ze.enumerable||!1,Ze.configurable=!0,"value"in Ze&&(Ze.writable=!0),Object.defineProperty(me,Ze.key,Ze)}}function _createClass$k(me,ue,Ue){return ue&&_defineProperties$8(me.prototype,ue),Object.defineProperty(me,"prototype",{writable:!1}),me}function _defineProperty$5(me,ue,Ue){return ue in me?Object.defineProperty(me,ue,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):me[ue]=Ue,me}var getDefaults$2=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(Ue){return JSON.parse(Ue)},stringify:JSON.stringify,parsePayload:function(Ue,Ze,Qe){return _defineProperty$5({},Ze,Qe||"")},request,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Backend=function(){function me(ue){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ze=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck$l(this,me),this.services=ue,this.options=Ue,this.allOptions=Ze,this.type="backend",this.init(ue,Ue,Ze)}return _createClass$k(me,[{key:"init",value:function(Ue){var Ze=this,Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=Ue,this.options=defaults$6(Qe,this.options||{},getDefaults$2()),this.allOptions=Ge,this.services&&this.options.reloadInterval&&setInterval(function(){return Ze.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(Ue,Ze,Qe){this._readAny(Ue,Ue,Ze,Ze,Qe)}},{key:"read",value:function(Ue,Ze,Qe){this._readAny([Ue],Ue,[Ze],Ze,Qe)}},{key:"_readAny",value:function(Ue,Ze,Qe,Ge,Je){var Xe=this,Ke=this.options.loadPath;typeof this.options.loadPath=="function"&&(Ke=this.options.loadPath(Ue,Qe)),Ke=makePromise(Ke),Ke.then(function(He){if(!He)return Je(null,{});var $e=Xe.services.interpolator.interpolate(He,{lng:Ue.join("+"),ns:Qe.join("+")});Xe.loadUrl($e,Je,Ze,Ge)})}},{key:"loadUrl",value:function(Ue,Ze,Qe,Ge){var Je=this;this.options.request(this.options,Ue,void 0,function(Xe,Ke){if(Ke&&(Ke.status>=500&&Ke.status<600||!Ke.status))return Ze("failed loading "+Ue+"; status code: "+Ke.status,!0);if(Ke&&Ke.status>=400&&Ke.status<500)return Ze("failed loading "+Ue+"; status code: "+Ke.status,!1);if(!Ke&&Xe&&Xe.message&&Xe.message.indexOf("Failed to fetch")>-1)return Ze("failed loading "+Ue+": "+Xe.message,!0);if(Xe)return Ze(Xe,!1);var He,$e;try{typeof Ke.data=="string"?He=Je.options.parse(Ke.data,Qe,Ge):He=Ke.data}catch{$e="failed parsing "+Ue+" to json"}if($e)return Ze($e,!1);Ze(null,He)})}},{key:"create",value:function(Ue,Ze,Qe,Ge,Je){var Xe=this;if(this.options.addPath){typeof Ue=="string"&&(Ue=[Ue]);var Ke=this.options.parsePayload(Ze,Qe,Ge),He=0,$e=[],tt=[];Ue.forEach(function(et){var nt=Xe.options.addPath;typeof Xe.options.addPath=="function"&&(nt=Xe.options.addPath(et,Ze));var it=Xe.services.interpolator.interpolate(nt,{lng:et,ns:Ze});Xe.options.request(Xe.options,it,Ke,function(at,st){He+=1,$e.push(at),tt.push(st),He===Ue.length&&Je&&Je($e,tt)})})}}},{key:"reload",value:function(){var Ue=this,Ze=this.services,Qe=Ze.backendConnector,Ge=Ze.languageUtils,Je=Ze.logger,Xe=Qe.language;if(!(Xe&&Xe.toLowerCase()==="cimode")){var Ke=[],He=function(tt){var et=Ge.toResolveHierarchy(tt);et.forEach(function(nt){Ke.indexOf(nt)<0&&Ke.push(nt)})};He(Xe),this.allOptions.preload&&this.allOptions.preload.forEach(function($e){return He($e)}),Ke.forEach(function($e){Ue.allOptions.ns.forEach(function(tt){Qe.read($e,tt,"read",null,null,function(et,nt){et&&Je.warn("loading namespace ".concat(tt," for language ").concat($e," failed"),et),!et&&nt&&Je.log("loaded namespace ".concat(tt," for language ").concat($e),nt),Qe.loaded("".concat($e,"|").concat(tt),et,nt)})})})}}}]),me}();Backend.type="backend";var arr=[],each=arr.forEach,slice=arr.slice;function defaults$5(me){return each.call(slice.call(arguments,1),function(ue){if(ue)for(var Ue in ue)me[Ue]===void 0&&(me[Ue]=ue[Ue])}),me}var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(ue,Ue,Ze){var Qe=Ze||{};Qe.path=Qe.path||"/";var Ge=encodeURIComponent(Ue),Je="".concat(ue,"=").concat(Ge);if(Qe.maxAge>0){var Xe=Qe.maxAge-0;if(Number.isNaN(Xe))throw new Error("maxAge should be a Number");Je+="; Max-Age=".concat(Math.floor(Xe))}if(Qe.domain){if(!fieldContentRegExp.test(Qe.domain))throw new TypeError("option domain is invalid");Je+="; Domain=".concat(Qe.domain)}if(Qe.path){if(!fieldContentRegExp.test(Qe.path))throw new TypeError("option path is invalid");Je+="; Path=".concat(Qe.path)}if(Qe.expires){if(typeof Qe.expires.toUTCString!="function")throw new TypeError("option expires is invalid");Je+="; Expires=".concat(Qe.expires.toUTCString())}if(Qe.httpOnly&&(Je+="; HttpOnly"),Qe.secure&&(Je+="; Secure"),Qe.sameSite){var Ke=typeof Qe.sameSite=="string"?Qe.sameSite.toLowerCase():Qe.sameSite;switch(Ke){case!0:Je+="; SameSite=Strict";break;case"lax":Je+="; SameSite=Lax";break;case"strict":Je+="; SameSite=Strict";break;case"none":Je+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return Je},cookie={create:function(ue,Ue,Ze,Qe){var Ge=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};Ze&&(Ge.expires=new Date,Ge.expires.setTime(Ge.expires.getTime()+Ze*60*1e3)),Qe&&(Ge.domain=Qe),document.cookie=serializeCookie(ue,encodeURIComponent(Ue),Ge)},read:function(ue){for(var Ue="".concat(ue,"="),Ze=document.cookie.split(";"),Qe=0;Qe<Ze.length;Qe++){for(var Ge=Ze[Qe];Ge.charAt(0)===" ";)Ge=Ge.substring(1,Ge.length);if(Ge.indexOf(Ue)===0)return Ge.substring(Ue.length,Ge.length)}return null},remove:function(ue){this.create(ue,"",-1)}},cookie$1={name:"cookie",lookup:function(ue){var Ue;if(ue.lookupCookie&&typeof document<"u"){var Ze=cookie.read(ue.lookupCookie);Ze&&(Ue=Ze)}return Ue},cacheUserLanguage:function(ue,Ue){Ue.lookupCookie&&typeof document<"u"&&cookie.create(Ue.lookupCookie,ue,Ue.cookieMinutes,Ue.cookieDomain,Ue.cookieOptions)}},querystring={name:"querystring",lookup:function(ue){var Ue;if(typeof window<"u"){var Ze=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(Ze=window.location.hash.substring(window.location.hash.indexOf("?")));for(var Qe=Ze.substring(1),Ge=Qe.split("&"),Je=0;Je<Ge.length;Je++){var Xe=Ge[Je].indexOf("=");if(Xe>0){var Ke=Ge[Je].substring(0,Xe);Ke===ue.lookupQuerystring&&(Ue=Ge[Je].substring(Xe+1))}}}return Ue}},hasLocalStorageSupport=null,localStorageAvailable=function(){if(hasLocalStorageSupport!==null)return hasLocalStorageSupport;try{hasLocalStorageSupport=window!=="undefined"&&window.localStorage!==null;var ue="i18next.translate.boo";window.localStorage.setItem(ue,"foo"),window.localStorage.removeItem(ue)}catch{hasLocalStorageSupport=!1}return hasLocalStorageSupport},localStorage$1={name:"localStorage",lookup:function(ue){var Ue;if(ue.lookupLocalStorage&&localStorageAvailable()){var Ze=window.localStorage.getItem(ue.lookupLocalStorage);Ze&&(Ue=Ze)}return Ue},cacheUserLanguage:function(ue,Ue){Ue.lookupLocalStorage&&localStorageAvailable()&&window.localStorage.setItem(Ue.lookupLocalStorage,ue)}},hasSessionStorageSupport=null,sessionStorageAvailable=function(){if(hasSessionStorageSupport!==null)return hasSessionStorageSupport;try{hasSessionStorageSupport=window!=="undefined"&&window.sessionStorage!==null;var ue="i18next.translate.boo";window.sessionStorage.setItem(ue,"foo"),window.sessionStorage.removeItem(ue)}catch{hasSessionStorageSupport=!1}return hasSessionStorageSupport},sessionStorage$1={name:"sessionStorage",lookup:function(ue){var Ue;if(ue.lookupSessionStorage&&sessionStorageAvailable()){var Ze=window.sessionStorage.getItem(ue.lookupSessionStorage);Ze&&(Ue=Ze)}return Ue},cacheUserLanguage:function(ue,Ue){Ue.lookupSessionStorage&&sessionStorageAvailable()&&window.sessionStorage.setItem(Ue.lookupSessionStorage,ue)}},navigator$1={name:"navigator",lookup:function(ue){var Ue=[];if(typeof navigator<"u"){if(navigator.languages)for(var Ze=0;Ze<navigator.languages.length;Ze++)Ue.push(navigator.languages[Ze]);navigator.userLanguage&&Ue.push(navigator.userLanguage),navigator.language&&Ue.push(navigator.language)}return Ue.length>0?Ue:void 0}},htmlTag={name:"htmlTag",lookup:function(ue){var Ue,Ze=ue.htmlTag||(typeof document<"u"?document.documentElement:null);return Ze&&typeof Ze.getAttribute=="function"&&(Ue=Ze.getAttribute("lang")),Ue}},path$1={name:"path",lookup:function(ue){var Ue;if(typeof window<"u"){var Ze=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Ze instanceof Array)if(typeof ue.lookupFromPathIndex=="number"){if(typeof Ze[ue.lookupFromPathIndex]!="string")return;Ue=Ze[ue.lookupFromPathIndex].replace("/","")}else Ue=Ze[0].replace("/","")}return Ue}},subdomain={name:"subdomain",lookup:function(ue){var Ue=typeof ue.lookupFromSubdomainIndex=="number"?ue.lookupFromSubdomainIndex+1:1,Ze=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(Ze)return Ze[Ue]}};function getDefaults$1(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Browser=function(){function me(ue){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,me),this.type="languageDetector",this.detectors={},this.init(ue,Ue)}return _createClass$l(me,[{key:"init",value:function(Ue){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=Ue,this.options=defaults$5(Ze,this.options||{},getDefaults$1()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=Qe,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(localStorage$1),this.addDetector(sessionStorage$1),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path$1),this.addDetector(subdomain)}},{key:"addDetector",value:function(Ue){this.detectors[Ue.name]=Ue}},{key:"detect",value:function(Ue){var Ze=this;Ue||(Ue=this.options.order);var Qe=[];return Ue.forEach(function(Ge){if(Ze.detectors[Ge]){var Je=Ze.detectors[Ge].lookup(Ze.options);Je&&typeof Je=="string"&&(Je=[Je]),Je&&(Qe=Qe.concat(Je))}}),this.services.languageUtils.getBestMatchFromCodes?Qe:Qe.length>0?Qe[0]:null}},{key:"cacheUserLanguage",value:function(Ue,Ze){var Qe=this;Ze||(Ze=this.options.caches),Ze&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(Ue)>-1||Ze.forEach(function(Ge){Qe.detectors[Ge]&&Qe.detectors[Ge].cacheUserLanguage(Ue,Qe.options)}))}}]),me}();Browser.type="languageDetector";function _objectWithoutPropertiesLoose(me,ue){if(me==null)return{};var Ue={},Ze=Object.keys(me),Qe,Ge;for(Ge=0;Ge<Ze.length;Ge++)Qe=Ze[Ge],!(ue.indexOf(Qe)>=0)&&(Ue[Qe]=me[Qe]);return Ue}function _objectWithoutProperties$4(me,ue){if(me==null)return{};var Ue=_objectWithoutPropertiesLoose(me,ue),Ze,Qe;if(Object.getOwnPropertySymbols){var Ge=Object.getOwnPropertySymbols(me);for(Qe=0;Qe<Ge.length;Qe++)Ze=Ge[Qe],!(ue.indexOf(Ze)>=0)&&Object.prototype.propertyIsEnumerable.call(me,Ze)&&(Ue[Ze]=me[Ze])}return Ue}var voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const e=getDefaultExportFromCjs(voidElements);var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(me){var ue={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},Ue=me.match(/<\/?([^\s]+?)[/\s>]/);if(Ue&&(ue.name=Ue[1],(e[Ue[1]]||me.charAt(me.length-2)==="/")&&(ue.voidElement=!0),ue.name.startsWith("!--"))){var Ze=me.indexOf("-->");return{type:"comment",comment:Ze!==-1?me.slice(4,Ze):""}}for(var Qe=new RegExp(t$1),Ge=null;(Ge=Qe.exec(me))!==null;)if(Ge[0].trim())if(Ge[1]){var Je=Ge[1].trim(),Xe=[Je,""];Je.indexOf("=")>-1&&(Xe=Je.split("=")),ue.attrs[Xe[0]]=Xe[1],Qe.lastIndex--}else Ge[2]&&(ue.attrs[Ge[2]]=Ge[3].trim().substring(1,Ge[3].length-1));return ue}var r$2=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i$4=/^\s*$/,s$2=Object.create(null);function a$2(me,ue){switch(ue.type){case"text":return me+ue.content;case"tag":return me+="<"+ue.name+(ue.attrs?function(Ue){var Ze=[];for(var Qe in Ue)Ze.push(Qe+'="'+Ue[Qe]+'"');return Ze.length?" "+Ze.join(" "):""}(ue.attrs):"")+(ue.voidElement?"/>":">"),ue.voidElement?me:me+ue.children.reduce(a$2,"")+"</"+ue.name+">";case"comment":return me+"<!--"+ue.comment+"-->"}}var c$2={parse:function(me,ue){ue||(ue={}),ue.components||(ue.components=s$2);var Ue,Ze=[],Qe=[],Ge=-1,Je=!1;if(me.indexOf("<")!==0){var Xe=me.indexOf("<");Ze.push({type:"text",content:Xe===-1?me:me.substring(0,Xe)})}return me.replace(r$2,function(Ke,He){if(Je){if(Ke!=="</"+Ue.name+">")return;Je=!1}var $e,tt=Ke.charAt(1)!=="/",et=Ke.startsWith("<!--"),nt=He+Ke.length,it=me.charAt(nt);if(et){var at=n(Ke);return Ge<0?(Ze.push(at),Ze):(($e=Qe[Ge]).children.push(at),Ze)}if(tt&&(Ge++,(Ue=n(Ke)).type==="tag"&&ue.components[Ue.name]&&(Ue.type="component",Je=!0),Ue.voidElement||Je||!it||it==="<"||Ue.children.push({type:"text",content:me.slice(nt,me.indexOf("<",nt))}),Ge===0&&Ze.push(Ue),($e=Qe[Ge-1])&&$e.children.push(Ue),Qe[Ge]=Ue),(!tt||Ue.voidElement)&&(Ge>-1&&(Ue.voidElement||Ue.name===Ke.slice(2,-1))&&(Ge--,Ue=Ge===-1?Ze:Qe[Ge]),!Je&&it!=="<"&&it)){$e=Ge===-1?Ze:Qe[Ge].children;var st=me.indexOf("<",nt),rt=me.slice(nt,st===-1?void 0:st);i$4.test(rt)&&(rt=" "),(st>-1&&Ge+$e.length>=0||rt!==" ")&&$e.push({type:"text",content:rt})}}),Ze},stringify:function(me){return me.reduce(function(ue,Ue){return ue+a$2("",Ue)},"")}},matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function(ue){return htmlEntities[ue]},unescape$1=function(ue){return ue.replace(matchHtmlEntity,unescapeHtmlEntity)};function ownKeys$7(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$7(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$7(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$7(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}var defaultOptions$1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1},i18nInstance,I18nContext=React.createContext();function setDefaults(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions$1=_objectSpread$7(_objectSpread$7({},defaultOptions$1),me)}function getDefaults(){return defaultOptions$1}var ReportNamespaces=function(){function me(){_classCallCheck$m(this,me),this.usedNamespaces={}}return _createClass$l(me,[{key:"addUsedNamespaces",value:function(Ue){var Ze=this;Ue.forEach(function(Qe){Ze.usedNamespaces[Qe]||(Ze.usedNamespaces[Qe]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),me}();function setI18n(me){i18nInstance=me}function getI18n(){return i18nInstance}var initReactI18next={type:"3rdParty",init:function(ue){setDefaults(ue.options.react),setI18n(ue)}};function warn$1(){if(console&&console.warn){for(var me,ue=arguments.length,Ue=new Array(ue),Ze=0;Ze<ue;Ze++)Ue[Ze]=arguments[Ze];typeof Ue[0]=="string"&&(Ue[0]="react-i18next:: ".concat(Ue[0])),(me=console).warn.apply(me,Ue)}}var alreadyWarned={};function warnOnce$1(){for(var me=arguments.length,ue=new Array(me),Ue=0;Ue<me;Ue++)ue[Ue]=arguments[Ue];typeof ue[0]=="string"&&alreadyWarned[ue[0]]||(typeof ue[0]=="string"&&(alreadyWarned[ue[0]]=new Date),warn$1.apply(void 0,ue))}function loadNamespaces(me,ue,Ue){me.loadNamespaces(ue,function(){if(me.isInitialized)Ue();else{var Ze=function Qe(){setTimeout(function(){me.off("initialized",Qe)},0),Ue()};me.on("initialized",Ze)}})}function oldI18nextHasLoadedNamespace(me,ue){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ze=ue.languages[0],Qe=ue.options?ue.options.fallbackLng:!1,Ge=ue.languages[ue.languages.length-1];if(Ze.toLowerCase()==="cimode")return!0;var Je=function(Ke,He){var $e=ue.services.backendConnector.state["".concat(Ke,"|").concat(He)];return $e===-1||$e===2};return Ue.bindI18n&&Ue.bindI18n.indexOf("languageChanging")>-1&&ue.services.backendConnector.backend&&ue.isLanguageChangingTo&&!Je(ue.isLanguageChangingTo,me)?!1:!!(ue.hasResourceBundle(Ze,me)||!ue.services.backendConnector.backend||ue.options.resources&&!ue.options.partialBundledLanguages||Je(Ze,me)&&(!Qe||Je(Ge,me)))}function hasLoadedNamespace(me,ue){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!ue.languages||!ue.languages.length)return warnOnce$1("i18n.languages were undefined or empty",ue.languages),!0;var Ze=ue.options.ignoreJSONStructure!==void 0;return Ze?ue.hasLoadedNamespace(me,{precheck:function(Ge,Je){if(Ue.bindI18n&&Ue.bindI18n.indexOf("languageChanging")>-1&&Ge.services.backendConnector.backend&&Ge.isLanguageChangingTo&&!Je(Ge.isLanguageChangingTo,me))return!1}}):oldI18nextHasLoadedNamespace(me,ue,Ue)}var _excluded=["format"],_excluded2=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$6(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$6(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$6(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$6(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}function hasChildren(me,ue){if(!me)return!1;var Ue=me.props?me.props.children:me.children;return ue?Ue.length>0:!!Ue}function getChildren$1(me){return me?me.props?me.props.children:me.children:[]}function hasValidReactChildren(me){return Object.prototype.toString.call(me)!=="[object Array]"?!1:me.every(function(ue){return React.isValidElement(ue)})}function getAsArray(me){return Array.isArray(me)?me:[me]}function mergeProps(me,ue){var Ue=_objectSpread$6({},ue);return Ue.props=Object.assign(me.props,ue.props),Ue}function nodesToString(me,ue){if(!me)return"";var Ue="",Ze=getAsArray(me),Qe=ue.transSupportBasicHtmlNodes&&ue.transKeepBasicHtmlNodesFor?ue.transKeepBasicHtmlNodesFor:[];return Ze.forEach(function(Ge,Je){if(typeof Ge=="string")Ue+="".concat(Ge);else if(React.isValidElement(Ge)){var Xe=Object.keys(Ge.props).length,Ke=Qe.indexOf(Ge.type)>-1,He=Ge.props.children;if(!He&&Ke&&Xe===0)Ue+="<".concat(Ge.type,"/>");else if(!He&&(!Ke||Xe!==0))Ue+="<".concat(Je,"></").concat(Je,">");else if(Ge.props.i18nIsDynamicList)Ue+="<".concat(Je,"></").concat(Je,">");else if(Ke&&Xe===1&&typeof He=="string")Ue+="<".concat(Ge.type,">").concat(He,"</").concat(Ge.type,">");else{var $e=nodesToString(He,ue);Ue+="<".concat(Je,">").concat($e,"</").concat(Je,">")}}else if(Ge===null)warn$1("Trans: the passed in value is invalid - seems you passed in a null child.");else if(_typeof$a(Ge)==="object"){var tt=Ge.format,et=_objectWithoutProperties$4(Ge,_excluded),nt=Object.keys(et);if(nt.length===1){var it=tt?"".concat(nt[0],", ").concat(tt):nt[0];Ue+="{{".concat(it,"}}")}else warn$1("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",Ge)}else warn$1("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",Ge)}),Ue}function renderNodes(me,ue,Ue,Ze,Qe,Ge){if(ue==="")return[];var Je=Ze.transKeepBasicHtmlNodesFor||[],Xe=ue&&new RegExp(Je.join("|")).test(ue);if(!me&&!Xe)return[ue];var Ke={};function He(st){var rt=getAsArray(st);rt.forEach(function(ot){typeof ot!="string"&&(hasChildren(ot)?He(getChildren$1(ot)):_typeof$a(ot)==="object"&&!React.isValidElement(ot)&&Object.assign(Ke,ot))})}He(me);var $e=c$2.parse("<0>".concat(ue,"</0>")),tt=_objectSpread$6(_objectSpread$6({},Ke),Qe);function et(st,rt,ot){var lt=getChildren$1(st),dt=it(lt,rt.children,ot);return hasValidReactChildren(lt)&&dt.length===0?lt:dt}function nt(st,rt,ot,lt,dt){st.dummy&&(st.children=rt),ot.push(React.cloneElement(st,_objectSpread$6(_objectSpread$6({},st.props),{},{key:lt}),dt?void 0:rt))}function it(st,rt,ot){var lt=getAsArray(st),dt=getAsArray(rt);return dt.reduce(function(ut,Ut,ht){var pt=Ut.children&&Ut.children[0]&&Ut.children[0].content&&Ue.services.interpolator.interpolate(Ut.children[0].content,tt,Ue.language);if(Ut.type==="tag"){var Vt=lt[parseInt(Ut.name,10)];!Vt&&ot.length===1&&ot[0][Ut.name]&&(Vt=ot[0][Ut.name]),Vt||(Vt={});var Tt=Object.keys(Ut.attrs).length!==0?mergeProps({props:Ut.attrs},Vt):Vt,yt=React.isValidElement(Tt),Nt=yt&&hasChildren(Ut,!0)&&!Ut.voidElement,Zt=Xe&&_typeof$a(Tt)==="object"&&Tt.dummy&&!yt,mt=_typeof$a(me)==="object"&&me!==null&&Object.hasOwnProperty.call(me,Ut.name);if(typeof Tt=="string"){var Qt=Ue.services.interpolator.interpolate(Tt,tt,Ue.language);ut.push(Qt)}else if(hasChildren(Tt)||Nt){var ft=et(Tt,Ut,ot);nt(Tt,ft,ut,ht)}else if(Zt){var Rt=it(lt,Ut.children,ot);ut.push(React.cloneElement(Tt,_objectSpread$6(_objectSpread$6({},Tt.props),{},{key:ht}),Rt))}else if(Number.isNaN(parseFloat(Ut.name)))if(mt){var gt=et(Tt,Ut,ot);nt(Tt,gt,ut,ht,Ut.voidElement)}else if(Ze.transSupportBasicHtmlNodes&&Je.indexOf(Ut.name)>-1)if(Ut.voidElement)ut.push(React.createElement(Ut.name,{key:"".concat(Ut.name,"-").concat(ht)}));else{var Ct=it(lt,Ut.children,ot);ut.push(React.createElement(Ut.name,{key:"".concat(Ut.name,"-").concat(ht)},Ct))}else if(Ut.voidElement)ut.push("<".concat(Ut.name," />"));else{var St=it(lt,Ut.children,ot);ut.push("<".concat(Ut.name,">").concat(St,"</").concat(Ut.name,">"))}else if(_typeof$a(Tt)==="object"&&!yt){var xt=Ut.children[0]?pt:null;xt&&ut.push(xt)}else Ut.children.length===1&&pt?ut.push(React.cloneElement(Tt,_objectSpread$6(_objectSpread$6({},Tt.props),{},{key:ht}),pt)):ut.push(React.cloneElement(Tt,_objectSpread$6(_objectSpread$6({},Tt.props),{},{key:ht})))}else if(Ut.type==="text"){var Dt=Ze.transWrapTextNodes,Bt=Ge?Ze.unescape(Ue.services.interpolator.interpolate(Ut.content,tt,Ue.language)):Ue.services.interpolator.interpolate(Ut.content,tt,Ue.language);Dt?ut.push(React.createElement(Dt,{key:"".concat(Ut.name,"-").concat(ht)},Bt)):ut.push(Bt)}return ut},[])}var at=it([{dummy:!0,children:me||[]}],$e,getAsArray(me||[]));return getChildren$1(at[0])}function Trans(me){var ue=me.children,Ue=me.count,Ze=me.parent,Qe=me.i18nKey,Ge=me.context,Je=me.tOptions,Xe=Je===void 0?{}:Je,Ke=me.values,He=me.defaults,$e=me.components,tt=me.ns,et=me.i18n,nt=me.t,it=me.shouldUnescape,at=_objectWithoutProperties$4(me,_excluded2),st=React.useContext(I18nContext)||{},rt=st.i18n,ot=st.defaultNS,lt=et||rt||getI18n();if(!lt)return warnOnce$1("You will need to pass in an i18next instance by using i18nextReactModule"),ue;var dt=nt||lt.t.bind(lt)||function(Qt){return Qt};Ge&&(Xe.context=Ge);var ut=_objectSpread$6(_objectSpread$6({},getDefaults()),lt.options&<.options.react),Ut=tt||dt.ns||ot||lt.options&<.options.defaultNS;Ut=typeof Ut=="string"?[Ut]:Ut||["translation"];var ht=He||nodesToString(ue,ut)||ut.transEmptyNodeValue||Qe,pt=ut.hashTransKey,Vt=Qe||(pt?pt(ht):ht),Tt=Ke?Xe.interpolation:{interpolation:_objectSpread$6(_objectSpread$6({},Xe.interpolation),{},{prefix:"#$?",suffix:"?$#"})},yt=_objectSpread$6(_objectSpread$6(_objectSpread$6(_objectSpread$6({},Xe),{},{count:Ue},Ke),Tt),{},{defaultValue:ht,ns:Ut}),Nt=Vt?dt(Vt,yt):ht,Zt=renderNodes($e||ue,Nt,lt,ut,yt,it),mt=Ze!==void 0?Ze:ut.defaultTransParent;return mt?React.createElement(mt,at,Zt):Zt}function _iterableToArrayLimit$3(me,ue){var Ue=me==null?null:typeof Symbol<"u"&&me[Symbol.iterator]||me["@@iterator"];if(Ue!=null){var Ze,Qe,Ge,Je,Xe=[],Ke=!0,He=!1;try{if(Ge=(Ue=Ue.call(me)).next,ue!==0)for(;!(Ke=(Ze=Ge.call(Ue)).done)&&(Xe.push(Ze.value),Xe.length!==ue);Ke=!0);}catch($e){He=!0,Qe=$e}finally{try{if(!Ke&&Ue.return!=null&&(Je=Ue.return(),Object(Je)!==Je))return}finally{if(He)throw Qe}}return Xe}}function _slicedToArray$3(me,ue){return _arrayWithHoles$3(me)||_iterableToArrayLimit$3(me,ue)||_unsupportedIterableToArray$b(me,ue)||_nonIterableRest$3()}function ownKeys$5(me,ue){var Ue=Object.keys(me);if(Object.getOwnPropertySymbols){var Ze=Object.getOwnPropertySymbols(me);ue&&(Ze=Ze.filter(function(Qe){return Object.getOwnPropertyDescriptor(me,Qe).enumerable})),Ue.push.apply(Ue,Ze)}return Ue}function _objectSpread$5(me){for(var ue=1;ue<arguments.length;ue++){var Ue=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$5(Object(Ue),!0).forEach(function(Ze){_defineProperty$6(me,Ze,Ue[Ze])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Ue)):ownKeys$5(Object(Ue)).forEach(function(Ze){Object.defineProperty(me,Ze,Object.getOwnPropertyDescriptor(Ue,Ze))})}return me}var usePrevious=function(ue,Ue){var Ze=React.useRef();return React.useEffect(function(){Ze.current=ue},[ue,Ue]),Ze.current};function useTranslation(me){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ue=ue.i18n,Ze=React.useContext(I18nContext)||{},Qe=Ze.i18n,Ge=Ze.defaultNS,Je=Ue||Qe||getI18n();if(Je&&!Je.reportNamespaces&&(Je.reportNamespaces=new ReportNamespaces),!Je){warnOnce$1("You will need to pass in an i18next instance by using initReactI18next");var Xe=function(Vt){return Array.isArray(Vt)?Vt[Vt.length-1]:Vt},Ke=[Xe,{},!1];return Ke.t=Xe,Ke.i18n={},Ke.ready=!1,Ke}Je.options.react&&Je.options.react.wait!==void 0&&warnOnce$1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var He=_objectSpread$5(_objectSpread$5(_objectSpread$5({},getDefaults()),Je.options.react),ue),$e=He.useSuspense,tt=He.keyPrefix,et=Ge||Je.options&&Je.options.defaultNS;et=typeof et=="string"?[et]:et||["translation"],Je.reportNamespaces.addUsedNamespaces&&Je.reportNamespaces.addUsedNamespaces(et);var nt=(Je.isInitialized||Je.initializedStoreOnce)&&et.every(function(pt){return hasLoadedNamespace(pt,Je,He)});function it(){return Je.getFixedT(null,He.nsMode==="fallback"?et:et[0],tt)}var at=React.useState(it),st=_slicedToArray$3(at,2),rt=st[0],ot=st[1],lt=et.join(),dt=usePrevious(lt),ut=React.useRef(!0);React.useEffect(function(){var pt=He.bindI18n,Vt=He.bindI18nStore;ut.current=!0,!nt&&!$e&&loadNamespaces(Je,et,function(){ut.current&&ot(it)}),nt&&dt&&dt!==lt&&ut.current&&ot(it);function Tt(){ut.current&&ot(it)}return pt&&Je&&Je.on(pt,Tt),Vt&&Je&&Je.store.on(Vt,Tt),function(){ut.current=!1,pt&&Je&&pt.split(" ").forEach(function(yt){return Je.off(yt,Tt)}),Vt&&Je&&Vt.split(" ").forEach(function(yt){return Je.store.off(yt,Tt)})}},[Je,lt]);var Ut=React.useRef(!0);React.useEffect(function(){ut.current&&!Ut.current&&ot(it),Ut.current=!1},[Je,tt]);var ht=[rt,Je,nt];if(ht.t=rt,ht.i18n=Je,ht.ready=nt,nt||!nt&&!$e)return ht;throw new Promise(function(pt){loadNamespaces(Je,et,function(){pt()})})}function I18nextProvider(me){var ue=me.i18n,Ue=me.defaultNS,Ze=me.children,Qe=React.useMemo(function(){return{i18n:ue,defaultNS:Ue}},[ue,Ue]);return React.createElement(I18nContext.Provider,{value:Qe},Ze)}const supportedLngs=["en","en-DG","es","es-ES","sr","sr-Latn","fr","pt-BR","pt","bn","zh","hi","id","ms","tr","vi","ht","it","de","nl","tl-PH","pl","hu","ro"],keyToStartCase=me=>{const ue=me.split("."),Ue=ue[ue.length-1];return camelToStartCase(Ue)},languageDetector=new Browser;languageDetector.addDetector({name:"navigatorOnlyLanguage",lookup(){if(typeof navigator>"u")return"en";const me=navigator.language;return supportedLngs.includes(me)?me:me.split("-")[0]}});const loadPath="https://api.i18nexus.com/project_resources/translations/{{lng}}/{{ns}}.json?api_key=cg41dUINoxdp8BaHDQLJhA";function createI18n({ns:me=["default"],...ue}){const Ue=instance.createInstance();return Ue.use(initReactI18next).use(Backend).use(languageDetector).init({fallbackLng:"en",supportedLngs,ns:me,detection:{order:["querystring","cookie","localStorage","sessionStorage","navigatorOnlyLanguage","htmlTag","path","subdomain"],lookupQuerystring:"lang"},defaultNS:me[0],parseMissingKeyHandler:keyToStartCase,partialBundledLanguages:!0,keySeparator:".",interpolation:{escapeValue:!1},backend:{loadPath},react:{useSuspense:!1},initImmediate:!1,...ue}),Ue}const i18n=createI18n({ns:["default"]}),addCustomFields=({token:me,fields:ue})=>exports.api.post("/omni/add/custom-fields",{customFields:{...ue}},{headers:{"X-Incode-Hardware-Id":me}}).then(Ue=>Ue.data).catch(Ue=>Promise.reject(Ue.response.data));async function addContract({token:me,image:ue}){const{url:Ue,contractId:Ze}=await getContractURL({token:me});return await fetch(Ue,{method:"PUT",body:ue,headers:{"x-ms-blob-type":"BlockBlob"}}),{url:Ue,contractId:Ze}}function getContractURL({token:me}){return exports.api.post("/omni/generateContractUploadUrl",null,{headers:{"X-Incode-Hardware-Id":me}}).then(ue=>ue.data)}async function addDocument({token:me,type:ue,image:Ue,onProgress:Ze=emptyFunc}){if(ue==="contract"){const{url:Qe,contractId:Ge}=await addContract({token:me,image:b64toBlob(Ue)});return{success:!0,sessionStatus:"Alive",additionalInformation:{contractId:Ge,url:Qe}}}return exports.api.post(`/omni/add/document/v2?type=${ue}`,{base64Image:Ue},{headers:{"X-Incode-Hardware-Id":me},onUploadProgress:({loaded:Qe,total:Ge})=>Ze(Qe/Ge*100)}).then(Qe=>Qe.data).catch(Qe=>Promise.reject(Qe.response.data))}function addName({token:me,name:ue}){return exports.api.post("/omni/add/name",{name:ue},{headers:{"X-Incode-Hardware-Id":me}}).catch(Ue=>Promise.reject(Ue.response.data))}const addQrUrl="/omni/qr";function addQr({token:me}){return exports.api.get(addQrUrl,{headers:{"X-Incode-Hardware-Id":me}}).then(ue=>ue.data)}function approve({token:me}){return exports.api.post("/omni/process/approve",null,{headers:{"X-Incode-Hardware-Id":me}}).then(ue=>{const{uuid:Ue,...Ze}=ue.data;return{...Ze,customerId:Ue}}).catch(ue=>{var Ue;return Promise.reject((Ue=ue.response)==null?void 0:Ue.data)})}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
|
|
82
82
|
* @license React
|
|
83
83
|
* react-jsx-runtime.production.min.js
|
|
@@ -2872,7 +2872,7 @@ newPrivacyConsent.text4
|
|
|
2872
2872
|
`).filter(at=>!!at.trim());return jsxRuntimeExports.jsxs(ConsentWrapper$1,{role:"region","aria-live":"assertive",className:`
|
|
2873
2873
|
${ue.default?"IncodeDefaultConsent":"IncodeCustomConsent"}
|
|
2874
2874
|
`,children:[jsxRuntimeExports.jsx(ConsentTitle,{tabIndex:0,children:nt}),it.map((at,st)=>jsxRuntimeExports.jsx(ConsentParagraph,{tabIndex:0,children:ue.default?jsxRuntimeExports.jsx(Markdown,{disallowedElements:disallowedMarkdownElements,children:Ge(at)}):jsxRuntimeExports.jsx(Markdown,{disallowedElements:disallowedMarkdownElements,children:at})},st)),jsxRuntimeExports.jsx(AcceptCheck$2,{consentChecked:Je,setConsentChecked:Xe,text:tt,id:"one"}),Qe?jsxRuntimeExports.jsx(AcceptCheck$2,{consentChecked:Ke,setConsentChecked:He,text:Ge("privacyCheck.aeromexico"),id:"two"}):null,jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Button$a,{tabIndex:0,"aria-disabled":et,disabled:et,onClick:$e,children:Ge("privacyConsent.button.continue")})})]})}function PrivacyConsent({session:me,title:ue,text:Ue,goNext:Ze,isAeroMexicoClient:Qe}){const{t:Ge}=useTranslation(),[Je,Xe]=React.useState(null);React.useEffect(()=>{Object.hasOwn||(Object.hasOwn=($e,tt)=>Object.prototype.hasOwnProperty.call($e,tt))},[]);const Ke=$e=>{const tt=$e.split(`
|
|
2875
|
-
`);return tt.length===1?tt.join(" "):tt.filter(et=>!!et.trim()).map(et=>Ge(et)).join(" ")},He=({title:$e,content:tt,isDefault:et})=>{addConsent({title:`${et?Ge($e):$e}`,content:et?Ke(tt):tt,status:!0,session:me})};return React.useEffect(()=>{if(ue||Ue){Xe({title:ue||defaultPrivacyConsent.title,text:Ue||defaultPrivacyConsent.text,consentType:defaultPrivacyConsent.consentType,default:!Ue});return}getPrivacyConsentData({session:me,type:"PRIVACY"}).then(({consents:$e})=>{const tt=$e.find(({consentType:et})=>et==="PRIVACY");tt!=null&&tt.text?Xe({...tt,title:(tt==null?void 0:tt.title.trim())||defaultPrivacyConsent.title,text:tt.text.trim()||defaultPrivacyConsent.text,default:!(tt!=null&&tt.text)}):Xe(defaultPrivacyConsent)}).catch(()=>{Xe(defaultPrivacyConsent)})},[me,ue,Ue]),Je?jsxRuntimeExports.jsx(NormalPrivacyConsent,{consent:Je,goNext:Ze,addPrivacyConsent:He,session:me,isAeroMexicoClient:Qe}):null}function renderUserConsent(me,{session:ue,onSuccess:Ue,title:Ze,text:Qe,isAeroMexicoClient:Ge=!1}){const Je=createRoot$1(me),Xe=handleUnmountRoot(Ue,Je,me);customRender(jsxRuntimeExports.jsx(App$1,{token:ue.token,children:jsxRuntimeExports.jsx(PrivacyConsent,{goNext:Xe,session:ue,title:Ze,text:Qe,isAeroMexicoClient:Ge})}),me,Je)}const version$1="1.76.1
|
|
2875
|
+
`);return tt.length===1?tt.join(" "):tt.filter(et=>!!et.trim()).map(et=>Ge(et)).join(" ")},He=({title:$e,content:tt,isDefault:et})=>{addConsent({title:`${et?Ge($e):$e}`,content:et?Ke(tt):tt,status:!0,session:me})};return React.useEffect(()=>{if(ue||Ue){Xe({title:ue||defaultPrivacyConsent.title,text:Ue||defaultPrivacyConsent.text,consentType:defaultPrivacyConsent.consentType,default:!Ue});return}getPrivacyConsentData({session:me,type:"PRIVACY"}).then(({consents:$e})=>{const tt=$e.find(({consentType:et})=>et==="PRIVACY");tt!=null&&tt.text?Xe({...tt,title:(tt==null?void 0:tt.title.trim())||defaultPrivacyConsent.title,text:tt.text.trim()||defaultPrivacyConsent.text,default:!(tt!=null&&tt.text)}):Xe(defaultPrivacyConsent)}).catch(()=>{Xe(defaultPrivacyConsent)})},[me,ue,Ue]),Je?jsxRuntimeExports.jsx(NormalPrivacyConsent,{consent:Je,goNext:Ze,addPrivacyConsent:He,session:me,isAeroMexicoClient:Qe}):null}function renderUserConsent(me,{session:ue,onSuccess:Ue,title:Ze,text:Qe,isAeroMexicoClient:Ge=!1}){const Je=createRoot$1(me),Xe=handleUnmountRoot(Ue,Je,me);customRender(jsxRuntimeExports.jsx(App$1,{token:ue.token,children:jsxRuntimeExports.jsx(PrivacyConsent,{goNext:Xe,session:ue,title:Ze,text:Qe,isAeroMexicoClient:Ge})}),me,Je)}const version$1="1.76.1";function r$1(me){for(var ue="",Ue=0;Ue<me.length;++Ue)if(Ue>0){var Ze=me[Ue].toLowerCase();Ze!==me[Ue]?ue+=" ".concat(Ze):ue+=me[Ue]}else ue+=me[Ue].toUpperCase();return ue}function o(me,ue){return function(Ue,Ze){return Object.prototype.hasOwnProperty.call(Ue,Ze)}(me,ue)?me[ue]:void 0}var i$1={default:"endpoint"},u={default:"tlsEndpoint"},a="Client timeout",R="Network connection error",c="Network request aborted",s="Response cannot be parsed",E="Blocked by CSP",f="The endpoint parameter is not a valid URL",d=r$1("WrongRegion"),l=r$1("SubscriptionNotActive"),_=r$1("UnsupportedVersion"),p=r$1("InstallationMethodRestricted"),v=r$1("HostnameRestricted"),O=r$1("IntegrationFailed"),I="API key required",h="API key not found",N="API key expired",T="Request cannot be parsed",m="Request failed",w="Request failed to process",A="Too many requests, rate limit exceeded",P="Not available for this origin",y="Not available with restricted header",D=I,S=h,L=N,U="3.8.6",b="9319";function g(me,ue){var Ue=[];return function(Ze,Qe){var Ge=5,Je=(et=Ze,nt=__spreadArray$1([],et,!0),{current:function(){return nt[0]},postpone:function(){var at=nt.shift();at!==void 0&&nt.push(at)},exclude:function(){nt.shift()}}),Xe=(He=100,$e=3e3,tt=0,function(){return Math.random()*Math.min($e,He*Math.pow(2,tt++))}),Ke=Je.current(),He,$e,tt,et,nt;if(Ke===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var it=function(at,st){return Qe(at).catch(function(rt){if(st+1>=Ge)throw rt;(function(dt){if(!(dt instanceof Error))return!1;var ut=dt.message;return ut===E||ut===b})(rt)?Je.exclude():Je.postpone();var ot,lt=Je.current();if(lt===void 0)throw rt;return(ot=Xe(),new Promise(function(dt){return setTimeout(dt,ot)})).then(function(){return it(lt,st+1)})})};return it(Ke,0)}(me,function(Ze){var Qe=new Date,Ge=function(Xe){return Ue.push({url:Ze,startedAt:Qe,finishedAt:new Date,error:Xe})},Je=ue(Ze);return Je.then(function(){return Ge()},Ge),Je}).then(function(Ze){return[Ze,Ue]})}var C="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",K=C,M="Failed to load the JS script of the agent";function B(me){var ue;me.scriptUrlPattern;var Ue=me.token,Ze=me.apiKey,Qe=Ze===void 0?Ue:Ze,Ge=__rest$3(me,["scriptUrlPattern","token","apiKey"]),Je=(ue=o(me,"scriptUrlPattern"))!==null&&ue!==void 0?ue:C,Xe=function(){var $e=[],tt=function(){$e.push({time:new Date,state:document.visibilityState})},et=function(nt,it,at,st){return nt.addEventListener(it,at,st),function(){return nt.removeEventListener(it,at,st)}}(document,"visibilitychange",tt);return tt(),[$e,et]}(),Ke=Xe[0],He=Xe[1];return Promise.resolve().then(function(){if(!Qe||typeof Qe!="string")throw new Error(I);var $e=function(tt,et){return(Array.isArray(tt)?tt:[tt]).map(function(nt){return function(it,at){var st=encodeURIComponent;return it.replace(/<[^<>]+>/g,function(rt){return rt==="<version>"?"3":rt==="<apiKey>"?st(at):rt==="<loaderVersion>"?st(U):rt})}(String(nt),et)})}(Je,Qe);return g($e,F)}).catch(function($e){throw He(),function(tt){return tt instanceof Error&&tt.message===b?new Error(M):tt}($e)}).then(function($e){var tt=$e[0],et=$e[1];return He(),tt.load(__assign$2(__assign$2({},Ge),{ldi:{attempts:et,visibilityStates:Ke}}))})}function F(me){return function(ue,Ue,Ze,Qe){var Ge,Je=document,Xe="securitypolicyviolation",Ke=function($e){var tt=new URL(ue,location.href),et=$e.blockedURI;et!==tt.href&&et!==tt.protocol.slice(0,-1)&&et!==tt.origin||(Ge=$e,He())};Je.addEventListener(Xe,Ke);var He=function(){return Je.removeEventListener(Xe,Ke)};return Promise.resolve().then(Ue).then(function($e){return He(),$e},function($e){return new Promise(function(tt){return setTimeout(tt)}).then(function(){if(He(),Ge)return Ze(Ge);throw $e})})}(me,function(){return function(ue){return new Promise(function(Ue,Ze){var Qe=document.createElement("script"),Ge=function(){var Xe;return(Xe=Qe.parentNode)===null||Xe===void 0?void 0:Xe.removeChild(Qe)},Je=document.head||document.getElementsByTagName("head")[0];Qe.onload=function(){Ge(),Ue()},Qe.onerror=function(){Ge(),Ze(new Error(M))},Qe.async=!0,Qe.src=ue,Je.appendChild(Qe)})}(me)},function(){throw new Error(E)}).then(V)}function V(){var me=window,ue="__fpjs_p_l_b",Ue=me[ue];if(function(Ze,Qe){var Ge,Je=(Ge=Object.getOwnPropertyDescriptor)===null||Ge===void 0?void 0:Ge.call(Object,Ze,Qe);Je!=null&&Je.configurable?delete Ze[Qe]:Je&&!Je.writable||(Ze[Qe]=void 0)}(me,ue),typeof(Ue==null?void 0:Ue.load)!="function")throw new Error(b);return Ue}var k={load:B,defaultScriptUrlPattern:K,ERROR_SCRIPT_LOAD_FAIL:M,ERROR_API_KEY_EXPIRED:N,ERROR_API_KEY_INVALID:h,ERROR_API_KEY_MISSING:I,ERROR_BAD_REQUEST_FORMAT:T,ERROR_BAD_RESPONSE_FORMAT:s,ERROR_CLIENT_TIMEOUT:a,ERROR_CSP_BLOCK:E,ERROR_FORBIDDEN_ENDPOINT:v,ERROR_FORBIDDEN_HEADER:y,ERROR_FORBIDDEN_ORIGIN:P,ERROR_GENERAL_SERVER_FAILURE:m,ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_INTEGRATION_FAILURE:O,ERROR_INVALID_ENDPOINT:f,ERROR_NETWORK_ABORT:c,ERROR_NETWORK_CONNECTION:R,ERROR_RATE_LIMIT:A,ERROR_SERVER_TIMEOUT:w,ERROR_SUBSCRIPTION_NOT_ACTIVE:l,ERROR_TOKEN_EXPIRED:L,ERROR_TOKEN_INVALID:S,ERROR_TOKEN_MISSING:D,ERROR_UNSUPPORTED_VERSION:_,ERROR_WRONG_REGION:d,defaultEndpoint:i$1,defaultTlsEndpoint:u};let fingerprintApiKey;function setFingerprintApiKey(me){fingerprintApiKey=me}async function getFingerPrint(){return k.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(me=>me.get({extendedResult:!0}))}const fingerPrintUrl="/omni/add/device-fingerprint";function postFingerprint({hash:me,ip:ue,deviceType:Ue,token:Ze,data:Qe,osVersion:Ge,deviceModel:Je,browser:Xe,sdkVersion:Ke,hasLiedBrowser:He,hostingApp:$e,ipLocation:tt}){return exports.api.post(fingerPrintUrl,{hash:me,ip:ue,deviceType:Ue,data:Qe,osVersion:Ge,deviceModel:Je,browser:Xe,hasLiedBrowser:He,sdkVersion:Ke,hostingApp:$e,ipLocation:tt},{headers:{"X-Incode-Hardware-Id":Ze}}).then(et=>et.data).catch(et=>Promise.reject(et.response.data))}function formatDeviceModel({vendor:me,model:ue}){return`${me||""} ${ue||""}`.trim()}const emptyFingerprint={visitorId:void 0,ip:void 0,ipLocation:{country:{name:void 0},subdivisions:[],city:{name:void 0},latitude:void 0,longitude:void 0}};async function sendFingerprint({token:me},ue=!0,Ue=!0){var Ke,He,$e;const Ze="WEBAPP",{os:Qe,device:Ge,browser:Je}=getUAParserResults(),Xe=Ue?await getFingerPrint().catch(tt=>(addEvent({code:"fingerprintFetchFailed",payload:{message:tt.message},token:me}),emptyFingerprint)):emptyFingerprint;return postFingerprint({hash:Xe.visitorId||"",ip:ue&&Xe.ip||"",deviceType:Ze,token:me,data:JSON.stringify(Xe),osVersion:`${Qe.name} ${Qe.version}`,deviceModel:formatDeviceModel(Ge),browser:`${Je.name} ${Je.version}`,hasLiedBrowser:isBrowserSimulation(),hostingApp:options.hostingApp,sdkVersion:version$1,ipLocation:{ipCountry:(Ke=Xe.ipLocation.country)==null?void 0:Ke.name,ipRegion:(He=Xe.ipLocation.subdivisions)==null?void 0:He[0].name,ipCity:($e=Xe.ipLocation.city)==null?void 0:$e.name,ipLatitude:Xe.ipLocation.latitude,ipLongitude:Xe.ipLocation.longitude}}).then(tt=>(emptyDeviceStatsQueue(me),tt))}var sha1$1={exports:{}};/*
|
|
2876
2876
|
* [js-sha1]{@link https://github.com/emn178/js-sha1}
|
|
2877
2877
|
*
|
|
2878
2878
|
* @version 0.6.0
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "./dist/onBoarding.umd.js",
|
|
4
4
|
"module": "./dist/onBoarding.mjs",
|
|
5
5
|
"types": "./dist/incode-welcome/src/index.d.ts",
|
|
6
|
-
"version": "1.76.1
|
|
6
|
+
"version": "1.76.1",
|
|
7
7
|
"publishConfig": {},
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist/**"
|
|
22
|
-
],
|
|
20
|
+
"files": ["dist/**"],
|
|
23
21
|
"scripts": {
|
|
24
22
|
"dev": "vite",
|
|
25
23
|
"test": "vitest",
|