@incodetech/welcome 1.85.0-20251103184219.0 → 1.85.0-20251103200526.0

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.
@@ -63,7 +63,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[St]+=1);const breakpoints$3={
63
63
  justify-content: center;
64
64
  align-items: center;
65
65
  flex-direction: column;
66
- `;typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let Be,Le;return{promise:new Promise((tt,nt)=>{Be=tt,Le=nt}),resolve:Be,reject:Le}});class InterruptionHandler{constructor(){this.boundVisibilityChange=this.handleVisibilityChange.bind(this),this.boundOnline=this.handleOnline.bind(this),this.boundOffline=this.handleOffline.bind(this),this.boundUnhandledRejection=this.handleUnhandledRejection.bind(this),this.boundError=this.handleError.bind(this),this.initialized=!1}registerEventListeners(){this.initialized||(document.addEventListener("visibilitychange",this.boundVisibilityChange),window.addEventListener("online",this.boundOnline),window.addEventListener("offline",this.boundOffline),window.addEventListener("unhandledrejection",this.boundUnhandledRejection),window.addEventListener("error",this.boundError),this.initialized=!0)}removeEventListeners(){this.initialized&&(this.initialized=!1,document.removeEventListener("visibilitychange",this.boundVisibilityChange),window.removeEventListener("online",this.boundOnline),window.removeEventListener("offline",this.boundOffline),window.removeEventListener("unhandledrejection",this.boundUnhandledRejection),window.removeEventListener("error",this.boundError))}handleVisibilityChange(){document.hidden?this.onAppHidden():this.onAppVisible()}onAppHidden(){}onAppVisible(){}handleOnline(){}handleOffline(){}handleUnhandledRejection(Le){}handleError(Le){}}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,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};function webgl(){let Be,Le,Ye=256,tt=128;Be=document.body.appendChild(document.createElement("canvas")),Be.width=Ye,Be.height=tt;try{Le=Be.getContext("webgl2")||Be.getContext("experimental-webgl2")||Be.getContext("webgl")||Be.getContext("experimental-webgl")||Be.getContext("moz-webgl");const nt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",ft="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",ht=Le.createBuffer();Le.bindBuffer(Le.ARRAY_BUFFER,ht);const gt=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);Le.bufferData(Le.ARRAY_BUFFER,gt,Le.STATIC_DRAW),ht.itemSize=3,ht.numItems=3;const At=Le.createProgram(),xt=Le.createShader(Le.VERTEX_SHADER);Le.shaderSource(xt,nt),Le.compileShader(xt);const yt=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(yt,ft),Le.compileShader(yt),Le.attachShader(At,xt),Le.attachShader(At,yt),Le.linkProgram(At),Le.useProgram(At),At.vertexPosAttrib=Le.getAttribLocation(At,"attrVertex"),At.offsetUniform=Le.getUniformLocation(At,"uniformOffset"),Le.enableVertexAttribArray(At.vertexPosAttrib),Le.vertexAttribPointer(At.vertexPosAttrib,ht.itemSize,Le.FLOAT,!1,0,0),Le.uniform2f(At.offsetUniform,1,1),Le.drawArrays(Le.TRIANGLE_STRIP,0,ht.numItems);let Ct="";const Et=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Et),Ct=JSON.stringify(Et).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(Ct)}catch{return""}}const sha256=(()=>{let Be=1,Le,Ye=[],tt=[];for(;++Be<18;)for(Le=Be*Be;Le<312;Le+=Be)Ye[Le]=1;function nt(gt,At){return Math.pow(gt,1/At)%1*4294967296|0}for(Be=1,Le=0;Be<313;)Ye[++Be]||(tt[Le]=nt(Be,2),Ye[Le++]=nt(Be,3));function ft(gt,At){return gt>>>At|gt<<32-At}function ht(gt){let At=tt.slice(Be=0),xt=unescape(encodeURI(gt)),yt=[],Ct=xt.length,Et=[],vt,kt,bt;for(;Be<Ct;)Et[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(Ct*=8,Et[Ct>>5]|=128<<24-Ct%32,Et[bt=Ct+64>>5|15]=Ct,Be=0;Be<bt;Be+=16){for(vt=At.slice(Le=0,8);Le<64;vt[4]+=kt)Le<16?yt[Le]=Et[Le+Be]:yt[Le]=(ft(kt=yt[Le-2],17)^ft(kt,19)^kt>>>10)+(yt[Le-7]|0)+(ft(kt=yt[Le-15],7)^ft(kt,18)^kt>>>3)+(yt[Le-16]|0),vt.unshift((kt=(vt.pop()+(ft(gt=vt[4],6)^ft(gt,11)^ft(gt,25))+((gt&vt[5]^~gt&vt[6])+Ye[Le])|0)+(yt[Le++]|0))+(ft(Ct=vt[0],2)^ft(Ct,13)^ft(Ct,22))+(Ct&vt[1]^vt[1]&vt[2]^vt[2]&Ct));for(Le=8;Le--;)At[Le]=vt[Le]+At[Le]}for(xt="";Le<63;)xt+=(At[++Le>>3]>>4*(7-Le%8)&15).toString(16);return xt}return ht})();var store;function getGlobalConfig(Be){return{lang:store==null?void 0:store.lang,message:Be==null?void 0:Be.message,abortEarly:store==null?void 0:store.abortEarly,abortPipeEarly:store==null?void 0:store.abortPipeEarly}}var store2;function getGlobalMessage(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$3(Be){var Ye,tt;const Le=typeof Be;return Le==="string"?`"${Be}"`:Le==="number"||Le==="bigint"||Le==="boolean"?`${Be}`:Le==="object"||Le==="function"?(Be&&((tt=(Ye=Object.getPrototypeOf(Be))==null?void 0:Ye.constructor)==null?void 0:tt.name))??"null":Le}function _addIssue(Be,Le,Ye,tt,nt){const ft=nt&&"input"in nt?nt.input:Ye.value,ht=(nt==null?void 0:nt.expected)??Be.expects??null,gt=(nt==null?void 0:nt.received)??_stringify$3(ft),At={kind:Be.kind,type:Be.type,input:ft,expected:ht,received:gt,message:`Invalid ${Le}: ${ht?`Expected ${ht} but r`:"R"}eceived ${gt}`,requirement:Be.requirement,path:nt==null?void 0:nt.path,issues:nt==null?void 0:nt.issues,lang:tt.lang,abortEarly:tt.abortEarly,abortPipeEarly:tt.abortPipeEarly},xt=Be.kind==="schema",yt=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage(Be.reference,At.lang)??(xt?getSchemaMessage(At.lang):null)??tt.message??getGlobalMessage(At.lang);yt!==void 0&&(At.message=typeof yt=="function"?yt(At):yt),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig())}}}function _isValidObjectKey(Be,Le){return Object.hasOwn(Be,Le)&&Le!=="__proto__"&&Le!=="prototype"&&Le!=="constructor"}function _joinExpects(Be,Le){const Ye=[...new Set(Be)];return Ye.length>1?`(${Ye.join(` ${Le} `)})`:Ye[0]??"never"}function isValiError(Be){return Be instanceof ValiError}var ValiError=class extends Error{constructor(Be){super(Be[0].message),this.name="ValiError",this.issues=Be}};function getFallback(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault(Be,Le,Ye){return typeof Be.default=="function"?Be.default(Le,Ye):Be.default}function boolean$2(Be){return{kind:"schema",type:"boolean",reference:boolean$2,expects:"boolean",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function custom(Be,Le){return{kind:"schema",type:"custom",reference:custom,expects:"unknown",async:!1,check:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue(this,"type",Ye,tt),Ye}}}function function_(Be){return{kind:"schema",type:"function",reference:function_,expects:"Function",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$3(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue(this,"type",Ye,tt),Ye}}}function null_(Be){return{kind:"schema",type:"null",reference:null_,expects:"null",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function number$3(Be){return{kind:"schema",type:"number",reference:number$3,expects:"number",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function object(Be,Le){return{kind:"schema",type:"object",reference:object,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){var ft;const nt=Ye.value;if(nt&&typeof nt=="object"){Ye.typed=!0,Ye.value={};for(const ht in this.entries){const gt=this.entries[ht];if(ht in nt||(gt.type==="exact_optional"||gt.type==="optional"||gt.type==="nullish")&&gt.default!==void 0){const At=ht in nt?nt[ht]:getDefault(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const yt={type:"object",origin:"value",input:nt,key:ht,value:At};for(const Ct of xt.issues)Ct.path?Ct.path.unshift(yt):Ct.path=[yt],(ft=Ye.issues)==null||ft.push(Ct);if(Ye.issues||(Ye.issues=xt.issues),tt.abortEarly){Ye.typed=!1;break}}xt.typed||(Ye.typed=!1),Ye.value[ht]=xt.value}else if(gt.fallback!==void 0)Ye.value[ht]=getFallback(gt);else if(gt.type!=="exact_optional"&&gt.type!=="optional"&&gt.type!=="nullish"&&(_addIssue(this,"key",Ye,tt,{input:void 0,expected:`"${ht}"`,path:[{type:"object",origin:"key",input:nt,key:ht,value:nt[ht]}]}),tt.abortEarly))break}}else _addIssue(this,"type",Ye,tt);return Ye}}}function optional(Be,Le){return{kind:"schema",type:"optional",reference:optional,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function record(Be,Le,Ye){return{kind:"schema",type:"record",reference:record,expects:"Object",async:!1,key:Be,value:Le,message:Ye,get"~standard"(){return _getStandardProps(this)},"~run"(tt,nt){var ht,gt;const ft=tt.value;if(ft&&typeof ft=="object"){tt.typed=!0,tt.value={};for(const At in ft)if(_isValidObjectKey(ft,At)){const xt=ft[At],yt=this.key["~run"]({value:At},nt);if(yt.issues){const Et={type:"object",origin:"key",input:ft,key:At,value:xt};for(const vt of yt.issues)vt.path=[Et],(ht=tt.issues)==null||ht.push(vt);if(tt.issues||(tt.issues=yt.issues),nt.abortEarly){tt.typed=!1;break}}const Ct=this.value["~run"]({value:xt},nt);if(Ct.issues){const Et={type:"object",origin:"value",input:ft,key:At,value:xt};for(const vt of Ct.issues)vt.path?vt.path.unshift(Et):vt.path=[Et],(gt=tt.issues)==null||gt.push(vt);if(tt.issues||(tt.issues=Ct.issues),nt.abortEarly){tt.typed=!1;break}}(!yt.typed||!Ct.typed)&&(tt.typed=!1),yt.typed&&(tt.value[yt.value]=Ct.value)}}else _addIssue(this,"type",tt,nt);return tt}}}function string$2(Be){return{kind:"schema",type:"string",reference:string$2,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function _subIssues(Be){let Le;if(Be)for(const Ye of Be)Le?Le.push(...Ye.issues):Le=Ye.issues;return Le}function union(Be,Le){return{kind:"schema",type:"union",reference:union,expects:_joinExpects(Be.map(Ye=>Ye.expects),"|"),async:!1,options:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){let nt,ft,ht;for(const gt of this.options){const At=gt["~run"]({value:Ye.value},tt);if(At.typed)if(At.issues)ft?ft.push(At):ft=[At];else{nt=At;break}else ht?ht.push(At):ht=[At]}if(nt)return nt;if(ft){if(ft.length===1)return ft[0];_addIssue(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig(Ye));if(tt.issues)throw new ValiError(tt.issues);return tt.value}function validate$2(...Be){try{Be.forEach(({schema:Le,value:Ye})=>parse$8(Le,Ye))}catch(Le){if(isValiError(Le)){const Ye=Le.issues.map(tt=>{var ft;return`${((ft=tt.path)==null?void 0:ft.map(ht=>ht.key).join("."))||"root"}: ${tt.message}`}).join(", ");throw new Error(`Validation failed: ${Ye}`)}throw Le}}exports.api=void 0;function setApi(Be){exports.api=Be}function setToken(Be){exports.api.defaults.headers["X-Incode-Hardware-Id"]=Be}const eventsQueue=[];function addEvent(Be){const{token:Le,code:Ye,module:tt,screen:nt,clientTimestamp:ft,payload:ht={}}=Be;if(!Le){eventsQueue.push(Be);return}return exports.api.post("/omni/interview-events",[{code:Ye,module:tt,screen:nt,clientTimestamp:ft??new Date().getTime(),payload:ht}],{headers:{"X-Incode-Hardware-Id":Le}}).catch(()=>{})}function emptyQueue(Be){eventsQueue.forEach(Le=>{addEvent({...Le,token:Be})})}const state={token:null};var PipelineProfileName=(Be=>(Be[Be.IdCapture_2_01=0]="IdCapture_2_01",Be[Be.IdCapture_2_02=1]="IdCapture_2_02",Be[Be.IdCapture_3_02=2]="IdCapture_3_02",Be[Be.IdVideoSelfie_2_01=3]="IdVideoSelfie_2_01",Be[Be.SelfieWithAggregationMetrics=4]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=5]="SelfieWithQualityMetrics",Be[Be.SelfieVideoSelfie=6]="SelfieVideoSelfie",Be))(PipelineProfileName||{});class PipelineProfile{constructor(Le,Ye,tt,nt,ft,ht=null,gt=""){this.pipelineType=Le,this.name=Ye,this.detectionType=tt,this.modelNames=nt,this.parameters=ft,this.paramsConfigurator=ht,this.description=gt}reconfigureParams(Le,Ye){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,Le,Ye)}}var DetectionType=(Be=>(Be[Be.IDCapture=0]="IDCapture",Be[Be.Selfie=1]="Selfie",Be[Be.SelfieVideoSelfie=2]="SelfieVideoSelfie",Be[Be.IdVideoSelfie=3]="IdVideoSelfie",Be))(DetectionType||{}),WasmPipelineType=(Be=>(Be[Be.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",Be[Be.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",Be[Be.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",Be[Be.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",Be[Be.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",Be))(WasmPipelineType||{}),IdCaptureModelType=(Be=>(Be[Be.IdCaptureV1x=0]="IdCaptureV1x",Be[Be.IdCaptureV2x=1]="IdCaptureV2x",Be[Be.IdCaptureV3x=2]="IdCaptureV3x",Be))(IdCaptureModelType||{}),src$2={},src$1={},$_StatsigGlobal={},Log={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Log=Be.LogLevel=void 0;const Le=" DEBUG ",Ye=" INFO ",tt=" WARN ",nt=" ERROR ";function ft(gt){return gt.unshift("[Statsig]"),gt}Be.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class ht{static info(...At){ht.level>=Be.LogLevel.Info&&console.info(Ye,...ft(At))}static debug(...At){ht.level>=Be.LogLevel.Debug&&console.debug(Le,...ft(At))}static warn(...At){ht.level>=Be.LogLevel.Warn&&console.warn(tt,...ft(At))}static error(...At){ht.level>=Be.LogLevel.Error&&console.error(nt,...ft(At))}}Be.Log=ht,ht.level=Be.LogLevel.Warn})(Log),function(Be){var Le,Ye,tt;Object.defineProperty(Be,"__esModule",{value:!0}),Be._getInstance=Be._getStatsigGlobalFlag=Be._getStatsigGlobal=void 0;const nt=Log,ft=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Et}catch{return Et}};Be._getStatsigGlobal=ft;const ht=vt=>(0,Be._getStatsigGlobal)()[vt];Be._getStatsigGlobalFlag=ht;const gt=vt=>{const kt=(0,Be._getStatsigGlobal)();return vt?kt.instances&&kt.instances[vt]:(kt.instances&&Object.keys(kt.instances).length>1&&nt.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."),kt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},yt=typeof commonjsGlobal<"u"?commonjsGlobal:{},Ct=typeof globalThis<"u"?globalThis:{},Et=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:yt[At])!==null&&Ye!==void 0?Ye:Ct[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Et,yt[At]=Et,Ct[At]=Et}($_StatsigGlobal);var Diagnostics={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Diagnostics=void 0;const Le=new Map,Ye="start",tt="end",nt="statsig::diagnostics";Be.Diagnostics={_getMarkers:xt=>Le.get(xt),_markInitOverallStart:xt=>{gt(xt,ft({},Ye,"overall"))},_markInitOverallEnd:(xt,yt,Ct)=>{gt(xt,ft({success:yt,error:yt?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:Ct},tt,"overall"))},_markInitNetworkReqStart:(xt,yt)=>{gt(xt,ft(yt,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,yt)=>{gt(xt,ft(yt,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,yt)=>{gt(xt,ft(yt,tt,"initialize","process"))},_clearMarkers:xt=>{Le.delete(xt)},_formatError(xt){if(xt&&typeof xt=="object")return{code:At(xt,"code"),name:At(xt,"name"),message:At(xt,"message")}},_getDiagnosticsData(xt,yt,Ct,Et){var vt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(vt=xt==null?void 0:xt.headers)===null||vt===void 0?void 0:vt.get("x-statsig-region"),isDelta:Ct.includes('"is_delta":true')===!0?!0:void 0,attempt:yt,error:Be.Diagnostics._formatError(Et)}},_enqueueDiagnosticsEvent(xt,yt,Ct,Et){const vt=Be.Diagnostics._getMarkers(Ct);if(vt==null||vt.length<=0)return-1;const kt=vt[vt.length-1].timestamp-vt[0].timestamp;Be.Diagnostics._clearMarkers(Ct);const bt=ht(xt,{context:"initialize",markers:vt.slice(),statsigOptions:Et});return yt.enqueue(bt),kt}};function ft(xt,yt,Ct,Et){return Object.assign({key:Ct,action:yt,step:Et,timestamp:Date.now()},xt)}function ht(xt,yt){return{eventName:nt,user:xt,value:null,metadata:yt,time:Date.now()}}function gt(xt,yt){var Ct;const Et=(Ct=Le.get(xt))!==null&&Ct!==void 0?Ct:[];Et.push(yt),Le.set(xt,Et)}function At(xt,yt){if(yt in xt)return xt[yt]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(Be){return Array.isArray(Be)?"array":typeof Be}TypingUtils._typeOf=_typeOf;function _isTypeMatch(Be,Le){const Ye=tt=>Array.isArray(tt)?"array":tt===null?"null":typeof tt;return Ye(Be)===Ye(Le)}TypingUtils._isTypeMatch=_isTypeMatch,function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getSortedObject=Be._DJB2Object=Be._DJB2=void 0;const Le=TypingUtils,Ye=ft=>{let ht=0;for(let gt=0;gt<ft.length;gt++){const At=ft.charCodeAt(gt);ht=(ht<<5)-ht+At,ht=ht&ht}return String(ht>>>0)};Be._DJB2=Ye;const tt=(ft,ht)=>(0,Be._DJB2)(JSON.stringify((0,Be._getSortedObject)(ft,ht)));Be._DJB2Object=tt;const nt=(ft,ht)=>{if(ft==null)return null;const gt=Object.keys(ft).sort(),At={};return gt.forEach(xt=>{const yt=ft[xt];if(ht===0||(0,Le._typeOf)(yt)!=="object"){At[xt]=yt;return}At[xt]=(0,Be._getSortedObject)(yt,ht!=null?ht-1:ht)}),At};Be._getSortedObject=nt}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$4=Hashing;function _getUserStorageKey(Be,Le,Ye){var tt;if(Ye)return Ye(Be,Le);const nt=Le&&Le.customIDs?Le.customIDs:{},ft=[`uid:${(tt=Le==null?void 0:Le.userID)!==null&&tt!==void 0?tt:""}`,`cids:${Object.keys(nt).sort((ht,gt)=>ht.localeCompare(gt)).map(ht=>`${ht}-${nt[ht]}`).join(",")}`,`k:${Be}`];return(0,Hashing_1$4._DJB2)(ft.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(Be,Le,Ye){return Le?_getUserStorageKey(Be,Le,Ye):(0,Hashing_1$4._DJB2)(`k:${Be}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.NetworkParam=Be.NetworkDefault=Be.Endpoint=void 0,Be.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},Be.NetworkDefault={[Be.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Be.Endpoint._initialize]:"https://featureassets.org/v1",[Be.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},Be.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(NetworkConfig);var SafeJs={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getUnloadEvent=Be._getCurrentPageUrlSafe=Be._addDocumentEventListenerSafe=Be._addWindowEventListenerSafe=Be._isServerEnv=Be._getDocumentSafe=Be._getWindowSafe=void 0;const Le=()=>typeof window<"u"?window:null;Be._getWindowSafe=Le;const Ye=()=>{var At;const xt=(0,Be._getWindowSafe)();return(At=xt==null?void 0:xt.document)!==null&&At!==void 0?At:null};Be._getDocumentSafe=Ye;const tt=()=>{if((0,Be._getDocumentSafe)()!==null)return!1;const At=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||At};Be._isServerEnv=tt;const nt=(At,xt)=>{const yt=(0,Be._getWindowSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const yt=(0,Be._getDocumentSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.addEventListener(At,xt)};Be._addDocumentEventListenerSafe=ft;const ht=()=>{var At;try{return(At=(0,Be._getWindowSafe)())===null||At===void 0?void 0:At.location.href.split(/[?#]/)[0]}catch{return}};Be._getCurrentPageUrlSafe=ht;const gt=()=>{const At=(0,Be._getWindowSafe)();return At&&"onpagehide"in At?"pagehide":"beforeunload"};Be._getUnloadEvent=gt})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._mapExposures=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=(Be,Le,Ye,tt,nt)=>(Ye.bootstrapMetadata&&(tt.bootstrapMetadata=Ye.bootstrapMetadata),{eventName:Be,user:Le,value:null,metadata:_addEvaluationDetailsToMetadata(Ye,tt),secondaryExposures:nt,time:Date.now()}),_isExposureEvent=({eventName:Be})=>Be===GATE_EXPOSURE_NAME||Be===CONFIG_EXPOSURE_NAME||Be===LAYER_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(Be,Le,Ye)=>{var tt,nt,ft;const ht={gate:Le.name,gateValue:String(Le.value),ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(ht.configVersion=Le.__evaluation.version),_createExposure(GATE_EXPOSURE_NAME,Be,Le.details,ht,_mapExposures((ft=(nt=Le.__evaluation)===null||nt===void 0?void 0:nt.secondary_exposures)!==null&&ft!==void 0?ft:[],Ye))};StatsigEvent._createGateExposure=_createGateExposure;function _mapExposures(Be,Le){return Be.map(Ye=>typeof Ye=="string"?(Le??{})[Ye]:Ye).filter(Ye=>Ye!=null)}StatsigEvent._mapExposures=_mapExposures;const _createConfigExposure=(Be,Le,Ye)=>{var tt,nt,ft,ht;const gt={config:Le.name,ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(gt.configVersion=Le.__evaluation.version),((nt=Le.__evaluation)===null||nt===void 0?void 0:nt.passed)!=null&&(gt.rulePassed=String(Le.__evaluation.passed)),_createExposure(CONFIG_EXPOSURE_NAME,Be,Le.details,gt,_mapExposures((ht=(ft=Le.__evaluation)===null||ft===void 0?void 0:ft.secondary_exposures)!==null&&ht!==void 0?ht:[],Ye))};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(Be,Le,Ye,tt)=>{var nt,ft,ht,gt,At,xt,yt;const Ct=Le.__evaluation,Et=((nt=Ct==null?void 0:Ct.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let vt="",kt=(ft=Ct==null?void 0:Ct.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Et&&(vt=(ht=Ct.allocated_experiment_name)!==null&&ht!==void 0?ht:"",kt=(gt=Ct.secondary_exposures)!==null&&gt!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,wt={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:vt,isExplicitParameter:String(Et)};return((yt=Le.__evaluation)===null||yt===void 0?void 0:yt.version)!=null&&(wt.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,wt,_mapExposures(kt,tt))};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(Be,Le)=>(Le.reason=Be.reason,Be.lcut&&(Le.lcut=String(Be.lcut)),Be.receivedAt&&(Le.receivedAt=String(Be.receivedAt)),Le);var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0}),StatsigOptionsCommon.LoggingEnabledOption=StatsigOptionsCommon.LogEventCompressionMode=void 0,StatsigOptionsCommon.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},StatsigOptionsCommon.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"};var StorageProvider={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._setObjectInStorage=Be._getObjectFromStorage=Be.Storage=void 0;const Le=Log,Ye=SafeJs,tt={},nt={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:Ct=>tt[Ct]?tt[Ct]:null,setItem:(Ct,Et)=>{tt[Ct]=Et},removeItem:Ct=>{delete tt[Ct]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const Ct=(0,Ye._getWindowSafe)();Ct&&Ct.localStorage&&typeof Ct.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Et=>Ct.localStorage.getItem(Et),setItem:(Et,vt)=>Ct.localStorage.setItem(Et,vt),removeItem:Et=>Ct.localStorage.removeItem(Et),getAllKeys:()=>Object.keys(Ct.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(Ct){try{return Ct()}catch(Et){if(Et instanceof Error&&Et.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Et}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:Ct=>At(()=>gt.getItem(Ct)),setItem:(Ct,Et)=>At(()=>gt.setItem(Ct,Et)),removeItem:Ct=>gt.removeItem(Ct),getAllKeys:()=>gt.getAllKeys(),_setProvider:Ct=>{ht=Ct,gt=Ct},_setDisabled:Ct=>{Ct?gt=nt:gt=ht}};function xt(Ct){const Et=Be.Storage.getItem(Ct);return JSON.parse(Et??"null")}Be._getObjectFromStorage=xt;function yt(Ct,Et){Be.Storage.setItem(Ct,JSON.stringify(Et))}Be._setObjectInStorage=yt})(StorageProvider);var UrlConfiguration$1={};Object.defineProperty(UrlConfiguration$1,"__esModule",{value:!0}),UrlConfiguration$1.UrlConfiguration=void 0;const Hashing_1$3=Hashing,NetworkConfig_1$2=NetworkConfig,ENDPOINT_DNS_KEY_MAP={[NetworkConfig_1$2.Endpoint._initialize]:"i",[NetworkConfig_1$2.Endpoint._rgstr]:"e",[NetworkConfig_1$2.Endpoint._download_config_specs]:"d"};class UrlConfiguration{constructor(Le,Ye,tt,nt){this.customUrl=null,this.fallbackUrls=null,this.endpoint=Le,this.endpointDnsKey=ENDPOINT_DNS_KEY_MAP[Le],Ye&&(this.customUrl=Ye),!Ye&&tt&&(this.customUrl=tt.endsWith("/")?`${tt}${Le}`:`${tt}/${Le}`),nt&&(this.fallbackUrls=nt);const ft=NetworkConfig_1$2.NetworkDefault[Le];this.defaultUrl=`${ft}/${Le}`}getUrl(){var Le;return(Le=this.customUrl)!==null&&Le!==void 0?Le:this.defaultUrl}getChecksum(){var Le;const Ye=((Le=this.fallbackUrls)!==null&&Le!==void 0?Le:[]).sort().join(",");return(0,Hashing_1$3._DJB2)(this.customUrl+Ye)}}UrlConfiguration$1.UrlConfiguration=UrlConfiguration;var VisibilityObserving={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._notifyVisibilityChanged=Be._subscribeToVisiblityChanged=Be._isUnloading=Be._isCurrentlyVisible=void 0;const Le=SafeJs,Ye="foreground",tt="background",nt=[];let ft=Ye,ht=!1;const gt=()=>ft===Ye;Be._isCurrentlyVisible=gt;const At=()=>ht;Be._isUnloading=At;const xt=Ct=>{nt.unshift(Ct)};Be._subscribeToVisiblityChanged=xt;const yt=Ct=>{Ct!==ft&&(ft=Ct,nt.forEach(Et=>Et(Ct)))};Be._notifyVisibilityChanged=yt,(0,Le._addWindowEventListenerSafe)("focus",()=>{ht=!1,(0,Be._notifyVisibilityChanged)(Ye)}),(0,Le._addWindowEventListenerSafe)("blur",()=>(0,Be._notifyVisibilityChanged)(tt)),(0,Le._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Be._notifyVisibilityChanged)(document.visibilityState==="visible"?Ye:tt)}),(0,Le._addWindowEventListenerSafe)((0,Le._getUnloadEvent)(),()=>{ht=!0,(0,Be._notifyVisibilityChanged)(tt)})})(VisibilityObserving);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$2=Hashing,Log_1$8=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$3=SafeJs,StatsigEvent_1=StatsigEvent,StatsigOptionsCommon_1$2=StatsigOptionsCommon,StorageProvider_1$4=StorageProvider,UrlConfiguration_1=UrlConfiguration$1,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=100,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e5,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye.flush().catch(()=>{})}static _safeRetryFailedLogs(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(Le,Ye,tt,nt){var ft,ht;this._sdkKey=Le,this._emitter=Ye,this._network=tt,this._options=nt,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(ft=nt==null?void 0:nt.loggingEnabled)!==null&&ft!==void 0?ft:(nt==null?void 0:nt.disableLogging)===!0?StatsigOptionsCommon_1$2.LoggingEnabledOption.disabled:StatsigOptionsCommon_1$2.LoggingEnabledOption.browserOnly,nt!=null&&nt.loggingEnabled&&nt.disableLogging!==void 0&&Log_1$8.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(ht=nt==null?void 0:nt.loggingBufferMaxSize)!==null&&ht!==void 0?ht:DEFAULT_QUEUE_SIZE;const gt=nt==null?void 0:nt.networkConfig;this._logEventUrlConfig=new UrlConfiguration_1.UrlConfiguration(NetworkConfig_1$1.Endpoint._rgstr,gt==null?void 0:gt.logEventUrl,gt==null?void 0:gt.api,gt==null?void 0:gt.logEventFallbackUrls)}setLogEventCompressionMode(Le){this._network.setLogEventCompressionMode(Le)}setLoggingEnabled(Le){if(this._loggingEnabled==="disabled"&&Le!=="disabled"){const Ye=this._getStorageKey(),tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);tt&&this._queue.push(...tt),StorageProvider_1$4.Storage.removeItem(Ye)}this._loggingEnabled=Le}enqueue(Le){this._shouldLogEvent(Le)&&(this._normalizeAndAppendEvent(Le),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(Le){var Ye;const tt=(Ye=this._nonExposedChecks[Le])!==null&&Ye!==void 0?Ye:0;this._nonExposedChecks[Le]=tt+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var Le;const Ye=(0,SafeJs_1$3._isServerEnv)();Ye&&((Le=this._options)===null||Le===void 0?void 0:Le.loggingEnabled)!=="always"||(EVENT_LOGGER_MAP[this._sdkKey]=this,Ye||(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(tt=>{tt==="background"?EventLogger._safeFlushAndForget(this._sdkKey):tt==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$f(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$f(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const Le=this._queue;this._queue=[],yield this._sendEvents(Le)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(Le){var Ye;if(((Ye=this._options)===null||Ye===void 0?void 0:Ye.loggingEnabled)!=="always"&&(0,SafeJs_1$3._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(Le))return!0;const tt=Le.user?Le.user:{statsigEnvironment:void 0},nt=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,tt),ft=Le.metadata?Le.metadata:{},ht=[Le.eventName,nt,ft.gate,ft.config,ft.ruleID,ft.allocatedExperiment,ft.parameterName,String(ft.isExplicitParameter),ft.reason].join("|"),gt=this._lastExposureTimeMap[ht],At=Date.now();return gt&&At-gt<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[ht]=At,!0)}_sendEvents(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye,tt;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(Le),!1;try{const ft=(0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((tt=(Ye=this._options)===null||Ye===void 0?void 0:Ye.networkConfig)===null||tt===void 0?void 0:tt.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:Le}),(ft?this._sendEventsViaBeacon(Le):yield this._sendEventsViaPost(Le)).success?(this._emitter({name:"logs_flushed",events:Le}),!0):(Log_1$8.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(Le),!1)}catch{return Log_1$8.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye;const tt=yield this._network.post(this._getRequestData(Le)),nt=(Ye=tt==null?void 0:tt.code)!==null&&Ye!==void 0?Ye:-1;return{success:nt>=200&&nt<300}})}_sendEventsViaBeacon(Le){return{success:this._network.beacon(this._getRequestData(Le))}}_getRequestData(Le){return{sdkKey:this._sdkKey,data:{events:Le},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(Le.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(Le){for(;Le.length>MAX_FAILED_LOGS;)Le.shift();const Ye=this._getStorageKey();try{const tt=this._getFailedLogsFromStorage(Ye);(0,StorageProvider_1$4._setObjectInStorage)(Ye,[...tt,...Le])}catch{Log_1$8.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(Le){let Ye=[];try{const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Le);return Array.isArray(tt)&&(Ye=tt),Ye}catch{return[]}}_retryFailedLogs(Le){const Ye=this._getStorageKey();__awaiter$f(this,void 0,void 0,function*(){StorageProvider_1$4.Storage.isReady()||(yield StorageProvider_1$4.Storage.isReadyResolver());const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);if(!tt)return;Le===RetryFailedLogsTrigger.Startup&&StorageProvider_1$4.Storage.removeItem(Ye),(yield this._sendEvents(tt))&&Le===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$4.Storage.removeItem(Ye)}).catch(()=>{Log_1$8.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$2._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(Le){Le.user&&(Le.user=Object.assign({},Le.user),delete Le.user.privateAttributes);const Ye={},tt=this._getCurrentPageUrl();tt&&(Ye.statsigMetadata={currentPage:tt});const nt=Object.assign(Object.assign({},Le),Ye);Log_1$8.Log.debug("Enqueued Event:",nt),this._queue.push(nt)}_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 Le;if(((Le=this._options)===null||Le===void 0?void 0:Le.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$3._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var Le,Ye;const tt=(Ye=(Le=this._options)===null||Le===void 0?void 0:Le.loggingIntervalMs)!==null&&Ye!==void 0?Ye:DEFAULT_FLUSH_INTERVAL_MS,nt=setInterval(()=>{const ft=EVENT_LOGGER_MAP[this._sdkKey];!ft||ft._flushIntervalId!==nt?clearInterval(nt):EventLogger._safeFlushAndForget(this._sdkKey)},tt);this._flushIntervalId=nt}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigMetadataProvider=Be.SDK_VERSION=void 0,Be.SDK_VERSION="3.28.1";let Le={sdkVersion:Be.SDK_VERSION,sdkType:"js-mono"};Be.StatsigMetadataProvider={get:()=>Le,add:Ye=>{Le=Object.assign(Object.assign({},Le),Ye)}}})(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 Be=new Date().getTime(),Le=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,tt=>{let nt=Math.random()*16;return Be>0?(nt=(Be+nt)%16|0,Be=Math.floor(Be/16)):(nt=(Le+nt)%16|0,Le=Math.floor(Le/16)),(tt==="x"?nt:nt&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.getCookieName=StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$7=Log,SafeJs_1$2=SafeJs,StorageProvider_1$3=StorageProvider,UUID_1=UUID,PROMISE_MAP={},COOKIE_ENABLED_MAP={},DISABLED_MAP={};StableID.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:Be=>{if(DISABLED_MAP[Be])return null;if(PROMISE_MAP[Be]!=null)return PROMISE_MAP[Be];let Le=null;return Le=_loadFromCookie(Be),Le!=null?(PROMISE_MAP[Be]=Le,_persistToStorage(Le,Be),Le):(Le=_loadFromStorage(Be),Le==null&&(Le=(0,UUID_1.getUUID)()),_persistToStorage(Le,Be),_persistToCookie(Le,Be),PROMISE_MAP[Be]=Le,Le)},setOverride:(Be,Le)=>{PROMISE_MAP[Le]=Be,_persistToStorage(Be,Le),_persistToCookie(Be,Le)},_setCookiesEnabled:(Be,Le)=>{COOKIE_ENABLED_MAP[Be]=Le},_setDisabled:(Be,Le)=>{DISABLED_MAP[Be]=Le}};function _getStableIDStorageKey(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}function _persistToStorage(Be,Le){const Ye=_getStableIDStorageKey(Le);try{(0,StorageProvider_1$3._setObjectInStorage)(Ye,Be)}catch{Log_1$7.Log.warn("Failed to save StableID to storage")}}function _loadFromStorage(Be){const Le=_getStableIDStorageKey(Be);return(0,StorageProvider_1$3._getObjectFromStorage)(Le)}function _loadFromCookie(Be){if(!COOKIE_ENABLED_MAP[Be]||(0,SafeJs_1$2._getDocumentSafe)()==null)return null;const Le=document.cookie.split(";");for(const Ye of Le){const[tt,nt]=Ye.trim().split("=");if(tt===getCookieName(Be))return decodeURIComponent(nt)}return null}function _persistToCookie(Be,Le){if(!COOKIE_ENABLED_MAP[Le]||(0,SafeJs_1$2._getDocumentSafe)()==null)return;const Ye=new Date;Ye.setFullYear(Ye.getFullYear()+1),document.cookie=`${getCookieName(Le)}=${encodeURIComponent(Be)}; expires=${Ye.toUTCString()}; path=/`}function getCookieName(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}StableID.getCookieName=getCookieName;var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1$1=Hashing,Log_1$6=Log;function _normalizeUser(Be,Le,Ye){try{const tt=JSON.parse(JSON.stringify(Be));return Le!=null&&Le.environment!=null?tt.statsigEnvironment=Le.environment:Ye!=null&&(tt.statsigEnvironment={tier:Ye}),tt}catch{return Log_1$6.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(Be){return Be?(0,Hashing_1$1._DJB2Object)(Be):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$5=Log;function _typedJsonParse(Be,Le,Ye){try{const tt=JSON.parse(Be);if(tt&&typeof tt=="object"&&Le in tt)return tt}catch{}return Log_1$5.Log.error(`Failed to parse ${Ye}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1._makeDataAdapterResult=DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$4=Log,StableID_1$2=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$2=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10,MAX_CACHE_WRITE_ATTEMPTS=8;class DataAdapterCore{constructor(Le,Ye){this._adapterName=Le,this._cacheSuffix=Ye,this._options=null,this._sdkKey=null,this._cacheLimit=CACHE_LIMIT,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ye}`,this._inMemoryCache=new InMemoryCache}attach(Le,Ye,tt){this._sdkKey=Le,this._options=Ye}getDataSync(Le){const Ye=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),tt=this._getCacheKey(Ye),nt=this._inMemoryCache.get(tt,Ye);if(nt&&this._getIsCacheValueValid(nt))return nt;const ft=this._loadFromCache(tt);return ft&&this._getIsCacheValueValid(ft)?(this._inMemoryCache.add(tt,ft,this._cacheLimit),this._inMemoryCache.get(tt,Ye)):null}setData(Le,Ye){const tt=Ye&&(0,StatsigUser_1._normalizeUser)(Ye,this._options),nt=this._getCacheKey(tt);this._inMemoryCache.add(nt,_makeDataAdapterResult("Bootstrap",Le,null,tt),this._cacheLimit)}_getIsCacheValueValid(Le){return Le.stableID==null||Le.stableID===StableID_1$2.StableID.get(this._getSdkKey())}_getDataAsyncImpl(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){StorageProvider_1$2.Storage.isReady()||(yield StorageProvider_1$2.Storage.isReadyResolver());const nt=Le??this.getDataSync(Ye),ft=[this._fetchAndPrepFromNetwork(nt,Ye,tt)];return tt!=null&&tt.timeoutMs&&ft.push(new Promise(ht=>setTimeout(ht,tt.timeoutMs)).then(()=>(Log_1$4.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(ft)})}_prefetchDataImpl(Le,Ye){return __awaiter$e(this,void 0,void 0,function*(){const tt=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),nt=this._getCacheKey(tt),ft=yield this._getDataAsyncImpl(null,tt,Ye);ft&&this._inMemoryCache.add(nt,Object.assign(Object.assign({},ft),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){var nt;const ft=(nt=Le==null?void 0:Le.data)!==null&&nt!==void 0?nt:null,ht=Le!=null&&this._isCachedResultValidFor204(Le,Ye),gt=yield this._fetchFromNetwork(ft,Ye,tt,ht);if(!gt)return Log_1$4.Log.debug("No response returned for latest value"),null;const At=(0,TypedJsonParse_1._typedJsonParse)(gt,"has_updates","Response"),xt=this._getSdkKey(),yt=StableID_1$2.StableID.get(xt);let Ct=null;if((At==null?void 0:At.has_updates)===!0)Ct=_makeDataAdapterResult("Network",gt,yt,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)Ct=_makeDataAdapterResult("NetworkNotModified",ft,yt,Ye);else return null;const Et=this._getCacheKey(Ye);return this._inMemoryCache.add(Et,Ct,this._cacheLimit),this._writeToCache(Et,Ct),Ct})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$4.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(Le){var Ye;const tt=(Ye=StorageProvider_1$2.Storage.getItem)===null||Ye===void 0?void 0:Ye.call(StorageProvider_1$2.Storage,Le);if(tt==null)return null;const nt=(0,TypedJsonParse_1._typedJsonParse)(tt,"source","Cached Result");return nt?Object.assign(Object.assign({},nt),{source:"Cache"}):null}_writeToCache(Le,Ye){const tt=JSON.stringify(Ye);for(let nt=0;nt<MAX_CACHE_WRITE_ATTEMPTS;nt++)try{StorageProvider_1$2.Storage.setItem(Le,tt);break}catch(ft){if(!(ft instanceof Error)||!(ft.toString().includes("QuotaExceededError")||ft.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw ft;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(Le,this._cacheLimit-1)}this._runLocalStorageCacheEviction(Le)}_runLocalStorageCacheEviction(Le,Ye=this._cacheLimit){var tt;const nt=(tt=(0,StorageProvider_1$2._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&tt!==void 0?tt:{};nt[Le]=Date.now();const ft=_getEvictableKeys(nt,Ye);for(const ht of ft)delete nt[ht],StorageProvider_1$2.Storage.removeItem(ht);(0,StorageProvider_1$2._setObjectInStorage)(this._lastModifiedStoreKey,nt)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(Be,Le,Ye,tt){return{source:Be,data:Le,receivedAt:Date.now(),stableID:Ye,fullUserHash:(0,StatsigUser_1._getFullUserHash)(tt)}}DataAdapterCore$1._makeDataAdapterResult=_makeDataAdapterResult;class InMemoryCache{constructor(){this._data={}}get(Le,Ye){var tt;const nt=this._data[Le],ft=nt==null?void 0:nt.stableID,ht=(tt=Ye==null?void 0:Ye.customIDs)===null||tt===void 0?void 0:tt.stableID;return ht&&ft&&ht!==ft?(Log_1$4.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):nt}add(Le,Ye,tt){const nt=_getEvictableKeys(this._data,tt-1);for(const ft of nt)delete this._data[ft];this._data[Le]=Ye}merge(Le){this._data=Object.assign(Object.assign({},this._data),Le)}}function _getEvictableKeys(Be,Le){const Ye=Object.keys(Be);return Ye.length<=Le?[]:Le===0?Ye:Ye.sort((tt,nt)=>{const ft=Be[tt],ht=Be[nt];return typeof ft=="object"&&typeof ht=="object"?ft.receivedAt-ht.receivedAt:ft-ht}).slice(0,Ye.length-Le)}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:Be=>{var Le;return((Le=SDK_CLIENT[Be])!==null&&Le!==void 0?Le:"js-mono")+(suffix??"")},_setClientType(Be,Le){SDK_CLIENT[Be]=Le},_setBindingType(Be){(!suffix||suffix==="-react")&&(suffix="-"+Be)}},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__awaiter||function(Ct,Et,vt,kt){function bt(wt){return wt instanceof vt?wt:new vt(function(It){It(wt)})}return new(vt||(vt=Promise))(function(wt,It){function Rt(Pt){try{Bt(kt.next(Pt))}catch(Dt){It(Dt)}}function Tt(Pt){try{Bt(kt.throw(Pt))}catch(Dt){It(Dt)}}function Bt(Pt){Pt.done?wt(Pt.value):bt(Pt.value).then(Rt,Tt)}Bt((kt=kt.apply(Ct,Et||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.ErrorBoundary=Be.EXCEPTION_ENDPOINT=void 0;const Ye=Log,tt=SDKType,nt=StatsigMetadata;Be.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const ft="[Statsig] UnknownError";class ht{constructor(Et,vt,kt,bt){this._sdkKey=Et,this._options=vt,this._emitter=kt,this._lastSeenError=bt,this._seen=new Set}wrap(Et,vt){try{const kt=Et;xt(kt).forEach(bt=>{const wt=kt[bt];"$EB"in wt||(kt[bt]=(...It)=>this._capture(vt?`${vt}:${bt}`:bt,()=>wt.apply(Et,It)),kt[bt].$EB=!0)})}catch(kt){this._onError("eb:wrap",kt)}}logError(Et,vt){this._onError(Et,vt)}getLastSeenErrorAndReset(){const Et=this._lastSeenError;return this._lastSeenError=void 0,Et??null}attachErrorIfNoneExists(Et){this._lastSeenError||(this._lastSeenError=gt(Et))}_capture(Et,vt){try{const kt=vt();return kt&&kt instanceof Promise?kt.catch(bt=>this._onError(Et,bt)):kt}catch(kt){return this._onError(Et,kt),null}}_onError(Et,vt){try{Ye.Log.warn(`Caught error in ${Et}`,{error:vt}),Le(this,void 0,void 0,function*(){var bt,wt,It,Rt,Tt,Bt,Pt;const Dt=vt||Error(ft),Ot=Dt instanceof Error,Lt=Ot?Dt.name:"No Name",Wt=gt(Dt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((wt=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||wt===void 0)&&wt.preventAllNetworkTraffic){(It=this._emitter)===null||It===void 0||It.call(this,{name:"error",error:vt,tag:Et});return}const $t=tt.SDKType._get(this._sdkKey),qt=nt.StatsigMetadataProvider.get(),Ht=Ot?Dt.stack:At(Dt),Ut=Object.assign({tag:Et,exception:Lt,info:Ht,statsigOptions:yt(this._options)},Object.assign(Object.assign({},qt),{sdkType:$t}));yield((Bt=(Tt=(Rt=this._options)===null||Rt===void 0?void 0:Rt.networkConfig)===null||Tt===void 0?void 0:Tt.networkOverrideFunc)!==null&&Bt!==void 0?Bt:fetch)(Be.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String($t),"STATSIG-SDK-VERSION":String(qt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Pt=this._emitter)===null||Pt===void 0||Pt.call(this,{name:"error",error:vt,tag:Et})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(Ct){return Ct instanceof Error?Ct:typeof Ct=="string"?new Error(Ct):new Error("An unknown error occurred.")}function At(Ct){try{return JSON.stringify(Ct)}catch{return ft}}function xt(Ct){const Et=new Set;let vt=Object.getPrototypeOf(Ct);for(;vt&&vt!==Object.prototype;)Object.getOwnPropertyNames(vt).filter(kt=>typeof(vt==null?void 0:vt[kt])=="function").forEach(kt=>Et.add(kt)),vt=Object.getPrototypeOf(vt);return Array.from(Et)}function yt(Ct){if(!Ct)return{};const Et={};return Object.keys(Ct).forEach(vt=>{const kt=vt,bt=Ct[kt];switch(typeof bt){case"number":case"bigint":case"boolean":Et[String(kt)]=bt;break;case"string":bt.length<50?Et[String(kt)]=bt:Et[String(kt)]="set";break;case"object":kt==="environment"?Et.environment=bt:kt==="networkConfig"?Et.networkConfig=bt:Et[String(kt)]=bt!=null?"set":"unset";break}}),Et}}(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 MemoKey={};Object.defineProperty(MemoKey,"__esModule",{value:!0}),MemoKey.createMemoKey=MemoKey.MemoPrefix=void 0,MemoKey.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const EXIST_KEYS=new Set([]),DO_NOT_MEMO_KEYS=new Set(["userPersistedValues"]);function createMemoKey(Be,Le,Ye){let tt=`${Be}|${Le}`;if(!Ye)return tt;for(const nt of Object.keys(Ye)){if(DO_NOT_MEMO_KEYS.has(nt))return;EXIST_KEYS.has(nt)?tt+=`|${nt}=true`:tt+=`|${nt}=${Ye[nt]}`}return tt}MemoKey.createMemoKey=createMemoKey;var NetworkCore$1={},NetworkFallbackResolver$1={},DnsTxtQuery={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DnsTxtQuery,"__esModule",{value:!0}),DnsTxtQuery._fetchTxtRecords=void 0;const FEATURE_ASSETS_DNS_QUERY=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),DNS_QUERY_ENDPOINT="https://cloudflare-dns.com/dns-query",DOMAIN_CHARS=["i","e","d"],MAX_START_LOOKUP=200;function _fetchTxtRecords(Be){return __awaiter$d(this,void 0,void 0,function*(){const Le=yield Be(DNS_QUERY_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:FEATURE_ASSETS_DNS_QUERY});if(!Le.ok){const nt=new Error("Failed to fetch TXT records from DNS");throw nt.name="DnsTxtFetchError",nt}const Ye=yield Le.arrayBuffer(),tt=new Uint8Array(Ye);return _parseDnsResponse(tt)})}DnsTxtQuery._fetchTxtRecords=_fetchTxtRecords;function _parseDnsResponse(Be){const Le=Be.findIndex((tt,nt)=>nt<MAX_START_LOOKUP&&String.fromCharCode(tt)==="="&&DOMAIN_CHARS.includes(String.fromCharCode(Be[nt-1])));if(Le===-1){const tt=new Error("Failed to parse TXT records from DNS");throw tt.name="DnsTxtParseError",tt}let Ye="";for(let tt=Le-1;tt<Be.length;tt++)Ye+=String.fromCharCode(Be[tt]);return Ye.split(",")}var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkFallbackResolver$1,"__esModule",{value:!0}),NetworkFallbackResolver$1._isDomainFailure=NetworkFallbackResolver$1.NetworkFallbackResolver=void 0;const DnsTxtQuery_1=DnsTxtQuery,Hashing_1=Hashing,Log_1$3=Log,StorageProvider_1$1=StorageProvider,DEFAULT_TTL_MS=7*24*60*60*1e3,COOLDOWN_TIME_MS=4*60*60*1e3;class NetworkFallbackResolver{constructor(Le){var Ye;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(Ye=Le.networkConfig)===null||Ye===void 0?void 0:Ye.networkOverrideFunc}setErrorBoundary(Le){this._errorBoundary=Le}tryBumpExpiryTime(Le,Ye){var tt;const nt=(tt=this._fallbackInfo)===null||tt===void 0?void 0:tt[Ye.endpoint];nt&&(nt.expiryTime=Date.now()+DEFAULT_TTL_MS,_tryWriteFallbackInfoToCache(Le,Object.assign(Object.assign({},this._fallbackInfo),{[Ye.endpoint]:nt})))}getActiveFallbackUrl(Le,Ye){var tt,nt;if(Ye.customUrl!=null&&Ye.fallbackUrls!=null)return null;let ft=this._fallbackInfo;ft==null&&(ft=(tt=_readFallbackInfoFromCache(Le))!==null&&tt!==void 0?tt:{},this._fallbackInfo=ft);const ht=ft[Ye.endpoint];return!ht||Date.now()>((nt=ht.expiryTime)!==null&&nt!==void 0?nt:0)||Ye.getChecksum()!==ht.urlConfigChecksum?(delete ft[Ye.endpoint],this._fallbackInfo=ft,_tryWriteFallbackInfoToCache(Le,this._fallbackInfo),null):ht.url?ht.url:null}tryFetchUpdatedFallbackInfo(Le,Ye,tt,nt){return __awaiter$c(this,void 0,void 0,function*(){var ft,ht;try{if(!_isDomainFailure(tt,nt))return!1;const At=Ye.customUrl==null&&Ye.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(Ye):Ye.fallbackUrls,xt=this._pickNewFallbackUrl((ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[Ye.endpoint],At);return xt?(this._updateFallbackInfoWithNewUrl(Le,Ye,xt),!0):!1}catch(gt){return(ht=this._errorBoundary)===null||ht===void 0||ht.logError("tryFetchUpdatedFallbackInfo",gt),!1}})}_updateFallbackInfoWithNewUrl(Le,Ye,tt){var nt,ft,ht;const gt={urlConfigChecksum:Ye.getChecksum(),url:tt,expiryTime:Date.now()+DEFAULT_TTL_MS,previous:[]},At=Ye.endpoint,xt=(nt=this._fallbackInfo)===null||nt===void 0?void 0:nt[At];xt&&gt.previous.push(...xt.previous),gt.previous.length>10&&(gt.previous=[]);const yt=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;yt!=null&&gt.previous.push(yt),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[At]:gt}),_tryWriteFallbackInfoToCache(Le,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(Le){return __awaiter$c(this,void 0,void 0,function*(){var Ye;const tt=this._dnsQueryCooldowns[Le.endpoint];if(tt&&Date.now()<tt)return null;this._dnsQueryCooldowns[Le.endpoint]=Date.now()+COOLDOWN_TIME_MS;const nt=[],ft=yield(0,DnsTxtQuery_1._fetchTxtRecords)((Ye=this._networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch),ht=_extractPathFromUrl(Le.defaultUrl);for(const gt of ft){if(!gt.startsWith(Le.endpointDnsKey+"="))continue;const At=gt.split("=");if(At.length>1){let xt=At[1];xt.endsWith("/")&&(xt=xt.slice(0,-1)),nt.push(`https://${xt}${ht}`)}}return nt})}_pickNewFallbackUrl(Le,Ye){var tt;if(Ye==null)return null;const nt=new Set((tt=Le==null?void 0:Le.previous)!==null&&tt!==void 0?tt:[]),ft=Le==null?void 0:Le.url;let ht=null;for(const gt of Ye){const At=gt.endsWith("/")?gt.slice(0,-1):gt;if(!nt.has(gt)&&At!==ft){ht=At;break}}return ht}}NetworkFallbackResolver$1.NetworkFallbackResolver=NetworkFallbackResolver;function _isDomainFailure(Be,Le){var Ye;const tt=(Ye=Be==null?void 0:Be.toLowerCase())!==null&&Ye!==void 0?Ye:"";return Le||tt.includes("uncaught exception")||tt.includes("failed to fetch")||tt.includes("networkerror when attempting to fetch resource")}NetworkFallbackResolver$1._isDomainFailure=_isDomainFailure;function _getFallbackInfoStorageKey(Be){return`statsig.network_fallback.${(0,Hashing_1._DJB2)(Be)}`}function _tryWriteFallbackInfoToCache(Be,Le){const Ye=_getFallbackInfoStorageKey(Be);if(!Le||Object.keys(Le).length===0){StorageProvider_1$1.Storage.removeItem(Ye);return}StorageProvider_1$1.Storage.setItem(Ye,JSON.stringify(Le))}function _readFallbackInfoFromCache(Be){const Le=_getFallbackInfoStorageKey(Be),Ye=StorageProvider_1$1.Storage.getItem(Le);if(!Ye)return null;try{return JSON.parse(Ye)}catch{return Log_1$3.Log.error("Failed to parse FallbackInfo"),null}}function _extractPathFromUrl(Be){try{return new URL(Be).pathname}catch{return null}}var SDKFlags={};Object.defineProperty(SDKFlags,"__esModule",{value:!0}),SDKFlags.SDKFlags=void 0;const FLAGMAP={};SDKFlags.SDKFlags={setFlags:(Be,Le)=>{FLAGMAP[Be]=Le},get:(Be,Le)=>{var Ye,tt;return(tt=(Ye=FLAGMAP[Be])===null||Ye===void 0?void 0:Ye[Le])!==null&&tt!==void 0?tt:!1}};var SessionID={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigSession=Be.SessionID=void 0;const Le=$_StatsigGlobal,Ye=CacheKey,tt=Log,nt=StorageProvider,ft=UUID,ht=30*60*1e3,gt=4*60*60*1e3,At={};Be.SessionID={get:Rt=>Be.StatsigSession.get(Rt).data.sessionID},Be.StatsigSession={get:Rt=>{At[Rt]==null&&(At[Rt]=xt(Rt));const Tt=At[Rt];return Ct(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=yt(Rt,Tt)}};function xt(Rt){let Tt=It(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function yt(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function Ct(Rt){const Tt=Date.now(),Bt=Rt.data,Pt=Rt.sdkKey;if(vt(Bt)||kt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Ot=__STATSIG__==null?void 0:__STATSIG__.instance(Pt);Ot&&Ot.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,wt(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Dt=Tt-Bt.startTime;return Rt.idleTimeoutID=Et(Pt,ht),Rt.ageTimeoutID=Et(Pt,gt-Dt),Rt}function Et(Rt,Tt){return setTimeout(()=>{var Bt;const Pt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Pt&&Pt.$emt({name:"session_expired"})},Tt)}function vt({lastUpdate:Rt}){return Date.now()-Rt>ht}function kt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function wt(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function It(Rt){const Tt=bt(Rt);return(0,nt._getObjectFromStorage)(Tt)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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,NetworkFallbackResolver_1=NetworkFallbackResolver$1,SDKFlags_1=SDKFlags,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1$1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,StatsigOptionsCommon_1$1=StatsigOptionsCommon,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,BACKOFF_BASE_MS=500,BACKOFF_MAX_MS=3e4,RATE_LIMIT_WINDOW_MS=1e3,RATE_LIMIT_MAX_REQ_COUNT=50,LEAK_RATE=RATE_LIMIT_MAX_REQ_COUNT/RATE_LIMIT_WINDOW_MS,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(Le,Ye){this._emitter=Ye,this._errorBoundary=null,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,Le&&(this._options=Le),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new NetworkFallbackResolver_1.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(Le))}setLogEventCompressionMode(Le){this._options.logEventCompressionMode=Le}setErrorBoundary(Le){this._errorBoundary=Le,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(Le)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const Le=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,Le}beacon(Le){if(!_ensureValidSdkKey(Le))return!1;const Ye=this._getInternalRequestArgs("POST",Le),tt=this._getPopulatedURL(Ye),nt=navigator;return nt.sendBeacon.bind(nt)(tt,Ye.body)}post(Le){return __awaiter$b(this,void 0,void 0,function*(){const Ye=this._getInternalRequestArgs("POST",Le);return this._tryEncodeBody(Ye),yield this._tryToCompressBody(Ye),this._sendRequest(Ye)})}get(Le){const Ye=this._getInternalRequestArgs("GET",Le);return this._sendRequest(Ye)}_sendRequest(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye,tt,nt,ft;if(!_ensureValidSdkKey(Le)||this._netConfig.preventAllNetworkTraffic)return null;const{method:ht,body:gt,retries:At,attempt:xt}=Le,yt=Le.urlConfig.endpoint;if(this._isRateLimited(yt))return Log_1$2.Log.warn(`Request to ${yt} was blocked because you are making requests too frequently.`),null;const Ct=xt??1;let Et=!1;const vt=this._getPopulatedURL(Le);let kt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const wt={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,Ct);const It=this._leakyBucket[yt];It&&(It.lastRequestTime=Date.now(),this._leakyBucket[yt]=It);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(kt=yield Promise.race([Rt(vt,wt).finally(()=>clearTimeout(Tt)),new Promise((Pt,Dt)=>{Tt=setTimeout(()=>{Et=!0,Dt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!kt.ok){const Pt=yield kt.text().catch(()=>"No Text"),Dt=new Error(`NetworkError: ${vt} ${Pt}`);throw Dt.name="NetworkError",Dt}const Bt=yield kt.text();return _tryMarkInitEnd(Le,kt,Ct,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:kt.status}}catch(wt){const It=_getErrorMessage(wt),Rt=_didTimeout(It??"",Et);if(_tryMarkInitEnd(Le,kt,Ct,"",wt),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,It,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||Ct>At||!RETRYABLE_CODES.has((tt=kt==null?void 0:kt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:wt,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${vt}.`;return Log_1$2.Log.error(Bt,It,wt),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(Ct),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:Ct+1}))}})}_getLogEventCompressionMode(Le){let Ye=Le==null?void 0:Le.logEventCompressionMode;return!Ye&&(Le==null?void 0:Le.disableCompression)===!0&&(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled),Ye||(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled),Ye}_isRateLimited(Le){var Ye;const tt=Date.now(),nt=(Ye=this._leakyBucket[Le])!==null&&Ye!==void 0?Ye:{count:0,lastRequestTime:tt},ft=tt-nt.lastRequestTime,ht=Math.floor(ft*LEAK_RATE);return nt.count=Math.max(0,nt.count-ht),nt.count>=RATE_LIMIT_MAX_REQ_COUNT?!0:(nt.count+=1,nt.lastRequestTime=tt,this._leakyBucket[Le]=nt,!1)}_getPopulatedURL(Le){var Ye;const tt=(Ye=Le.fallbackUrl)!==null&&Ye!==void 0?Ye:Le.urlConfig.getUrl();(Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize||Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=tt);const nt=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:Le.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(Le.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(Le.sdkKey)},Le.params),ft=Object.keys(nt).map(ht=>`${encodeURIComponent(ht)}=${encodeURIComponent(nt[ht])}`).join("&");return`${tt}${ft?`?${ft}`:""}`}_tryEncodeBody(Le){var Ye;const tt=(0,SafeJs_1$1._getWindowSafe)(),nt=Le.body;if(!(!Le.isStatsigEncodable||this._options.disableStatsigEncoding||typeof nt!="string"||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(tt!=null&&tt.btoa)))try{Le.body=tt.btoa(nt).split("").reverse().join(""),Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"})}catch(ft){Log_1$2.Log.warn(`Request encoding failed for ${Le.urlConfig.getUrl()}`,ft)}}_tryToCompressBody(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye;const tt=Le.body;if(!(typeof tt!="string"||!_allowCompression(Le,this._options)))try{const nt=new TextEncoder().encode(tt),ft=new CompressionStream("gzip"),ht=ft.writable.getWriter();ht.write(nt).catch(Log_1$2.Log.error),ht.close().catch(Log_1$2.Log.error);const gt=ft.readable.getReader(),At=[];let xt;for(;!(xt=yield gt.read()).done;)At.push(xt.value);const yt=At.reduce((vt,kt)=>vt+kt.length,0),Ct=new Uint8Array(yt);let Et=0;for(const vt of At)Ct.set(vt,Et),Et+=vt.length;Le.body=Ct,Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.IsGzipped]:"1"})}catch(nt){Log_1$2.Log.warn(`Request compression failed for ${Le.urlConfig.getUrl()}`,nt)}})}_getInternalRequestArgs(Le,Ye){const tt=this._fallbackResolver.getActiveFallbackUrl(Ye.sdkKey,Ye.urlConfig),nt=Object.assign(Object.assign({},Ye),{method:Le,fallbackUrl:tt});return"data"in Ye&&_populateRequestBody(nt,Ye.data),nt}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=Be=>Be.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1),_populateRequestBody=(Be,Le)=>{const{sdkKey:Ye,fallbackUrl:tt}=Be,nt=StableID_1$1.StableID.get(Ye),ft=SessionID_1$1.SessionID.get(Ye),ht=SDKType_1.SDKType._get(Ye);Be.body=JSON.stringify(Object.assign(Object.assign({},Le),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:nt,sessionID:ft,sdkType:ht,fallbackUrl:tt})}))};function _allowCompression(Be,Le){if(!Be.isCompressable||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const Ye=Be.urlConfig.customUrl!=null||Be.urlConfig.fallbackUrls!=null,tt=SDKFlags_1.SDKFlags.get(Be.sdkKey,"enable_log_event_compression")===!0;switch(Le.logEventCompressionMode){case StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled:return!1;case StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled:return!(Ye&&!tt);case StatsigOptionsCommon_1$1.LogEventCompressionMode.Forced:return!0;default:return!1}}function _getErrorMessage(Be){return typeof Be=="string"?Be:Be instanceof Error?`${Be.name}: ${Be.message}`:"Unknown Error"}function _didTimeout(Be,Le){return Be.includes("Timeout")||Le}function _tryMarkInitStart(Be,Le){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(Be.sdkKey,{attempt:Le})}function _tryMarkInitEnd(Be,Le,Ye,tt,nt){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(Be.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(Le,Ye,tt,nt))}function _exponentialBackoff(Be){return __awaiter$b(this,void 0,void 0,function*(){yield new Promise(Le=>setTimeout(Le,Math.min(BACKOFF_BASE_MS*(Be*Be),BACKOFF_MAX_MS)))})}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var SizeOf={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._fastApproxSizeOf=void 0;const Le=2,Ye=1,tt=(nt,ft)=>{let ht=0;const gt=Object.keys(nt);for(let At=0;At<gt.length;At++){const xt=gt[At],yt=nt[xt];if(ht+=xt.length,typeof yt=="object"&&yt!==null?ht+=(0,Be._fastApproxSizeOf)(yt,ft)+Le:ht+=String(yt).length+Ye,ht>=ft)return ht}return ht};Be._fastApproxSizeOf=tt})(SizeOf);var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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,MemoKey_1=MemoKey,SafeJs_1=SafeJs,SessionID_1=SessionID,StableID_1=StableID,StatsigOptionsCommon_1=StatsigOptionsCommon,StorageProvider_1=StorageProvider,MAX_MEMO_CACHE_SIZE=3e3;class StatsigClientBase{constructor(Le,Ye,tt,nt){var ft,ht,gt,At;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const xt=this.$emt.bind(this);(nt==null?void 0:nt.logLevel)!=null&&(Log_1$1.Log.level=nt.logLevel),nt!=null&&nt.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),nt!=null&&nt.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(nt.initialSessionID,Le),nt!=null&&nt.storageProvider&&StorageProvider_1.Storage._setProvider(nt.storageProvider),nt!=null&&nt.enableCookies&&StableID_1.StableID._setCookiesEnabled(Le,nt.enableCookies),nt!=null&&nt.disableStableID&&StableID_1.StableID._setDisabled(Le,!0),this._sdkKey=Le,this._options=nt??{},this._memoCache={},this.overrideAdapter=(ft=nt==null?void 0:nt.overrideAdapter)!==null&&ft!==void 0?ft:null,this._logger=new EventLogger_1.EventLogger(Le,xt,tt,nt),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(Le,nt,xt),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ye),this._errorBoundary.wrap(this._logger),tt.setErrorBoundary(this._errorBoundary),this.dataAdapter=Ye,this.dataAdapter.attach(Le,nt,tt),this.storageProvider=StorageProvider_1.Storage,(At=(gt=(ht=this.overrideAdapter)===null||ht===void 0?void 0:ht.loadFromStorage)===null||gt===void 0?void 0:gt.call(ht))===null||At===void 0||At.catch(yt=>this._errorBoundary.logError("OA::loadFromStorage",yt)),this._primeReadyRipcord(),_assignGlobalInstance(Le,this)}updateRuntimeOptions(Le){Le.loggingEnabled?(this._options.loggingEnabled=Le.loggingEnabled,this._logger.setLoggingEnabled(Le.loggingEnabled)):Le.disableLogging!=null&&(this._options.disableLogging=Le.disableLogging,this._logger.setLoggingEnabled(Le.disableLogging?"disabled":"browser-only")),Le.disableStorage!=null&&(this._options.disableStorage=Le.disableStorage,StorageProvider_1.Storage._setDisabled(Le.disableStorage)),Le.enableCookies!=null&&(this._options.enableCookies=Le.enableCookies,StableID_1.StableID._setCookiesEnabled(this._sdkKey,Le.enableCookies)),Le.logEventCompressionMode?this._logger.setLogEventCompressionMode(Le.logEventCompressionMode):Le.disableCompression&&this._logger.setLogEventCompressionMode(StatsigOptionsCommon_1.LogEventCompressionMode.Disabled)}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(Le,Ye){this._listeners[Le]||(this._listeners[Le]=[]),this._listeners[Le].push(Ye)}off(Le,Ye){if(this._listeners[Le]){const tt=this._listeners[Le].indexOf(Ye);tt!==-1&&this._listeners[Le].splice(tt,1)}}$on(Le,Ye){Ye.__isInternal=!0,this.on(Le,Ye)}$emt(Le){var Ye;const tt=nt=>{try{nt(Le)}catch(ft){if(nt.__isInternal===!0){this._errorBoundary.logError(`__emit:${Le.name}`,ft);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",Le)}};this._listeners[Le.name]&&this._listeners[Le.name].forEach(nt=>tt(nt)),(Ye=this._listeners["*"])===null||Ye===void 0||Ye.forEach(tt)}_setStatus(Le,Ye){this.loadingStatus=Le,this._memoCache={},this.$emt({name:"values_updated",status:Le,values:Ye})}_enqueueExposure(Le,Ye,tt){if((tt==null?void 0:tt.disableExposureLog)===!0){this._logger.incrementNonExposureCount(Le);return}this._logger.enqueue(Ye)}_memoize(Le,Ye){return(tt,nt)=>{if(this._options.disableEvaluationMemoization)return Ye(tt,nt);const ft=(0,MemoKey_1.createMemoKey)(Le,tt,nt);return ft?(ft in this._memoCache||(Object.keys(this._memoCache).length>=MAX_MEMO_CACHE_SIZE&&(this._memoCache={}),this._memoCache[ft]=Ye(tt,nt)),this._memoCache[ft]):Ye(tt,nt)}}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(Be,Le){var Ye;if((0,SafeJs_1._isServerEnv)())return;const tt=(0,__StatsigGlobal_1._getStatsigGlobal)(),nt=(Ye=tt.instances)!==null&&Ye!==void 0?Ye:{},ft=Le;nt[Be]!=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."),nt[Be]=ft,tt.firstInstance||(tt.firstInstance=ft),tt.instances=nt,__STATSIG__=tt}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";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;function _makeEvaluation(Be,Le,Ye,tt){var nt;return{name:Be,details:Le,ruleID:(nt=Ye==null?void 0:Ye.rule_id)!==null&&nt!==void 0?nt:"",__evaluation:Ye,value:tt}}function _makeFeatureGate(Be,Le,Ye){var tt;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,(Ye==null?void 0:Ye.value)===!0)),{idType:(tt=Ye==null?void 0:Ye.id_type)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(Be,Le,Ye){var tt,nt;const ft=(tt=Ye==null?void 0:Ye.value)!==null&&tt!==void 0?tt:{};return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,ft)),{idType:(nt=Ye==null?void 0:Ye.id_type)!==null&&nt!==void 0?nt:null,get:_makeTypedGet(Be,Ye==null?void 0:Ye.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(Be,Le,Ye){var tt;const nt=_makeDynamicConfig(Be,Le,Ye);return Object.assign(Object.assign({},nt),{groupName:(tt=Ye==null?void 0:Ye.group_name)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(Be,Le,Ye,tt){var nt,ft;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,void 0)),{get:_makeTypedGet(Be,Ye==null?void 0:Ye.value,tt),groupName:(nt=Ye==null?void 0:Ye.group_name)!==null&&nt!==void 0?nt:null,__value:(ft=Ye==null?void 0:Ye.value)!==null&&ft!==void 0?ft:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(Be,Le,Ye,tt){return Object.assign(Object.assign(Object.assign({},Be),Le),{get:_makeTypedGet(Be.name,Ye,tt)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(Be,Le,Ye){return(tt,nt)=>{var ft;const ht=(ft=Le==null?void 0:Le[tt])!==null&&ft!==void 0?ft:null;return ht==null?nt??null:nt!=null&&!(0,TypingUtils_1._isTypeMatch)(ht,nt)?(Log_1.Log.warn(`Parameter type mismatch. '${Be}.${tt}' was found to be type '${typeof ht}' but fallback/return type is '${typeof nt}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),nt??null):(Ye==null||Ye(tt),ht)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0});var StatsigUpdateDetails={};Object.defineProperty(StatsigUpdateDetails,"__esModule",{value:!0}),StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES=StatsigUpdateDetails.createUpdateDetails=void 0;const createUpdateDetails=(Be,Le,Ye,tt,nt,ft)=>({duration:Ye,source:Le,success:Be,error:tt,sourceUrl:nt,warnings:ft});StatsigUpdateDetails.createUpdateDetails=createUpdateDetails,StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(xt,yt,Ct,Et){Et===void 0&&(Et=Ct);var vt=Object.getOwnPropertyDescriptor(yt,Ct);(!vt||("get"in vt?!yt.__esModule:vt.writable||vt.configurable))&&(vt={enumerable:!0,get:function(){return yt[Ct]}}),Object.defineProperty(xt,Et,vt)}:function(xt,yt,Ct,Et){Et===void 0&&(Et=Ct),xt[Et]=yt[Ct]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,yt){for(var Ct in xt)Ct!=="default"&&!Object.prototype.hasOwnProperty.call(yt,Ct)&&Le(yt,xt,Ct)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Storage=Be.Log=Be.EventLogger=Be.Diagnostics=void 0;const tt=$_StatsigGlobal,nt=Diagnostics;Object.defineProperty(Be,"Diagnostics",{enumerable:!0,get:function(){return nt.Diagnostics}});const ft=EventLogger$1;Object.defineProperty(Be,"EventLogger",{enumerable:!0,get:function(){return ft.EventLogger}});const ht=Log;Object.defineProperty(Be,"Log",{enumerable:!0,get:function(){return ht.Log}});const gt=StatsigMetadata,At=StorageProvider;Object.defineProperty(Be,"Storage",{enumerable:!0,get:function(){return At.Storage}}),Ye($_StatsigGlobal,Be),Ye(CacheKey,Be),Ye(ClientInterfaces,Be),Ye(DataAdapterCore$1,Be),Ye(Diagnostics,Be),Ye(DownloadConfigSpecsResponse,Be),Ye(ErrorBoundary,Be),Ye(EvaluationOptions,Be),Ye(EvaluationTypes,Be),Ye(Hashing,Be),Ye(InitializeResponse,Be),Ye(Log,Be),Ye(MemoKey,Be),Ye(NetworkConfig,Be),Ye(NetworkCore$1,Be),Ye(OverrideAdapter,Be),Ye(ParamStoreTypes,Be),Ye(SafeJs,Be),Ye(SDKType,Be),Ye(SessionID,Be),Ye(SizeOf,Be),Ye(StableID,Be),Ye(StatsigClientBase$1,Be),Ye(StatsigClientEventEmitter,Be),Ye(StatsigDataAdapter,Be),Ye(StatsigEvent,Be),Ye(StatsigMetadata,Be),Ye(StatsigOptionsCommon,Be),Ye(StatsigPlugin,Be),Ye(StatsigTypeFactories,Be),Ye(StatsigTypes,Be),Ye(StatsigUser,Be),Ye(StorageProvider,Be),Ye(TypedJsonParse,Be),Ye(TypingUtils,Be),Ye(UrlConfiguration$1,Be),Ye(UUID,Be),Ye(VisibilityObserving,Be),Ye(StatsigUpdateDetails,Be),Ye(SDKFlags,Be),Object.assign((0,tt._getStatsigGlobal)(),{Log:ht.Log,SDK_VERSION:gt.SDK_VERSION})}(src$1);var StatsigClient$1={},EvaluationStore$1={},V1InitializeContainer$1={};Object.defineProperty(V1InitializeContainer$1,"__esModule",{value:!0}),V1InitializeContainer$1.V1InitializeContainer=void 0;const client_core_1$7=src$1;class V1InitializeContainer{constructor(Le){this._values=Le}getGate(Le){return this._getResultFromLookup(this._values.feature_gates,Le)}getConfig(Le){return this._getResultFromLookup(this._values.dynamic_configs,Le)}getLayer(Le){return this._getResultFromLookup(this._values.layer_configs,Le)}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$7._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V1InitializeContainer$1.V1InitializeContainer=V1InitializeContainer;var V2InitializeContainer$1={};Object.defineProperty(V2InitializeContainer$1,"__esModule",{value:!0}),V2InitializeContainer$1.V2InitializeContainer=void 0;const client_core_1$6=src$1;class V2InitializeContainer{constructor(Le){this._values=Le}getGate(Le){var Ye,tt,nt;const ft=this._getResultFromLookup(this._values.feature_gates,Le);return ft?{name:Le,value:ft.v===!0,rule_id:(Ye=ft.r)!==null&&Ye!==void 0?Ye:"default",secondary_exposures:(tt=ft.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ft.i)!==null&&nt!==void 0?nt:""}:null}getConfig(Le){var Ye,tt,nt,ft;const ht=this._getResultFromLookup(this._values.dynamic_configs,Le);return ht?{name:Le,value:(Ye=this._values.values[ht.v])!==null&&Ye!==void 0?Ye:{},rule_id:ht.r,secondary_exposures:(tt=ht.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ht.i)!==null&&nt!==void 0?nt:"",is_user_in_experiment:ht.ue===!0,passed:ht.p===!0,group_name:(ft=ht.gn)!==null&&ft!==void 0?ft:void 0,is_experiment_active:ht.ea===!0,group:ht.r,is_device_based:ht.i==="stableID"}:null}getLayer(Le){var Ye,tt,nt,ft,ht,gt;const At=this._getResultFromLookup(this._values.layer_configs,Le);return At?{name:Le,value:(Ye=this._values.values[At.v])!==null&&Ye!==void 0?Ye:{},rule_id:At.r,secondary_exposures:(tt=At.s)!==null&&tt!==void 0?tt:[],is_user_in_experiment:At.ue===!0,group_name:(nt=At.gn)!==null&&nt!==void 0?nt:void 0,is_experiment_active:At.ea===!0,group:At.r,is_device_based:At.i==="stableID",allocated_experiment_name:(ft=At.ae)!==null&&ft!==void 0?ft:"",explicit_parameters:(ht=At.ep)!==null&&ht!==void 0?ht:[],undelegated_secondary_exposures:(gt=At.us)!==null&&gt!==void 0?gt:[],parameter_rule_ids:At.pr}:null}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$6._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V2InitializeContainer$1.V2InitializeContainer=V2InitializeContainer,Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1,V1InitializeContainer_1=V1InitializeContainer$1,V2InitializeContainer_1=V2InitializeContainer$1;class EvaluationStore{constructor(Le){this._sdkKey=Le,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,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(Le,Ye){var tt,nt;if(!Le)return!1;const ft=(0,client_core_1$5._typedJsonParse)(Le.data,"has_updates","EvaluationResponse");return ft==null?!1:(this._source=Le.source,(ft==null?void 0:ft.has_updates)!==!0||((tt=ft.time)!==null&&tt!==void 0?tt:0)<this._lcut||(this._rawValues=Le.data,this._lcut=ft.time,this._receivedAt=Le.receivedAt,ft.response_format==="init-v2"?this._values=new V2InitializeContainer_1.V2InitializeContainer(ft):this._values=new V1InitializeContainer_1.V1InitializeContainer(ft),this._bootstrapMetadata=this._extractBootstrapMetadata(Le.source,ft),Le.source&&ft.user&&this._setWarningState(Ye,ft),client_core_1$5.SDKFlags.setFlags(this._sdkKey,(nt=ft.sdk_flags)!==null&&nt!==void 0?nt:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(Le){const Ye=this._values?this._values.getGate(Le):null;return this._getDetailedStoreResult(Ye)}getConfig(Le){const Ye=this._values?this._values.getConfig(Le):null;return this._getDetailedStoreResult(Ye)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(Le){const Ye=this._values?this._values.getLayer(Le):null;return this._getDetailedStoreResult(Ye)}getParamStore(Le){const Ye=this._values?this._values.getParamStore(Le):null;return this._getDetailedStoreResult(Ye)}getSource(){return this._source}getExposureMapping(){var Le;return(Le=this._values)===null||Le===void 0?void 0:Le.getExposureMapping()}_extractBootstrapMetadata(Le,Ye){if(Le!=="Bootstrap")return null;const tt={};return Ye.user&&(tt.user=Ye.user),Ye.sdkInfo&&(tt.generatorSDKInfo=Ye.sdkInfo),tt.lcut=Ye.time,tt}_getDetailedStoreResult(Le){return{result:Le,details:this._getDetails(Le==null)}}_setWarningState(Le,Ye){var tt,nt;const ft=client_core_1$5.StableID.get(this._sdkKey);if(((tt=Le.customIDs)===null||tt===void 0?void 0:tt.stableID)!==ft&&(!((nt=Le.customIDs)===null||nt===void 0)&&nt.stableID||ft)){this._warnings.add("StableIDMismatch");return}if("user"in Ye){const ht=Ye.user,gt=Object.assign(Object.assign({},Le),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,client_core_1$5._getFullUserHash)(gt)!==(0,client_core_1$5._getFullUserHash)(ht)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const Le={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(Le.warnings=Array.from(this._warnings)),Le}_getDetails(Le){var Ye,tt;const nt=this.getCurrentSourceDetails();let ft=nt.reason;const ht=(Ye=nt.warnings)!==null&&Ye!==void 0?Ye:[];this._source==="Bootstrap"&&ht.length>0&&(ft=ft+ht[0]),ft!=="Uninitialized"&&ft!=="NoValues"&&(ft=`${ft}:${Le?"Unrecognized":"Recognized"}`);const gt=this._source==="Bootstrap"&&(tt=this._bootstrapMetadata)!==null&&tt!==void 0?tt:void 0;return gt&&(nt.bootstrapMetadata=gt),Object.assign(Object.assign({},nt),{reason:ft})}}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(Be,Le){const Ye=(0,client_core_1$4._typedJsonParse)(Le,"checksum","DeltasEvaluationResponse");if(!Ye)return{hadBadDeltaChecksum:!0};const tt=_mergeDeltasIntoCache(Be,Ye),nt=_handleDeletedEntries(tt),ft=(0,client_core_1$4._DJB2Object)({feature_gates:nt.feature_gates,dynamic_configs:nt.dynamic_configs,layer_configs:nt.layer_configs},MAX_DELTAS_SORT_DEPTH);return ft===Ye.checksumV2?JSON.stringify(nt):{hadBadDeltaChecksum:!0,badChecksum:ft,badMergedConfigs:nt,badFullResponse:Ye.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(Be,Le){return Object.assign(Object.assign(Object.assign({},Be),Le),{feature_gates:Object.assign(Object.assign({},Be.feature_gates),Le.feature_gates),layer_configs:Object.assign(Object.assign({},Be.layer_configs),Le.layer_configs),dynamic_configs:Object.assign(Object.assign({},Be.dynamic_configs),Le.dynamic_configs)})}function _handleDeletedEntries(Be){const Le=Be;return _deleteEntriesInRecord(Be.deleted_gates,Le.feature_gates),delete Le.deleted_gates,_deleteEntriesInRecord(Be.deleted_configs,Le.dynamic_configs),delete Le.deleted_configs,_deleteEntriesInRecord(Be.deleted_layers,Le.layer_configs),delete Le.deleted_layers,Le}function _deleteEntriesInRecord(Be,Le){Be==null||Be.forEach(Ye=>{delete Le[Ye]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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(Le,Ye){super(Le,Ye);const tt=Le==null?void 0:Le.networkConfig;this._option=Le,this._initializeUrlConfig=new client_core_1$3.UrlConfiguration(client_core_1$3.Endpoint._initialize,tt==null?void 0:tt.initializeUrl,tt==null?void 0:tt.api,tt==null?void 0:tt.initializeFallbackUrls)}fetchEvaluations(Le,Ye,tt,nt,ft){return __awaiter$9(this,void 0,void 0,function*(){var ht,gt,At,xt,yt,Ct;const Et=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let vt={user:nt,hash:(At=(gt=(ht=this._option)===null||ht===void 0?void 0:ht.networkConfig)===null||gt===void 0?void 0:gt.initializeHashAlgorithm)!==null&&At!==void 0?At:"djb2",deltasResponseRequested:!1,full_checksum:null};if(Et!=null&&Et.has_updates){const kt=(Et==null?void 0:Et.hash_used)!==((Ct=(yt=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||yt===void 0?void 0:yt.initializeHashAlgorithm)!==null&&Ct!==void 0?Ct:"djb2");vt=Object.assign(Object.assign({},vt),{sinceTime:ft&&!kt?Et.time:0,previousDerivedFields:"derived_fields"in Et&&ft?Et.derived_fields:{},deltasResponseRequested:!0,full_checksum:Et.full_checksum,partialUserMatchSinceTime:kt?0:Et.time})}return this._fetchEvaluations(Le,Et,vt,tt)})}_fetchEvaluations(Le,Ye,tt,nt){return __awaiter$9(this,void 0,void 0,function*(){var ft,ht;const gt=yield this.post({sdkKey:Le,urlConfig:this._initializeUrlConfig,data:tt,retries:2,isStatsigEncodable:!0,priority:nt});if((gt==null?void 0:gt.code)===204)return'{"has_updates": false}';if((gt==null?void 0:gt.code)!==200)return(ft=gt==null?void 0:gt.body)!==null&&ft!==void 0?ft:null;if((Ye==null?void 0:Ye.has_updates)!==!0||((ht=gt.body)===null||ht===void 0?void 0:ht.includes('"is_delta":true'))!==!0||tt.deltasResponseRequested!==!0)return gt.body;const At=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ye,gt.body);return typeof At=="string"?At:this._fetchEvaluations(Le,Ye,Object.assign(Object.assign(Object.assign({},tt),At),{deltasResponseRequested:!1}),nt)})}}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(Be){return Be==null||Be.disableExposureLog===!1}function _shouldReturnFallback(Be,Le){return Le!=null&&!(0,client_core_1$2._isTypeMatch)(Be,Le)}function _getMappedStaticValue(Be,Le){return Be.value}function _getMappedGateValue(Be,Le,Ye){return Be.getFeatureGate(Le.gate_name,_shouldLogExposure(Ye)?void 0:NO_EXPOSURE_OPT).value?Le.pass_value:Le.fail_value}function _getMappedDynamicConfigValue(Be,Le,Ye,tt){const ft=Be.getDynamicConfig(Le.config_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedExperimentValue(Be,Le,Ye,tt){const ft=Be.getExperiment(Le.experiment_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedLayerValue(Be,Le,Ye,tt){const ft=Be.getLayer(Le.layer_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _makeParamStoreGetter(Be,Le,Ye){return(tt,nt)=>{if(Le==null)return nt;const ft=Le[tt];if(ft==null||nt!=null&&(0,client_core_1$2._typeOf)(nt)!==ft.param_type)return nt;switch(ft.ref_type){case"static":return _getMappedStaticValue(ft);case"gate":return _getMappedGateValue(Be,ft,Ye);case"dynamic_config":return _getMappedDynamicConfigValue(Be,ft,nt,Ye);case"experiment":return _getMappedExperimentValue(Be,ft,nt,Ye);case"layer":return _getMappedLayerValue(Be,ft,nt,Ye);default:return nt}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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(Le,Ye,tt){super.attach(Le,Ye,tt),tt!==null&&tt instanceof Network_1$1.default?this._network=tt:this._network=new Network_1$1.default(Ye??{})}getDataAsync(Le,Ye,tt){return this._getDataAsyncImpl(Le,(0,client_core_1$1._normalizeUser)(Ye,this._options),tt)}prefetchData(Le,Ye){return this._prefetchDataImpl(Le,Ye)}setData(Le){const Ye=(0,client_core_1$1._typedJsonParse)(Le,"has_updates","data");Ye&&"user"in Ye?super.setData(Le,Ye.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(Le,Ye){super.setData(Le,Ye)}_fetchFromNetwork(Le,Ye,tt,nt){return __awaiter$8(this,void 0,void 0,function*(){var ft;const ht=yield(ft=this._network)===null||ft===void 0?void 0:ft.fetchEvaluations(this._getSdkKey(),Le,tt==null?void 0:tt.priority,Ye,nt);return ht??null})}_getCacheKey(Le){var Ye;const tt=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),Le,(Ye=this._options)===null||Ye===void 0?void 0:Ye.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${tt}`}_isCachedResultValidFor204(Le,Ye){return Le.fullUserHash!=null&&Le.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ye)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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(Le){const Ye=(0,client_core_1._getStatsigGlobal)().instance(Le);return Ye instanceof StatsigClient?Ye:(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(Le??"",{}))}constructor(Le,Ye,tt=null){var nt,ft;client_core_1.SDKType._setClientType(Le,"javascript-client");const ht=new Network_1.default(tt,At=>{this.$emt(At)});super(Le,(nt=tt==null?void 0:tt.dataAdapter)!==null&&nt!==void 0?nt:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,ht,tt),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(client_core_1.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(client_core_1.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(client_core_1.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(client_core_1.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(client_core_1.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(client_core_1.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new EvaluationStore_1.default(Le),this._network=ht,this._user=this._configureUser(Ye,tt),this._sdkInstanceID=(0,client_core_1.getUUID)();const gt=(ft=tt==null?void 0:tt.plugins)!==null&&ft!==void 0?ft:[];for(const At of gt)At.bind(this)}initializeSync(Le){var Ye;return this.loadingStatus!=="Uninitialized"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(Ye=this._store.getWarnings())!==null&&Ye!==void 0?Ye:[]]):(this._logger.start(),this.updateUserSync(this._user,Le))}initializeAsync(Le){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(Le),this._initializePromise)})}updateUserSync(Le,Ye){const tt=performance.now();try{return this._updateUserSyncImpl(Le,Ye,tt)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}}_updateUserSyncImpl(Le,Ye,tt){var nt;const ft=[...(nt=this._store.getWarnings())!==null&&nt!==void 0?nt:[]];this._resetForUser(Le);const ht=this.dataAdapter.getDataSync(this._user);ht==null&&ft.push("NoCachedValues"),this._store.setValues(ht,this._user),this._finalizeUpdate(ht);const gt=Ye==null?void 0:Ye.disableBackgroundCacheRefresh;return gt===!0||gt==null&&(ht==null?void 0:ht.source)==="Bootstrap"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft):(this._runPostUpdate(ht??null,this._user),(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft))}updateUserAsync(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){const tt=performance.now();try{return yield this._updateUserAsyncImpl(Le,Ye)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}})}_updateUserAsyncImpl(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(Le);const tt=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let nt=this.dataAdapter.getDataSync(tt);if(this._store.setValues(nt,this._user),this._setStatus("Loading",nt),nt=yield this.dataAdapter.getDataAsync(nt,tt,Ye),tt!==this._user)return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let ft=!1;nt!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),ft=this._store.setValues(nt,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:ft})),this._finalizeUpdate(nt),ft||(this._errorBoundary.attachErrorIfNoneExists(client_core_1.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,ft,this._store.getCurrentSourceDetails());const ht=client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,client_core_1.createUpdateDetails)(ft,this._store.getSource(),ht,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}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),sdkInstanceID:this._sdkInstanceID}}checkGate(Le,Ye){return this.getFeatureGate(Le,Ye).value}logEvent(Le,Ye,tt){const nt=typeof Le=="string"?{eventName:Le,value:Ye,metadata:tt}:Le;this.$emt({name:"log_event_called",event:nt}),this._logger.enqueue(Object.assign(Object.assign({},nt),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(Le){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:Le}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(Le){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,Le)})}_createErrorUpdateDetails(Le,Ye){var tt;return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),performance.now()-Ye,Le,null,[...(tt=this._store.getWarnings())!==null&&tt!==void 0?tt:[]])}_finalizeUpdate(Le){this._store.finalize(),this._setStatus("Ready",Le)}_runPostUpdate(Le,Ye){this.dataAdapter.getDataAsync(Le,Ye,{priority:"low"}).catch(tt=>{client_core_1.Log.error("An error occurred after update.",tt)})}_resetForUser(Le){this._logger.reset(),this._store.reset(),this._user=this._configureUser(Le,this._options)}_configureUser(Le,Ye){var tt,nt,ft;const ht=(0,client_core_1._normalizeUser)(Le,Ye),gt=(tt=ht.customIDs)===null||tt===void 0?void 0:tt.stableID;if(gt){const At=(ft=(nt=this.storageProvider).isReadyResolver)===null||ft===void 0?void 0:ft.call(nt);At?At.then(()=>client_core_1.StableID.setOverride(gt,this._sdkKey),()=>client_core_1.StableID.setOverride(gt,this._sdkKey)):client_core_1.StableID.setOverride(gt,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(ht.analyticsOnlyMetadata=Object.assign(Object.assign({},ht.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),ht}_getFeatureGateImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getGate(Le),gt=(0,client_core_1._makeFeatureGate)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getGateOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createGateExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"gate_evaluation",gate:xt}),xt}_getDynamicConfigImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getConfig(Le),gt=(0,client_core_1._makeDynamicConfig)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getDynamicConfigOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:xt}),xt}_getExperimentImpl(Le,Ye){var tt,nt,ft,ht;const{result:gt,details:At}=this._store.getConfig(Le),xt=(0,client_core_1._makeExperiment)(Le,At,gt);xt.__evaluation!=null&&(xt.__evaluation.secondary_exposures=(0,client_core_1._mapExposures)((nt=(tt=xt.__evaluation)===null||tt===void 0?void 0:tt.secondary_exposures)!==null&&nt!==void 0?nt:[],this._store.getExposureMapping()));const yt=(ht=(ft=this.overrideAdapter)===null||ft===void 0?void 0:ft.getExperimentOverride)===null||ht===void 0?void 0:ht.call(ft,xt,this._user,Ye),Ct=yt??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,Ct,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:Ct}),Ct}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(Le,Ye){var tt,nt,ft;const{result:ht,details:gt}=this._store.getLayer(Le),At=(0,client_core_1._makeLayer)(Le,gt,ht),xt=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getLayerOverride)===null||nt===void 0?void 0:nt.call(tt,At,this._user,Ye);Ye!=null&&Ye.disableExposureLog&&this._logger.incrementNonExposureCount(Le);const yt=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,Ct=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,yt,Ct,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:yt}),yt}_getParameterStoreImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getParamStore(Le);this._logger.incrementNonExposureCount(Le);const gt={name:Le,details:ht,__configuration:ft,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,ft,Ye)},At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getParamStoreOverride)===null||nt===void 0?void 0:nt.call(tt,gt,Ye);return At!=null&&(gt.__configuration=At.config,gt.details=At.details,gt.get=(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,At.config,Ye)),gt}}StatsigClient$1.default=StatsigClient,function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ht,gt,At,xt){xt===void 0&&(xt=At);var yt=Object.getOwnPropertyDescriptor(gt,At);(!yt||("get"in yt?!gt.__esModule:yt.writable||yt.configurable))&&(yt={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,yt)}:function(ht,gt,At,xt){xt===void 0&&(xt=At),ht[xt]=gt[At]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(ht,gt){for(var At in ht)At!=="default"&&!Object.prototype.hasOwnProperty.call(gt,At)&&Le(gt,ht,At)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigClient=void 0;const tt=src$1,nt=StatsigClient$1;Be.StatsigClient=nt.default,Ye(src$1,Be);const ft=Object.assign((0,tt._getStatsigGlobal)(),{StatsigClient:nt.default});Be.default=ft}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability","selfie_local_lenses_check_web","id_model_hebrew_back_id","id_face_readability","new_id_capture_ux_least_risky_clients","id_test_aa","id_iou_check","iad_checks","iad_c_checks","new_fingerprint","mp_test_hashed_id","face_occlusion"],GLOBAL_FLAGS=["new_fingerprint"],ID_MODULE_FLAGS=["id_face_readability","id_test_aa","iad_c_checks","mp_test_hashed_id","id_model_hebrew_back_id","id_iou_check","iad_checks","new_id_capture_ux_least_risky_clients","id_text_barcode_readability"],SELFIE_MODULE_FLAGS=["selfie_local_lenses_check_web","face_occlusion"];function getStatsigEnvironment(Be){return isStageK8sEnv(Be)?{tier:"development"}:isStageEnv(Be)||isDemoEnv(Be)?{tier:"staging"}:isSaasEnv(Be)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1,selfie_local_lenses_check_web:!1,id_model_hebrew_back_id:!1,id_face_readability:!1,new_id_capture_ux_least_risky_clients:!1,id_test_aa:!1,iad_checks:!1,iad_c_checks:!1,id_iou_check:!0,new_fingerprint:!1,mp_test_hashed_id:!1,face_occlusion:!1},clientExperimentIds={new_id_capture_ux_least_risky_clients:"experimentV2"};let initPromise=null;const initialize=async({flowId:Be,apiKey:Le,sessionIdentifier:Ye,apiURL:tt,clientExperimentId:nt})=>{if(initPromise)return initPromise;initPromise=(async()=>{var gt;const ft={customIDs:{client_api_key:Le,hashed_onboarding_id:Ye,flow_id:Be},custom:{landing_page:(gt=window==null?void 0:window.location)==null?void 0:gt.href}},ht=new src$2.StatsigClient(clientApiKey,ft,{environment:getStatsigEnvironment(tt)});await ht.initializeAsync(),FEATURE_FLAGS.forEach(At=>{if(nt&&clientExperimentIds[At]===nt){featureFlagsValues[At]=!0;return}featureFlagsValues[At]=ht.checkGate(At)})})(),await initPromise},getFeatureFlag=Be=>featureFlagsValues[Be]??!1,getModuleFeatureFlags=async Be=>{const Le={};GLOBAL_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]});const Ye=Be.toLowerCase();return Ye.includes("id")||Ye==="government-validation"?ID_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}):(Ye.includes("selfie")||Ye==="face")&&SELFIE_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}),Le};function IdCaptureParamsConfigurator(Be,Le,Ye,tt){Object.assign(Be,{areaDown:25e3,areaUp:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:160,widthIOSDown:85,widthDown:tt?110:135,widthUp:205,framesAggregationInterval:tt?3e3:2e3,minFaceIdQualityScore:.62})}function getSelfieFaceDetectionPipelineParams(){return{frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.86,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.85,minFaceQualityScore:.63,isOcclusionCheckEnabled:getFeatureFlag("face_occlusion"),faceOcclusionThreshold:.3}}const getProfiles=()=>[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_02,DetectionType.IDCapture,["id_capture_2_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"https://www.notion.so/ML-Update-ID-processing-model-to-accept-more-back-ID-types-18c4c3caef49801e95b4fd6bf9b92883?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_02,DetectionType.IDCapture,["id_capture_3_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Pipeline with text and barcode quality: https://www.notion.so/Web-Use-Text-Barcode-model-2nd-iteration-1bc4c3caef49805aa9e6d308db9fc6dd?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:!0},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","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Current Prod - Selfie face detection profile with quality metrics"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieVideoSelfie,DetectionType.SelfieVideoSelfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"VideoSelfie face detection profile")];function getProfile(Be){const Le=getProfiles().find(Ye=>Ye.name===Be);if(!Le)throw new Error(`Profile not found for type: ${Be}`);return Le}const wasmVersion="v2.12.26";function generateBundle(){const Be=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_02:getFeatureFlag("id_model_hebrew_back_id")?PipelineProfileName.IdCapture_2_02:PipelineProfileName.IdCapture_2_01,Le=PipelineProfileName.SelfieWithQualityMetrics,Ye=PipelineProfileName.SelfieVideoSelfie,tt=PipelineProfileName.IdVideoSelfie_2_01;return[Be,tt,Le,Ye]}function getInitializationParams(){const Le=generateBundle(),Ye="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",tt=`${Ye}/${wasmVersion}/webLib.wasm`,nt=`${Ye}/${wasmVersion}/webLibSimd.wasm`,ft=`${Ye}/${wasmVersion}/webLib.js`,ht=`${Ye}/${wasmVersion}/versions.json`;let gt=new Map,At=new Map;for(const xt of Le){const yt=getProfile(xt);if(!yt)throw new Error(`Profile not found: ${xt}`);const Ct=yt.modelNames;let Et=[];for(const vt of Ct)Et.push(`${Ye}/${wasmVersion}/models/${vt}`);gt.set(yt.pipelineType,Et),At.set(yt.detectionType,yt)}return{wasmModulePath:tt,wasmSimdModulePath:nt,glueCodePath:ft,versionsFilePath:ht,pipelineModels:gt,enableSIMD:!0,profiles:At,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.pipelineApiUtilities=null,this.utilityApi=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.inspectorOpened_=!1,this.wasmCallMutex=new Mutex,this.Module=null,this.loadModule=async Le=>{this.Module=(await import(Le)).Module}}async initialize(Le,Ye,tt,nt,ft,ht){await this.freeResources(),this.pipelines_=ht,this.versionsFile=ft,await this.loadModule(tt);const gt=await this.loadWasm(nt,Le,Ye);return this.pipelineApiUtilities=new this.wasmModule.PipelineApiUtilities,this.utilityApi=new this.wasmModule.UtilityApi,this.idCaptureWasmApi=new this.wasmModule.IdCaptureApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionApi,this.isInitialized_=!0,gt}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.pipelineApiUtilities!=null&&this.utilityApi!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(Le,Ye){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(Le&&Ye&&Le==this.imageWidth_&&Ye==this.imageHeight_&&this.inputImageBuffer&&Le*Ye*4===this.inputImageBuffer.length)&&(this.imageWidth_=Le,this.imageHeight_=Ye,this.inputImageBuffer=this.pipelineApiUtilities.allocateInputImageBuffer(Le,Ye,4))}async handleDetectionCallAndUpdateState(Le){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(Le))}encryptImage(Le){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.utilityApi.encryptImage(Le)}isVirtualCamera(Le){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),Le)return this.utilityApi.isVirtualCamera(Le)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.utilityApi.estimatePerformance()}async analyzeFrame(Le){this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(Le.width,Le.height),this.inputImageBuffer.set(Le.data),this.utilityApi.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.pipelineApiUtilities&&typeof this.pipelineApiUtilities.delete=="function"&&(this.pipelineApiUtilities.delete(),this.pipelineApiUtilities=null),this.utilityApi&&typeof this.utilityApi.delete=="function"&&(this.utilityApi.delete(),this.utilityApi=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(Le){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.pipelineApiUtilities.resetPipeline(this.pipelineTypeToWasmEnum(Le))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[Le,Ye]of this.pipelines_)this.resetPipeline(Le)}resetOther(){this.checkWasmInitialization("Unable to reset other states, cpp API hasn't been initialized"),this.utilityApi.resetOther()}reset(){this.resetAllPipelines(),this.resetOther()}async process(Le,Ye){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(Le.data),Ye){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ye));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(Ye));default:throw new Error("Unknown pipeline type")}}async runIdCapture(Le){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(Le.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(Le){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(Le.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceDetectionThresholds(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}async setFaceAttributesThresholds(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceChecksEnabled(Le,Ye,tt,nt,ft,ht){this.checkWasmInitialization("Unable to set face checks enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceChecksEnabled(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht)}async setFaceDetectionMode(Le,Ye){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(Le),Ye)}async setFaceDetectionCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt,bt,wt,It,Rt,Tt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt,bt,wt,It,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt)}async setIdCaptureConfigParams(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}setIdCaptureModelType(Le,Ye){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(Le),this.IdCaptureModelTypeToWasmEnum(Ye))}IdPerspectiveTransform(Le,Ye){return this.checkWasmInitialization("Unable to perform perspective transform, cpp API hasn't been initialized"),this.idCaptureWasmApi.IdPerspectiveTransform(Le,Ye)}async getVersions(){const Ye=await(await fetch(this.versionsFile)).text();return JSON.parse(Ye)}async loadWasm(Le,Ye,tt){const nt=Le?tt:Ye;try{window.wasmArrayBuffer=await fetch(nt).then(ft=>ft.arrayBuffer()).then(ft=>new Uint8Array(ft)),this.wasmModule=await this.Module()}catch(ft){if(console.log(ft,Le,"useSmd"),Le)return await this.loadWasm(!1,Ye,tt);throw ft}return Le}async loadModels(){var nt;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let Le=new this.wasmModule.PipelineTypeToIntMap,Ye=new Map,tt=new Map;for(let[ft,ht]of this.pipelines_){let gt=this.pipelineTypeToWasmEnum(ft),At=[],xt=new this.wasmModule.VectorInt;for(let yt of ht){if(!tt.has(yt)){let Et=await fetch(yt).then(vt=>vt.arrayBuffer()).then(vt=>new Uint8Array(vt));tt.set(yt,Et)}let Ct=tt.get(yt);xt.push_back(Ct.byteLength),At.push(Ct)}Le.set(gt,xt),Ye.set(gt,At)}this.modelsBuffers=this.pipelineApiUtilities.allocateModelsBuffers(Le);for(let[ft,ht]of Ye){let gt=(nt=this.modelsBuffers)==null?void 0:nt.get(ft);for(let At=0;At<gt.size();At++){let xt=gt==null?void 0:gt.get(At);if(xt)xt.set(ht[At]);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.pipelineApiUtilities.initializePipelines()}async setProductionMode(Le){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.utilityApi.setProductionMode(Le)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.pipelineApiUtilities.getCurrentPipeline())}setSdkVersion(Le){this.checkWasmInitialization("Unable to set sdk version, cpp API hasn't been initialized"),this.utilityApi.setSdkVersion(Le)}setSdkPlatform(Le){this.checkWasmInitialization("Unable to set device type, cpp API hasn't been initialized"),this.utilityApi.setSdkPlatform(Le)}setDeviceInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set device info, cpp API hasn't been initialized"),this.utilityApi.setDeviceInfo(Le,Ye)}setBrowserInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set browser info, cpp API hasn't been initialized"),this.utilityApi.setBrowserInfo(Le,Ye)}setCameraInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set camera info, cpp API hasn't been initialized"),this.utilityApi.setCameraInfo(Le,Ye)}setZc(Le){this.checkWasmInitialization("Unable to set zc, cpp API hasn't been initialized"),this.utilityApi.setZc(Le)}setMotionStatus(Le){this.checkWasmInitialization("Unable to set motion status, cpp API hasn't been initialized"),this.utilityApi.setMotionStatus(Le)}setMetadataField(Le,Ye){this.checkWasmInitialization("Unable to set metadata field, cpp API hasn't been initialized"),this.utilityApi.setMetadataField(Le,Ye)}setInspectorOpened(Le){this.inspectorOpened_=Le}setBackgroundMode(Le){this.checkWasmInitialization("Unable to set background mode, cpp API hasn't been initialized"),this.utilityApi.setBackgroundMode(Le)}getCheck(){return this.checkWasmInitialization("Unable to get check, cpp API hasn't been initialized"),this.utilityApi.getCheck()}getMetadata(){return this.checkWasmInitialization("Unable to get metadata, cpp API hasn't been initialized"),this.utilityApi.setInspectorOpened(this.inspectorOpened_),this.utilityApi.getMetadata()}async prc(Le){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[Le])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}async pc(Le){this.checkWasmInitialization("Unable to pc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.pc.bind(this.utilityApi),[Le])}pipelineTypeToWasmEnum(Le){switch(Le){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(Le){switch(Le){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(Le){switch(Le){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(Le){switch(Le){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(Le){if(!this.isInitialized())throw new Error(Le)}async wasmCallWrapper(Le,Ye=[]){return await this.wasmCallMutex.withLock(async(...tt)=>{let nt=!1;try{for(;;){if(nt=Le(...tt),nt)return;await new Promise(ft=>setTimeout(ft,0))}}catch(ft){console.log("Error in wasmCallWrapper:",ft)}},...Ye)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance(),version$4="1.85.0-20251103184219.0";function e$2(Be,Le){return function(Ye,tt){return Object.prototype.hasOwnProperty.call(Ye,tt)}(Be,Le)?Be[Le]:void 0}function t$2(Be,Le,Ye,tt){const nt=document,ft="securitypolicyviolation";let ht;const gt=xt=>{const yt=new URL(Be,location.href),{blockedURI:Ct}=xt;Ct!==yt.href&&Ct!==yt.protocol.slice(0,-1)&&Ct!==yt.origin||(ht=xt,At())};nt.addEventListener(ft,gt);const At=()=>nt.removeEventListener(ft,gt);return Promise.resolve().then(Le).then(xt=>(At(),xt),xt=>new Promise(yt=>{const Ct=new MessageChannel;Ct.port1.onmessage=()=>yt(),Ct.port2.postMessage(null)}).then(()=>{if(At(),ht)return Ye(ht);throw xt}))}function n$2(Be){let Le="";for(let Ye=0;Ye<Be.length;++Ye)if(Ye>0){const tt=Be[Ye].toLowerCase();tt!==Be[Ye]?Le+=` ${tt}`:Le+=Be[Ye]}else Le+=Be[Ye].toUpperCase();return Le}const r$4={default:"endpoint"},o$1={default:"tlsEndpoint"},i$5="Client timeout",R$2="Network connection error",s$3="Network request aborted",a$3="Response cannot be parsed",c$3="Blocked by CSP",E$1="The endpoint parameter is not a valid URL",l$1="Handle on demand agent data error",u$1=n$2("WrongRegion"),d$1=n$2("SubscriptionNotActive"),_$2=n$2("UnsupportedVersion"),O$1=n$2("InstallationMethodRestricted"),p$1=n$2("HostnameRestricted"),I$1=n$2("IntegrationFailed"),f$2=n$2("NetworkRestricted"),N$1=n$2("InvalidProxyIntegrationSecret"),T$1=n$2("InvalidProxyIntegrationHeaders"),h$e=n$2("ProxyIntegrationSecretEnvironmentMismatch"),v$d="API key required",m$2="API key not found",A$1="API key expired",w$e="Request cannot be parsed",P$1="Request failed",D$1="Request failed to process",S$1="Too many requests, rate limit exceeded",y="Not available for this origin",g$1="Not available with restricted header",L$1=v$d,C$1=m$2,U$1=A$1;var b$2="3.12.3";const M$1="Failed to load the JS script of the agent",K="9319";function V(Be,Le){const Ye=[],[tt,nt]=function(gt){const At=function(Ct){const Et=[...Ct];return{current:()=>Et[0],postpone(){const vt=Et.shift();vt!==void 0&&Et.push(vt)},exclude(){Et.shift()}}}(gt),xt=function(Ct,Et){let vt=0;return()=>Math.random()*Math.min(Et,Ct*Math.pow(2,vt++))}(100,3e3),yt=new Set;return[At.current(),(Ct,Et)=>{let vt;const kt=Et instanceof Error?Et.message:"";if(kt===c$3||kt===E$1)At.exclude(),vt=0;else if(kt===K)At.exclude();else if(kt===M$1){const wt=Date.now()-Ct.getTime()<50,It=At.current();It&&wt&&!yt.has(It)&&(yt.add(It),vt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,vt??Ct.getTime()+xt()-Date.now()]}]}(Be);let ft;if(tt===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const ht=gt=>{const At=new Date,xt=Ct=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:Ct}),yt=Le(gt);return yt.then(()=>xt(),xt),yt.catch(Ct=>{if(ft!=null||(ft=Ct),Ye.length>=5)throw ft;const Et=nt(At,Ct);if(!Et)throw ft;const[vt,kt]=Et;return(bt=kt,new Promise(wt=>setTimeout(wt,bt))).then(()=>ht(vt));var bt})};return ht(tt).then(gt=>[gt,Ye])}const k$1="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",G=k$1;function B$1(Be){var Le,Ye;const{picked:tt,rest:nt}=function(yt,Ct){const Et={},vt={};for(const[kt,bt]of Object.entries(yt))Ct.includes(kt)?Et[kt]=bt:vt[kt]=bt;return{picked:Et,rest:vt}}(Be,["scriptUrlPattern","token","apiKey"]),ft=tt.token,ht=(Le=tt.apiKey)!==null&&Le!==void 0?Le:ft,gt=(Ye=e$2(Be,"scriptUrlPattern"))!==null&&Ye!==void 0?Ye:k$1,[At,xt]=function(){const yt=[],Ct=()=>{yt.push({time:new Date,state:document.visibilityState})},Et=function(vt,kt,bt,wt){return vt.addEventListener(kt,bt,wt),()=>vt.removeEventListener(kt,bt,wt)}(document,"visibilitychange",Ct);return Ct(),[yt,Et]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const yt=function(Ct,Et){return(Array.isArray(Ct)?Ct:[Ct]).map(vt=>function(kt,bt){const wt=encodeURIComponent;return kt.replace(/<[^<>]+>/g,It=>It==="<version>"?"3":It==="<apiKey>"?wt(bt):It==="<loaderVersion>"?wt(b$2):It)}(String(vt),Et))}(gt,ht);return V(yt,F$1)}).catch(yt=>{throw xt(),function(Ct){return Ct instanceof Error&&Ct.message===K?new Error(M$1):Ct}(yt)}).then(([yt,Ct])=>(xt(),yt.load({...nt,ldi:{attempts:Ct,visibilityStates:At}})))}function F$1(Be){return t$2(Be,()=>function(Le){return new Promise((Ye,tt)=>{if(function(gt){if(URL.prototype)try{return new URL(gt,location.href),!1}catch(At){if(At instanceof Error&&At.name==="TypeError")return!0;throw At}}(Le))throw new Error(E$1);const nt=document.createElement("script"),ft=()=>{var gt;return(gt=nt.parentNode)===null||gt===void 0?void 0:gt.removeChild(nt)},ht=document.head||document.getElementsByTagName("head")[0];nt.onload=()=>{ft(),Ye()},nt.onerror=()=>{ft(),tt(new Error(M$1))},nt.async=!0,nt.src=Le,ht.appendChild(nt)})}(Be),()=>{throw new Error(c$3)}).then(x$1)}function x$1(){const Be=window,Le="__fpjs_p_l_b",Ye=Be[Le];if(function(tt,nt){var ft;const ht=(ft=Object.getOwnPropertyDescriptor)===null||ft===void 0?void 0:ft.call(Object,tt,nt);ht!=null&&ht.configurable?delete tt[nt]:ht&&!ht.writable||(tt[nt]=void 0)}(Be,Le),typeof(Ye==null?void 0:Ye.load)!="function")throw new Error(K);return Ye}var H={load:B$1,defaultScriptUrlPattern:G,ERROR_SCRIPT_LOAD_FAIL:M$1,ERROR_API_KEY_EXPIRED:A$1,ERROR_API_KEY_INVALID:m$2,ERROR_API_KEY_MISSING:v$d,ERROR_BAD_REQUEST_FORMAT:w$e,ERROR_BAD_RESPONSE_FORMAT:a$3,ERROR_CLIENT_TIMEOUT:i$5,ERROR_CSP_BLOCK:c$3,ERROR_FORBIDDEN_ENDPOINT:p$1,ERROR_FORBIDDEN_HEADER:g$1,ERROR_FORBIDDEN_ORIGIN:y,ERROR_GENERAL_SERVER_FAILURE:P$1,ERROR_HANDLE_AGENT_DATA:l$1,ERROR_INSTALLATION_METHOD_RESTRICTED:O$1,ERROR_INTEGRATION_FAILURE:I$1,ERROR_INVALID_ENDPOINT:E$1,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:T$1,ERROR_INVALID_PROXY_INTEGRATION_SECRET:N$1,ERROR_NETWORK_ABORT:s$3,ERROR_NETWORK_CONNECTION:R$2,ERROR_NETWORK_RESTRICTED:f$2,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:h$e,ERROR_RATE_LIMIT:S$1,ERROR_SERVER_TIMEOUT:D$1,ERROR_SUBSCRIPTION_NOT_ACTIVE:d$1,ERROR_TOKEN_EXPIRED:U$1,ERROR_TOKEN_INVALID:C$1,ERROR_TOKEN_MISSING:L$1,ERROR_UNSUPPORTED_VERSION:_$2,ERROR_WRONG_REGION:u$1,defaultEndpoint:r$4,defaultTlsEndpoint:o$1};function e$1(Be,Le,Ye,tt){return new(Ye||(Ye=Promise))(function(nt,ft){function ht(xt){try{At(tt.next(xt))}catch(yt){ft(yt)}}function gt(xt){try{At(tt.throw(xt))}catch(yt){ft(yt)}}function At(xt){var yt;xt.done?nt(xt.value):(yt=xt.value,yt instanceof Ye?yt:new Ye(function(Ct){Ct(yt)})).then(ht,gt)}At((tt=tt.apply(Be,[])).next())})}function n$1(Be,Le){var Ye,tt,nt,ft,ht={label:0,sent:function(){if(1&nt[0])throw nt[1];return nt[1]},trys:[],ops:[]};return ft={next:gt(0),throw:gt(1),return:gt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function gt(At){return function(xt){return function(yt){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,yt[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&yt[0]?tt.return:yt[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,yt[1])).done)return nt;switch(tt=0,nt&&(yt=[2&yt[0],nt.value]),yt[0]){case 0:case 1:nt=yt;break;case 4:return ht.label++,{value:yt[1],done:!1};case 5:ht.label++,tt=yt[1],yt=[0];continue;case 7:yt=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||yt[0]!==6&&yt[0]!==2)){ht=0;continue}if(yt[0]===3&&(!nt||yt[1]>nt[0]&&yt[1]<nt[3])){ht.label=yt[1];break}if(yt[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=yt;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(yt);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}yt=Le.call(Be,ht)}catch(Ct){yt=[6,Ct],tt=0}finally{Ye=nt=0}if(5&yt[0])throw yt[1];return{value:yt[0]?yt[1]:void 0,done:!0}}([At,xt])}}}typeof SuppressedError=="function"&&SuppressedError;var r$3={exclude:[],include:[],logging:!0,timeout:1e3},o={},a$2={timeout:"true"},i$4=function(Be,Le){typeof window<"u"&&(o[Be]=Le)},u=function(){return Object.fromEntries(Object.entries(o).filter(function(Be){var Le,Ye=Be[0];return!(!((Le=r$3==null?void 0:r$3.exclude)===null||Le===void 0)&&Le.includes(Ye))}).filter(function(Be){var Le,Ye,tt,nt,ft=Be[0];return!((Le=r$3==null?void 0:r$3.include)===null||Le===void 0)&&Le.some(function(ht){return ht.includes(".")})?(Ye=r$3==null?void 0:r$3.include)===null||Ye===void 0?void 0:Ye.some(function(ht){return ht.startsWith(ft)}):((tt=r$3==null?void 0:r$3.include)===null||tt===void 0?void 0:tt.length)===0||((nt=r$3==null?void 0:r$3.include)===null||nt===void 0?void 0:nt.includes(ft))}).map(function(Be){return[Be[0],(0,Be[1])()]}))};function c$2(Be){return Be^=Be>>>16,Be=Math.imul(Be,2246822507),Be^=Be>>>13,Be=Math.imul(Be,3266489909),(Be^=Be>>>16)>>>0}var s$2=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(Be,Le){return Be<<Le|Be>>>32-Le}function d(Be,Le){var Ye;if(Le===void 0&&(Le=0),Le=Le?0|Le:0,typeof Be=="string"&&(Ye=Be,Be=new TextEncoder().encode(Ye).buffer),!(Be instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var tt=new Uint32Array([Le,Le,Le,Le]);(function(ft,ht){for(var gt=ft.byteLength/16|0,At=new Uint32Array(ft,0,4*gt),xt=0;xt<gt;xt++){var yt=At.subarray(4*xt,4*(xt+1));yt[0]=Math.imul(yt[0],s$2[0]),yt[0]=l(yt[0],15),yt[0]=Math.imul(yt[0],s$2[1]),ht[0]=ht[0]^yt[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,yt[1]=Math.imul(yt[1],s$2[1]),yt[1]=l(yt[1],16),yt[1]=Math.imul(yt[1],s$2[2]),ht[1]=ht[1]^yt[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,yt[2]=Math.imul(yt[2],s$2[2]),yt[2]=l(yt[2],17),yt[2]=Math.imul(yt[2],s$2[3]),ht[2]=ht[2]^yt[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,yt[3]=Math.imul(yt[3],s$2[3]),yt[3]=l(yt[3],18),yt[3]=Math.imul(yt[3],s$2[0]),ht[3]=ht[3]^yt[3],ht[3]=l(ht[3],13),ht[3]=ht[3]+ht[0],ht[3]=Math.imul(ht[3],5)+850148119}})(Be,tt),function(ft,ht){var gt=ft.byteLength/16|0,At=ft.byteLength%16,xt=new Uint32Array(4),yt=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^yt[14]<<16;case 14:xt[3]=xt[3]^yt[13]<<8;case 13:xt[3]=xt[3]^yt[12],xt[3]=Math.imul(xt[3],s$2[3]),xt[3]=l(xt[3],18),xt[3]=Math.imul(xt[3],s$2[0]),ht[3]=ht[3]^xt[3];case 12:xt[2]=xt[2]^yt[11]<<24;case 11:xt[2]=xt[2]^yt[10]<<16;case 10:xt[2]=xt[2]^yt[9]<<8;case 9:xt[2]=xt[2]^yt[8],xt[2]=Math.imul(xt[2],s$2[2]),xt[2]=l(xt[2],17),xt[2]=Math.imul(xt[2],s$2[3]),ht[2]=ht[2]^xt[2];case 8:xt[1]=xt[1]^yt[7]<<24;case 7:xt[1]=xt[1]^yt[6]<<16;case 6:xt[1]=xt[1]^yt[5]<<8;case 5:xt[1]=xt[1]^yt[4],xt[1]=Math.imul(xt[1],s$2[1]),xt[1]=l(xt[1],16),xt[1]=Math.imul(xt[1],s$2[2]),ht[1]=ht[1]^xt[1];case 4:xt[0]=xt[0]^yt[3]<<24;case 3:xt[0]=xt[0]^yt[2]<<16;case 2:xt[0]=xt[0]^yt[1]<<8;case 1:xt[0]=xt[0]^yt[0],xt[0]=Math.imul(xt[0],s$2[0]),xt[0]=l(xt[0],15),xt[0]=Math.imul(xt[0],s$2[1]),ht[0]=ht[0]^xt[0]}}(Be,tt),function(ft,ht){ht[0]=ht[0]^ft.byteLength,ht[1]=ht[1]^ft.byteLength,ht[2]=ht[2]^ft.byteLength,ht[3]=ht[3]^ft.byteLength,ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0,ht[0]=c$2(ht[0]),ht[1]=c$2(ht[1]),ht[2]=c$2(ht[2]),ht[3]=c$2(ht[3]),ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0}(Be,tt);var nt=new Uint8Array(tt.buffer);return Array.from(nt).map(function(ft){return ft.toString(16).padStart(2,"0")}).join("")}function f$1(Be,Le){return new Promise(function(Ye){setTimeout(function(){return Ye(Le)},Be)})}function m$1(Be,Le,Ye){return Promise.all(Be.map(function(tt){return Promise.race([tt,f$1(Le,Ye)])}))}function g(){return e$1(this,void 0,void 0,function(){var Be,Le,Ye,tt,nt;return n$1(this,function(ft){switch(ft.label){case 0:return ft.trys.push([0,2,,3]),Be=u(),Le=Object.keys(Be),[4,m$1(Object.values(Be),(r$3==null?void 0:r$3.timeout)||1e3,a$2)];case 1:return Ye=ft.sent(),tt=Ye.filter(function(ht){return ht!==void 0}),nt={},tt.forEach(function(ht,gt){nt[Le[gt]]=ht}),[2,p(nt,r$3.exclude||[],r$3.include||[],"")];case 2:throw ft.sent();case 3:return[2]}})})}function p(Be,Le,Ye,tt){tt===void 0&&(tt="");for(var nt={},ft=function(xt,yt){var Ct=tt+xt+".";if(typeof yt!="object"||Array.isArray(yt)){var Et=Le.some(function(bt){return Ct.startsWith(bt)}),vt=Ye.some(function(bt){return Ct.startsWith(bt)});Et&&!vt||(nt[xt]=yt)}else{var kt=p(yt,Le,Ye,Ct);Object.keys(kt).length>0&&(nt[xt]=kt)}},ht=0,gt=Object.entries(Be);ht<gt.length;ht++){var At=gt[ht];ft(At[0],At[1])}return nt}function w$d(Be){return e$1(this,void 0,void 0,function(){var Le,Ye;return n$1(this,function(tt){switch(tt.label){case 0:return tt.trys.push([0,2,,3]),[4,g()];case 1:return Le=tt.sent(),Ye=d(JSON.stringify(Le)),Math.random()<1e-5&&r$3.logging&&function(nt,ft){e$1(this,void 0,void 0,function(){var ht,gt;return n$1(this,function(At){switch(At.label){case 0:if(ht="https://logging.thumbmarkjs.com/v1/log",gt={thumbmark:nt,components:ft,version:"0.20.6"},sessionStorage.getItem("_tmjs_l"))return[3,4];sessionStorage.setItem("_tmjs_l","1"),At.label=1;case 1:return At.trys.push([1,3,,4]),[4,fetch(ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)})];case 2:case 3:return At.sent(),[3,4];case 4:return[2]}})})}(Ye,Le),[2,Ye.toString()];case 2:throw tt.sent();case 3:return[2]}})})}function b$1(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var Be=navigator.userAgent,Le={edg:"Edge",opr:"Opera",samsung:"SamsungBrowser"},Ye=0,tt=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>samsung).*Version\/(?<version>\d+(?:\.\d+)?)/i,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/];Ye<tt.length;Ye++){var nt=tt[Ye],ft=Be.match(nt);if(ft&&ft.groups)return{name:Le[ft.groups.name.toLowerCase()]||ft.groups.name,version:ft.groups.version}}return{name:"unknown",version:"unknown"}}function S(Be){for(var Le=0,Ye=0;Ye<Be.length;++Ye)Le+=Math.abs(Be[Ye]);return Le}var M=b$1();function E(Be,Le,Ye){for(var tt=[],nt=0;nt<Be[0].data.length;nt++){for(var ft=[],ht=0;ht<Be.length;ht++)ft.push(Be[ht].data[nt]);tt.push(P(ft))}var gt=new Uint8ClampedArray(tt);return new ImageData(gt,Le,Ye)}function P(Be){if(Be.length===0)return 0;for(var Le={},Ye=0,tt=Be;Ye<tt.length;Ye++)Le[ft=tt[Ye]]=(Le[ft]||0)+1;var nt=Be[0];for(var ft in Le)Le[ft]>Le[nt]&&(nt=parseInt(ft,10));return nt}["SamsungBrowser","Safari"].includes(M.name)||i$4("audio",function(){return e$1(this,void 0,void 0,function(){return n$1(this,function(Be){return[2,new Promise(function(Le,Ye){try{var tt=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),nt=tt.createBufferSource(),ft=tt.createOscillator();ft.frequency.value=1e3;var ht,gt=tt.createDynamicsCompressor();gt.threshold.value=-50,gt.knee.value=40,gt.ratio.value=12,gt.attack.value=0,gt.release.value=.2,ft.connect(gt),gt.connect(tt.destination),ft.start(),tt.oncomplete=function(At){ht=At.renderedBuffer.getChannelData(0),Le({sampleHash:S(ht),oscillator:ft.type,maxChannels:tt.destination.maxChannelCount,channelCountMode:nt.channelCountMode})},tt.startRendering()}catch(At){console.error("Error creating audio fingerprint:",At),Ye(At)}})]})})});var A=b$1(),C=A.name.toLowerCase(),x=A.version.split(".")[0]||"0",T=parseInt(x,10);C==="firefox"||C==="safari"&&T===17||i$4("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(Be){var Le=Array.from({length:3},function(){return function(){var Ye=document.createElement("canvas"),tt=Ye.getContext("2d");if(!tt)return new ImageData(1,1);Ye.width=280,Ye.height=20;var nt=tt.createLinearGradient(0,0,Ye.width,Ye.height);nt.addColorStop(0,"red"),nt.addColorStop(.16666666666666666,"orange"),nt.addColorStop(.3333333333333333,"yellow"),nt.addColorStop(.5,"green"),nt.addColorStop(.6666666666666666,"blue"),nt.addColorStop(.8333333333333334,"indigo"),nt.addColorStop(1,"violet"),tt.fillStyle=nt,tt.fillRect(0,0,Ye.width,Ye.height);var ft="Random Text WMwmil10Oo";return tt.font="23.123px Arial",tt.fillStyle="black",tt.fillText(ft,-5,15),tt.fillStyle="rgba(0, 0, 255, 0.5)",tt.fillText(ft,-3.3,17.7),tt.beginPath(),tt.moveTo(0,0),tt.lineTo(2*Ye.width/7,Ye.height),tt.strokeStyle="white",tt.lineWidth=2,tt.stroke(),tt.getImageData(0,0,Ye.width,Ye.height)}()});Be({commonImageDataHash:d(E(Le,280,20).data.toString()).toString()})})});var k,I=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],R$1=["monospace","sans-serif","serif"];function L(Be,Le){if(!Be)throw new Error("Canvas context not supported");return Be.font,Be.font="72px ".concat(Le),Be.measureText("WwMmLli0Oo").width}function _$1(){var Be,Le=document.createElement("canvas"),Ye=(Be=Le.getContext("webgl"))!==null&&Be!==void 0?Be:Le.getContext("experimental-webgl");if(Ye&&"getParameter"in Ye)try{var tt=(Ye.getParameter(Ye.VENDOR)||"").toString(),nt=(Ye.getParameter(Ye.RENDERER)||"").toString(),ft={vendor:tt,renderer:nt,version:(Ye.getParameter(Ye.VERSION)||"").toString(),shadingLanguageVersion:(Ye.getParameter(Ye.SHADING_LANGUAGE_VERSION)||"").toString()};if(!nt.length||!tt.length){var ht=Ye.getExtension("WEBGL_debug_renderer_info");if(ht){var gt=(Ye.getParameter(ht.UNMASKED_VENDOR_WEBGL)||"").toString(),At=(Ye.getParameter(ht.UNMASKED_RENDERER_WEBGL)||"").toString();gt&&(ft.vendorUnmasked=gt),At&&(ft.rendererUnmasked=At)}}return ft}catch{}return"undefined"}function O(){var Be=new Float32Array(1),Le=new Uint8Array(Be.buffer);return Be[0]=1/0,Be[0]=Be[0]-Be[0],Le[3]}function B(Be,Le){var Ye={};return Le.forEach(function(tt){var nt=function(ft){if(ft.length===0)return null;var ht={};ft.forEach(function(xt){var yt=String(xt);ht[yt]=(ht[yt]||0)+1});var gt=ft[0],At=1;return Object.keys(ht).forEach(function(xt){ht[xt]>At&&(gt=xt,At=ht[xt])}),gt}(Be.map(function(ft){return tt in ft?ft[tt]:void 0}).filter(function(ft){return ft!==void 0}));nt&&(Ye[tt]=nt)}),Ye}function D(){var Be=[],Le={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(Le).forEach(function(Ye){Le[Ye].forEach(function(tt){matchMedia("(".concat(Ye,": ").concat(tt,")")).matches&&Be.push("".concat(Ye,": ").concat(tt))})}),Be}b$1().name!="Firefox"&&i$4("fonts",function(){var Be=this;return new Promise(function(Le,Ye){try{(function(tt){var nt;e$1(this,void 0,void 0,function(){var ft,ht,gt;return n$1(this,function(At){switch(At.label){case 0:return document.body?[3,2]:[4,(xt=50,new Promise(function(Ct){return setTimeout(Ct,xt,yt)}))];case 1:return At.sent(),[3,0];case 2:if((ft=document.createElement("iframe")).setAttribute("frameBorder","0"),(ht=ft.style).setProperty("position","fixed"),ht.setProperty("display","block","important"),ht.setProperty("visibility","visible"),ht.setProperty("border","0"),ht.setProperty("opacity","0"),ft.src="about:blank",document.body.appendChild(ft),!(gt=ft.contentDocument||((nt=ft.contentWindow)===null||nt===void 0?void 0:nt.document)))throw new Error("Iframe document is not accessible");return tt({iframe:gt}),setTimeout(function(){document.body.removeChild(ft)},0),[2]}var xt,yt})})})(function(tt){var nt=tt.iframe;return e$1(Be,void 0,void 0,function(){var ft,ht,gt,At;return n$1(this,function(xt){return ft=nt.createElement("canvas"),ht=ft.getContext("2d"),gt=R$1.map(function(yt){return L(ht,yt)}),At={},I.forEach(function(yt){var Ct=L(ht,yt);gt.includes(Ct)||(At[yt]=Ct)}),Le(At),[2]})})})}catch{Ye({error:"unsupported"})}})}),i$4("hardware",function(){return new Promise(function(Be,Le){var Ye=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,tt=window.performance&&window.performance.memory?window.performance.memory:0;Be({videocard:_$1(),architecture:O(),deviceMemory:Ye.toString()||"undefined",jsHeapSizeLimit:tt.jsHeapSizeLimit||0})})}),i$4("locales",function(){return new Promise(function(Be){Be({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),i$4("permissions",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){return k=(r$3==null?void 0:r$3.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],b$1().name.toLowerCase()==="safari"&&(k=k.filter(function(Ye){return!["camera","geolocation","microphone"].includes(Ye)})),Be=Array.from({length:(r$3==null?void 0:r$3.retries)||3},function(){return function(){return e$1(this,void 0,void 0,function(){var Ye,tt,nt,ft,ht;return n$1(this,function(gt){switch(gt.label){case 0:Ye={},tt=0,nt=k,gt.label=1;case 1:if(!(tt<nt.length))return[3,6];ft=nt[tt],gt.label=2;case 2:return gt.trys.push([2,4,,5]),[4,navigator.permissions.query({name:ft})];case 3:return ht=gt.sent(),Ye[ft]=ht.state.toString(),[3,5];case 4:return gt.sent(),[3,5];case 5:return tt++,[3,1];case 6:return[2,Ye]}})})}()}),[2,Promise.all(Be).then(function(Ye){return B(Ye,k)})]})})}),i$4("plugins",function(){var Be=[];if(navigator.plugins)for(var Le=0;Le<navigator.plugins.length;Le++){var Ye=navigator.plugins[Le];Be.push([Ye.name,Ye.filename,Ye.description].join("|"))}return new Promise(function(tt){tt({plugins:Be})})}),i$4("screen",function(){return new Promise(function(Be){Be({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:D()})})}),i$4("system",function(){return new Promise(function(Be){var Le=b$1(),Ye={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:Le.name,version:Le.version}};Le.name.toLowerCase()!=="safari"&&(Ye.applePayVersion=function(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var tt=window.ApplePaySession.supportsVersion,nt=15;nt>0;nt--)if(tt(nt))return nt}catch{return 0}return 0}(),Ye.cookieEnabled=window.navigator.cookieEnabled),Be(Ye)})});var U,N=b$1().name!=="SamsungBrowser"?1:3,F=null;i$4("webgl",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){typeof document<"u"&&((U=document.createElement("canvas")).width=200,U.height=100,F=U.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return Be=Array.from({length:N},function(){return function(){try{if(!F)throw new Error("WebGL not supported");var Ye=`
66
+ `;typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let Be,Le;return{promise:new Promise((tt,nt)=>{Be=tt,Le=nt}),resolve:Be,reject:Le}});class InterruptionHandler{constructor(){this.boundVisibilityChange=this.handleVisibilityChange.bind(this),this.boundOnline=this.handleOnline.bind(this),this.boundOffline=this.handleOffline.bind(this),this.boundUnhandledRejection=this.handleUnhandledRejection.bind(this),this.boundError=this.handleError.bind(this),this.initialized=!1}registerEventListeners(){this.initialized||(document.addEventListener("visibilitychange",this.boundVisibilityChange),window.addEventListener("online",this.boundOnline),window.addEventListener("offline",this.boundOffline),window.addEventListener("unhandledrejection",this.boundUnhandledRejection),window.addEventListener("error",this.boundError),this.initialized=!0)}removeEventListeners(){this.initialized&&(this.initialized=!1,document.removeEventListener("visibilitychange",this.boundVisibilityChange),window.removeEventListener("online",this.boundOnline),window.removeEventListener("offline",this.boundOffline),window.removeEventListener("unhandledrejection",this.boundUnhandledRejection),window.removeEventListener("error",this.boundError))}handleVisibilityChange(){document.hidden?this.onAppHidden():this.onAppVisible()}onAppHidden(){}onAppVisible(){}handleOnline(){}handleOffline(){}handleUnhandledRejection(Le){}handleError(Le){}}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,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};function webgl(){let Be,Le,Ye=256,tt=128;Be=document.body.appendChild(document.createElement("canvas")),Be.width=Ye,Be.height=tt;try{Le=Be.getContext("webgl2")||Be.getContext("experimental-webgl2")||Be.getContext("webgl")||Be.getContext("experimental-webgl")||Be.getContext("moz-webgl");const nt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",ft="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",ht=Le.createBuffer();Le.bindBuffer(Le.ARRAY_BUFFER,ht);const gt=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);Le.bufferData(Le.ARRAY_BUFFER,gt,Le.STATIC_DRAW),ht.itemSize=3,ht.numItems=3;const At=Le.createProgram(),xt=Le.createShader(Le.VERTEX_SHADER);Le.shaderSource(xt,nt),Le.compileShader(xt);const yt=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(yt,ft),Le.compileShader(yt),Le.attachShader(At,xt),Le.attachShader(At,yt),Le.linkProgram(At),Le.useProgram(At),At.vertexPosAttrib=Le.getAttribLocation(At,"attrVertex"),At.offsetUniform=Le.getUniformLocation(At,"uniformOffset"),Le.enableVertexAttribArray(At.vertexPosAttrib),Le.vertexAttribPointer(At.vertexPosAttrib,ht.itemSize,Le.FLOAT,!1,0,0),Le.uniform2f(At.offsetUniform,1,1),Le.drawArrays(Le.TRIANGLE_STRIP,0,ht.numItems);let Ct="";const Et=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Et),Ct=JSON.stringify(Et).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(Ct)}catch{return""}}const sha256=(()=>{let Be=1,Le,Ye=[],tt=[];for(;++Be<18;)for(Le=Be*Be;Le<312;Le+=Be)Ye[Le]=1;function nt(gt,At){return Math.pow(gt,1/At)%1*4294967296|0}for(Be=1,Le=0;Be<313;)Ye[++Be]||(tt[Le]=nt(Be,2),Ye[Le++]=nt(Be,3));function ft(gt,At){return gt>>>At|gt<<32-At}function ht(gt){let At=tt.slice(Be=0),xt=unescape(encodeURI(gt)),yt=[],Ct=xt.length,Et=[],vt,kt,bt;for(;Be<Ct;)Et[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(Ct*=8,Et[Ct>>5]|=128<<24-Ct%32,Et[bt=Ct+64>>5|15]=Ct,Be=0;Be<bt;Be+=16){for(vt=At.slice(Le=0,8);Le<64;vt[4]+=kt)Le<16?yt[Le]=Et[Le+Be]:yt[Le]=(ft(kt=yt[Le-2],17)^ft(kt,19)^kt>>>10)+(yt[Le-7]|0)+(ft(kt=yt[Le-15],7)^ft(kt,18)^kt>>>3)+(yt[Le-16]|0),vt.unshift((kt=(vt.pop()+(ft(gt=vt[4],6)^ft(gt,11)^ft(gt,25))+((gt&vt[5]^~gt&vt[6])+Ye[Le])|0)+(yt[Le++]|0))+(ft(Ct=vt[0],2)^ft(Ct,13)^ft(Ct,22))+(Ct&vt[1]^vt[1]&vt[2]^vt[2]&Ct));for(Le=8;Le--;)At[Le]=vt[Le]+At[Le]}for(xt="";Le<63;)xt+=(At[++Le>>3]>>4*(7-Le%8)&15).toString(16);return xt}return ht})();var store;function getGlobalConfig(Be){return{lang:store==null?void 0:store.lang,message:Be==null?void 0:Be.message,abortEarly:store==null?void 0:store.abortEarly,abortPipeEarly:store==null?void 0:store.abortPipeEarly}}var store2;function getGlobalMessage(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$3(Be){var Ye,tt;const Le=typeof Be;return Le==="string"?`"${Be}"`:Le==="number"||Le==="bigint"||Le==="boolean"?`${Be}`:Le==="object"||Le==="function"?(Be&&((tt=(Ye=Object.getPrototypeOf(Be))==null?void 0:Ye.constructor)==null?void 0:tt.name))??"null":Le}function _addIssue(Be,Le,Ye,tt,nt){const ft=nt&&"input"in nt?nt.input:Ye.value,ht=(nt==null?void 0:nt.expected)??Be.expects??null,gt=(nt==null?void 0:nt.received)??_stringify$3(ft),At={kind:Be.kind,type:Be.type,input:ft,expected:ht,received:gt,message:`Invalid ${Le}: ${ht?`Expected ${ht} but r`:"R"}eceived ${gt}`,requirement:Be.requirement,path:nt==null?void 0:nt.path,issues:nt==null?void 0:nt.issues,lang:tt.lang,abortEarly:tt.abortEarly,abortPipeEarly:tt.abortPipeEarly},xt=Be.kind==="schema",yt=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage(Be.reference,At.lang)??(xt?getSchemaMessage(At.lang):null)??tt.message??getGlobalMessage(At.lang);yt!==void 0&&(At.message=typeof yt=="function"?yt(At):yt),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig())}}}function _isValidObjectKey(Be,Le){return Object.hasOwn(Be,Le)&&Le!=="__proto__"&&Le!=="prototype"&&Le!=="constructor"}function _joinExpects(Be,Le){const Ye=[...new Set(Be)];return Ye.length>1?`(${Ye.join(` ${Le} `)})`:Ye[0]??"never"}function isValiError(Be){return Be instanceof ValiError}var ValiError=class extends Error{constructor(Be){super(Be[0].message),this.name="ValiError",this.issues=Be}};function getFallback(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault(Be,Le,Ye){return typeof Be.default=="function"?Be.default(Le,Ye):Be.default}function boolean$2(Be){return{kind:"schema",type:"boolean",reference:boolean$2,expects:"boolean",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function custom(Be,Le){return{kind:"schema",type:"custom",reference:custom,expects:"unknown",async:!1,check:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue(this,"type",Ye,tt),Ye}}}function function_(Be){return{kind:"schema",type:"function",reference:function_,expects:"Function",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$3(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue(this,"type",Ye,tt),Ye}}}function null_(Be){return{kind:"schema",type:"null",reference:null_,expects:"null",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function number$3(Be){return{kind:"schema",type:"number",reference:number$3,expects:"number",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function object(Be,Le){return{kind:"schema",type:"object",reference:object,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){var ft;const nt=Ye.value;if(nt&&typeof nt=="object"){Ye.typed=!0,Ye.value={};for(const ht in this.entries){const gt=this.entries[ht];if(ht in nt||(gt.type==="exact_optional"||gt.type==="optional"||gt.type==="nullish")&&gt.default!==void 0){const At=ht in nt?nt[ht]:getDefault(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const yt={type:"object",origin:"value",input:nt,key:ht,value:At};for(const Ct of xt.issues)Ct.path?Ct.path.unshift(yt):Ct.path=[yt],(ft=Ye.issues)==null||ft.push(Ct);if(Ye.issues||(Ye.issues=xt.issues),tt.abortEarly){Ye.typed=!1;break}}xt.typed||(Ye.typed=!1),Ye.value[ht]=xt.value}else if(gt.fallback!==void 0)Ye.value[ht]=getFallback(gt);else if(gt.type!=="exact_optional"&&gt.type!=="optional"&&gt.type!=="nullish"&&(_addIssue(this,"key",Ye,tt,{input:void 0,expected:`"${ht}"`,path:[{type:"object",origin:"key",input:nt,key:ht,value:nt[ht]}]}),tt.abortEarly))break}}else _addIssue(this,"type",Ye,tt);return Ye}}}function optional(Be,Le){return{kind:"schema",type:"optional",reference:optional,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function record(Be,Le,Ye){return{kind:"schema",type:"record",reference:record,expects:"Object",async:!1,key:Be,value:Le,message:Ye,get"~standard"(){return _getStandardProps(this)},"~run"(tt,nt){var ht,gt;const ft=tt.value;if(ft&&typeof ft=="object"){tt.typed=!0,tt.value={};for(const At in ft)if(_isValidObjectKey(ft,At)){const xt=ft[At],yt=this.key["~run"]({value:At},nt);if(yt.issues){const Et={type:"object",origin:"key",input:ft,key:At,value:xt};for(const vt of yt.issues)vt.path=[Et],(ht=tt.issues)==null||ht.push(vt);if(tt.issues||(tt.issues=yt.issues),nt.abortEarly){tt.typed=!1;break}}const Ct=this.value["~run"]({value:xt},nt);if(Ct.issues){const Et={type:"object",origin:"value",input:ft,key:At,value:xt};for(const vt of Ct.issues)vt.path?vt.path.unshift(Et):vt.path=[Et],(gt=tt.issues)==null||gt.push(vt);if(tt.issues||(tt.issues=Ct.issues),nt.abortEarly){tt.typed=!1;break}}(!yt.typed||!Ct.typed)&&(tt.typed=!1),yt.typed&&(tt.value[yt.value]=Ct.value)}}else _addIssue(this,"type",tt,nt);return tt}}}function string$2(Be){return{kind:"schema",type:"string",reference:string$2,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function _subIssues(Be){let Le;if(Be)for(const Ye of Be)Le?Le.push(...Ye.issues):Le=Ye.issues;return Le}function union(Be,Le){return{kind:"schema",type:"union",reference:union,expects:_joinExpects(Be.map(Ye=>Ye.expects),"|"),async:!1,options:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){let nt,ft,ht;for(const gt of this.options){const At=gt["~run"]({value:Ye.value},tt);if(At.typed)if(At.issues)ft?ft.push(At):ft=[At];else{nt=At;break}else ht?ht.push(At):ht=[At]}if(nt)return nt;if(ft){if(ft.length===1)return ft[0];_addIssue(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig(Ye));if(tt.issues)throw new ValiError(tt.issues);return tt.value}function validate$2(...Be){try{Be.forEach(({schema:Le,value:Ye})=>parse$8(Le,Ye))}catch(Le){if(isValiError(Le)){const Ye=Le.issues.map(tt=>{var ft;return`${((ft=tt.path)==null?void 0:ft.map(ht=>ht.key).join("."))||"root"}: ${tt.message}`}).join(", ");throw new Error(`Validation failed: ${Ye}`)}throw Le}}exports.api=void 0;function setApi(Be){exports.api=Be}function setToken(Be){exports.api.defaults.headers["X-Incode-Hardware-Id"]=Be}const eventsQueue=[];function addEvent(Be){const{token:Le,code:Ye,module:tt,screen:nt,clientTimestamp:ft,payload:ht={}}=Be;if(!Le){eventsQueue.push(Be);return}return exports.api.post("/omni/interview-events",[{code:Ye,module:tt,screen:nt,clientTimestamp:ft??new Date().getTime(),payload:ht}],{headers:{"X-Incode-Hardware-Id":Le}}).catch(()=>{})}function emptyQueue(Be){eventsQueue.forEach(Le=>{addEvent({...Le,token:Be})})}const state={token:null};var PipelineProfileName=(Be=>(Be[Be.IdCapture_2_01=0]="IdCapture_2_01",Be[Be.IdCapture_2_02=1]="IdCapture_2_02",Be[Be.IdCapture_3_02=2]="IdCapture_3_02",Be[Be.IdVideoSelfie_2_01=3]="IdVideoSelfie_2_01",Be[Be.SelfieWithAggregationMetrics=4]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=5]="SelfieWithQualityMetrics",Be[Be.SelfieVideoSelfie=6]="SelfieVideoSelfie",Be))(PipelineProfileName||{});class PipelineProfile{constructor(Le,Ye,tt,nt,ft,ht=null,gt=""){this.pipelineType=Le,this.name=Ye,this.detectionType=tt,this.modelNames=nt,this.parameters=ft,this.paramsConfigurator=ht,this.description=gt}reconfigureParams(Le,Ye){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,Le,Ye)}}var DetectionType=(Be=>(Be[Be.IDCapture=0]="IDCapture",Be[Be.Selfie=1]="Selfie",Be[Be.SelfieVideoSelfie=2]="SelfieVideoSelfie",Be[Be.IdVideoSelfie=3]="IdVideoSelfie",Be))(DetectionType||{}),WasmPipelineType=(Be=>(Be[Be.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",Be[Be.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",Be[Be.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",Be[Be.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",Be[Be.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",Be))(WasmPipelineType||{}),IdCaptureModelType=(Be=>(Be[Be.IdCaptureV1x=0]="IdCaptureV1x",Be[Be.IdCaptureV2x=1]="IdCaptureV2x",Be[Be.IdCaptureV3x=2]="IdCaptureV3x",Be))(IdCaptureModelType||{}),src$2={},src$1={},$_StatsigGlobal={},Log={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Log=Be.LogLevel=void 0;const Le=" DEBUG ",Ye=" INFO ",tt=" WARN ",nt=" ERROR ";function ft(gt){return gt.unshift("[Statsig]"),gt}Be.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class ht{static info(...At){ht.level>=Be.LogLevel.Info&&console.info(Ye,...ft(At))}static debug(...At){ht.level>=Be.LogLevel.Debug&&console.debug(Le,...ft(At))}static warn(...At){ht.level>=Be.LogLevel.Warn&&console.warn(tt,...ft(At))}static error(...At){ht.level>=Be.LogLevel.Error&&console.error(nt,...ft(At))}}Be.Log=ht,ht.level=Be.LogLevel.Warn})(Log),function(Be){var Le,Ye,tt;Object.defineProperty(Be,"__esModule",{value:!0}),Be._getInstance=Be._getStatsigGlobalFlag=Be._getStatsigGlobal=void 0;const nt=Log,ft=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Et}catch{return Et}};Be._getStatsigGlobal=ft;const ht=vt=>(0,Be._getStatsigGlobal)()[vt];Be._getStatsigGlobalFlag=ht;const gt=vt=>{const kt=(0,Be._getStatsigGlobal)();return vt?kt.instances&&kt.instances[vt]:(kt.instances&&Object.keys(kt.instances).length>1&&nt.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."),kt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},yt=typeof commonjsGlobal<"u"?commonjsGlobal:{},Ct=typeof globalThis<"u"?globalThis:{},Et=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:yt[At])!==null&&Ye!==void 0?Ye:Ct[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Et,yt[At]=Et,Ct[At]=Et}($_StatsigGlobal);var Diagnostics={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Diagnostics=void 0;const Le=new Map,Ye="start",tt="end",nt="statsig::diagnostics";Be.Diagnostics={_getMarkers:xt=>Le.get(xt),_markInitOverallStart:xt=>{gt(xt,ft({},Ye,"overall"))},_markInitOverallEnd:(xt,yt,Ct)=>{gt(xt,ft({success:yt,error:yt?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:Ct},tt,"overall"))},_markInitNetworkReqStart:(xt,yt)=>{gt(xt,ft(yt,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,yt)=>{gt(xt,ft(yt,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,yt)=>{gt(xt,ft(yt,tt,"initialize","process"))},_clearMarkers:xt=>{Le.delete(xt)},_formatError(xt){if(xt&&typeof xt=="object")return{code:At(xt,"code"),name:At(xt,"name"),message:At(xt,"message")}},_getDiagnosticsData(xt,yt,Ct,Et){var vt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(vt=xt==null?void 0:xt.headers)===null||vt===void 0?void 0:vt.get("x-statsig-region"),isDelta:Ct.includes('"is_delta":true')===!0?!0:void 0,attempt:yt,error:Be.Diagnostics._formatError(Et)}},_enqueueDiagnosticsEvent(xt,yt,Ct,Et){const vt=Be.Diagnostics._getMarkers(Ct);if(vt==null||vt.length<=0)return-1;const kt=vt[vt.length-1].timestamp-vt[0].timestamp;Be.Diagnostics._clearMarkers(Ct);const bt=ht(xt,{context:"initialize",markers:vt.slice(),statsigOptions:Et});return yt.enqueue(bt),kt}};function ft(xt,yt,Ct,Et){return Object.assign({key:Ct,action:yt,step:Et,timestamp:Date.now()},xt)}function ht(xt,yt){return{eventName:nt,user:xt,value:null,metadata:yt,time:Date.now()}}function gt(xt,yt){var Ct;const Et=(Ct=Le.get(xt))!==null&&Ct!==void 0?Ct:[];Et.push(yt),Le.set(xt,Et)}function At(xt,yt){if(yt in xt)return xt[yt]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(Be){return Array.isArray(Be)?"array":typeof Be}TypingUtils._typeOf=_typeOf;function _isTypeMatch(Be,Le){const Ye=tt=>Array.isArray(tt)?"array":tt===null?"null":typeof tt;return Ye(Be)===Ye(Le)}TypingUtils._isTypeMatch=_isTypeMatch,function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getSortedObject=Be._DJB2Object=Be._DJB2=void 0;const Le=TypingUtils,Ye=ft=>{let ht=0;for(let gt=0;gt<ft.length;gt++){const At=ft.charCodeAt(gt);ht=(ht<<5)-ht+At,ht=ht&ht}return String(ht>>>0)};Be._DJB2=Ye;const tt=(ft,ht)=>(0,Be._DJB2)(JSON.stringify((0,Be._getSortedObject)(ft,ht)));Be._DJB2Object=tt;const nt=(ft,ht)=>{if(ft==null)return null;const gt=Object.keys(ft).sort(),At={};return gt.forEach(xt=>{const yt=ft[xt];if(ht===0||(0,Le._typeOf)(yt)!=="object"){At[xt]=yt;return}At[xt]=(0,Be._getSortedObject)(yt,ht!=null?ht-1:ht)}),At};Be._getSortedObject=nt}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$4=Hashing;function _getUserStorageKey(Be,Le,Ye){var tt;if(Ye)return Ye(Be,Le);const nt=Le&&Le.customIDs?Le.customIDs:{},ft=[`uid:${(tt=Le==null?void 0:Le.userID)!==null&&tt!==void 0?tt:""}`,`cids:${Object.keys(nt).sort((ht,gt)=>ht.localeCompare(gt)).map(ht=>`${ht}-${nt[ht]}`).join(",")}`,`k:${Be}`];return(0,Hashing_1$4._DJB2)(ft.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(Be,Le,Ye){return Le?_getUserStorageKey(Be,Le,Ye):(0,Hashing_1$4._DJB2)(`k:${Be}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.NetworkParam=Be.NetworkDefault=Be.Endpoint=void 0,Be.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},Be.NetworkDefault={[Be.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Be.Endpoint._initialize]:"https://featureassets.org/v1",[Be.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},Be.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(NetworkConfig);var SafeJs={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getUnloadEvent=Be._getCurrentPageUrlSafe=Be._addDocumentEventListenerSafe=Be._addWindowEventListenerSafe=Be._isServerEnv=Be._getDocumentSafe=Be._getWindowSafe=void 0;const Le=()=>typeof window<"u"?window:null;Be._getWindowSafe=Le;const Ye=()=>{var At;const xt=(0,Be._getWindowSafe)();return(At=xt==null?void 0:xt.document)!==null&&At!==void 0?At:null};Be._getDocumentSafe=Ye;const tt=()=>{if((0,Be._getDocumentSafe)()!==null)return!1;const At=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||At};Be._isServerEnv=tt;const nt=(At,xt)=>{const yt=(0,Be._getWindowSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const yt=(0,Be._getDocumentSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.addEventListener(At,xt)};Be._addDocumentEventListenerSafe=ft;const ht=()=>{var At;try{return(At=(0,Be._getWindowSafe)())===null||At===void 0?void 0:At.location.href.split(/[?#]/)[0]}catch{return}};Be._getCurrentPageUrlSafe=ht;const gt=()=>{const At=(0,Be._getWindowSafe)();return At&&"onpagehide"in At?"pagehide":"beforeunload"};Be._getUnloadEvent=gt})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._mapExposures=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=(Be,Le,Ye,tt,nt)=>(Ye.bootstrapMetadata&&(tt.bootstrapMetadata=Ye.bootstrapMetadata),{eventName:Be,user:Le,value:null,metadata:_addEvaluationDetailsToMetadata(Ye,tt),secondaryExposures:nt,time:Date.now()}),_isExposureEvent=({eventName:Be})=>Be===GATE_EXPOSURE_NAME||Be===CONFIG_EXPOSURE_NAME||Be===LAYER_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(Be,Le,Ye)=>{var tt,nt,ft;const ht={gate:Le.name,gateValue:String(Le.value),ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(ht.configVersion=Le.__evaluation.version),_createExposure(GATE_EXPOSURE_NAME,Be,Le.details,ht,_mapExposures((ft=(nt=Le.__evaluation)===null||nt===void 0?void 0:nt.secondary_exposures)!==null&&ft!==void 0?ft:[],Ye))};StatsigEvent._createGateExposure=_createGateExposure;function _mapExposures(Be,Le){return Be.map(Ye=>typeof Ye=="string"?(Le??{})[Ye]:Ye).filter(Ye=>Ye!=null)}StatsigEvent._mapExposures=_mapExposures;const _createConfigExposure=(Be,Le,Ye)=>{var tt,nt,ft,ht;const gt={config:Le.name,ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(gt.configVersion=Le.__evaluation.version),((nt=Le.__evaluation)===null||nt===void 0?void 0:nt.passed)!=null&&(gt.rulePassed=String(Le.__evaluation.passed)),_createExposure(CONFIG_EXPOSURE_NAME,Be,Le.details,gt,_mapExposures((ht=(ft=Le.__evaluation)===null||ft===void 0?void 0:ft.secondary_exposures)!==null&&ht!==void 0?ht:[],Ye))};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(Be,Le,Ye,tt)=>{var nt,ft,ht,gt,At,xt,yt;const Ct=Le.__evaluation,Et=((nt=Ct==null?void 0:Ct.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let vt="",kt=(ft=Ct==null?void 0:Ct.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Et&&(vt=(ht=Ct.allocated_experiment_name)!==null&&ht!==void 0?ht:"",kt=(gt=Ct.secondary_exposures)!==null&&gt!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,wt={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:vt,isExplicitParameter:String(Et)};return((yt=Le.__evaluation)===null||yt===void 0?void 0:yt.version)!=null&&(wt.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,wt,_mapExposures(kt,tt))};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(Be,Le)=>(Le.reason=Be.reason,Be.lcut&&(Le.lcut=String(Be.lcut)),Be.receivedAt&&(Le.receivedAt=String(Be.receivedAt)),Le);var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0}),StatsigOptionsCommon.LoggingEnabledOption=StatsigOptionsCommon.LogEventCompressionMode=void 0,StatsigOptionsCommon.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},StatsigOptionsCommon.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"};var StorageProvider={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._setObjectInStorage=Be._getObjectFromStorage=Be.Storage=void 0;const Le=Log,Ye=SafeJs,tt={},nt={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:Ct=>tt[Ct]?tt[Ct]:null,setItem:(Ct,Et)=>{tt[Ct]=Et},removeItem:Ct=>{delete tt[Ct]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const Ct=(0,Ye._getWindowSafe)();Ct&&Ct.localStorage&&typeof Ct.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Et=>Ct.localStorage.getItem(Et),setItem:(Et,vt)=>Ct.localStorage.setItem(Et,vt),removeItem:Et=>Ct.localStorage.removeItem(Et),getAllKeys:()=>Object.keys(Ct.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(Ct){try{return Ct()}catch(Et){if(Et instanceof Error&&Et.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Et}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:Ct=>At(()=>gt.getItem(Ct)),setItem:(Ct,Et)=>At(()=>gt.setItem(Ct,Et)),removeItem:Ct=>gt.removeItem(Ct),getAllKeys:()=>gt.getAllKeys(),_setProvider:Ct=>{ht=Ct,gt=Ct},_setDisabled:Ct=>{Ct?gt=nt:gt=ht}};function xt(Ct){const Et=Be.Storage.getItem(Ct);return JSON.parse(Et??"null")}Be._getObjectFromStorage=xt;function yt(Ct,Et){Be.Storage.setItem(Ct,JSON.stringify(Et))}Be._setObjectInStorage=yt})(StorageProvider);var UrlConfiguration$1={};Object.defineProperty(UrlConfiguration$1,"__esModule",{value:!0}),UrlConfiguration$1.UrlConfiguration=void 0;const Hashing_1$3=Hashing,NetworkConfig_1$2=NetworkConfig,ENDPOINT_DNS_KEY_MAP={[NetworkConfig_1$2.Endpoint._initialize]:"i",[NetworkConfig_1$2.Endpoint._rgstr]:"e",[NetworkConfig_1$2.Endpoint._download_config_specs]:"d"};class UrlConfiguration{constructor(Le,Ye,tt,nt){this.customUrl=null,this.fallbackUrls=null,this.endpoint=Le,this.endpointDnsKey=ENDPOINT_DNS_KEY_MAP[Le],Ye&&(this.customUrl=Ye),!Ye&&tt&&(this.customUrl=tt.endsWith("/")?`${tt}${Le}`:`${tt}/${Le}`),nt&&(this.fallbackUrls=nt);const ft=NetworkConfig_1$2.NetworkDefault[Le];this.defaultUrl=`${ft}/${Le}`}getUrl(){var Le;return(Le=this.customUrl)!==null&&Le!==void 0?Le:this.defaultUrl}getChecksum(){var Le;const Ye=((Le=this.fallbackUrls)!==null&&Le!==void 0?Le:[]).sort().join(",");return(0,Hashing_1$3._DJB2)(this.customUrl+Ye)}}UrlConfiguration$1.UrlConfiguration=UrlConfiguration;var VisibilityObserving={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._notifyVisibilityChanged=Be._subscribeToVisiblityChanged=Be._isUnloading=Be._isCurrentlyVisible=void 0;const Le=SafeJs,Ye="foreground",tt="background",nt=[];let ft=Ye,ht=!1;const gt=()=>ft===Ye;Be._isCurrentlyVisible=gt;const At=()=>ht;Be._isUnloading=At;const xt=Ct=>{nt.unshift(Ct)};Be._subscribeToVisiblityChanged=xt;const yt=Ct=>{Ct!==ft&&(ft=Ct,nt.forEach(Et=>Et(Ct)))};Be._notifyVisibilityChanged=yt,(0,Le._addWindowEventListenerSafe)("focus",()=>{ht=!1,(0,Be._notifyVisibilityChanged)(Ye)}),(0,Le._addWindowEventListenerSafe)("blur",()=>(0,Be._notifyVisibilityChanged)(tt)),(0,Le._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Be._notifyVisibilityChanged)(document.visibilityState==="visible"?Ye:tt)}),(0,Le._addWindowEventListenerSafe)((0,Le._getUnloadEvent)(),()=>{ht=!0,(0,Be._notifyVisibilityChanged)(tt)})})(VisibilityObserving);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$2=Hashing,Log_1$8=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$3=SafeJs,StatsigEvent_1=StatsigEvent,StatsigOptionsCommon_1$2=StatsigOptionsCommon,StorageProvider_1$4=StorageProvider,UrlConfiguration_1=UrlConfiguration$1,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=100,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e5,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye.flush().catch(()=>{})}static _safeRetryFailedLogs(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(Le,Ye,tt,nt){var ft,ht;this._sdkKey=Le,this._emitter=Ye,this._network=tt,this._options=nt,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(ft=nt==null?void 0:nt.loggingEnabled)!==null&&ft!==void 0?ft:(nt==null?void 0:nt.disableLogging)===!0?StatsigOptionsCommon_1$2.LoggingEnabledOption.disabled:StatsigOptionsCommon_1$2.LoggingEnabledOption.browserOnly,nt!=null&&nt.loggingEnabled&&nt.disableLogging!==void 0&&Log_1$8.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(ht=nt==null?void 0:nt.loggingBufferMaxSize)!==null&&ht!==void 0?ht:DEFAULT_QUEUE_SIZE;const gt=nt==null?void 0:nt.networkConfig;this._logEventUrlConfig=new UrlConfiguration_1.UrlConfiguration(NetworkConfig_1$1.Endpoint._rgstr,gt==null?void 0:gt.logEventUrl,gt==null?void 0:gt.api,gt==null?void 0:gt.logEventFallbackUrls)}setLogEventCompressionMode(Le){this._network.setLogEventCompressionMode(Le)}setLoggingEnabled(Le){if(this._loggingEnabled==="disabled"&&Le!=="disabled"){const Ye=this._getStorageKey(),tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);tt&&this._queue.push(...tt),StorageProvider_1$4.Storage.removeItem(Ye)}this._loggingEnabled=Le}enqueue(Le){this._shouldLogEvent(Le)&&(this._normalizeAndAppendEvent(Le),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(Le){var Ye;const tt=(Ye=this._nonExposedChecks[Le])!==null&&Ye!==void 0?Ye:0;this._nonExposedChecks[Le]=tt+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var Le;const Ye=(0,SafeJs_1$3._isServerEnv)();Ye&&((Le=this._options)===null||Le===void 0?void 0:Le.loggingEnabled)!=="always"||(EVENT_LOGGER_MAP[this._sdkKey]=this,Ye||(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(tt=>{tt==="background"?EventLogger._safeFlushAndForget(this._sdkKey):tt==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$f(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$f(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const Le=this._queue;this._queue=[],yield this._sendEvents(Le)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(Le){var Ye;if(((Ye=this._options)===null||Ye===void 0?void 0:Ye.loggingEnabled)!=="always"&&(0,SafeJs_1$3._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(Le))return!0;const tt=Le.user?Le.user:{statsigEnvironment:void 0},nt=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,tt),ft=Le.metadata?Le.metadata:{},ht=[Le.eventName,nt,ft.gate,ft.config,ft.ruleID,ft.allocatedExperiment,ft.parameterName,String(ft.isExplicitParameter),ft.reason].join("|"),gt=this._lastExposureTimeMap[ht],At=Date.now();return gt&&At-gt<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[ht]=At,!0)}_sendEvents(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye,tt;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(Le),!1;try{const ft=(0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((tt=(Ye=this._options)===null||Ye===void 0?void 0:Ye.networkConfig)===null||tt===void 0?void 0:tt.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:Le}),(ft?this._sendEventsViaBeacon(Le):yield this._sendEventsViaPost(Le)).success?(this._emitter({name:"logs_flushed",events:Le}),!0):(Log_1$8.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(Le),!1)}catch{return Log_1$8.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye;const tt=yield this._network.post(this._getRequestData(Le)),nt=(Ye=tt==null?void 0:tt.code)!==null&&Ye!==void 0?Ye:-1;return{success:nt>=200&&nt<300}})}_sendEventsViaBeacon(Le){return{success:this._network.beacon(this._getRequestData(Le))}}_getRequestData(Le){return{sdkKey:this._sdkKey,data:{events:Le},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(Le.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(Le){for(;Le.length>MAX_FAILED_LOGS;)Le.shift();const Ye=this._getStorageKey();try{const tt=this._getFailedLogsFromStorage(Ye);(0,StorageProvider_1$4._setObjectInStorage)(Ye,[...tt,...Le])}catch{Log_1$8.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(Le){let Ye=[];try{const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Le);return Array.isArray(tt)&&(Ye=tt),Ye}catch{return[]}}_retryFailedLogs(Le){const Ye=this._getStorageKey();__awaiter$f(this,void 0,void 0,function*(){StorageProvider_1$4.Storage.isReady()||(yield StorageProvider_1$4.Storage.isReadyResolver());const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);if(!tt)return;Le===RetryFailedLogsTrigger.Startup&&StorageProvider_1$4.Storage.removeItem(Ye),(yield this._sendEvents(tt))&&Le===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$4.Storage.removeItem(Ye)}).catch(()=>{Log_1$8.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$2._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(Le){Le.user&&(Le.user=Object.assign({},Le.user),delete Le.user.privateAttributes);const Ye={},tt=this._getCurrentPageUrl();tt&&(Ye.statsigMetadata={currentPage:tt});const nt=Object.assign(Object.assign({},Le),Ye);Log_1$8.Log.debug("Enqueued Event:",nt),this._queue.push(nt)}_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 Le;if(((Le=this._options)===null||Le===void 0?void 0:Le.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$3._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var Le,Ye;const tt=(Ye=(Le=this._options)===null||Le===void 0?void 0:Le.loggingIntervalMs)!==null&&Ye!==void 0?Ye:DEFAULT_FLUSH_INTERVAL_MS,nt=setInterval(()=>{const ft=EVENT_LOGGER_MAP[this._sdkKey];!ft||ft._flushIntervalId!==nt?clearInterval(nt):EventLogger._safeFlushAndForget(this._sdkKey)},tt);this._flushIntervalId=nt}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigMetadataProvider=Be.SDK_VERSION=void 0,Be.SDK_VERSION="3.28.1";let Le={sdkVersion:Be.SDK_VERSION,sdkType:"js-mono"};Be.StatsigMetadataProvider={get:()=>Le,add:Ye=>{Le=Object.assign(Object.assign({},Le),Ye)}}})(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 Be=new Date().getTime(),Le=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,tt=>{let nt=Math.random()*16;return Be>0?(nt=(Be+nt)%16|0,Be=Math.floor(Be/16)):(nt=(Le+nt)%16|0,Le=Math.floor(Le/16)),(tt==="x"?nt:nt&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.getCookieName=StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$7=Log,SafeJs_1$2=SafeJs,StorageProvider_1$3=StorageProvider,UUID_1=UUID,PROMISE_MAP={},COOKIE_ENABLED_MAP={},DISABLED_MAP={};StableID.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:Be=>{if(DISABLED_MAP[Be])return null;if(PROMISE_MAP[Be]!=null)return PROMISE_MAP[Be];let Le=null;return Le=_loadFromCookie(Be),Le!=null?(PROMISE_MAP[Be]=Le,_persistToStorage(Le,Be),Le):(Le=_loadFromStorage(Be),Le==null&&(Le=(0,UUID_1.getUUID)()),_persistToStorage(Le,Be),_persistToCookie(Le,Be),PROMISE_MAP[Be]=Le,Le)},setOverride:(Be,Le)=>{PROMISE_MAP[Le]=Be,_persistToStorage(Be,Le),_persistToCookie(Be,Le)},_setCookiesEnabled:(Be,Le)=>{COOKIE_ENABLED_MAP[Be]=Le},_setDisabled:(Be,Le)=>{DISABLED_MAP[Be]=Le}};function _getStableIDStorageKey(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}function _persistToStorage(Be,Le){const Ye=_getStableIDStorageKey(Le);try{(0,StorageProvider_1$3._setObjectInStorage)(Ye,Be)}catch{Log_1$7.Log.warn("Failed to save StableID to storage")}}function _loadFromStorage(Be){const Le=_getStableIDStorageKey(Be);return(0,StorageProvider_1$3._getObjectFromStorage)(Le)}function _loadFromCookie(Be){if(!COOKIE_ENABLED_MAP[Be]||(0,SafeJs_1$2._getDocumentSafe)()==null)return null;const Le=document.cookie.split(";");for(const Ye of Le){const[tt,nt]=Ye.trim().split("=");if(tt===getCookieName(Be))return decodeURIComponent(nt)}return null}function _persistToCookie(Be,Le){if(!COOKIE_ENABLED_MAP[Le]||(0,SafeJs_1$2._getDocumentSafe)()==null)return;const Ye=new Date;Ye.setFullYear(Ye.getFullYear()+1),document.cookie=`${getCookieName(Le)}=${encodeURIComponent(Be)}; expires=${Ye.toUTCString()}; path=/`}function getCookieName(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}StableID.getCookieName=getCookieName;var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1$1=Hashing,Log_1$6=Log;function _normalizeUser(Be,Le,Ye){try{const tt=JSON.parse(JSON.stringify(Be));return Le!=null&&Le.environment!=null?tt.statsigEnvironment=Le.environment:Ye!=null&&(tt.statsigEnvironment={tier:Ye}),tt}catch{return Log_1$6.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(Be){return Be?(0,Hashing_1$1._DJB2Object)(Be):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$5=Log;function _typedJsonParse(Be,Le,Ye){try{const tt=JSON.parse(Be);if(tt&&typeof tt=="object"&&Le in tt)return tt}catch{}return Log_1$5.Log.error(`Failed to parse ${Ye}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1._makeDataAdapterResult=DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$4=Log,StableID_1$2=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$2=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10,MAX_CACHE_WRITE_ATTEMPTS=8;class DataAdapterCore{constructor(Le,Ye){this._adapterName=Le,this._cacheSuffix=Ye,this._options=null,this._sdkKey=null,this._cacheLimit=CACHE_LIMIT,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ye}`,this._inMemoryCache=new InMemoryCache}attach(Le,Ye,tt){this._sdkKey=Le,this._options=Ye}getDataSync(Le){const Ye=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),tt=this._getCacheKey(Ye),nt=this._inMemoryCache.get(tt,Ye);if(nt&&this._getIsCacheValueValid(nt))return nt;const ft=this._loadFromCache(tt);return ft&&this._getIsCacheValueValid(ft)?(this._inMemoryCache.add(tt,ft,this._cacheLimit),this._inMemoryCache.get(tt,Ye)):null}setData(Le,Ye){const tt=Ye&&(0,StatsigUser_1._normalizeUser)(Ye,this._options),nt=this._getCacheKey(tt);this._inMemoryCache.add(nt,_makeDataAdapterResult("Bootstrap",Le,null,tt),this._cacheLimit)}_getIsCacheValueValid(Le){return Le.stableID==null||Le.stableID===StableID_1$2.StableID.get(this._getSdkKey())}_getDataAsyncImpl(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){StorageProvider_1$2.Storage.isReady()||(yield StorageProvider_1$2.Storage.isReadyResolver());const nt=Le??this.getDataSync(Ye),ft=[this._fetchAndPrepFromNetwork(nt,Ye,tt)];return tt!=null&&tt.timeoutMs&&ft.push(new Promise(ht=>setTimeout(ht,tt.timeoutMs)).then(()=>(Log_1$4.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(ft)})}_prefetchDataImpl(Le,Ye){return __awaiter$e(this,void 0,void 0,function*(){const tt=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),nt=this._getCacheKey(tt),ft=yield this._getDataAsyncImpl(null,tt,Ye);ft&&this._inMemoryCache.add(nt,Object.assign(Object.assign({},ft),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){var nt;const ft=(nt=Le==null?void 0:Le.data)!==null&&nt!==void 0?nt:null,ht=Le!=null&&this._isCachedResultValidFor204(Le,Ye),gt=yield this._fetchFromNetwork(ft,Ye,tt,ht);if(!gt)return Log_1$4.Log.debug("No response returned for latest value"),null;const At=(0,TypedJsonParse_1._typedJsonParse)(gt,"has_updates","Response"),xt=this._getSdkKey(),yt=StableID_1$2.StableID.get(xt);let Ct=null;if((At==null?void 0:At.has_updates)===!0)Ct=_makeDataAdapterResult("Network",gt,yt,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)Ct=_makeDataAdapterResult("NetworkNotModified",ft,yt,Ye);else return null;const Et=this._getCacheKey(Ye);return this._inMemoryCache.add(Et,Ct,this._cacheLimit),this._writeToCache(Et,Ct),Ct})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$4.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(Le){var Ye;const tt=(Ye=StorageProvider_1$2.Storage.getItem)===null||Ye===void 0?void 0:Ye.call(StorageProvider_1$2.Storage,Le);if(tt==null)return null;const nt=(0,TypedJsonParse_1._typedJsonParse)(tt,"source","Cached Result");return nt?Object.assign(Object.assign({},nt),{source:"Cache"}):null}_writeToCache(Le,Ye){const tt=JSON.stringify(Ye);for(let nt=0;nt<MAX_CACHE_WRITE_ATTEMPTS;nt++)try{StorageProvider_1$2.Storage.setItem(Le,tt);break}catch(ft){if(!(ft instanceof Error)||!(ft.toString().includes("QuotaExceededError")||ft.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw ft;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(Le,this._cacheLimit-1)}this._runLocalStorageCacheEviction(Le)}_runLocalStorageCacheEviction(Le,Ye=this._cacheLimit){var tt;const nt=(tt=(0,StorageProvider_1$2._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&tt!==void 0?tt:{};nt[Le]=Date.now();const ft=_getEvictableKeys(nt,Ye);for(const ht of ft)delete nt[ht],StorageProvider_1$2.Storage.removeItem(ht);(0,StorageProvider_1$2._setObjectInStorage)(this._lastModifiedStoreKey,nt)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(Be,Le,Ye,tt){return{source:Be,data:Le,receivedAt:Date.now(),stableID:Ye,fullUserHash:(0,StatsigUser_1._getFullUserHash)(tt)}}DataAdapterCore$1._makeDataAdapterResult=_makeDataAdapterResult;class InMemoryCache{constructor(){this._data={}}get(Le,Ye){var tt;const nt=this._data[Le],ft=nt==null?void 0:nt.stableID,ht=(tt=Ye==null?void 0:Ye.customIDs)===null||tt===void 0?void 0:tt.stableID;return ht&&ft&&ht!==ft?(Log_1$4.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):nt}add(Le,Ye,tt){const nt=_getEvictableKeys(this._data,tt-1);for(const ft of nt)delete this._data[ft];this._data[Le]=Ye}merge(Le){this._data=Object.assign(Object.assign({},this._data),Le)}}function _getEvictableKeys(Be,Le){const Ye=Object.keys(Be);return Ye.length<=Le?[]:Le===0?Ye:Ye.sort((tt,nt)=>{const ft=Be[tt],ht=Be[nt];return typeof ft=="object"&&typeof ht=="object"?ft.receivedAt-ht.receivedAt:ft-ht}).slice(0,Ye.length-Le)}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:Be=>{var Le;return((Le=SDK_CLIENT[Be])!==null&&Le!==void 0?Le:"js-mono")+(suffix??"")},_setClientType(Be,Le){SDK_CLIENT[Be]=Le},_setBindingType(Be){(!suffix||suffix==="-react")&&(suffix="-"+Be)}},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__awaiter||function(Ct,Et,vt,kt){function bt(wt){return wt instanceof vt?wt:new vt(function(It){It(wt)})}return new(vt||(vt=Promise))(function(wt,It){function Rt(Pt){try{Bt(kt.next(Pt))}catch(Dt){It(Dt)}}function Tt(Pt){try{Bt(kt.throw(Pt))}catch(Dt){It(Dt)}}function Bt(Pt){Pt.done?wt(Pt.value):bt(Pt.value).then(Rt,Tt)}Bt((kt=kt.apply(Ct,Et||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.ErrorBoundary=Be.EXCEPTION_ENDPOINT=void 0;const Ye=Log,tt=SDKType,nt=StatsigMetadata;Be.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const ft="[Statsig] UnknownError";class ht{constructor(Et,vt,kt,bt){this._sdkKey=Et,this._options=vt,this._emitter=kt,this._lastSeenError=bt,this._seen=new Set}wrap(Et,vt){try{const kt=Et;xt(kt).forEach(bt=>{const wt=kt[bt];"$EB"in wt||(kt[bt]=(...It)=>this._capture(vt?`${vt}:${bt}`:bt,()=>wt.apply(Et,It)),kt[bt].$EB=!0)})}catch(kt){this._onError("eb:wrap",kt)}}logError(Et,vt){this._onError(Et,vt)}getLastSeenErrorAndReset(){const Et=this._lastSeenError;return this._lastSeenError=void 0,Et??null}attachErrorIfNoneExists(Et){this._lastSeenError||(this._lastSeenError=gt(Et))}_capture(Et,vt){try{const kt=vt();return kt&&kt instanceof Promise?kt.catch(bt=>this._onError(Et,bt)):kt}catch(kt){return this._onError(Et,kt),null}}_onError(Et,vt){try{Ye.Log.warn(`Caught error in ${Et}`,{error:vt}),Le(this,void 0,void 0,function*(){var bt,wt,It,Rt,Tt,Bt,Pt;const Dt=vt||Error(ft),Ot=Dt instanceof Error,Lt=Ot?Dt.name:"No Name",Wt=gt(Dt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((wt=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||wt===void 0)&&wt.preventAllNetworkTraffic){(It=this._emitter)===null||It===void 0||It.call(this,{name:"error",error:vt,tag:Et});return}const $t=tt.SDKType._get(this._sdkKey),qt=nt.StatsigMetadataProvider.get(),Ht=Ot?Dt.stack:At(Dt),Ut=Object.assign({tag:Et,exception:Lt,info:Ht,statsigOptions:yt(this._options)},Object.assign(Object.assign({},qt),{sdkType:$t}));yield((Bt=(Tt=(Rt=this._options)===null||Rt===void 0?void 0:Rt.networkConfig)===null||Tt===void 0?void 0:Tt.networkOverrideFunc)!==null&&Bt!==void 0?Bt:fetch)(Be.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String($t),"STATSIG-SDK-VERSION":String(qt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Pt=this._emitter)===null||Pt===void 0||Pt.call(this,{name:"error",error:vt,tag:Et})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(Ct){return Ct instanceof Error?Ct:typeof Ct=="string"?new Error(Ct):new Error("An unknown error occurred.")}function At(Ct){try{return JSON.stringify(Ct)}catch{return ft}}function xt(Ct){const Et=new Set;let vt=Object.getPrototypeOf(Ct);for(;vt&&vt!==Object.prototype;)Object.getOwnPropertyNames(vt).filter(kt=>typeof(vt==null?void 0:vt[kt])=="function").forEach(kt=>Et.add(kt)),vt=Object.getPrototypeOf(vt);return Array.from(Et)}function yt(Ct){if(!Ct)return{};const Et={};return Object.keys(Ct).forEach(vt=>{const kt=vt,bt=Ct[kt];switch(typeof bt){case"number":case"bigint":case"boolean":Et[String(kt)]=bt;break;case"string":bt.length<50?Et[String(kt)]=bt:Et[String(kt)]="set";break;case"object":kt==="environment"?Et.environment=bt:kt==="networkConfig"?Et.networkConfig=bt:Et[String(kt)]=bt!=null?"set":"unset";break}}),Et}}(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 MemoKey={};Object.defineProperty(MemoKey,"__esModule",{value:!0}),MemoKey.createMemoKey=MemoKey.MemoPrefix=void 0,MemoKey.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const EXIST_KEYS=new Set([]),DO_NOT_MEMO_KEYS=new Set(["userPersistedValues"]);function createMemoKey(Be,Le,Ye){let tt=`${Be}|${Le}`;if(!Ye)return tt;for(const nt of Object.keys(Ye)){if(DO_NOT_MEMO_KEYS.has(nt))return;EXIST_KEYS.has(nt)?tt+=`|${nt}=true`:tt+=`|${nt}=${Ye[nt]}`}return tt}MemoKey.createMemoKey=createMemoKey;var NetworkCore$1={},NetworkFallbackResolver$1={},DnsTxtQuery={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DnsTxtQuery,"__esModule",{value:!0}),DnsTxtQuery._fetchTxtRecords=void 0;const FEATURE_ASSETS_DNS_QUERY=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),DNS_QUERY_ENDPOINT="https://cloudflare-dns.com/dns-query",DOMAIN_CHARS=["i","e","d"],MAX_START_LOOKUP=200;function _fetchTxtRecords(Be){return __awaiter$d(this,void 0,void 0,function*(){const Le=yield Be(DNS_QUERY_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:FEATURE_ASSETS_DNS_QUERY});if(!Le.ok){const nt=new Error("Failed to fetch TXT records from DNS");throw nt.name="DnsTxtFetchError",nt}const Ye=yield Le.arrayBuffer(),tt=new Uint8Array(Ye);return _parseDnsResponse(tt)})}DnsTxtQuery._fetchTxtRecords=_fetchTxtRecords;function _parseDnsResponse(Be){const Le=Be.findIndex((tt,nt)=>nt<MAX_START_LOOKUP&&String.fromCharCode(tt)==="="&&DOMAIN_CHARS.includes(String.fromCharCode(Be[nt-1])));if(Le===-1){const tt=new Error("Failed to parse TXT records from DNS");throw tt.name="DnsTxtParseError",tt}let Ye="";for(let tt=Le-1;tt<Be.length;tt++)Ye+=String.fromCharCode(Be[tt]);return Ye.split(",")}var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkFallbackResolver$1,"__esModule",{value:!0}),NetworkFallbackResolver$1._isDomainFailure=NetworkFallbackResolver$1.NetworkFallbackResolver=void 0;const DnsTxtQuery_1=DnsTxtQuery,Hashing_1=Hashing,Log_1$3=Log,StorageProvider_1$1=StorageProvider,DEFAULT_TTL_MS=7*24*60*60*1e3,COOLDOWN_TIME_MS=4*60*60*1e3;class NetworkFallbackResolver{constructor(Le){var Ye;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(Ye=Le.networkConfig)===null||Ye===void 0?void 0:Ye.networkOverrideFunc}setErrorBoundary(Le){this._errorBoundary=Le}tryBumpExpiryTime(Le,Ye){var tt;const nt=(tt=this._fallbackInfo)===null||tt===void 0?void 0:tt[Ye.endpoint];nt&&(nt.expiryTime=Date.now()+DEFAULT_TTL_MS,_tryWriteFallbackInfoToCache(Le,Object.assign(Object.assign({},this._fallbackInfo),{[Ye.endpoint]:nt})))}getActiveFallbackUrl(Le,Ye){var tt,nt;if(Ye.customUrl!=null&&Ye.fallbackUrls!=null)return null;let ft=this._fallbackInfo;ft==null&&(ft=(tt=_readFallbackInfoFromCache(Le))!==null&&tt!==void 0?tt:{},this._fallbackInfo=ft);const ht=ft[Ye.endpoint];return!ht||Date.now()>((nt=ht.expiryTime)!==null&&nt!==void 0?nt:0)||Ye.getChecksum()!==ht.urlConfigChecksum?(delete ft[Ye.endpoint],this._fallbackInfo=ft,_tryWriteFallbackInfoToCache(Le,this._fallbackInfo),null):ht.url?ht.url:null}tryFetchUpdatedFallbackInfo(Le,Ye,tt,nt){return __awaiter$c(this,void 0,void 0,function*(){var ft,ht;try{if(!_isDomainFailure(tt,nt))return!1;const At=Ye.customUrl==null&&Ye.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(Ye):Ye.fallbackUrls,xt=this._pickNewFallbackUrl((ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[Ye.endpoint],At);return xt?(this._updateFallbackInfoWithNewUrl(Le,Ye,xt),!0):!1}catch(gt){return(ht=this._errorBoundary)===null||ht===void 0||ht.logError("tryFetchUpdatedFallbackInfo",gt),!1}})}_updateFallbackInfoWithNewUrl(Le,Ye,tt){var nt,ft,ht;const gt={urlConfigChecksum:Ye.getChecksum(),url:tt,expiryTime:Date.now()+DEFAULT_TTL_MS,previous:[]},At=Ye.endpoint,xt=(nt=this._fallbackInfo)===null||nt===void 0?void 0:nt[At];xt&&gt.previous.push(...xt.previous),gt.previous.length>10&&(gt.previous=[]);const yt=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;yt!=null&&gt.previous.push(yt),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[At]:gt}),_tryWriteFallbackInfoToCache(Le,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(Le){return __awaiter$c(this,void 0,void 0,function*(){var Ye;const tt=this._dnsQueryCooldowns[Le.endpoint];if(tt&&Date.now()<tt)return null;this._dnsQueryCooldowns[Le.endpoint]=Date.now()+COOLDOWN_TIME_MS;const nt=[],ft=yield(0,DnsTxtQuery_1._fetchTxtRecords)((Ye=this._networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch),ht=_extractPathFromUrl(Le.defaultUrl);for(const gt of ft){if(!gt.startsWith(Le.endpointDnsKey+"="))continue;const At=gt.split("=");if(At.length>1){let xt=At[1];xt.endsWith("/")&&(xt=xt.slice(0,-1)),nt.push(`https://${xt}${ht}`)}}return nt})}_pickNewFallbackUrl(Le,Ye){var tt;if(Ye==null)return null;const nt=new Set((tt=Le==null?void 0:Le.previous)!==null&&tt!==void 0?tt:[]),ft=Le==null?void 0:Le.url;let ht=null;for(const gt of Ye){const At=gt.endsWith("/")?gt.slice(0,-1):gt;if(!nt.has(gt)&&At!==ft){ht=At;break}}return ht}}NetworkFallbackResolver$1.NetworkFallbackResolver=NetworkFallbackResolver;function _isDomainFailure(Be,Le){var Ye;const tt=(Ye=Be==null?void 0:Be.toLowerCase())!==null&&Ye!==void 0?Ye:"";return Le||tt.includes("uncaught exception")||tt.includes("failed to fetch")||tt.includes("networkerror when attempting to fetch resource")}NetworkFallbackResolver$1._isDomainFailure=_isDomainFailure;function _getFallbackInfoStorageKey(Be){return`statsig.network_fallback.${(0,Hashing_1._DJB2)(Be)}`}function _tryWriteFallbackInfoToCache(Be,Le){const Ye=_getFallbackInfoStorageKey(Be);if(!Le||Object.keys(Le).length===0){StorageProvider_1$1.Storage.removeItem(Ye);return}StorageProvider_1$1.Storage.setItem(Ye,JSON.stringify(Le))}function _readFallbackInfoFromCache(Be){const Le=_getFallbackInfoStorageKey(Be),Ye=StorageProvider_1$1.Storage.getItem(Le);if(!Ye)return null;try{return JSON.parse(Ye)}catch{return Log_1$3.Log.error("Failed to parse FallbackInfo"),null}}function _extractPathFromUrl(Be){try{return new URL(Be).pathname}catch{return null}}var SDKFlags={};Object.defineProperty(SDKFlags,"__esModule",{value:!0}),SDKFlags.SDKFlags=void 0;const FLAGMAP={};SDKFlags.SDKFlags={setFlags:(Be,Le)=>{FLAGMAP[Be]=Le},get:(Be,Le)=>{var Ye,tt;return(tt=(Ye=FLAGMAP[Be])===null||Ye===void 0?void 0:Ye[Le])!==null&&tt!==void 0?tt:!1}};var SessionID={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigSession=Be.SessionID=void 0;const Le=$_StatsigGlobal,Ye=CacheKey,tt=Log,nt=StorageProvider,ft=UUID,ht=30*60*1e3,gt=4*60*60*1e3,At={};Be.SessionID={get:Rt=>Be.StatsigSession.get(Rt).data.sessionID},Be.StatsigSession={get:Rt=>{At[Rt]==null&&(At[Rt]=xt(Rt));const Tt=At[Rt];return Ct(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=yt(Rt,Tt)}};function xt(Rt){let Tt=It(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function yt(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function Ct(Rt){const Tt=Date.now(),Bt=Rt.data,Pt=Rt.sdkKey;if(vt(Bt)||kt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Ot=__STATSIG__==null?void 0:__STATSIG__.instance(Pt);Ot&&Ot.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,wt(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Dt=Tt-Bt.startTime;return Rt.idleTimeoutID=Et(Pt,ht),Rt.ageTimeoutID=Et(Pt,gt-Dt),Rt}function Et(Rt,Tt){return setTimeout(()=>{var Bt;const Pt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Pt&&Pt.$emt({name:"session_expired"})},Tt)}function vt({lastUpdate:Rt}){return Date.now()-Rt>ht}function kt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function wt(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function It(Rt){const Tt=bt(Rt);return(0,nt._getObjectFromStorage)(Tt)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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,NetworkFallbackResolver_1=NetworkFallbackResolver$1,SDKFlags_1=SDKFlags,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1$1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,StatsigOptionsCommon_1$1=StatsigOptionsCommon,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,BACKOFF_BASE_MS=500,BACKOFF_MAX_MS=3e4,RATE_LIMIT_WINDOW_MS=1e3,RATE_LIMIT_MAX_REQ_COUNT=50,LEAK_RATE=RATE_LIMIT_MAX_REQ_COUNT/RATE_LIMIT_WINDOW_MS,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(Le,Ye){this._emitter=Ye,this._errorBoundary=null,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,Le&&(this._options=Le),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new NetworkFallbackResolver_1.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(Le))}setLogEventCompressionMode(Le){this._options.logEventCompressionMode=Le}setErrorBoundary(Le){this._errorBoundary=Le,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(Le)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const Le=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,Le}beacon(Le){if(!_ensureValidSdkKey(Le))return!1;const Ye=this._getInternalRequestArgs("POST",Le),tt=this._getPopulatedURL(Ye),nt=navigator;return nt.sendBeacon.bind(nt)(tt,Ye.body)}post(Le){return __awaiter$b(this,void 0,void 0,function*(){const Ye=this._getInternalRequestArgs("POST",Le);return this._tryEncodeBody(Ye),yield this._tryToCompressBody(Ye),this._sendRequest(Ye)})}get(Le){const Ye=this._getInternalRequestArgs("GET",Le);return this._sendRequest(Ye)}_sendRequest(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye,tt,nt,ft;if(!_ensureValidSdkKey(Le)||this._netConfig.preventAllNetworkTraffic)return null;const{method:ht,body:gt,retries:At,attempt:xt}=Le,yt=Le.urlConfig.endpoint;if(this._isRateLimited(yt))return Log_1$2.Log.warn(`Request to ${yt} was blocked because you are making requests too frequently.`),null;const Ct=xt??1;let Et=!1;const vt=this._getPopulatedURL(Le);let kt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const wt={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,Ct);const It=this._leakyBucket[yt];It&&(It.lastRequestTime=Date.now(),this._leakyBucket[yt]=It);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(kt=yield Promise.race([Rt(vt,wt).finally(()=>clearTimeout(Tt)),new Promise((Pt,Dt)=>{Tt=setTimeout(()=>{Et=!0,Dt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!kt.ok){const Pt=yield kt.text().catch(()=>"No Text"),Dt=new Error(`NetworkError: ${vt} ${Pt}`);throw Dt.name="NetworkError",Dt}const Bt=yield kt.text();return _tryMarkInitEnd(Le,kt,Ct,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:kt.status}}catch(wt){const It=_getErrorMessage(wt),Rt=_didTimeout(It??"",Et);if(_tryMarkInitEnd(Le,kt,Ct,"",wt),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,It,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||Ct>At||!RETRYABLE_CODES.has((tt=kt==null?void 0:kt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:wt,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${vt}.`;return Log_1$2.Log.error(Bt,It,wt),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(Ct),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:Ct+1}))}})}_getLogEventCompressionMode(Le){let Ye=Le==null?void 0:Le.logEventCompressionMode;return!Ye&&(Le==null?void 0:Le.disableCompression)===!0&&(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled),Ye||(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled),Ye}_isRateLimited(Le){var Ye;const tt=Date.now(),nt=(Ye=this._leakyBucket[Le])!==null&&Ye!==void 0?Ye:{count:0,lastRequestTime:tt},ft=tt-nt.lastRequestTime,ht=Math.floor(ft*LEAK_RATE);return nt.count=Math.max(0,nt.count-ht),nt.count>=RATE_LIMIT_MAX_REQ_COUNT?!0:(nt.count+=1,nt.lastRequestTime=tt,this._leakyBucket[Le]=nt,!1)}_getPopulatedURL(Le){var Ye;const tt=(Ye=Le.fallbackUrl)!==null&&Ye!==void 0?Ye:Le.urlConfig.getUrl();(Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize||Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=tt);const nt=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:Le.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(Le.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(Le.sdkKey)},Le.params),ft=Object.keys(nt).map(ht=>`${encodeURIComponent(ht)}=${encodeURIComponent(nt[ht])}`).join("&");return`${tt}${ft?`?${ft}`:""}`}_tryEncodeBody(Le){var Ye;const tt=(0,SafeJs_1$1._getWindowSafe)(),nt=Le.body;if(!(!Le.isStatsigEncodable||this._options.disableStatsigEncoding||typeof nt!="string"||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(tt!=null&&tt.btoa)))try{Le.body=tt.btoa(nt).split("").reverse().join(""),Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"})}catch(ft){Log_1$2.Log.warn(`Request encoding failed for ${Le.urlConfig.getUrl()}`,ft)}}_tryToCompressBody(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye;const tt=Le.body;if(!(typeof tt!="string"||!_allowCompression(Le,this._options)))try{const nt=new TextEncoder().encode(tt),ft=new CompressionStream("gzip"),ht=ft.writable.getWriter();ht.write(nt).catch(Log_1$2.Log.error),ht.close().catch(Log_1$2.Log.error);const gt=ft.readable.getReader(),At=[];let xt;for(;!(xt=yield gt.read()).done;)At.push(xt.value);const yt=At.reduce((vt,kt)=>vt+kt.length,0),Ct=new Uint8Array(yt);let Et=0;for(const vt of At)Ct.set(vt,Et),Et+=vt.length;Le.body=Ct,Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.IsGzipped]:"1"})}catch(nt){Log_1$2.Log.warn(`Request compression failed for ${Le.urlConfig.getUrl()}`,nt)}})}_getInternalRequestArgs(Le,Ye){const tt=this._fallbackResolver.getActiveFallbackUrl(Ye.sdkKey,Ye.urlConfig),nt=Object.assign(Object.assign({},Ye),{method:Le,fallbackUrl:tt});return"data"in Ye&&_populateRequestBody(nt,Ye.data),nt}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=Be=>Be.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1),_populateRequestBody=(Be,Le)=>{const{sdkKey:Ye,fallbackUrl:tt}=Be,nt=StableID_1$1.StableID.get(Ye),ft=SessionID_1$1.SessionID.get(Ye),ht=SDKType_1.SDKType._get(Ye);Be.body=JSON.stringify(Object.assign(Object.assign({},Le),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:nt,sessionID:ft,sdkType:ht,fallbackUrl:tt})}))};function _allowCompression(Be,Le){if(!Be.isCompressable||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const Ye=Be.urlConfig.customUrl!=null||Be.urlConfig.fallbackUrls!=null,tt=SDKFlags_1.SDKFlags.get(Be.sdkKey,"enable_log_event_compression")===!0;switch(Le.logEventCompressionMode){case StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled:return!1;case StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled:return!(Ye&&!tt);case StatsigOptionsCommon_1$1.LogEventCompressionMode.Forced:return!0;default:return!1}}function _getErrorMessage(Be){return typeof Be=="string"?Be:Be instanceof Error?`${Be.name}: ${Be.message}`:"Unknown Error"}function _didTimeout(Be,Le){return Be.includes("Timeout")||Le}function _tryMarkInitStart(Be,Le){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(Be.sdkKey,{attempt:Le})}function _tryMarkInitEnd(Be,Le,Ye,tt,nt){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(Be.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(Le,Ye,tt,nt))}function _exponentialBackoff(Be){return __awaiter$b(this,void 0,void 0,function*(){yield new Promise(Le=>setTimeout(Le,Math.min(BACKOFF_BASE_MS*(Be*Be),BACKOFF_MAX_MS)))})}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var SizeOf={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._fastApproxSizeOf=void 0;const Le=2,Ye=1,tt=(nt,ft)=>{let ht=0;const gt=Object.keys(nt);for(let At=0;At<gt.length;At++){const xt=gt[At],yt=nt[xt];if(ht+=xt.length,typeof yt=="object"&&yt!==null?ht+=(0,Be._fastApproxSizeOf)(yt,ft)+Le:ht+=String(yt).length+Ye,ht>=ft)return ht}return ht};Be._fastApproxSizeOf=tt})(SizeOf);var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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,MemoKey_1=MemoKey,SafeJs_1=SafeJs,SessionID_1=SessionID,StableID_1=StableID,StatsigOptionsCommon_1=StatsigOptionsCommon,StorageProvider_1=StorageProvider,MAX_MEMO_CACHE_SIZE=3e3;class StatsigClientBase{constructor(Le,Ye,tt,nt){var ft,ht,gt,At;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const xt=this.$emt.bind(this);(nt==null?void 0:nt.logLevel)!=null&&(Log_1$1.Log.level=nt.logLevel),nt!=null&&nt.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),nt!=null&&nt.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(nt.initialSessionID,Le),nt!=null&&nt.storageProvider&&StorageProvider_1.Storage._setProvider(nt.storageProvider),nt!=null&&nt.enableCookies&&StableID_1.StableID._setCookiesEnabled(Le,nt.enableCookies),nt!=null&&nt.disableStableID&&StableID_1.StableID._setDisabled(Le,!0),this._sdkKey=Le,this._options=nt??{},this._memoCache={},this.overrideAdapter=(ft=nt==null?void 0:nt.overrideAdapter)!==null&&ft!==void 0?ft:null,this._logger=new EventLogger_1.EventLogger(Le,xt,tt,nt),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(Le,nt,xt),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ye),this._errorBoundary.wrap(this._logger),tt.setErrorBoundary(this._errorBoundary),this.dataAdapter=Ye,this.dataAdapter.attach(Le,nt,tt),this.storageProvider=StorageProvider_1.Storage,(At=(gt=(ht=this.overrideAdapter)===null||ht===void 0?void 0:ht.loadFromStorage)===null||gt===void 0?void 0:gt.call(ht))===null||At===void 0||At.catch(yt=>this._errorBoundary.logError("OA::loadFromStorage",yt)),this._primeReadyRipcord(),_assignGlobalInstance(Le,this)}updateRuntimeOptions(Le){Le.loggingEnabled?(this._options.loggingEnabled=Le.loggingEnabled,this._logger.setLoggingEnabled(Le.loggingEnabled)):Le.disableLogging!=null&&(this._options.disableLogging=Le.disableLogging,this._logger.setLoggingEnabled(Le.disableLogging?"disabled":"browser-only")),Le.disableStorage!=null&&(this._options.disableStorage=Le.disableStorage,StorageProvider_1.Storage._setDisabled(Le.disableStorage)),Le.enableCookies!=null&&(this._options.enableCookies=Le.enableCookies,StableID_1.StableID._setCookiesEnabled(this._sdkKey,Le.enableCookies)),Le.logEventCompressionMode?this._logger.setLogEventCompressionMode(Le.logEventCompressionMode):Le.disableCompression&&this._logger.setLogEventCompressionMode(StatsigOptionsCommon_1.LogEventCompressionMode.Disabled)}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(Le,Ye){this._listeners[Le]||(this._listeners[Le]=[]),this._listeners[Le].push(Ye)}off(Le,Ye){if(this._listeners[Le]){const tt=this._listeners[Le].indexOf(Ye);tt!==-1&&this._listeners[Le].splice(tt,1)}}$on(Le,Ye){Ye.__isInternal=!0,this.on(Le,Ye)}$emt(Le){var Ye;const tt=nt=>{try{nt(Le)}catch(ft){if(nt.__isInternal===!0){this._errorBoundary.logError(`__emit:${Le.name}`,ft);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",Le)}};this._listeners[Le.name]&&this._listeners[Le.name].forEach(nt=>tt(nt)),(Ye=this._listeners["*"])===null||Ye===void 0||Ye.forEach(tt)}_setStatus(Le,Ye){this.loadingStatus=Le,this._memoCache={},this.$emt({name:"values_updated",status:Le,values:Ye})}_enqueueExposure(Le,Ye,tt){if((tt==null?void 0:tt.disableExposureLog)===!0){this._logger.incrementNonExposureCount(Le);return}this._logger.enqueue(Ye)}_memoize(Le,Ye){return(tt,nt)=>{if(this._options.disableEvaluationMemoization)return Ye(tt,nt);const ft=(0,MemoKey_1.createMemoKey)(Le,tt,nt);return ft?(ft in this._memoCache||(Object.keys(this._memoCache).length>=MAX_MEMO_CACHE_SIZE&&(this._memoCache={}),this._memoCache[ft]=Ye(tt,nt)),this._memoCache[ft]):Ye(tt,nt)}}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(Be,Le){var Ye;if((0,SafeJs_1._isServerEnv)())return;const tt=(0,__StatsigGlobal_1._getStatsigGlobal)(),nt=(Ye=tt.instances)!==null&&Ye!==void 0?Ye:{},ft=Le;nt[Be]!=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."),nt[Be]=ft,tt.firstInstance||(tt.firstInstance=ft),tt.instances=nt,__STATSIG__=tt}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";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;function _makeEvaluation(Be,Le,Ye,tt){var nt;return{name:Be,details:Le,ruleID:(nt=Ye==null?void 0:Ye.rule_id)!==null&&nt!==void 0?nt:"",__evaluation:Ye,value:tt}}function _makeFeatureGate(Be,Le,Ye){var tt;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,(Ye==null?void 0:Ye.value)===!0)),{idType:(tt=Ye==null?void 0:Ye.id_type)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(Be,Le,Ye){var tt,nt;const ft=(tt=Ye==null?void 0:Ye.value)!==null&&tt!==void 0?tt:{};return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,ft)),{idType:(nt=Ye==null?void 0:Ye.id_type)!==null&&nt!==void 0?nt:null,get:_makeTypedGet(Be,Ye==null?void 0:Ye.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(Be,Le,Ye){var tt;const nt=_makeDynamicConfig(Be,Le,Ye);return Object.assign(Object.assign({},nt),{groupName:(tt=Ye==null?void 0:Ye.group_name)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(Be,Le,Ye,tt){var nt,ft;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,void 0)),{get:_makeTypedGet(Be,Ye==null?void 0:Ye.value,tt),groupName:(nt=Ye==null?void 0:Ye.group_name)!==null&&nt!==void 0?nt:null,__value:(ft=Ye==null?void 0:Ye.value)!==null&&ft!==void 0?ft:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(Be,Le,Ye,tt){return Object.assign(Object.assign(Object.assign({},Be),Le),{get:_makeTypedGet(Be.name,Ye,tt)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(Be,Le,Ye){return(tt,nt)=>{var ft;const ht=(ft=Le==null?void 0:Le[tt])!==null&&ft!==void 0?ft:null;return ht==null?nt??null:nt!=null&&!(0,TypingUtils_1._isTypeMatch)(ht,nt)?(Log_1.Log.warn(`Parameter type mismatch. '${Be}.${tt}' was found to be type '${typeof ht}' but fallback/return type is '${typeof nt}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),nt??null):(Ye==null||Ye(tt),ht)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0});var StatsigUpdateDetails={};Object.defineProperty(StatsigUpdateDetails,"__esModule",{value:!0}),StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES=StatsigUpdateDetails.createUpdateDetails=void 0;const createUpdateDetails=(Be,Le,Ye,tt,nt,ft)=>({duration:Ye,source:Le,success:Be,error:tt,sourceUrl:nt,warnings:ft});StatsigUpdateDetails.createUpdateDetails=createUpdateDetails,StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(xt,yt,Ct,Et){Et===void 0&&(Et=Ct);var vt=Object.getOwnPropertyDescriptor(yt,Ct);(!vt||("get"in vt?!yt.__esModule:vt.writable||vt.configurable))&&(vt={enumerable:!0,get:function(){return yt[Ct]}}),Object.defineProperty(xt,Et,vt)}:function(xt,yt,Ct,Et){Et===void 0&&(Et=Ct),xt[Et]=yt[Ct]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,yt){for(var Ct in xt)Ct!=="default"&&!Object.prototype.hasOwnProperty.call(yt,Ct)&&Le(yt,xt,Ct)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Storage=Be.Log=Be.EventLogger=Be.Diagnostics=void 0;const tt=$_StatsigGlobal,nt=Diagnostics;Object.defineProperty(Be,"Diagnostics",{enumerable:!0,get:function(){return nt.Diagnostics}});const ft=EventLogger$1;Object.defineProperty(Be,"EventLogger",{enumerable:!0,get:function(){return ft.EventLogger}});const ht=Log;Object.defineProperty(Be,"Log",{enumerable:!0,get:function(){return ht.Log}});const gt=StatsigMetadata,At=StorageProvider;Object.defineProperty(Be,"Storage",{enumerable:!0,get:function(){return At.Storage}}),Ye($_StatsigGlobal,Be),Ye(CacheKey,Be),Ye(ClientInterfaces,Be),Ye(DataAdapterCore$1,Be),Ye(Diagnostics,Be),Ye(DownloadConfigSpecsResponse,Be),Ye(ErrorBoundary,Be),Ye(EvaluationOptions,Be),Ye(EvaluationTypes,Be),Ye(Hashing,Be),Ye(InitializeResponse,Be),Ye(Log,Be),Ye(MemoKey,Be),Ye(NetworkConfig,Be),Ye(NetworkCore$1,Be),Ye(OverrideAdapter,Be),Ye(ParamStoreTypes,Be),Ye(SafeJs,Be),Ye(SDKType,Be),Ye(SessionID,Be),Ye(SizeOf,Be),Ye(StableID,Be),Ye(StatsigClientBase$1,Be),Ye(StatsigClientEventEmitter,Be),Ye(StatsigDataAdapter,Be),Ye(StatsigEvent,Be),Ye(StatsigMetadata,Be),Ye(StatsigOptionsCommon,Be),Ye(StatsigPlugin,Be),Ye(StatsigTypeFactories,Be),Ye(StatsigTypes,Be),Ye(StatsigUser,Be),Ye(StorageProvider,Be),Ye(TypedJsonParse,Be),Ye(TypingUtils,Be),Ye(UrlConfiguration$1,Be),Ye(UUID,Be),Ye(VisibilityObserving,Be),Ye(StatsigUpdateDetails,Be),Ye(SDKFlags,Be),Object.assign((0,tt._getStatsigGlobal)(),{Log:ht.Log,SDK_VERSION:gt.SDK_VERSION})}(src$1);var StatsigClient$1={},EvaluationStore$1={},V1InitializeContainer$1={};Object.defineProperty(V1InitializeContainer$1,"__esModule",{value:!0}),V1InitializeContainer$1.V1InitializeContainer=void 0;const client_core_1$7=src$1;class V1InitializeContainer{constructor(Le){this._values=Le}getGate(Le){return this._getResultFromLookup(this._values.feature_gates,Le)}getConfig(Le){return this._getResultFromLookup(this._values.dynamic_configs,Le)}getLayer(Le){return this._getResultFromLookup(this._values.layer_configs,Le)}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$7._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V1InitializeContainer$1.V1InitializeContainer=V1InitializeContainer;var V2InitializeContainer$1={};Object.defineProperty(V2InitializeContainer$1,"__esModule",{value:!0}),V2InitializeContainer$1.V2InitializeContainer=void 0;const client_core_1$6=src$1;class V2InitializeContainer{constructor(Le){this._values=Le}getGate(Le){var Ye,tt,nt;const ft=this._getResultFromLookup(this._values.feature_gates,Le);return ft?{name:Le,value:ft.v===!0,rule_id:(Ye=ft.r)!==null&&Ye!==void 0?Ye:"default",secondary_exposures:(tt=ft.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ft.i)!==null&&nt!==void 0?nt:""}:null}getConfig(Le){var Ye,tt,nt,ft;const ht=this._getResultFromLookup(this._values.dynamic_configs,Le);return ht?{name:Le,value:(Ye=this._values.values[ht.v])!==null&&Ye!==void 0?Ye:{},rule_id:ht.r,secondary_exposures:(tt=ht.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ht.i)!==null&&nt!==void 0?nt:"",is_user_in_experiment:ht.ue===!0,passed:ht.p===!0,group_name:(ft=ht.gn)!==null&&ft!==void 0?ft:void 0,is_experiment_active:ht.ea===!0,group:ht.r,is_device_based:ht.i==="stableID"}:null}getLayer(Le){var Ye,tt,nt,ft,ht,gt;const At=this._getResultFromLookup(this._values.layer_configs,Le);return At?{name:Le,value:(Ye=this._values.values[At.v])!==null&&Ye!==void 0?Ye:{},rule_id:At.r,secondary_exposures:(tt=At.s)!==null&&tt!==void 0?tt:[],is_user_in_experiment:At.ue===!0,group_name:(nt=At.gn)!==null&&nt!==void 0?nt:void 0,is_experiment_active:At.ea===!0,group:At.r,is_device_based:At.i==="stableID",allocated_experiment_name:(ft=At.ae)!==null&&ft!==void 0?ft:"",explicit_parameters:(ht=At.ep)!==null&&ht!==void 0?ht:[],undelegated_secondary_exposures:(gt=At.us)!==null&&gt!==void 0?gt:[],parameter_rule_ids:At.pr}:null}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$6._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V2InitializeContainer$1.V2InitializeContainer=V2InitializeContainer,Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1,V1InitializeContainer_1=V1InitializeContainer$1,V2InitializeContainer_1=V2InitializeContainer$1;class EvaluationStore{constructor(Le){this._sdkKey=Le,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,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(Le,Ye){var tt,nt;if(!Le)return!1;const ft=(0,client_core_1$5._typedJsonParse)(Le.data,"has_updates","EvaluationResponse");return ft==null?!1:(this._source=Le.source,(ft==null?void 0:ft.has_updates)!==!0||((tt=ft.time)!==null&&tt!==void 0?tt:0)<this._lcut||(this._rawValues=Le.data,this._lcut=ft.time,this._receivedAt=Le.receivedAt,ft.response_format==="init-v2"?this._values=new V2InitializeContainer_1.V2InitializeContainer(ft):this._values=new V1InitializeContainer_1.V1InitializeContainer(ft),this._bootstrapMetadata=this._extractBootstrapMetadata(Le.source,ft),Le.source&&ft.user&&this._setWarningState(Ye,ft),client_core_1$5.SDKFlags.setFlags(this._sdkKey,(nt=ft.sdk_flags)!==null&&nt!==void 0?nt:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(Le){const Ye=this._values?this._values.getGate(Le):null;return this._getDetailedStoreResult(Ye)}getConfig(Le){const Ye=this._values?this._values.getConfig(Le):null;return this._getDetailedStoreResult(Ye)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(Le){const Ye=this._values?this._values.getLayer(Le):null;return this._getDetailedStoreResult(Ye)}getParamStore(Le){const Ye=this._values?this._values.getParamStore(Le):null;return this._getDetailedStoreResult(Ye)}getSource(){return this._source}getExposureMapping(){var Le;return(Le=this._values)===null||Le===void 0?void 0:Le.getExposureMapping()}_extractBootstrapMetadata(Le,Ye){if(Le!=="Bootstrap")return null;const tt={};return Ye.user&&(tt.user=Ye.user),Ye.sdkInfo&&(tt.generatorSDKInfo=Ye.sdkInfo),tt.lcut=Ye.time,tt}_getDetailedStoreResult(Le){return{result:Le,details:this._getDetails(Le==null)}}_setWarningState(Le,Ye){var tt,nt;const ft=client_core_1$5.StableID.get(this._sdkKey);if(((tt=Le.customIDs)===null||tt===void 0?void 0:tt.stableID)!==ft&&(!((nt=Le.customIDs)===null||nt===void 0)&&nt.stableID||ft)){this._warnings.add("StableIDMismatch");return}if("user"in Ye){const ht=Ye.user,gt=Object.assign(Object.assign({},Le),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,client_core_1$5._getFullUserHash)(gt)!==(0,client_core_1$5._getFullUserHash)(ht)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const Le={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(Le.warnings=Array.from(this._warnings)),Le}_getDetails(Le){var Ye,tt;const nt=this.getCurrentSourceDetails();let ft=nt.reason;const ht=(Ye=nt.warnings)!==null&&Ye!==void 0?Ye:[];this._source==="Bootstrap"&&ht.length>0&&(ft=ft+ht[0]),ft!=="Uninitialized"&&ft!=="NoValues"&&(ft=`${ft}:${Le?"Unrecognized":"Recognized"}`);const gt=this._source==="Bootstrap"&&(tt=this._bootstrapMetadata)!==null&&tt!==void 0?tt:void 0;return gt&&(nt.bootstrapMetadata=gt),Object.assign(Object.assign({},nt),{reason:ft})}}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(Be,Le){const Ye=(0,client_core_1$4._typedJsonParse)(Le,"checksum","DeltasEvaluationResponse");if(!Ye)return{hadBadDeltaChecksum:!0};const tt=_mergeDeltasIntoCache(Be,Ye),nt=_handleDeletedEntries(tt),ft=(0,client_core_1$4._DJB2Object)({feature_gates:nt.feature_gates,dynamic_configs:nt.dynamic_configs,layer_configs:nt.layer_configs},MAX_DELTAS_SORT_DEPTH);return ft===Ye.checksumV2?JSON.stringify(nt):{hadBadDeltaChecksum:!0,badChecksum:ft,badMergedConfigs:nt,badFullResponse:Ye.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(Be,Le){return Object.assign(Object.assign(Object.assign({},Be),Le),{feature_gates:Object.assign(Object.assign({},Be.feature_gates),Le.feature_gates),layer_configs:Object.assign(Object.assign({},Be.layer_configs),Le.layer_configs),dynamic_configs:Object.assign(Object.assign({},Be.dynamic_configs),Le.dynamic_configs)})}function _handleDeletedEntries(Be){const Le=Be;return _deleteEntriesInRecord(Be.deleted_gates,Le.feature_gates),delete Le.deleted_gates,_deleteEntriesInRecord(Be.deleted_configs,Le.dynamic_configs),delete Le.deleted_configs,_deleteEntriesInRecord(Be.deleted_layers,Le.layer_configs),delete Le.deleted_layers,Le}function _deleteEntriesInRecord(Be,Le){Be==null||Be.forEach(Ye=>{delete Le[Ye]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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(Le,Ye){super(Le,Ye);const tt=Le==null?void 0:Le.networkConfig;this._option=Le,this._initializeUrlConfig=new client_core_1$3.UrlConfiguration(client_core_1$3.Endpoint._initialize,tt==null?void 0:tt.initializeUrl,tt==null?void 0:tt.api,tt==null?void 0:tt.initializeFallbackUrls)}fetchEvaluations(Le,Ye,tt,nt,ft){return __awaiter$9(this,void 0,void 0,function*(){var ht,gt,At,xt,yt,Ct;const Et=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let vt={user:nt,hash:(At=(gt=(ht=this._option)===null||ht===void 0?void 0:ht.networkConfig)===null||gt===void 0?void 0:gt.initializeHashAlgorithm)!==null&&At!==void 0?At:"djb2",deltasResponseRequested:!1,full_checksum:null};if(Et!=null&&Et.has_updates){const kt=(Et==null?void 0:Et.hash_used)!==((Ct=(yt=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||yt===void 0?void 0:yt.initializeHashAlgorithm)!==null&&Ct!==void 0?Ct:"djb2");vt=Object.assign(Object.assign({},vt),{sinceTime:ft&&!kt?Et.time:0,previousDerivedFields:"derived_fields"in Et&&ft?Et.derived_fields:{},deltasResponseRequested:!0,full_checksum:Et.full_checksum,partialUserMatchSinceTime:kt?0:Et.time})}return this._fetchEvaluations(Le,Et,vt,tt)})}_fetchEvaluations(Le,Ye,tt,nt){return __awaiter$9(this,void 0,void 0,function*(){var ft,ht;const gt=yield this.post({sdkKey:Le,urlConfig:this._initializeUrlConfig,data:tt,retries:2,isStatsigEncodable:!0,priority:nt});if((gt==null?void 0:gt.code)===204)return'{"has_updates": false}';if((gt==null?void 0:gt.code)!==200)return(ft=gt==null?void 0:gt.body)!==null&&ft!==void 0?ft:null;if((Ye==null?void 0:Ye.has_updates)!==!0||((ht=gt.body)===null||ht===void 0?void 0:ht.includes('"is_delta":true'))!==!0||tt.deltasResponseRequested!==!0)return gt.body;const At=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ye,gt.body);return typeof At=="string"?At:this._fetchEvaluations(Le,Ye,Object.assign(Object.assign(Object.assign({},tt),At),{deltasResponseRequested:!1}),nt)})}}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(Be){return Be==null||Be.disableExposureLog===!1}function _shouldReturnFallback(Be,Le){return Le!=null&&!(0,client_core_1$2._isTypeMatch)(Be,Le)}function _getMappedStaticValue(Be,Le){return Be.value}function _getMappedGateValue(Be,Le,Ye){return Be.getFeatureGate(Le.gate_name,_shouldLogExposure(Ye)?void 0:NO_EXPOSURE_OPT).value?Le.pass_value:Le.fail_value}function _getMappedDynamicConfigValue(Be,Le,Ye,tt){const ft=Be.getDynamicConfig(Le.config_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedExperimentValue(Be,Le,Ye,tt){const ft=Be.getExperiment(Le.experiment_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedLayerValue(Be,Le,Ye,tt){const ft=Be.getLayer(Le.layer_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _makeParamStoreGetter(Be,Le,Ye){return(tt,nt)=>{if(Le==null)return nt;const ft=Le[tt];if(ft==null||nt!=null&&(0,client_core_1$2._typeOf)(nt)!==ft.param_type)return nt;switch(ft.ref_type){case"static":return _getMappedStaticValue(ft);case"gate":return _getMappedGateValue(Be,ft,Ye);case"dynamic_config":return _getMappedDynamicConfigValue(Be,ft,nt,Ye);case"experiment":return _getMappedExperimentValue(Be,ft,nt,Ye);case"layer":return _getMappedLayerValue(Be,ft,nt,Ye);default:return nt}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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(Le,Ye,tt){super.attach(Le,Ye,tt),tt!==null&&tt instanceof Network_1$1.default?this._network=tt:this._network=new Network_1$1.default(Ye??{})}getDataAsync(Le,Ye,tt){return this._getDataAsyncImpl(Le,(0,client_core_1$1._normalizeUser)(Ye,this._options),tt)}prefetchData(Le,Ye){return this._prefetchDataImpl(Le,Ye)}setData(Le){const Ye=(0,client_core_1$1._typedJsonParse)(Le,"has_updates","data");Ye&&"user"in Ye?super.setData(Le,Ye.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(Le,Ye){super.setData(Le,Ye)}_fetchFromNetwork(Le,Ye,tt,nt){return __awaiter$8(this,void 0,void 0,function*(){var ft;const ht=yield(ft=this._network)===null||ft===void 0?void 0:ft.fetchEvaluations(this._getSdkKey(),Le,tt==null?void 0:tt.priority,Ye,nt);return ht??null})}_getCacheKey(Le){var Ye;const tt=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),Le,(Ye=this._options)===null||Ye===void 0?void 0:Ye.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${tt}`}_isCachedResultValidFor204(Le,Ye){return Le.fullUserHash!=null&&Le.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ye)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).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(Le){const Ye=(0,client_core_1._getStatsigGlobal)().instance(Le);return Ye instanceof StatsigClient?Ye:(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(Le??"",{}))}constructor(Le,Ye,tt=null){var nt,ft;client_core_1.SDKType._setClientType(Le,"javascript-client");const ht=new Network_1.default(tt,At=>{this.$emt(At)});super(Le,(nt=tt==null?void 0:tt.dataAdapter)!==null&&nt!==void 0?nt:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,ht,tt),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(client_core_1.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(client_core_1.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(client_core_1.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(client_core_1.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(client_core_1.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(client_core_1.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new EvaluationStore_1.default(Le),this._network=ht,this._user=this._configureUser(Ye,tt),this._sdkInstanceID=(0,client_core_1.getUUID)();const gt=(ft=tt==null?void 0:tt.plugins)!==null&&ft!==void 0?ft:[];for(const At of gt)At.bind(this)}initializeSync(Le){var Ye;return this.loadingStatus!=="Uninitialized"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(Ye=this._store.getWarnings())!==null&&Ye!==void 0?Ye:[]]):(this._logger.start(),this.updateUserSync(this._user,Le))}initializeAsync(Le){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(Le),this._initializePromise)})}updateUserSync(Le,Ye){const tt=performance.now();try{return this._updateUserSyncImpl(Le,Ye,tt)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}}_updateUserSyncImpl(Le,Ye,tt){var nt;const ft=[...(nt=this._store.getWarnings())!==null&&nt!==void 0?nt:[]];this._resetForUser(Le);const ht=this.dataAdapter.getDataSync(this._user);ht==null&&ft.push("NoCachedValues"),this._store.setValues(ht,this._user),this._finalizeUpdate(ht);const gt=Ye==null?void 0:Ye.disableBackgroundCacheRefresh;return gt===!0||gt==null&&(ht==null?void 0:ht.source)==="Bootstrap"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft):(this._runPostUpdate(ht??null,this._user),(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft))}updateUserAsync(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){const tt=performance.now();try{return yield this._updateUserAsyncImpl(Le,Ye)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}})}_updateUserAsyncImpl(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(Le);const tt=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let nt=this.dataAdapter.getDataSync(tt);if(this._store.setValues(nt,this._user),this._setStatus("Loading",nt),nt=yield this.dataAdapter.getDataAsync(nt,tt,Ye),tt!==this._user)return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let ft=!1;nt!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),ft=this._store.setValues(nt,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:ft})),this._finalizeUpdate(nt),ft||(this._errorBoundary.attachErrorIfNoneExists(client_core_1.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,ft,this._store.getCurrentSourceDetails());const ht=client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,client_core_1.createUpdateDetails)(ft,this._store.getSource(),ht,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}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),sdkInstanceID:this._sdkInstanceID}}checkGate(Le,Ye){return this.getFeatureGate(Le,Ye).value}logEvent(Le,Ye,tt){const nt=typeof Le=="string"?{eventName:Le,value:Ye,metadata:tt}:Le;this.$emt({name:"log_event_called",event:nt}),this._logger.enqueue(Object.assign(Object.assign({},nt),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(Le){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:Le}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(Le){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,Le)})}_createErrorUpdateDetails(Le,Ye){var tt;return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),performance.now()-Ye,Le,null,[...(tt=this._store.getWarnings())!==null&&tt!==void 0?tt:[]])}_finalizeUpdate(Le){this._store.finalize(),this._setStatus("Ready",Le)}_runPostUpdate(Le,Ye){this.dataAdapter.getDataAsync(Le,Ye,{priority:"low"}).catch(tt=>{client_core_1.Log.error("An error occurred after update.",tt)})}_resetForUser(Le){this._logger.reset(),this._store.reset(),this._user=this._configureUser(Le,this._options)}_configureUser(Le,Ye){var tt,nt,ft;const ht=(0,client_core_1._normalizeUser)(Le,Ye),gt=(tt=ht.customIDs)===null||tt===void 0?void 0:tt.stableID;if(gt){const At=(ft=(nt=this.storageProvider).isReadyResolver)===null||ft===void 0?void 0:ft.call(nt);At?At.then(()=>client_core_1.StableID.setOverride(gt,this._sdkKey),()=>client_core_1.StableID.setOverride(gt,this._sdkKey)):client_core_1.StableID.setOverride(gt,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(ht.analyticsOnlyMetadata=Object.assign(Object.assign({},ht.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),ht}_getFeatureGateImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getGate(Le),gt=(0,client_core_1._makeFeatureGate)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getGateOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createGateExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"gate_evaluation",gate:xt}),xt}_getDynamicConfigImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getConfig(Le),gt=(0,client_core_1._makeDynamicConfig)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getDynamicConfigOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:xt}),xt}_getExperimentImpl(Le,Ye){var tt,nt,ft,ht;const{result:gt,details:At}=this._store.getConfig(Le),xt=(0,client_core_1._makeExperiment)(Le,At,gt);xt.__evaluation!=null&&(xt.__evaluation.secondary_exposures=(0,client_core_1._mapExposures)((nt=(tt=xt.__evaluation)===null||tt===void 0?void 0:tt.secondary_exposures)!==null&&nt!==void 0?nt:[],this._store.getExposureMapping()));const yt=(ht=(ft=this.overrideAdapter)===null||ft===void 0?void 0:ft.getExperimentOverride)===null||ht===void 0?void 0:ht.call(ft,xt,this._user,Ye),Ct=yt??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,Ct,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:Ct}),Ct}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(Le,Ye){var tt,nt,ft;const{result:ht,details:gt}=this._store.getLayer(Le),At=(0,client_core_1._makeLayer)(Le,gt,ht),xt=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getLayerOverride)===null||nt===void 0?void 0:nt.call(tt,At,this._user,Ye);Ye!=null&&Ye.disableExposureLog&&this._logger.incrementNonExposureCount(Le);const yt=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,Ct=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,yt,Ct,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:yt}),yt}_getParameterStoreImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getParamStore(Le);this._logger.incrementNonExposureCount(Le);const gt={name:Le,details:ht,__configuration:ft,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,ft,Ye)},At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getParamStoreOverride)===null||nt===void 0?void 0:nt.call(tt,gt,Ye);return At!=null&&(gt.__configuration=At.config,gt.details=At.details,gt.get=(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,At.config,Ye)),gt}}StatsigClient$1.default=StatsigClient,function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ht,gt,At,xt){xt===void 0&&(xt=At);var yt=Object.getOwnPropertyDescriptor(gt,At);(!yt||("get"in yt?!gt.__esModule:yt.writable||yt.configurable))&&(yt={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,yt)}:function(ht,gt,At,xt){xt===void 0&&(xt=At),ht[xt]=gt[At]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(ht,gt){for(var At in ht)At!=="default"&&!Object.prototype.hasOwnProperty.call(gt,At)&&Le(gt,ht,At)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigClient=void 0;const tt=src$1,nt=StatsigClient$1;Be.StatsigClient=nt.default,Ye(src$1,Be);const ft=Object.assign((0,tt._getStatsigGlobal)(),{StatsigClient:nt.default});Be.default=ft}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability","selfie_local_lenses_check_web","id_model_hebrew_back_id","id_face_readability","new_id_capture_ux_least_risky_clients","id_test_aa","id_iou_check","iad_checks","iad_c_checks","new_fingerprint","mp_test_hashed_id","face_occlusion"],GLOBAL_FLAGS=["new_fingerprint"],ID_MODULE_FLAGS=["id_face_readability","id_test_aa","iad_c_checks","mp_test_hashed_id","id_model_hebrew_back_id","id_iou_check","iad_checks","new_id_capture_ux_least_risky_clients","id_text_barcode_readability"],SELFIE_MODULE_FLAGS=["selfie_local_lenses_check_web","face_occlusion"];function getStatsigEnvironment(Be){return isStageK8sEnv(Be)?{tier:"development"}:isStageEnv(Be)||isDemoEnv(Be)?{tier:"staging"}:isSaasEnv(Be)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1,selfie_local_lenses_check_web:!1,id_model_hebrew_back_id:!1,id_face_readability:!1,new_id_capture_ux_least_risky_clients:!1,id_test_aa:!1,iad_checks:!1,iad_c_checks:!1,id_iou_check:!0,new_fingerprint:!1,mp_test_hashed_id:!1,face_occlusion:!1},clientExperimentIds={new_id_capture_ux_least_risky_clients:"experimentV2"};let initPromise=null;const initialize=async({flowId:Be,apiKey:Le,sessionIdentifier:Ye,apiURL:tt,clientExperimentId:nt})=>{if(initPromise)return initPromise;initPromise=(async()=>{var gt;const ft={customIDs:{client_api_key:Le,hashed_onboarding_id:Ye,flow_id:Be},custom:{landing_page:(gt=window==null?void 0:window.location)==null?void 0:gt.href}},ht=new src$2.StatsigClient(clientApiKey,ft,{environment:getStatsigEnvironment(tt)});await ht.initializeAsync(),FEATURE_FLAGS.forEach(At=>{if(nt&&clientExperimentIds[At]===nt){featureFlagsValues[At]=!0;return}featureFlagsValues[At]=ht.checkGate(At)})})(),await initPromise},getFeatureFlag=Be=>featureFlagsValues[Be]??!1,getModuleFeatureFlags=async Be=>{const Le={};GLOBAL_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]});const Ye=Be.toLowerCase();return Ye.includes("id")||Ye==="government-validation"?ID_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}):(Ye.includes("selfie")||Ye==="face")&&SELFIE_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}),Le};function IdCaptureParamsConfigurator(Be,Le,Ye,tt){Object.assign(Be,{areaDown:25e3,areaUp:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:160,widthIOSDown:85,widthDown:tt?110:135,widthUp:205,framesAggregationInterval:tt?3e3:2e3,minFaceIdQualityScore:.62})}function getSelfieFaceDetectionPipelineParams(){return{frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.86,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.85,minFaceQualityScore:.63,isOcclusionCheckEnabled:getFeatureFlag("face_occlusion"),faceOcclusionThreshold:.3}}const getProfiles=()=>[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_02,DetectionType.IDCapture,["id_capture_2_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"https://www.notion.so/ML-Update-ID-processing-model-to-accept-more-back-ID-types-18c4c3caef49801e95b4fd6bf9b92883?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_02,DetectionType.IDCapture,["id_capture_3_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Pipeline with text and barcode quality: https://www.notion.so/Web-Use-Text-Barcode-model-2nd-iteration-1bc4c3caef49805aa9e6d308db9fc6dd?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:!0},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","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Current Prod - Selfie face detection profile with quality metrics"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieVideoSelfie,DetectionType.SelfieVideoSelfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"VideoSelfie face detection profile")];function getProfile(Be){const Le=getProfiles().find(Ye=>Ye.name===Be);if(!Le)throw new Error(`Profile not found for type: ${Be}`);return Le}const wasmVersion="v2.12.26";function generateBundle(){const Be=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_02:getFeatureFlag("id_model_hebrew_back_id")?PipelineProfileName.IdCapture_2_02:PipelineProfileName.IdCapture_2_01,Le=PipelineProfileName.SelfieWithQualityMetrics,Ye=PipelineProfileName.SelfieVideoSelfie,tt=PipelineProfileName.IdVideoSelfie_2_01;return[Be,tt,Le,Ye]}function getInitializationParams(){const Le=generateBundle(),Ye="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",tt=`${Ye}/${wasmVersion}/webLib.wasm`,nt=`${Ye}/${wasmVersion}/webLibSimd.wasm`,ft=`${Ye}/${wasmVersion}/webLib.js`,ht=`${Ye}/${wasmVersion}/versions.json`;let gt=new Map,At=new Map;for(const xt of Le){const yt=getProfile(xt);if(!yt)throw new Error(`Profile not found: ${xt}`);const Ct=yt.modelNames;let Et=[];for(const vt of Ct)Et.push(`${Ye}/${wasmVersion}/models/${vt}`);gt.set(yt.pipelineType,Et),At.set(yt.detectionType,yt)}return{wasmModulePath:tt,wasmSimdModulePath:nt,glueCodePath:ft,versionsFilePath:ht,pipelineModels:gt,enableSIMD:!0,profiles:At,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.pipelineApiUtilities=null,this.utilityApi=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.inspectorOpened_=!1,this.wasmCallMutex=new Mutex,this.Module=null,this.loadModule=async Le=>{this.Module=(await import(Le)).Module}}async initialize(Le,Ye,tt,nt,ft,ht){await this.freeResources(),this.pipelines_=ht,this.versionsFile=ft,await this.loadModule(tt);const gt=await this.loadWasm(nt,Le,Ye);return this.pipelineApiUtilities=new this.wasmModule.PipelineApiUtilities,this.utilityApi=new this.wasmModule.UtilityApi,this.idCaptureWasmApi=new this.wasmModule.IdCaptureApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionApi,this.isInitialized_=!0,gt}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.pipelineApiUtilities!=null&&this.utilityApi!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(Le,Ye){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(Le&&Ye&&Le==this.imageWidth_&&Ye==this.imageHeight_&&this.inputImageBuffer&&Le*Ye*4===this.inputImageBuffer.length)&&(this.imageWidth_=Le,this.imageHeight_=Ye,this.inputImageBuffer=this.pipelineApiUtilities.allocateInputImageBuffer(Le,Ye,4))}async handleDetectionCallAndUpdateState(Le){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(Le))}encryptImage(Le){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.utilityApi.encryptImage(Le)}isVirtualCamera(Le){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),Le)return this.utilityApi.isVirtualCamera(Le)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.utilityApi.estimatePerformance()}async analyzeFrame(Le){this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(Le.width,Le.height),this.inputImageBuffer.set(Le.data),this.utilityApi.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.pipelineApiUtilities&&typeof this.pipelineApiUtilities.delete=="function"&&(this.pipelineApiUtilities.delete(),this.pipelineApiUtilities=null),this.utilityApi&&typeof this.utilityApi.delete=="function"&&(this.utilityApi.delete(),this.utilityApi=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(Le){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.pipelineApiUtilities.resetPipeline(this.pipelineTypeToWasmEnum(Le))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[Le,Ye]of this.pipelines_)this.resetPipeline(Le)}resetOther(){this.checkWasmInitialization("Unable to reset other states, cpp API hasn't been initialized"),this.utilityApi.resetOther()}reset(){this.resetAllPipelines(),this.resetOther()}async process(Le,Ye){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(Le.data),Ye){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ye));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(Ye));default:throw new Error("Unknown pipeline type")}}async runIdCapture(Le){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(Le.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(Le){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(Le.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceDetectionThresholds(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}async setFaceAttributesThresholds(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceChecksEnabled(Le,Ye,tt,nt,ft,ht){this.checkWasmInitialization("Unable to set face checks enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceChecksEnabled(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht)}async setFaceDetectionMode(Le,Ye){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(Le),Ye)}async setFaceDetectionCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt,bt,wt,It,Rt,Tt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt,bt,wt,It,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt)}async setIdCaptureConfigParams(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}setIdCaptureModelType(Le,Ye){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(Le),this.IdCaptureModelTypeToWasmEnum(Ye))}IdPerspectiveTransform(Le,Ye){return this.checkWasmInitialization("Unable to perform perspective transform, cpp API hasn't been initialized"),this.idCaptureWasmApi.IdPerspectiveTransform(Le,Ye)}async getVersions(){const Ye=await(await fetch(this.versionsFile)).text();return JSON.parse(Ye)}async loadWasm(Le,Ye,tt){const nt=Le?tt:Ye;try{window.wasmArrayBuffer=await fetch(nt).then(ft=>ft.arrayBuffer()).then(ft=>new Uint8Array(ft)),this.wasmModule=await this.Module()}catch(ft){if(console.log(ft,Le,"useSmd"),Le)return await this.loadWasm(!1,Ye,tt);throw ft}return Le}async loadModels(){var nt;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let Le=new this.wasmModule.PipelineTypeToIntMap,Ye=new Map,tt=new Map;for(let[ft,ht]of this.pipelines_){let gt=this.pipelineTypeToWasmEnum(ft),At=[],xt=new this.wasmModule.VectorInt;for(let yt of ht){if(!tt.has(yt)){let Et=await fetch(yt).then(vt=>vt.arrayBuffer()).then(vt=>new Uint8Array(vt));tt.set(yt,Et)}let Ct=tt.get(yt);xt.push_back(Ct.byteLength),At.push(Ct)}Le.set(gt,xt),Ye.set(gt,At)}this.modelsBuffers=this.pipelineApiUtilities.allocateModelsBuffers(Le);for(let[ft,ht]of Ye){let gt=(nt=this.modelsBuffers)==null?void 0:nt.get(ft);for(let At=0;At<gt.size();At++){let xt=gt==null?void 0:gt.get(At);if(xt)xt.set(ht[At]);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.pipelineApiUtilities.initializePipelines()}async setProductionMode(Le){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.utilityApi.setProductionMode(Le)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.pipelineApiUtilities.getCurrentPipeline())}setSdkVersion(Le){this.checkWasmInitialization("Unable to set sdk version, cpp API hasn't been initialized"),this.utilityApi.setSdkVersion(Le)}setSdkPlatform(Le){this.checkWasmInitialization("Unable to set device type, cpp API hasn't been initialized"),this.utilityApi.setSdkPlatform(Le)}setDeviceInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set device info, cpp API hasn't been initialized"),this.utilityApi.setDeviceInfo(Le,Ye)}setBrowserInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set browser info, cpp API hasn't been initialized"),this.utilityApi.setBrowserInfo(Le,Ye)}setCameraInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set camera info, cpp API hasn't been initialized"),this.utilityApi.setCameraInfo(Le,Ye)}setZc(Le){this.checkWasmInitialization("Unable to set zc, cpp API hasn't been initialized"),this.utilityApi.setZc(Le)}setMotionStatus(Le){this.checkWasmInitialization("Unable to set motion status, cpp API hasn't been initialized"),this.utilityApi.setMotionStatus(Le)}setMetadataField(Le,Ye){this.checkWasmInitialization("Unable to set metadata field, cpp API hasn't been initialized"),this.utilityApi.setMetadataField(Le,Ye)}setInspectorOpened(Le){this.inspectorOpened_=Le}setBackgroundMode(Le){this.checkWasmInitialization("Unable to set background mode, cpp API hasn't been initialized"),this.utilityApi.setBackgroundMode(Le)}getCheck(){return this.checkWasmInitialization("Unable to get check, cpp API hasn't been initialized"),this.utilityApi.getCheck()}getMetadata(){return this.checkWasmInitialization("Unable to get metadata, cpp API hasn't been initialized"),this.utilityApi.setInspectorOpened(this.inspectorOpened_),this.utilityApi.getMetadata()}async prc(Le){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[Le])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}async pc(Le){this.checkWasmInitialization("Unable to pc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.pc.bind(this.utilityApi),[Le])}pipelineTypeToWasmEnum(Le){switch(Le){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(Le){switch(Le){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(Le){switch(Le){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(Le){switch(Le){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(Le){if(!this.isInitialized())throw new Error(Le)}async wasmCallWrapper(Le,Ye=[]){return await this.wasmCallMutex.withLock(async(...tt)=>{let nt=!1;try{for(;;){if(nt=Le(...tt),nt)return;await new Promise(ft=>setTimeout(ft,0))}}catch(ft){console.log("Error in wasmCallWrapper:",ft)}},...Ye)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance(),version$4="1.85.0-20251103200526.0";function e$2(Be,Le){return function(Ye,tt){return Object.prototype.hasOwnProperty.call(Ye,tt)}(Be,Le)?Be[Le]:void 0}function t$2(Be,Le,Ye,tt){const nt=document,ft="securitypolicyviolation";let ht;const gt=xt=>{const yt=new URL(Be,location.href),{blockedURI:Ct}=xt;Ct!==yt.href&&Ct!==yt.protocol.slice(0,-1)&&Ct!==yt.origin||(ht=xt,At())};nt.addEventListener(ft,gt);const At=()=>nt.removeEventListener(ft,gt);return Promise.resolve().then(Le).then(xt=>(At(),xt),xt=>new Promise(yt=>{const Ct=new MessageChannel;Ct.port1.onmessage=()=>yt(),Ct.port2.postMessage(null)}).then(()=>{if(At(),ht)return Ye(ht);throw xt}))}function n$2(Be){let Le="";for(let Ye=0;Ye<Be.length;++Ye)if(Ye>0){const tt=Be[Ye].toLowerCase();tt!==Be[Ye]?Le+=` ${tt}`:Le+=Be[Ye]}else Le+=Be[Ye].toUpperCase();return Le}const r$4={default:"endpoint"},o$1={default:"tlsEndpoint"},i$5="Client timeout",R$2="Network connection error",s$3="Network request aborted",a$3="Response cannot be parsed",c$3="Blocked by CSP",E$1="The endpoint parameter is not a valid URL",l$1="Handle on demand agent data error",u$1=n$2("WrongRegion"),d$1=n$2("SubscriptionNotActive"),_$2=n$2("UnsupportedVersion"),O$1=n$2("InstallationMethodRestricted"),p$1=n$2("HostnameRestricted"),I$1=n$2("IntegrationFailed"),f$2=n$2("NetworkRestricted"),N$1=n$2("InvalidProxyIntegrationSecret"),T$1=n$2("InvalidProxyIntegrationHeaders"),h$e=n$2("ProxyIntegrationSecretEnvironmentMismatch"),v$d="API key required",m$2="API key not found",A$1="API key expired",w$e="Request cannot be parsed",P$1="Request failed",D$1="Request failed to process",S$1="Too many requests, rate limit exceeded",y="Not available for this origin",g$1="Not available with restricted header",L$1=v$d,C$1=m$2,U$1=A$1;var b$2="3.12.3";const M$1="Failed to load the JS script of the agent",K="9319";function V(Be,Le){const Ye=[],[tt,nt]=function(gt){const At=function(Ct){const Et=[...Ct];return{current:()=>Et[0],postpone(){const vt=Et.shift();vt!==void 0&&Et.push(vt)},exclude(){Et.shift()}}}(gt),xt=function(Ct,Et){let vt=0;return()=>Math.random()*Math.min(Et,Ct*Math.pow(2,vt++))}(100,3e3),yt=new Set;return[At.current(),(Ct,Et)=>{let vt;const kt=Et instanceof Error?Et.message:"";if(kt===c$3||kt===E$1)At.exclude(),vt=0;else if(kt===K)At.exclude();else if(kt===M$1){const wt=Date.now()-Ct.getTime()<50,It=At.current();It&&wt&&!yt.has(It)&&(yt.add(It),vt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,vt??Ct.getTime()+xt()-Date.now()]}]}(Be);let ft;if(tt===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const ht=gt=>{const At=new Date,xt=Ct=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:Ct}),yt=Le(gt);return yt.then(()=>xt(),xt),yt.catch(Ct=>{if(ft!=null||(ft=Ct),Ye.length>=5)throw ft;const Et=nt(At,Ct);if(!Et)throw ft;const[vt,kt]=Et;return(bt=kt,new Promise(wt=>setTimeout(wt,bt))).then(()=>ht(vt));var bt})};return ht(tt).then(gt=>[gt,Ye])}const k$1="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",G=k$1;function B$1(Be){var Le,Ye;const{picked:tt,rest:nt}=function(yt,Ct){const Et={},vt={};for(const[kt,bt]of Object.entries(yt))Ct.includes(kt)?Et[kt]=bt:vt[kt]=bt;return{picked:Et,rest:vt}}(Be,["scriptUrlPattern","token","apiKey"]),ft=tt.token,ht=(Le=tt.apiKey)!==null&&Le!==void 0?Le:ft,gt=(Ye=e$2(Be,"scriptUrlPattern"))!==null&&Ye!==void 0?Ye:k$1,[At,xt]=function(){const yt=[],Ct=()=>{yt.push({time:new Date,state:document.visibilityState})},Et=function(vt,kt,bt,wt){return vt.addEventListener(kt,bt,wt),()=>vt.removeEventListener(kt,bt,wt)}(document,"visibilitychange",Ct);return Ct(),[yt,Et]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const yt=function(Ct,Et){return(Array.isArray(Ct)?Ct:[Ct]).map(vt=>function(kt,bt){const wt=encodeURIComponent;return kt.replace(/<[^<>]+>/g,It=>It==="<version>"?"3":It==="<apiKey>"?wt(bt):It==="<loaderVersion>"?wt(b$2):It)}(String(vt),Et))}(gt,ht);return V(yt,F$1)}).catch(yt=>{throw xt(),function(Ct){return Ct instanceof Error&&Ct.message===K?new Error(M$1):Ct}(yt)}).then(([yt,Ct])=>(xt(),yt.load({...nt,ldi:{attempts:Ct,visibilityStates:At}})))}function F$1(Be){return t$2(Be,()=>function(Le){return new Promise((Ye,tt)=>{if(function(gt){if(URL.prototype)try{return new URL(gt,location.href),!1}catch(At){if(At instanceof Error&&At.name==="TypeError")return!0;throw At}}(Le))throw new Error(E$1);const nt=document.createElement("script"),ft=()=>{var gt;return(gt=nt.parentNode)===null||gt===void 0?void 0:gt.removeChild(nt)},ht=document.head||document.getElementsByTagName("head")[0];nt.onload=()=>{ft(),Ye()},nt.onerror=()=>{ft(),tt(new Error(M$1))},nt.async=!0,nt.src=Le,ht.appendChild(nt)})}(Be),()=>{throw new Error(c$3)}).then(x$1)}function x$1(){const Be=window,Le="__fpjs_p_l_b",Ye=Be[Le];if(function(tt,nt){var ft;const ht=(ft=Object.getOwnPropertyDescriptor)===null||ft===void 0?void 0:ft.call(Object,tt,nt);ht!=null&&ht.configurable?delete tt[nt]:ht&&!ht.writable||(tt[nt]=void 0)}(Be,Le),typeof(Ye==null?void 0:Ye.load)!="function")throw new Error(K);return Ye}var H={load:B$1,defaultScriptUrlPattern:G,ERROR_SCRIPT_LOAD_FAIL:M$1,ERROR_API_KEY_EXPIRED:A$1,ERROR_API_KEY_INVALID:m$2,ERROR_API_KEY_MISSING:v$d,ERROR_BAD_REQUEST_FORMAT:w$e,ERROR_BAD_RESPONSE_FORMAT:a$3,ERROR_CLIENT_TIMEOUT:i$5,ERROR_CSP_BLOCK:c$3,ERROR_FORBIDDEN_ENDPOINT:p$1,ERROR_FORBIDDEN_HEADER:g$1,ERROR_FORBIDDEN_ORIGIN:y,ERROR_GENERAL_SERVER_FAILURE:P$1,ERROR_HANDLE_AGENT_DATA:l$1,ERROR_INSTALLATION_METHOD_RESTRICTED:O$1,ERROR_INTEGRATION_FAILURE:I$1,ERROR_INVALID_ENDPOINT:E$1,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:T$1,ERROR_INVALID_PROXY_INTEGRATION_SECRET:N$1,ERROR_NETWORK_ABORT:s$3,ERROR_NETWORK_CONNECTION:R$2,ERROR_NETWORK_RESTRICTED:f$2,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:h$e,ERROR_RATE_LIMIT:S$1,ERROR_SERVER_TIMEOUT:D$1,ERROR_SUBSCRIPTION_NOT_ACTIVE:d$1,ERROR_TOKEN_EXPIRED:U$1,ERROR_TOKEN_INVALID:C$1,ERROR_TOKEN_MISSING:L$1,ERROR_UNSUPPORTED_VERSION:_$2,ERROR_WRONG_REGION:u$1,defaultEndpoint:r$4,defaultTlsEndpoint:o$1};function e$1(Be,Le,Ye,tt){return new(Ye||(Ye=Promise))(function(nt,ft){function ht(xt){try{At(tt.next(xt))}catch(yt){ft(yt)}}function gt(xt){try{At(tt.throw(xt))}catch(yt){ft(yt)}}function At(xt){var yt;xt.done?nt(xt.value):(yt=xt.value,yt instanceof Ye?yt:new Ye(function(Ct){Ct(yt)})).then(ht,gt)}At((tt=tt.apply(Be,[])).next())})}function n$1(Be,Le){var Ye,tt,nt,ft,ht={label:0,sent:function(){if(1&nt[0])throw nt[1];return nt[1]},trys:[],ops:[]};return ft={next:gt(0),throw:gt(1),return:gt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function gt(At){return function(xt){return function(yt){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,yt[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&yt[0]?tt.return:yt[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,yt[1])).done)return nt;switch(tt=0,nt&&(yt=[2&yt[0],nt.value]),yt[0]){case 0:case 1:nt=yt;break;case 4:return ht.label++,{value:yt[1],done:!1};case 5:ht.label++,tt=yt[1],yt=[0];continue;case 7:yt=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||yt[0]!==6&&yt[0]!==2)){ht=0;continue}if(yt[0]===3&&(!nt||yt[1]>nt[0]&&yt[1]<nt[3])){ht.label=yt[1];break}if(yt[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=yt;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(yt);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}yt=Le.call(Be,ht)}catch(Ct){yt=[6,Ct],tt=0}finally{Ye=nt=0}if(5&yt[0])throw yt[1];return{value:yt[0]?yt[1]:void 0,done:!0}}([At,xt])}}}typeof SuppressedError=="function"&&SuppressedError;var r$3={exclude:[],include:[],logging:!0,timeout:1e3},o={},a$2={timeout:"true"},i$4=function(Be,Le){typeof window<"u"&&(o[Be]=Le)},u=function(){return Object.fromEntries(Object.entries(o).filter(function(Be){var Le,Ye=Be[0];return!(!((Le=r$3==null?void 0:r$3.exclude)===null||Le===void 0)&&Le.includes(Ye))}).filter(function(Be){var Le,Ye,tt,nt,ft=Be[0];return!((Le=r$3==null?void 0:r$3.include)===null||Le===void 0)&&Le.some(function(ht){return ht.includes(".")})?(Ye=r$3==null?void 0:r$3.include)===null||Ye===void 0?void 0:Ye.some(function(ht){return ht.startsWith(ft)}):((tt=r$3==null?void 0:r$3.include)===null||tt===void 0?void 0:tt.length)===0||((nt=r$3==null?void 0:r$3.include)===null||nt===void 0?void 0:nt.includes(ft))}).map(function(Be){return[Be[0],(0,Be[1])()]}))};function c$2(Be){return Be^=Be>>>16,Be=Math.imul(Be,2246822507),Be^=Be>>>13,Be=Math.imul(Be,3266489909),(Be^=Be>>>16)>>>0}var s$2=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(Be,Le){return Be<<Le|Be>>>32-Le}function d(Be,Le){var Ye;if(Le===void 0&&(Le=0),Le=Le?0|Le:0,typeof Be=="string"&&(Ye=Be,Be=new TextEncoder().encode(Ye).buffer),!(Be instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var tt=new Uint32Array([Le,Le,Le,Le]);(function(ft,ht){for(var gt=ft.byteLength/16|0,At=new Uint32Array(ft,0,4*gt),xt=0;xt<gt;xt++){var yt=At.subarray(4*xt,4*(xt+1));yt[0]=Math.imul(yt[0],s$2[0]),yt[0]=l(yt[0],15),yt[0]=Math.imul(yt[0],s$2[1]),ht[0]=ht[0]^yt[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,yt[1]=Math.imul(yt[1],s$2[1]),yt[1]=l(yt[1],16),yt[1]=Math.imul(yt[1],s$2[2]),ht[1]=ht[1]^yt[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,yt[2]=Math.imul(yt[2],s$2[2]),yt[2]=l(yt[2],17),yt[2]=Math.imul(yt[2],s$2[3]),ht[2]=ht[2]^yt[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,yt[3]=Math.imul(yt[3],s$2[3]),yt[3]=l(yt[3],18),yt[3]=Math.imul(yt[3],s$2[0]),ht[3]=ht[3]^yt[3],ht[3]=l(ht[3],13),ht[3]=ht[3]+ht[0],ht[3]=Math.imul(ht[3],5)+850148119}})(Be,tt),function(ft,ht){var gt=ft.byteLength/16|0,At=ft.byteLength%16,xt=new Uint32Array(4),yt=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^yt[14]<<16;case 14:xt[3]=xt[3]^yt[13]<<8;case 13:xt[3]=xt[3]^yt[12],xt[3]=Math.imul(xt[3],s$2[3]),xt[3]=l(xt[3],18),xt[3]=Math.imul(xt[3],s$2[0]),ht[3]=ht[3]^xt[3];case 12:xt[2]=xt[2]^yt[11]<<24;case 11:xt[2]=xt[2]^yt[10]<<16;case 10:xt[2]=xt[2]^yt[9]<<8;case 9:xt[2]=xt[2]^yt[8],xt[2]=Math.imul(xt[2],s$2[2]),xt[2]=l(xt[2],17),xt[2]=Math.imul(xt[2],s$2[3]),ht[2]=ht[2]^xt[2];case 8:xt[1]=xt[1]^yt[7]<<24;case 7:xt[1]=xt[1]^yt[6]<<16;case 6:xt[1]=xt[1]^yt[5]<<8;case 5:xt[1]=xt[1]^yt[4],xt[1]=Math.imul(xt[1],s$2[1]),xt[1]=l(xt[1],16),xt[1]=Math.imul(xt[1],s$2[2]),ht[1]=ht[1]^xt[1];case 4:xt[0]=xt[0]^yt[3]<<24;case 3:xt[0]=xt[0]^yt[2]<<16;case 2:xt[0]=xt[0]^yt[1]<<8;case 1:xt[0]=xt[0]^yt[0],xt[0]=Math.imul(xt[0],s$2[0]),xt[0]=l(xt[0],15),xt[0]=Math.imul(xt[0],s$2[1]),ht[0]=ht[0]^xt[0]}}(Be,tt),function(ft,ht){ht[0]=ht[0]^ft.byteLength,ht[1]=ht[1]^ft.byteLength,ht[2]=ht[2]^ft.byteLength,ht[3]=ht[3]^ft.byteLength,ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0,ht[0]=c$2(ht[0]),ht[1]=c$2(ht[1]),ht[2]=c$2(ht[2]),ht[3]=c$2(ht[3]),ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0}(Be,tt);var nt=new Uint8Array(tt.buffer);return Array.from(nt).map(function(ft){return ft.toString(16).padStart(2,"0")}).join("")}function f$1(Be,Le){return new Promise(function(Ye){setTimeout(function(){return Ye(Le)},Be)})}function m$1(Be,Le,Ye){return Promise.all(Be.map(function(tt){return Promise.race([tt,f$1(Le,Ye)])}))}function g(){return e$1(this,void 0,void 0,function(){var Be,Le,Ye,tt,nt;return n$1(this,function(ft){switch(ft.label){case 0:return ft.trys.push([0,2,,3]),Be=u(),Le=Object.keys(Be),[4,m$1(Object.values(Be),(r$3==null?void 0:r$3.timeout)||1e3,a$2)];case 1:return Ye=ft.sent(),tt=Ye.filter(function(ht){return ht!==void 0}),nt={},tt.forEach(function(ht,gt){nt[Le[gt]]=ht}),[2,p(nt,r$3.exclude||[],r$3.include||[],"")];case 2:throw ft.sent();case 3:return[2]}})})}function p(Be,Le,Ye,tt){tt===void 0&&(tt="");for(var nt={},ft=function(xt,yt){var Ct=tt+xt+".";if(typeof yt!="object"||Array.isArray(yt)){var Et=Le.some(function(bt){return Ct.startsWith(bt)}),vt=Ye.some(function(bt){return Ct.startsWith(bt)});Et&&!vt||(nt[xt]=yt)}else{var kt=p(yt,Le,Ye,Ct);Object.keys(kt).length>0&&(nt[xt]=kt)}},ht=0,gt=Object.entries(Be);ht<gt.length;ht++){var At=gt[ht];ft(At[0],At[1])}return nt}function w$d(Be){return e$1(this,void 0,void 0,function(){var Le,Ye;return n$1(this,function(tt){switch(tt.label){case 0:return tt.trys.push([0,2,,3]),[4,g()];case 1:return Le=tt.sent(),Ye=d(JSON.stringify(Le)),Math.random()<1e-5&&r$3.logging&&function(nt,ft){e$1(this,void 0,void 0,function(){var ht,gt;return n$1(this,function(At){switch(At.label){case 0:if(ht="https://logging.thumbmarkjs.com/v1/log",gt={thumbmark:nt,components:ft,version:"0.20.6"},sessionStorage.getItem("_tmjs_l"))return[3,4];sessionStorage.setItem("_tmjs_l","1"),At.label=1;case 1:return At.trys.push([1,3,,4]),[4,fetch(ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)})];case 2:case 3:return At.sent(),[3,4];case 4:return[2]}})})}(Ye,Le),[2,Ye.toString()];case 2:throw tt.sent();case 3:return[2]}})})}function b$1(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var Be=navigator.userAgent,Le={edg:"Edge",opr:"Opera",samsung:"SamsungBrowser"},Ye=0,tt=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>samsung).*Version\/(?<version>\d+(?:\.\d+)?)/i,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/];Ye<tt.length;Ye++){var nt=tt[Ye],ft=Be.match(nt);if(ft&&ft.groups)return{name:Le[ft.groups.name.toLowerCase()]||ft.groups.name,version:ft.groups.version}}return{name:"unknown",version:"unknown"}}function S(Be){for(var Le=0,Ye=0;Ye<Be.length;++Ye)Le+=Math.abs(Be[Ye]);return Le}var M=b$1();function E(Be,Le,Ye){for(var tt=[],nt=0;nt<Be[0].data.length;nt++){for(var ft=[],ht=0;ht<Be.length;ht++)ft.push(Be[ht].data[nt]);tt.push(P(ft))}var gt=new Uint8ClampedArray(tt);return new ImageData(gt,Le,Ye)}function P(Be){if(Be.length===0)return 0;for(var Le={},Ye=0,tt=Be;Ye<tt.length;Ye++)Le[ft=tt[Ye]]=(Le[ft]||0)+1;var nt=Be[0];for(var ft in Le)Le[ft]>Le[nt]&&(nt=parseInt(ft,10));return nt}["SamsungBrowser","Safari"].includes(M.name)||i$4("audio",function(){return e$1(this,void 0,void 0,function(){return n$1(this,function(Be){return[2,new Promise(function(Le,Ye){try{var tt=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),nt=tt.createBufferSource(),ft=tt.createOscillator();ft.frequency.value=1e3;var ht,gt=tt.createDynamicsCompressor();gt.threshold.value=-50,gt.knee.value=40,gt.ratio.value=12,gt.attack.value=0,gt.release.value=.2,ft.connect(gt),gt.connect(tt.destination),ft.start(),tt.oncomplete=function(At){ht=At.renderedBuffer.getChannelData(0),Le({sampleHash:S(ht),oscillator:ft.type,maxChannels:tt.destination.maxChannelCount,channelCountMode:nt.channelCountMode})},tt.startRendering()}catch(At){console.error("Error creating audio fingerprint:",At),Ye(At)}})]})})});var A=b$1(),C=A.name.toLowerCase(),x=A.version.split(".")[0]||"0",T=parseInt(x,10);C==="firefox"||C==="safari"&&T===17||i$4("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(Be){var Le=Array.from({length:3},function(){return function(){var Ye=document.createElement("canvas"),tt=Ye.getContext("2d");if(!tt)return new ImageData(1,1);Ye.width=280,Ye.height=20;var nt=tt.createLinearGradient(0,0,Ye.width,Ye.height);nt.addColorStop(0,"red"),nt.addColorStop(.16666666666666666,"orange"),nt.addColorStop(.3333333333333333,"yellow"),nt.addColorStop(.5,"green"),nt.addColorStop(.6666666666666666,"blue"),nt.addColorStop(.8333333333333334,"indigo"),nt.addColorStop(1,"violet"),tt.fillStyle=nt,tt.fillRect(0,0,Ye.width,Ye.height);var ft="Random Text WMwmil10Oo";return tt.font="23.123px Arial",tt.fillStyle="black",tt.fillText(ft,-5,15),tt.fillStyle="rgba(0, 0, 255, 0.5)",tt.fillText(ft,-3.3,17.7),tt.beginPath(),tt.moveTo(0,0),tt.lineTo(2*Ye.width/7,Ye.height),tt.strokeStyle="white",tt.lineWidth=2,tt.stroke(),tt.getImageData(0,0,Ye.width,Ye.height)}()});Be({commonImageDataHash:d(E(Le,280,20).data.toString()).toString()})})});var k,I=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],R$1=["monospace","sans-serif","serif"];function L(Be,Le){if(!Be)throw new Error("Canvas context not supported");return Be.font,Be.font="72px ".concat(Le),Be.measureText("WwMmLli0Oo").width}function _$1(){var Be,Le=document.createElement("canvas"),Ye=(Be=Le.getContext("webgl"))!==null&&Be!==void 0?Be:Le.getContext("experimental-webgl");if(Ye&&"getParameter"in Ye)try{var tt=(Ye.getParameter(Ye.VENDOR)||"").toString(),nt=(Ye.getParameter(Ye.RENDERER)||"").toString(),ft={vendor:tt,renderer:nt,version:(Ye.getParameter(Ye.VERSION)||"").toString(),shadingLanguageVersion:(Ye.getParameter(Ye.SHADING_LANGUAGE_VERSION)||"").toString()};if(!nt.length||!tt.length){var ht=Ye.getExtension("WEBGL_debug_renderer_info");if(ht){var gt=(Ye.getParameter(ht.UNMASKED_VENDOR_WEBGL)||"").toString(),At=(Ye.getParameter(ht.UNMASKED_RENDERER_WEBGL)||"").toString();gt&&(ft.vendorUnmasked=gt),At&&(ft.rendererUnmasked=At)}}return ft}catch{}return"undefined"}function O(){var Be=new Float32Array(1),Le=new Uint8Array(Be.buffer);return Be[0]=1/0,Be[0]=Be[0]-Be[0],Le[3]}function B(Be,Le){var Ye={};return Le.forEach(function(tt){var nt=function(ft){if(ft.length===0)return null;var ht={};ft.forEach(function(xt){var yt=String(xt);ht[yt]=(ht[yt]||0)+1});var gt=ft[0],At=1;return Object.keys(ht).forEach(function(xt){ht[xt]>At&&(gt=xt,At=ht[xt])}),gt}(Be.map(function(ft){return tt in ft?ft[tt]:void 0}).filter(function(ft){return ft!==void 0}));nt&&(Ye[tt]=nt)}),Ye}function D(){var Be=[],Le={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(Le).forEach(function(Ye){Le[Ye].forEach(function(tt){matchMedia("(".concat(Ye,": ").concat(tt,")")).matches&&Be.push("".concat(Ye,": ").concat(tt))})}),Be}b$1().name!="Firefox"&&i$4("fonts",function(){var Be=this;return new Promise(function(Le,Ye){try{(function(tt){var nt;e$1(this,void 0,void 0,function(){var ft,ht,gt;return n$1(this,function(At){switch(At.label){case 0:return document.body?[3,2]:[4,(xt=50,new Promise(function(Ct){return setTimeout(Ct,xt,yt)}))];case 1:return At.sent(),[3,0];case 2:if((ft=document.createElement("iframe")).setAttribute("frameBorder","0"),(ht=ft.style).setProperty("position","fixed"),ht.setProperty("display","block","important"),ht.setProperty("visibility","visible"),ht.setProperty("border","0"),ht.setProperty("opacity","0"),ft.src="about:blank",document.body.appendChild(ft),!(gt=ft.contentDocument||((nt=ft.contentWindow)===null||nt===void 0?void 0:nt.document)))throw new Error("Iframe document is not accessible");return tt({iframe:gt}),setTimeout(function(){document.body.removeChild(ft)},0),[2]}var xt,yt})})})(function(tt){var nt=tt.iframe;return e$1(Be,void 0,void 0,function(){var ft,ht,gt,At;return n$1(this,function(xt){return ft=nt.createElement("canvas"),ht=ft.getContext("2d"),gt=R$1.map(function(yt){return L(ht,yt)}),At={},I.forEach(function(yt){var Ct=L(ht,yt);gt.includes(Ct)||(At[yt]=Ct)}),Le(At),[2]})})})}catch{Ye({error:"unsupported"})}})}),i$4("hardware",function(){return new Promise(function(Be,Le){var Ye=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,tt=window.performance&&window.performance.memory?window.performance.memory:0;Be({videocard:_$1(),architecture:O(),deviceMemory:Ye.toString()||"undefined",jsHeapSizeLimit:tt.jsHeapSizeLimit||0})})}),i$4("locales",function(){return new Promise(function(Be){Be({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),i$4("permissions",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){return k=(r$3==null?void 0:r$3.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],b$1().name.toLowerCase()==="safari"&&(k=k.filter(function(Ye){return!["camera","geolocation","microphone"].includes(Ye)})),Be=Array.from({length:(r$3==null?void 0:r$3.retries)||3},function(){return function(){return e$1(this,void 0,void 0,function(){var Ye,tt,nt,ft,ht;return n$1(this,function(gt){switch(gt.label){case 0:Ye={},tt=0,nt=k,gt.label=1;case 1:if(!(tt<nt.length))return[3,6];ft=nt[tt],gt.label=2;case 2:return gt.trys.push([2,4,,5]),[4,navigator.permissions.query({name:ft})];case 3:return ht=gt.sent(),Ye[ft]=ht.state.toString(),[3,5];case 4:return gt.sent(),[3,5];case 5:return tt++,[3,1];case 6:return[2,Ye]}})})}()}),[2,Promise.all(Be).then(function(Ye){return B(Ye,k)})]})})}),i$4("plugins",function(){var Be=[];if(navigator.plugins)for(var Le=0;Le<navigator.plugins.length;Le++){var Ye=navigator.plugins[Le];Be.push([Ye.name,Ye.filename,Ye.description].join("|"))}return new Promise(function(tt){tt({plugins:Be})})}),i$4("screen",function(){return new Promise(function(Be){Be({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:D()})})}),i$4("system",function(){return new Promise(function(Be){var Le=b$1(),Ye={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:Le.name,version:Le.version}};Le.name.toLowerCase()!=="safari"&&(Ye.applePayVersion=function(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var tt=window.ApplePaySession.supportsVersion,nt=15;nt>0;nt--)if(tt(nt))return nt}catch{return 0}return 0}(),Ye.cookieEnabled=window.navigator.cookieEnabled),Be(Ye)})});var U,N=b$1().name!=="SamsungBrowser"?1:3,F=null;i$4("webgl",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){typeof document<"u"&&((U=document.createElement("canvas")).width=200,U.height=100,F=U.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return Be=Array.from({length:N},function(){return function(){try{if(!F)throw new Error("WebGL not supported");var Ye=`
67
67
  attribute vec2 position;
68
68
  void main() {
69
69
  gl_Position = vec4(position, 0.0, 1.0);
@@ -1983,7 +1983,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1983
1983
  -webkit-appearance: none;
1984
1984
  -moz-appearance: textfield;
1985
1985
  color: ${Be=>Be.color||Be.tokens.input.primary.text.field.default};
1986
- padding-right: ${Be=>Be.tokens.spacing[9]||"44px"}; /* make room for your icon */
1986
+ padding-right: ${Be=>Be.tokens.spacing[9]||"44px"};
1987
1987
  min-height: 57px;
1988
1988
  }
1989
1989
  &[type='date']::-webkit-calendar-picker-indicator {
@@ -2000,6 +2000,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2000
2000
  &[type='date']:focus,
2001
2001
  &[type='date'][data-has-value='true'] {
2002
2002
  color: ${Be=>Be.color||Be.tokens.input.primary.text.field.default};
2003
+ outline-color: #3db0f7 !important;
2003
2004
  }
2004
2005
  `,Input$c=React.forwardRef((Be,Le)=>{const Ye=useTokens(),{as:tt,...nt}=Be;return jsx$1(StyledInput,{className:"styled-input",tokens:Ye,as:tt||"input",...nt,ref:Le})}),spacerCustomProps=["size","width","height","w","h","xsSize","smSize","mdSize","xsWidth","smWidth","mdWidth","xsHeight","smHeight","mdHeight","xsW","smW","mdW","xsH","smH","mdH","direction","flex","$tokens"],StyledSpacer=styled("div",{shouldForwardProp:Be=>!spacerCustomProps.includes(Be)&&Be!=="theme"&&Be!=="as"})`
2005
2006
  /* Base spacer styles */
@@ -2151,7 +2152,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2151
2152
  max-width: ${Be=>Be.maxW||"800px"};
2152
2153
  max-height: ${Be=>Be.maxH||"840px"};
2153
2154
  }
2154
- `,Header$4=({hideHeaderBranding:Be,logo:Le,closeButton:Ye})=>{const tt=useTokens(),nt=typeof(Le==null?void 0:Le.height)=="number"?tt.spacing[Le.height]:Le==null?void 0:Le.height,ft=(Ye==null?void 0:Ye.offset)!==void 0?typeof Ye.offset=="string"?Ye.offset:tt.spacing[Ye.offset]:tt.spacing[6],ht=()=>{var At,xt;if(!window.confirm("Are you sure you want to quit?")){(At=Ye==null?void 0:Ye.onCancel)==null||At.call(Ye);return}(xt=Ye==null?void 0:Ye.onClose)==null||xt.call(Ye)};return jsxs(FlexCenter,{as:"header",px:"6px",minH:"38px",h:"44px",wFull:!0,position:"relative",children:[Be?null:jsx$1(Image$f,{src:(Le==null?void 0:Le.src)??incodeLogoDataUri,alt:"Logo",h:nt||tt.spacing[5]}),Ye!=null&&Ye.show?jsx$1(Box,{as:"button",onClick:ht,position:"absolute",right:((Ye==null?void 0:Ye.position)??"right")==="right"?ft:void 0,left:((Ye==null?void 0:Ye.position)??"right")==="left"?ft:void 0,top:"50%",transform:"translateY(-50%)",backgroundColor:"transparent",border:"none",p:0,zIndex:1e4,children:jsx$1(XIcon,{color:Ye==null?void 0:Ye.color})}):null]})},Page$1=({children:Be,title:Le,subtitle:Ye,px:tt=6,py:nt=2,p:ft,bg:ht,maxW:gt,maxH:At,logo:xt={src:incodeLogoDataUri,height:5},hideFooterBranding:yt=!1,hideHeaderBranding:Ct=!1,closeButton:Et,"data-testid":vt,position:kt})=>{const bt=Le||Ye,wt=useTokens();return jsx$1(Flex,{minH:"100%",wFull:!0,bg:ht||wt.color.surface.neutral.light,position:kt,...vt?{"data-testid":vt}:{},children:jsxs(PageContent,{p:ft,pt:0,pb:0,px:ft===void 0&&tt!==void 0?wt.spacing[tt]:void 0,py:ft===void 0&&nt!==void 0?wt.spacing[nt]:void 0,maxW:gt,maxH:At,children:[!Ct||Et!=null&&Et.show?jsx$1(Header$4,{hideHeaderBranding:Ct,logo:xt,closeButton:Et}):null,bt?jsx$1(Spacer,{size:Ct?wt.spacing[2]:wt.spacing[6]}):null,bt?jsxs(Box,{m:"0 auto",children:[Le?jsx$1(Title$p,{maxW:"275px",m:"0 auto",children:Le}):null,Ye?jsxs(Fragment,{children:[jsx$1(Spacer,{size:wt.spacing[3]}),jsx$1(Text$8,{as:"p",textAlign:"center",color:wt.color.text.body.secondary,lineHeight:"114%",fontWeight:500,letterSpacing:"-0.5px",fontSize:wt.typography.fontSize.base,p:0,m:0,children:Ye})]}):null]}):null,jsx$1(Flex,{flex:1,direction:"column",children:Be}),yt?null:jsx$1(Flex,{justify:"center",align:"center",pb:wt.spacing[3],pt:wt.spacing[2],children:jsx$1(Box,{maxH:wt.spacing[10],children:jsx$1(VerifiedLogo,{})})})]})})},ErrorIcon$1=({size:Be})=>{const Le=useTokens();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Be||"32",height:Be||"32",viewBox:"0 0 32 32",fill:"none",children:[jsx$1("title",{children:"Error"}),jsx$1("path",{d:"M16 0C24.8219 0 32 7.17642 32 16C32 24.8219 24.8219 32 16 32C7.17811 32 0 24.8219 0 16C0 7.17642 7.17811 0 16 0ZM13.1553 11.3701C12.6618 10.8767 11.8636 10.8767 11.3701 11.3701C10.8767 11.8636 10.8767 12.6618 11.3701 13.1553L14.4053 16.1924L11.3721 19.2256C10.8803 19.7191 10.8803 20.5173 11.3721 21.0107C11.8656 21.504 12.6658 21.5041 13.1592 21.0107L16.1924 17.9775L19.2334 21.0205C19.481 21.2664 19.8029 21.3916 20.1279 21.3916C20.4513 21.3916 20.7746 21.2664 21.0205 21.0205C21.514 20.527 21.514 19.7269 21.0205 19.2334L17.9775 16.1924L21.0107 13.1572C21.5041 12.6638 21.504 11.8639 21.0107 11.3721C20.5173 10.8786 19.7191 10.8786 19.2256 11.3721L16.1904 14.4053L13.1553 11.3701Z",fill:Le.color.surface.status.negative})]})},SuccessIcon$1=({size:Be})=>{const Le=useTokens();return jsxs("svg",{width:Be,height:Be,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"status"}),jsx$1("path",{d:"M8 0.5C12.4182 0.500064 16 4.0818 16 8.5C16 12.9182 12.4181 16.4999 8 16.5C3.58181 16.5 3.68521e-05 12.9182 0 8.5C0 4.08176 3.58179 0.5 8 0.5ZM11.1748 6.11621C10.9423 5.88373 10.5747 5.86781 10.3242 6.06934L10.3203 6.07324L10.2764 6.1123L6.85742 9.53125L5.72656 8.40039C5.47758 8.1514 5.0732 8.1514 4.82422 8.40039C4.59169 8.63292 4.57673 9.00038 4.77832 9.25098L4.78125 9.25488L4.82031 9.29883L6.40625 10.8848C6.63867 11.117 7.00542 11.1319 7.25586 10.9307L7.26074 10.9277L7.30371 10.8877L11.1748 7.01758C11.4235 6.76863 11.4234 6.36521 11.1748 6.11621Z",fill:Le.color.icon.success})]})},WarningIcon=()=>{const Be=useTokens();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[jsx$1("title",{children:"Warning"}),jsx$1("g",{clipPath:"url(#clip0)",children:jsx$1("path",{d:"M16 0C24.848 0 32 7.1696 32 16C32 24.8336 24.848 32 16 32C7.168 32 0 24.8336 0 16C0 7.1696 7.168 0 16 0ZM16 20.6896C15.232 20.6896 14.608 21.3136 14.608 22.0816C14.608 22.8496 15.232 23.4896 16.016 23.4896C16.784 23.4896 17.408 22.8496 17.408 22.0816C17.408 21.3136 16.784 20.6896 16 20.6896ZM16 8.528C15.232 8.528 14.592 9.1696 14.592 9.936V17.008C14.592 17.7776 15.232 18.4 16 18.4C16.768 18.4 17.392 17.7776 17.392 17.008V9.936C17.392 9.1696 16.768 8.528 16 8.528Z",fill:Be.color.surface.status.warning})}),jsx$1("defs",{children:jsx$1("clipPath",{id:"clip0",children:jsx$1("rect",{width:"32",height:"32",fill:"white"})})})]})},LocationActiveIcon=({color:Be})=>jsxs("svg",{width:"342",height:"371",viewBox:"0 0 342 371",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Location Active"}),jsx$1("path",{d:"M196.828 134.876L141.896 166.816L125.257 317.465L216.5 285.791L196.828 134.876Z",fill:"url(#paint0_linear_2130_1701)"}),jsx$1("path",{d:"M260.015 166.283L196.828 134.876L216.499 285.791L316 317.465L260.018 166.283H260.015Z",fill:"url(#paint1_linear_2130_1701)"}),jsx$1("path",{d:"M141.896 166.82L93.9483 135.525L41 285.906L125.261 317.468L141.899 166.82H141.896Z",fill:"url(#paint2_linear_2130_1701)"}),jsx$1("g",{opacity:"0.8",children:jsx$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M125.583 247.829C125.919 245.294 128.511 244.23 131.39 245.455H131.394C131.995 245.712 132.574 246.047 133.103 246.448C134.79 246.26 136.059 246.859 136.407 248.151C139.023 257.457 149.374 261.678 162.979 259.044C165.545 258.543 167.331 259.69 167.322 261.804L167.22 283.275C167.207 285.814 164.404 288.87 160.936 290.101H160.933L126.998 301.748V301.752L126.993 301.75L126.989 301.752V301.748L124.945 301.014C121.543 299.785 119.079 296.736 119.414 294.201L125.583 247.829ZM87.9309 198.19C88.6744 195.658 91.0562 194.594 93.2737 195.812L116.851 208.092C119.322 209.313 121.003 212.356 120.585 214.891L108.182 290.006H108.175C107.757 292.538 104.757 293.602 101.496 292.374L69.9699 280.035C66.9662 278.81 65.1463 275.764 65.8899 273.232L87.9309 198.19ZM231.328 254.276C230.855 251.738 233.158 250.67 236.49 251.898L271.33 264.26C274.916 265.488 278.5 268.551 279.299 271.093L285.171 289.753C285.97 292.295 283.48 293.358 279.631 292.127L242.173 279.746C238.58 278.518 235.293 275.459 234.816 272.92L231.328 254.276ZM214.447 270.052L184.855 281.425C181.525 282.659 178.755 281.6 178.686 279.064L178.094 257.256C178.038 255.204 179.627 252.738 181.98 251.221C193.873 243.311 202.161 231.214 203.954 219.524H203.951C204.228 217.585 205.514 215.638 207.201 214.479L214.447 270.052ZM207.205 214.476C207.528 214.559 207.863 214.671 208.208 214.815L209.656 215.425C212.594 216.65 215.308 219.705 215.703 222.244L222.915 268.719C223.31 271.257 220.81 272.321 217.352 271.093V271.086L214.449 270.049L207.205 214.476ZM214.002 161.686C213.528 159.148 215.128 158.077 217.599 159.296L243.726 171.595C246.447 172.816 249.326 175.872 250.125 178.414L273.854 253.792C274.653 256.334 272.436 257.401 268.922 256.173L234.842 243.818C231.585 242.593 228.571 239.534 228.094 236.995L214.002 161.686ZM171.461 203.623C183.99 197.597 194.663 202.721 195.788 215.072C196.917 227.423 186.421 242.313 171.856 248.322C156.744 254.328 144.83 249.195 145.739 236.86H145.742C146.651 224.526 158.386 209.645 171.461 203.623ZM163.548 169.859C165.891 168.618 167.763 169.671 167.75 172.207L167.648 193.755C167.638 195.865 166.151 198.417 164.026 199.919C152.504 207.789 142.38 220.295 138.007 232.356L138 232.359C137.374 234.037 135.909 235.721 134.161 236.887L134.16 236.896C134.157 236.896 134.153 236.895 134.15 236.894L134.148 236.896V236.894C133.606 236.828 133.037 236.674 132.463 236.423L132.44 236.413C129.646 235.188 127.672 232.142 128.008 229.606L134.177 183.231L134.18 183.234C134.519 180.699 136.618 179.635 138.892 180.853L140.264 181.584L163.548 169.859ZM200.703 150.702C203.036 151.924 205.261 154.972 205.655 157.511L212.867 203.982C213.259 206.524 211.249 207.591 208.4 206.366L206.972 205.75V205.747C206.643 205.605 206.32 205.438 205.997 205.247L198.753 149.671L200.703 150.702ZM205.997 205.247C204.283 205.754 202.737 205.177 202.075 203.685C198.226 194.742 189.783 190.537 179.693 192.635C177.722 193.04 176.317 191.907 176.261 189.849L175.665 167.963L175.662 167.966C175.593 165.427 177.34 162.364 179.541 161.123L198.752 149.671L205.997 205.247ZM98.4397 162.394C99.1832 159.862 101.292 158.795 103.174 160.014L123.369 172.269C125.504 173.488 126.912 176.53 126.494 179.065L123.425 197.66V197.657C123.007 200.189 120.707 201.256 118.312 200.034L95.4983 187.762C93.3597 186.543 92.241 183.501 92.9846 180.969L98.4397 162.394Z",fill:"url(#paint3_linear_2130_1701)"})}),jsx$1("g",{filter:"url(#filter0_f_2130_1701)",children:jsx$1("ellipse",{cx:"184.221",cy:"184.765",rx:"15",ry:"3",transform:"rotate(-17.0433 184.221 184.765)",fill:"url(#paint4_linear_2130_1701)",fillOpacity:"0.71"})}),jsx$1("path",{d:"M171.417 46.5C146.334 46.5 126 66.8379 126 91.9252C126 117.013 171.417 189.109 171.417 189.109C171.417 189.109 216.834 117.014 216.834 91.9252C216.834 66.8363 196.499 46.5 171.417 46.5ZM171.417 111.788C160.449 111.788 151.558 102.895 151.558 91.9252C151.558 80.9552 160.449 72.0623 171.417 72.0623C182.385 72.0623 191.276 80.9552 191.276 91.9252C191.276 102.895 182.385 111.788 171.417 111.788Z",fill:Be}),jsxs("defs",{children:[jsxs("filter",{id:"filter0_f_2130_1701",x:"165.852",y:"175.515",width:"36.7373",height:"18.4999",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsx$1("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),jsx$1("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsx$1("feGaussianBlur",{stdDeviation:"2",result:"effect1_foregroundBlur_2130_1701"})]}),jsxs("linearGradient",{id:"paint0_linear_2130_1701",x1:"220.984",y1:"226.498",x2:"26.1221",y2:"225.43",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:"#CFCECE"}),jsx$1("stop",{offset:"1",stopColor:"white"})]}),jsxs("linearGradient",{id:"paint1_linear_2130_1701",x1:"332.441",y1:"278.402",x2:"171.874",y2:"189.271",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:"#CFCECE"}),jsx$1("stop",{offset:"1",stopColor:"white"})]}),jsxs("linearGradient",{id:"paint2_linear_2130_1701",x1:"119.223",y1:"239.488",x2:"68.0849",y2:"211.1",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:"#DADADA"}),jsx$1("stop",{offset:"1",stopColor:"white"})]}),jsxs("linearGradient",{id:"paint3_linear_2130_1701",x1:"127.639",y1:"300.042",x2:"135.977",y2:"178.948",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:Be,stopOpacity:"0.15"}),jsx$1("stop",{offset:"1",stopColor:Be})]}),jsxs("linearGradient",{id:"paint4_linear_2130_1701",x1:"169.221",y1:"184.765",x2:"199.221",y2:"184.765",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{offset:"0.153846",stopColor:"#737373"}),jsx$1("stop",{offset:"1",stopColor:"#737373",stopOpacity:"0"})]})]})]}),LocationUnactiveIcon=()=>jsxs("svg",{width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Location Unactive"}),jsx$1("path",{d:"M185.828 109.572L130.896 141.512L114.257 292.16L205.5 260.487L185.828 109.572Z",fill:"url(#paint0_linear_2156_2062)"}),jsx$1("path",{d:"M249.015 140.979L185.828 109.572L205.5 260.487L305 292.16L249.018 140.979H249.015Z",fill:"url(#paint1_linear_2156_2062)"}),jsx$1("path",{d:"M130.896 141.515L82.9483 110.221L30 260.602L114.261 292.163L130.899 141.515H130.896Z",fill:"url(#paint2_linear_2156_2062)"}),jsx$1("g",{opacity:"0.8",children:jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M114.583 222.525C114.919 219.989 117.511 218.926 120.39 220.151H120.394C120.995 220.407 121.574 220.743 122.103 221.144C123.79 220.956 125.059 221.555 125.407 222.847C128.023 232.152 138.374 236.374 151.979 233.74C154.545 233.239 156.331 234.385 156.322 236.499L156.22 257.971C156.207 260.51 153.404 263.566 149.936 264.797H149.933L115.998 276.444V276.448L115.993 276.446L115.989 276.448V276.444L113.945 275.709C110.543 274.481 108.079 271.432 108.414 268.897L114.583 222.525ZM76.9309 172.886C77.6744 170.354 80.0562 169.29 82.2737 170.508L105.851 182.787C108.322 184.009 110.003 187.052 109.585 189.587L97.1819 264.702H97.175C96.7572 267.234 93.7567 268.298 90.4963 267.07L58.9699 254.731C55.9662 253.506 54.1463 250.46 54.8899 247.928L76.9309 172.886ZM220.328 228.972C219.855 226.433 222.158 225.366 225.49 226.594L260.33 238.955C263.916 240.184 267.5 243.246 268.299 245.788L274.171 264.449C274.97 266.99 272.48 268.054 268.631 266.823L231.173 254.442C227.58 253.214 224.293 250.154 223.816 247.616L220.328 228.972ZM203.447 244.747L173.855 256.12C170.525 257.355 167.755 256.295 167.686 253.76L167.094 231.952C167.038 229.9 168.627 227.434 170.98 225.916C182.873 218.007 191.161 205.909 192.954 194.22H192.951C193.228 192.281 194.514 190.334 196.201 189.175L203.447 244.747ZM196.205 189.172C196.528 189.255 196.863 189.366 197.208 189.511L198.656 190.12C201.594 191.345 204.308 194.401 204.703 196.94L211.915 243.414C212.31 245.953 209.81 247.017 206.352 245.788V245.782L203.449 244.745L196.205 189.172ZM203.002 136.382C202.528 133.843 204.128 132.773 206.599 133.992L232.726 146.29C235.447 147.512 238.326 150.568 239.125 153.11L262.854 228.488C263.653 231.03 261.436 232.096 257.922 230.869L223.842 218.514C220.585 217.289 217.571 214.229 217.094 211.691L203.002 136.382ZM160.461 178.319C172.99 172.293 183.663 177.417 184.788 189.768C185.917 202.119 175.421 217.009 160.856 223.018C145.744 229.024 133.83 223.891 134.739 211.556H134.742C135.651 199.221 147.386 184.341 160.461 178.319ZM152.548 144.555C154.891 143.314 156.763 144.367 156.75 146.903L156.648 168.451C156.638 170.561 155.151 173.113 153.026 174.615C141.504 182.484 131.38 194.991 127.007 207.052L127 207.055C126.374 208.733 124.909 210.417 123.161 211.582L123.16 211.592C123.157 211.592 123.153 211.591 123.15 211.59L123.148 211.592V211.59C122.606 211.523 122.037 211.37 121.463 211.119L121.44 211.109C118.646 209.884 116.672 206.838 117.008 204.302L123.177 157.927L123.18 157.93C123.519 155.395 125.618 154.331 127.892 155.549L129.264 156.28L152.548 144.555ZM189.703 125.398C192.036 126.619 194.261 129.668 194.655 132.206L201.867 178.678C202.259 181.22 200.249 182.287 197.4 181.062L195.972 180.446V180.443C195.643 180.301 195.32 180.134 194.997 179.943L187.753 124.367L189.703 125.398ZM194.997 179.943C193.283 180.45 191.737 179.873 191.075 178.381C187.226 169.438 178.783 165.233 168.693 167.33C166.722 167.735 165.317 166.603 165.261 164.545L164.665 142.659L164.662 142.661C164.593 140.123 166.34 137.06 168.541 135.819L187.752 124.367L194.997 179.943ZM87.4397 137.09C88.1832 134.558 90.2921 133.491 92.174 134.709L112.369 146.965C114.504 148.184 115.912 151.226 115.494 153.761L112.425 172.356V172.353C112.007 174.885 109.707 175.951 107.312 174.73L84.4983 162.457C82.3597 161.239 81.241 158.197 81.9846 155.664L87.4397 137.09Z",fill:"url(#paint3_linear_2156_2062)"})}),jsx$1("g",{filter:"url(#filter0_f_2156_2062)",children:jsx$1("ellipse",{cx:"173.221",cy:"159.46",rx:"15",ry:"3",transform:"rotate(-17.0433 173.221 159.46)",fill:"url(#paint4_linear_2156_2062)","fill-opacity":"0.71"})}),jsx$1("path",{d:"M160.417 21C135.288 21 114.917 41.3937 114.917 66.5498C114.917 91.706 160.417 164 160.417 164C160.417 164 205.917 91.7075 205.917 66.5498C205.917 41.3921 185.545 21 160.417 21ZM183.33 79.2663L173.119 89.4886L160.418 76.7737L147.717 89.4886L137.506 79.2663L150.207 66.5514L137.506 53.8365L147.717 43.6141L160.418 56.329L173.119 43.6141L183.33 53.8365L170.629 66.5514L183.33 79.2663Z",fill:"url(#paint5_linear_2156_2062)"}),jsxs("defs",{children:[jsxs("filter",{id:"filter0_f_2156_2062",x:"154.852",y:"150.21",width:"36.7373",height:"18.4999",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB",children:[jsx$1("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),jsx$1("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsx$1("feGaussianBlur",{stdDeviation:"2",result:"effect1_foregroundBlur_2156_2062"})]}),jsxs("linearGradient",{id:"paint0_linear_2156_2062",x1:"209.984",y1:"201.194",x2:"15.1221",y2:"200.125",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#CFCECE"}),jsx$1("stop",{offset:"1","stop-color":"white"})]}),jsxs("linearGradient",{id:"paint1_linear_2156_2062",x1:"321.441",y1:"253.098",x2:"160.874",y2:"163.966",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#CFCECE"}),jsx$1("stop",{offset:"1","stop-color":"white"})]}),jsxs("linearGradient",{id:"paint2_linear_2156_2062",x1:"108.223",y1:"214.184",x2:"57.0849",y2:"185.795",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#DADADA"}),jsx$1("stop",{offset:"1","stop-color":"white"})]}),jsxs("linearGradient",{id:"paint3_linear_2156_2062",x1:"116.639",y1:"274.738",x2:"124.977",y2:"153.644",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#A0A0A0","stop-opacity":"0.15"}),jsx$1("stop",{offset:"1","stop-color":"#A0A0A0"})]}),jsxs("linearGradient",{id:"paint4_linear_2156_2062",x1:"158.221",y1:"159.46",x2:"188.221",y2:"159.46",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{offset:"0.153846","stop-color":"#737373"}),jsx$1("stop",{offset:"1","stop-color":"#737373","stop-opacity":"0"})]}),jsxs("linearGradient",{id:"paint5_linear_2156_2062",x1:"160.417",y1:"21",x2:"160.417",y2:"164",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#E0E0E0"}),jsx$1("stop",{offset:"1","stop-color":"#949497"})]})]})]}),UpArrow=()=>jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Up Arrow"}),jsx$1("path",{d:"M19.2327 14.8193C19.6084 15.2239 19.5853 15.8566 19.1809 16.2324C18.7763 16.6081 18.1437 16.5851 17.7678 16.1807L12.0002 9.96875L6.23266 16.1807L6.15942 16.252C5.77876 16.5865 5.19892 16.5847 4.81957 16.2324C4.41515 15.8566 4.3921 15.2239 4.76781 14.8193L11.2678 7.81934C11.457 7.61576 11.7223 7.5 12.0002 7.5C12.2782 7.5 12.5435 7.61576 12.7327 7.81934L19.2327 14.8193Z",fill:"#60667C"})]}),DownArrow=()=>jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Down Arrow"}),jsx$1("path",{d:"M4.76734 9.18066C4.39163 8.77605 4.41468 8.14342 4.8191 7.76758C5.22371 7.39187 5.85635 7.41491 6.23219 7.81934L11.9998 14.0312L17.7673 7.81934L17.8406 7.74805C18.2212 7.41355 18.8011 7.41532 19.1804 7.76758C19.5849 8.14341 19.6079 8.77605 19.2322 9.18066L12.7322 16.1807C12.543 16.3842 12.2777 16.5 11.9998 16.5C11.7218 16.5 11.4565 16.3842 11.2673 16.1807L4.76734 9.18066Z",fill:"#60667C"})]}),InputComposed=React.forwardRef(({label:Be,type:Le,error:Ye,showErrorIcon:tt,helper:nt,showHelperIcon:ft,closeButton:ht,...gt},At)=>{const xt=useTokens();return jsxs(Box,{wFull:!0,maxW:"420px",children:[Be&&jsx$1(Text$8,{fontWeight:700,as:"label",color:xt.input.primary.text.label.default,mb:xt.spacing[2],display:"inline-block",fontSize:"14px",children:Be}),jsxs(Box,{position:"relative",children:[jsx$1(Input$c,{type:Le,p:xt.spacing[4],...gt,ref:At,borderColor:Ye&&xt.input.primary.border.negative,"data-has-value":!!gt.value&&String(gt.value).length>0}),(ht==null?void 0:ht.show)&&jsx$1(Box,{as:"button",position:"absolute",right:xt.spacing[6],top:"50%",transform:"translateY(-50%)",backgroundColor:"transparent",border:"none",p:0,zIndex:1e4,onClick:ht.onClose,children:jsx$1(XIcon,{})})]}),Ye&&jsxs(Flex,{mt:xt.spacing[2],align:"center",children:[tt&&jsx$1(Box,{display:"inline-block",mr:xt.spacing[2],children:jsx$1(ErrorIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",color:xt.input.primary.text.helper.negative,children:Ye})]}),nt&&jsxs(Flex,{mt:xt.spacing[2],align:"center",children:[ft&&jsx$1(Box,{display:"inline-block",mr:xt.spacing[2],children:jsx$1(SuccessIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",fontWeight:400,color:xt.input.primary.text.helper.default,children:nt})]})]})}),DropdownComposed=React.forwardRef(({label:Be,placeholder:Le="Choose an option",value:Ye,onChange:tt,options:nt,error:ft,helper:ht,showErrorIcon:gt,showHelperIcon:At,enterKeyHint:xt,tabIndex:yt,onKeyDown:Ct},Et)=>{const vt=useTokens(),[kt,bt]=React.useState(!1),wt=React.useRef(null),It=React.useRef(null),Rt=React.useRef(null),Tt=nt.find(Dt=>Dt.value===Ye);React.useEffect(()=>{const Dt=Ot=>{wt.current&&!wt.current.contains(Ot.target)&&bt(!1)};return document.addEventListener("mousedown",Dt),document.addEventListener("touchstart",Dt),()=>{document.removeEventListener("mousedown",Dt),document.removeEventListener("touchstart",Dt)}},[]);const Bt=()=>{bt(!kt)},Pt=Dt=>{tt==null||tt(Dt),bt(!1)};return jsxs(Box,{wFull:!0,maxW:"420px",ref:wt,position:"relative",children:[Be&&jsx$1(Text$8,{fontWeight:700,as:"label",color:vt.input.primary.text.label.default,mb:vt.spacing[2],display:"inline-block",fontSize:"14px",children:Be}),jsxs(Box,{position:"relative",children:[jsxs(Flex,{wFull:!0,position:"relative",align:"center",children:[jsx$1(Box,{as:"input",ref:Dt=>{Rt.current=Dt,typeof Et=="function"?Et(Dt):Et&&(Et.current=Dt)},type:"text",readOnly:!0,value:(Tt==null?void 0:Tt.label)||"",placeholder:Le,wFull:!0,p:vt.spacing[4],pr:"48px",backgroundColor:ft?void 0:vt.input.primary.surface.default,borderWidth:"1px",borderColor:ft?vt.input.primary.border.negative:vt.input.primary.border.default,borderRadius:vt.spacing[2],onClick:Bt,onKeyDown:Ct,color:Tt?vt.input.primary.text.field.default:vt.input.primary.text.field.placeholder,fontSize:vt.typography.fontSize.lg,enterKeyHint:xt,tabIndex:yt,style:{cursor:"pointer"}}),jsx$1(Box,{position:"absolute",right:vt.spacing[4],display:"flex",align:"center",onClick:Bt,style:{cursor:"pointer"},children:kt?jsx$1(UpArrow,{}):jsx$1(DownArrow,{})})]}),kt&&jsx$1(Flex,{as:"ul",position:"absolute",top:"100%",left:"0",right:"0",zIndex:10,direction:"column",backgroundColor:vt.input.primary.surface.default,borderWidth:"1px",borderColor:ft?vt.input.primary.border.negative:vt.input.primary.border.default,overflow:"scroll",ref:It,maxH:"320px",mt:"8px",borderRadius:vt.spacing[2],children:nt.map(Dt=>{const Ot=Ye===Dt.value;return jsx$1(Flex,{as:"li",p:vt.spacing[4],backgroundColor:Ot?vt.color.surface.secondary[100]:"transparent",onClick:()=>Pt(Dt.value),onMouseEnter:Lt=>{Ot||(Lt.currentTarget.style.backgroundColor=vt.color.surface.secondary[50])},onMouseLeave:Lt=>{Ot||(Lt.currentTarget.style.backgroundColor="transparent")},children:jsx$1(Text$8,{color:vt.input.primary.text.field.default,fontSize:vt.typography.fontSize.lg,children:Dt.label})},Dt.value)})})]}),ft&&jsxs(Flex,{mt:vt.spacing[2],align:"center",children:[gt&&jsx$1(Box,{display:"inline-block",mr:vt.spacing[2],children:jsx$1(ErrorIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",color:vt.input.primary.text.helper.negative,children:ft})]}),ht&&jsxs(Flex,{mt:vt.spacing[2],align:"center",children:[At&&jsx$1(Box,{display:"inline-block",mr:vt.spacing[2],children:jsx$1(SuccessIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",fontWeight:400,color:vt.input.primary.text.helper.default,children:ht})]})]})}),Subtitle$6=({children:Be,...Le})=>{const Ye=useTokens();return jsx$1(Text$8,{as:"h5",fontSize:Ye.typography.fontSize.base,textAlign:"center",m:Ye.spacing[0],letterSpacing:Ye.typography.letterSpacing.tight,lineHeight:Ye.typography.lineHeight.normal,fontWeight:Ye.typography.fontWeight.medium,color:Ye.color.text.body.secondary,...Le,children:Be})},warn$1=(Be,Le,Ye,tt)=>{var ft,ht,gt,At;const nt=[Ye,{code:Le,...tt||{}}];if((ht=(ft=Be==null?void 0:Be.services)==null?void 0:ft.logger)!=null&&ht.forward)return Be.services.logger.forward(nt,"warn","react-i18next::",!0);isString$3(nt[0])&&(nt[0]=`react-i18next:: ${nt[0]}`),(At=(gt=Be==null?void 0:Be.services)==null?void 0:gt.logger)!=null&&At.warn?Be.services.logger.warn(...nt):console!=null&&console.warn&&console.warn(...nt)},alreadyWarned={},warnOnce=(Be,Le,Ye,tt)=>{isString$3(Ye)&&alreadyWarned[Ye]||(isString$3(Ye)&&(alreadyWarned[Ye]=new Date),warn$1(Be,Le,Ye,tt))},loadedClb=(Be,Le)=>()=>{if(Be.isInitialized)Le();else{const Ye=()=>{setTimeout(()=>{Be.off("initialized",Ye)},0),Le()};Be.on("initialized",Ye)}},loadNamespaces=(Be,Le,Ye)=>{Be.loadNamespaces(Le,loadedClb(Be,Ye))},loadLanguages=(Be,Le,Ye,tt)=>{if(isString$3(Ye)&&(Ye=[Ye]),Be.options.preload&&Be.options.preload.indexOf(Le)>-1)return loadNamespaces(Be,Ye,tt);Ye.forEach(nt=>{Be.options.ns.indexOf(nt)<0&&Be.options.ns.push(nt)}),Be.loadLanguages(Le,loadedClb(Be,tt))},hasLoadedNamespace=(Be,Le,Ye={})=>!Le.languages||!Le.languages.length?(warnOnce(Le,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:Le.languages}),!0):Le.hasLoadedNamespace(Be,{lng:Ye.lng,precheck:(tt,nt)=>{if(Ye.bindI18n&&Ye.bindI18n.indexOf("languageChanging")>-1&&tt.services.backendConnector.backend&&tt.isLanguageChangingTo&&!nt(tt.isLanguageChangingTo,Be))return!1}}),isString$3=Be=>typeof Be=="string",isObject$8=Be=>typeof Be=="object"&&Be!==null,matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity=Be=>htmlEntities[Be],unescape$1=Be=>Be.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions$1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1};const getDefaults=()=>defaultOptions$1;let i18nInstance;const getI18n=()=>i18nInstance,I18nContext=React.createContext();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(Le){Le.forEach(Ye=>{this.usedNamespaces[Ye]||(this.usedNamespaces[Ye]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const usePrevious=(Be,Le)=>{const Ye=React.useRef();return React.useEffect(()=>{Ye.current=Be},[Be,Le]),Ye.current},alwaysNewT=(Be,Le,Ye,tt)=>Be.getFixedT(Le,Ye,tt),useMemoizedT=(Be,Le,Ye,tt)=>React.useCallback(alwaysNewT(Be,Le,Ye,tt),[Be,Le,Ye,tt]),useTranslation=(Be,Le={})=>{var Bt,Pt,Dt,Ot;const{i18n:Ye}=Le,{i18n:tt,defaultNS:nt}=React.useContext(I18nContext)||{},ft=Ye||tt||getI18n();if(ft&&!ft.reportNamespaces&&(ft.reportNamespaces=new ReportNamespaces),!ft){warnOnce(ft,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const Lt=($t,qt)=>isString$3(qt)?qt:isObject$8(qt)&&isString$3(qt.defaultValue)?qt.defaultValue:Array.isArray($t)?$t[$t.length-1]:$t,Wt=[Lt,{},!1];return Wt.t=Lt,Wt.i18n={},Wt.ready=!1,Wt}(Bt=ft.options.react)!=null&&Bt.wait&&warnOnce(ft,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const ht={...getDefaults(),...ft.options.react,...Le},{useSuspense:gt,keyPrefix:At}=ht;let xt=nt||((Pt=ft.options)==null?void 0:Pt.defaultNS);xt=isString$3(xt)?[xt]:xt||["translation"],(Ot=(Dt=ft.reportNamespaces).addUsedNamespaces)==null||Ot.call(Dt,xt);const yt=(ft.isInitialized||ft.initializedStoreOnce)&&xt.every(Lt=>hasLoadedNamespace(Lt,ft,ht)),Ct=useMemoizedT(ft,Le.lng||null,ht.nsMode==="fallback"?xt:xt[0],At),Et=()=>Ct,vt=()=>alwaysNewT(ft,Le.lng||null,ht.nsMode==="fallback"?xt:xt[0],At),[kt,bt]=React.useState(Et);let wt=xt.join();Le.lng&&(wt=`${Le.lng}${wt}`);const It=usePrevious(wt),Rt=React.useRef(!0);React.useEffect(()=>{const{bindI18n:Lt,bindI18nStore:Wt}=ht;Rt.current=!0,!yt&&!gt&&(Le.lng?loadLanguages(ft,Le.lng,xt,()=>{Rt.current&&bt(vt)}):loadNamespaces(ft,xt,()=>{Rt.current&&bt(vt)})),yt&&It&&It!==wt&&Rt.current&&bt(vt);const $t=()=>{Rt.current&&bt(vt)};return Lt&&(ft==null||ft.on(Lt,$t)),Wt&&(ft==null||ft.store.on(Wt,$t)),()=>{Rt.current=!1,ft&&Lt&&(Lt==null||Lt.split(" ").forEach(qt=>ft.off(qt,$t))),Wt&&ft&&Wt.split(" ").forEach(qt=>ft.store.off(qt,$t))}},[ft,wt]),React.useEffect(()=>{Rt.current&&yt&&bt(Et)},[ft,At,yt]);const Tt=[kt,ft,yt];if(Tt.t=kt,Tt.i18n=ft,Tt.ready=yt,yt||!yt&&!gt)return Tt;throw new Promise(Lt=>{Le.lng?loadLanguages(ft,Le.lng,xt,()=>Lt()):loadNamespaces(ft,xt,()=>Lt())})};function I18nextProvider({i18n:Be,defaultNS:Le,children:Ye}){const tt=React.useMemo(()=>({i18n:Be,defaultNS:Le}),[Be,Le]);return React.createElement(I18nContext.Provider,{value:tt},Ye)}const isObject$7=Be=>typeof Be=="object"&&Be!==null&&!Array.isArray(Be),deepMerge$1=(Be,Le)=>{const Ye={...Be};for(const tt of Object.keys(Le)){const nt=Le[tt],ft=Ye[tt];isObject$7(ft)&&isObject$7(nt)?Ye[tt]=deepMerge$1(ft,nt):Ye[tt]=nt}return Ye},mergeWithOverrides=(Be,Le)=>Le?deepMerge$1(Be,Le):Be,colors={neutral:{light:"#ffffff",dark:"#000000"},brand:{50:"#e5f0ff",200:"#99c3ff",300:"#66a6ff",400:"#3388ff",500:"#006aff",600:"#0055cc",900:"#21273b"},gray:{50:"#fcfcfd",100:"#ebecef",200:"#c6c8d2",300:"#a3a8B8",500:"#60667c",700:"#3a3e4b",800:"#262831",900:"#14151a"},brandSecondary:{50:"#f2e2fe",500:"#820AD1"},positive:{50:"#E4FBF0",600:"#189F60",800:"#0C5030"},warn:{50:"#FFF7EB",400:"#FFB647",500:"#ff9900",950:"#523100"},negative:{50:"#FFF0F0",500:"#FF5A5F",600:"#E71111",950:"#240001"}},buildReferenceColors=Be=>({brand:{brand:Be.brand[500]},surface:{neutral:{light:Be.neutral.light,dark:Be.neutral.dark},primary:{50:Be.brand[50],400:Be.brand[400],500:Be.brand[500],600:Be.brand[600]},secondary:{0:Be.neutral.light,50:Be.gray[50],100:Be.gray[100],200:Be.gray[200],300:Be.gray[300],500:Be.gray[500],700:Be.gray[700],800:Be.gray[800],900:Be.gray[900]},statusSoft:{negative:Be.negative[50],warning:Be.warn[50],positive:Be.positive[50]},status:{negative:Be.negative[600],warning:Be.warn[500],positive:Be.positive[600]}},icon:{primary:Be.gray[500],secondary:Be.gray[800],accent:Be.brand[500],negative:Be.negative[600],warning:Be.warn[500],positive:Be.positive[600],invert:Be.neutral.light,success:Be.positive[600]},border:{primary:Be.gray[100],disabled:Be.gray[300],focus:Be.gray[500],accent:Be.brand[500],negative:Be.negative[500],warning:Be.warn[500],positive:Be.positive[600]},text:{body:{primary:Be.gray[800],secondary:Be.gray[500],tertiary:Be.gray[300],invert:Be.neutral.light},brand:{accent:Be.brand[500],brandSecondary:Be.brandSecondary[500]},status:{negative:Be.negative[500],warning:Be.warn[500],positive:Be.positive[600]}}}),lightColors=buildReferenceColors(colors),buildReferenceWithOverrides=(Be,Le)=>mergeWithOverrides(buildReferenceColors(Be),Le);colors.brand[500],colors.neutral.dark,colors.neutral.light,colors.brand[900],colors.brand[600],colors.brand[500],colors.brand[400],colors.neutral.dark,colors.gray[900],colors.gray[800],colors.gray[700],colors.gray[500],colors.gray[300],colors.gray[200],colors.gray[100],colors.gray[50],colors.negative[950],colors.warn[950],colors.positive[800],colors.negative[600],colors.warn[500],colors.positive[600],colors.gray[500],colors.gray[200],colors.brand[500],colors.negative[600],colors.warn[500],colors.positive[600],colors.gray[900],colors.gray[700],colors.gray[500],colors.brand[500],colors.negative[600],colors.warn[500],colors.positive[600],colors.gray[200],colors.gray[500],colors.gray[700],colors.neutral.light,colors.brand[500],colors.brandSecondary[500],colors.negative[600],colors.warn[500],colors.positive[600];const buildButtonTokens=(Be,Le)=>mergeWithOverrides(buildButtonBase(Be),Le),buildButtonBase=Be=>({primary:{surface:{default:Be.surface.primary[500],hover:Be.surface.primary[400],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[100]},text:{default:Be.text.body.invert,disabled:Be.text.body.tertiary},border:{default:Be.surface.primary[500],hover:Be.surface.primary[400],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[100]}},secondary:{surface:{default:Be.surface.neutral.light,hover:Be.surface.primary[50],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[200]},text:{default:Be.text.brand.accent,disabled:Be.text.body.secondary},border:{default:Be.surface.primary[500],hover:Be.surface.primary[400],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[100]}},tertiary:{text:Be.surface.primary[500],disabled:Be.surface.secondary[500]}}),button=buildButtonTokens(lightColors),buildInputTokens=(Be,Le)=>mergeWithOverrides(buildInputBase(Be),Le),buildInputBase=Be=>({primary:{surface:{default:Be.surface.secondary[50],hover:Be.surface.secondary[50],active:Be.surface.secondary[50],disabled:Be.surface.secondary[100]},text:{label:{default:Be.text.body.primary,disabled:Be.text.body.tertiary},field:{default:Be.text.body.primary,disabled:Be.text.body.tertiary,placeholder:Be.text.body.tertiary},helper:{default:Be.text.body.secondary,disabled:Be.text.body.tertiary,negative:Be.text.status.negative}},border:{default:Be.border.primary,active:Be.border.accent,disabled:Be.border.primary,negative:Be.border.negative}}}),input=buildInputTokens(lightColors),buildSpinnerTokens=(Be,Le)=>mergeWithOverrides(buildSpinnerBase(Be),Le),buildSpinnerBase=Be=>({surface:{primary:Be.surface.primary[500],secondary:Be.surface.primary[50]},text:{primary:Be.text.body.primary,secondary:Be.text.body.secondary}}),spinner$3=buildSpinnerTokens(lightColors),animations={duration:{fast:"150ms",normal:"300ms",slow:"500ms"},easing:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"}},shadows={none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",base:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},spacing$1={"-1":"-0.25rem",0:"0",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem",32:"8rem",40:"10rem",48:"12rem",56:"14rem",64:"16rem"},typography$1={fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},letterSpacing:{tighter:"-2px",tight:"-1px",normal:"0",wide:"1px",wider:"2px",widest:"4px"},fontFamily:{sans:['"DM Sans"',"system-ui","sans-serif"],mono:["Fira Code","monospace"]}},spacing={component:{xs:spacing$1[1],sm:spacing$1[2],md:spacing$1[3],lg:spacing$1[4],xl:spacing$1[6]},layout:{xs:spacing$1[4],sm:spacing$1[6],md:spacing$1[8],lg:spacing$1[12],xl:spacing$1[16],xxl:spacing$1[24]},container:{xs:spacing$1[3],sm:spacing$1[4],md:spacing$1[6],lg:spacing$1[8],xl:spacing$1[12]},stack:{xs:spacing$1[2],sm:spacing$1[3],md:spacing$1[4],lg:spacing$1[6],xl:spacing$1[8]},inline:{xs:spacing$1[1],sm:spacing$1[2],md:spacing$1[3],lg:spacing$1[4]}},typography={heading:{h1:{fontSize:typography$1.fontSize["4xl"],fontWeight:typography$1.fontWeight.bold,lineHeight:typography$1.lineHeight.tight},h2:{fontSize:typography$1.fontSize["3xl"],fontWeight:typography$1.fontWeight.bold,lineHeight:typography$1.lineHeight.tight},h3:{fontSize:typography$1.fontSize["2xl"],fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.snug},h4:{fontSize:typography$1.fontSize.xl,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.snug},h5:{fontSize:typography$1.fontSize.lg,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.normal},h6:{fontSize:typography$1.fontSize.base,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.normal}},body:{large:{fontSize:typography$1.fontSize.lg,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.relaxed},default:{fontSize:typography$1.fontSize.base,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.normal},small:{fontSize:typography$1.fontSize.sm,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.normal}},ui:{buttonLarge:{fontSize:typography$1.fontSize.base,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.none},buttonDefault:{fontSize:typography$1.fontSize.sm,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.none},buttonSmall:{fontSize:typography$1.fontSize.xs,fontWeight:typography$1.fontWeight.medium,lineHeight:typography$1.lineHeight.none},label:{fontSize:typography$1.fontSize.sm,fontWeight:typography$1.fontWeight.medium,lineHeight:typography$1.lineHeight.normal},caption:{fontSize:typography$1.fontSize.xs,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.normal}},code:{inline:{fontSize:typography$1.fontSize.sm,fontFamily:typography$1.fontFamily.mono,fontWeight:typography$1.fontWeight.normal},block:{fontSize:typography$1.fontSize.sm,fontFamily:typography$1.fontFamily.mono,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.relaxed}}},tokens={primitives:{color:colors,typography:typography$1,spacing:spacing$1,shadow:shadows,animation:animations},reference:{colors:lightColors,spacing,typography},color:lightColors,typography:typography$1,spacing:spacing$1,button,input,spinner:spinner$3};function hexToHsl(Be){if(typeof Be!="string")throw new Error(`Invalid hex color: expected string, received ${typeof Be}`);if(Be.length!==7)throw new Error(`Invalid hex color: "${Be}" must be exactly 7 characters long (e.g., "#ffffff")`);if(!Be.startsWith("#"))throw new Error(`Invalid hex color: "${Be}" must start with '#'`);const Le=Be.slice(1);if(!/^[0-9A-Fa-f]{6}$/.test(Le))throw new Error(`Invalid hex color: "${Be}" contains invalid hexadecimal digits. Use only 0-9, A-F, or a-f.`);const Ye=Number.parseInt(Be.slice(1,3),16)/255,tt=Number.parseInt(Be.slice(3,5),16)/255,nt=Number.parseInt(Be.slice(5,7),16)/255,ft=Math.max(Ye,tt,nt),ht=Math.min(Ye,tt,nt);let gt=0,At=0;const xt=(ft+ht)/2;if(ft!==ht){const yt=ft-ht;switch(At=xt>.5?yt/(2-ft-ht):yt/(ft+ht),ft){case Ye:gt=(tt-nt)/yt+(tt<nt?6:0);break;case tt:gt=(nt-Ye)/yt+2;break;case nt:gt=(Ye-tt)/yt+4;break}gt/=6}return[gt*360,At*100,xt*100]}function hslToHex(Be,Le,Ye){if(typeof Be!="number"||typeof Le!="number"||typeof Ye!="number")throw new Error(`Invalid HSL values: all parameters must be numbers. Received hue: ${typeof Be}, saturation: ${typeof Le}, lightness: ${typeof Ye}`);if(!Number.isFinite(Be))throw new Error(`Invalid hue value: ${Be}. Hue must be a finite number.`);if(!Number.isFinite(Le))throw new Error(`Invalid saturation value: ${Le}. Saturation must be a finite number.`);if(!Number.isFinite(Ye))throw new Error(`Invalid lightness value: ${Ye}. Lightness must be a finite number.`);if(Be<0||Be>360)throw new Error(`Invalid hue value: ${Be}. Hue must be between 0 and 360 degrees.`);if(Le<0||Le>100)throw new Error(`Invalid saturation value: ${Le}. Saturation must be between 0 and 100.`);if(Ye<0||Ye>100)throw new Error(`Invalid lightness value: ${Ye}. Lightness must be between 0 and 100.`);const tt=Be/360,nt=Le/100,ft=Ye/100,ht=(Ct,Et,vt)=>{let kt=vt;return kt<0&&(kt+=1),kt>1&&(kt-=1),kt<1/6?Ct+(Et-Ct)*6*kt:kt<1/2?Et:kt<2/3?Ct+(Et-Ct)*(2/3-kt)*6:Ct};let gt,At,xt;if(nt===0)gt=ft,At=ft,xt=ft;else{const Ct=ft<.5?ft*(1+nt):ft+nt-ft*nt,Et=2*ft-Ct;gt=ht(Et,Ct,tt+1/3),At=ht(Et,Ct,tt),xt=ht(Et,Ct,tt-1/3)}const yt=Ct=>{const Et=Math.round(Ct*255).toString(16);return Et.length===1?`0${Et}`:Et};return`#${yt(gt)}${yt(At)}${yt(xt)}`}function getBrandColors(Be){if(!Be)return colors.brand;const Le=Be.replace("#","");if(!/^[0-9A-F]{6}$/i.test(Le))throw new Error(`Invalid hex color: ${Be}`);const[Ye,tt,nt]=hexToHsl(`#${Le}`);return{50:hslToHex(Ye,Math.max(tt-10,20),Math.min(nt+45,97)),200:hslToHex(Ye,Math.max(tt-5,30),Math.min(nt+25,85)),300:hslToHex(Ye,tt,Math.min(nt+15,75)),400:hslToHex(Ye,tt,Math.min(nt+8,65)),500:`#${Le}`,600:hslToHex(Ye,Math.min(tt+10,90),Math.max(nt-15,15)),900:hslToHex(Ye,Math.min(tt+20,95),Math.max(nt-35,8))}}function hasOnlyOneColor(Be){return Object.keys(Be).length===1}function isSingle500Color(Be){return hasOnlyOneColor(Be)&&"500"in Be}function getBrandColorKeys(){return["50","200","300","400","500","600","900"]}function smartBrandColorMerging(Be,Le){if(!Be||Object.keys(Be).length===0)return Le;if(isSingle500Color(Be))return getBrandColors(Be[500]);const Ye=getBrandColorKeys(),tt=Object.keys(Be);if(Ye.filter(At=>!tt.includes(At)).length===0)return Be;const ft=Be[500]||Object.values(Be)[0],ht=getBrandColors(ft),gt={50:"",200:"",300:"",400:"",500:"",600:"",900:""};for(const At of Ye)if(Be[At])gt[At]=Be[At];else{const xt=At;gt[At]=ht[xt]}return gt}const buildColorPrimitives=Be=>{const Le=colors,Ye={...Be.colors||{}};return Ye.brand&&(Ye.brand=smartBrandColorMerging(Ye.brand,Le.brand)),mergeWithOverrides(Le,Ye)};function createTokens(Be={}){var gt;const Le=buildColorPrimitives(Be),Ye=buildReferenceWithOverrides(Le,(gt=Be.reference)==null?void 0:gt.colors),tt=mergeWithOverrides(typography$1,Be.typography),nt=buildButtonTokens(Ye,Be.button),ft=buildInputTokens(Ye),ht=buildSpinnerTokens(Ye,Be.spinner);return{primitives:{color:Le,typography:tt,spacing:spacing$1,shadow:shadows,animation:animations},reference:{colors:Ye,spacing,typography},color:Ye,typography:tt,spacing:spacing$1,button:nt,input:ft,spinner:ht}}const validateCustomTokens=Be=>!(!Be||typeof Be!="object"||Be.colors&&(Be.colors.brand&&typeof Be.colors.brand!="object"||Be.colors.gray&&typeof Be.colors.gray!="object"||Be.colors.brandSecondary&&typeof Be.colors.brandSecondary!="object")),ThemeProvider=({children:Be,tokens:Le})=>{let Ye=tokens;if(Le)if(!validateCustomTokens(Le))console.warn("Invalid custom tokens provided to ThemeProvider, falling back to default tokens"),Ye=tokens;else try{Ye=createTokens(Le)}catch(tt){console.error("Error creating custom tokens, falling back to default tokens:",tt),Ye=tokens}return jsx$1(ThemeProvider$1,{theme:Ye,children:jsx$1(I18nextProvider,{i18n,children:Be})})},Card=({image:Be,title:Le,body:Ye,fullImageSize:tt})=>{const nt=useTokens();return jsx$1(Box,{backgroundColor:nt.color.surface.secondary[800],wFull:!0,h:"139px",borderRadius:"24px",xsH:"120px",children:jsxs(Flex,{justify:"center",align:"center",hFull:!0,children:[jsx$1(Box,{m:tt?"0":"15px 0",w:"129px",xsW:"115px",children:jsx$1(Flex,{align:"center",justify:"center",children:Be})}),jsx$1(Flex,{flex:1,children:jsxs(Box,{px:"1rem",children:[jsx$1(Text$8,{color:nt.primitives.color.neutral.light,fontWeight:700,fontSize:nt.typography.fontSize.sm,children:Le}),jsx$1(Text$8,{color:nt.primitives.color.neutral.light,fontWeight:400,fontSize:nt.typography.fontSize.sm,children:Ye})]})})]})})};function ModalRoot({children:Be,fullScreen:Le}){return typeof document>"u"?null:Le?ReactDOM.createPortal(Be,document.body):jsx$1(Fragment,{children:Be})}const Modal$3=({open:Be,children:Le,onClose:Ye,"aria-labelledby":tt,bg:nt="white",fullScreen:ft=!0})=>{const ht=React.useRef(null);if(React.useEffect(()=>{if(!Be)return;const At=xt=>{xt.key==="Escape"&&Ye&&Ye()};return document.addEventListener("keydown",At),ft&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",At),ft&&(document.body.style.overflow="")}},[Be,Ye,ft]),!Be)return null;const gt={ref:ht,"aria-modal":!0,"aria-labelledby":tt,onClick:At=>At.target===At.currentTarget&&(Ye==null?void 0:Ye()),bg:nt,zIndex:1e5,overflow:"scroll"};return jsx$1(ModalRoot,{fullScreen:ft,children:ft?jsx$1(Box,{position:"fixed",inset:0,w:"100vw",h:"100dvh",...gt,children:Le}):jsx$1(Box,{position:"absolute",inset:0,w:"100%",h:"100%",...gt,children:Le})})};function r$1(Be){var Le,Ye,tt="";if(typeof Be=="string"||typeof Be=="number")tt+=Be;else if(typeof Be=="object")if(Array.isArray(Be))for(Le=0;Le<Be.length;Le++)Be[Le]&&(Ye=r$1(Be[Le]))&&(tt&&(tt+=" "),tt+=Ye);else for(Le in Be)Be[Le]&&(tt&&(tt+=" "),tt+=Le);return tt}function clsx$1(){for(var Be,Le,Ye=0,tt="";Ye<arguments.length;)(Be=arguments[Ye++])&&(Le=r$1(Be))&&(tt&&(tt+=" "),tt+=Le);return tt}var lottie$1={exports:{}};(function(module,exports){typeof document<"u"&&typeof navigator<"u"&&function(Be,Le){module.exports=Le()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(Le){_useWebWorker=!!Le},getWebWorker=function(){return _useWebWorker},setLocationHref=function(Le){locationHref=Le},getLocationHref=function(){return locationHref};function createTag(Be){return document.createElement(Be)}function extendPrototype(Be,Le){var Ye,tt=Be.length,nt;for(Ye=0;Ye<tt;Ye+=1){nt=Be[Ye].prototype;for(var ft in nt)Object.prototype.hasOwnProperty.call(nt,ft)&&(Le.prototype[ft]=nt[ft])}}function getDescriptor(Be,Le){return Object.getOwnPropertyDescriptor(Be,Le)}function createProxyFunction(Be){function Le(){}return Le.prototype=Be,Le}var audioControllerFactory=function(){function Be(Le){this.audios=[],this.audioFactory=Le,this._volume=1,this._isMuted=!1}return Be.prototype={addAudio:function(Ye){this.audios.push(Ye)},pause:function(){var Ye,tt=this.audios.length;for(Ye=0;Ye<tt;Ye+=1)this.audios[Ye].pause()},resume:function(){var Ye,tt=this.audios.length;for(Ye=0;Ye<tt;Ye+=1)this.audios[Ye].resume()},setRate:function(Ye){var tt,nt=this.audios.length;for(tt=0;tt<nt;tt+=1)this.audios[tt].setRate(Ye)},createAudio:function(Ye){return this.audioFactory?this.audioFactory(Ye):window.Howl?new window.Howl({src:[Ye]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(Ye){this.audioFactory=Ye},setVolume:function(Ye){this._volume=Ye,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var Ye,tt=this.audios.length;for(Ye=0;Ye<tt;Ye+=1)this.audios[Ye].volume(this._volume*(this._isMuted?0:1))}},function(){return new Be}}(),createTypedArray=function(){function Be(Ye,tt){var nt=0,ft=[],ht;switch(Ye){case"int16":case"uint8c":ht=1;break;default:ht=1.1;break}for(nt=0;nt<tt;nt+=1)ft.push(ht);return ft}function Le(Ye,tt){return Ye==="float32"?new Float32Array(tt):Ye==="int16"?new Int16Array(tt):Ye==="uint8c"?new Uint8ClampedArray(tt):Be(Ye,tt)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?Le:Be}();function createSizedArray(Be){return Array.apply(null,{length:Be})}function _typeof$6(Be){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$6(Be)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var Be=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],Le,Ye=Be.length;for(Le=0;Le<Ye;Le+=1)BMMath[Be[Le]]=Math[Be[Le]]})(),BMMath.random=Math.random,BMMath.abs=function(Be){var Le=_typeof$6(Be);if(Le==="object"&&Be.length){var Ye=createSizedArray(Be.length),tt,nt=Be.length;for(tt=0;tt<nt;tt+=1)Ye[tt]=Math.abs(Be[tt]);return Ye}return Math.abs(Be)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(Be){Be.style.position="absolute",Be.style.top=0,Be.style.left=0,Be.style.display="block",Be.style.transformOrigin="0 0",Be.style.webkitTransformOrigin="0 0",Be.style.backfaceVisibility="visible",Be.style.webkitBackfaceVisibility="visible",Be.style.transformStyle="preserve-3d",Be.style.webkitTransformStyle="preserve-3d",Be.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(Be,Le,Ye,tt){this.type=Be,this.currentTime=Le,this.totalTime=Ye,this.direction=tt<0?-1:1}function BMCompleteEvent(Be,Le){this.type=Be,this.direction=Le<0?-1:1}function BMCompleteLoopEvent(Be,Le,Ye,tt){this.type=Be,this.currentLoop=Ye,this.totalLoops=Le,this.direction=tt<0?-1:1}function BMSegmentStartEvent(Be,Le,Ye){this.type=Be,this.firstFrame=Le,this.totalFrames=Ye}function BMDestroyEvent(Be,Le){this.type=Be,this.target=Le}function BMRenderFrameErrorEvent(Be,Le){this.type="renderFrameError",this.nativeError=Be,this.currentTime=Le}function BMConfigErrorEvent(Be){this.type="configError",this.nativeError=Be}var createElementID=function(){var Be=0;return function(){return Be+=1,idPrefix$1+"__lottie_element_"+Be}}();function HSVtoRGB(Be,Le,Ye){var tt,nt,ft,ht,gt,At,xt,yt;switch(ht=Math.floor(Be*6),gt=Be*6-ht,At=Ye*(1-Le),xt=Ye*(1-gt*Le),yt=Ye*(1-(1-gt)*Le),ht%6){case 0:tt=Ye,nt=yt,ft=At;break;case 1:tt=xt,nt=Ye,ft=At;break;case 2:tt=At,nt=Ye,ft=yt;break;case 3:tt=At,nt=xt,ft=Ye;break;case 4:tt=yt,nt=At,ft=Ye;break;case 5:tt=Ye,nt=At,ft=xt;break}return[tt,nt,ft]}function RGBtoHSV(Be,Le,Ye){var tt=Math.max(Be,Le,Ye),nt=Math.min(Be,Le,Ye),ft=tt-nt,ht,gt=tt===0?0:ft/tt,At=tt/255;switch(tt){case nt:ht=0;break;case Be:ht=Le-Ye+ft*(Le<Ye?6:0),ht/=6*ft;break;case Le:ht=Ye-Be+ft*2,ht/=6*ft;break;case Ye:ht=Be-Le+ft*4,ht/=6*ft;break}return[ht,gt,At]}function addSaturationToRGB(Be,Le){var Ye=RGBtoHSV(Be[0]*255,Be[1]*255,Be[2]*255);return Ye[1]+=Le,Ye[1]>1?Ye[1]=1:Ye[1]<=0&&(Ye[1]=0),HSVtoRGB(Ye[0],Ye[1],Ye[2])}function addBrightnessToRGB(Be,Le){var Ye=RGBtoHSV(Be[0]*255,Be[1]*255,Be[2]*255);return Ye[2]+=Le,Ye[2]>1?Ye[2]=1:Ye[2]<0&&(Ye[2]=0),HSVtoRGB(Ye[0],Ye[1],Ye[2])}function addHueToRGB(Be,Le){var Ye=RGBtoHSV(Be[0]*255,Be[1]*255,Be[2]*255);return Ye[0]+=Le/360,Ye[0]>1?Ye[0]-=1:Ye[0]<0&&(Ye[0]+=1),HSVtoRGB(Ye[0],Ye[1],Ye[2])}var rgbToHex=function(){var Be=[],Le,Ye;for(Le=0;Le<256;Le+=1)Ye=Le.toString(16),Be[Le]=Ye.length===1?"0"+Ye:Ye;return function(tt,nt,ft){return tt<0&&(tt=0),nt<0&&(nt=0),ft<0&&(ft=0),"#"+Be[tt]+Be[nt]+Be[ft]}}(),setSubframeEnabled=function(Le){subframeEnabled=!!Le},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(Le){expressionsPlugin=Le},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(Le){expressionsInterfaces=Le},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(Le){defaultCurveSegments=Le},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(Le){idPrefix$1=Le};function createNS(Be){return document.createElementNS(svgNS,Be)}function _typeof$5(Be){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$5(Be)}var dataManager=function(){var Be=1,Le=[],Ye,tt,nt={onmessage:function(){},postMessage:function(vt){Ye({data:vt})}},ft={postMessage:function(vt){nt.onmessage({data:vt})}};function ht(Et){if(window.Worker&&window.Blob&&getWebWorker()){var vt=new Blob(["var _workerSelf = self; self.onmessage = ",Et.toString()],{type:"text/javascript"}),kt=URL.createObjectURL(vt);return new Worker(kt)}return Ye=Et,nt}function gt(){tt||(tt=ht(function(vt){function kt(){function wt(Xt,_t){var Mt,jt,zt=Xt.length,Gt,Yt,ar,tr;for(jt=0;jt<zt;jt+=1)if(Mt=Xt[jt],"ks"in Mt&&!Mt.completed){if(Mt.completed=!0,Mt.hasMask){var sr=Mt.masksProperties;for(Yt=sr.length,Gt=0;Gt<Yt;Gt+=1)if(sr[Gt].pt.k.i)Pt(sr[Gt].pt.k);else for(tr=sr[Gt].pt.k.length,ar=0;ar<tr;ar+=1)sr[Gt].pt.k[ar].s&&Pt(sr[Gt].pt.k[ar].s[0]),sr[Gt].pt.k[ar].e&&Pt(sr[Gt].pt.k[ar].e[0])}Mt.ty===0?(Mt.layers=Tt(Mt.refId,_t),wt(Mt.layers,_t)):Mt.ty===4?Bt(Mt.shapes):Mt.ty===5&&Ut(Mt)}}function It(Xt,_t){if(Xt){var Mt=0,jt=Xt.length;for(Mt=0;Mt<jt;Mt+=1)Xt[Mt].t===1&&(Xt[Mt].data.layers=Tt(Xt[Mt].data.refId,_t),wt(Xt[Mt].data.layers,_t))}}function Rt(Xt,_t){for(var Mt=0,jt=_t.length;Mt<jt;){if(_t[Mt].id===Xt)return _t[Mt];Mt+=1}return null}function Tt(Xt,_t){var Mt=Rt(Xt,_t);return Mt?Mt.layers.__used?JSON.parse(JSON.stringify(Mt.layers)):(Mt.layers.__used=!0,Mt.layers):null}function Bt(Xt){var _t,Mt=Xt.length,jt,zt;for(_t=Mt-1;_t>=0;_t-=1)if(Xt[_t].ty==="sh")if(Xt[_t].ks.k.i)Pt(Xt[_t].ks.k);else for(zt=Xt[_t].ks.k.length,jt=0;jt<zt;jt+=1)Xt[_t].ks.k[jt].s&&Pt(Xt[_t].ks.k[jt].s[0]),Xt[_t].ks.k[jt].e&&Pt(Xt[_t].ks.k[jt].e[0]);else Xt[_t].ty==="gr"&&Bt(Xt[_t].it)}function Pt(Xt){var _t,Mt=Xt.i.length;for(_t=0;_t<Mt;_t+=1)Xt.i[_t][0]+=Xt.v[_t][0],Xt.i[_t][1]+=Xt.v[_t][1],Xt.o[_t][0]+=Xt.v[_t][0],Xt.o[_t][1]+=Xt.v[_t][1]}function Dt(Xt,_t){var Mt=_t?_t.split("."):[100,100,100];return Xt[0]>Mt[0]?!0:Mt[0]>Xt[0]?!1:Xt[1]>Mt[1]?!0:Mt[1]>Xt[1]?!1:Xt[2]>Mt[2]?!0:Mt[2]>Xt[2]?!1:null}var Ot=function(){var Xt=[4,4,14];function _t(jt){var zt=jt.t.d;jt.t.d={k:[{s:zt,t:0}]}}function Mt(jt){var zt,Gt=jt.length;for(zt=0;zt<Gt;zt+=1)jt[zt].ty===5&&_t(jt[zt])}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}(),Lt=function(){var Xt=[4,7,99];return function(_t){if(_t.chars&&!Dt(Xt,_t.v)){var Mt,jt=_t.chars.length;for(Mt=0;Mt<jt;Mt+=1){var zt=_t.chars[Mt];zt.data&&zt.data.shapes&&(Bt(zt.data.shapes),zt.data.ip=0,zt.data.op=99999,zt.data.st=0,zt.data.sr=1,zt.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},_t.chars[Mt].t||(zt.data.shapes.push({ty:"no"}),zt.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),Wt=function(){var Xt=[5,7,15];function _t(jt){var zt=jt.t.p;typeof zt.a=="number"&&(zt.a={a:0,k:zt.a}),typeof zt.p=="number"&&(zt.p={a:0,k:zt.p}),typeof zt.r=="number"&&(zt.r={a:0,k:zt.r})}function Mt(jt){var zt,Gt=jt.length;for(zt=0;zt<Gt;zt+=1)jt[zt].ty===5&&_t(jt[zt])}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}(),$t=function(){var Xt=[4,1,9];function _t(jt){var zt,Gt=jt.length,Yt,ar;for(zt=0;zt<Gt;zt+=1)if(jt[zt].ty==="gr")_t(jt[zt].it);else if(jt[zt].ty==="fl"||jt[zt].ty==="st")if(jt[zt].c.k&&jt[zt].c.k[0].i)for(ar=jt[zt].c.k.length,Yt=0;Yt<ar;Yt+=1)jt[zt].c.k[Yt].s&&(jt[zt].c.k[Yt].s[0]/=255,jt[zt].c.k[Yt].s[1]/=255,jt[zt].c.k[Yt].s[2]/=255,jt[zt].c.k[Yt].s[3]/=255),jt[zt].c.k[Yt].e&&(jt[zt].c.k[Yt].e[0]/=255,jt[zt].c.k[Yt].e[1]/=255,jt[zt].c.k[Yt].e[2]/=255,jt[zt].c.k[Yt].e[3]/=255);else jt[zt].c.k[0]/=255,jt[zt].c.k[1]/=255,jt[zt].c.k[2]/=255,jt[zt].c.k[3]/=255}function Mt(jt){var zt,Gt=jt.length;for(zt=0;zt<Gt;zt+=1)jt[zt].ty===4&&_t(jt[zt].shapes)}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}(),qt=function(){var Xt=[4,4,18];function _t(jt){var zt,Gt=jt.length,Yt,ar;for(zt=Gt-1;zt>=0;zt-=1)if(jt[zt].ty==="sh")if(jt[zt].ks.k.i)jt[zt].ks.k.c=jt[zt].closed;else for(ar=jt[zt].ks.k.length,Yt=0;Yt<ar;Yt+=1)jt[zt].ks.k[Yt].s&&(jt[zt].ks.k[Yt].s[0].c=jt[zt].closed),jt[zt].ks.k[Yt].e&&(jt[zt].ks.k[Yt].e[0].c=jt[zt].closed);else jt[zt].ty==="gr"&&_t(jt[zt].it)}function Mt(jt){var zt,Gt,Yt=jt.length,ar,tr,sr,ur;for(Gt=0;Gt<Yt;Gt+=1){if(zt=jt[Gt],zt.hasMask){var rr=zt.masksProperties;for(tr=rr.length,ar=0;ar<tr;ar+=1)if(rr[ar].pt.k.i)rr[ar].pt.k.c=rr[ar].cl;else for(ur=rr[ar].pt.k.length,sr=0;sr<ur;sr+=1)rr[ar].pt.k[sr].s&&(rr[ar].pt.k[sr].s[0].c=rr[ar].cl),rr[ar].pt.k[sr].e&&(rr[ar].pt.k[sr].e[0].c=rr[ar].cl)}zt.ty===4&&_t(zt.shapes)}}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}();function Ht(Xt){Xt.__complete||($t(Xt),Ot(Xt),Lt(Xt),Wt(Xt),qt(Xt),wt(Xt.layers,Xt.assets),It(Xt.chars,Xt.assets),Xt.__complete=!0)}function Ut(Xt){Xt.t.a.length===0&&"m"in Xt.t.p}var Ft={};return Ft.completeData=Ht,Ft.checkColors=$t,Ft.checkChars=Lt,Ft.checkPathProperties=Wt,Ft.checkShapes=qt,Ft.completeLayers=wt,Ft}if(ft.dataManager||(ft.dataManager=kt()),ft.assetLoader||(ft.assetLoader=function(){function wt(Rt){var Tt=Rt.getResponseHeader("content-type");return Tt&&Rt.responseType==="json"&&Tt.indexOf("json")!==-1||Rt.response&&_typeof$5(Rt.response)==="object"?Rt.response:Rt.response&&typeof Rt.response=="string"?JSON.parse(Rt.response):Rt.responseText?JSON.parse(Rt.responseText):null}function It(Rt,Tt,Bt,Pt){var Dt,Ot=new XMLHttpRequest;try{Ot.responseType="json"}catch{}Ot.onreadystatechange=function(){if(Ot.readyState===4)if(Ot.status===200)Dt=wt(Ot),Bt(Dt);else try{Dt=wt(Ot),Bt(Dt)}catch(Lt){Pt&&Pt(Lt)}};try{Ot.open(["G","E","T"].join(""),Rt,!0)}catch{Ot.open(["G","E","T"].join(""),Tt+"/"+Rt,!0)}Ot.send()}return{load:It}}()),vt.data.type==="loadAnimation")ft.assetLoader.load(vt.data.path,vt.data.fullPath,function(wt){ft.dataManager.completeData(wt),ft.postMessage({id:vt.data.id,payload:wt,status:"success"})},function(){ft.postMessage({id:vt.data.id,status:"error"})});else if(vt.data.type==="complete"){var bt=vt.data.animation;ft.dataManager.completeData(bt),ft.postMessage({id:vt.data.id,payload:bt,status:"success"})}else vt.data.type==="loadData"&&ft.assetLoader.load(vt.data.path,vt.data.fullPath,function(wt){ft.postMessage({id:vt.data.id,payload:wt,status:"success"})},function(){ft.postMessage({id:vt.data.id,status:"error"})})}),tt.onmessage=function(Et){var vt=Et.data,kt=vt.id,bt=Le[kt];Le[kt]=null,vt.status==="success"?bt.onComplete(vt.payload):bt.onError&&bt.onError()})}function At(Et,vt){Be+=1;var kt="processId_"+Be;return Le[kt]={onComplete:Et,onError:vt},kt}function xt(Et,vt,kt){gt();var bt=At(vt,kt);tt.postMessage({type:"loadAnimation",path:Et,fullPath:window.location.origin+window.location.pathname,id:bt})}function yt(Et,vt,kt){gt();var bt=At(vt,kt);tt.postMessage({type:"loadData",path:Et,fullPath:window.location.origin+window.location.pathname,id:bt})}function Ct(Et,vt,kt){gt();var bt=At(vt,kt);tt.postMessage({type:"complete",animation:Et,id:bt})}return{loadAnimation:xt,loadData:yt,completeAnimation:Ct}}(),ImagePreloader=function(){var Be=function(){var It=createTag("canvas");It.width=1,It.height=1;var Rt=It.getContext("2d");return Rt.fillStyle="rgba(0,0,0,0)",Rt.fillRect(0,0,1,1),It}();function Le(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function Ye(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function tt(It,Rt,Tt){var Bt="";if(It.e)Bt=It.p;else if(Rt){var Pt=It.p;Pt.indexOf("images/")!==-1&&(Pt=Pt.split("/")[1]),Bt=Rt+Pt}else Bt=Tt,Bt+=It.u?It.u:"",Bt+=It.p;return Bt}function nt(It){var Rt=0,Tt=setInterval((function(){var Bt=It.getBBox();(Bt.width||Rt>500)&&(this._imageLoaded(),clearInterval(Tt)),Rt+=1}).bind(this),50)}function ft(It){var Rt=tt(It,this.assetsPath,this.path),Tt=createNS("image");isSafari?this.testImageLoaded(Tt):Tt.addEventListener("load",this._imageLoaded,!1),Tt.addEventListener("error",(function(){Bt.img=Be,this._imageLoaded()}).bind(this),!1),Tt.setAttributeNS("http://www.w3.org/1999/xlink","href",Rt),this._elementHelper.append?this._elementHelper.append(Tt):this._elementHelper.appendChild(Tt);var Bt={img:Tt,assetData:It};return Bt}function ht(It){var Rt=tt(It,this.assetsPath,this.path),Tt=createTag("img");Tt.crossOrigin="anonymous",Tt.addEventListener("load",this._imageLoaded,!1),Tt.addEventListener("error",(function(){Bt.img=Be,this._imageLoaded()}).bind(this),!1),Tt.src=Rt;var Bt={img:Tt,assetData:It};return Bt}function gt(It){var Rt={assetData:It},Tt=tt(It,this.assetsPath,this.path);return dataManager.loadData(Tt,(function(Bt){Rt.img=Bt,this._footageLoaded()}).bind(this),(function(){Rt.img={},this._footageLoaded()}).bind(this)),Rt}function At(It,Rt){this.imagesLoadedCb=Rt;var Tt,Bt=It.length;for(Tt=0;Tt<Bt;Tt+=1)It[Tt].layers||(!It[Tt].t||It[Tt].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(It[Tt]))):It[Tt].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(It[Tt]))))}function xt(It){this.path=It||""}function yt(It){this.assetsPath=It||""}function Ct(It){for(var Rt=0,Tt=this.images.length;Rt<Tt;){if(this.images[Rt].assetData===It)return this.images[Rt].img;Rt+=1}return null}function Et(){this.imagesLoadedCb=null,this.images.length=0}function vt(){return this.totalImages===this.loadedAssets}function kt(){return this.totalFootages===this.loadedFootagesCount}function bt(It,Rt){It==="svg"?(this._elementHelper=Rt,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function wt(){this._imageLoaded=Le.bind(this),this._footageLoaded=Ye.bind(this),this.testImageLoaded=nt.bind(this),this.createFootageData=gt.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return wt.prototype={loadAssets:At,setAssetsPath:yt,setPath:xt,loadedImages:vt,loadedFootages:kt,destroy:Et,getAsset:Ct,createImgData:ht,createImageData:ft,imageLoaded:Le,footageLoaded:Ye,setCacheType:bt},wt}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(Le,Ye){if(this._cbs[Le])for(var tt=this._cbs[Le],nt=0;nt<tt.length;nt+=1)tt[nt](Ye)},addEventListener:function(Le,Ye){return this._cbs[Le]||(this._cbs[Le]=[]),this._cbs[Le].push(Ye),(function(){this.removeEventListener(Le,Ye)}).bind(this)},removeEventListener:function(Le,Ye){if(!Ye)this._cbs[Le]=null;else if(this._cbs[Le]){for(var tt=0,nt=this._cbs[Le].length;tt<nt;)this._cbs[Le][tt]===Ye&&(this._cbs[Le].splice(tt,1),tt-=1,nt-=1),tt+=1;this._cbs[Le].length||(this._cbs[Le]=null)}}};var markerParser=function(){function Be(Le){for(var Ye=Le.split(`\r
2155
+ `,Header$4=({hideHeaderBranding:Be,logo:Le,closeButton:Ye})=>{const tt=useTokens(),nt=typeof(Le==null?void 0:Le.height)=="number"?tt.spacing[Le.height]:Le==null?void 0:Le.height,ft=(Ye==null?void 0:Ye.offset)!==void 0?typeof Ye.offset=="string"?Ye.offset:tt.spacing[Ye.offset]:tt.spacing[6],ht=()=>{var At,xt;if(!window.confirm("Are you sure you want to quit?")){(At=Ye==null?void 0:Ye.onCancel)==null||At.call(Ye);return}(xt=Ye==null?void 0:Ye.onClose)==null||xt.call(Ye)};return jsxs(FlexCenter,{as:"header",px:"6px",minH:"38px",h:"44px",wFull:!0,position:"relative",children:[Be?null:jsx$1(Image$f,{src:(Le==null?void 0:Le.src)??incodeLogoDataUri,alt:"Logo",h:nt||tt.spacing[5]}),Ye!=null&&Ye.show?jsx$1(Box,{as:"button",onClick:ht,position:"absolute",right:((Ye==null?void 0:Ye.position)??"right")==="right"?ft:void 0,left:((Ye==null?void 0:Ye.position)??"right")==="left"?ft:void 0,top:"50%",transform:"translateY(-50%)",backgroundColor:"transparent",border:"none",p:0,zIndex:1e4,children:jsx$1(XIcon,{color:Ye==null?void 0:Ye.color})}):null]})},Page$1=({children:Be,title:Le,subtitle:Ye,px:tt=6,py:nt=2,p:ft,bg:ht,maxW:gt,maxH:At,logo:xt={src:incodeLogoDataUri,height:5},hideFooterBranding:yt=!1,hideHeaderBranding:Ct=!1,closeButton:Et,"data-testid":vt,position:kt})=>{const bt=Le||Ye,wt=useTokens();return jsx$1(Flex,{minH:"100%",wFull:!0,bg:ht||wt.color.surface.neutral.light,position:kt,...vt?{"data-testid":vt}:{},children:jsxs(PageContent,{p:ft,pt:0,pb:0,px:ft===void 0&&tt!==void 0?wt.spacing[tt]:void 0,py:ft===void 0&&nt!==void 0?wt.spacing[nt]:void 0,maxW:gt,maxH:At,children:[!Ct||Et!=null&&Et.show?jsx$1(Header$4,{hideHeaderBranding:Ct,logo:xt,closeButton:Et}):null,bt?jsx$1(Spacer,{size:Ct?wt.spacing[2]:wt.spacing[6]}):null,bt?jsxs(Box,{m:"0 auto",children:[Le?jsx$1(Title$p,{maxW:"275px",m:"0 auto",children:Le}):null,Ye?jsxs(Fragment,{children:[jsx$1(Spacer,{size:wt.spacing[3]}),jsx$1(Text$8,{as:"p",textAlign:"center",color:wt.color.text.body.secondary,lineHeight:"114%",fontWeight:500,letterSpacing:"-0.5px",fontSize:wt.typography.fontSize.base,p:0,m:0,children:Ye})]}):null]}):null,jsx$1(Flex,{flex:1,direction:"column",children:Be}),yt?null:jsx$1(Flex,{justify:"center",align:"center",pb:wt.spacing[3],pt:wt.spacing[2],children:jsx$1(Box,{maxH:wt.spacing[10],children:jsx$1(VerifiedLogo,{})})})]})})},ErrorIcon$1=({size:Be})=>{const Le=useTokens();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Be||"32",height:Be||"32",viewBox:"0 0 32 32",fill:"none",children:[jsx$1("title",{children:"Error"}),jsx$1("path",{d:"M16 0C24.8219 0 32 7.17642 32 16C32 24.8219 24.8219 32 16 32C7.17811 32 0 24.8219 0 16C0 7.17642 7.17811 0 16 0ZM13.1553 11.3701C12.6618 10.8767 11.8636 10.8767 11.3701 11.3701C10.8767 11.8636 10.8767 12.6618 11.3701 13.1553L14.4053 16.1924L11.3721 19.2256C10.8803 19.7191 10.8803 20.5173 11.3721 21.0107C11.8656 21.504 12.6658 21.5041 13.1592 21.0107L16.1924 17.9775L19.2334 21.0205C19.481 21.2664 19.8029 21.3916 20.1279 21.3916C20.4513 21.3916 20.7746 21.2664 21.0205 21.0205C21.514 20.527 21.514 19.7269 21.0205 19.2334L17.9775 16.1924L21.0107 13.1572C21.5041 12.6638 21.504 11.8639 21.0107 11.3721C20.5173 10.8786 19.7191 10.8786 19.2256 11.3721L16.1904 14.4053L13.1553 11.3701Z",fill:Le.color.surface.status.negative})]})},SuccessIcon$1=({size:Be})=>{const Le=useTokens();return jsxs("svg",{width:Be,height:Be,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"status"}),jsx$1("path",{d:"M8 0.5C12.4182 0.500064 16 4.0818 16 8.5C16 12.9182 12.4181 16.4999 8 16.5C3.58181 16.5 3.68521e-05 12.9182 0 8.5C0 4.08176 3.58179 0.5 8 0.5ZM11.1748 6.11621C10.9423 5.88373 10.5747 5.86781 10.3242 6.06934L10.3203 6.07324L10.2764 6.1123L6.85742 9.53125L5.72656 8.40039C5.47758 8.1514 5.0732 8.1514 4.82422 8.40039C4.59169 8.63292 4.57673 9.00038 4.77832 9.25098L4.78125 9.25488L4.82031 9.29883L6.40625 10.8848C6.63867 11.117 7.00542 11.1319 7.25586 10.9307L7.26074 10.9277L7.30371 10.8877L11.1748 7.01758C11.4235 6.76863 11.4234 6.36521 11.1748 6.11621Z",fill:Le.color.icon.success})]})},WarningIcon=()=>{const Be=useTokens();return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[jsx$1("title",{children:"Warning"}),jsx$1("g",{clipPath:"url(#clip0)",children:jsx$1("path",{d:"M16 0C24.848 0 32 7.1696 32 16C32 24.8336 24.848 32 16 32C7.168 32 0 24.8336 0 16C0 7.1696 7.168 0 16 0ZM16 20.6896C15.232 20.6896 14.608 21.3136 14.608 22.0816C14.608 22.8496 15.232 23.4896 16.016 23.4896C16.784 23.4896 17.408 22.8496 17.408 22.0816C17.408 21.3136 16.784 20.6896 16 20.6896ZM16 8.528C15.232 8.528 14.592 9.1696 14.592 9.936V17.008C14.592 17.7776 15.232 18.4 16 18.4C16.768 18.4 17.392 17.7776 17.392 17.008V9.936C17.392 9.1696 16.768 8.528 16 8.528Z",fill:Be.color.surface.status.warning})}),jsx$1("defs",{children:jsx$1("clipPath",{id:"clip0",children:jsx$1("rect",{width:"32",height:"32",fill:"white"})})})]})},LocationActiveIcon=({color:Be})=>jsxs("svg",{width:"342",height:"371",viewBox:"0 0 342 371",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Location Active"}),jsx$1("path",{d:"M196.828 134.876L141.896 166.816L125.257 317.465L216.5 285.791L196.828 134.876Z",fill:"url(#paint0_linear_2130_1701)"}),jsx$1("path",{d:"M260.015 166.283L196.828 134.876L216.499 285.791L316 317.465L260.018 166.283H260.015Z",fill:"url(#paint1_linear_2130_1701)"}),jsx$1("path",{d:"M141.896 166.82L93.9483 135.525L41 285.906L125.261 317.468L141.899 166.82H141.896Z",fill:"url(#paint2_linear_2130_1701)"}),jsx$1("g",{opacity:"0.8",children:jsx$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M125.583 247.829C125.919 245.294 128.511 244.23 131.39 245.455H131.394C131.995 245.712 132.574 246.047 133.103 246.448C134.79 246.26 136.059 246.859 136.407 248.151C139.023 257.457 149.374 261.678 162.979 259.044C165.545 258.543 167.331 259.69 167.322 261.804L167.22 283.275C167.207 285.814 164.404 288.87 160.936 290.101H160.933L126.998 301.748V301.752L126.993 301.75L126.989 301.752V301.748L124.945 301.014C121.543 299.785 119.079 296.736 119.414 294.201L125.583 247.829ZM87.9309 198.19C88.6744 195.658 91.0562 194.594 93.2737 195.812L116.851 208.092C119.322 209.313 121.003 212.356 120.585 214.891L108.182 290.006H108.175C107.757 292.538 104.757 293.602 101.496 292.374L69.9699 280.035C66.9662 278.81 65.1463 275.764 65.8899 273.232L87.9309 198.19ZM231.328 254.276C230.855 251.738 233.158 250.67 236.49 251.898L271.33 264.26C274.916 265.488 278.5 268.551 279.299 271.093L285.171 289.753C285.97 292.295 283.48 293.358 279.631 292.127L242.173 279.746C238.58 278.518 235.293 275.459 234.816 272.92L231.328 254.276ZM214.447 270.052L184.855 281.425C181.525 282.659 178.755 281.6 178.686 279.064L178.094 257.256C178.038 255.204 179.627 252.738 181.98 251.221C193.873 243.311 202.161 231.214 203.954 219.524H203.951C204.228 217.585 205.514 215.638 207.201 214.479L214.447 270.052ZM207.205 214.476C207.528 214.559 207.863 214.671 208.208 214.815L209.656 215.425C212.594 216.65 215.308 219.705 215.703 222.244L222.915 268.719C223.31 271.257 220.81 272.321 217.352 271.093V271.086L214.449 270.049L207.205 214.476ZM214.002 161.686C213.528 159.148 215.128 158.077 217.599 159.296L243.726 171.595C246.447 172.816 249.326 175.872 250.125 178.414L273.854 253.792C274.653 256.334 272.436 257.401 268.922 256.173L234.842 243.818C231.585 242.593 228.571 239.534 228.094 236.995L214.002 161.686ZM171.461 203.623C183.99 197.597 194.663 202.721 195.788 215.072C196.917 227.423 186.421 242.313 171.856 248.322C156.744 254.328 144.83 249.195 145.739 236.86H145.742C146.651 224.526 158.386 209.645 171.461 203.623ZM163.548 169.859C165.891 168.618 167.763 169.671 167.75 172.207L167.648 193.755C167.638 195.865 166.151 198.417 164.026 199.919C152.504 207.789 142.38 220.295 138.007 232.356L138 232.359C137.374 234.037 135.909 235.721 134.161 236.887L134.16 236.896C134.157 236.896 134.153 236.895 134.15 236.894L134.148 236.896V236.894C133.606 236.828 133.037 236.674 132.463 236.423L132.44 236.413C129.646 235.188 127.672 232.142 128.008 229.606L134.177 183.231L134.18 183.234C134.519 180.699 136.618 179.635 138.892 180.853L140.264 181.584L163.548 169.859ZM200.703 150.702C203.036 151.924 205.261 154.972 205.655 157.511L212.867 203.982C213.259 206.524 211.249 207.591 208.4 206.366L206.972 205.75V205.747C206.643 205.605 206.32 205.438 205.997 205.247L198.753 149.671L200.703 150.702ZM205.997 205.247C204.283 205.754 202.737 205.177 202.075 203.685C198.226 194.742 189.783 190.537 179.693 192.635C177.722 193.04 176.317 191.907 176.261 189.849L175.665 167.963L175.662 167.966C175.593 165.427 177.34 162.364 179.541 161.123L198.752 149.671L205.997 205.247ZM98.4397 162.394C99.1832 159.862 101.292 158.795 103.174 160.014L123.369 172.269C125.504 173.488 126.912 176.53 126.494 179.065L123.425 197.66V197.657C123.007 200.189 120.707 201.256 118.312 200.034L95.4983 187.762C93.3597 186.543 92.241 183.501 92.9846 180.969L98.4397 162.394Z",fill:"url(#paint3_linear_2130_1701)"})}),jsx$1("g",{filter:"url(#filter0_f_2130_1701)",children:jsx$1("ellipse",{cx:"184.221",cy:"184.765",rx:"15",ry:"3",transform:"rotate(-17.0433 184.221 184.765)",fill:"url(#paint4_linear_2130_1701)",fillOpacity:"0.71"})}),jsx$1("path",{d:"M171.417 46.5C146.334 46.5 126 66.8379 126 91.9252C126 117.013 171.417 189.109 171.417 189.109C171.417 189.109 216.834 117.014 216.834 91.9252C216.834 66.8363 196.499 46.5 171.417 46.5ZM171.417 111.788C160.449 111.788 151.558 102.895 151.558 91.9252C151.558 80.9552 160.449 72.0623 171.417 72.0623C182.385 72.0623 191.276 80.9552 191.276 91.9252C191.276 102.895 182.385 111.788 171.417 111.788Z",fill:Be}),jsxs("defs",{children:[jsxs("filter",{id:"filter0_f_2130_1701",x:"165.852",y:"175.515",width:"36.7373",height:"18.4999",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsx$1("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),jsx$1("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsx$1("feGaussianBlur",{stdDeviation:"2",result:"effect1_foregroundBlur_2130_1701"})]}),jsxs("linearGradient",{id:"paint0_linear_2130_1701",x1:"220.984",y1:"226.498",x2:"26.1221",y2:"225.43",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:"#CFCECE"}),jsx$1("stop",{offset:"1",stopColor:"white"})]}),jsxs("linearGradient",{id:"paint1_linear_2130_1701",x1:"332.441",y1:"278.402",x2:"171.874",y2:"189.271",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:"#CFCECE"}),jsx$1("stop",{offset:"1",stopColor:"white"})]}),jsxs("linearGradient",{id:"paint2_linear_2130_1701",x1:"119.223",y1:"239.488",x2:"68.0849",y2:"211.1",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:"#DADADA"}),jsx$1("stop",{offset:"1",stopColor:"white"})]}),jsxs("linearGradient",{id:"paint3_linear_2130_1701",x1:"127.639",y1:"300.042",x2:"135.977",y2:"178.948",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{stopColor:Be,stopOpacity:"0.15"}),jsx$1("stop",{offset:"1",stopColor:Be})]}),jsxs("linearGradient",{id:"paint4_linear_2130_1701",x1:"169.221",y1:"184.765",x2:"199.221",y2:"184.765",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{offset:"0.153846",stopColor:"#737373"}),jsx$1("stop",{offset:"1",stopColor:"#737373",stopOpacity:"0"})]})]})]}),LocationUnactiveIcon=()=>jsxs("svg",{width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Location Unactive"}),jsx$1("path",{d:"M185.828 109.572L130.896 141.512L114.257 292.16L205.5 260.487L185.828 109.572Z",fill:"url(#paint0_linear_2156_2062)"}),jsx$1("path",{d:"M249.015 140.979L185.828 109.572L205.5 260.487L305 292.16L249.018 140.979H249.015Z",fill:"url(#paint1_linear_2156_2062)"}),jsx$1("path",{d:"M130.896 141.515L82.9483 110.221L30 260.602L114.261 292.163L130.899 141.515H130.896Z",fill:"url(#paint2_linear_2156_2062)"}),jsx$1("g",{opacity:"0.8",children:jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M114.583 222.525C114.919 219.989 117.511 218.926 120.39 220.151H120.394C120.995 220.407 121.574 220.743 122.103 221.144C123.79 220.956 125.059 221.555 125.407 222.847C128.023 232.152 138.374 236.374 151.979 233.74C154.545 233.239 156.331 234.385 156.322 236.499L156.22 257.971C156.207 260.51 153.404 263.566 149.936 264.797H149.933L115.998 276.444V276.448L115.993 276.446L115.989 276.448V276.444L113.945 275.709C110.543 274.481 108.079 271.432 108.414 268.897L114.583 222.525ZM76.9309 172.886C77.6744 170.354 80.0562 169.29 82.2737 170.508L105.851 182.787C108.322 184.009 110.003 187.052 109.585 189.587L97.1819 264.702H97.175C96.7572 267.234 93.7567 268.298 90.4963 267.07L58.9699 254.731C55.9662 253.506 54.1463 250.46 54.8899 247.928L76.9309 172.886ZM220.328 228.972C219.855 226.433 222.158 225.366 225.49 226.594L260.33 238.955C263.916 240.184 267.5 243.246 268.299 245.788L274.171 264.449C274.97 266.99 272.48 268.054 268.631 266.823L231.173 254.442C227.58 253.214 224.293 250.154 223.816 247.616L220.328 228.972ZM203.447 244.747L173.855 256.12C170.525 257.355 167.755 256.295 167.686 253.76L167.094 231.952C167.038 229.9 168.627 227.434 170.98 225.916C182.873 218.007 191.161 205.909 192.954 194.22H192.951C193.228 192.281 194.514 190.334 196.201 189.175L203.447 244.747ZM196.205 189.172C196.528 189.255 196.863 189.366 197.208 189.511L198.656 190.12C201.594 191.345 204.308 194.401 204.703 196.94L211.915 243.414C212.31 245.953 209.81 247.017 206.352 245.788V245.782L203.449 244.745L196.205 189.172ZM203.002 136.382C202.528 133.843 204.128 132.773 206.599 133.992L232.726 146.29C235.447 147.512 238.326 150.568 239.125 153.11L262.854 228.488C263.653 231.03 261.436 232.096 257.922 230.869L223.842 218.514C220.585 217.289 217.571 214.229 217.094 211.691L203.002 136.382ZM160.461 178.319C172.99 172.293 183.663 177.417 184.788 189.768C185.917 202.119 175.421 217.009 160.856 223.018C145.744 229.024 133.83 223.891 134.739 211.556H134.742C135.651 199.221 147.386 184.341 160.461 178.319ZM152.548 144.555C154.891 143.314 156.763 144.367 156.75 146.903L156.648 168.451C156.638 170.561 155.151 173.113 153.026 174.615C141.504 182.484 131.38 194.991 127.007 207.052L127 207.055C126.374 208.733 124.909 210.417 123.161 211.582L123.16 211.592C123.157 211.592 123.153 211.591 123.15 211.59L123.148 211.592V211.59C122.606 211.523 122.037 211.37 121.463 211.119L121.44 211.109C118.646 209.884 116.672 206.838 117.008 204.302L123.177 157.927L123.18 157.93C123.519 155.395 125.618 154.331 127.892 155.549L129.264 156.28L152.548 144.555ZM189.703 125.398C192.036 126.619 194.261 129.668 194.655 132.206L201.867 178.678C202.259 181.22 200.249 182.287 197.4 181.062L195.972 180.446V180.443C195.643 180.301 195.32 180.134 194.997 179.943L187.753 124.367L189.703 125.398ZM194.997 179.943C193.283 180.45 191.737 179.873 191.075 178.381C187.226 169.438 178.783 165.233 168.693 167.33C166.722 167.735 165.317 166.603 165.261 164.545L164.665 142.659L164.662 142.661C164.593 140.123 166.34 137.06 168.541 135.819L187.752 124.367L194.997 179.943ZM87.4397 137.09C88.1832 134.558 90.2921 133.491 92.174 134.709L112.369 146.965C114.504 148.184 115.912 151.226 115.494 153.761L112.425 172.356V172.353C112.007 174.885 109.707 175.951 107.312 174.73L84.4983 162.457C82.3597 161.239 81.241 158.197 81.9846 155.664L87.4397 137.09Z",fill:"url(#paint3_linear_2156_2062)"})}),jsx$1("g",{filter:"url(#filter0_f_2156_2062)",children:jsx$1("ellipse",{cx:"173.221",cy:"159.46",rx:"15",ry:"3",transform:"rotate(-17.0433 173.221 159.46)",fill:"url(#paint4_linear_2156_2062)","fill-opacity":"0.71"})}),jsx$1("path",{d:"M160.417 21C135.288 21 114.917 41.3937 114.917 66.5498C114.917 91.706 160.417 164 160.417 164C160.417 164 205.917 91.7075 205.917 66.5498C205.917 41.3921 185.545 21 160.417 21ZM183.33 79.2663L173.119 89.4886L160.418 76.7737L147.717 89.4886L137.506 79.2663L150.207 66.5514L137.506 53.8365L147.717 43.6141L160.418 56.329L173.119 43.6141L183.33 53.8365L170.629 66.5514L183.33 79.2663Z",fill:"url(#paint5_linear_2156_2062)"}),jsxs("defs",{children:[jsxs("filter",{id:"filter0_f_2156_2062",x:"154.852",y:"150.21",width:"36.7373",height:"18.4999",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB",children:[jsx$1("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),jsx$1("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsx$1("feGaussianBlur",{stdDeviation:"2",result:"effect1_foregroundBlur_2156_2062"})]}),jsxs("linearGradient",{id:"paint0_linear_2156_2062",x1:"209.984",y1:"201.194",x2:"15.1221",y2:"200.125",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#CFCECE"}),jsx$1("stop",{offset:"1","stop-color":"white"})]}),jsxs("linearGradient",{id:"paint1_linear_2156_2062",x1:"321.441",y1:"253.098",x2:"160.874",y2:"163.966",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#CFCECE"}),jsx$1("stop",{offset:"1","stop-color":"white"})]}),jsxs("linearGradient",{id:"paint2_linear_2156_2062",x1:"108.223",y1:"214.184",x2:"57.0849",y2:"185.795",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#DADADA"}),jsx$1("stop",{offset:"1","stop-color":"white"})]}),jsxs("linearGradient",{id:"paint3_linear_2156_2062",x1:"116.639",y1:"274.738",x2:"124.977",y2:"153.644",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#A0A0A0","stop-opacity":"0.15"}),jsx$1("stop",{offset:"1","stop-color":"#A0A0A0"})]}),jsxs("linearGradient",{id:"paint4_linear_2156_2062",x1:"158.221",y1:"159.46",x2:"188.221",y2:"159.46",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{offset:"0.153846","stop-color":"#737373"}),jsx$1("stop",{offset:"1","stop-color":"#737373","stop-opacity":"0"})]}),jsxs("linearGradient",{id:"paint5_linear_2156_2062",x1:"160.417",y1:"21",x2:"160.417",y2:"164",gradientUnits:"userSpaceOnUse",children:[jsx$1("stop",{"stop-color":"#E0E0E0"}),jsx$1("stop",{offset:"1","stop-color":"#949497"})]})]})]}),UpArrow=()=>jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Up Arrow"}),jsx$1("path",{d:"M19.2327 14.8193C19.6084 15.2239 19.5853 15.8566 19.1809 16.2324C18.7763 16.6081 18.1437 16.5851 17.7678 16.1807L12.0002 9.96875L6.23266 16.1807L6.15942 16.252C5.77876 16.5865 5.19892 16.5847 4.81957 16.2324C4.41515 15.8566 4.3921 15.2239 4.76781 14.8193L11.2678 7.81934C11.457 7.61576 11.7223 7.5 12.0002 7.5C12.2782 7.5 12.5435 7.61576 12.7327 7.81934L19.2327 14.8193Z",fill:"#60667C"})]}),DownArrow=()=>jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx$1("title",{children:"Down Arrow"}),jsx$1("path",{d:"M4.76734 9.18066C4.39163 8.77605 4.41468 8.14342 4.8191 7.76758C5.22371 7.39187 5.85635 7.41491 6.23219 7.81934L11.9998 14.0312L17.7673 7.81934L17.8406 7.74805C18.2212 7.41355 18.8011 7.41532 19.1804 7.76758C19.5849 8.14341 19.6079 8.77605 19.2322 9.18066L12.7322 16.1807C12.543 16.3842 12.2777 16.5 11.9998 16.5C11.7218 16.5 11.4565 16.3842 11.2673 16.1807L4.76734 9.18066Z",fill:"#60667C"})]}),InputComposed=React.forwardRef(({label:Be,type:Le,error:Ye,showErrorIcon:tt,helper:nt,showHelperIcon:ft,closeButton:ht,...gt},At)=>{const xt=useTokens();return jsxs(Box,{wFull:!0,maxW:"420px",children:[Be&&jsx$1(Text$8,{fontWeight:700,as:"label",color:xt.input.primary.text.label.default,mb:xt.spacing[2],display:"inline-block",fontSize:"14px",children:Be}),jsxs(Box,{position:"relative",children:[jsx$1(Input$c,{type:Le,p:xt.spacing[4],...gt,ref:At,borderColor:Ye&&xt.input.primary.border.negative,"data-has-value":!!gt.value&&String(gt.value).length>0}),(ht==null?void 0:ht.show)&&jsx$1(Box,{as:"button",position:"absolute",right:xt.spacing[6],top:"50%",transform:"translateY(-50%)",backgroundColor:"transparent",border:"none",p:0,zIndex:1e4,onClick:ht.onClose,children:jsx$1(XIcon,{})})]}),Ye&&jsxs(Flex,{mt:xt.spacing[2],align:"center",children:[tt&&jsx$1(Box,{display:"inline-block",mr:xt.spacing[2],children:jsx$1(ErrorIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",color:xt.input.primary.text.helper.negative,children:Ye})]}),nt&&jsxs(Flex,{mt:xt.spacing[2],align:"center",children:[ft&&jsx$1(Box,{display:"inline-block",mr:xt.spacing[2],children:jsx$1(SuccessIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",fontWeight:400,color:xt.input.primary.text.helper.default,children:nt})]})]})}),DropdownComposed=React.forwardRef(({label:Be,placeholder:Le="Choose an option",value:Ye,onChange:tt,options:nt,error:ft,helper:ht,showErrorIcon:gt,showHelperIcon:At,tabIndex:xt,onKeyDown:yt,enterKeyHint:Ct},Et)=>{const vt=useTokens(),[kt,bt]=React.useState(!1),[wt,It]=React.useState(!1),Rt=React.useRef(null),Tt=React.useRef(null),Bt=React.useRef(null);React.useImperativeHandle(Et,()=>Tt.current),React.useEffect(()=>{kt&&Bt.current&&setTimeout(()=>{var $t;($t=Bt.current)==null||$t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},100)},[kt]);const Pt=nt.find($t=>$t.value===Ye),Dt=()=>{bt($t=>!$t)},Ot=$t=>{tt==null||tt($t),bt(!1)},Lt=()=>{It(!0)};return jsxs(Box,{wFull:!0,maxW:"420px",ref:Rt,position:"relative",onBlur:$t=>{var qt;It(!1),(qt=Rt.current)!=null&&qt.contains($t.relatedTarget)||bt(!1)},children:[Be&&jsx$1(Text$8,{fontWeight:700,as:"label",color:vt.input.primary.text.label.default,mb:vt.spacing[2],display:"inline-block",fontSize:"14px",children:Be}),jsxs(Box,{position:"relative",children:[jsxs("button",{ref:Tt,type:"button",onClick:Dt,onFocus:Lt,onKeyDown:yt,tabIndex:xt??0,"aria-haspopup":"listbox","aria-expanded":kt,style:{width:"100%",position:"relative",display:"flex",alignItems:"center",padding:vt.spacing[4],paddingRight:"48px",backgroundColor:ft?"transparent":wt?vt.input.primary.surface.active:vt.input.primary.surface.default,border:`1px solid ${ft?vt.input.primary.border.negative:wt?"transparent":vt.input.primary.border.default}`,borderRadius:vt.spacing[2],fontSize:vt.typography.fontSize.lg,color:vt.input.primary.text.field.default,cursor:"pointer",userSelect:"none",textAlign:"left",fontFamily:"inherit",outline:wt?"2px solid #3db0f7":"none",outlineOffset:wt?"2px":"0"},children:[jsx$1(Text$8,{color:Pt?vt.input.primary.text.field.default:vt.input.primary.text.field.placeholder,fontSize:vt.typography.fontSize.lg,children:(Pt==null?void 0:Pt.label)||Le}),jsx$1(Box,{position:"absolute",right:vt.spacing[4],display:"flex",align:"center",style:{pointerEvents:"none"},children:kt?jsx$1(UpArrow,{}):jsx$1(DownArrow,{})})]}),kt&&jsx$1(Box,{ref:Bt,position:"absolute",top:"100%",left:"0",right:"0",zIndex:10,backgroundColor:vt.input.primary.surface.default,borderWidth:"1px",borderColor:ft?vt.input.primary.border.negative:vt.input.primary.border.default,borderRadius:vt.spacing[2],mt:"8px",maxH:"320px",overflow:"auto",style:{boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:nt.map($t=>jsx$1(Box,{p:vt.spacing[4],onClick:()=>Ot($t.value),onMouseDown:qt=>qt.preventDefault(),style:{cursor:"pointer",backgroundColor:Ye===$t.value?vt.color.surface.secondary[100]:"transparent"},onMouseEnter:qt=>{Ye!==$t.value&&(qt.currentTarget.style.backgroundColor=vt.color.surface.secondary[50])},onMouseLeave:qt=>{Ye!==$t.value&&(qt.currentTarget.style.backgroundColor="transparent")},children:jsx$1(Text$8,{color:vt.input.primary.text.field.default,fontSize:vt.typography.fontSize.lg,children:$t.label})},$t.value))})]}),ft&&jsxs(Flex,{mt:vt.spacing[2],align:"center",children:[gt&&jsx$1(Box,{display:"inline-block",mr:vt.spacing[2],children:jsx$1(ErrorIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",color:vt.input.primary.text.helper.negative,children:ft})]}),ht&&jsxs(Flex,{mt:vt.spacing[2],align:"center",children:[At&&jsx$1(Box,{display:"inline-block",mr:vt.spacing[2],children:jsx$1(SuccessIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",fontWeight:400,color:vt.input.primary.text.helper.default,children:ht})]})]})}),Subtitle$6=({children:Be,...Le})=>{const Ye=useTokens();return jsx$1(Text$8,{as:"h5",fontSize:Ye.typography.fontSize.base,textAlign:"center",m:Ye.spacing[0],letterSpacing:Ye.typography.letterSpacing.tight,lineHeight:Ye.typography.lineHeight.normal,fontWeight:Ye.typography.fontWeight.medium,color:Ye.color.text.body.secondary,...Le,children:Be})},warn$1=(Be,Le,Ye,tt)=>{var ft,ht,gt,At;const nt=[Ye,{code:Le,...tt||{}}];if((ht=(ft=Be==null?void 0:Be.services)==null?void 0:ft.logger)!=null&&ht.forward)return Be.services.logger.forward(nt,"warn","react-i18next::",!0);isString$3(nt[0])&&(nt[0]=`react-i18next:: ${nt[0]}`),(At=(gt=Be==null?void 0:Be.services)==null?void 0:gt.logger)!=null&&At.warn?Be.services.logger.warn(...nt):console!=null&&console.warn&&console.warn(...nt)},alreadyWarned={},warnOnce=(Be,Le,Ye,tt)=>{isString$3(Ye)&&alreadyWarned[Ye]||(isString$3(Ye)&&(alreadyWarned[Ye]=new Date),warn$1(Be,Le,Ye,tt))},loadedClb=(Be,Le)=>()=>{if(Be.isInitialized)Le();else{const Ye=()=>{setTimeout(()=>{Be.off("initialized",Ye)},0),Le()};Be.on("initialized",Ye)}},loadNamespaces=(Be,Le,Ye)=>{Be.loadNamespaces(Le,loadedClb(Be,Ye))},loadLanguages=(Be,Le,Ye,tt)=>{if(isString$3(Ye)&&(Ye=[Ye]),Be.options.preload&&Be.options.preload.indexOf(Le)>-1)return loadNamespaces(Be,Ye,tt);Ye.forEach(nt=>{Be.options.ns.indexOf(nt)<0&&Be.options.ns.push(nt)}),Be.loadLanguages(Le,loadedClb(Be,tt))},hasLoadedNamespace=(Be,Le,Ye={})=>!Le.languages||!Le.languages.length?(warnOnce(Le,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:Le.languages}),!0):Le.hasLoadedNamespace(Be,{lng:Ye.lng,precheck:(tt,nt)=>{if(Ye.bindI18n&&Ye.bindI18n.indexOf("languageChanging")>-1&&tt.services.backendConnector.backend&&tt.isLanguageChangingTo&&!nt(tt.isLanguageChangingTo,Be))return!1}}),isString$3=Be=>typeof Be=="string",isObject$8=Be=>typeof Be=="object"&&Be!==null,matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity=Be=>htmlEntities[Be],unescape$1=Be=>Be.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions$1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1};const getDefaults=()=>defaultOptions$1;let i18nInstance;const getI18n=()=>i18nInstance,I18nContext=React.createContext();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(Le){Le.forEach(Ye=>{this.usedNamespaces[Ye]||(this.usedNamespaces[Ye]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const usePrevious=(Be,Le)=>{const Ye=React.useRef();return React.useEffect(()=>{Ye.current=Be},[Be,Le]),Ye.current},alwaysNewT=(Be,Le,Ye,tt)=>Be.getFixedT(Le,Ye,tt),useMemoizedT=(Be,Le,Ye,tt)=>React.useCallback(alwaysNewT(Be,Le,Ye,tt),[Be,Le,Ye,tt]),useTranslation=(Be,Le={})=>{var Bt,Pt,Dt,Ot;const{i18n:Ye}=Le,{i18n:tt,defaultNS:nt}=React.useContext(I18nContext)||{},ft=Ye||tt||getI18n();if(ft&&!ft.reportNamespaces&&(ft.reportNamespaces=new ReportNamespaces),!ft){warnOnce(ft,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const Lt=($t,qt)=>isString$3(qt)?qt:isObject$8(qt)&&isString$3(qt.defaultValue)?qt.defaultValue:Array.isArray($t)?$t[$t.length-1]:$t,Wt=[Lt,{},!1];return Wt.t=Lt,Wt.i18n={},Wt.ready=!1,Wt}(Bt=ft.options.react)!=null&&Bt.wait&&warnOnce(ft,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const ht={...getDefaults(),...ft.options.react,...Le},{useSuspense:gt,keyPrefix:At}=ht;let xt=nt||((Pt=ft.options)==null?void 0:Pt.defaultNS);xt=isString$3(xt)?[xt]:xt||["translation"],(Ot=(Dt=ft.reportNamespaces).addUsedNamespaces)==null||Ot.call(Dt,xt);const yt=(ft.isInitialized||ft.initializedStoreOnce)&&xt.every(Lt=>hasLoadedNamespace(Lt,ft,ht)),Ct=useMemoizedT(ft,Le.lng||null,ht.nsMode==="fallback"?xt:xt[0],At),Et=()=>Ct,vt=()=>alwaysNewT(ft,Le.lng||null,ht.nsMode==="fallback"?xt:xt[0],At),[kt,bt]=React.useState(Et);let wt=xt.join();Le.lng&&(wt=`${Le.lng}${wt}`);const It=usePrevious(wt),Rt=React.useRef(!0);React.useEffect(()=>{const{bindI18n:Lt,bindI18nStore:Wt}=ht;Rt.current=!0,!yt&&!gt&&(Le.lng?loadLanguages(ft,Le.lng,xt,()=>{Rt.current&&bt(vt)}):loadNamespaces(ft,xt,()=>{Rt.current&&bt(vt)})),yt&&It&&It!==wt&&Rt.current&&bt(vt);const $t=()=>{Rt.current&&bt(vt)};return Lt&&(ft==null||ft.on(Lt,$t)),Wt&&(ft==null||ft.store.on(Wt,$t)),()=>{Rt.current=!1,ft&&Lt&&(Lt==null||Lt.split(" ").forEach(qt=>ft.off(qt,$t))),Wt&&ft&&Wt.split(" ").forEach(qt=>ft.store.off(qt,$t))}},[ft,wt]),React.useEffect(()=>{Rt.current&&yt&&bt(Et)},[ft,At,yt]);const Tt=[kt,ft,yt];if(Tt.t=kt,Tt.i18n=ft,Tt.ready=yt,yt||!yt&&!gt)return Tt;throw new Promise(Lt=>{Le.lng?loadLanguages(ft,Le.lng,xt,()=>Lt()):loadNamespaces(ft,xt,()=>Lt())})};function I18nextProvider({i18n:Be,defaultNS:Le,children:Ye}){const tt=React.useMemo(()=>({i18n:Be,defaultNS:Le}),[Be,Le]);return React.createElement(I18nContext.Provider,{value:tt},Ye)}const isObject$7=Be=>typeof Be=="object"&&Be!==null&&!Array.isArray(Be),deepMerge$1=(Be,Le)=>{const Ye={...Be};for(const tt of Object.keys(Le)){const nt=Le[tt],ft=Ye[tt];isObject$7(ft)&&isObject$7(nt)?Ye[tt]=deepMerge$1(ft,nt):Ye[tt]=nt}return Ye},mergeWithOverrides=(Be,Le)=>Le?deepMerge$1(Be,Le):Be,colors={neutral:{light:"#ffffff",dark:"#000000"},brand:{50:"#e5f0ff",200:"#99c3ff",300:"#66a6ff",400:"#3388ff",500:"#006aff",600:"#0055cc",900:"#21273b"},gray:{50:"#fcfcfd",100:"#ebecef",200:"#c6c8d2",300:"#a3a8B8",500:"#60667c",700:"#3a3e4b",800:"#262831",900:"#14151a"},brandSecondary:{50:"#f2e2fe",500:"#820AD1"},positive:{50:"#E4FBF0",600:"#189F60",800:"#0C5030"},warn:{50:"#FFF7EB",400:"#FFB647",500:"#ff9900",950:"#523100"},negative:{50:"#FFF0F0",500:"#FF5A5F",600:"#E71111",950:"#240001"}},buildReferenceColors=Be=>({brand:{brand:Be.brand[500]},surface:{neutral:{light:Be.neutral.light,dark:Be.neutral.dark},primary:{50:Be.brand[50],400:Be.brand[400],500:Be.brand[500],600:Be.brand[600]},secondary:{0:Be.neutral.light,50:Be.gray[50],100:Be.gray[100],200:Be.gray[200],300:Be.gray[300],500:Be.gray[500],700:Be.gray[700],800:Be.gray[800],900:Be.gray[900]},statusSoft:{negative:Be.negative[50],warning:Be.warn[50],positive:Be.positive[50]},status:{negative:Be.negative[600],warning:Be.warn[500],positive:Be.positive[600]}},icon:{primary:Be.gray[500],secondary:Be.gray[800],accent:Be.brand[500],negative:Be.negative[600],warning:Be.warn[500],positive:Be.positive[600],invert:Be.neutral.light,success:Be.positive[600]},border:{primary:Be.gray[100],disabled:Be.gray[300],focus:Be.gray[500],accent:Be.brand[500],negative:Be.negative[500],warning:Be.warn[500],positive:Be.positive[600]},text:{body:{primary:Be.gray[800],secondary:Be.gray[500],tertiary:Be.gray[300],invert:Be.neutral.light},brand:{accent:Be.brand[500],brandSecondary:Be.brandSecondary[500]},status:{negative:Be.negative[500],warning:Be.warn[500],positive:Be.positive[600]}}}),lightColors=buildReferenceColors(colors),buildReferenceWithOverrides=(Be,Le)=>mergeWithOverrides(buildReferenceColors(Be),Le);colors.brand[500],colors.neutral.dark,colors.neutral.light,colors.brand[900],colors.brand[600],colors.brand[500],colors.brand[400],colors.neutral.dark,colors.gray[900],colors.gray[800],colors.gray[700],colors.gray[500],colors.gray[300],colors.gray[200],colors.gray[100],colors.gray[50],colors.negative[950],colors.warn[950],colors.positive[800],colors.negative[600],colors.warn[500],colors.positive[600],colors.gray[500],colors.gray[200],colors.brand[500],colors.negative[600],colors.warn[500],colors.positive[600],colors.gray[900],colors.gray[700],colors.gray[500],colors.brand[500],colors.negative[600],colors.warn[500],colors.positive[600],colors.gray[200],colors.gray[500],colors.gray[700],colors.neutral.light,colors.brand[500],colors.brandSecondary[500],colors.negative[600],colors.warn[500],colors.positive[600];const buildButtonTokens=(Be,Le)=>mergeWithOverrides(buildButtonBase(Be),Le),buildButtonBase=Be=>({primary:{surface:{default:Be.surface.primary[500],hover:Be.surface.primary[400],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[100]},text:{default:Be.text.body.invert,disabled:Be.text.body.tertiary},border:{default:Be.surface.primary[500],hover:Be.surface.primary[400],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[100]}},secondary:{surface:{default:Be.surface.neutral.light,hover:Be.surface.primary[50],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[200]},text:{default:Be.text.brand.accent,disabled:Be.text.body.secondary},border:{default:Be.surface.primary[500],hover:Be.surface.primary[400],pressed:Be.surface.primary[600],disabled:Be.surface.secondary[100]}},tertiary:{text:Be.surface.primary[500],disabled:Be.surface.secondary[500]}}),button=buildButtonTokens(lightColors),buildInputTokens=(Be,Le)=>mergeWithOverrides(buildInputBase(Be),Le),buildInputBase=Be=>({primary:{surface:{default:Be.surface.secondary[50],hover:Be.surface.secondary[50],active:Be.surface.secondary[50],disabled:Be.surface.secondary[100]},text:{label:{default:Be.text.body.primary,disabled:Be.text.body.tertiary},field:{default:Be.text.body.primary,disabled:Be.text.body.tertiary,placeholder:Be.text.body.tertiary},helper:{default:Be.text.body.secondary,disabled:Be.text.body.tertiary,negative:Be.text.status.negative}},border:{default:Be.border.primary,active:Be.border.accent,disabled:Be.border.primary,negative:Be.border.negative}}}),input=buildInputTokens(lightColors),buildSpinnerTokens=(Be,Le)=>mergeWithOverrides(buildSpinnerBase(Be),Le),buildSpinnerBase=Be=>({surface:{primary:Be.surface.primary[500],secondary:Be.surface.primary[50]},text:{primary:Be.text.body.primary,secondary:Be.text.body.secondary}}),spinner$3=buildSpinnerTokens(lightColors),animations={duration:{fast:"150ms",normal:"300ms",slow:"500ms"},easing:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"}},shadows={none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",base:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},spacing$1={"-1":"-0.25rem",0:"0",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem",32:"8rem",40:"10rem",48:"12rem",56:"14rem",64:"16rem"},typography$1={fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},letterSpacing:{tighter:"-2px",tight:"-1px",normal:"0",wide:"1px",wider:"2px",widest:"4px"},fontFamily:{sans:['"DM Sans"',"system-ui","sans-serif"],mono:["Fira Code","monospace"]}},spacing={component:{xs:spacing$1[1],sm:spacing$1[2],md:spacing$1[3],lg:spacing$1[4],xl:spacing$1[6]},layout:{xs:spacing$1[4],sm:spacing$1[6],md:spacing$1[8],lg:spacing$1[12],xl:spacing$1[16],xxl:spacing$1[24]},container:{xs:spacing$1[3],sm:spacing$1[4],md:spacing$1[6],lg:spacing$1[8],xl:spacing$1[12]},stack:{xs:spacing$1[2],sm:spacing$1[3],md:spacing$1[4],lg:spacing$1[6],xl:spacing$1[8]},inline:{xs:spacing$1[1],sm:spacing$1[2],md:spacing$1[3],lg:spacing$1[4]}},typography={heading:{h1:{fontSize:typography$1.fontSize["4xl"],fontWeight:typography$1.fontWeight.bold,lineHeight:typography$1.lineHeight.tight},h2:{fontSize:typography$1.fontSize["3xl"],fontWeight:typography$1.fontWeight.bold,lineHeight:typography$1.lineHeight.tight},h3:{fontSize:typography$1.fontSize["2xl"],fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.snug},h4:{fontSize:typography$1.fontSize.xl,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.snug},h5:{fontSize:typography$1.fontSize.lg,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.normal},h6:{fontSize:typography$1.fontSize.base,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.normal}},body:{large:{fontSize:typography$1.fontSize.lg,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.relaxed},default:{fontSize:typography$1.fontSize.base,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.normal},small:{fontSize:typography$1.fontSize.sm,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.normal}},ui:{buttonLarge:{fontSize:typography$1.fontSize.base,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.none},buttonDefault:{fontSize:typography$1.fontSize.sm,fontWeight:typography$1.fontWeight.semibold,lineHeight:typography$1.lineHeight.none},buttonSmall:{fontSize:typography$1.fontSize.xs,fontWeight:typography$1.fontWeight.medium,lineHeight:typography$1.lineHeight.none},label:{fontSize:typography$1.fontSize.sm,fontWeight:typography$1.fontWeight.medium,lineHeight:typography$1.lineHeight.normal},caption:{fontSize:typography$1.fontSize.xs,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.normal}},code:{inline:{fontSize:typography$1.fontSize.sm,fontFamily:typography$1.fontFamily.mono,fontWeight:typography$1.fontWeight.normal},block:{fontSize:typography$1.fontSize.sm,fontFamily:typography$1.fontFamily.mono,fontWeight:typography$1.fontWeight.normal,lineHeight:typography$1.lineHeight.relaxed}}},tokens={primitives:{color:colors,typography:typography$1,spacing:spacing$1,shadow:shadows,animation:animations},reference:{colors:lightColors,spacing,typography},color:lightColors,typography:typography$1,spacing:spacing$1,button,input,spinner:spinner$3};function hexToHsl(Be){if(typeof Be!="string")throw new Error(`Invalid hex color: expected string, received ${typeof Be}`);if(Be.length!==7)throw new Error(`Invalid hex color: "${Be}" must be exactly 7 characters long (e.g., "#ffffff")`);if(!Be.startsWith("#"))throw new Error(`Invalid hex color: "${Be}" must start with '#'`);const Le=Be.slice(1);if(!/^[0-9A-Fa-f]{6}$/.test(Le))throw new Error(`Invalid hex color: "${Be}" contains invalid hexadecimal digits. Use only 0-9, A-F, or a-f.`);const Ye=Number.parseInt(Be.slice(1,3),16)/255,tt=Number.parseInt(Be.slice(3,5),16)/255,nt=Number.parseInt(Be.slice(5,7),16)/255,ft=Math.max(Ye,tt,nt),ht=Math.min(Ye,tt,nt);let gt=0,At=0;const xt=(ft+ht)/2;if(ft!==ht){const yt=ft-ht;switch(At=xt>.5?yt/(2-ft-ht):yt/(ft+ht),ft){case Ye:gt=(tt-nt)/yt+(tt<nt?6:0);break;case tt:gt=(nt-Ye)/yt+2;break;case nt:gt=(Ye-tt)/yt+4;break}gt/=6}return[gt*360,At*100,xt*100]}function hslToHex(Be,Le,Ye){if(typeof Be!="number"||typeof Le!="number"||typeof Ye!="number")throw new Error(`Invalid HSL values: all parameters must be numbers. Received hue: ${typeof Be}, saturation: ${typeof Le}, lightness: ${typeof Ye}`);if(!Number.isFinite(Be))throw new Error(`Invalid hue value: ${Be}. Hue must be a finite number.`);if(!Number.isFinite(Le))throw new Error(`Invalid saturation value: ${Le}. Saturation must be a finite number.`);if(!Number.isFinite(Ye))throw new Error(`Invalid lightness value: ${Ye}. Lightness must be a finite number.`);if(Be<0||Be>360)throw new Error(`Invalid hue value: ${Be}. Hue must be between 0 and 360 degrees.`);if(Le<0||Le>100)throw new Error(`Invalid saturation value: ${Le}. Saturation must be between 0 and 100.`);if(Ye<0||Ye>100)throw new Error(`Invalid lightness value: ${Ye}. Lightness must be between 0 and 100.`);const tt=Be/360,nt=Le/100,ft=Ye/100,ht=(Ct,Et,vt)=>{let kt=vt;return kt<0&&(kt+=1),kt>1&&(kt-=1),kt<1/6?Ct+(Et-Ct)*6*kt:kt<1/2?Et:kt<2/3?Ct+(Et-Ct)*(2/3-kt)*6:Ct};let gt,At,xt;if(nt===0)gt=ft,At=ft,xt=ft;else{const Ct=ft<.5?ft*(1+nt):ft+nt-ft*nt,Et=2*ft-Ct;gt=ht(Et,Ct,tt+1/3),At=ht(Et,Ct,tt),xt=ht(Et,Ct,tt-1/3)}const yt=Ct=>{const Et=Math.round(Ct*255).toString(16);return Et.length===1?`0${Et}`:Et};return`#${yt(gt)}${yt(At)}${yt(xt)}`}function getBrandColors(Be){if(!Be)return colors.brand;const Le=Be.replace("#","");if(!/^[0-9A-F]{6}$/i.test(Le))throw new Error(`Invalid hex color: ${Be}`);const[Ye,tt,nt]=hexToHsl(`#${Le}`);return{50:hslToHex(Ye,Math.max(tt-10,20),Math.min(nt+45,97)),200:hslToHex(Ye,Math.max(tt-5,30),Math.min(nt+25,85)),300:hslToHex(Ye,tt,Math.min(nt+15,75)),400:hslToHex(Ye,tt,Math.min(nt+8,65)),500:`#${Le}`,600:hslToHex(Ye,Math.min(tt+10,90),Math.max(nt-15,15)),900:hslToHex(Ye,Math.min(tt+20,95),Math.max(nt-35,8))}}function hasOnlyOneColor(Be){return Object.keys(Be).length===1}function isSingle500Color(Be){return hasOnlyOneColor(Be)&&"500"in Be}function getBrandColorKeys(){return["50","200","300","400","500","600","900"]}function smartBrandColorMerging(Be,Le){if(!Be||Object.keys(Be).length===0)return Le;if(isSingle500Color(Be))return getBrandColors(Be[500]);const Ye=getBrandColorKeys(),tt=Object.keys(Be);if(Ye.filter(At=>!tt.includes(At)).length===0)return Be;const ft=Be[500]||Object.values(Be)[0],ht=getBrandColors(ft),gt={50:"",200:"",300:"",400:"",500:"",600:"",900:""};for(const At of Ye)if(Be[At])gt[At]=Be[At];else{const xt=At;gt[At]=ht[xt]}return gt}const buildColorPrimitives=Be=>{const Le=colors,Ye={...Be.colors||{}};return Ye.brand&&(Ye.brand=smartBrandColorMerging(Ye.brand,Le.brand)),mergeWithOverrides(Le,Ye)};function createTokens(Be={}){var gt;const Le=buildColorPrimitives(Be),Ye=buildReferenceWithOverrides(Le,(gt=Be.reference)==null?void 0:gt.colors),tt=mergeWithOverrides(typography$1,Be.typography),nt=buildButtonTokens(Ye,Be.button),ft=buildInputTokens(Ye),ht=buildSpinnerTokens(Ye,Be.spinner);return{primitives:{color:Le,typography:tt,spacing:spacing$1,shadow:shadows,animation:animations},reference:{colors:Ye,spacing,typography},color:Ye,typography:tt,spacing:spacing$1,button:nt,input:ft,spinner:ht}}const validateCustomTokens=Be=>!(!Be||typeof Be!="object"||Be.colors&&(Be.colors.brand&&typeof Be.colors.brand!="object"||Be.colors.gray&&typeof Be.colors.gray!="object"||Be.colors.brandSecondary&&typeof Be.colors.brandSecondary!="object")),ThemeProvider=({children:Be,tokens:Le})=>{let Ye=tokens;if(Le)if(!validateCustomTokens(Le))console.warn("Invalid custom tokens provided to ThemeProvider, falling back to default tokens"),Ye=tokens;else try{Ye=createTokens(Le)}catch(tt){console.error("Error creating custom tokens, falling back to default tokens:",tt),Ye=tokens}return jsx$1(ThemeProvider$1,{theme:Ye,children:jsx$1(I18nextProvider,{i18n,children:Be})})},Card=({image:Be,title:Le,body:Ye,fullImageSize:tt})=>{const nt=useTokens();return jsx$1(Box,{backgroundColor:nt.color.surface.secondary[800],wFull:!0,h:"139px",borderRadius:"24px",xsH:"120px",children:jsxs(Flex,{justify:"center",align:"center",hFull:!0,children:[jsx$1(Box,{m:tt?"0":"15px 0",w:"129px",xsW:"115px",children:jsx$1(Flex,{align:"center",justify:"center",children:Be})}),jsx$1(Flex,{flex:1,children:jsxs(Box,{px:"1rem",children:[jsx$1(Text$8,{color:nt.primitives.color.neutral.light,fontWeight:700,fontSize:nt.typography.fontSize.sm,children:Le}),jsx$1(Text$8,{color:nt.primitives.color.neutral.light,fontWeight:400,fontSize:nt.typography.fontSize.sm,children:Ye})]})})]})})};function ModalRoot({children:Be,fullScreen:Le}){return typeof document>"u"?null:Le?ReactDOM.createPortal(Be,document.body):jsx$1(Fragment,{children:Be})}const Modal$3=({open:Be,children:Le,onClose:Ye,"aria-labelledby":tt,bg:nt="white",fullScreen:ft=!0})=>{const ht=React.useRef(null);if(React.useEffect(()=>{if(!Be)return;const At=xt=>{xt.key==="Escape"&&Ye&&Ye()};return document.addEventListener("keydown",At),ft&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",At),ft&&(document.body.style.overflow="")}},[Be,Ye,ft]),!Be)return null;const gt={ref:ht,"aria-modal":!0,"aria-labelledby":tt,onClick:At=>At.target===At.currentTarget&&(Ye==null?void 0:Ye()),bg:nt,zIndex:1e5,overflow:"scroll"};return jsx$1(ModalRoot,{fullScreen:ft,children:ft?jsx$1(Box,{position:"fixed",inset:0,w:"100vw",h:"100dvh",...gt,children:Le}):jsx$1(Box,{position:"absolute",inset:0,w:"100%",h:"100%",...gt,children:Le})})};function r$1(Be){var Le,Ye,tt="";if(typeof Be=="string"||typeof Be=="number")tt+=Be;else if(typeof Be=="object")if(Array.isArray(Be))for(Le=0;Le<Be.length;Le++)Be[Le]&&(Ye=r$1(Be[Le]))&&(tt&&(tt+=" "),tt+=Ye);else for(Le in Be)Be[Le]&&(tt&&(tt+=" "),tt+=Le);return tt}function clsx$1(){for(var Be,Le,Ye=0,tt="";Ye<arguments.length;)(Be=arguments[Ye++])&&(Le=r$1(Be))&&(tt&&(tt+=" "),tt+=Le);return tt}var lottie$1={exports:{}};(function(module,exports){typeof document<"u"&&typeof navigator<"u"&&function(Be,Le){module.exports=Le()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(Le){_useWebWorker=!!Le},getWebWorker=function(){return _useWebWorker},setLocationHref=function(Le){locationHref=Le},getLocationHref=function(){return locationHref};function createTag(Be){return document.createElement(Be)}function extendPrototype(Be,Le){var Ye,tt=Be.length,nt;for(Ye=0;Ye<tt;Ye+=1){nt=Be[Ye].prototype;for(var ft in nt)Object.prototype.hasOwnProperty.call(nt,ft)&&(Le.prototype[ft]=nt[ft])}}function getDescriptor(Be,Le){return Object.getOwnPropertyDescriptor(Be,Le)}function createProxyFunction(Be){function Le(){}return Le.prototype=Be,Le}var audioControllerFactory=function(){function Be(Le){this.audios=[],this.audioFactory=Le,this._volume=1,this._isMuted=!1}return Be.prototype={addAudio:function(Ye){this.audios.push(Ye)},pause:function(){var Ye,tt=this.audios.length;for(Ye=0;Ye<tt;Ye+=1)this.audios[Ye].pause()},resume:function(){var Ye,tt=this.audios.length;for(Ye=0;Ye<tt;Ye+=1)this.audios[Ye].resume()},setRate:function(Ye){var tt,nt=this.audios.length;for(tt=0;tt<nt;tt+=1)this.audios[tt].setRate(Ye)},createAudio:function(Ye){return this.audioFactory?this.audioFactory(Ye):window.Howl?new window.Howl({src:[Ye]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(Ye){this.audioFactory=Ye},setVolume:function(Ye){this._volume=Ye,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var Ye,tt=this.audios.length;for(Ye=0;Ye<tt;Ye+=1)this.audios[Ye].volume(this._volume*(this._isMuted?0:1))}},function(){return new Be}}(),createTypedArray=function(){function Be(Ye,tt){var nt=0,ft=[],ht;switch(Ye){case"int16":case"uint8c":ht=1;break;default:ht=1.1;break}for(nt=0;nt<tt;nt+=1)ft.push(ht);return ft}function Le(Ye,tt){return Ye==="float32"?new Float32Array(tt):Ye==="int16"?new Int16Array(tt):Ye==="uint8c"?new Uint8ClampedArray(tt):Be(Ye,tt)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?Le:Be}();function createSizedArray(Be){return Array.apply(null,{length:Be})}function _typeof$6(Be){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$6(Be)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var Be=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],Le,Ye=Be.length;for(Le=0;Le<Ye;Le+=1)BMMath[Be[Le]]=Math[Be[Le]]})(),BMMath.random=Math.random,BMMath.abs=function(Be){var Le=_typeof$6(Be);if(Le==="object"&&Be.length){var Ye=createSizedArray(Be.length),tt,nt=Be.length;for(tt=0;tt<nt;tt+=1)Ye[tt]=Math.abs(Be[tt]);return Ye}return Math.abs(Be)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(Be){Be.style.position="absolute",Be.style.top=0,Be.style.left=0,Be.style.display="block",Be.style.transformOrigin="0 0",Be.style.webkitTransformOrigin="0 0",Be.style.backfaceVisibility="visible",Be.style.webkitBackfaceVisibility="visible",Be.style.transformStyle="preserve-3d",Be.style.webkitTransformStyle="preserve-3d",Be.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(Be,Le,Ye,tt){this.type=Be,this.currentTime=Le,this.totalTime=Ye,this.direction=tt<0?-1:1}function BMCompleteEvent(Be,Le){this.type=Be,this.direction=Le<0?-1:1}function BMCompleteLoopEvent(Be,Le,Ye,tt){this.type=Be,this.currentLoop=Ye,this.totalLoops=Le,this.direction=tt<0?-1:1}function BMSegmentStartEvent(Be,Le,Ye){this.type=Be,this.firstFrame=Le,this.totalFrames=Ye}function BMDestroyEvent(Be,Le){this.type=Be,this.target=Le}function BMRenderFrameErrorEvent(Be,Le){this.type="renderFrameError",this.nativeError=Be,this.currentTime=Le}function BMConfigErrorEvent(Be){this.type="configError",this.nativeError=Be}var createElementID=function(){var Be=0;return function(){return Be+=1,idPrefix$1+"__lottie_element_"+Be}}();function HSVtoRGB(Be,Le,Ye){var tt,nt,ft,ht,gt,At,xt,yt;switch(ht=Math.floor(Be*6),gt=Be*6-ht,At=Ye*(1-Le),xt=Ye*(1-gt*Le),yt=Ye*(1-(1-gt)*Le),ht%6){case 0:tt=Ye,nt=yt,ft=At;break;case 1:tt=xt,nt=Ye,ft=At;break;case 2:tt=At,nt=Ye,ft=yt;break;case 3:tt=At,nt=xt,ft=Ye;break;case 4:tt=yt,nt=At,ft=Ye;break;case 5:tt=Ye,nt=At,ft=xt;break}return[tt,nt,ft]}function RGBtoHSV(Be,Le,Ye){var tt=Math.max(Be,Le,Ye),nt=Math.min(Be,Le,Ye),ft=tt-nt,ht,gt=tt===0?0:ft/tt,At=tt/255;switch(tt){case nt:ht=0;break;case Be:ht=Le-Ye+ft*(Le<Ye?6:0),ht/=6*ft;break;case Le:ht=Ye-Be+ft*2,ht/=6*ft;break;case Ye:ht=Be-Le+ft*4,ht/=6*ft;break}return[ht,gt,At]}function addSaturationToRGB(Be,Le){var Ye=RGBtoHSV(Be[0]*255,Be[1]*255,Be[2]*255);return Ye[1]+=Le,Ye[1]>1?Ye[1]=1:Ye[1]<=0&&(Ye[1]=0),HSVtoRGB(Ye[0],Ye[1],Ye[2])}function addBrightnessToRGB(Be,Le){var Ye=RGBtoHSV(Be[0]*255,Be[1]*255,Be[2]*255);return Ye[2]+=Le,Ye[2]>1?Ye[2]=1:Ye[2]<0&&(Ye[2]=0),HSVtoRGB(Ye[0],Ye[1],Ye[2])}function addHueToRGB(Be,Le){var Ye=RGBtoHSV(Be[0]*255,Be[1]*255,Be[2]*255);return Ye[0]+=Le/360,Ye[0]>1?Ye[0]-=1:Ye[0]<0&&(Ye[0]+=1),HSVtoRGB(Ye[0],Ye[1],Ye[2])}var rgbToHex=function(){var Be=[],Le,Ye;for(Le=0;Le<256;Le+=1)Ye=Le.toString(16),Be[Le]=Ye.length===1?"0"+Ye:Ye;return function(tt,nt,ft){return tt<0&&(tt=0),nt<0&&(nt=0),ft<0&&(ft=0),"#"+Be[tt]+Be[nt]+Be[ft]}}(),setSubframeEnabled=function(Le){subframeEnabled=!!Le},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(Le){expressionsPlugin=Le},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(Le){expressionsInterfaces=Le},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(Le){defaultCurveSegments=Le},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(Le){idPrefix$1=Le};function createNS(Be){return document.createElementNS(svgNS,Be)}function _typeof$5(Be){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$5(Be)}var dataManager=function(){var Be=1,Le=[],Ye,tt,nt={onmessage:function(){},postMessage:function(vt){Ye({data:vt})}},ft={postMessage:function(vt){nt.onmessage({data:vt})}};function ht(Et){if(window.Worker&&window.Blob&&getWebWorker()){var vt=new Blob(["var _workerSelf = self; self.onmessage = ",Et.toString()],{type:"text/javascript"}),kt=URL.createObjectURL(vt);return new Worker(kt)}return Ye=Et,nt}function gt(){tt||(tt=ht(function(vt){function kt(){function wt(Xt,_t){var Mt,jt,zt=Xt.length,Gt,Yt,ar,tr;for(jt=0;jt<zt;jt+=1)if(Mt=Xt[jt],"ks"in Mt&&!Mt.completed){if(Mt.completed=!0,Mt.hasMask){var sr=Mt.masksProperties;for(Yt=sr.length,Gt=0;Gt<Yt;Gt+=1)if(sr[Gt].pt.k.i)Pt(sr[Gt].pt.k);else for(tr=sr[Gt].pt.k.length,ar=0;ar<tr;ar+=1)sr[Gt].pt.k[ar].s&&Pt(sr[Gt].pt.k[ar].s[0]),sr[Gt].pt.k[ar].e&&Pt(sr[Gt].pt.k[ar].e[0])}Mt.ty===0?(Mt.layers=Tt(Mt.refId,_t),wt(Mt.layers,_t)):Mt.ty===4?Bt(Mt.shapes):Mt.ty===5&&Ut(Mt)}}function It(Xt,_t){if(Xt){var Mt=0,jt=Xt.length;for(Mt=0;Mt<jt;Mt+=1)Xt[Mt].t===1&&(Xt[Mt].data.layers=Tt(Xt[Mt].data.refId,_t),wt(Xt[Mt].data.layers,_t))}}function Rt(Xt,_t){for(var Mt=0,jt=_t.length;Mt<jt;){if(_t[Mt].id===Xt)return _t[Mt];Mt+=1}return null}function Tt(Xt,_t){var Mt=Rt(Xt,_t);return Mt?Mt.layers.__used?JSON.parse(JSON.stringify(Mt.layers)):(Mt.layers.__used=!0,Mt.layers):null}function Bt(Xt){var _t,Mt=Xt.length,jt,zt;for(_t=Mt-1;_t>=0;_t-=1)if(Xt[_t].ty==="sh")if(Xt[_t].ks.k.i)Pt(Xt[_t].ks.k);else for(zt=Xt[_t].ks.k.length,jt=0;jt<zt;jt+=1)Xt[_t].ks.k[jt].s&&Pt(Xt[_t].ks.k[jt].s[0]),Xt[_t].ks.k[jt].e&&Pt(Xt[_t].ks.k[jt].e[0]);else Xt[_t].ty==="gr"&&Bt(Xt[_t].it)}function Pt(Xt){var _t,Mt=Xt.i.length;for(_t=0;_t<Mt;_t+=1)Xt.i[_t][0]+=Xt.v[_t][0],Xt.i[_t][1]+=Xt.v[_t][1],Xt.o[_t][0]+=Xt.v[_t][0],Xt.o[_t][1]+=Xt.v[_t][1]}function Dt(Xt,_t){var Mt=_t?_t.split("."):[100,100,100];return Xt[0]>Mt[0]?!0:Mt[0]>Xt[0]?!1:Xt[1]>Mt[1]?!0:Mt[1]>Xt[1]?!1:Xt[2]>Mt[2]?!0:Mt[2]>Xt[2]?!1:null}var Ot=function(){var Xt=[4,4,14];function _t(jt){var zt=jt.t.d;jt.t.d={k:[{s:zt,t:0}]}}function Mt(jt){var zt,Gt=jt.length;for(zt=0;zt<Gt;zt+=1)jt[zt].ty===5&&_t(jt[zt])}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}(),Lt=function(){var Xt=[4,7,99];return function(_t){if(_t.chars&&!Dt(Xt,_t.v)){var Mt,jt=_t.chars.length;for(Mt=0;Mt<jt;Mt+=1){var zt=_t.chars[Mt];zt.data&&zt.data.shapes&&(Bt(zt.data.shapes),zt.data.ip=0,zt.data.op=99999,zt.data.st=0,zt.data.sr=1,zt.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},_t.chars[Mt].t||(zt.data.shapes.push({ty:"no"}),zt.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),Wt=function(){var Xt=[5,7,15];function _t(jt){var zt=jt.t.p;typeof zt.a=="number"&&(zt.a={a:0,k:zt.a}),typeof zt.p=="number"&&(zt.p={a:0,k:zt.p}),typeof zt.r=="number"&&(zt.r={a:0,k:zt.r})}function Mt(jt){var zt,Gt=jt.length;for(zt=0;zt<Gt;zt+=1)jt[zt].ty===5&&_t(jt[zt])}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}(),$t=function(){var Xt=[4,1,9];function _t(jt){var zt,Gt=jt.length,Yt,ar;for(zt=0;zt<Gt;zt+=1)if(jt[zt].ty==="gr")_t(jt[zt].it);else if(jt[zt].ty==="fl"||jt[zt].ty==="st")if(jt[zt].c.k&&jt[zt].c.k[0].i)for(ar=jt[zt].c.k.length,Yt=0;Yt<ar;Yt+=1)jt[zt].c.k[Yt].s&&(jt[zt].c.k[Yt].s[0]/=255,jt[zt].c.k[Yt].s[1]/=255,jt[zt].c.k[Yt].s[2]/=255,jt[zt].c.k[Yt].s[3]/=255),jt[zt].c.k[Yt].e&&(jt[zt].c.k[Yt].e[0]/=255,jt[zt].c.k[Yt].e[1]/=255,jt[zt].c.k[Yt].e[2]/=255,jt[zt].c.k[Yt].e[3]/=255);else jt[zt].c.k[0]/=255,jt[zt].c.k[1]/=255,jt[zt].c.k[2]/=255,jt[zt].c.k[3]/=255}function Mt(jt){var zt,Gt=jt.length;for(zt=0;zt<Gt;zt+=1)jt[zt].ty===4&&_t(jt[zt].shapes)}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}(),qt=function(){var Xt=[4,4,18];function _t(jt){var zt,Gt=jt.length,Yt,ar;for(zt=Gt-1;zt>=0;zt-=1)if(jt[zt].ty==="sh")if(jt[zt].ks.k.i)jt[zt].ks.k.c=jt[zt].closed;else for(ar=jt[zt].ks.k.length,Yt=0;Yt<ar;Yt+=1)jt[zt].ks.k[Yt].s&&(jt[zt].ks.k[Yt].s[0].c=jt[zt].closed),jt[zt].ks.k[Yt].e&&(jt[zt].ks.k[Yt].e[0].c=jt[zt].closed);else jt[zt].ty==="gr"&&_t(jt[zt].it)}function Mt(jt){var zt,Gt,Yt=jt.length,ar,tr,sr,ur;for(Gt=0;Gt<Yt;Gt+=1){if(zt=jt[Gt],zt.hasMask){var rr=zt.masksProperties;for(tr=rr.length,ar=0;ar<tr;ar+=1)if(rr[ar].pt.k.i)rr[ar].pt.k.c=rr[ar].cl;else for(ur=rr[ar].pt.k.length,sr=0;sr<ur;sr+=1)rr[ar].pt.k[sr].s&&(rr[ar].pt.k[sr].s[0].c=rr[ar].cl),rr[ar].pt.k[sr].e&&(rr[ar].pt.k[sr].e[0].c=rr[ar].cl)}zt.ty===4&&_t(zt.shapes)}}return function(jt){if(Dt(Xt,jt.v)&&(Mt(jt.layers),jt.assets)){var zt,Gt=jt.assets.length;for(zt=0;zt<Gt;zt+=1)jt.assets[zt].layers&&Mt(jt.assets[zt].layers)}}}();function Ht(Xt){Xt.__complete||($t(Xt),Ot(Xt),Lt(Xt),Wt(Xt),qt(Xt),wt(Xt.layers,Xt.assets),It(Xt.chars,Xt.assets),Xt.__complete=!0)}function Ut(Xt){Xt.t.a.length===0&&"m"in Xt.t.p}var Ft={};return Ft.completeData=Ht,Ft.checkColors=$t,Ft.checkChars=Lt,Ft.checkPathProperties=Wt,Ft.checkShapes=qt,Ft.completeLayers=wt,Ft}if(ft.dataManager||(ft.dataManager=kt()),ft.assetLoader||(ft.assetLoader=function(){function wt(Rt){var Tt=Rt.getResponseHeader("content-type");return Tt&&Rt.responseType==="json"&&Tt.indexOf("json")!==-1||Rt.response&&_typeof$5(Rt.response)==="object"?Rt.response:Rt.response&&typeof Rt.response=="string"?JSON.parse(Rt.response):Rt.responseText?JSON.parse(Rt.responseText):null}function It(Rt,Tt,Bt,Pt){var Dt,Ot=new XMLHttpRequest;try{Ot.responseType="json"}catch{}Ot.onreadystatechange=function(){if(Ot.readyState===4)if(Ot.status===200)Dt=wt(Ot),Bt(Dt);else try{Dt=wt(Ot),Bt(Dt)}catch(Lt){Pt&&Pt(Lt)}};try{Ot.open(["G","E","T"].join(""),Rt,!0)}catch{Ot.open(["G","E","T"].join(""),Tt+"/"+Rt,!0)}Ot.send()}return{load:It}}()),vt.data.type==="loadAnimation")ft.assetLoader.load(vt.data.path,vt.data.fullPath,function(wt){ft.dataManager.completeData(wt),ft.postMessage({id:vt.data.id,payload:wt,status:"success"})},function(){ft.postMessage({id:vt.data.id,status:"error"})});else if(vt.data.type==="complete"){var bt=vt.data.animation;ft.dataManager.completeData(bt),ft.postMessage({id:vt.data.id,payload:bt,status:"success"})}else vt.data.type==="loadData"&&ft.assetLoader.load(vt.data.path,vt.data.fullPath,function(wt){ft.postMessage({id:vt.data.id,payload:wt,status:"success"})},function(){ft.postMessage({id:vt.data.id,status:"error"})})}),tt.onmessage=function(Et){var vt=Et.data,kt=vt.id,bt=Le[kt];Le[kt]=null,vt.status==="success"?bt.onComplete(vt.payload):bt.onError&&bt.onError()})}function At(Et,vt){Be+=1;var kt="processId_"+Be;return Le[kt]={onComplete:Et,onError:vt},kt}function xt(Et,vt,kt){gt();var bt=At(vt,kt);tt.postMessage({type:"loadAnimation",path:Et,fullPath:window.location.origin+window.location.pathname,id:bt})}function yt(Et,vt,kt){gt();var bt=At(vt,kt);tt.postMessage({type:"loadData",path:Et,fullPath:window.location.origin+window.location.pathname,id:bt})}function Ct(Et,vt,kt){gt();var bt=At(vt,kt);tt.postMessage({type:"complete",animation:Et,id:bt})}return{loadAnimation:xt,loadData:yt,completeAnimation:Ct}}(),ImagePreloader=function(){var Be=function(){var It=createTag("canvas");It.width=1,It.height=1;var Rt=It.getContext("2d");return Rt.fillStyle="rgba(0,0,0,0)",Rt.fillRect(0,0,1,1),It}();function Le(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function Ye(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function tt(It,Rt,Tt){var Bt="";if(It.e)Bt=It.p;else if(Rt){var Pt=It.p;Pt.indexOf("images/")!==-1&&(Pt=Pt.split("/")[1]),Bt=Rt+Pt}else Bt=Tt,Bt+=It.u?It.u:"",Bt+=It.p;return Bt}function nt(It){var Rt=0,Tt=setInterval((function(){var Bt=It.getBBox();(Bt.width||Rt>500)&&(this._imageLoaded(),clearInterval(Tt)),Rt+=1}).bind(this),50)}function ft(It){var Rt=tt(It,this.assetsPath,this.path),Tt=createNS("image");isSafari?this.testImageLoaded(Tt):Tt.addEventListener("load",this._imageLoaded,!1),Tt.addEventListener("error",(function(){Bt.img=Be,this._imageLoaded()}).bind(this),!1),Tt.setAttributeNS("http://www.w3.org/1999/xlink","href",Rt),this._elementHelper.append?this._elementHelper.append(Tt):this._elementHelper.appendChild(Tt);var Bt={img:Tt,assetData:It};return Bt}function ht(It){var Rt=tt(It,this.assetsPath,this.path),Tt=createTag("img");Tt.crossOrigin="anonymous",Tt.addEventListener("load",this._imageLoaded,!1),Tt.addEventListener("error",(function(){Bt.img=Be,this._imageLoaded()}).bind(this),!1),Tt.src=Rt;var Bt={img:Tt,assetData:It};return Bt}function gt(It){var Rt={assetData:It},Tt=tt(It,this.assetsPath,this.path);return dataManager.loadData(Tt,(function(Bt){Rt.img=Bt,this._footageLoaded()}).bind(this),(function(){Rt.img={},this._footageLoaded()}).bind(this)),Rt}function At(It,Rt){this.imagesLoadedCb=Rt;var Tt,Bt=It.length;for(Tt=0;Tt<Bt;Tt+=1)It[Tt].layers||(!It[Tt].t||It[Tt].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(It[Tt]))):It[Tt].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(It[Tt]))))}function xt(It){this.path=It||""}function yt(It){this.assetsPath=It||""}function Ct(It){for(var Rt=0,Tt=this.images.length;Rt<Tt;){if(this.images[Rt].assetData===It)return this.images[Rt].img;Rt+=1}return null}function Et(){this.imagesLoadedCb=null,this.images.length=0}function vt(){return this.totalImages===this.loadedAssets}function kt(){return this.totalFootages===this.loadedFootagesCount}function bt(It,Rt){It==="svg"?(this._elementHelper=Rt,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function wt(){this._imageLoaded=Le.bind(this),this._footageLoaded=Ye.bind(this),this.testImageLoaded=nt.bind(this),this.createFootageData=gt.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return wt.prototype={loadAssets:At,setAssetsPath:yt,setPath:xt,loadedImages:vt,loadedFootages:kt,destroy:Et,getAsset:Ct,createImgData:ht,createImageData:ft,imageLoaded:Le,footageLoaded:Ye,setCacheType:bt},wt}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(Le,Ye){if(this._cbs[Le])for(var tt=this._cbs[Le],nt=0;nt<tt.length;nt+=1)tt[nt](Ye)},addEventListener:function(Le,Ye){return this._cbs[Le]||(this._cbs[Le]=[]),this._cbs[Le].push(Ye),(function(){this.removeEventListener(Le,Ye)}).bind(this)},removeEventListener:function(Le,Ye){if(!Ye)this._cbs[Le]=null;else if(this._cbs[Le]){for(var tt=0,nt=this._cbs[Le].length;tt<nt;)this._cbs[Le][tt]===Ye&&(this._cbs[Le].splice(tt,1),tt-=1,nt-=1),tt+=1;this._cbs[Le].length||(this._cbs[Le]=null)}}};var markerParser=function(){function Be(Le){for(var Ye=Le.split(`\r
2155
2156
  `),tt={},nt,ft=0,ht=0;ht<Ye.length;ht+=1)nt=Ye[ht].split(":"),nt.length===2&&(tt[nt[0]]=nt[1].trim(),ft+=1);if(ft===0)throw new Error;return tt}return function(Le){for(var Ye=[],tt=0;tt<Le.length;tt+=1){var nt=Le[tt],ft={time:nt.tm,duration:nt.dr};try{ft.payload=JSON.parse(Le[tt].cm)}catch{try{ft.payload=Be(Le[tt].cm)}catch{ft.payload={name:Le[tt].cm}}}Ye.push(ft)}return Ye}}(),ProjectInterface=function(){function Be(Le){this.compositions.push(Le)}return function(){function Le(Ye){for(var tt=0,nt=this.compositions.length;tt<nt;){if(this.compositions[tt].data&&this.compositions[tt].data.nm===Ye)return this.compositions[tt].prepareFrame&&this.compositions[tt].data.xt&&this.compositions[tt].prepareFrame(this.currentFrame),this.compositions[tt].compInterface;tt+=1}return null}return Le.compositions=[],Le.currentFrame=0,Le.registerComposition=Be,Le}}(),renderers={},registerRenderer=function(Le,Ye){renderers[Le]=Ye};function getRenderer(Be){return renderers[Be]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var Be in renderers)if(renderers[Be])return Be;return""}function _typeof$4(Be){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$4(Be)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(Be){(Be.wrapper||Be.container)&&(this.wrapper=Be.wrapper||Be.container);var Le="svg";Be.animType?Le=Be.animType:Be.renderer&&(Le=Be.renderer);var Ye=getRenderer(Le);this.renderer=new Ye(this,Be.rendererSettings),this.imagePreloader.setCacheType(Le,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=Le,Be.loop===""||Be.loop===null||Be.loop===void 0||Be.loop===!0?this.loop=!0:Be.loop===!1?this.loop=!1:this.loop=parseInt(Be.loop,10),this.autoplay="autoplay"in Be?Be.autoplay:!0,this.name=Be.name?Be.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(Be,"autoloadSegments")?Be.autoloadSegments:!0,this.assetsPath=Be.assetsPath,this.initialSegment=Be.initialSegment,Be.audioFactory&&this.audioController.setAudioFactory(Be.audioFactory),Be.animationData?this.setupAnimation(Be.animationData):Be.path&&(Be.path.lastIndexOf("\\")!==-1?this.path=Be.path.substr(0,Be.path.lastIndexOf("\\")+1):this.path=Be.path.substr(0,Be.path.lastIndexOf("/")+1),this.fileName=Be.path.substr(Be.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(Be.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(Be){dataManager.completeAnimation(Be,this.configAnimation)},AnimationItem.prototype.setData=function(Be,Le){Le&&_typeof$4(Le)!=="object"&&(Le=JSON.parse(Le));var Ye={wrapper:Be,animationData:Le},tt=Be.attributes;Ye.path=tt.getNamedItem("data-animation-path")?tt.getNamedItem("data-animation-path").value:tt.getNamedItem("data-bm-path")?tt.getNamedItem("data-bm-path").value:tt.getNamedItem("bm-path")?tt.getNamedItem("bm-path").value:"",Ye.animType=tt.getNamedItem("data-anim-type")?tt.getNamedItem("data-anim-type").value:tt.getNamedItem("data-bm-type")?tt.getNamedItem("data-bm-type").value:tt.getNamedItem("bm-type")?tt.getNamedItem("bm-type").value:tt.getNamedItem("data-bm-renderer")?tt.getNamedItem("data-bm-renderer").value:tt.getNamedItem("bm-renderer")?tt.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var nt=tt.getNamedItem("data-anim-loop")?tt.getNamedItem("data-anim-loop").value:tt.getNamedItem("data-bm-loop")?tt.getNamedItem("data-bm-loop").value:tt.getNamedItem("bm-loop")?tt.getNamedItem("bm-loop").value:"";nt==="false"?Ye.loop=!1:nt==="true"?Ye.loop=!0:nt!==""&&(Ye.loop=parseInt(nt,10));var ft=tt.getNamedItem("data-anim-autoplay")?tt.getNamedItem("data-anim-autoplay").value:tt.getNamedItem("data-bm-autoplay")?tt.getNamedItem("data-bm-autoplay").value:tt.getNamedItem("bm-autoplay")?tt.getNamedItem("bm-autoplay").value:!0;Ye.autoplay=ft!=="false",Ye.name=tt.getNamedItem("data-name")?tt.getNamedItem("data-name").value:tt.getNamedItem("data-bm-name")?tt.getNamedItem("data-bm-name").value:tt.getNamedItem("bm-name")?tt.getNamedItem("bm-name").value:"";var ht=tt.getNamedItem("data-anim-prerender")?tt.getNamedItem("data-anim-prerender").value:tt.getNamedItem("data-bm-prerender")?tt.getNamedItem("data-bm-prerender").value:tt.getNamedItem("bm-prerender")?tt.getNamedItem("bm-prerender").value:"";ht==="false"&&(Ye.prerender=!1),Ye.path?this.setParams(Ye):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(Be){Be.op>this.animationData.op&&(this.animationData.op=Be.op,this.totalFrames=Math.floor(Be.op-this.animationData.ip));var Le=this.animationData.layers,Ye,tt=Le.length,nt=Be.layers,ft,ht=nt.length;for(ft=0;ft<ht;ft+=1)for(Ye=0;Ye<tt;){if(Le[Ye].id===nt[ft].id){Le[Ye]=nt[ft];break}Ye+=1}if((Be.chars||Be.fonts)&&(this.renderer.globalData.fontManager.addChars(Be.chars),this.renderer.globalData.fontManager.addFonts(Be.fonts,this.renderer.globalData.defs)),Be.assets)for(tt=Be.assets.length,Ye=0;Ye<tt;Ye+=1)this.animationData.assets.push(Be.assets[Ye]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(Be){this.animationData=Be;var Le=getExpressionsPlugin();Le&&Le.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var Be=this.animationData.segments;if(!Be||Be.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var Le=Be.shift();this.timeCompleted=Le.time*this.frameRate;var Ye=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(Ye,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var Be=this.animationData.segments;Be||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(Be){if(this.renderer)try{this.animationData=Be,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(Be),Be.assets||(Be.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(Be.assets),this.markers=markerParser(Be.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(Le){this.triggerConfigError(Le)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var Be=getExpressionsPlugin();Be&&Be.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(Be,Le){var Ye=typeof Be=="number"?Be:void 0,tt=typeof Le=="number"?Le:void 0;this.renderer.updateContainerSize(Ye,tt)},AnimationItem.prototype.setSubframe=function(Be){this.isSubframeEnabled=!!Be},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(Be){this.triggerRenderFrameError(Be)}},AnimationItem.prototype.play=function(Be){Be&&this.name!==Be||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(Be){Be&&this.name!==Be||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(Be){Be&&this.name!==Be||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(Be){Be&&this.name!==Be||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(Be){for(var Le,Ye=0;Ye<this.markers.length;Ye+=1)if(Le=this.markers[Ye],Le.payload&&Le.payload.name===Be)return Le;return null},AnimationItem.prototype.goToAndStop=function(Be,Le,Ye){if(!(Ye&&this.name!==Ye)){var tt=Number(Be);if(isNaN(tt)){var nt=this.getMarkerData(Be);nt&&this.goToAndStop(nt.time,!0)}else Le?this.setCurrentRawFrameValue(Be):this.setCurrentRawFrameValue(Be*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(Be,Le,Ye){if(!(Ye&&this.name!==Ye)){var tt=Number(Be);if(isNaN(tt)){var nt=this.getMarkerData(Be);nt&&(nt.duration?this.playSegments([nt.time,nt.time+nt.duration],!0):this.goToAndStop(nt.time,!0))}else this.goToAndStop(tt,Le,Ye);this.play()}},AnimationItem.prototype.advanceTime=function(Be){if(!(this.isPaused===!0||this.isLoaded===!1)){var Le=this.currentRawFrame+Be*this.frameModifier,Ye=!1;Le>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(Le>this.totalFrames?Le%this.totalFrames:0)||(Ye=!0,Le=this.totalFrames-1):Le>=this.totalFrames?(this.playCount+=1,this.checkSegments(Le%this.totalFrames)||(this.setCurrentRawFrameValue(Le%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(Le):Le<0?this.checkSegments(Le%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+Le%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(Ye=!0,Le=0)):this.setCurrentRawFrameValue(Le),Ye&&(this.setCurrentRawFrameValue(Le),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(Be,Le){this.playCount=0,Be[1]<Be[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=Be[0]-Be[1],this.timeCompleted=this.totalFrames,this.firstFrame=Be[1],this.setCurrentRawFrameValue(this.totalFrames-.001-Le)):Be[1]>Be[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=Be[1]-Be[0],this.timeCompleted=this.totalFrames,this.firstFrame=Be[0],this.setCurrentRawFrameValue(.001+Le)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(Be,Le){var Ye=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<Be?Ye=Be:this.currentRawFrame+this.firstFrame>Le&&(Ye=Le-Be)),this.firstFrame=Be,this.totalFrames=Le-Be,this.timeCompleted=this.totalFrames,Ye!==-1&&this.goToAndStop(Ye,!0)},AnimationItem.prototype.playSegments=function(Be,Le){if(Le&&(this.segments.length=0),_typeof$4(Be[0])==="object"){var Ye,tt=Be.length;for(Ye=0;Ye<tt;Ye+=1)this.segments.push(Be[Ye])}else this.segments.push(Be);this.segments.length&&Le&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(Be){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),Be&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(Be){return this.segments.length?(this.adjustSegment(this.segments.shift(),Be),!0):!1},AnimationItem.prototype.destroy=function(Be){Be&&this.name!==Be||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(Be){this.currentRawFrame=Be,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(Be){this.playSpeed=Be,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(Be){this.playDirection=Be<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(Be){this.loop=Be},AnimationItem.prototype.setVolume=function(Be,Le){Le&&this.name!==Le||this.audioController.setVolume(Be)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(Be){Be&&this.name!==Be||this.audioController.mute()},AnimationItem.prototype.unmute=function(Be){Be&&this.name!==Be||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(Be){var Le="";if(Be.e)Le=Be.p;else if(this.assetsPath){var Ye=Be.p;Ye.indexOf("images/")!==-1&&(Ye=Ye.split("/")[1]),Le=this.assetsPath+Ye}else Le=this.path,Le+=Be.u?Be.u:"",Le+=Be.p;return Le},AnimationItem.prototype.getAssetData=function(Be){for(var Le=0,Ye=this.assets.length;Le<Ye;){if(Be===this.assets[Le].id)return this.assets[Le];Le+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(Be){return Be?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(Be,Le,Ye){try{var tt=this.renderer.getElementByPath(Be);tt.updateDocumentData(Le,Ye)}catch{}},AnimationItem.prototype.trigger=function(Be){if(this._cbs&&this._cbs[Be])switch(Be){case"enterFrame":this.triggerEvent(Be,new BMEnterFrameEvent(Be,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(Be,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(Be,new BMCompleteLoopEvent(Be,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(Be,new BMCompleteEvent(Be,this.frameMult));break;case"segmentStart":this.triggerEvent(Be,new BMSegmentStartEvent(Be,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(Be,new BMDestroyEvent(Be,this));break;default:this.triggerEvent(Be)}Be==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(Be,this.currentFrame,this.totalFrames,this.frameMult)),Be==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(Be,this.loop,this.playCount,this.frameMult)),Be==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(Be,this.frameMult)),Be==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(Be,this.firstFrame,this.totalFrames)),Be==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(Be,this))},AnimationItem.prototype.triggerRenderFrameError=function(Be){var Le=new BMRenderFrameErrorEvent(Be,this.currentFrame);this.triggerEvent("error",Le),this.onError&&this.onError.call(this,Le)},AnimationItem.prototype.triggerConfigError=function(Be){var Le=new BMConfigErrorEvent(Be,this.currentFrame);this.triggerEvent("error",Le),this.onError&&this.onError.call(this,Le)};var animationManager=function(){var Be={},Le=[],Ye=0,tt=0,nt=0,ft=!0,ht=!1;function gt(_t){for(var Mt=0,jt=_t.target;Mt<tt;)Le[Mt].animation===jt&&(Le.splice(Mt,1),Mt-=1,tt-=1,jt.isPaused||Ct()),Mt+=1}function At(_t,Mt){if(!_t)return null;for(var jt=0;jt<tt;){if(Le[jt].elem===_t&&Le[jt].elem!==null)return Le[jt].animation;jt+=1}var zt=new AnimationItem;return Et(zt,_t),zt.setData(_t,Mt),zt}function xt(){var _t,Mt=Le.length,jt=[];for(_t=0;_t<Mt;_t+=1)jt.push(Le[_t].animation);return jt}function yt(){nt+=1,$t()}function Ct(){nt-=1}function Et(_t,Mt){_t.addEventListener("destroy",gt),_t.addEventListener("_active",yt),_t.addEventListener("_idle",Ct),Le.push({elem:Mt,animation:_t}),tt+=1}function vt(_t){var Mt=new AnimationItem;return Et(Mt,null),Mt.setParams(_t),Mt}function kt(_t,Mt){var jt;for(jt=0;jt<tt;jt+=1)Le[jt].animation.setSpeed(_t,Mt)}function bt(_t,Mt){var jt;for(jt=0;jt<tt;jt+=1)Le[jt].animation.setDirection(_t,Mt)}function wt(_t){var Mt;for(Mt=0;Mt<tt;Mt+=1)Le[Mt].animation.play(_t)}function It(_t){var Mt=_t-Ye,jt;for(jt=0;jt<tt;jt+=1)Le[jt].animation.advanceTime(Mt);Ye=_t,nt&&!ht?window.requestAnimationFrame(It):ft=!0}function Rt(_t){Ye=_t,window.requestAnimationFrame(It)}function Tt(_t){var Mt;for(Mt=0;Mt<tt;Mt+=1)Le[Mt].animation.pause(_t)}function Bt(_t,Mt,jt){var zt;for(zt=0;zt<tt;zt+=1)Le[zt].animation.goToAndStop(_t,Mt,jt)}function Pt(_t){var Mt;for(Mt=0;Mt<tt;Mt+=1)Le[Mt].animation.stop(_t)}function Dt(_t){var Mt;for(Mt=0;Mt<tt;Mt+=1)Le[Mt].animation.togglePause(_t)}function Ot(_t){var Mt;for(Mt=tt-1;Mt>=0;Mt-=1)Le[Mt].animation.destroy(_t)}function Lt(_t,Mt,jt){var zt=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Gt,Yt=zt.length;for(Gt=0;Gt<Yt;Gt+=1)jt&&zt[Gt].setAttribute("data-bm-type",jt),At(zt[Gt],_t);if(Mt&&Yt===0){jt||(jt="svg");var ar=document.getElementsByTagName("body")[0];ar.innerText="";var tr=createTag("div");tr.style.width="100%",tr.style.height="100%",tr.setAttribute("data-bm-type",jt),ar.appendChild(tr),At(tr,_t)}}function Wt(){var _t;for(_t=0;_t<tt;_t+=1)Le[_t].animation.resize()}function $t(){!ht&&nt&&ft&&(window.requestAnimationFrame(Rt),ft=!1)}function qt(){ht=!0}function Ht(){ht=!1,$t()}function Ut(_t,Mt){var jt;for(jt=0;jt<tt;jt+=1)Le[jt].animation.setVolume(_t,Mt)}function Ft(_t){var Mt;for(Mt=0;Mt<tt;Mt+=1)Le[Mt].animation.mute(_t)}function Xt(_t){var Mt;for(Mt=0;Mt<tt;Mt+=1)Le[Mt].animation.unmute(_t)}return Be.registerAnimation=At,Be.loadAnimation=vt,Be.setSpeed=kt,Be.setDirection=bt,Be.play=wt,Be.pause=Tt,Be.stop=Pt,Be.togglePause=Dt,Be.searchAnimations=Lt,Be.resize=Wt,Be.goToAndStop=Bt,Be.destroy=Ot,Be.freeze=qt,Be.unfreeze=Ht,Be.setVolume=Ut,Be.mute=Ft,Be.unmute=Xt,Be.getRegisteredAnimations=xt,Be}(),BezierFactory=function(){var Be={};Be.getBezierEasing=Ye;var Le={};function Ye(Rt,Tt,Bt,Pt,Dt){var Ot=Dt||("bez_"+Rt+"_"+Tt+"_"+Bt+"_"+Pt).replace(/\./g,"p");if(Le[Ot])return Le[Ot];var Lt=new It([Rt,Tt,Bt,Pt]);return Le[Ot]=Lt,Lt}var tt=4,nt=.001,ft=1e-7,ht=10,gt=11,At=1/(gt-1),xt=typeof Float32Array=="function";function yt(Rt,Tt){return 1-3*Tt+3*Rt}function Ct(Rt,Tt){return 3*Tt-6*Rt}function Et(Rt){return 3*Rt}function vt(Rt,Tt,Bt){return((yt(Tt,Bt)*Rt+Ct(Tt,Bt))*Rt+Et(Tt))*Rt}function kt(Rt,Tt,Bt){return 3*yt(Tt,Bt)*Rt*Rt+2*Ct(Tt,Bt)*Rt+Et(Tt)}function bt(Rt,Tt,Bt,Pt,Dt){var Ot,Lt,Wt=0;do Lt=Tt+(Bt-Tt)/2,Ot=vt(Lt,Pt,Dt)-Rt,Ot>0?Bt=Lt:Tt=Lt;while(Math.abs(Ot)>ft&&++Wt<ht);return Lt}function wt(Rt,Tt,Bt,Pt){for(var Dt=0;Dt<tt;++Dt){var Ot=kt(Tt,Bt,Pt);if(Ot===0)return Tt;var Lt=vt(Tt,Bt,Pt)-Rt;Tt-=Lt/Ot}return Tt}function It(Rt){this._p=Rt,this._mSampleValues=xt?new Float32Array(gt):new Array(gt),this._precomputed=!1,this.get=this.get.bind(this)}return It.prototype={get:function(Tt){var Bt=this._p[0],Pt=this._p[1],Dt=this._p[2],Ot=this._p[3];return this._precomputed||this._precompute(),Bt===Pt&&Dt===Ot?Tt:Tt===0?0:Tt===1?1:vt(this._getTForX(Tt),Pt,Ot)},_precompute:function(){var Tt=this._p[0],Bt=this._p[1],Pt=this._p[2],Dt=this._p[3];this._precomputed=!0,(Tt!==Bt||Pt!==Dt)&&this._calcSampleValues()},_calcSampleValues:function(){for(var Tt=this._p[0],Bt=this._p[2],Pt=0;Pt<gt;++Pt)this._mSampleValues[Pt]=vt(Pt*At,Tt,Bt)},_getTForX:function(Tt){for(var Bt=this._p[0],Pt=this._p[2],Dt=this._mSampleValues,Ot=0,Lt=1,Wt=gt-1;Lt!==Wt&&Dt[Lt]<=Tt;++Lt)Ot+=At;--Lt;var $t=(Tt-Dt[Lt])/(Dt[Lt+1]-Dt[Lt]),qt=Ot+$t*At,Ht=kt(qt,Bt,Pt);return Ht>=nt?wt(Tt,qt,Bt,Pt):Ht===0?qt:bt(Tt,Ot,Ot+At,Bt,Pt)}},Be}(),pooling=function(){function Be(Le){return Le.concat(createSizedArray(Le.length))}return{double:Be}}(),poolFactory=function(){return function(Be,Le,Ye){var tt=0,nt=Be,ft=createSizedArray(nt),ht={newElement:gt,release:At};function gt(){var xt;return tt?(tt-=1,xt=ft[tt]):xt=Le(),xt}function At(xt){tt===nt&&(ft=pooling.double(ft),nt*=2),Ye&&Ye(xt),ft[tt]=xt,tt+=1}return ht}}(),bezierLengthPool=function(){function Be(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,Be)}(),segmentsLengthPool=function(){function Be(){return{lengths:[],totalLength:0}}function Le(Ye){var tt,nt=Ye.lengths.length;for(tt=0;tt<nt;tt+=1)bezierLengthPool.release(Ye.lengths[tt]);Ye.lengths.length=0}return poolFactory(8,Be,Le)}();function bezFunction(){var Be=Math;function Le(Et,vt,kt,bt,wt,It){var Rt=Et*bt+vt*wt+kt*It-wt*bt-It*Et-kt*vt;return Rt>-.001&&Rt<.001}function Ye(Et,vt,kt,bt,wt,It,Rt,Tt,Bt){if(kt===0&&It===0&&Bt===0)return Le(Et,vt,bt,wt,Rt,Tt);var Pt=Be.sqrt(Be.pow(bt-Et,2)+Be.pow(wt-vt,2)+Be.pow(It-kt,2)),Dt=Be.sqrt(Be.pow(Rt-Et,2)+Be.pow(Tt-vt,2)+Be.pow(Bt-kt,2)),Ot=Be.sqrt(Be.pow(Rt-bt,2)+Be.pow(Tt-wt,2)+Be.pow(Bt-It,2)),Lt;return Pt>Dt?Pt>Ot?Lt=Pt-Dt-Ot:Lt=Ot-Dt-Pt:Ot>Dt?Lt=Ot-Dt-Pt:Lt=Dt-Pt-Ot,Lt>-1e-4&&Lt<1e-4}var tt=function(){return function(Et,vt,kt,bt){var wt=getDefaultCurveSegments(),It,Rt,Tt,Bt,Pt,Dt=0,Ot,Lt=[],Wt=[],$t=bezierLengthPool.newElement();for(Tt=kt.length,It=0;It<wt;It+=1){for(Pt=It/(wt-1),Ot=0,Rt=0;Rt<Tt;Rt+=1)Bt=bmPow(1-Pt,3)*Et[Rt]+3*bmPow(1-Pt,2)*Pt*kt[Rt]+3*(1-Pt)*bmPow(Pt,2)*bt[Rt]+bmPow(Pt,3)*vt[Rt],Lt[Rt]=Bt,Wt[Rt]!==null&&(Ot+=bmPow(Lt[Rt]-Wt[Rt],2)),Wt[Rt]=Lt[Rt];Ot&&(Ot=bmSqrt(Ot),Dt+=Ot),$t.percents[It]=Pt,$t.lengths[It]=Dt}return $t.addedLength=Dt,$t}}();function nt(Et){var vt=segmentsLengthPool.newElement(),kt=Et.c,bt=Et.v,wt=Et.o,It=Et.i,Rt,Tt=Et._length,Bt=vt.lengths,Pt=0;for(Rt=0;Rt<Tt-1;Rt+=1)Bt[Rt]=tt(bt[Rt],bt[Rt+1],wt[Rt],It[Rt+1]),Pt+=Bt[Rt].addedLength;return kt&&Tt&&(Bt[Rt]=tt(bt[Rt],bt[0],wt[Rt],It[0]),Pt+=Bt[Rt].addedLength),vt.totalLength=Pt,vt}function ft(Et){this.segmentLength=0,this.points=new Array(Et)}function ht(Et,vt){this.partialLength=Et,this.point=vt}var gt=function(){var Et={};return function(vt,kt,bt,wt){var It=(vt[0]+"_"+vt[1]+"_"+kt[0]+"_"+kt[1]+"_"+bt[0]+"_"+bt[1]+"_"+wt[0]+"_"+wt[1]).replace(/\./g,"p");if(!Et[It]){var Rt=getDefaultCurveSegments(),Tt,Bt,Pt,Dt,Ot,Lt=0,Wt,$t,qt=null;vt.length===2&&(vt[0]!==kt[0]||vt[1]!==kt[1])&&Le(vt[0],vt[1],kt[0],kt[1],vt[0]+bt[0],vt[1]+bt[1])&&Le(vt[0],vt[1],kt[0],kt[1],kt[0]+wt[0],kt[1]+wt[1])&&(Rt=2);var Ht=new ft(Rt);for(Pt=bt.length,Tt=0;Tt<Rt;Tt+=1){for($t=createSizedArray(Pt),Ot=Tt/(Rt-1),Wt=0,Bt=0;Bt<Pt;Bt+=1)Dt=bmPow(1-Ot,3)*vt[Bt]+3*bmPow(1-Ot,2)*Ot*(vt[Bt]+bt[Bt])+3*(1-Ot)*bmPow(Ot,2)*(kt[Bt]+wt[Bt])+bmPow(Ot,3)*kt[Bt],$t[Bt]=Dt,qt!==null&&(Wt+=bmPow($t[Bt]-qt[Bt],2));Wt=bmSqrt(Wt),Lt+=Wt,Ht.points[Tt]=new ht(Wt,$t),qt=$t}Ht.segmentLength=Lt,Et[It]=Ht}return Et[It]}}();function At(Et,vt){var kt=vt.percents,bt=vt.lengths,wt=kt.length,It=bmFloor((wt-1)*Et),Rt=Et*vt.addedLength,Tt=0;if(It===wt-1||It===0||Rt===bt[It])return kt[It];for(var Bt=bt[It]>Rt?-1:1,Pt=!0;Pt;)if(bt[It]<=Rt&&bt[It+1]>Rt?(Tt=(Rt-bt[It])/(bt[It+1]-bt[It]),Pt=!1):It+=Bt,It<0||It>=wt-1){if(It===wt-1)return kt[It];Pt=!1}return kt[It]+(kt[It+1]-kt[It])*Tt}function xt(Et,vt,kt,bt,wt,It){var Rt=At(wt,It),Tt=1-Rt,Bt=Be.round((Tt*Tt*Tt*Et[0]+(Rt*Tt*Tt+Tt*Rt*Tt+Tt*Tt*Rt)*kt[0]+(Rt*Rt*Tt+Tt*Rt*Rt+Rt*Tt*Rt)*bt[0]+Rt*Rt*Rt*vt[0])*1e3)/1e3,Pt=Be.round((Tt*Tt*Tt*Et[1]+(Rt*Tt*Tt+Tt*Rt*Tt+Tt*Tt*Rt)*kt[1]+(Rt*Rt*Tt+Tt*Rt*Rt+Rt*Tt*Rt)*bt[1]+Rt*Rt*Rt*vt[1])*1e3)/1e3;return[Bt,Pt]}var yt=createTypedArray("float32",8);function Ct(Et,vt,kt,bt,wt,It,Rt){wt<0?wt=0:wt>1&&(wt=1);var Tt=At(wt,Rt);It=It>1?1:It;var Bt=At(It,Rt),Pt,Dt=Et.length,Ot=1-Tt,Lt=1-Bt,Wt=Ot*Ot*Ot,$t=Tt*Ot*Ot*3,qt=Tt*Tt*Ot*3,Ht=Tt*Tt*Tt,Ut=Ot*Ot*Lt,Ft=Tt*Ot*Lt+Ot*Tt*Lt+Ot*Ot*Bt,Xt=Tt*Tt*Lt+Ot*Tt*Bt+Tt*Ot*Bt,_t=Tt*Tt*Bt,Mt=Ot*Lt*Lt,jt=Tt*Lt*Lt+Ot*Bt*Lt+Ot*Lt*Bt,zt=Tt*Bt*Lt+Ot*Bt*Bt+Tt*Lt*Bt,Gt=Tt*Bt*Bt,Yt=Lt*Lt*Lt,ar=Bt*Lt*Lt+Lt*Bt*Lt+Lt*Lt*Bt,tr=Bt*Bt*Lt+Lt*Bt*Bt+Bt*Lt*Bt,sr=Bt*Bt*Bt;for(Pt=0;Pt<Dt;Pt+=1)yt[Pt*4]=Be.round((Wt*Et[Pt]+$t*kt[Pt]+qt*bt[Pt]+Ht*vt[Pt])*1e3)/1e3,yt[Pt*4+1]=Be.round((Ut*Et[Pt]+Ft*kt[Pt]+Xt*bt[Pt]+_t*vt[Pt])*1e3)/1e3,yt[Pt*4+2]=Be.round((Mt*Et[Pt]+jt*kt[Pt]+zt*bt[Pt]+Gt*vt[Pt])*1e3)/1e3,yt[Pt*4+3]=Be.round((Yt*Et[Pt]+ar*kt[Pt]+tr*bt[Pt]+sr*vt[Pt])*1e3)/1e3;return yt}return{getSegmentsLength:nt,getNewSegment:Ct,getPointInSegment:xt,buildBezierData:gt,pointOnLine2D:Le,pointOnLine3D:Ye}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(Be,Le){var Ye=this.offsetTime,tt;this.propType==="multidimensional"&&(tt=createTypedArray("float32",this.pv.length));for(var nt=Le.lastIndex,ft=nt,ht=this.keyframes.length-1,gt=!0,At,xt,yt;gt;){if(At=this.keyframes[ft],xt=this.keyframes[ft+1],ft===ht-1&&Be>=xt.t-Ye){At.h&&(At=xt),nt=0;break}if(xt.t-Ye>Be){nt=ft;break}ft<ht-1?ft+=1:(nt=0,gt=!1)}yt=this.keyframesMetadata[ft]||{};var Ct,Et,vt,kt,bt,wt,It=xt.t-Ye,Rt=At.t-Ye,Tt;if(At.to){yt.bezierData||(yt.bezierData=bez.buildBezierData(At.s,xt.s||At.e,At.to,At.ti));var Bt=yt.bezierData;if(Be>=It||Be<Rt){var Pt=Be>=It?Bt.points.length-1:0;for(Et=Bt.points[Pt].point.length,Ct=0;Ct<Et;Ct+=1)tt[Ct]=Bt.points[Pt].point[Ct]}else{yt.__fnct?wt=yt.__fnct:(wt=BezierFactory.getBezierEasing(At.o.x,At.o.y,At.i.x,At.i.y,At.n).get,yt.__fnct=wt),vt=wt((Be-Rt)/(It-Rt));var Dt=Bt.segmentLength*vt,Ot,Lt=Le.lastFrame<Be&&Le._lastKeyframeIndex===ft?Le._lastAddedLength:0;for(bt=Le.lastFrame<Be&&Le._lastKeyframeIndex===ft?Le._lastPoint:0,gt=!0,kt=Bt.points.length;gt;){if(Lt+=Bt.points[bt].partialLength,Dt===0||vt===0||bt===Bt.points.length-1){for(Et=Bt.points[bt].point.length,Ct=0;Ct<Et;Ct+=1)tt[Ct]=Bt.points[bt].point[Ct];break}else if(Dt>=Lt&&Dt<Lt+Bt.points[bt+1].partialLength){for(Ot=(Dt-Lt)/Bt.points[bt+1].partialLength,Et=Bt.points[bt].point.length,Ct=0;Ct<Et;Ct+=1)tt[Ct]=Bt.points[bt].point[Ct]+(Bt.points[bt+1].point[Ct]-Bt.points[bt].point[Ct])*Ot;break}bt<kt-1?bt+=1:gt=!1}Le._lastPoint=bt,Le._lastAddedLength=Lt-Bt.points[bt].partialLength,Le._lastKeyframeIndex=ft}}else{var Wt,$t,qt,Ht,Ut;if(ht=At.s.length,Tt=xt.s||At.e,this.sh&&At.h!==1)if(Be>=It)tt[0]=Tt[0],tt[1]=Tt[1],tt[2]=Tt[2];else if(Be<=Rt)tt[0]=At.s[0],tt[1]=At.s[1],tt[2]=At.s[2];else{var Ft=createQuaternion(At.s),Xt=createQuaternion(Tt),_t=(Be-Rt)/(It-Rt);quaternionToEuler(tt,slerp(Ft,Xt,_t))}else for(ft=0;ft<ht;ft+=1)At.h!==1&&(Be>=It?vt=1:Be<Rt?vt=0:(At.o.x.constructor===Array?(yt.__fnct||(yt.__fnct=[]),yt.__fnct[ft]?wt=yt.__fnct[ft]:(Wt=At.o.x[ft]===void 0?At.o.x[0]:At.o.x[ft],$t=At.o.y[ft]===void 0?At.o.y[0]:At.o.y[ft],qt=At.i.x[ft]===void 0?At.i.x[0]:At.i.x[ft],Ht=At.i.y[ft]===void 0?At.i.y[0]:At.i.y[ft],wt=BezierFactory.getBezierEasing(Wt,$t,qt,Ht).get,yt.__fnct[ft]=wt)):yt.__fnct?wt=yt.__fnct:(Wt=At.o.x,$t=At.o.y,qt=At.i.x,Ht=At.i.y,wt=BezierFactory.getBezierEasing(Wt,$t,qt,Ht).get,At.keyframeMetadata=wt),vt=wt((Be-Rt)/(It-Rt)))),Tt=xt.s||At.e,Ut=At.h===1?At.s[ft]:At.s[ft]+(Tt[ft]-At.s[ft])*vt,this.propType==="multidimensional"?tt[ft]=Ut:tt=Ut}return Le.lastIndex=nt,tt}function slerp(Be,Le,Ye){var tt=[],nt=Be[0],ft=Be[1],ht=Be[2],gt=Be[3],At=Le[0],xt=Le[1],yt=Le[2],Ct=Le[3],Et,vt,kt,bt,wt;return vt=nt*At+ft*xt+ht*yt+gt*Ct,vt<0&&(vt=-vt,At=-At,xt=-xt,yt=-yt,Ct=-Ct),1-vt>1e-6?(Et=Math.acos(vt),kt=Math.sin(Et),bt=Math.sin((1-Ye)*Et)/kt,wt=Math.sin(Ye*Et)/kt):(bt=1-Ye,wt=Ye),tt[0]=bt*nt+wt*At,tt[1]=bt*ft+wt*xt,tt[2]=bt*ht+wt*yt,tt[3]=bt*gt+wt*Ct,tt}function quaternionToEuler(Be,Le){var Ye=Le[0],tt=Le[1],nt=Le[2],ft=Le[3],ht=Math.atan2(2*tt*ft-2*Ye*nt,1-2*tt*tt-2*nt*nt),gt=Math.asin(2*Ye*tt+2*nt*ft),At=Math.atan2(2*Ye*ft-2*tt*nt,1-2*Ye*Ye-2*nt*nt);Be[0]=ht/degToRads,Be[1]=gt/degToRads,Be[2]=At/degToRads}function createQuaternion(Be){var Le=Be[0]*degToRads,Ye=Be[1]*degToRads,tt=Be[2]*degToRads,nt=Math.cos(Le/2),ft=Math.cos(Ye/2),ht=Math.cos(tt/2),gt=Math.sin(Le/2),At=Math.sin(Ye/2),xt=Math.sin(tt/2),yt=nt*ft*ht-gt*At*xt,Ct=gt*At*ht+nt*ft*xt,Et=gt*ft*ht+nt*At*xt,vt=nt*At*ht-gt*ft*xt;return[Ct,Et,vt,yt]}function getValueAtCurrentTime(){var Be=this.comp.renderedFrame-this.offsetTime,Le=this.keyframes[0].t-this.offsetTime,Ye=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(Be===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=Ye&&Be>=Ye||this._caching.lastFrame<Le&&Be<Le))){this._caching.lastFrame>=Be&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var tt=this.interpolateValue(Be,this._caching);this.pv=tt}return this._caching.lastFrame=Be,this.pv}function setVValue(Be){var Le;if(this.propType==="unidimensional")Le=Be*this.mult,mathAbs(this.v-Le)>1e-5&&(this.v=Le,this._mdf=!0);else for(var Ye=0,tt=this.v.length;Ye<tt;)Le=Be[Ye]*this.mult,mathAbs(this.v[Ye]-Le)>1e-5&&(this.v[Ye]=Le,this._mdf=!0),Ye+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var Be,Le=this.effectsSequence.length,Ye=this.kf?this.pv:this.data.k;for(Be=0;Be<Le;Be+=1)Ye=this.effectsSequence[Be](Ye);this.setVValue(Ye),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(Be){this.effectsSequence.push(Be),this.container.addDynamicProperty(this)}function ValueProperty(Be,Le,Ye,tt){this.propType="unidimensional",this.mult=Ye||1,this.data=Le,this.v=Ye?Le.k*Ye:Le.k,this.pv=Le.k,this._mdf=!1,this.elem=Be,this.container=tt,this.comp=Be.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(Be,Le,Ye,tt){this.propType="multidimensional",this.mult=Ye||1,this.data=Le,this._mdf=!1,this.elem=Be,this.container=tt,this.comp=Be.comp,this.k=!1,this.kf=!1,this.frameId=-1;var nt,ft=Le.k.length;for(this.v=createTypedArray("float32",ft),this.pv=createTypedArray("float32",ft),this.vel=createTypedArray("float32",ft),nt=0;nt<ft;nt+=1)this.v[nt]=Le.k[nt]*this.mult,this.pv[nt]=Le.k[nt];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(Be,Le,Ye,tt){this.propType="unidimensional",this.keyframes=Le.k,this.keyframesMetadata=[],this.offsetTime=Be.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=Le,this.mult=Ye||1,this.elem=Be,this.container=tt,this.comp=Be.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(Be,Le,Ye,tt){this.propType="multidimensional";var nt,ft=Le.k.length,ht,gt,At,xt;for(nt=0;nt<ft-1;nt+=1)Le.k[nt].to&&Le.k[nt].s&&Le.k[nt+1]&&Le.k[nt+1].s&&(ht=Le.k[nt].s,gt=Le.k[nt+1].s,At=Le.k[nt].to,xt=Le.k[nt].ti,(ht.length===2&&!(ht[0]===gt[0]&&ht[1]===gt[1])&&bez.pointOnLine2D(ht[0],ht[1],gt[0],gt[1],ht[0]+At[0],ht[1]+At[1])&&bez.pointOnLine2D(ht[0],ht[1],gt[0],gt[1],gt[0]+xt[0],gt[1]+xt[1])||ht.length===3&&!(ht[0]===gt[0]&&ht[1]===gt[1]&&ht[2]===gt[2])&&bez.pointOnLine3D(ht[0],ht[1],ht[2],gt[0],gt[1],gt[2],ht[0]+At[0],ht[1]+At[1],ht[2]+At[2])&&bez.pointOnLine3D(ht[0],ht[1],ht[2],gt[0],gt[1],gt[2],gt[0]+xt[0],gt[1]+xt[1],gt[2]+xt[2]))&&(Le.k[nt].to=null,Le.k[nt].ti=null),ht[0]===gt[0]&&ht[1]===gt[1]&&At[0]===0&&At[1]===0&&xt[0]===0&&xt[1]===0&&(ht.length===2||ht[2]===gt[2]&&At[2]===0&&xt[2]===0)&&(Le.k[nt].to=null,Le.k[nt].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=Le,this.keyframes=Le.k,this.keyframesMetadata=[],this.offsetTime=Be.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=Ye||1,this.elem=Be,this.container=tt,this.comp=Be.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var yt=Le.k[0].s.length;for(this.v=createTypedArray("float32",yt),this.pv=createTypedArray("float32",yt),nt=0;nt<yt;nt+=1)this.v[nt]=initFrame,this.pv[nt]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",yt)},this.addEffect=addEffect}var PropertyFactory=function(){function Be(Ye,tt,nt,ft,ht){tt.sid&&(tt=Ye.globalData.slotManager.getProp(tt));var gt;if(!tt.k.length)gt=new ValueProperty(Ye,tt,ft,ht);else if(typeof tt.k[0]=="number")gt=new MultiDimensionalProperty(Ye,tt,ft,ht);else switch(nt){case 0:gt=new KeyframedValueProperty(Ye,tt,ft,ht);break;case 1:gt=new KeyframedMultidimensionalProperty(Ye,tt,ft,ht);break}return gt.effectsSequence.length&&ht.addDynamicProperty(gt),gt}var Le={getProp:Be};return Le}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(Le){this.dynamicProperties.indexOf(Le)===-1&&(this.dynamicProperties.push(Le),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var Le,Ye=this.dynamicProperties.length;for(Le=0;Le<Ye;Le+=1)this.dynamicProperties[Le].getValue(),this.dynamicProperties[Le]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(Le){this.container=Le,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=function(){function Be(){return createTypedArray("float32",2)}return poolFactory(8,Be)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(Be,Le){this.c=Be,this.setLength(Le);for(var Ye=0;Ye<Le;)this.v[Ye]=pointPool.newElement(),this.o[Ye]=pointPool.newElement(),this.i[Ye]=pointPool.newElement(),Ye+=1},ShapePath.prototype.setLength=function(Be){for(;this._maxLength<Be;)this.doubleArrayLength();this._length=Be},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(Be,Le,Ye,tt,nt){var ft;switch(this._length=Math.max(this._length,tt+1),this._length>=this._maxLength&&this.doubleArrayLength(),Ye){case"v":ft=this.v;break;case"i":ft=this.i;break;case"o":ft=this.o;break;default:ft=[];break}(!ft[tt]||ft[tt]&&!nt)&&(ft[tt]=pointPool.newElement()),ft[tt][0]=Be,ft[tt][1]=Le},ShapePath.prototype.setTripleAt=function(Be,Le,Ye,tt,nt,ft,ht,gt){this.setXYAt(Be,Le,"v",ht,gt),this.setXYAt(Ye,tt,"o",ht,gt),this.setXYAt(nt,ft,"i",ht,gt)},ShapePath.prototype.reverse=function(){var Be=new ShapePath;Be.setPathData(this.c,this._length);var Le=this.v,Ye=this.o,tt=this.i,nt=0;this.c&&(Be.setTripleAt(Le[0][0],Le[0][1],tt[0][0],tt[0][1],Ye[0][0],Ye[0][1],0,!1),nt=1);var ft=this._length-1,ht=this._length,gt;for(gt=nt;gt<ht;gt+=1)Be.setTripleAt(Le[ft][0],Le[ft][1],tt[ft][0],tt[ft][1],Ye[ft][0],Ye[ft][1],gt,!1),ft-=1;return Be},ShapePath.prototype.length=function(){return this._length};var shapePool=function(){function Be(){return new ShapePath}function Le(nt){var ft=nt._length,ht;for(ht=0;ht<ft;ht+=1)pointPool.release(nt.v[ht]),pointPool.release(nt.i[ht]),pointPool.release(nt.o[ht]),nt.v[ht]=null,nt.i[ht]=null,nt.o[ht]=null;nt._length=0,nt.c=!1}function Ye(nt){var ft=tt.newElement(),ht,gt=nt._length===void 0?nt.v.length:nt._length;for(ft.setLength(gt),ft.c=nt.c,ht=0;ht<gt;ht+=1)ft.setTripleAt(nt.v[ht][0],nt.v[ht][1],nt.o[ht][0],nt.o[ht][1],nt.i[ht][0],nt.i[ht][1],ht);return ft}var tt=poolFactory(4,Be,Le);return tt.clone=Ye,tt}();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(Be){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=Be,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var Be;for(Be=0;Be<this._length;Be+=1)shapePool.release(this.shapes[Be]);this._length=0};var shapeCollectionPool=function(){var Be={newShapeCollection:nt,release:ft},Le=0,Ye=4,tt=createSizedArray(Ye);function nt(){var ht;return Le?(Le-=1,ht=tt[Le]):ht=new ShapeCollection,ht}function ft(ht){var gt,At=ht._length;for(gt=0;gt<At;gt+=1)shapePool.release(ht.shapes[gt]);ht._length=0,Le===Ye&&(tt=pooling.double(tt),Ye*=2),tt[Le]=ht,Le+=1}return Be}(),ShapePropertyFactory=function(){var Be=-999999;function Le(It,Rt,Tt){var Bt=Tt.lastIndex,Pt,Dt,Ot,Lt,Wt,$t,qt,Ht,Ut,Ft=this.keyframes;if(It<Ft[0].t-this.offsetTime)Pt=Ft[0].s[0],Ot=!0,Bt=0;else if(It>=Ft[Ft.length-1].t-this.offsetTime)Pt=Ft[Ft.length-1].s?Ft[Ft.length-1].s[0]:Ft[Ft.length-2].e[0],Ot=!0;else{for(var Xt=Bt,_t=Ft.length-1,Mt=!0,jt,zt,Gt;Mt&&(jt=Ft[Xt],zt=Ft[Xt+1],!(zt.t-this.offsetTime>It));)Xt<_t-1?Xt+=1:Mt=!1;if(Gt=this.keyframesMetadata[Xt]||{},Ot=jt.h===1,Bt=Xt,!Ot){if(It>=zt.t-this.offsetTime)Ht=1;else if(It<jt.t-this.offsetTime)Ht=0;else{var Yt;Gt.__fnct?Yt=Gt.__fnct:(Yt=BezierFactory.getBezierEasing(jt.o.x,jt.o.y,jt.i.x,jt.i.y).get,Gt.__fnct=Yt),Ht=Yt((It-(jt.t-this.offsetTime))/(zt.t-this.offsetTime-(jt.t-this.offsetTime)))}Dt=zt.s?zt.s[0]:jt.e[0]}Pt=jt.s[0]}for($t=Rt._length,qt=Pt.i[0].length,Tt.lastIndex=Bt,Lt=0;Lt<$t;Lt+=1)for(Wt=0;Wt<qt;Wt+=1)Ut=Ot?Pt.i[Lt][Wt]:Pt.i[Lt][Wt]+(Dt.i[Lt][Wt]-Pt.i[Lt][Wt])*Ht,Rt.i[Lt][Wt]=Ut,Ut=Ot?Pt.o[Lt][Wt]:Pt.o[Lt][Wt]+(Dt.o[Lt][Wt]-Pt.o[Lt][Wt])*Ht,Rt.o[Lt][Wt]=Ut,Ut=Ot?Pt.v[Lt][Wt]:Pt.v[Lt][Wt]+(Dt.v[Lt][Wt]-Pt.v[Lt][Wt])*Ht,Rt.v[Lt][Wt]=Ut}function Ye(){var It=this.comp.renderedFrame-this.offsetTime,Rt=this.keyframes[0].t-this.offsetTime,Tt=this.keyframes[this.keyframes.length-1].t-this.offsetTime,Bt=this._caching.lastFrame;return Bt!==Be&&(Bt<Rt&&It<Rt||Bt>Tt&&It>Tt)||(this._caching.lastIndex=Bt<It?this._caching.lastIndex:0,this.interpolateShape(It,this.pv,this._caching)),this._caching.lastFrame=It,this.pv}function tt(){this.paths=this.localShapeCollection}function nt(It,Rt){if(It._length!==Rt._length||It.c!==Rt.c)return!1;var Tt,Bt=It._length;for(Tt=0;Tt<Bt;Tt+=1)if(It.v[Tt][0]!==Rt.v[Tt][0]||It.v[Tt][1]!==Rt.v[Tt][1]||It.o[Tt][0]!==Rt.o[Tt][0]||It.o[Tt][1]!==Rt.o[Tt][1]||It.i[Tt][0]!==Rt.i[Tt][0]||It.i[Tt][1]!==Rt.i[Tt][1])return!1;return!0}function ft(It){nt(this.v,It)||(this.v=shapePool.clone(It),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function ht(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var It;this.kf?It=this.pv:this.data.ks?It=this.data.ks.k:It=this.data.pt.k;var Rt,Tt=this.effectsSequence.length;for(Rt=0;Rt<Tt;Rt+=1)It=this.effectsSequence[Rt](It);this.setVValue(It),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function gt(It,Rt,Tt){this.propType="shape",this.comp=It.comp,this.container=It,this.elem=It,this.data=Rt,this.k=!1,this.kf=!1,this._mdf=!1;var Bt=Tt===3?Rt.pt.k:Rt.ks.k;this.v=shapePool.clone(Bt),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=tt,this.effectsSequence=[]}function At(It){this.effectsSequence.push(It),this.container.addDynamicProperty(this)}gt.prototype.interpolateShape=Le,gt.prototype.getValue=ht,gt.prototype.setVValue=ft,gt.prototype.addEffect=At;function xt(It,Rt,Tt){this.propType="shape",this.comp=It.comp,this.elem=It,this.container=It,this.offsetTime=It.data.st,this.keyframes=Tt===3?Rt.pt.k:Rt.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var Bt=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,Bt),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=Be,this.reset=tt,this._caching={lastFrame:Be,lastIndex:0},this.effectsSequence=[Ye.bind(this)]}xt.prototype.getValue=ht,xt.prototype.interpolateShape=Le,xt.prototype.setVValue=ft,xt.prototype.addEffect=At;var yt=function(){var It=roundCorner;function Rt(Tt,Bt){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=Bt.d,this.elem=Tt,this.comp=Tt.comp,this.frameId=-1,this.initDynamicPropertyContainer(Tt),this.p=PropertyFactory.getProp(Tt,Bt.p,1,0,this),this.s=PropertyFactory.getProp(Tt,Bt.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return Rt.prototype={reset:tt,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var Bt=this.p.v[0],Pt=this.p.v[1],Dt=this.s.v[0]/2,Ot=this.s.v[1]/2,Lt=this.d!==3,Wt=this.v;Wt.v[0][0]=Bt,Wt.v[0][1]=Pt-Ot,Wt.v[1][0]=Lt?Bt+Dt:Bt-Dt,Wt.v[1][1]=Pt,Wt.v[2][0]=Bt,Wt.v[2][1]=Pt+Ot,Wt.v[3][0]=Lt?Bt-Dt:Bt+Dt,Wt.v[3][1]=Pt,Wt.i[0][0]=Lt?Bt-Dt*It:Bt+Dt*It,Wt.i[0][1]=Pt-Ot,Wt.i[1][0]=Lt?Bt+Dt:Bt-Dt,Wt.i[1][1]=Pt-Ot*It,Wt.i[2][0]=Lt?Bt+Dt*It:Bt-Dt*It,Wt.i[2][1]=Pt+Ot,Wt.i[3][0]=Lt?Bt-Dt:Bt+Dt,Wt.i[3][1]=Pt+Ot*It,Wt.o[0][0]=Lt?Bt+Dt*It:Bt-Dt*It,Wt.o[0][1]=Pt-Ot,Wt.o[1][0]=Lt?Bt+Dt:Bt-Dt,Wt.o[1][1]=Pt+Ot*It,Wt.o[2][0]=Lt?Bt-Dt*It:Bt+Dt*It,Wt.o[2][1]=Pt+Ot,Wt.o[3][0]=Lt?Bt-Dt:Bt+Dt,Wt.o[3][1]=Pt-Ot*It}},extendPrototype([DynamicPropertyContainer],Rt),Rt}(),Ct=function(){function It(Rt,Tt){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=Rt,this.comp=Rt.comp,this.data=Tt,this.frameId=-1,this.d=Tt.d,this.initDynamicPropertyContainer(Rt),Tt.sy===1?(this.ir=PropertyFactory.getProp(Rt,Tt.ir,0,0,this),this.is=PropertyFactory.getProp(Rt,Tt.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(Rt,Tt.pt,0,0,this),this.p=PropertyFactory.getProp(Rt,Tt.p,1,0,this),this.r=PropertyFactory.getProp(Rt,Tt.r,0,degToRads,this),this.or=PropertyFactory.getProp(Rt,Tt.or,0,0,this),this.os=PropertyFactory.getProp(Rt,Tt.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return It.prototype={reset:tt,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var Tt=Math.floor(this.pt.v)*2,Bt=Math.PI*2/Tt,Pt=!0,Dt=this.or.v,Ot=this.ir.v,Lt=this.os.v,Wt=this.is.v,$t=2*Math.PI*Dt/(Tt*2),qt=2*Math.PI*Ot/(Tt*2),Ht,Ut,Ft,Xt,_t=-Math.PI/2;_t+=this.r.v;var Mt=this.data.d===3?-1:1;for(this.v._length=0,Ht=0;Ht<Tt;Ht+=1){Ut=Pt?Dt:Ot,Ft=Pt?Lt:Wt,Xt=Pt?$t:qt;var jt=Ut*Math.cos(_t),zt=Ut*Math.sin(_t),Gt=jt===0&&zt===0?0:zt/Math.sqrt(jt*jt+zt*zt),Yt=jt===0&&zt===0?0:-jt/Math.sqrt(jt*jt+zt*zt);jt+=+this.p.v[0],zt+=+this.p.v[1],this.v.setTripleAt(jt,zt,jt-Gt*Xt*Ft*Mt,zt-Yt*Xt*Ft*Mt,jt+Gt*Xt*Ft*Mt,zt+Yt*Xt*Ft*Mt,Ht,!0),Pt=!Pt,_t+=Bt*Mt}},convertPolygonToPath:function(){var Tt=Math.floor(this.pt.v),Bt=Math.PI*2/Tt,Pt=this.or.v,Dt=this.os.v,Ot=2*Math.PI*Pt/(Tt*4),Lt,Wt=-Math.PI*.5,$t=this.data.d===3?-1:1;for(Wt+=this.r.v,this.v._length=0,Lt=0;Lt<Tt;Lt+=1){var qt=Pt*Math.cos(Wt),Ht=Pt*Math.sin(Wt),Ut=qt===0&&Ht===0?0:Ht/Math.sqrt(qt*qt+Ht*Ht),Ft=qt===0&&Ht===0?0:-qt/Math.sqrt(qt*qt+Ht*Ht);qt+=+this.p.v[0],Ht+=+this.p.v[1],this.v.setTripleAt(qt,Ht,qt-Ut*Ot*Dt*$t,Ht-Ft*Ot*Dt*$t,qt+Ut*Ot*Dt*$t,Ht+Ft*Ot*Dt*$t,Lt,!0),Wt+=Bt*$t}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],It),It}(),Et=function(){function It(Rt,Tt){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=Rt,this.comp=Rt.comp,this.frameId=-1,this.d=Tt.d,this.initDynamicPropertyContainer(Rt),this.p=PropertyFactory.getProp(Rt,Tt.p,1,0,this),this.s=PropertyFactory.getProp(Rt,Tt.s,1,0,this),this.r=PropertyFactory.getProp(Rt,Tt.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return It.prototype={convertRectToPath:function(){var Tt=this.p.v[0],Bt=this.p.v[1],Pt=this.s.v[0]/2,Dt=this.s.v[1]/2,Ot=bmMin(Pt,Dt,this.r.v),Lt=Ot*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(Tt+Pt,Bt-Dt+Ot,Tt+Pt,Bt-Dt+Ot,Tt+Pt,Bt-Dt+Lt,0,!0),this.v.setTripleAt(Tt+Pt,Bt+Dt-Ot,Tt+Pt,Bt+Dt-Lt,Tt+Pt,Bt+Dt-Ot,1,!0),Ot!==0?(this.v.setTripleAt(Tt+Pt-Ot,Bt+Dt,Tt+Pt-Ot,Bt+Dt,Tt+Pt-Lt,Bt+Dt,2,!0),this.v.setTripleAt(Tt-Pt+Ot,Bt+Dt,Tt-Pt+Lt,Bt+Dt,Tt-Pt+Ot,Bt+Dt,3,!0),this.v.setTripleAt(Tt-Pt,Bt+Dt-Ot,Tt-Pt,Bt+Dt-Ot,Tt-Pt,Bt+Dt-Lt,4,!0),this.v.setTripleAt(Tt-Pt,Bt-Dt+Ot,Tt-Pt,Bt-Dt+Lt,Tt-Pt,Bt-Dt+Ot,5,!0),this.v.setTripleAt(Tt-Pt+Ot,Bt-Dt,Tt-Pt+Ot,Bt-Dt,Tt-Pt+Lt,Bt-Dt,6,!0),this.v.setTripleAt(Tt+Pt-Ot,Bt-Dt,Tt+Pt-Lt,Bt-Dt,Tt+Pt-Ot,Bt-Dt,7,!0)):(this.v.setTripleAt(Tt-Pt,Bt+Dt,Tt-Pt+Lt,Bt+Dt,Tt-Pt,Bt+Dt,2),this.v.setTripleAt(Tt-Pt,Bt-Dt,Tt-Pt,Bt-Dt+Lt,Tt-Pt,Bt-Dt,3))):(this.v.setTripleAt(Tt+Pt,Bt-Dt+Ot,Tt+Pt,Bt-Dt+Lt,Tt+Pt,Bt-Dt+Ot,0,!0),Ot!==0?(this.v.setTripleAt(Tt+Pt-Ot,Bt-Dt,Tt+Pt-Ot,Bt-Dt,Tt+Pt-Lt,Bt-Dt,1,!0),this.v.setTripleAt(Tt-Pt+Ot,Bt-Dt,Tt-Pt+Lt,Bt-Dt,Tt-Pt+Ot,Bt-Dt,2,!0),this.v.setTripleAt(Tt-Pt,Bt-Dt+Ot,Tt-Pt,Bt-Dt+Ot,Tt-Pt,Bt-Dt+Lt,3,!0),this.v.setTripleAt(Tt-Pt,Bt+Dt-Ot,Tt-Pt,Bt+Dt-Lt,Tt-Pt,Bt+Dt-Ot,4,!0),this.v.setTripleAt(Tt-Pt+Ot,Bt+Dt,Tt-Pt+Ot,Bt+Dt,Tt-Pt+Lt,Bt+Dt,5,!0),this.v.setTripleAt(Tt+Pt-Ot,Bt+Dt,Tt+Pt-Lt,Bt+Dt,Tt+Pt-Ot,Bt+Dt,6,!0),this.v.setTripleAt(Tt+Pt,Bt+Dt-Ot,Tt+Pt,Bt+Dt-Ot,Tt+Pt,Bt+Dt-Lt,7,!0)):(this.v.setTripleAt(Tt-Pt,Bt-Dt,Tt-Pt+Lt,Bt-Dt,Tt-Pt,Bt-Dt,1,!0),this.v.setTripleAt(Tt-Pt,Bt+Dt,Tt-Pt,Bt+Dt-Lt,Tt-Pt,Bt+Dt,2,!0),this.v.setTripleAt(Tt+Pt,Bt+Dt,Tt+Pt-Lt,Bt+Dt,Tt+Pt,Bt+Dt,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:tt},extendPrototype([DynamicPropertyContainer],It),It}();function vt(It,Rt,Tt){var Bt;if(Tt===3||Tt===4){var Pt=Tt===3?Rt.pt:Rt.ks,Dt=Pt.k;Dt.length?Bt=new xt(It,Rt,Tt):Bt=new gt(It,Rt,Tt)}else Tt===5?Bt=new Et(It,Rt):Tt===6?Bt=new yt(It,Rt):Tt===7&&(Bt=new Ct(It,Rt));return Bt.k&&It.addDynamicProperty(Bt),Bt}function kt(){return gt}function bt(){return xt}var wt={};return wt.getShapeProp=vt,wt.getConstructorFunction=kt,wt.getKeyframedConstructorFunction=bt,wt}();/*!
2156
2157
  Transformation Matrix v2.0
2157
2158
  (c) Epistemex 2014-2015
@@ -2216,7 +2217,7 @@ tt.goToAndStop(bt-tt.firstFrame-1,!0)}kt.type==="loop"&&(yt===null||yt!==kt.fram
2216
2217
  border: 2px solid ${({theme:Be})=>Be==null?void 0:Be.input.primary.border.active} !important;
2217
2218
  background-color: ${({theme:Be})=>Be==null?void 0:Be.input.primary.surface.active} !important;
2218
2219
  }
2219
- `,IndividualCharacterInputBoxes=({amount:Be,autoFocus:Le,onChange:Ye,password:tt=!1,value:nt,isNumeric:ft=!1,maxLength:ht,hasError:gt=!1,disabled:At=!1,inputMode:xt=void 0})=>{const{t:yt}=useTranslation(),[Ct,Et]=React.useState(()=>{const Pt=nt.split("").slice(0,Be);return Pt.length<Be?[...Pt,...Array(Be-Pt.length).fill("")]:Pt}),vt=React.useRef([]),kt=React.useRef(""),bt=useTokens();React.useEffect(()=>{const Pt=nt.split("").slice(0,Be);Pt.length<Be&&Pt.push(...Array(Be-Pt.length).fill("")),Et(Pt)},[nt,Be]),React.useEffect(()=>{Le&&vt.current[0]&&vt.current[0].focus()},[Le]),React.useEffect(()=>{const Pt=tt?Ct.join(""):Ct.join("").toUpperCase();Pt!==kt.current&&(kt.current=Pt,Ye(Pt))},[Ct,Ye,tt]);const wt=(Pt,Dt)=>{var Wt;let Ot=Dt.target.value;Ot.length>1&&(Ot=Ot.charAt(0));const Lt=[...Ct];Lt[Pt]=Ot,Et(Lt),Ot&&Pt<Be-1&&((Wt=vt.current[Pt+1])==null||Wt.focus())},It=(Pt,Dt)=>{var Lt,Wt,$t;const{key:Ot}=Dt;Ot==="Backspace"?!Ct[Pt]&&Pt>0&&((Lt=vt.current[Pt-1])==null||Lt.focus()):Ot==="ArrowLeft"&&Pt>0?(Wt=vt.current[Pt-1])==null||Wt.focus():Ot==="ArrowRight"&&Pt<Be-1&&(($t=vt.current[Pt+1])==null||$t.focus())},Rt=Pt=>{Pt.target.select()},Tt=(Pt,Dt)=>{var qt;const Lt=Dt.clipboardData.getData("text").split("");if(!Lt.length)return;const Wt=[...Ct];for(let Ht=0;Ht<Lt.length&&Pt+Ht<Be;Ht++)Wt[Pt+Ht]=Lt[Ht];Et(Wt);const $t=Math.min(Pt+Lt.length,Be-1);(qt=vt.current[$t])==null||qt.focus(),Dt.preventDefault()},Bt=()=>Ct.map((Pt,Dt)=>{const Ot=yt("otp.input",{number:Dt+1,charLength:Be}),Lt=tt?"password":ft?"number":"text";return jsx$1(InputBox,{error:gt,id:`OTPInput-${Dt}`,type:Lt,inputMode:xt,onChange:Wt=>wt(Dt,Wt),onKeyDown:Wt=>It(Dt,Wt),onPaste:Wt=>Tt(Dt,Wt),onFocus:Rt,name:`input${Dt}`,"aria-label":Ot,ref:Wt=>{vt.current[Dt]=Wt},value:Pt,disabled:At,maxLength:ft?void 0:ht},`input-${Dt}`)});return jsx$1(Flex,{hFull:!0,mt:bt.spacing[8],children:jsxs(Box,{children:[jsx$1(SynchronizedInputGroup,{children:jsx$1(Flex,{gap:bt.spacing[3],children:Bt()})}),gt&&jsxs(Flex,{mt:bt.spacing[2],align:"center",children:[jsx$1(Box,{display:"inline-block",mr:bt.spacing[2],children:jsx$1(ErrorIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",color:bt.input.primary.text.helper.negative,children:yt("otp.errorv2")})]})]})})},useCountryItems=()=>{const{t:Be}=useTranslation(),Le=React.useMemo(()=>{const tt=new Map;return Object.entries(countries$1).forEach(([nt,ft])=>{const ht=nt,gt=`+${getCountryCallingCode(ht)}`;tt.set(ht,{...ft,name:Be(`countries.${ht}`),id:ht,code:gt})}),tt},[Be]);return{countryItems:Le,getCountryByISOCode:tt=>Le.get(tt)}},PhoneInput=React.forwardRef(({countryISOCode:Be,label:Le,helper:Ye,showHelperIcon:tt,onChange:nt,...ft},ht)=>{const{disabled:gt=!1}=ft,{countryItems:At}=useCountryItems(),{state:xt,actions:{off:yt,on:Ct}}=useToggle(!1),[Et,vt]=React.useState(),[kt,bt]=React.useState("");React.useEffect(()=>{const Tt=At.get(Be)??At.get("MX");vt(Tt)},[Be,At]);const wt=useTokens(),It=Tt=>{const Bt=`${(Tt==null?void 0:Tt.code)||""}${kt}`;yt(),vt(Tt);const Pt=parsePhoneNumber(Bt);nt==null||nt(Bt,(Pt==null?void 0:Pt.isValid())||!1)},Rt=({target:{value:Tt}})=>{const Bt=`${(Et==null?void 0:Et.code)||""}${Tt}`;if(Et){const Pt=parsePhoneNumber(Bt),Ot=new AsYouType(Et.id).input(Bt).replace(Et.code,"");bt(Ot),nt==null||nt(Bt,(Pt==null?void 0:Pt.isValid())||!1)}};return jsx$1(Box,{children:jsxs(Flex,{direction:"column",gap:wt.spacing[2],position:"relative",children:[Le&&jsx$1(Text$8,{w:"auto",fontWeight:700,as:"label",color:wt.input.primary.text.label.default,mb:wt.spacing[2],display:"inline-block",children:Le}),jsxs(Flex,{gap:wt.spacing[2],justify:"center",children:[jsx$1(Flex,{children:jsxs(Flex,{w:"124px",justify:"center",p:wt.spacing[2],pl:wt.spacing[4],align:"center",onClick:()=>xt?yt():Ct(),borderWidth:"1px",borderColor:xt?wt.input.primary.border.active:wt.input.primary.border.default,backgroundColor:gt?wt.input.primary.surface.disabled:wt.input.primary.surface.default,borderRadius:wt.spacing[2],children:[jsx$1(Text$8,{as:"span","aria-hidden":"true",children:Et==null?void 0:Et.emoji}),jsx$1(Text$8,{as:"span","aria-hidden":"true",ml:wt.spacing[1],color:wt.color.text.body.primary,fontWeight:wt.typography.fontWeight.medium,fontSize:wt.typography.fontSize.lg,children:Et==null?void 0:Et.code}),jsx$1(Flex,{ml:wt.spacing[2],children:xt?jsx$1(UpArrow,{}):jsx$1(DownArrow,{})})]})}),jsx$1(Input$c,{ref:ht,p:wt.spacing[4],placeholder:"(123) 123-45-67",type:"tel",onChange:Rt,value:kt,...ft})]}),xt&&jsx$1(Flex,{as:"ul",position:"absolute",borderWidth:"1px",borderColor:wt.input.primary.border.default,backgroundColor:wt.input.primary.surface.default,borderRadius:wt.spacing[2],px:wt.spacing[1],py:wt.spacing[3],wFull:!0,top:"100%",maxH:"320px",zIndex:2,direction:"column",overflow:"scroll",children:At&&Array.from(At.entries()).map(([Tt,Bt])=>jsx$1(Flex,{as:"li",p:wt.spacing[4],onClick:()=>It(Bt),children:jsxs(Text$8,{color:wt.color.text.body.primary,fontWeight:wt.typography.fontWeight.medium,fontSize:wt.typography.fontSize.lg,children:[Bt.emoji," ",Bt.code," ",Bt.name]})},Tt))})]})})}),CalendarIcon=()=>jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-labelledby":"calendarIconTitle",children:[jsx$1("title",{id:"calendarIconTitle",children:"Calendar icon"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.50244 10.1563C7.50244 9.74204 7.83823 9.40625 8.25244 9.40625H16.7485C17.1627 9.40625 17.4985 9.74204 17.4985 10.1563C17.4985 10.5705 17.1627 10.9063 16.7485 10.9063H8.25244C7.83823 10.9063 7.50244 10.5705 7.50244 10.1563Z",fill:"#60667C"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.1406 2.25C16.5548 2.25 16.8906 2.58579 16.8906 3V5.96174C16.8906 6.37595 16.5548 6.71174 16.1406 6.71174C15.7264 6.71174 15.3906 6.37595 15.3906 5.96174V3C15.3906 2.58579 15.7264 2.25 16.1406 2.25Z",fill:"#60667C"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.86816 2.25C9.28238 2.25 9.61816 2.58579 9.61816 3V5.96174C9.61816 6.37595 9.28238 6.71174 8.86816 6.71174C8.45395 6.71174 8.11816 6.37595 8.11816 5.96174V3C8.11816 2.58579 8.45395 2.25 8.86816 2.25Z",fill:"#60667C"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.0392 4.95256C5.95822 4.07897 7.23731 3.67188 8.69414 3.67188H16.3145C17.7746 3.67188 19.0544 4.07865 19.9721 4.95323C20.8955 5.83327 21.3546 7.094 21.3504 8.60132C21.3504 8.6011 21.3504 8.60154 21.3504 8.60132V16.8137C21.3504 18.3212 20.8891 19.5831 19.9657 20.4646C19.0476 21.341 17.768 21.7504 16.3067 21.7504H8.69414C7.23281 21.7504 5.95209 21.3322 5.03394 20.4423C4.11207 19.5488 3.65039 18.2716 3.65039 16.7456V8.59984C3.65039 7.09167 4.11438 5.83167 5.0392 4.95256ZM6.07265 6.03976C5.51149 6.57317 5.15039 7.40215 5.15039 8.59984V16.7456C5.15039 17.9683 5.5138 18.8185 6.0779 19.3652C6.64573 19.9156 7.51189 20.2504 8.69414 20.2504H16.3067C17.4968 20.2504 18.364 19.9198 18.93 19.3796C19.4906 18.8445 19.8504 18.013 19.8504 16.8137V8.59984V8.59768C19.8539 7.39945 19.4958 6.57144 18.9372 6.03908C18.3728 5.50115 17.5058 5.17187 16.3145 5.17187H8.69414C7.50739 5.17187 6.6396 5.50083 6.07265 6.03976Z",fill:"#60667C"})]}),DateInput=React.forwardRef(({value:Be,onChange:Le,label:Ye,...tt},nt)=>{const ft=React.useRef(null),ht=()=>{var gt,At;(gt=ft.current)!=null&&gt.showPicker?ft.current.showPicker():(At=ft.current)==null||At.focus()};return jsxs(Box,{position:"relative",wFull:!0,maxW:"420px",children:[jsx$1(InputComposed,{ref:gt=>{ft.current=gt,typeof nt=="function"?nt(gt):nt&&(nt.current=gt)},className:"ds-date-input",label:Ye,type:"date",value:Be,onChange:Le,style:{paddingRight:"44px"},...tt}),jsx$1(Box,{as:"button",type:"button",onClick:ht,position:"absolute",right:"16px",top:"65%",transform:"translateY(-50%)",background:"transparent",border:"none",p:0,cursor:"pointer","aria-label":"Open date picker",style:{zIndex:1},children:jsx$1(CalendarIcon,{})})]})}),getTokensFromDashboardTheme=Be=>({colors:{brand:getBrandColors(Be.main)},button:{primary:{text:{default:Be.buttonColor||"#fff"}}}}),CustomPrimitivesSchema=object({colors:optional(object({neutral:optional(object({light:optional(string$2()),dark:optional(string$2())})),brand:optional(record(string$2(),string$2())),gray:optional(record(string$2(),string$2())),brandSecondary:optional(record(string$2(),string$2())),positive:optional(record(string$2(),string$2())),warn:optional(record(string$2(),string$2())),negative:optional(record(string$2(),string$2()))})),button:optional(object({primary:optional(object({surface:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())})),text:optional(object({default:optional(string$2()),disabled:optional(string$2())})),border:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())}))})),secondary:optional(object({surface:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())})),text:optional(object({default:optional(string$2()),disabled:optional(string$2())})),border:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())}))}))}))});var lib$2={exports:{}},Modal$2={},propTypes$2={exports:{}};/*
2220
+ `,IndividualCharacterInputBoxes=({amount:Be,autoFocus:Le,onChange:Ye,password:tt=!1,value:nt,isNumeric:ft=!1,maxLength:ht,hasError:gt=!1,disabled:At=!1,inputMode:xt=void 0})=>{const{t:yt}=useTranslation(),[Ct,Et]=React.useState(()=>{const Pt=nt.split("").slice(0,Be);return Pt.length<Be?[...Pt,...Array(Be-Pt.length).fill("")]:Pt}),vt=React.useRef([]),kt=React.useRef(""),bt=useTokens();React.useEffect(()=>{const Pt=nt.split("").slice(0,Be);Pt.length<Be&&Pt.push(...Array(Be-Pt.length).fill("")),Et(Pt)},[nt,Be]),React.useEffect(()=>{Le&&vt.current[0]&&vt.current[0].focus()},[Le]),React.useEffect(()=>{const Pt=tt?Ct.join(""):Ct.join("").toUpperCase();Pt!==kt.current&&(kt.current=Pt,Ye(Pt))},[Ct,Ye,tt]);const wt=(Pt,Dt)=>{var Wt;let Ot=Dt.target.value;Ot.length>1&&(Ot=Ot.charAt(0));const Lt=[...Ct];Lt[Pt]=Ot,Et(Lt),Ot&&Pt<Be-1&&((Wt=vt.current[Pt+1])==null||Wt.focus())},It=(Pt,Dt)=>{var Lt,Wt,$t;const{key:Ot}=Dt;Ot==="Backspace"?!Ct[Pt]&&Pt>0&&((Lt=vt.current[Pt-1])==null||Lt.focus()):Ot==="ArrowLeft"&&Pt>0?(Wt=vt.current[Pt-1])==null||Wt.focus():Ot==="ArrowRight"&&Pt<Be-1&&(($t=vt.current[Pt+1])==null||$t.focus())},Rt=Pt=>{Pt.target.select()},Tt=(Pt,Dt)=>{var qt;const Lt=Dt.clipboardData.getData("text").split("");if(!Lt.length)return;const Wt=[...Ct];for(let Ht=0;Ht<Lt.length&&Pt+Ht<Be;Ht++)Wt[Pt+Ht]=Lt[Ht];Et(Wt);const $t=Math.min(Pt+Lt.length,Be-1);(qt=vt.current[$t])==null||qt.focus(),Dt.preventDefault()},Bt=()=>Ct.map((Pt,Dt)=>{const Ot=yt("otp.input",{number:Dt+1,charLength:Be}),Lt=tt?"password":ft?"number":"text";return jsx$1(InputBox,{error:gt,id:`OTPInput-${Dt}`,type:Lt,inputMode:xt,onChange:Wt=>wt(Dt,Wt),onKeyDown:Wt=>It(Dt,Wt),onPaste:Wt=>Tt(Dt,Wt),onFocus:Rt,name:`input${Dt}`,"aria-label":Ot,ref:Wt=>{vt.current[Dt]=Wt},value:Pt,disabled:At,maxLength:ft?void 0:ht},`input-${Dt}`)});return jsx$1(Flex,{hFull:!0,mt:bt.spacing[8],children:jsxs(Box,{children:[jsx$1(SynchronizedInputGroup,{children:jsx$1(Flex,{gap:bt.spacing[3],children:Bt()})}),gt&&jsxs(Flex,{mt:bt.spacing[2],align:"center",children:[jsx$1(Box,{display:"inline-block",mr:bt.spacing[2],children:jsx$1(ErrorIcon$1,{size:"17"})}),jsx$1(Text$8,{display:"inline-block",as:"p",my:"auto",color:bt.input.primary.text.helper.negative,children:yt("otp.errorv2")})]})]})})},useCountryItems=()=>{const{t:Be}=useTranslation(),Le=React.useMemo(()=>{const tt=new Map;return Object.entries(countries$1).forEach(([nt,ft])=>{const ht=nt,gt=`+${getCountryCallingCode(ht)}`;tt.set(ht,{...ft,name:Be(`countries.${ht}`),id:ht,code:gt})}),tt},[Be]);return{countryItems:Le,getCountryByISOCode:tt=>Le.get(tt)}},PhoneInput=React.forwardRef(({countryISOCode:Be,label:Le,helper:Ye,showHelperIcon:tt,onChange:nt,...ft},ht)=>{const{disabled:gt=!1}=ft,{countryItems:At}=useCountryItems(),{state:xt,actions:{off:yt,on:Ct}}=useToggle(!1),[Et,vt]=React.useState(),[kt,bt]=React.useState("");React.useEffect(()=>{const Tt=At.get(Be)??At.get("MX");vt(Tt)},[Be,At]);const wt=useTokens(),It=Tt=>{const Bt=`${(Tt==null?void 0:Tt.code)||""}${kt}`;yt(),vt(Tt);const Pt=parsePhoneNumber(Bt);nt==null||nt(Bt,(Pt==null?void 0:Pt.isValid())||!1)},Rt=({target:{value:Tt}})=>{const Bt=`${(Et==null?void 0:Et.code)||""}${Tt}`;if(Et){const Pt=parsePhoneNumber(Bt),Ot=new AsYouType(Et.id).input(Bt).replace(Et.code,"");bt(Ot),nt==null||nt(Bt,(Pt==null?void 0:Pt.isValid())||!1)}};return jsx$1(Box,{children:jsxs(Flex,{direction:"column",gap:wt.spacing[2],position:"relative",children:[Le&&jsx$1(Text$8,{w:"auto",fontWeight:700,as:"label",color:wt.input.primary.text.label.default,mb:wt.spacing[2],display:"inline-block",children:Le}),jsxs(Flex,{gap:wt.spacing[2],justify:"center",children:[jsx$1(Flex,{children:jsxs(Flex,{w:"124px",justify:"center",p:wt.spacing[2],pl:wt.spacing[4],align:"center",onClick:()=>xt?yt():Ct(),borderWidth:"1px",borderColor:xt?wt.input.primary.border.active:wt.input.primary.border.default,backgroundColor:gt?wt.input.primary.surface.disabled:wt.input.primary.surface.default,borderRadius:wt.spacing[2],children:[jsx$1(Text$8,{as:"span","aria-hidden":"true",children:Et==null?void 0:Et.emoji}),jsx$1(Text$8,{as:"span","aria-hidden":"true",ml:wt.spacing[1],color:wt.color.text.body.primary,fontWeight:wt.typography.fontWeight.medium,fontSize:wt.typography.fontSize.lg,children:Et==null?void 0:Et.code}),jsx$1(Flex,{ml:wt.spacing[2],children:xt?jsx$1(UpArrow,{}):jsx$1(DownArrow,{})})]})}),jsx$1(Input$c,{ref:ht,p:wt.spacing[4],placeholder:"(123) 123-45-67",type:"tel",onChange:Rt,value:kt,...ft})]}),xt&&jsx$1(Flex,{as:"ul",position:"absolute",borderWidth:"1px",borderColor:wt.input.primary.border.default,backgroundColor:wt.input.primary.surface.default,borderRadius:wt.spacing[2],px:wt.spacing[1],py:wt.spacing[3],wFull:!0,top:"100%",maxH:"320px",zIndex:2,direction:"column",overflow:"scroll",children:At&&Array.from(At.entries()).map(([Tt,Bt])=>jsx$1(Flex,{as:"li",p:wt.spacing[4],onClick:()=>It(Bt),children:jsxs(Text$8,{color:wt.color.text.body.primary,fontWeight:wt.typography.fontWeight.medium,fontSize:wt.typography.fontSize.lg,children:[Bt.emoji," ",Bt.code," ",Bt.name]})},Tt))})]})})}),CalendarIcon=()=>jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-labelledby":"calendarIconTitle",children:[jsx$1("title",{id:"calendarIconTitle",children:"Calendar icon"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.50244 10.1563C7.50244 9.74204 7.83823 9.40625 8.25244 9.40625H16.7485C17.1627 9.40625 17.4985 9.74204 17.4985 10.1563C17.4985 10.5705 17.1627 10.9063 16.7485 10.9063H8.25244C7.83823 10.9063 7.50244 10.5705 7.50244 10.1563Z",fill:"#60667C"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.1406 2.25C16.5548 2.25 16.8906 2.58579 16.8906 3V5.96174C16.8906 6.37595 16.5548 6.71174 16.1406 6.71174C15.7264 6.71174 15.3906 6.37595 15.3906 5.96174V3C15.3906 2.58579 15.7264 2.25 16.1406 2.25Z",fill:"#60667C"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.86816 2.25C9.28238 2.25 9.61816 2.58579 9.61816 3V5.96174C9.61816 6.37595 9.28238 6.71174 8.86816 6.71174C8.45395 6.71174 8.11816 6.37595 8.11816 5.96174V3C8.11816 2.58579 8.45395 2.25 8.86816 2.25Z",fill:"#60667C"}),jsx$1("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.0392 4.95256C5.95822 4.07897 7.23731 3.67188 8.69414 3.67188H16.3145C17.7746 3.67188 19.0544 4.07865 19.9721 4.95323C20.8955 5.83327 21.3546 7.094 21.3504 8.60132C21.3504 8.6011 21.3504 8.60154 21.3504 8.60132V16.8137C21.3504 18.3212 20.8891 19.5831 19.9657 20.4646C19.0476 21.341 17.768 21.7504 16.3067 21.7504H8.69414C7.23281 21.7504 5.95209 21.3322 5.03394 20.4423C4.11207 19.5488 3.65039 18.2716 3.65039 16.7456V8.59984C3.65039 7.09167 4.11438 5.83167 5.0392 4.95256ZM6.07265 6.03976C5.51149 6.57317 5.15039 7.40215 5.15039 8.59984V16.7456C5.15039 17.9683 5.5138 18.8185 6.0779 19.3652C6.64573 19.9156 7.51189 20.2504 8.69414 20.2504H16.3067C17.4968 20.2504 18.364 19.9198 18.93 19.3796C19.4906 18.8445 19.8504 18.013 19.8504 16.8137V8.59984V8.59768C19.8539 7.39945 19.4958 6.57144 18.9372 6.03908C18.3728 5.50115 17.5058 5.17187 16.3145 5.17187H8.69414C7.50739 5.17187 6.6396 5.50083 6.07265 6.03976Z",fill:"#60667C"})]}),DateInput=React.forwardRef(({value:Be,onChange:Le,label:Ye,...tt},nt)=>{const ft=React.useRef(null);return jsxs(Box,{position:"relative",wFull:!0,maxW:"420px",children:[jsx$1(InputComposed,{ref:ht=>{ft.current=ht,typeof nt=="function"?nt(ht):nt&&(nt.current=ht)},label:Ye,type:"date",value:Be,onChange:Le,...tt}),jsx$1(Box,{position:"absolute",right:"16px",top:"65%",transform:"translateY(-50%)",style:{pointerEvents:"none",zIndex:1},children:jsx$1(CalendarIcon,{})})]})}),getTokensFromDashboardTheme=Be=>({colors:{brand:getBrandColors(Be.main)},button:{primary:{text:{default:Be.buttonColor||"#fff"}}}}),CustomPrimitivesSchema=object({colors:optional(object({neutral:optional(object({light:optional(string$2()),dark:optional(string$2())})),brand:optional(record(string$2(),string$2())),gray:optional(record(string$2(),string$2())),brandSecondary:optional(record(string$2(),string$2())),positive:optional(record(string$2(),string$2())),warn:optional(record(string$2(),string$2())),negative:optional(record(string$2(),string$2()))})),button:optional(object({primary:optional(object({surface:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())})),text:optional(object({default:optional(string$2()),disabled:optional(string$2())})),border:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())}))})),secondary:optional(object({surface:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())})),text:optional(object({default:optional(string$2()),disabled:optional(string$2())})),border:optional(object({default:optional(string$2()),hover:optional(string$2()),pressed:optional(string$2()),disabled:optional(string$2())}))}))}))});var lib$2={exports:{}},Modal$2={},propTypes$2={exports:{}};/*
2220
2221
  object-assign
2221
2222
  (c) Sindre Sorhus
2222
2223
  @license MIT
@@ -5221,7 +5222,7 @@ linearGradient:first-of-type {
5221
5222
  font-size: ${Be=>Be.fontSize||"0.875rem"};
5222
5223
  margin: 0;
5223
5224
  }
5224
- `,ThemedCaptureManualId=Be=>{var Dt;const{onlyFront:Le}=Be,[Ye,tt]=React.useState("id"),[nt,ft]=React.useState({front:!1,back:!1,passport:!1}),[ht,gt]=React.useState(((Dt=Be.token)==null?void 0:Dt.idCaptureRetries)-3||3),[At,xt]=React.useState(null),[yt,Ct]=React.useState(!1),[Et,vt]=React.useState(null),kt=React.useRef(null),{t:bt}=useTranslation$1(),wt=useTokens(),It=React.useMemo(()=>Object.values(nt).some(Ot=>Ot===!0),[nt]),Rt=Ot=>{const Lt={WRONG_DOCUMENT_SIDE:bt("manualIdUpload.wrongSide"),WRONG_ONE_SIDED_DOCUMENT:bt("manualIdUpload.wrongSide"),UNKNOWN_DOCUMENT_TYPE:bt("manualIdUpload.pleaseUploadCorrectDocument")};return Lt[Ot.failReason]?(xt(Lt[Ot.failReason]),gt(ht-1),!0):Ot.failReason?(xt(bt("manualIdUpload.somethingWentWrong")),gt(ht-1),!0):Et==="passport"&&Ot.typeOfId!=="Passport"||["front","back"].includes(Et)&&Ot.typeOfId==="Passport"?(xt(bt("manualIdUpload.pleaseUploadCorrectDocument")),gt(ht-1),!0):!1},Tt=async Ot=>{const Lt=Ot.target.files[0],Wt=5*1024*1024;if(Lt.size>Wt){xt(bt("manualIdUpload.fileTooBig"));return}Ct(!0),xt(null),(async()=>{Ct(!0);try{const qt=await capture({token:Be.token.token,image:Lt,type:["front","passport"].includes(Et)?"front":"back",onProgress:()=>{},sendBase64:!1,onlyFront:!1,isRetry:!1,isSecondId:!1,encrypted:!1,faceCoordinates:void 0,imageType:Lt.type,shouldSkipGlareBack:!1,shouldSkipGlareFront:!1,captureType:"UPLOAD",metadata:MlWasmJSApi$1.getMetadata()}),Ht=(qt.skipBackIdCapture||Et==="front"&&Le)&&{back:!0};Rt(qt)||(ft(Ut=>({...Ut,[Et]:!0,...Ht})),Ot.target.value="")}catch(qt){console.error("Error uploading image:",qt)}finally{Ct(!1)}})()},Bt=Ot=>{vt(Ot),kt.current&&kt.current.click()},Pt=()=>Ye==="id"?!(nt.front&&nt.back):!nt.passport;return yt?jsxRuntimeExports.jsx(Spinner$4,{title:bt("manualIdUpload.holdOnASec"),subtitle:bt("idv2.manualUploadLoading.subtitle")}):ht===0?(setTimeout(()=>{Be.onSuccess()},5e3),jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.tooManyTries"),maxW:"450px","data-testid":"manual-upload-error-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",align:"center",justify:"center",hFull:!0,children:jsxRuntimeExports.jsx(Text$8,{textAlign:"center",color:wt.color.text.body.secondary,fontSize:wt.typography.fontSize.base,children:bt("manualIdUpload.contactedByAdmin")})})})):jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.title"),maxW:"450px","data-testid":"manual-upload-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",gap:4,hFull:!0,children:jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:4,hFull:!0,mt:6,children:[jsxRuntimeExports.jsxs(ManualIdUploadTabs,{tokens:wt,children:[jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("id"),className:Ye==="id"&&"selected",disabled:It,children:bt("manualIdUpload.id")}),jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("passport"),className:Ye==="passport"&&"selected",disabled:It,children:bt("manualIdUpload.passport")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,justify:"space-between",children:[jsxRuntimeExports.jsxs(UploadDocumentContainer,{className:"IncodeManualUploadSectionContainer",children:[jsxRuntimeExports.jsx("input",{type:"file",style:{display:"none"},ref:kt,onChange:Tt,accept:"image/*"}),Ye==="id"&&jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdFrontIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.frontId")})]}),nt.front?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("front"),disabled:nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]}),Le?null:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdBackIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.backId")})]}),nt.back?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("back"),disabled:!nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})]}),Ye==="passport"&&jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",children:[jsxRuntimeExports.jsx(UploadPassportIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,ml:"12px",children:bt("manualIdUpload.passport")})]}),nt.passport?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("passport"),tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})}),At&&jsxRuntimeExports.jsxs(ErrorText$2,{fontSize:wt.typography.fontSize.sm,color:wt.color.surface.status.negative,children:[jsxRuntimeExports.jsx(ErrorIcon$1,{size:16}),jsxRuntimeExports.jsx("p",{children:"Please upload the correct document"})]})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:5,children:[jsxRuntimeExports.jsxs(InstructionsList,{className:"IncodeManualUploadInstrucctions",textColor:wt.color.text.body.primary,bgColor:`${wt.color.surface.primary[50]}`,children:[jsxRuntimeExports.jsx("li",{children:bt(`manualIdUpload.${Ye}Text`)}),jsxRuntimeExports.jsx("li",{children:bt("manualIdUpload.glareFree")})]}),jsxRuntimeExports.jsx(CompleteUploadButton,{type:"button",onClick:()=>Be.onSuccess(),disabled:Pt(),tokens:wt,children:bt("manualIdUpload.continue")})]})]})]})})})})},CaptureManualId=Be=>jsxRuntimeExports.jsx(IncodeProvider,{token:Be.token.token,children:jsxRuntimeExports.jsx(ThemedCaptureManualId,{...Be})});class BaseCaptureCore{constructor(){this.session=null,this.attempts=0,this.eventListeners=new Map,this.flow=null,this.idCaptureResponse=null}updateSession(Le){this.session=Le,this.emit("sessionChange",this.session)}updateFlow(Le){this.flow=Le,this.emit("flowChange",this.flow)}updateIdCaptureResponse(Le){this.idCaptureResponse=Le,this.emit("responseChanged",this.idCaptureResponse)}getFlow(){return this.flow}getSession(){return this.session}getIdCaptureResponse(){return this.idCaptureResponse}getAttempts(){return this.attempts}getMaxAttempts(){var Le;return((Le=this.flow)==null?void 0:Le.idCaptureAttempts)||3}canRetry(){return this.attempts<this.getMaxAttempts()}incrementAttempts(){this.attempts++,this.emit("attemptsChange",this.attempts)}resetAttempts(){this.attempts=0,this.emit("attemptsChange",this.attempts)}reset(){this.session=null,this.resetAttempts(),this.emit("sessionChange",this.session)}on(Le,Ye){this.eventListeners.has(Le)||this.eventListeners.set(Le,new Set);const tt=this.eventListeners.get(Le);if(!tt)throw new Error(`No listeners for event: ${Le}`);return tt.add(Ye),()=>{tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le)}}off(Le,Ye){const tt=this.eventListeners.get(Le);tt&&(tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le))}emit(Le,Ye){const tt=this.eventListeners.get(Le);tt&&tt.forEach(nt=>{nt(Ye)})}emitError(Le){this.emit("error",Le)}}function isRecordingEnabled(Be){return Be.modules.some(Le=>Le==="ENABLE_ID_RECORDING"||Le==="Enable ID recording")}const idHorizontalFrame="644650346f9f47edf1ca6b31",idVerticalFixedFrame="6454d6700f14f9356f208730",idOverlay_AutoCapture="6424aad2fddf3911cd8eee9f",idOverlay_ManualOnly="6424ab02fddf3911cd8f27a8",idOverlay_AutoManual="6424aaecfddf3911cd8f1084",paperDLFlowId="64485fa0e2c5c4b55fe9f378",FrontOrPassport=({type:Be})=>{var ht,gt;const Le=CaptureIdCore.getInstance(),Ye=(ht=Le.getFlow())==null?void 0:ht.id,tt=Le.getSession(),nt=Le.kioskOptions,ft=Le.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{onSuccess:At=>{if(At.showMandatoryConsent){Le.updateIdCaptureResponse(At),Le.changeStep("mandatoryConsent");return}if(At.skipBackIdCapture){Le.emit("finish",At);return}Le.changeStep("back")},onError:At=>{if(At.type==="skip"){Le.emit("finish","multiple attempts reached");return}if(!At.skipBackIdCapture){Le.changeStep("back");return}Le.emit("error",At)},type:Be,isRecordingEnabled:ft.enableIdRecording,showTutorial:ft.showTutorial,timeout:ft.autoCaptureTimeout,idDetectedTimeout:ft.idDetectedTimeout,ageAssurance:ft.ageAssurance,token:Le.getSession(),permissionBackgroundColor:"#696969",sendBase64:!0,showCustomCameraPermissionScreen:!0,publishAudio:ft.mergeSessionRecordings,showDoublePermissionsRequest:!0,blurrinessStrictMode:(gt=tt.clientId)==null?void 0:gt.includes("payjoy"),showAutoCaptureIDOverlay:[idOverlay_AutoCapture,idOverlay_AutoManual].some(At=>At===Ye),showManualCaptureIDOverlay:[idOverlay_ManualOnly,idOverlay_AutoManual].some(At=>At===Ye),defaultHorizontalMask:Ye===idHorizontalFrame,isFixedMask:Ye===idVerticalFixedFrame,showPaperDLTutorial:paperDLFlowId===Ye,numberOfTries:ft.captureAttempts,onLog:emptyFunc,isKiosk:(nt==null?void 0:nt.enableKiosk)??!1,flipVerticallyImage:(nt==null?void 0:nt.flipVerticallyImage)??!1,zoomLevel:(nt==null?void 0:nt.zoomLevel)??1,isDeepsightEnabled:ft.isDeepsightEnabled,isSecondId:ft.isSecondId})},BackId=()=>{var nt;const Be=CaptureIdCore.getInstance(),Le=(nt=Be.getFlow())==null?void 0:nt.id,Ye=Be.kioskOptions,tt=Be.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial,{onSuccess:ft=>{if(ft.showMandatoryConsent){Be.updateIdCaptureResponse(ft),Be.changeStep("mandatoryBackConsent");return}Be.emit("finish",ft)},onError:ft=>{if(ft.type==="skip"){Be.emit("finish","multiple attempts reached");return}Be.emit("error",ft)},type:"back",isRecordingEnabled:tt.enableIdRecording,showTutorial:tt.showTutorial,captureAttempts:tt.captureAttempts,autoCaptureTimeout:tt.autoCaptureTimeout,ageAssurance:tt.ageAssurance,token:Be.getSession(),onLog:emptyFunc,numberOfTries:tt.captureAttempts,sendBase64:!0,timeout:tt.autoCaptureTimeout,showCustomCameraPermissionScreen:!0,showDoublePermissionsRequest:!0,showPaperDLTutorial:paperDLFlowId===Le,defaultHorizontalMask:Le===idHorizontalFrame,isFixedMask:Le===idVerticalFixedFrame,publishAudio:tt.mergeSessionRecordings,idDetectedTimeout:tt.idDetectedTimeout,isKiosk:(Ye==null?void 0:Ye.enableKiosk)??!1,flipVerticallyImage:(Ye==null?void 0:Ye.flipVerticallyImage)??!1,zoomLevel:(Ye==null?void 0:Ye.zoomLevel)??1,isDeepsightEnabled:tt.isDeepsightEnabled,isSecondId:tt.isSecondId})},MandatoryConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse(),Ye=Le==null?void 0:Le.skipBackIdCapture;return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Ye?Be.emit("finish",Le):Be.changeStep("back")},onCancel:tt=>{Be.emit("error",tt)},regulationType:Le==null?void 0:Le.regulationType})},MandatoryBackConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse();return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Be.emit("finish",Le)},onCancel:Ye=>{Be.emit("error",Ye)},regulationType:Le==null?void 0:Le.regulationType})},steps$3={chooser:{component:()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdConfiguration();return jsxRuntimeExports.jsx(DocumentSelector,{showManualUpload:Le.manualUploadIdCapture,goNext:Ye=>{Be.changeStep(Ye)},session:Be.getSession()})},api:null},front:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"front"}),api:null},passport:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"passport"}),api:null},mandatoryConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryConsent,{}),api:null},back:{component:()=>jsxRuntimeExports.jsx(BackId,{}),api:null},mandatoryBackConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryBackConsent,{}),api:null},manualIdUpload:{component:()=>jsxRuntimeExports.jsx(CaptureManualId,{token:CaptureIdCore.getInstance().getSession(),onSuccess:()=>{CaptureIdCore.getInstance().emit("finish",null)}}),api:null},end:{component:()=>null,api:null}},d1=class d1 extends BaseCaptureCore{constructor(){super(),this.steps=steps$3,this.currentStep=null,this.flow=null,this.kioskOptions=null,this.captureConfig=null}static getInstance(){return d1.instance||(d1.instance=new d1),d1.instance}setup(Le,Ye,tt){if(!this.currentStep){if(this.session=Le,this.kioskOptions=Ye,tt){this.captureConfig=tt,this.handleFlowConfiguration();return}getFlow({token:Le.token}).then(nt=>{this.flow=nt,this.handleFlowConfiguration()})}}getFlow(){return this.flow}handleFlowConfiguration(){const Le=this.getIdConfiguration();if(Le.onlyBack){this.changeStep("back");return}Le.showDocumentChooser?this.changeStep("chooser"):Le.enableId?this.changeStep("front"):Le.enablePassport&&this.changeStep("passport")}changeStep(Le){this.currentStep=Le,this.emit("stepChange",{key:this.currentStep})}getStepComponent(){return!this.currentStep||!this.flow&&!this.captureConfig?null:this.steps[this.currentStep]}reset(){super.reset(),this.currentStep=null,this.flow=null,this.emit("stepChange",{key:this.currentStep})}getIdConfiguration(){var Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt;return this.captureConfig?{showTutorial:this.captureConfig.showTutorial,captureAttempts:this.captureConfig.captureAttempts,enableIdRecording:this.captureConfig.enableIdRecording,autoCaptureTimeout:this.captureConfig.autoCaptureTimeout*1e3,enablePassport:this.captureConfig.enablePassport,isSecondId:this.captureConfig.isSecondId,ageAssurance:this.captureConfig.ageAssurance,mergeSessionRecordings:this.captureConfig.mergeSessionRecordings,showDocumentChooser:this.captureConfig.showDocumentChooser,onlyBack:this.captureConfig.onlyBack,enableId:this.captureConfig.enableId,manualUploadIdCapture:this.captureConfig.manualUploadIdCapture,idDetectedTimeout:this.captureConfig.idDetectionTimeout*1e3,isDeepsightEnabled:this.captureConfig.isDeepsightEnabled}:{showTutorial:(Le=this.flow)==null?void 0:Le.modules.includes("ID capture tutorial"),enableIdRecording:isRecordingEnabled(this.flow),autoCaptureTimeout:((Ye=this.flow)==null?void 0:Ye.idCaptureTimeout)*1e3,isSecondId:!1,captureAttempts:(tt=this.flow)==null?void 0:tt.idCaptureAttempts,idDetectedTimeout:((nt=this.flow)==null?void 0:nt.deviceIdleTimeout)*1e3,ageAssurance:(ft=this.flow)==null?void 0:ft.ageAssurance,mergeSessionRecordings:(ht=this.flow)==null?void 0:ht.mergeSessionRecordings,showDocumentChooser:((gt=this.flow)==null?void 0:gt.modules.includes("Enable ID"))&&((At=this.flow)==null?void 0:At.modules.includes("Enable Passport"))&&((xt=this.flow)==null?void 0:xt.showDocumentChooserScreen),onlyBack:(yt=this.flow)==null?void 0:yt.onlyBack,enableId:(Ct=this.flow)==null?void 0:Ct.modules.includes("Enable ID"),enablePassport:(Et=this.flow)==null?void 0:Et.modules.includes("Enable Passport"),manualUploadIdCapture:(vt=this.flow)==null?void 0:vt.manualUploadIdCapture,isDeepsightEnabled:((kt=this.flow)==null?void 0:kt.deepsightLiveness)==="VIDEOLIVENESS"}}};d1.instance=null;let CaptureIdCore=d1;const CaptureId$2=({onSuccess:Be,onError:Le,session:Ye,kioskOptions:tt,captureConfig:nt})=>{var xt;const ft=CaptureIdCore.getInstance(),[ht,gt]=React.useState(null);useModuleEvents({module:eventModuleNames.front,token:Ye.token,payload:{moduleVersion:"1"}}),React.useEffect(()=>{const yt=CaptureIdCore.getInstance();return()=>{yt.reset()}},[]),React.useEffect(()=>{const yt=ft.on("stepChange",vt=>{gt(vt)}),Ct=ft.on("finish",vt=>{Be==null||Be(vt)}),Et=ft.on("error",vt=>{Le(vt)});return ft.setup(Ye,tt,nt),()=>{Ct(),Et(),yt()}},[Le,Be,Ye,tt,nt,ft]);const At=(xt=ft.getStepComponent())==null?void 0:xt.component;return At?jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(At,{})}):null};class IdFlowManager extends AbstractFlowManager{constructor(){super({currentStep:null}),this.kioskOptions=null,this.idFrameSize=null,this.onCapture=null,this.captureOnly=!1,this.capturedImages={},this.permissionsGranted=!1,this.captureMode="both",this.maxFrameSize={horizontal:{width:640,height:400},vertical:{width:400,height:640}}}async initialize(Le){var Ye,tt;Le.kioskOptions&&(this.kioskOptions=Le.kioskOptions),this.parentSize=(Ye=Le.parentSize)!=null&&Ye.width&&((tt=Le.parentSize)!=null&&tt.height)?Le.parentSize:this.parentSize,this.onCapture=Le.onCapture||null,this.captureOnly=Le.captureOnly||!1,this.capturedImages={},this.captureMode=Le.captureMode||"both",await super.initialize({sessionToken:Le.sessionToken,captureConfig:Le.captureConfig,parentSize:Le.parentSize,uiConfig:Le.uiConfig}),this.setFrameSize()}async determineInitialStep(Le){return this.setState({attempts:0}),this.permissionsGranted=await this.isPermissionsEnabled(),Le.onlyBack?"id":Le.showDocumentChooser?"chooser":Le.enableId?"id":Le.enablePassport?"passport":Le.manualUploadIdCapture?"manualIdUpload":Le.digitalIdsUpload?"digitalIdUpload":"error"}goToChooser(){this.setState({currentStep:"chooser"})}goToIdStep(){this.setState({currentStep:"id"})}goToPassportStep(){this.setState({currentStep:"passport"})}goToManualUploadStep(){this.setState({currentStep:"manualIdUpload"})}goToDigitalIdUploadStep(){this.setState({currentStep:"digitalIdUpload"})}storeCapturedImage(Le,Ye){this.capturedImages[Le]=Ye}completeCaptureOnlyFlow(){const{front:Le,back:Ye}=this.capturedImages;!this.captureOnly||!this.onCapture||this.onCapture({frontImage:Le,backImage:Ye})}goToPermissions(){this.setState({currentStep:"permissions"})}changeStep(Le){this.setState({currentStep:Le})}setParentSize(Le){this.parentSize=Le,this.setFrameSize()}setFrameSize(){this.parentSize&&(this.idFrameSize={horizontal:{width:this.parentSize?this.parentSize.width>options.maxContentWidth?this.maxFrameSize.horizontal.width:this.parentSize.width>600?this.parentSize.width*.65:this.parentSize.width*.9:window.innerWidth*.9,height:null},vertical:{width:null,height:this.parentSize.height-350>this.maxFrameSize.vertical.height?this.maxFrameSize.vertical.height:this.parentSize.height-350}})}getPermissionsGranted(){return this.permissionsGranted}getHorizontalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.horizontal)||null}getVerticalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.vertical)||null}getFrameSizeByOrientation(Le){var Ye;return((Ye=this.idFrameSize)==null?void 0:Ye[Le])||null}completeFlow(){this.setState({successData:this.state.successData,flowOutcome:"success",currentStep:"end"})}completeWithError(Le){this.setState({errorDetails:Le,flowOutcome:"error",currentStep:"error"})}saveCaptureResponse(Le){this.setState({successData:Le})}getCaptureConfiguration(){var nt,ft,ht;const Le=this.captureConfig;if(Le)return{showTutorial:Le.showTutorial,captureAttempts:Le.captureAttempts,isRecordingEnabled:Le.enableIdRecording,autoCaptureTimeout:Le.autoCaptureTimeout*1e3,enablePassport:Le.enablePassport,isSecondId:Le.isSecondId,ageAssurance:Le.ageAssurance,mergeSessionRecordings:Le.mergeSessionRecordings,showDocumentChooser:Le.showDocumentChooser,onlyBack:this.captureMode==="back_only"?!0:Le.onlyBack,enableId:Le.enableId,manualUploadIdCapture:Le.manualUploadIdCapture,digitalIdsUpload:Le.digitalIdsUpload,idDetectedTimeout:Le.idDetectionTimeout*1e3,isDeepsightEnabled:Le.isDeepsightEnabled,usSmartCapture:Le.usSmartCapture,onlyFront:this.captureMode==="front_only"};const Ye=(nt=this.flow.flowModules.find(gt=>gt.key==="ID"))==null?void 0:nt.configuration,tt=(ht=(ft=this.flow.flowModules.find(gt=>gt.key==="SELFIE"))==null?void 0:ft.configuration)==null?void 0:ht.deepsightLiveness;return{showTutorial:Ye.showTutorial,isRecordingEnabled:Ye.enableIdRecording,autoCaptureTimeout:Ye.autoCaptureTimeout*1e3,isSecondId:!1,captureAttempts:Ye.captureAttempts,idDetectedTimeout:Ye.deviceIdleTimeout*1e3,ageAssurance:this.flow.ageAssurance,mergeSessionRecordings:this.flow.mergeSessionRecordings,showDocumentChooser:Ye.showDocumentChooserScreen,onlyBack:Ye.onlyBack,onlyFront:!1,enableId:Ye.enableId,enablePassport:Ye.enablePassport,manualUploadIdCapture:Ye.manualUploadIdCapture,digitalIdsUpload:Ye.digitalIdsUpload||!1,isDeepsightEnabled:tt==="VIDEOLIVENESS",usSmartCapture:Ye.usSmartCapture}}getMaxAttempts(){var Le;return((Le=this.captureConfiguration)==null?void 0:Le.captureAttempts)||3}onClose(){super.onClose(FlowType.ID)}}const idFlowManager=new IdFlowManager,SHARPNESS_THRESHOLD=10,GLARE_THRESHOLD=10;class CaptureIdError extends Error{constructor(Le,Ye,tt){super(Ye),this.errorKey=Le,this.messageDescription=tt,this.name="CaptureIdError"}}const createCaptureIdApi=Be=>{if(!Be)throw new CaptureIdError("NO_TOKEN","Session token not found");const Le=async tt=>{const nt=tt.ageAssurance?[tt.type==="back"?"croppedBackID":"croppedFrontID"]:[];try{return await getImages$1({token:Be,body:{images:["croppedIDFace",...nt]}})}catch{return{croppedIDFace:"",croppedFrontID:"",croppedBackID:""}}},Ye=(tt,nt)=>tt.failReason==="ID_TYPE_UNACCEPTABLE"?{error:!0,message:"ID type is not acceptable",messageDescription:"Please use a valid ID type",errorKey:"ID_TYPE_UNACCEPTABLE"}:tt.failReason==="WRONG_DOCUMENT_SIDE"?{error:!0,message:"Wrong side of document",messageDescription:tt.side==="back"?"Please show the back side of your ID":"Please show the front side of your ID",errorKey:"WRONG_DOCUMENT_SIDE"}:tt.classification?tt.sharpness!==void 0&&tt.sharpness<SHARPNESS_THRESHOLD?{error:!0,message:"Image is not sharp enough",messageDescription:"Please ensure the image is clear and well-focused",errorKey:"LOW_SHARPNESS"}:tt.glare!==void 0&&tt.glare<GLARE_THRESHOLD&&!(nt!=null&&nt.skipGlareFront)?{error:!0,message:"Glare detected on ID",messageDescription:"Please avoid bright reflections on your ID",errorKey:"GLARE_DETECTED"}:{error:!1,message:null,errorKey:null}:{error:!0,message:"ID classification failed",errorKey:"CLASSIFICATION_FAILED"};return{async uploadId(tt){var nt,ft;try{idFlowManager.incrementAttempts(),(nt=tt.onProgress)==null||nt.call(tt,0),await onboardingAnalytics.analyzeFrame(tt.image),onboardingAnalytics.update(),MlWasmJSApi$1.reset(),tt.type==="front"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),tt.type==="back"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),addEvent({token:Be,code:"captureAttemptFinished",module:"ID",payload:{logs:onboardingAnalytics.getPipelineLogs()}});const ht=await capture({...tt,token:Be,type:tt.type==="front"?frontType:backType,encrypted:!1,faceCoordinates:void 0,imageType:void 0,onProgress:tt.onProgress,metadata:onboardingAnalytics.getMetadata()}),gt=await Le({type:tt.type,ageAssurance:tt.ageAssurance}),At={...ht,originalImage:tt.image,frontIdImage:tt.type==="front"?tt.image:void 0,backIdImage:gt.croppedBackID,...gt};idFlowManager.saveCaptureResponse(At);const xt=Ye({...At,side:tt.type},{skipGlareFront:ht.skipGlareFront,skipGlareBack:ht.skipGlareBack});if(xt.error)throw new CaptureIdError(xt.errorKey,xt.message,xt.messageDescription);return(ft=tt.onProgress)==null||ft.call(tt,100),idFlowManager.resetAttempts(),At}catch(ht){if(!idFlowManager.canRetry()){const gt=idFlowManager.getState().successData;throw tt.type!=="front"?new CaptureIdError("NO_MORE_TRIES","No more retry attempts available"):gt!=null&&gt.skipBackIdCapture?new CaptureIdError("RETRY_EXHAUSTED_SKIP_BACK","Front ID retries exhausted, skip back ID capture"):new CaptureIdError("RETRY_EXHAUSTED_CONTINUE_TO_BACK","Front ID retries exhausted, continue to back ID capture")}throw ht instanceof CaptureIdError?ht:new CaptureIdError("UNEXPECTED_ERROR","Unexpected capture error")}},reset(){idFlowManager.resetAttempts()}}},useCaptureIdState=()=>{const[Be,Le]=React.useState(idFlowManager.getState()),[Ye,tt]=React.useState(null);React.useEffect(()=>idFlowManager.subscribe(Le),[]);const nt=idFlowManager.getToken();React.useEffect(()=>{if(!nt){tt(null);return}try{const ht=createCaptureIdApi(nt);tt(ht)}catch(ht){console.error("Failed to create capture API:",ht),tt(null)}},[nt]);const ft=idFlowManager.getCaptureConfiguration();return{token:idFlowManager.getToken(),currentStep:Be.currentStep,flowOutcome:Be.flowOutcome,isLoading:Be.isLoading,errorDetails:Be.errorDetails,successData:Be.successData,attempts:Be.attempts,uploadId:Ye==null?void 0:Ye.uploadId.bind(Ye),completeWithError:ht=>idFlowManager.completeWithError(ht),reset:()=>idFlowManager.reset(),canRetry:()=>idFlowManager.canRetry(),getAttempts:()=>Be.attempts,completeFlow:()=>idFlowManager.completeFlow(),goToChooser:()=>idFlowManager.goToChooser(),goToIdStep:()=>idFlowManager.goToIdStep(),goToPassportStep:()=>idFlowManager.goToPassportStep(),goToManualUploadStep:()=>idFlowManager.goToManualUploadStep(),goToDigitalIdUploadStep:()=>idFlowManager.goToDigitalIdUploadStep(),goToPermissions:()=>idFlowManager.goToPermissions(),changeStep:ht=>idFlowManager.changeStep(ht),resetAttempts:()=>idFlowManager.resetAttempts(),kioskOptions:idFlowManager.kioskOptions,captureConfiguration:ft,attemptsLeft:idFlowManager.getAttemptsLeft(),uiConfig:idFlowManager.uiConfig,captureOnly:idFlowManager.captureOnly,onCapture:idFlowManager.onCapture,storeCapturedImage:(ht,gt)=>idFlowManager.storeCapturedImage(ht,gt),completeCaptureOnlyFlow:()=>idFlowManager.completeCaptureOnlyFlow(),isDeepsightEnabled:ft.isDeepsightEnabled}},IdFlowPage=({closeButtonColor:Be,closeButtonOnCancel:Le,...Ye})=>{const{uiConfig:tt}=useCaptureIdState(),nt=Be?{...tt,closeButton:{...tt==null?void 0:tt.closeButton,color:Be}}:tt;return jsxRuntimeExports.jsx(FlowPage,{uiConfig:nt,onClose:()=>idFlowManager.onClose(),onCloseCancel:Le,...Ye})},StyledArrowIcon$1=dt.svg`
5225
+ `,ThemedCaptureManualId=Be=>{var Dt;const{onlyFront:Le}=Be,[Ye,tt]=React.useState("id"),[nt,ft]=React.useState({front:!1,back:!1,passport:!1}),[ht,gt]=React.useState(((Dt=Be.token)==null?void 0:Dt.idCaptureRetries)-3||3),[At,xt]=React.useState(null),[yt,Ct]=React.useState(!1),[Et,vt]=React.useState(null),kt=React.useRef(null),{t:bt}=useTranslation$1(),wt=useTokens(),It=React.useMemo(()=>Object.values(nt).some(Ot=>Ot===!0),[nt]),Rt=Ot=>{const Lt={WRONG_DOCUMENT_SIDE:bt("manualIdUpload.wrongSide"),WRONG_ONE_SIDED_DOCUMENT:bt("manualIdUpload.wrongSide"),UNKNOWN_DOCUMENT_TYPE:bt("manualIdUpload.pleaseUploadCorrectDocument")};return Lt[Ot.failReason]?(xt(Lt[Ot.failReason]),gt(ht-1),!0):Ot.failReason?(xt(bt("manualIdUpload.somethingWentWrong")),gt(ht-1),!0):Et==="passport"&&Ot.typeOfId!=="Passport"||["front","back"].includes(Et)&&Ot.typeOfId==="Passport"?(xt(bt("manualIdUpload.pleaseUploadCorrectDocument")),gt(ht-1),!0):!1},Tt=async Ot=>{const Lt=Ot.target.files[0],Wt=5*1024*1024;if(Lt.size>Wt){xt(bt("manualIdUpload.fileTooBig"));return}Ct(!0),xt(null),(async()=>{Ct(!0);try{const qt=await capture({token:Be.token.token,image:Lt,type:["front","passport"].includes(Et)?"front":"back",onProgress:()=>{},sendBase64:!1,onlyFront:!1,isRetry:!1,isSecondId:!1,encrypted:!1,faceCoordinates:void 0,imageType:Lt.type,shouldSkipGlareBack:!1,shouldSkipGlareFront:!1,captureType:"UPLOAD",metadata:MlWasmJSApi$1.getMetadata()}),Ht=(qt.skipBackIdCapture||Et==="front"&&Le)&&{back:!0};Rt(qt)||(ft(Ut=>({...Ut,[Et]:!0,...Ht})),Ot.target.value="")}catch(qt){console.error("Error uploading image:",qt)}finally{Ct(!1)}})()},Bt=Ot=>{vt(Ot),kt.current&&kt.current.click()},Pt=()=>Ye==="id"?!(nt.front&&nt.back):!nt.passport;return yt?jsxRuntimeExports.jsx(Spinner$4,{title:bt("manualIdUpload.holdOnASec"),subtitle:bt("idv2.manualUploadLoading.subtitle")}):ht===0?(setTimeout(()=>{Be.onSuccess()},5e3),jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.tooManyTries"),maxW:"450px","data-testid":"manual-upload-error-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",align:"center",justify:"center",hFull:!0,children:jsxRuntimeExports.jsx(Text$8,{textAlign:"center",color:wt.color.text.body.secondary,fontSize:wt.typography.fontSize.base,children:bt("manualIdUpload.contactedByAdmin")})})})):jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.title"),maxW:"450px","data-testid":"manual-upload-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",gap:4,hFull:!0,children:jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:4,hFull:!0,mt:6,children:[jsxRuntimeExports.jsxs(ManualIdUploadTabs,{tokens:wt,children:[jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("id"),className:Ye==="id"&&"selected",disabled:It,children:bt("manualIdUpload.id")}),jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("passport"),className:Ye==="passport"&&"selected",disabled:It,children:bt("manualIdUpload.passport")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,justify:"space-between",children:[jsxRuntimeExports.jsxs(UploadDocumentContainer,{className:"IncodeManualUploadSectionContainer",children:[jsxRuntimeExports.jsx("input",{type:"file",style:{display:"none"},ref:kt,onChange:Tt,accept:"image/*"}),Ye==="id"&&jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdFrontIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.frontId")})]}),nt.front?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("front"),disabled:nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]}),Le?null:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdBackIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.backId")})]}),nt.back?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("back"),disabled:!nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})]}),Ye==="passport"&&jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",children:[jsxRuntimeExports.jsx(UploadPassportIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,ml:"12px",children:bt("manualIdUpload.passport")})]}),nt.passport?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("passport"),tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})}),At&&jsxRuntimeExports.jsxs(ErrorText$2,{fontSize:wt.typography.fontSize.sm,color:wt.color.surface.status.negative,children:[jsxRuntimeExports.jsx(ErrorIcon$1,{size:16}),jsxRuntimeExports.jsx("p",{children:"Please upload the correct document"})]})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:5,children:[jsxRuntimeExports.jsxs(InstructionsList,{className:"IncodeManualUploadInstrucctions",textColor:wt.color.text.body.primary,bgColor:`${wt.color.surface.primary[50]}`,children:[jsxRuntimeExports.jsx("li",{children:bt(`manualIdUpload.${Ye}Text`)}),jsxRuntimeExports.jsx("li",{children:bt("manualIdUpload.glareFree")})]}),jsxRuntimeExports.jsx(CompleteUploadButton,{type:"button",onClick:()=>Be.onSuccess(),disabled:Pt(),tokens:wt,children:bt("manualIdUpload.continue")})]})]})]})})})})},CaptureManualId=Be=>jsxRuntimeExports.jsx(IncodeProvider,{token:Be.token.token,children:jsxRuntimeExports.jsx(ThemedCaptureManualId,{...Be})});class BaseCaptureCore{constructor(){this.session=null,this.attempts=0,this.eventListeners=new Map,this.flow=null,this.idCaptureResponse=null}updateSession(Le){this.session=Le,this.emit("sessionChange",this.session)}updateFlow(Le){this.flow=Le,this.emit("flowChange",this.flow)}updateIdCaptureResponse(Le){this.idCaptureResponse=Le,this.emit("responseChanged",this.idCaptureResponse)}getFlow(){return this.flow}getSession(){return this.session}getIdCaptureResponse(){return this.idCaptureResponse}getAttempts(){return this.attempts}getMaxAttempts(){var Le;return((Le=this.flow)==null?void 0:Le.idCaptureAttempts)||3}canRetry(){return this.attempts<this.getMaxAttempts()}incrementAttempts(){this.attempts++,this.emit("attemptsChange",this.attempts)}resetAttempts(){this.attempts=0,this.emit("attemptsChange",this.attempts)}reset(){this.session=null,this.resetAttempts(),this.emit("sessionChange",this.session)}on(Le,Ye){this.eventListeners.has(Le)||this.eventListeners.set(Le,new Set);const tt=this.eventListeners.get(Le);if(!tt)throw new Error(`No listeners for event: ${Le}`);return tt.add(Ye),()=>{tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le)}}off(Le,Ye){const tt=this.eventListeners.get(Le);tt&&(tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le))}emit(Le,Ye){const tt=this.eventListeners.get(Le);tt&&tt.forEach(nt=>{nt(Ye)})}emitError(Le){this.emit("error",Le)}}function isRecordingEnabled(Be){return Be.modules.some(Le=>Le==="ENABLE_ID_RECORDING"||Le==="Enable ID recording")}const idHorizontalFrame="644650346f9f47edf1ca6b31",idVerticalFixedFrame="6454d6700f14f9356f208730",idOverlay_AutoCapture="6424aad2fddf3911cd8eee9f",idOverlay_ManualOnly="6424ab02fddf3911cd8f27a8",idOverlay_AutoManual="6424aaecfddf3911cd8f1084",paperDLFlowId="64485fa0e2c5c4b55fe9f378",FrontOrPassport=({type:Be})=>{var ht,gt;const Le=CaptureIdCore.getInstance(),Ye=(ht=Le.getFlow())==null?void 0:ht.id,tt=Le.getSession(),nt=Le.kioskOptions,ft=Le.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{onSuccess:At=>{if(At.showMandatoryConsent){Le.updateIdCaptureResponse(At),Le.changeStep("mandatoryConsent");return}if(At.skipBackIdCapture){Le.emit("finish",At);return}Le.changeStep("back")},onError:At=>{if(At.type==="skip"){Le.emit("finish","multiple attempts reached");return}if(!At.skipBackIdCapture){Le.changeStep("back");return}Le.emit("error",At)},type:Be,isRecordingEnabled:ft.enableIdRecording,showTutorial:ft.showTutorial,timeout:ft.autoCaptureTimeout,idDetectedTimeout:ft.idDetectedTimeout,ageAssurance:ft.ageAssurance,token:Le.getSession(),permissionBackgroundColor:"#696969",sendBase64:!0,showCustomCameraPermissionScreen:!0,publishAudio:ft.mergeSessionRecordings,showDoublePermissionsRequest:!0,blurrinessStrictMode:(gt=tt.clientId)==null?void 0:gt.includes("payjoy"),showAutoCaptureIDOverlay:[idOverlay_AutoCapture,idOverlay_AutoManual].some(At=>At===Ye),showManualCaptureIDOverlay:[idOverlay_ManualOnly,idOverlay_AutoManual].some(At=>At===Ye),defaultHorizontalMask:Ye===idHorizontalFrame,isFixedMask:Ye===idVerticalFixedFrame,showPaperDLTutorial:paperDLFlowId===Ye,numberOfTries:ft.captureAttempts,onLog:emptyFunc,isKiosk:(nt==null?void 0:nt.enableKiosk)??!1,flipVerticallyImage:(nt==null?void 0:nt.flipVerticallyImage)??!1,zoomLevel:(nt==null?void 0:nt.zoomLevel)??1,isDeepsightEnabled:ft.isDeepsightEnabled,isSecondId:ft.isSecondId})},BackId=()=>{var nt;const Be=CaptureIdCore.getInstance(),Le=(nt=Be.getFlow())==null?void 0:nt.id,Ye=Be.kioskOptions,tt=Be.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial,{onSuccess:ft=>{if(ft.showMandatoryConsent){Be.updateIdCaptureResponse(ft),Be.changeStep("mandatoryBackConsent");return}Be.emit("finish",ft)},onError:ft=>{if(ft.type==="skip"){Be.emit("finish","multiple attempts reached");return}Be.emit("error",ft)},type:"back",isRecordingEnabled:tt.enableIdRecording,showTutorial:tt.showTutorial,captureAttempts:tt.captureAttempts,autoCaptureTimeout:tt.autoCaptureTimeout,ageAssurance:tt.ageAssurance,token:Be.getSession(),onLog:emptyFunc,numberOfTries:tt.captureAttempts,sendBase64:!0,timeout:tt.autoCaptureTimeout,showCustomCameraPermissionScreen:!0,showDoublePermissionsRequest:!0,showPaperDLTutorial:paperDLFlowId===Le,defaultHorizontalMask:Le===idHorizontalFrame,isFixedMask:Le===idVerticalFixedFrame,publishAudio:tt.mergeSessionRecordings,idDetectedTimeout:tt.idDetectedTimeout,isKiosk:(Ye==null?void 0:Ye.enableKiosk)??!1,flipVerticallyImage:(Ye==null?void 0:Ye.flipVerticallyImage)??!1,zoomLevel:(Ye==null?void 0:Ye.zoomLevel)??1,isDeepsightEnabled:tt.isDeepsightEnabled,isSecondId:tt.isSecondId})},MandatoryConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse(),Ye=Le==null?void 0:Le.skipBackIdCapture;return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Ye?Be.emit("finish",Le):Be.changeStep("back")},onCancel:tt=>{Be.emit("error",tt)},regulationType:Le==null?void 0:Le.regulationType})},MandatoryBackConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse();return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Be.emit("finish",Le)},onCancel:Ye=>{Be.emit("error",Ye)},regulationType:Le==null?void 0:Le.regulationType})},steps$3={chooser:{component:()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdConfiguration();return jsxRuntimeExports.jsx(DocumentSelector,{showManualUpload:Le.manualUploadIdCapture,goNext:Ye=>{Be.changeStep(Ye)},session:Be.getSession()})},api:null},front:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"front"}),api:null},passport:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"passport"}),api:null},mandatoryConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryConsent,{}),api:null},back:{component:()=>jsxRuntimeExports.jsx(BackId,{}),api:null},mandatoryBackConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryBackConsent,{}),api:null},manualIdUpload:{component:()=>jsxRuntimeExports.jsx(CaptureManualId,{token:CaptureIdCore.getInstance().getSession(),onSuccess:()=>{CaptureIdCore.getInstance().emit("finish",null)}}),api:null},end:{component:()=>null,api:null}},d1=class d1 extends BaseCaptureCore{constructor(){super(),this.steps=steps$3,this.currentStep=null,this.flow=null,this.kioskOptions=null,this.captureConfig=null}static getInstance(){return d1.instance||(d1.instance=new d1),d1.instance}setup(Le,Ye,tt){if(!this.currentStep){if(this.session=Le,this.kioskOptions=Ye,tt){this.captureConfig=tt,this.handleFlowConfiguration();return}getFlow({token:Le.token}).then(nt=>{this.flow=nt,this.handleFlowConfiguration()})}}getFlow(){return this.flow}handleFlowConfiguration(){const Le=this.getIdConfiguration();if(Le.onlyBack){this.changeStep("back");return}Le.showDocumentChooser?this.changeStep("chooser"):Le.enableId?this.changeStep("front"):Le.enablePassport&&this.changeStep("passport")}changeStep(Le){this.currentStep=Le,this.emit("stepChange",{key:this.currentStep})}getStepComponent(){return!this.currentStep||!this.flow&&!this.captureConfig?null:this.steps[this.currentStep]}reset(){super.reset(),this.currentStep=null,this.flow=null,this.emit("stepChange",{key:this.currentStep})}getIdConfiguration(){var Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt;return this.captureConfig?{showTutorial:this.captureConfig.showTutorial,captureAttempts:this.captureConfig.captureAttempts??3,enableIdRecording:this.captureConfig.enableIdRecording,autoCaptureTimeout:this.captureConfig.autoCaptureTimeout*1e3,enablePassport:this.captureConfig.enablePassport,isSecondId:this.captureConfig.isSecondId,ageAssurance:this.captureConfig.ageAssurance,mergeSessionRecordings:this.captureConfig.mergeSessionRecordings,showDocumentChooser:this.captureConfig.showDocumentChooser,onlyBack:this.captureConfig.onlyBack,enableId:this.captureConfig.enableId,manualUploadIdCapture:this.captureConfig.manualUploadIdCapture,idDetectedTimeout:this.captureConfig.idDetectionTimeout*1e3,isDeepsightEnabled:this.captureConfig.isDeepsightEnabled}:{showTutorial:(Le=this.flow)==null?void 0:Le.modules.includes("ID capture tutorial"),enableIdRecording:isRecordingEnabled(this.flow),autoCaptureTimeout:((Ye=this.flow)==null?void 0:Ye.idCaptureTimeout)*1e3,isSecondId:!1,captureAttempts:(tt=this.flow)==null?void 0:tt.idCaptureAttempts,idDetectedTimeout:((nt=this.flow)==null?void 0:nt.deviceIdleTimeout)*1e3,ageAssurance:(ft=this.flow)==null?void 0:ft.ageAssurance,mergeSessionRecordings:(ht=this.flow)==null?void 0:ht.mergeSessionRecordings,showDocumentChooser:((gt=this.flow)==null?void 0:gt.modules.includes("Enable ID"))&&((At=this.flow)==null?void 0:At.modules.includes("Enable Passport"))&&((xt=this.flow)==null?void 0:xt.showDocumentChooserScreen),onlyBack:(yt=this.flow)==null?void 0:yt.onlyBack,enableId:(Ct=this.flow)==null?void 0:Ct.modules.includes("Enable ID"),enablePassport:(Et=this.flow)==null?void 0:Et.modules.includes("Enable Passport"),manualUploadIdCapture:(vt=this.flow)==null?void 0:vt.manualUploadIdCapture,isDeepsightEnabled:((kt=this.flow)==null?void 0:kt.deepsightLiveness)==="VIDEOLIVENESS"}}};d1.instance=null;let CaptureIdCore=d1;const CaptureId$2=({onSuccess:Be,onError:Le,session:Ye,kioskOptions:tt,captureConfig:nt})=>{var xt;const ft=CaptureIdCore.getInstance(),[ht,gt]=React.useState(null);useModuleEvents({module:eventModuleNames.front,token:Ye.token,payload:{moduleVersion:"1"}}),React.useEffect(()=>{const yt=CaptureIdCore.getInstance();return()=>{yt.reset()}},[]),React.useEffect(()=>{const yt=ft.on("stepChange",vt=>{gt(vt)}),Ct=ft.on("finish",vt=>{Be==null||Be(vt)}),Et=ft.on("error",vt=>{Le(vt)});return ft.setup(Ye,tt,nt),()=>{Ct(),Et(),yt()}},[Le,Be,Ye,tt,nt,ft]);const At=(xt=ft.getStepComponent())==null?void 0:xt.component;return At?jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(At,{})}):null};class IdFlowManager extends AbstractFlowManager{constructor(){super({currentStep:null}),this.kioskOptions=null,this.idFrameSize=null,this.onCapture=null,this.captureOnly=!1,this.capturedImages={},this.permissionsGranted=!1,this.captureMode="both",this.maxFrameSize={horizontal:{width:640,height:400},vertical:{width:400,height:640}}}async initialize(Le){var Ye,tt;Le.kioskOptions&&(this.kioskOptions=Le.kioskOptions),this.parentSize=(Ye=Le.parentSize)!=null&&Ye.width&&((tt=Le.parentSize)!=null&&tt.height)?Le.parentSize:this.parentSize,this.onCapture=Le.onCapture||null,this.captureOnly=Le.captureOnly||!1,this.capturedImages={},this.captureMode=Le.captureMode||"both",await super.initialize({sessionToken:Le.sessionToken,captureConfig:Le.captureConfig,parentSize:Le.parentSize,uiConfig:Le.uiConfig}),this.setFrameSize()}async determineInitialStep(Le){return this.setState({attempts:0}),this.permissionsGranted=await this.isPermissionsEnabled(),Le.onlyBack?"id":Le.showDocumentChooser?"chooser":Le.enableId?"id":Le.enablePassport?"passport":Le.manualUploadIdCapture?"manualIdUpload":Le.digitalIdsUpload?"digitalIdUpload":"error"}goToChooser(){this.setState({currentStep:"chooser"})}goToIdStep(){this.setState({currentStep:"id"})}goToPassportStep(){this.setState({currentStep:"passport"})}goToManualUploadStep(){this.setState({currentStep:"manualIdUpload"})}goToDigitalIdUploadStep(){this.setState({currentStep:"digitalIdUpload"})}storeCapturedImage(Le,Ye){this.capturedImages[Le]=Ye}completeCaptureOnlyFlow(){const{front:Le,back:Ye}=this.capturedImages;!this.captureOnly||!this.onCapture||this.onCapture({frontImage:Le,backImage:Ye})}goToPermissions(){this.setState({currentStep:"permissions"})}changeStep(Le){this.setState({currentStep:Le})}setParentSize(Le){this.parentSize=Le,this.setFrameSize()}setFrameSize(){this.parentSize&&(this.idFrameSize={horizontal:{width:this.parentSize?this.parentSize.width>options.maxContentWidth?this.maxFrameSize.horizontal.width:this.parentSize.width>600?this.parentSize.width*.65:this.parentSize.width*.9:window.innerWidth*.9,height:null},vertical:{width:null,height:this.parentSize.height-350>this.maxFrameSize.vertical.height?this.maxFrameSize.vertical.height:this.parentSize.height-350}})}getPermissionsGranted(){return this.permissionsGranted}getHorizontalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.horizontal)||null}getVerticalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.vertical)||null}getFrameSizeByOrientation(Le){var Ye;return((Ye=this.idFrameSize)==null?void 0:Ye[Le])||null}completeFlow(){this.setState({successData:this.state.successData,flowOutcome:"success",currentStep:"end"})}completeWithError(Le){this.setState({errorDetails:Le,flowOutcome:"error",currentStep:"error"})}saveCaptureResponse(Le){this.setState({successData:Le})}getCaptureConfiguration(){var nt,ft,ht;const Le=this.captureConfig;if(Le)return{showTutorial:Le.showTutorial,captureAttempts:Le.captureAttempts??3,isRecordingEnabled:Le.enableIdRecording,autoCaptureTimeout:Le.autoCaptureTimeout*1e3,enablePassport:Le.enablePassport,isSecondId:Le.isSecondId,ageAssurance:Le.ageAssurance,mergeSessionRecordings:Le.mergeSessionRecordings,showDocumentChooser:Le.showDocumentChooser,onlyBack:this.captureMode==="back_only"?!0:Le.onlyBack,enableId:Le.enableId,manualUploadIdCapture:Le.manualUploadIdCapture,digitalIdsUpload:Le.digitalIdsUpload,idDetectedTimeout:Le.idDetectionTimeout*1e3,isDeepsightEnabled:Le.isDeepsightEnabled,usSmartCapture:Le.usSmartCapture,onlyFront:this.captureMode==="front_only"};const Ye=(nt=this.flow.flowModules.find(gt=>gt.key==="ID"))==null?void 0:nt.configuration,tt=(ht=(ft=this.flow.flowModules.find(gt=>gt.key==="SELFIE"))==null?void 0:ft.configuration)==null?void 0:ht.deepsightLiveness;return{showTutorial:Ye.showTutorial,isRecordingEnabled:Ye.enableIdRecording,autoCaptureTimeout:Ye.autoCaptureTimeout*1e3,isSecondId:!1,captureAttempts:Ye.captureAttempts??3,idDetectedTimeout:Ye.deviceIdleTimeout*1e3,ageAssurance:this.flow.ageAssurance,mergeSessionRecordings:this.flow.mergeSessionRecordings,showDocumentChooser:Ye.showDocumentChooserScreen,onlyBack:Ye.onlyBack,onlyFront:!1,enableId:Ye.enableId,enablePassport:Ye.enablePassport,manualUploadIdCapture:Ye.manualUploadIdCapture,digitalIdsUpload:Ye.digitalIdsUpload||!1,isDeepsightEnabled:tt==="VIDEOLIVENESS",usSmartCapture:Ye.usSmartCapture}}getMaxAttempts(){var Le;return((Le=this.captureConfiguration)==null?void 0:Le.captureAttempts)||3}onClose(){super.onClose(FlowType.ID)}}const idFlowManager=new IdFlowManager,SHARPNESS_THRESHOLD=10,GLARE_THRESHOLD=10;class CaptureIdError extends Error{constructor(Le,Ye,tt){super(Ye),this.errorKey=Le,this.messageDescription=tt,this.name="CaptureIdError"}}const createCaptureIdApi=Be=>{if(!Be)throw new CaptureIdError("NO_TOKEN","Session token not found");const Le=async tt=>{const nt=tt.ageAssurance?[tt.type==="back"?"croppedBackID":"croppedFrontID"]:[];try{return await getImages$1({token:Be,body:{images:["croppedIDFace",...nt]}})}catch{return{croppedIDFace:"",croppedFrontID:"",croppedBackID:""}}},Ye=(tt,nt)=>tt.failReason==="ID_TYPE_UNACCEPTABLE"?{error:!0,message:"ID type is not acceptable",messageDescription:"Please use a valid ID type",errorKey:"ID_TYPE_UNACCEPTABLE"}:tt.failReason==="WRONG_DOCUMENT_SIDE"?{error:!0,message:"Wrong side of document",messageDescription:tt.side==="back"?"Please show the back side of your ID":"Please show the front side of your ID",errorKey:"WRONG_DOCUMENT_SIDE"}:tt.classification?tt.sharpness!==void 0&&tt.sharpness<SHARPNESS_THRESHOLD?{error:!0,message:"Image is not sharp enough",messageDescription:"Please ensure the image is clear and well-focused",errorKey:"LOW_SHARPNESS"}:tt.glare!==void 0&&tt.glare<GLARE_THRESHOLD&&!(nt!=null&&nt.skipGlareFront)?{error:!0,message:"Glare detected on ID",messageDescription:"Please avoid bright reflections on your ID",errorKey:"GLARE_DETECTED"}:{error:!1,message:null,errorKey:null}:{error:!0,message:"ID classification failed",errorKey:"CLASSIFICATION_FAILED"};return{async uploadId(tt){var nt,ft;try{idFlowManager.incrementAttempts(),(nt=tt.onProgress)==null||nt.call(tt,0),await onboardingAnalytics.analyzeFrame(tt.image),onboardingAnalytics.update(),MlWasmJSApi$1.reset(),tt.type==="front"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),tt.type==="back"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),addEvent({token:Be,code:"captureAttemptFinished",module:"ID",payload:{logs:onboardingAnalytics.getPipelineLogs()}});const ht=await capture({...tt,token:Be,type:tt.type==="front"?frontType:backType,encrypted:!1,faceCoordinates:void 0,imageType:void 0,onProgress:tt.onProgress,metadata:onboardingAnalytics.getMetadata()}),gt=await Le({type:tt.type,ageAssurance:tt.ageAssurance}),At={...ht,originalImage:tt.image,frontIdImage:tt.type==="front"?tt.image:void 0,backIdImage:gt.croppedBackID,...gt};idFlowManager.saveCaptureResponse(At);const xt=Ye({...At,side:tt.type},{skipGlareFront:ht.skipGlareFront,skipGlareBack:ht.skipGlareBack});if(xt.error)throw new CaptureIdError(xt.errorKey,xt.message,xt.messageDescription);return(ft=tt.onProgress)==null||ft.call(tt,100),idFlowManager.resetAttempts(),At}catch(ht){if(!idFlowManager.canRetry()){const gt=idFlowManager.getState().successData;throw tt.type!=="front"?new CaptureIdError("NO_MORE_TRIES","No more retry attempts available"):gt!=null&&gt.skipBackIdCapture?new CaptureIdError("RETRY_EXHAUSTED_SKIP_BACK","Front ID retries exhausted, skip back ID capture"):new CaptureIdError("RETRY_EXHAUSTED_CONTINUE_TO_BACK","Front ID retries exhausted, continue to back ID capture")}throw ht instanceof CaptureIdError?ht:new CaptureIdError("UNEXPECTED_ERROR","Unexpected capture error")}},reset(){idFlowManager.resetAttempts()}}},useCaptureIdState=()=>{const[Be,Le]=React.useState(idFlowManager.getState()),[Ye,tt]=React.useState(null);React.useEffect(()=>idFlowManager.subscribe(Le),[]);const nt=idFlowManager.getToken();React.useEffect(()=>{if(!nt){tt(null);return}try{const ht=createCaptureIdApi(nt);tt(ht)}catch(ht){console.error("Failed to create capture API:",ht),tt(null)}},[nt]);const ft=idFlowManager.getCaptureConfiguration();return{token:idFlowManager.getToken(),currentStep:Be.currentStep,flowOutcome:Be.flowOutcome,isLoading:Be.isLoading,errorDetails:Be.errorDetails,successData:Be.successData,attempts:Be.attempts,uploadId:Ye==null?void 0:Ye.uploadId.bind(Ye),completeWithError:ht=>idFlowManager.completeWithError(ht),reset:()=>idFlowManager.reset(),canRetry:()=>idFlowManager.canRetry(),getAttempts:()=>Be.attempts,completeFlow:()=>idFlowManager.completeFlow(),goToChooser:()=>idFlowManager.goToChooser(),goToIdStep:()=>idFlowManager.goToIdStep(),goToPassportStep:()=>idFlowManager.goToPassportStep(),goToManualUploadStep:()=>idFlowManager.goToManualUploadStep(),goToDigitalIdUploadStep:()=>idFlowManager.goToDigitalIdUploadStep(),goToPermissions:()=>idFlowManager.goToPermissions(),changeStep:ht=>idFlowManager.changeStep(ht),resetAttempts:()=>idFlowManager.resetAttempts(),kioskOptions:idFlowManager.kioskOptions,captureConfiguration:ft,attemptsLeft:idFlowManager.getAttemptsLeft(),uiConfig:idFlowManager.uiConfig,captureOnly:idFlowManager.captureOnly,onCapture:idFlowManager.onCapture,storeCapturedImage:(ht,gt)=>idFlowManager.storeCapturedImage(ht,gt),completeCaptureOnlyFlow:()=>idFlowManager.completeCaptureOnlyFlow(),isDeepsightEnabled:ft.isDeepsightEnabled}},IdFlowPage=({closeButtonColor:Be,closeButtonOnCancel:Le,...Ye})=>{const{uiConfig:tt}=useCaptureIdState(),nt=Be?{...tt,closeButton:{...tt==null?void 0:tt.closeButton,color:Be}}:tt;return jsxRuntimeExports.jsx(FlowPage,{uiConfig:nt,onClose:()=>idFlowManager.onClose(),onCloseCancel:Le,...Ye})},StyledArrowIcon$1=dt.svg`
5225
5226
  .arrow-rect {
5226
5227
  transition: filter 0.2s ease;
5227
5228
  }
@@ -6467,7 +6468,7 @@ newPrivacyConsent.text4
6467
6468
  &.loading-icon {
6468
6469
  animation: ${spinner$2} 3s linear infinite;
6469
6470
  }
6470
- `;function Loading$4(){const{t:Be}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:loadingLogo$1,"data-testid":"curp-loading-image",alt:"loading...",className:"loading-icon"}),jsxRuntimeExports.jsx(Text$5,{"data-testid":"curp-loading-text",children:Be("curp.verifying")})]})}function Success$1(){const{t:Be}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:greenCheck$2,alt:"success","data-testid":"curp-success-image"}),jsxRuntimeExports.jsx("p",{"data-testid":"curp-success-text",children:Be("curp.success")})]})}function NotSuccess$1({willRetry:Be=!1}){const{t:Le}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:redStrike$1,alt:"failure","data-testid":"curp-failure-image"}),jsxRuntimeExports.jsx(Text$5,{"data-testid":"curp-failure-text",children:Le("curp.failed")}),Be&&jsxRuntimeExports.jsx(Text$5,{className:"weak","data-testid":"curp-failure-text-retry",children:Le("curp.retry")})]})}function InProgress(){const{t:Be}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:greenCheck$2,alt:"inProgress","data-testid":"curp-in-progress-image"}),jsxRuntimeExports.jsx("p",{"data-testid":"curp-in-progress-text",children:Be("curp.inProgress")})]})}function EnterCurp({onSuccess:Be,token:Le}){const{t:Ye}=useTranslation$1(),{register:tt,handleSubmit:nt,errors:ft,reset:ht,watch:gt}=useForm(),[At,xt]=React.useState(!0),[yt,Ct]=React.useState(!1),[Et,vt]=React.useState("loading"),[kt,bt]=React.useState(!1),wt=React.useRef(),It=window.visualViewport.height;useModuleEvents({module:eventModuleNames.curpValidation,token:Le}),useEventListener("resize",()=>{const Lt=window.visualViewport.height;wt.current.style.bottom=`${Lt===It?25:It-Lt-125}px`},window.visualViewport),React.useEffect(()=>{addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidate,token:Le,shouldOpen:!0}),ocrData({token:Le}).then(Lt=>{addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidate,token:Le,shouldOpen:!1});const{curp:Wt}=Lt;if(!Wt){vt("idle"),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0});return}addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!0}),addCurp(Wt.toUpperCase(),Le).then($t=>{addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!1}),$t.success?(addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!0}),vt("success"),setTimeout(()=>{Be(),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!1})},3e3)):(vt("idle"),bt(!0),Ct(!0),ht({curp:Wt}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0}))}).catch(()=>{vt("idle"),bt(!0),Ct(!0),ht({curp:Wt}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0})})}).catch(()=>{vt("idle"),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0})})},[Be,ht]);const Tt=async Lt=>{const Wt=At?"":Bt(Lt.birthDate);let $t=!1;vt("loading"),addScreenEvent({module:eventModuleNames.curpValidation,screen:At?eventScreenNames.curpEnter:eventScreenNames.curpGenerate,token:Le,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!0});try{const qt=At?await addCurp(Lt.curp.toUpperCase(),Le):await addCurpv2({...Lt,birthDate:Wt},Le);if(addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!1}),qt.result==="Attempting validation by scraping method")vt("inProgress"),$t=!0,addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!0});else{if($t=qt.success,(qt==null?void 0:qt.deceasedStatus)==="DECEASED"){Be();return}vt($t?"success":"failed"),addScreenEvent($t?{module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!0}:{module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!0})}}catch{vt("failed"),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!0})}setTimeout(()=>{kt||$t?(addScreenEvent({module:eventModuleNames.curpValidation,screen:$t?eventScreenNames.curpValidationSuccess:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!1}),Be()):(addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.curpValidation,screen:At?eventScreenNames.curpEnter:eventScreenNames.curpGenerate,token:Le,shouldOpen:!0}),bt(!0),vt("idle"))},3e3)},Bt=Lt=>{const Wt=Lt.split("-");return`${Wt[2]}/${Wt[1]}/${Wt[0]}`},Pt=()=>{xt(!1),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpGenerate,token:Le,shouldOpen:!0}),ht()},Dt=React.useMemo(()=>{let Lt=Ye("curp.labels.generate");return yt?Lt=Ye("curp.labels.confirm"):At&&(Lt=Ye("curp.labels.enter")),`${Lt} ${Ye("curp.labels.yourCURP")}`},[yt,At,Ye]),Ot=(Lt=>{if(Lt==="loading")return Loading$4;if(Lt==="success")return Success$1;if(Lt==="failed")return NotSuccess$1;if(Lt==="inProgress")return InProgress})(Et);return Et!=="idle"?jsxRuntimeExports.jsx(EnterCurpContainer,{className:"IncodeEnterCurpContainer",children:jsxRuntimeExports.jsx(Ot,{className:"IncodeEnterCurpStatus",willRetry:!kt,enterCurp:At})}):jsxRuntimeExports.jsxs(EnterCurpContainer,{className:"IncodeEnterCurpContainer",children:[jsxRuntimeExports.jsxs(Content$4,{children:[jsxRuntimeExports.jsx(Title$d,{className:"IncodeEnterCurpTitle",children:Dt}),jsxRuntimeExports.jsxs(Form$1,{className:"IncodeEnterCurpForm",onSubmit:nt(Tt),autoComplete:"false",children:[At?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input$9,{id:"curp",name:"curp",placeholder:"CURP",className:cx("enterCurp",{"error-input":ft.curp}),ref:tt({required:Ye("curp.errors.curpRequired"),validate:Lt=>isValidCurp(Lt)||Ye("curp.errors.curpInvalid")}),"data-testid":"curp-input"}),!!ft.curp&&jsxRuntimeExports.jsx("span",{"data-testid":"curp-error-message",children:ft.curp.message})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input$9,{id:"name",name:"name",className:cx("curpName",{"error-input":ft.name}),ref:tt({required:"required"}),placeholder:Ye("curp.labels.name"),"data-testid":"curp-input-name"}),jsxRuntimeExports.jsx(Input$9,{id:"firstLastName",name:"firstLastName",className:ft.firstLastName&&errorInputClass$2,ref:tt({required:"required"}),placeholder:Ye("curp.labels.firstLastName"),"data-testid":"curp-input-first-last-name"}),jsxRuntimeExports.jsx(Input$9,{id:"secondLastName",name:"secondLastName",className:ft.secondLastName&&errorInputClass$2,ref:tt,placeholder:Ye("curp.labels.secondLastName"),"data-testid":"curp-input-second-last-name"}),jsxRuntimeExports.jsxs(Select$3,{id:"gender",name:"gender",className:ft.gender&&errorInputClass$2,ref:tt({required:"required"}),"data-testid":"curp-input-gender",children:[jsxRuntimeExports.jsx("option",{disabled:!0,selected:!0,value:"",children:Ye("curp.labels.gender")}),jsxRuntimeExports.jsx("option",{value:"H",children:Ye("curp.labels.male")}),jsxRuntimeExports.jsx("option",{value:"M",children:Ye("curp.labels.female")}),jsxRuntimeExports.jsx("option",{value:"X",children:Ye("curp.labels.nonBinary")})]}),jsxRuntimeExports.jsx(Input$9,{id:"birthDate",name:"birthDate",className:cx("birthDate",{"error-input":ft.birthDate,hasValue:gt("birthDate")}),type:"date",max:formatInputDate(new Date),ref:tt({required:"required"}),placeholder:Ye("curp.labels.birthDate"),"data-testid":"curp-input-birth-date"}),jsxRuntimeExports.jsxs(Select$3,{id:"state",name:"state",className:ft.state&&errorInputClass$2,"data-testid":"curp-input-state",ref:tt({required:"required"}),children:[jsxRuntimeExports.jsx("option",{disabled:!0,selected:!0,value:"",children:Ye("curp.labels.state")}),jsxRuntimeExports.jsx("option",{value:"NE",children:Ye("curp.labels.bornAbroad")},"NE"),states.filter(Lt=>Lt.value!=="NE").map(Lt=>jsxRuntimeExports.jsx("option",{value:Lt.value,children:Lt.label},Lt.value))]})]}),jsxRuntimeExports.jsx(Button$c,{disabled:Et!=="idle",type:"submit","data-testid":"curp-continue-button",children:Ye("common.continue")})]})]}),jsxRuntimeExports.jsx("footer",{children:jsxRuntimeExports.jsxs(Paragraph$6,{"data-testid":"curp-missing-paragraph",children:[Ye("curp.labels.missing"),jsxRuntimeExports.jsx(Span$1,{onClick:Pt,"data-testid":"curp-generate-button",children:Ye("curp.labels.generate")})]})})]})}const GenerateCurp=({token:Be,uiConfig:Le={},onSuccess:Ye})=>{const{t:tt}=useTranslation$1(),[nt,ft]=React.useState(""),[ht,gt]=React.useState(""),[At,xt]=React.useState(""),[yt,Ct]=React.useState(""),[Et,vt]=React.useState(""),[kt,bt]=React.useState(""),[wt,It]=React.useState("idle"),[Rt,Tt]=React.useState(""),Bt=React.useRef(null),Pt=React.useRef(null),Dt=React.useRef(null),Ot=React.useRef(null),Lt=React.useRef(null),Wt=React.useRef(null),$t=nt&&ht&&yt&&Et&&kt,qt=Xt=>{const[_t,Mt,jt]=Xt.split("-");return`${jt}/${Mt}/${_t}`},Ht=async Xt=>{if(Xt.preventDefault(),!(!$t||wt==="loading")){It("loading");try{const _t=await addCurpv2({name:nt,firstLastName:ht,secondLastName:At,gender:yt,birthDate:qt(Et),state:kt},Be);if(_t.result==="Attempting validation by scraping method"){Ye&&setTimeout(()=>{Ye()},2e3);return}const Mt=_t.success;if((_t==null?void 0:_t.deceasedStatus)==="DECEASED"){Ye&&Ye();return}Mt&&_t.curp?(Tt(_t.curp),It("success"),setTimeout(()=>{Ye&&Ye()},3e3)):It("error")}catch(_t){console.error("Error generating CURP:",_t),It("error")}}},Ut=()=>{It("idle")},Ft=(Xt,_t,Mt=!1)=>{(Xt.key==="Enter"||Xt.keyCode===13)&&(Xt.preventDefault(),Xt.stopPropagation(),Mt&&$t?Ht(Xt):_t!=null&&_t.current&&setTimeout(()=>{var jt;(jt=_t.current)==null||jt.focus()},0))};return wt==="loading"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsx(Flex,{position:"relative",hFull:!0,wFull:!0,children:jsxRuntimeExports.jsx(Spinner$4,{title:tt("curp.status.generating"),fullScreen:!1})})})}):wt==="success"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.confirm")}),jsxRuntimeExports.jsx(Spacer,{size:8}),jsxRuntimeExports.jsx(InputComposed,{label:"",value:Rt,readOnly:!0,style:{textAlign:"center",fontWeight:"bold"}})]}),jsxRuntimeExports.jsx(Button$b,{onClick:()=>Ye==null?void 0:Ye(),mb:4,children:tt("curp.continue")})]})}):wt==="error"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,justify:"center",align:"center",children:[jsxRuntimeExports.jsx(ErrorIcon$1,{size:32}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.couldntGenerate")}),jsxRuntimeExports.jsx(Spacer,{size:3}),jsxRuntimeExports.jsx(Text$8,{fontSize:"16px",textAlign:"center",color:"#60667C",children:tt("curp.status.checkInfo")})]}),jsxRuntimeExports.jsx(Button$b,{onClick:Ut,mb:4,children:tt("curp.status.edit")})]})}):jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.generate")}),jsxRuntimeExports.jsx(Spacer,{size:8}),jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,gap:4,align:"center",overflow:"auto",children:[jsxRuntimeExports.jsx(InputComposed,{ref:Bt,label:tt("curp.labels.firstName"),placeholder:tt("curp.placeholder.firstName"),value:nt,onChange:Xt=>ft(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Pt),enterKeyHint:"next"}),jsxRuntimeExports.jsx(InputComposed,{ref:Pt,label:tt("curp.labels.firstLast"),placeholder:tt("curp.placeholder.firstLast"),value:ht,onChange:Xt=>gt(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Dt),enterKeyHint:"next"}),jsxRuntimeExports.jsx(InputComposed,{ref:Dt,label:tt("curp.placeholder.firstLast"),placeholder:tt("curp.placeholder.secondLast"),value:At,onChange:Xt=>xt(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Ot),enterKeyHint:"next"}),jsxRuntimeExports.jsx(DropdownComposed,{ref:Ot,label:tt("curp.labels.genderV2"),placeholder:tt("curp.placeholder.gender"),value:yt,onChange:Ct,options:[{value:"H",label:tt("curp.labels.maleV2")},{value:"M",label:tt("curp.labels.femaleV2")},{value:"X",label:tt("curp.labels.other")}],onKeyDown:Xt=>Ft(Xt,Lt),enterKeyHint:"next"}),jsxRuntimeExports.jsx(DateInput,{ref:Lt,label:tt("curp.labels.dob"),value:Et,onChange:Xt=>vt(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Wt),max:formatInputDate(new Date().toISOString()),enterKeyHint:"next"}),jsxRuntimeExports.jsx(DropdownComposed,{ref:Wt,label:tt("curp.labels.birthState"),placeholder:tt("curp.placeholder.state"),value:kt,onChange:bt,options:states,onKeyDown:Xt=>Ft(Xt,null,!0),enterKeyHint:"done"}),jsxRuntimeExports.jsx(Button$b,{disabled:!$t,onClick:Ht,mb:4,type:"button",children:tt("curp.generateCta")})]})]})})},EnterCurpV2=({token:Be,uiConfig:Le={},onSuccess:Ye})=>{const{t:tt}=useTranslation$1(),[nt,ft]=React.useState(""),[ht,gt]=React.useState(!1),[At,xt]=React.useState("idle"),yt=isValidCurp(nt),Ct=async()=>{if(!(!yt||At==="verifying")){xt("verifying");try{(await addCurp(nt,Be)).success?(xt("success"),Ye&&setTimeout(()=>{Ye()},3e3)):xt("failure")}catch(vt){console.error("Error verifying CURP:",vt),xt("failure")}}},Et=()=>{xt("idle"),ft("")};return ht?jsxRuntimeExports.jsx(GenerateCurp,{token:Be,uiConfig:Le,onSuccess:Ye}):At==="verifying"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsx(Flex,{hFull:!0,wFull:!0,position:"relative",children:jsxRuntimeExports.jsx(Spinner$4,{open:!0,title:tt("curp.status.verifying"),fullScreen:!1})})})}):At==="success"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,justify:"center",align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(SuccessIcon$1,{size:32}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.verified")})]})})}):At==="failure"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,justify:"center",align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(ErrorIcon$1,{size:32}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.notVerified")})]}),jsxRuntimeExports.jsx(Button$b,{onClick:Et,variant:"primary",mb:4,children:tt("curp.status.tryAgain")})]})}):jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.enterCurp")}),jsxRuntimeExports.jsx(Spacer,{size:8}),jsxRuntimeExports.jsx(InputComposed,{placeholder:tt("curp.placeholder.curp"),value:nt,onChange:vt=>ft(vt.target.value.toUpperCase())})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",mb:4,gap:3,children:[jsxRuntimeExports.jsx(Button$b,{disabled:!yt,onClick:Ct,children:tt("curp.continue")}),jsxRuntimeExports.jsx(Button$b,{variant:"secondary",onClick:()=>gt(!0),children:tt("curp.dontHave")})]})]})})},EnterCurpManager=({onSuccess:Be,token:Le,uiConfig:Ye={}})=>getFeatureFlag("new_id_capture_ux_least_risky_clients")?jsxRuntimeExports.jsx(EnterCurpV2,{token:Le,uiConfig:Ye,onSuccess:Be}):jsxRuntimeExports.jsx(EnterCurp,{onSuccess:Be,token:Le});function renderEnterCurp(Be,{onSuccess:Le,token:Ye}){const tt=createRoot$1(Be),nt={onSuccess:handleUnmountRoot(Le,tt,Be),onBoarding:this,token:Ye};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye,children:jsxRuntimeExports.jsx(EnterCurpManager,{...nt})}),Be,tt)}const getGenerateDocumentUploadUrl=()=>"/omni/es/generateDocumentUploadUrl";function generateAESDocumentUploadUrl({token:Be}){return exports.api.post(getGenerateDocumentUploadUrl(),{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data)}const getUnsignedDocsURL=()=>"/omni/es/documents/unsigned";function getAdvancedElectronicSignatureUnsignedDocs({token:Be}){return exports.api.get(getUnsignedDocsURL(),{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data)}const getProcessDocsURL$1=()=>"/omni/es/process/sign";function processAdvancedElectronicSignatureDocs({token:Be,documentRef:Le}){return exports.api.post(getProcessDocsURL$1(),{documentRef:Le,userConsented:!0},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}const fail$1="data:image/svg+xml,%3csvg%20width='33'%20height='32'%20viewBox='0%200%2033%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.8265%2016.0001L31.7457%208.08092C32.2488%207.57834%2032.4999%206.96783%2032.4999%206.24929C32.4999%205.53094%2032.2481%204.92052%2031.7457%204.41766L28.0825%200.754108C27.5798%200.251432%2026.9693%200%2026.2512%200C25.5325%200%2024.9223%200.251432%2024.4193%200.754108L16.5001%208.67332L8.58083%200.754108C8.07834%200.251432%207.46783%200%206.7492%200C6.03113%200%205.42052%200.251432%204.91756%200.754108L1.2542%204.41766C0.751621%204.92014%200.5%205.53094%200.5%206.24929C0.5%206.96783%200.751338%207.57806%201.2542%208.08092L9.17332%2016.0001L1.2542%2023.9194C0.751621%2024.4223%200.5%2025.0325%200.5%2025.7513C0.5%2026.4692%200.751338%2027.0799%201.2542%2027.5825L4.91766%2031.2458C5.42052%2031.7489%206.03122%2032%206.74929%2032C7.46783%2032%208.07806%2031.7482%208.58092%2031.2458L16.5002%2023.3266L24.42%2031.2458C24.9227%2031.7489%2025.5326%2032%2026.2519%2032C26.97%2032%2027.5805%2031.7482%2028.0833%2031.2458L31.7458%2027.5825C32.2489%2027.0802%2032.5%2026.4692%2032.5%2025.7513C32.5%2025.0325%2032.2489%2024.4223%2031.7458%2023.9194L23.8265%2016.0001Z'%20fill='%23FF5C6F'/%3e%3c/svg%3e",filesIcon="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_367_7974)'%3e%3cpath%20d='M15.75%2021H5.25C5.05109%2021%204.86032%2020.921%204.71967%2020.7803C4.57902%2020.6397%204.5%2020.4489%204.5%2020.25V6.75C4.5%206.55109%204.57902%206.36032%204.71967%206.21967C4.86032%206.07902%205.05109%206%205.25%206H12.75L16.5%209.75V20.25C16.5%2020.4489%2016.421%2020.6397%2016.2803%2020.7803C16.1397%2020.921%2015.9489%2021%2015.75%2021Z'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5%206V3.75C7.5%203.55109%207.57902%203.36032%207.71967%203.21967C7.86032%203.07902%208.05109%203%208.25%203H15.75L19.5%206.75V17.25C19.5%2017.4489%2019.421%2017.6397%2019.2803%2017.7803C19.1397%2017.921%2018.9489%2018%2018.75%2018H16.5'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%2014.25H12.75'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%2017.25H12.75'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_367_7974'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",success$2="data:image/svg+xml,%3csvg%20width='49'%20height='48'%20viewBox='0%200%2049%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M44.7413%2012.0554L41.0562%208.27767C40.5509%207.75929%2039.9364%207.5%2039.214%207.5C38.491%207.5%2037.8765%207.75929%2037.3712%208.27767L19.5955%2026.5278L11.629%2018.3332C11.1231%2017.8146%2010.509%2017.5556%209.78662%2017.5556C9.0638%2017.5556%208.44965%2017.8146%207.94379%2018.3332L4.2587%2022.111C3.75284%2022.6295%203.5%2023.2593%203.5%2024.0002C3.5%2024.7405%203.75284%2025.3709%204.2587%2025.8893L14.0676%2035.9445L17.7529%2039.7222C18.2585%2040.241%2018.8728%2040.5%2019.5955%2040.5C20.3178%2040.5%2020.9322%2040.2403%2021.438%2039.7222L25.1233%2035.9445L44.7413%2015.8334C45.2467%2015.3149%2045.5%2014.6852%2045.5%2013.9443C45.5004%2013.2038%2045.2467%2012.574%2044.7413%2012.0554Z'%20fill='%230CD5A2'/%3e%3c/svg%3e",SpinnerContainer$1=dt.div`
6471
+ `;function Loading$4(){const{t:Be}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:loadingLogo$1,"data-testid":"curp-loading-image",alt:"loading...",className:"loading-icon"}),jsxRuntimeExports.jsx(Text$5,{"data-testid":"curp-loading-text",children:Be("curp.verifying")})]})}function Success$1(){const{t:Be}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:greenCheck$2,alt:"success","data-testid":"curp-success-image"}),jsxRuntimeExports.jsx("p",{"data-testid":"curp-success-text",children:Be("curp.success")})]})}function NotSuccess$1({willRetry:Be=!1}){const{t:Le}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:redStrike$1,alt:"failure","data-testid":"curp-failure-image"}),jsxRuntimeExports.jsx(Text$5,{"data-testid":"curp-failure-text",children:Le("curp.failed")}),Be&&jsxRuntimeExports.jsx(Text$5,{className:"weak","data-testid":"curp-failure-text-retry",children:Le("curp.retry")})]})}function InProgress(){const{t:Be}=useTranslation$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$a,{src:greenCheck$2,alt:"inProgress","data-testid":"curp-in-progress-image"}),jsxRuntimeExports.jsx("p",{"data-testid":"curp-in-progress-text",children:Be("curp.inProgress")})]})}function EnterCurp({onSuccess:Be,token:Le}){const{t:Ye}=useTranslation$1(),{register:tt,handleSubmit:nt,errors:ft,reset:ht,watch:gt}=useForm(),[At,xt]=React.useState(!0),[yt,Ct]=React.useState(!1),[Et,vt]=React.useState("loading"),[kt,bt]=React.useState(!1),wt=React.useRef(),It=window.visualViewport.height;useModuleEvents({module:eventModuleNames.curpValidation,token:Le}),useEventListener("resize",()=>{const Lt=window.visualViewport.height;wt.current.style.bottom=`${Lt===It?25:It-Lt-125}px`},window.visualViewport),React.useEffect(()=>{addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidate,token:Le,shouldOpen:!0}),ocrData({token:Le}).then(Lt=>{addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidate,token:Le,shouldOpen:!1});const{curp:Wt}=Lt;if(!Wt){vt("idle"),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0});return}addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!0}),addCurp(Wt.toUpperCase(),Le).then($t=>{addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!1}),$t.success?(addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!0}),vt("success"),setTimeout(()=>{Be(),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!1})},3e3)):(vt("idle"),bt(!0),Ct(!0),ht({curp:Wt}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0}))}).catch(()=>{vt("idle"),bt(!0),Ct(!0),ht({curp:Wt}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0})})}).catch(()=>{vt("idle"),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!0})})},[Be,ht]);const Tt=async Lt=>{const Wt=At?"":Bt(Lt.birthDate);let $t=!1;vt("loading"),addScreenEvent({module:eventModuleNames.curpValidation,screen:At?eventScreenNames.curpEnter:eventScreenNames.curpGenerate,token:Le,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!0});try{const qt=At?await addCurp(Lt.curp.toUpperCase(),Le):await addCurpv2({...Lt,birthDate:Wt},Le);if(addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidation,token:Le,shouldOpen:!1}),qt.result==="Attempting validation by scraping method")vt("inProgress"),$t=!0,addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!0});else{if($t=qt.success,(qt==null?void 0:qt.deceasedStatus)==="DECEASED"){Be();return}vt($t?"success":"failed"),addScreenEvent($t?{module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationSuccess,token:Le,shouldOpen:!0}:{module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!0})}}catch{vt("failed"),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!0})}setTimeout(()=>{kt||$t?(addScreenEvent({module:eventModuleNames.curpValidation,screen:$t?eventScreenNames.curpValidationSuccess:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!1}),Be()):(addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpValidationFailed,token:Le,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.curpValidation,screen:At?eventScreenNames.curpEnter:eventScreenNames.curpGenerate,token:Le,shouldOpen:!0}),bt(!0),vt("idle"))},3e3)},Bt=Lt=>{const Wt=Lt.split("-");return`${Wt[2]}/${Wt[1]}/${Wt[0]}`},Pt=()=>{xt(!1),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpEnter,token:Le,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.curpValidation,screen:eventScreenNames.curpGenerate,token:Le,shouldOpen:!0}),ht()},Dt=React.useMemo(()=>{let Lt=Ye("curp.labels.generate");return yt?Lt=Ye("curp.labels.confirm"):At&&(Lt=Ye("curp.labels.enter")),`${Lt} ${Ye("curp.labels.yourCURP")}`},[yt,At,Ye]),Ot=(Lt=>{if(Lt==="loading")return Loading$4;if(Lt==="success")return Success$1;if(Lt==="failed")return NotSuccess$1;if(Lt==="inProgress")return InProgress})(Et);return Et!=="idle"?jsxRuntimeExports.jsx(EnterCurpContainer,{className:"IncodeEnterCurpContainer",children:jsxRuntimeExports.jsx(Ot,{className:"IncodeEnterCurpStatus",willRetry:!kt,enterCurp:At})}):jsxRuntimeExports.jsxs(EnterCurpContainer,{className:"IncodeEnterCurpContainer",children:[jsxRuntimeExports.jsxs(Content$4,{children:[jsxRuntimeExports.jsx(Title$d,{className:"IncodeEnterCurpTitle",children:Dt}),jsxRuntimeExports.jsxs(Form$1,{className:"IncodeEnterCurpForm",onSubmit:nt(Tt),autoComplete:"false",children:[At?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input$9,{id:"curp",name:"curp",placeholder:"CURP",className:cx("enterCurp",{"error-input":ft.curp}),ref:tt({required:Ye("curp.errors.curpRequired"),validate:Lt=>isValidCurp(Lt)||Ye("curp.errors.curpInvalid")}),"data-testid":"curp-input"}),!!ft.curp&&jsxRuntimeExports.jsx("span",{"data-testid":"curp-error-message",children:ft.curp.message})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input$9,{id:"name",name:"name",className:cx("curpName",{"error-input":ft.name}),ref:tt({required:"required"}),placeholder:Ye("curp.labels.name"),"data-testid":"curp-input-name"}),jsxRuntimeExports.jsx(Input$9,{id:"firstLastName",name:"firstLastName",className:ft.firstLastName&&errorInputClass$2,ref:tt({required:"required"}),placeholder:Ye("curp.labels.firstLastName"),"data-testid":"curp-input-first-last-name"}),jsxRuntimeExports.jsx(Input$9,{id:"secondLastName",name:"secondLastName",className:ft.secondLastName&&errorInputClass$2,ref:tt,placeholder:Ye("curp.labels.secondLastName"),"data-testid":"curp-input-second-last-name"}),jsxRuntimeExports.jsxs(Select$3,{id:"gender",name:"gender",className:ft.gender&&errorInputClass$2,ref:tt({required:"required"}),"data-testid":"curp-input-gender",children:[jsxRuntimeExports.jsx("option",{disabled:!0,selected:!0,value:"",children:Ye("curp.labels.gender")}),jsxRuntimeExports.jsx("option",{value:"H",children:Ye("curp.labels.male")}),jsxRuntimeExports.jsx("option",{value:"M",children:Ye("curp.labels.female")}),jsxRuntimeExports.jsx("option",{value:"X",children:Ye("curp.labels.nonBinary")})]}),jsxRuntimeExports.jsx(Input$9,{id:"birthDate",name:"birthDate",className:cx("birthDate",{"error-input":ft.birthDate,hasValue:gt("birthDate")}),type:"date",max:formatInputDate(new Date),ref:tt({required:"required"}),placeholder:Ye("curp.labels.birthDate"),"data-testid":"curp-input-birth-date"}),jsxRuntimeExports.jsxs(Select$3,{id:"state",name:"state",className:ft.state&&errorInputClass$2,"data-testid":"curp-input-state",ref:tt({required:"required"}),children:[jsxRuntimeExports.jsx("option",{disabled:!0,selected:!0,value:"",children:Ye("curp.labels.state")}),jsxRuntimeExports.jsx("option",{value:"NE",children:Ye("curp.labels.bornAbroad")},"NE"),states.filter(Lt=>Lt.value!=="NE").map(Lt=>jsxRuntimeExports.jsx("option",{value:Lt.value,children:Lt.label},Lt.value))]})]}),jsxRuntimeExports.jsx(Button$c,{disabled:Et!=="idle",type:"submit","data-testid":"curp-continue-button",children:Ye("common.continue")})]})]}),jsxRuntimeExports.jsx("footer",{children:jsxRuntimeExports.jsxs(Paragraph$6,{"data-testid":"curp-missing-paragraph",children:[Ye("curp.labels.missing"),jsxRuntimeExports.jsx(Span$1,{onClick:Pt,"data-testid":"curp-generate-button",children:Ye("curp.labels.generate")})]})})]})}const GenerateCurp=({token:Be,uiConfig:Le={},onSuccess:Ye})=>{const{t:tt}=useTranslation$1(),[nt,ft]=React.useState(""),[ht,gt]=React.useState(""),[At,xt]=React.useState(""),[yt,Ct]=React.useState(""),[Et,vt]=React.useState(""),[kt,bt]=React.useState(""),[wt,It]=React.useState("idle"),[Rt,Tt]=React.useState(""),Bt=React.useRef(null),Pt=React.useRef(null),Dt=React.useRef(null),Ot=React.useRef(null),Lt=React.useRef(null),Wt=React.useRef(null),$t=nt&&ht&&yt&&Et&&kt,qt=Xt=>{const[_t,Mt,jt]=Xt.split("-");return`${jt}/${Mt}/${_t}`},Ht=async Xt=>{if(Xt.preventDefault(),!(!$t||wt==="loading")){It("loading");try{const _t=await addCurpv2({name:nt,firstLastName:ht,secondLastName:At,gender:yt,birthDate:qt(Et),state:kt},Be);if(_t.result==="Attempting validation by scraping method"){Ye&&setTimeout(()=>{Ye()},2e3);return}const Mt=_t.success;if((_t==null?void 0:_t.deceasedStatus)==="DECEASED"){Ye&&Ye();return}Mt&&_t.curp?(Tt(_t.curp),It("success"),setTimeout(()=>{Ye&&Ye()},3e3)):It("error")}catch(_t){console.error("Error generating CURP:",_t),It("error")}}},Ut=()=>{It("idle")},Ft=(Xt,_t,Mt=!1)=>{(Xt.key==="Enter"||Xt.keyCode===13)&&(Xt.preventDefault(),Xt.stopPropagation(),Mt&&$t?Ht(Xt):_t!=null&&_t.current&&setTimeout(()=>{var jt;(jt=_t.current)==null||jt.focus()},0))};return wt==="loading"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsx(Flex,{position:"relative",hFull:!0,wFull:!0,children:jsxRuntimeExports.jsx(Spinner$4,{title:tt("curp.status.generating"),fullScreen:!1})})})}):wt==="success"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.confirm")}),jsxRuntimeExports.jsx(Spacer,{size:8}),jsxRuntimeExports.jsx(InputComposed,{label:"",value:Rt,readOnly:!0,style:{textAlign:"center",fontWeight:"bold"}})]}),jsxRuntimeExports.jsx(Button$b,{onClick:()=>Ye==null?void 0:Ye(),mb:4,children:tt("curp.continue")})]})}):wt==="error"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,justify:"center",align:"center",children:[jsxRuntimeExports.jsx(ErrorIcon$1,{size:32}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.couldntGenerate")}),jsxRuntimeExports.jsx(Spacer,{size:3}),jsxRuntimeExports.jsx(Text$8,{fontSize:"16px",textAlign:"center",color:"#60667C",children:tt("curp.status.checkInfo")})]}),jsxRuntimeExports.jsx(Button$b,{onClick:Ut,mb:4,children:tt("curp.status.edit")})]})}):jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.generate")}),jsxRuntimeExports.jsx(Spacer,{size:8}),jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,gap:4,align:"center",children:[jsxRuntimeExports.jsx(InputComposed,{ref:Bt,label:tt("curp.labels.firstName"),placeholder:tt("curp.placeholder.firstName"),value:nt,onChange:Xt=>ft(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Pt),enterKeyHint:"next"}),jsxRuntimeExports.jsx(InputComposed,{ref:Pt,label:tt("curp.labels.firstLast"),placeholder:tt("curp.placeholder.firstLast"),value:ht,onChange:Xt=>gt(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Dt),enterKeyHint:"next"}),jsxRuntimeExports.jsx(InputComposed,{ref:Dt,label:tt("curp.placeholder.firstLast"),placeholder:tt("curp.placeholder.secondLast"),value:At,onChange:Xt=>xt(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Ot),enterKeyHint:"next"}),jsxRuntimeExports.jsx(DropdownComposed,{ref:Ot,label:tt("curp.labels.genderV2"),placeholder:tt("curp.placeholder.gender"),value:yt,onChange:Ct,options:[{value:"H",label:tt("curp.labels.maleV2")},{value:"M",label:tt("curp.labels.femaleV2")},{value:"X",label:tt("curp.labels.other")}],onKeyDown:Xt=>Ft(Xt,Lt),enterKeyHint:"next"}),jsxRuntimeExports.jsx(DateInput,{ref:Lt,label:tt("curp.labels.dob"),value:Et,onChange:Xt=>vt(Xt.target.value),onKeyDown:Xt=>Ft(Xt,Wt),max:formatInputDate(new Date().toISOString()),enterKeyHint:"next"}),jsxRuntimeExports.jsx(DropdownComposed,{ref:Wt,label:tt("curp.labels.birthState"),placeholder:tt("curp.placeholder.state"),value:kt,onChange:bt,options:states,onKeyDown:Xt=>Ft(Xt,null,!0),enterKeyHint:"done"}),jsxRuntimeExports.jsx(Button$b,{disabled:!$t,onClick:Ht,mb:4,type:"button",children:tt("curp.generateCta")})]})]})})},EnterCurpV2=({token:Be,uiConfig:Le={},onSuccess:Ye})=>{const{t:tt}=useTranslation$1(),[nt,ft]=React.useState(""),[ht,gt]=React.useState(!1),[At,xt]=React.useState("idle"),yt=isValidCurp(nt),Ct=async()=>{if(!(!yt||At==="verifying")){xt("verifying");try{(await addCurp(nt,Be)).success?(xt("success"),Ye&&setTimeout(()=>{Ye()},3e3)):xt("failure")}catch(vt){console.error("Error verifying CURP:",vt),xt("failure")}}},Et=()=>{xt("idle"),ft("")};return ht?jsxRuntimeExports.jsx(GenerateCurp,{token:Be,uiConfig:Le,onSuccess:Ye}):At==="verifying"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsx(Flex,{hFull:!0,wFull:!0,position:"relative",children:jsxRuntimeExports.jsx(Spinner$4,{open:!0,title:tt("curp.status.verifying"),fullScreen:!1})})})}):At==="success"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,justify:"center",align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(SuccessIcon$1,{size:32}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.verified")})]})})}):At==="failure"?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,justify:"center",align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(ErrorIcon$1,{size:32}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.status.notVerified")})]}),jsxRuntimeExports.jsx(Button$b,{onClick:Et,variant:"primary",mb:4,children:tt("curp.status.tryAgain")})]})}):jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsxs(Page$1,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,wFull:!0,align:"center",children:[jsxRuntimeExports.jsx(Spacer,{size:10}),jsxRuntimeExports.jsx(Title$p,{children:tt("curp.enterCurp")}),jsxRuntimeExports.jsx(Spacer,{size:8}),jsxRuntimeExports.jsx(InputComposed,{placeholder:tt("curp.placeholder.curp"),value:nt,onChange:vt=>ft(vt.target.value.toUpperCase())})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",mb:4,gap:3,children:[jsxRuntimeExports.jsx(Button$b,{disabled:!yt,onClick:Ct,children:tt("curp.continue")}),jsxRuntimeExports.jsx(Button$b,{variant:"secondary",onClick:()=>gt(!0),children:tt("curp.dontHave")})]})]})})},EnterCurpManager=({onSuccess:Be,token:Le,uiConfig:Ye={}})=>getFeatureFlag("new_id_capture_ux_least_risky_clients")?jsxRuntimeExports.jsx(EnterCurpV2,{token:Le,uiConfig:Ye,onSuccess:Be}):jsxRuntimeExports.jsx(EnterCurp,{onSuccess:Be,token:Le});function renderEnterCurp(Be,{onSuccess:Le,token:Ye}){const tt=createRoot$1(Be),nt={onSuccess:handleUnmountRoot(Le,tt,Be),onBoarding:this,token:Ye};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye,children:jsxRuntimeExports.jsx(EnterCurpManager,{...nt})}),Be,tt)}const getGenerateDocumentUploadUrl=()=>"/omni/es/generateDocumentUploadUrl";function generateAESDocumentUploadUrl({token:Be}){return exports.api.post(getGenerateDocumentUploadUrl(),{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data)}const getUnsignedDocsURL=()=>"/omni/es/documents/unsigned";function getAdvancedElectronicSignatureUnsignedDocs({token:Be}){return exports.api.get(getUnsignedDocsURL(),{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data)}const getProcessDocsURL$1=()=>"/omni/es/process/sign";function processAdvancedElectronicSignatureDocs({token:Be,documentRef:Le}){return exports.api.post(getProcessDocsURL$1(),{documentRef:Le,userConsented:!0},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}const fail$1="data:image/svg+xml,%3csvg%20width='33'%20height='32'%20viewBox='0%200%2033%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.8265%2016.0001L31.7457%208.08092C32.2488%207.57834%2032.4999%206.96783%2032.4999%206.24929C32.4999%205.53094%2032.2481%204.92052%2031.7457%204.41766L28.0825%200.754108C27.5798%200.251432%2026.9693%200%2026.2512%200C25.5325%200%2024.9223%200.251432%2024.4193%200.754108L16.5001%208.67332L8.58083%200.754108C8.07834%200.251432%207.46783%200%206.7492%200C6.03113%200%205.42052%200.251432%204.91756%200.754108L1.2542%204.41766C0.751621%204.92014%200.5%205.53094%200.5%206.24929C0.5%206.96783%200.751338%207.57806%201.2542%208.08092L9.17332%2016.0001L1.2542%2023.9194C0.751621%2024.4223%200.5%2025.0325%200.5%2025.7513C0.5%2026.4692%200.751338%2027.0799%201.2542%2027.5825L4.91766%2031.2458C5.42052%2031.7489%206.03122%2032%206.74929%2032C7.46783%2032%208.07806%2031.7482%208.58092%2031.2458L16.5002%2023.3266L24.42%2031.2458C24.9227%2031.7489%2025.5326%2032%2026.2519%2032C26.97%2032%2027.5805%2031.7482%2028.0833%2031.2458L31.7458%2027.5825C32.2489%2027.0802%2032.5%2026.4692%2032.5%2025.7513C32.5%2025.0325%2032.2489%2024.4223%2031.7458%2023.9194L23.8265%2016.0001Z'%20fill='%23FF5C6F'/%3e%3c/svg%3e",filesIcon="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_367_7974)'%3e%3cpath%20d='M15.75%2021H5.25C5.05109%2021%204.86032%2020.921%204.71967%2020.7803C4.57902%2020.6397%204.5%2020.4489%204.5%2020.25V6.75C4.5%206.55109%204.57902%206.36032%204.71967%206.21967C4.86032%206.07902%205.05109%206%205.25%206H12.75L16.5%209.75V20.25C16.5%2020.4489%2016.421%2020.6397%2016.2803%2020.7803C16.1397%2020.921%2015.9489%2021%2015.75%2021Z'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5%206V3.75C7.5%203.55109%207.57902%203.36032%207.71967%203.21967C7.86032%203.07902%208.05109%203%208.25%203H15.75L19.5%206.75V17.25C19.5%2017.4489%2019.421%2017.6397%2019.2803%2017.7803C19.1397%2017.921%2018.9489%2018%2018.75%2018H16.5'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%2014.25H12.75'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%2017.25H12.75'%20stroke='%23979797'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_367_7974'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",success$2="data:image/svg+xml,%3csvg%20width='49'%20height='48'%20viewBox='0%200%2049%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M44.7413%2012.0554L41.0562%208.27767C40.5509%207.75929%2039.9364%207.5%2039.214%207.5C38.491%207.5%2037.8765%207.75929%2037.3712%208.27767L19.5955%2026.5278L11.629%2018.3332C11.1231%2017.8146%2010.509%2017.5556%209.78662%2017.5556C9.0638%2017.5556%208.44965%2017.8146%207.94379%2018.3332L4.2587%2022.111C3.75284%2022.6295%203.5%2023.2593%203.5%2024.0002C3.5%2024.7405%203.75284%2025.3709%204.2587%2025.8893L14.0676%2035.9445L17.7529%2039.7222C18.2585%2040.241%2018.8728%2040.5%2019.5955%2040.5C20.3178%2040.5%2020.9322%2040.2403%2021.438%2039.7222L25.1233%2035.9445L44.7413%2015.8334C45.2467%2015.3149%2045.5%2014.6852%2045.5%2013.9443C45.5004%2013.2038%2045.2467%2012.574%2044.7413%2012.0554Z'%20fill='%230CD5A2'/%3e%3c/svg%3e",SpinnerContainer$1=dt.div`
6471
6472
  display: flex;
6472
6473
  flex-direction: column;
6473
6474
  height: 100vh;
@@ -9091,7 +9092,7 @@ newPrivacyConsent.text4
9091
9092
  &:active {
9092
9093
  background-color: ${Be=>darkenColor(Be.backgroundColor||"#006AFF")};
9093
9094
  }
9094
- `,Button$3=({backgroundColor:Be,color:Le,borderColor:Ye,...tt})=>jsxRuntimeExports.jsx(ButtonWrapper,{children:jsxRuntimeExports.jsx(StyledButton$3,{backgroundColor:Be,color:Le,borderColor:Ye,...tt})}),ExpiredId=({onRetry:Be})=>{const{t:Le}=useTranslation$1(),Ye=useTokens();return jsxRuntimeExports.jsx(Box,{hFull:!0,wFull:!0,position:"absolute",bg:Ye.color.surface.neutral.light,zIndex:1e3,top:0,left:0,right:0,bottom:0,m:"auto",children:jsxRuntimeExports.jsxs(Flex,{position:"absolute",bottom:0,left:0,right:0,top:0,xsPt:"40px",direction:"column",align:"center",wFull:!0,hFull:!0,p:"20px",maxH:"840px",maxW:"800px",m:"auto",justify:"space-around",children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",align:"center",flex:1,justify:"center",children:[jsxRuntimeExports.jsx(Flex,{content:"center",mb:4,children:jsxRuntimeExports.jsx(SvgRedStrike,{title:"idv2.capture.processing.error"})}),jsxRuntimeExports.jsx(Title$p,{textAlign:"center",letterSpacing:-1,lineHeight:"114%",color:Ye.color.surface.neutral.dark,children:Le("idv2.capture.notifications.expiredId")}),jsxRuntimeExports.jsx(Spacer,{size:3}),jsxRuntimeExports.jsx(Text$8,{color:Ye.color.text.body.secondary,fontWeight:"400",textAlign:"center",children:Le("idv2.capture.notifications.useDifferent")}),jsxRuntimeExports.jsx(Spacer,{size:20})]}),jsxRuntimeExports.jsx(Button$3,{onClick:Be,children:jsxRuntimeExports.jsx(Text$8,{color:Ye.color.text.body.invert,fontSize:Ye.typography.fontSize.lg,textAlign:"center",children:Le("idv2.unacceptedId.tryAgain")})})]})})};function processImss({token:Be,curp:Le=""}){return exports.api.post("/omni/process/imss",{curp:Le},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Ye=>Promise.reject(Ye.response.data))}function processSecondId({token:Be}){return exports.api.post("/omni/process/second-id",{},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Le=>Promise.reject(Le.response.data))}const ProcessId$1=({goNext:Be,isSecondId:Le=!1,token:Ye,onDocumentExpired:tt})=>{const nt=React.useRef(!1),[ft,ht]=React.useState(!1),[gt,At]=React.useState(!0);React.useEffect(()=>{if(nt.current)return;nt.current=!0;let yt;Le?yt=processSecondId({token:Ye.token}):yt=processId({token:Ye.token});const Ct=sleep(3e3);Promise.all([yt,Ct]).then(([Et])=>{var vt;if((vt=Et==null?void 0:Et.data)!=null&&vt.isDocumentExpired){ht(!0),At(!1);return}if(Ye.processImss)try{processImss({token:Ye.token})}catch{}Be()}).catch(()=>{Be()})},[Be,Le,Ye.token,Ye.processImss]);const xt=()=>{tt&&tt()};return ft?jsxRuntimeExports.jsx(ExpiredId,{onRetry:xt}):gt?jsxRuntimeExports.jsx(Spinner$6,{}):null},ProcessIdWrapper=({goNext:Be,isSecondId:Le=!1,token:Ye,onDocumentExpired:tt,uiConfig:nt})=>jsxRuntimeExports.jsx(IncodeProvider,{token:Ye,uiConfig:nt,children:jsxRuntimeExports.jsx(ProcessId$1,{goNext:Be,isSecondId:Le,token:Ye,onDocumentExpired:tt})});function IdModule({onSuccess:Be,token:Le,config:Ye,flow:tt,isSecondId:nt=!1,uiConfig:ft,finishWithError:ht}){var Ct,Et;const[gt,At]=React.useState("capture"),xt=React.useRef(null),yt=()=>{At("capture")};if(gt==="capture"){const vt=((Et=(Ct=tt.flowModules.find(kt=>kt.key==="SELFIE"))==null?void 0:Ct.configuration)==null?void 0:Et.deepsightLiveness)==="VIDEOLIVENESS";return jsxRuntimeExports.jsx(CaptureId,{onSuccess:kt=>{xt.current=kt,At("process")},onError:kt=>{const{code:bt}=kt;bt==="PERMISSION_REFRESH"&&ht({type:"PERMISSION_REFRESH",message:"Refresh button clicked"}),bt==="PERMISSION_DENIED"&&ht({type:"PERMISSION_DENIED",message:"Permission denied"})},session:{token:Le},captureConfig:{showTutorial:Ye.showTutorial,captureAttempts:Ye.captureAttempts,enableIdRecording:Ye.enableIdRecording,autoCaptureTimeout:Ye.autoCaptureTimeout,enablePassport:Ye.enablePassport,isSecondId:nt,ageAssurance:tt.ageAssurance??!1,mergeSessionRecordings:tt.mergeSessionRecordings??!1,showDocumentChooser:Ye.showDocumentChooserScreen,enableId:Ye.enableId,onlyBack:Ye.onlyBack,idDetectionTimeout:Ye.deviceIdleTimeout,manualUploadIdCapture:Ye.manualUploadIdCapture,digitalIdsUpload:Ye.digitalIdsUpload,usSmartCapture:Ye.usSmartCapture,isDeepsightEnabled:vt},uiConfig:ft})}return jsxRuntimeExports.jsx(ProcessIdWrapper,{goNext:()=>Be(xt.current),token:{token:Le},isSecondId:nt,onDocumentExpired:yt,uiConfig:ft})}function processGovernmentValidation({token:Be}){return exports.api.post("/omni/process/government-validation",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const LinkButton=dt.button`
9095
+ `,Button$3=({backgroundColor:Be,color:Le,borderColor:Ye,...tt})=>jsxRuntimeExports.jsx(ButtonWrapper,{children:jsxRuntimeExports.jsx(StyledButton$3,{backgroundColor:Be,color:Le,borderColor:Ye,...tt})}),ExpiredId=({onRetry:Be})=>{const{t:Le}=useTranslation$1(),Ye=useTokens();return jsxRuntimeExports.jsx(Box,{hFull:!0,wFull:!0,position:"absolute",bg:Ye.color.surface.neutral.light,zIndex:1e3,top:0,left:0,right:0,bottom:0,m:"auto",children:jsxRuntimeExports.jsxs(Flex,{position:"absolute",bottom:0,left:0,right:0,top:0,xsPt:"40px",direction:"column",align:"center",wFull:!0,hFull:!0,p:"20px",maxH:"840px",maxW:"800px",m:"auto",justify:"space-around",children:[jsxRuntimeExports.jsxs(Flex,{direction:"column",align:"center",flex:1,justify:"center",children:[jsxRuntimeExports.jsx(Flex,{content:"center",mb:4,children:jsxRuntimeExports.jsx(SvgRedStrike,{title:"idv2.capture.processing.error"})}),jsxRuntimeExports.jsx(Title$p,{textAlign:"center",letterSpacing:-1,lineHeight:"114%",color:Ye.color.surface.neutral.dark,children:Le("idv2.capture.notifications.expiredId")}),jsxRuntimeExports.jsx(Spacer,{size:3}),jsxRuntimeExports.jsx(Text$8,{color:Ye.color.text.body.secondary,fontWeight:"400",textAlign:"center",children:Le("idv2.capture.notifications.useDifferent")}),jsxRuntimeExports.jsx(Spacer,{size:20})]}),jsxRuntimeExports.jsx(Button$3,{onClick:Be,children:jsxRuntimeExports.jsx(Text$8,{color:Ye.color.text.body.invert,fontSize:Ye.typography.fontSize.lg,textAlign:"center",children:Le("idv2.unacceptedId.tryAgain")})})]})})};function processImss({token:Be,curp:Le=""}){return exports.api.post("/omni/process/imss",{curp:Le},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Ye=>Promise.reject(Ye.response.data))}function processSecondId({token:Be}){return exports.api.post("/omni/process/second-id",{},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Le=>Promise.reject(Le.response.data))}const ProcessId$1=({goNext:Be,isSecondId:Le=!1,token:Ye,onDocumentExpired:tt})=>{const nt=React.useRef(!1),[ft,ht]=React.useState(!1),[gt,At]=React.useState(!0);React.useEffect(()=>{if(nt.current)return;nt.current=!0;let yt;Le?yt=processSecondId({token:Ye.token}):yt=processId({token:Ye.token});const Ct=sleep(3e3);Promise.all([yt,Ct]).then(([Et])=>{var vt;if((vt=Et==null?void 0:Et.data)!=null&&vt.isDocumentExpired){ht(!0),At(!1);return}if(Ye.processImss)try{processImss({token:Ye.token})}catch{}Be()}).catch(()=>{Be()})},[Be,Le,Ye.token,Ye.processImss]);const xt=()=>{tt&&tt()};return ft?jsxRuntimeExports.jsx(ExpiredId,{onRetry:xt}):gt?jsxRuntimeExports.jsx(Spinner$6,{}):null},ProcessIdWrapper=({goNext:Be,isSecondId:Le=!1,token:Ye,onDocumentExpired:tt,uiConfig:nt})=>jsxRuntimeExports.jsx(IncodeProvider,{token:Ye,uiConfig:nt,children:jsxRuntimeExports.jsx(ProcessId$1,{goNext:Be,isSecondId:Le,token:Ye,onDocumentExpired:tt})});function IdModule({onSuccess:Be,token:Le,config:Ye,flow:tt,isSecondId:nt=!1,uiConfig:ft,finishWithError:ht}){var Ct,Et;const[gt,At]=React.useState("capture"),xt=React.useRef(null),yt=()=>{At("capture")};if(gt==="capture"){const vt=((Et=(Ct=tt.flowModules.find(kt=>kt.key==="SELFIE"))==null?void 0:Ct.configuration)==null?void 0:Et.deepsightLiveness)==="VIDEOLIVENESS";return jsxRuntimeExports.jsx(CaptureId,{onSuccess:kt=>{xt.current=kt,At("process")},onError:kt=>{const{code:bt}=kt;bt==="PERMISSION_REFRESH"&&ht({type:"PERMISSION_REFRESH",message:"Refresh button clicked"}),bt==="PERMISSION_DENIED"&&ht({type:"PERMISSION_DENIED",message:"Permission denied"})},session:{token:Le},captureConfig:{showTutorial:Ye.showTutorial,captureAttempts:Ye.captureAttempts??3,enableIdRecording:Ye.enableIdRecording,autoCaptureTimeout:Ye.autoCaptureTimeout,enablePassport:Ye.enablePassport,isSecondId:nt,ageAssurance:tt.ageAssurance??!1,mergeSessionRecordings:tt.mergeSessionRecordings??!1,showDocumentChooser:Ye.showDocumentChooserScreen,enableId:Ye.enableId,onlyBack:Ye.onlyBack,idDetectionTimeout:Ye.deviceIdleTimeout,manualUploadIdCapture:Ye.manualUploadIdCapture,digitalIdsUpload:Ye.digitalIdsUpload,usSmartCapture:Ye.usSmartCapture,isDeepsightEnabled:vt},uiConfig:ft})}return jsxRuntimeExports.jsx(ProcessIdWrapper,{goNext:()=>Be(xt.current),token:{token:Le},isSecondId:nt,onDocumentExpired:yt,uiConfig:ft})}function processGovernmentValidation({token:Be}){return exports.api.post("/omni/process/government-validation",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const LinkButton=dt.button`
9095
9096
  background: none;
9096
9097
  border: none;
9097
9098
  color: #0a6fdd;