@incodetech/welcome 1.95.0-rc.20261105170002 → 1.95.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.
- package/dist/onBoarding.mjs +3 -3
- package/dist/onBoarding.umd.js +2 -2
- package/package.json +1 -1
package/dist/onBoarding.mjs
CHANGED
|
@@ -157646,7 +157646,7 @@ i$2("math", function() {
|
|
|
157646
157646
|
});
|
|
157647
157647
|
});
|
|
157648
157648
|
});
|
|
157649
|
-
const version$3 = "1.95.0
|
|
157649
|
+
const version$3 = "1.95.0", devDependencies = {
|
|
157650
157650
|
"@fingerprintjs/fingerprintjs-pro": "3.12.3",
|
|
157651
157651
|
"@thumbmarkjs/thumbmarkjs": "0.20.6"
|
|
157652
157652
|
};
|
|
@@ -157734,7 +157734,7 @@ async function getFingerprintFromThumbprint(Be) {
|
|
|
157734
157734
|
async function getFingerprint(Be = !1) {
|
|
157735
157735
|
return isOfflineMode() ? getFingerprintFromThumbprint(!0) : getFeatureFlag("new_fingerprint") ? getFingerprintFromThumbprint(Be) : getFingerPrintFromFingerprint(Be);
|
|
157736
157736
|
}
|
|
157737
|
-
const SDK_BUILD_VERSION = "1.95.0
|
|
157737
|
+
const SDK_BUILD_VERSION = "1.95.0+8b67f50";
|
|
157738
157738
|
class MetadataUtils {
|
|
157739
157739
|
async initializeMetadata(Le, Ye = !1) {
|
|
157740
157740
|
var xt, Et, kt;
|
|
@@ -358830,7 +358830,7 @@ function init(Be = {}) {
|
|
|
358830
358830
|
};
|
|
358831
358831
|
return initAndBind(BrowserClient, tt);
|
|
358832
358832
|
}
|
|
358833
|
-
const DEPRECATION_PERIOD_MONTHS = 12, SDK_RELEASE_DATE = "2026-11-
|
|
358833
|
+
const DEPRECATION_PERIOD_MONTHS = 12, SDK_RELEASE_DATE = "2026-11-06", DEPRECATED_SDK_WARNING_MESSAGE = "You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";
|
|
358834
358834
|
let hasWarned = !1;
|
|
358835
358835
|
const parseReleaseDate = (Be) => {
|
|
358836
358836
|
const Le = /^(\d{4})-(\d{2})-(\d{2})$/.exec(Be);
|
package/dist/onBoarding.umd.js
CHANGED
|
@@ -2525,7 +2525,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2525
2525
|
void main() {
|
|
2526
2526
|
gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
|
|
2527
2527
|
}
|
|
2528
|
-
`,nt=F.createShader(F.VERTEX_SHADER),ft=F.createShader(F.FRAGMENT_SHADER);if(!nt||!ft)throw new Error("Failed to create shaders");if(F.shaderSource(nt,Ye),F.shaderSource(ft,tt),F.compileShader(nt),!F.getShaderParameter(nt,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(nt));if(F.compileShader(ft),!F.getShaderParameter(ft,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(ft));var ht=F.createProgram();if(!ht)throw new Error("Failed to create shader program");if(F.attachShader(ht,nt),F.attachShader(ht,ft),F.linkProgram(ht),!F.getProgramParameter(ht,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(ht));F.useProgram(ht);for(var gt=137,At=new Float32Array(4*gt),xt=2*Math.PI/gt,Et=0;Et<gt;Et++){var kt=Et*xt;At[4*Et]=0,At[4*Et+1]=0,At[4*Et+2]=Math.cos(kt)*(U.width/2),At[4*Et+3]=Math.sin(kt)*(U.height/2)}var Ct=F.createBuffer();F.bindBuffer(F.ARRAY_BUFFER,Ct),F.bufferData(F.ARRAY_BUFFER,At,F.STATIC_DRAW);var yt=F.getAttribLocation(ht,"position");F.enableVertexAttribArray(yt),F.vertexAttribPointer(yt,2,F.FLOAT,!1,0,0),F.viewport(0,0,U.width,U.height),F.clearColor(0,0,0,1),F.clear(F.COLOR_BUFFER_BIT),F.drawArrays(F.LINES,0,2*gt);var vt=new Uint8ClampedArray(U.width*U.height*4);return F.readPixels(0,0,U.width,U.height,F.RGBA,F.UNSIGNED_BYTE,vt),new ImageData(vt,U.width,U.height)}catch{return new ImageData(1,1)}finally{F&&(F.bindBuffer(F.ARRAY_BUFFER,null),F.useProgram(null),F.viewport(0,0,F.drawingBufferWidth,F.drawingBufferHeight),F.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:d(E(Le,U.width,U.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var j=function(Le,Be,Ye,tt){for(var nt=(Ye-Be)/tt,ft=0,ht=0;ht<tt;ht++)ft+=Le(Be+(ht+.5)*nt);return ft*nt};i$2("math",function(){return e(void 0,void 0,void 0,function(){return n(this,function(Le){return[2,{acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),atan:j(Math.atan,-1,1,97),cos:j(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:j(Math.sin,-Math.PI,Math.PI,97),sinh:j(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:j(Math.tan,0,2*Math.PI,97),tanh:j(Math.tanh,-9/7,7/9,97)}]})})});const version$3="1.95.0-rc.20261105170002",devDependencies={"@fingerprintjs/fingerprintjs-pro":"3.12.3","@thumbmarkjs/thumbmarkjs":"0.20.6"};let fingerprintApiKey;function setFingerprintApiKey(Le){fingerprintApiKey=Le}const FINGERPRINT_PRO_ALGORITHM={algorithmName:"fingerprintjs-pro",algorithmVersion:devDependencies["@fingerprintjs/fingerprintjs-pro"]},THUMBMARK_ALGORITHM={algorithmName:"thumbmarkjs",algorithmVersion:devDependencies["@thumbmarkjs/thumbmarkjs"]};let fingerPrintPromise=null;const FINGERPRINT_STORAGE_KEY="fingerprint_result";let ipPromise=null;async function getIp(){if(ipPromise)return ipPromise;if(AbortSignal.timeout)ipPromise=fetch("https://api.ipify.org?format=json",{signal:AbortSignal.timeout(3e3)}).then(Le=>Le.json()).then(Le=>Le.ip).catch(()=>"");else{const Le=new Promise((Be,Ye)=>{setTimeout(()=>Ye(new Error("Request timeout")),3e3)});ipPromise=Promise.race([fetch("https://api.ipify.org?format=json").then(Be=>Be.json()).then(Be=>Be.ip),Le]).catch(()=>"")}return ipPromise}function getCachedFingerprint(){try{const Le=localStorage.getItem(FINGERPRINT_STORAGE_KEY);return Le?JSON.parse(Le):null}catch{return null}}function setCachedFingerprint(Le){try{localStorage.setItem(FINGERPRINT_STORAGE_KEY,JSON.stringify({visitorId:Le.visitorId}))}catch{}}async function getFingerPrintFromFingerprint(Le){const Be=getCachedFingerprint();return Be?Promise.resolve({visitorId:Be.visitorId,ip:Le?void 0:await getIp(),...FINGERPRINT_PRO_ALGORITHM}):fingerPrintPromise||(fingerPrintPromise=H.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(Ye=>Ye.get({extendedResult:!0})).then(Ye=>(setCachedFingerprint(Ye),{visitorId:Ye.visitorId,ip:Ye.ip,...FINGERPRINT_PRO_ALGORITHM})),fingerPrintPromise)}let thumbprintPromise=null;async function getFingerprintFromThumbprint(Le){return thumbprintPromise||(thumbprintPromise=w$9().then(async Be=>({visitorId:Be,ip:Le?void 0:await getIp(),...THUMBMARK_ALGORITHM})),thumbprintPromise)}async function getFingerprint(Le=!1){return isOfflineMode()?getFingerprintFromThumbprint(!0):getFeatureFlag("new_fingerprint")?getFingerprintFromThumbprint(Le):getFingerPrintFromFingerprint(Le)}const SDK_BUILD_VERSION="1.95.0-rc.20261105170002+3a2b429";class MetadataUtils{async initializeMetadata(Be,Ye=!1){var xt,Et,kt;MlWasmApi.setSdkPlatform("WEBAPP"),MlWasmApi.setSdkVersion(Be||SDK_BUILD_VERSION);const{os:tt,device:nt}=getUAParserResults(),[ft,ht]=await Promise.all([getFingerprint(Ye).catch(()=>({visitorId:"",ip:""})),MlWasmApi.getVersions().catch(()=>null)]),gt={kind:mobile.isDesktop()?"desktop":"mobile",model:`${nt.vendor||""} ${nt.model||""}`.trim(),os:tt.name,osVersion:tt.version,osVer:tt.version,screenDimensions:{width:screen.width,height:screen.height},numTouchPoints:navigator.maxTouchPoints,fingerprintHash:ft.visitorId||"",ip:ft.ip||"",backgroundMode:!1};MlWasmApi.setDeviceInfo(gt);const At={wasmBuild:((xt=ht==null?void 0:ht.versions)==null?void 0:xt.lib)??"",cppApiVersion:((Et=ht==null?void 0:ht.versions)==null?void 0:Et.cpp_api)??"",jsApiVersion:((kt=ht==null?void 0:ht.versions)==null?void 0:kt.js_api)??"",userAgent:navigator.userAgent,getUserMediaAvailability:{webkit:navigator.webkitGetUserMedia!==void 0,moz:navigator.mozGetUserMedia!==void 0,o:navigator.oGetUserMedia!==void 0,ms:navigator.msGetUserMedia!==void 0},webglFingerprint:webgl(),inspectorOpened:!1,isMockedBrowser:isBrowserSimulation()};MlWasmApi.setBrowserInfo(At,!1),FingerprintSignalsReporter$1.start()}updateCameraInfo(Be){const Ye=Be.getSettings(),tt=Be.getCapabilities?Be.getCapabilities():{},nt=Be.label?[Be.label]:[],ht={facingMode:Ye.facingMode==="user"?"frontal":Ye.facingMode==="environment"?"back":Ye.facingMode||"unknown",settings:Ye,capabilities:tt,labels:nt};MlWasmApi.setCameraInfo(ht),FingerprintSignalsReporter$1.markFingerprintDataUpdated()}}class MotionStatusCheck{constructor(Be,Ye,tt,nt,ft,ht,gt,At,xt,Et,kt,Ct){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=10,this.maxFrequency_=60,this.maxPoints_=1200,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.deviceMotionListener=yt=>{if(yt.accelerationIncludingGravity){const vt={x:yt.accelerationIncludingGravity.x,y:yt.accelerationIncludingGravity.y,z:yt.accelerationIncludingGravity.z};this.checkFields(vt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,vt))}if(yt.acceleration){const vt={x:yt.acceleration.x,y:yt.acceleration.y,z:yt.acceleration.z};this.checkFields(vt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,vt))}if(yt.rotationRate){const vt={x:yt.rotationRate.alpha,y:yt.rotationRate.beta,z:yt.rotationRate.gamma};this.checkFields(vt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,vt))}},this.deviceOrientationListener=yt=>{const vt={x:yt.alpha,y:yt.beta,z:yt.gamma};this.checkFields(vt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,vt))},this.accThreshold_=Be,this.gyroThreshold_=Ye,this.accGrOldThreshold_=tt,this.accOldThreshold_=nt,this.gyroscopeOldThreshold_=ft,this.orientationOldThreshold_=ht,this.maeAccThreshold_=gt,this.maeGyroThreshold_=At,this.maeAccGrOldThreshold_=xt,this.maeAccOldThreshold_=Et,this.maeGyroscopeOldThreshold_=kt,this.maeOrientationOldThreshold_=Ct}async requestMotionPermission(){return DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"?(sessionStorage.setItem("motionSensorsPermissionsRequested",String(!0)),DeviceMotionEvent.requestPermission().then(Be=>(Be!=="granted"&&(this.permission_=!1),Be)).catch(console.error)):"granted"}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!this.isRunning_||!this.acl_)return;const Be={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(Be)&&(this.paramsAcc_.ptsNum+=1,this.updateParams(this.paramsAcc_,Be))}updateGyro(){if(!this.isRunning_||!this.gyro_)return;const Be={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(Be)&&(this.paramsGyro_.ptsNum+=1,this.updateParams(this.paramsGyro_,Be))}check(){if(!this.permission_)return"UNCLEAR";const Be=this.checkStability();return Be===null?"UNCLEAR":Be?"FAIL":"PASS"}getDetails(){return{aggregate:this.check(),permissionGranted:this.permission_,hasAccelerometer:this.acl_!==null,hasGyroscope:this.gyro_!==null,isRunning:this.isRunning_}}checkStability(){if(!this.isRunning_)return null;const Ye=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(gt=>gt!==null),tt=Ye.length>0?Ye.every(gt=>gt):null,ft=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(gt=>gt!==null),ht=ft.length>0?ft.every(gt=>gt):null;return tt===null?ht===null?null:ht:ht!==null?tt&&ht:tt}updateParams(Be,Ye){Be.ptsNum>this.maxPoints_&&(this.resetParams(Be),Be.ptsNum=1);const tt=Ye.x-Be.meanX,nt=Ye.y-Be.meanY,ft=Ye.z-Be.meanZ;Be.meanX+=tt/Be.ptsNum,Be.meanY+=nt/Be.ptsNum,Be.meanZ+=ft/Be.ptsNum,Be.m2X+=tt*(Ye.x-Be.meanX),Be.m2Y+=nt*(Ye.y-Be.meanY),Be.m2Z+=ft*(Ye.z-Be.meanZ),Be.cumulativeAbsErrorX+=Math.abs(Ye.x-Be.meanX),Be.cumulativeAbsErrorY+=Math.abs(Ye.y-Be.meanY),Be.cumulativeAbsErrorZ+=Math.abs(Ye.z-Be.meanZ)}resetParams(Be){Be.meanX=0,Be.meanY=0,Be.meanZ=0,Be.m2X=0,Be.m2Y=0,Be.m2Z=0,Be.cumulativeAbsErrorX=0,Be.cumulativeAbsErrorY=0,Be.cumulativeAbsErrorZ=0,Be.ptsNum=0}calculateStd(Be){const Ye={x:Be.m2X/Be.ptsNum,y:Be.m2Y/Be.ptsNum,z:Be.m2Z/Be.ptsNum};return{x:Math.sqrt(Ye.x),y:Math.sqrt(Ye.y),z:Math.sqrt(Ye.z)}}calculateMae(Be){return{x:Be.cumulativeAbsErrorX/Be.ptsNum,y:Be.cumulativeAbsErrorY/Be.ptsNum,z:Be.cumulativeAbsErrorZ/Be.ptsNum}}checkFields(Be){return Be.x!==null&&Be.y!==null&&Be.z!==null}isBelowStdThreshold(Be,Ye){if(Be.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateStd(Be);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}isBelowMaeThreshold(Be,Ye){if(Be.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateMae(Be);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}}class OnboardingAnalytics extends MetadataUtils{constructor(){super(),this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.metadata="",this.onDeviceBarcodeDecoded=!1,this.motionStatusCheck=new MotionStatusCheck(.1,.005,.1,.1,.5,2.5,.1,.005,.1,.1,.5,2.5)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setOnDeviceBarcodeDecoded(Be){this.onDeviceBarcodeDecoded=Be}getOnDeviceBarcodeDecoded(){return this.onDeviceBarcodeDecoded}setSimdIsEnabled(Be){this.simdIsEnabled=Be}setWasmVersion(Be){this.wasmVersion=Be}setProfiles(Be){this.profiles=Be}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getMotionStatusCheck(){return this.motionStatusCheck}getAnalysisStatus(){return this.analysisStatus}getMetadata(){return this.metadata}async analyzeFrame(Be){const Ye=await base64ToImageData(Be);await MlWasmApi.analyzeFrame(Ye)}async startOnboardingCheck(){return this.motionStatusCheck.requestMotionPermission()}async startMotionSensors(Be){this.motionStatusCheck.start();try{await MlWasmApi.rsp(Be),MlWasmApi.ssl(Be)}catch(Ye){appLog.warn("sensors",`startMotionSensors failed ${appLog.describeError(Ye)}`)}}stopMotionSensors(){this.motionStatusCheck.stop()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmApi.estimatePerformance()}update(){if(MlWasmApi.isInitialized())try{const Be=MlWasmApi.getWorkflowState();if(Be!==""){const Ye=JSON.parse(Be);Ye.profiles=Array.from(this.profiles.values()).map(nt=>WasmWorkflowProfileName[nt.name]),Ye.estimatedPerformance=this.estimatedPerformance,Ye.simdIsEnabled=this.simdIsEnabled,Ye.wasmVersion=this.wasmVersion,this.pipelineLogs=Ye;const tt=this.motionStatusCheck.check();this.motionStatus!=="PASS"&&(this.motionStatus=tt),MlWasmApi.setMotionStatus(this.motionStatus),this.analysisStatus=MlWasmApi.getCheck()}this.metadata=MlWasmApi.getMetadata()}catch(Be){console.error(`Exception: ${Be}`)}}}const onboardingAnalytics=OnboardingAnalytics.getInstance(),ENFORCE_KEY="incode_enforce_capture_attempts",BUDGET_KEY="incode_capture_attempt_budget",getEnforceStorageKey=Le=>`${ENFORCE_KEY}_${Le}`,getBudgetStorageKey=(Le,Be)=>`${BUDGET_KEY}_${Le}_${Be}`,readBudget=(Le,Be)=>{try{const Ye=sessionStorage.getItem(getBudgetStorageKey(Le,Be));if(Ye){const tt=JSON.parse(Ye);if(tt&&typeof tt=="object")return{used:typeof tt.used=="number"&&tt.used>0?tt.used:0,max:typeof tt.max=="number"?tt.max:null,remaining:typeof tt.remaining=="number"?Math.max(0,tt.remaining):null}}}catch{}return{used:0,max:null,remaining:null}},writeBudget=(Le,Be,Ye)=>{try{sessionStorage.setItem(getBudgetStorageKey(Le,Be),JSON.stringify(Ye))}catch{}},recordEnforceCaptureAttemptLimits=(Le,Be)=>{if(!(!Le||typeof Be!="boolean"))try{sessionStorage.setItem(getEnforceStorageKey(Le),Be?"1":"0")}catch{}},isCaptureAttemptEnforcementEnabled=Le=>{if(!Le)return!1;try{return sessionStorage.getItem(getEnforceStorageKey(Le))==="1"}catch{return!1}},recordCaptureAttempt=(Le,Be)=>{if(!isCaptureAttemptEnforcementEnabled(Le))return;const Ye=readBudget(Le,Be);writeBudget(Le,Be,{...Ye,used:Ye.used+1,remaining:Ye.remaining===null?null:Math.max(0,Ye.remaining-1)})},applyBackendAttemptsLimit=(Le,Be,Ye)=>{if(!Le||!Ye||typeof Ye!="object"||typeof Ye.max!="number"&&typeof Ye.remaining!="number")return;const tt=readBudget(Le,Be);writeBudget(Le,Be,{used:tt.used,max:typeof Ye.max=="number"?Ye.max:tt.max,remaining:typeof Ye.remaining=="number"?Math.max(0,Ye.remaining):tt.remaining})},getEnforcedAttemptsLeft=(Le,Be,Ye)=>{if(!isCaptureAttemptEnforcementEnabled(Le))return null;const tt=readBudget(Le,Be);if(tt.remaining!==null)return tt.remaining;const nt=tt.max??Ye;return!Number.isFinite(nt)||nt<=0?null:Math.max(0,nt-tt.used)},defaultFlow$1={name:"",checkTutorials:!0,checkAuthorization:!0,redirectDesktopToMobile:!1,disableUnsupportedBrowserScreen:!1,qrPhishingResistance:!1,addContinueToDesktop:!1,redirectOriginOnly:!1,displayOnboardingResultOnDesktop:!1,enableMultipleOnboardings:!1,disableLaunchScreen:!1,disableSmsOption:!1,mergeSessionRecordings:!1,mandatoryConsentCheck:!0,enableSardineRisk:!1,flowModules:[{key:"PHONE",configuration:{otpVerification:!1,otpExpirationInMinutes:10,prefill:!1}},{key:"GEOLOCATION",configuration:{allowUserToSkipGeolocation:!1}},{key:"ID",configuration:{showTutorial:!0,enableId:!0,enablePassport:!0,onlyFront:!1,onlyBack:!1,barcodeCapture:!1,fetchAdditionalPage:!1,secondId:!1,autoCaptureTimeout:18,deviceIdleTimeout:60,captureAttempts:3,manualUploadIdCapture:!1,deviceWallet:!1,digiLocker:!1,showDocumentChooserScreen:!0,enableIdRecording:!0,perCountryPerDocOverrides:{}}},{key:"ADDRESS",configuration:{disableSkipPoa:!1,title:"",text:""}},{key:"ID_OCR",configuration:{editableOcr:!1}},{key:"SELFIE",configuration:{showTutorial:!0,showPreview:!1,assistedOnboarding:!1,enableFaceRecording:!0,autoCaptureTimeout:20,captureAttempts:3,validateLenses:!0,validateFaceMask:!0,validateHeadCover:!0,validateClosedEyes:!0,validateBrightness:!0,deepsightLiveness:"SINGLE_FRAME"}},{key:"FACE_MATCH",configuration:{matchingType:"selfieVsId",disableFaceMatchAnimation:!1}},{key:"SIGNATURE",configuration:{title:"",subTitle:""}},{key:"VIDEO_ONBOARDING",configuration:{useAsSelfie:!1,showTutorials:!0,companyName:"",checkLiveness:!0,checkIdScan:!0,checkDocumentScan:!0,compareIdEnabled:!0,compareOcrEnabled:!1,compareBackIdEnabled:!1,compareBackOcrEnabled:!1,checkVoiceConsent:!0,voiceConsentQuestions:0,selfieQualityAffectsScore:!1,maxWaitingVideoSelfieFile:0,lastSecondsVideoQualityCheck:!1,lastSecondsVideoQualityCheckDuration:0}}]};function normalizeFlowModules(Le){const Be=Le.flatMap((ft,ht,gt)=>{if(ft.key==="TUTORIAL_ID"){const xt=ft.configuration,kt=[{key:"ID",configuration:xt}];return xt.secondId&&kt.push({key:"SECOND_ID",configuration:xt}),kt}const At=gt[ht-1];return ft.key==="ID"&&(At==null?void 0:At.key)==="TUTORIAL_ID"?[]:[ft]}),Ye=ft=>ft,tt=ft=>ft.filter(ht=>ht.key!=="SELFIE");return(Be.some(ft=>ft.key==="VIDEO_ONBOARDING"&&ft.configuration.useAsSelfie===!0)?tt:Ye)(Be)}function handleResponse(Le){const Be=Le.data,Ye=normalizeFlowModules(Be.flowModules);return{...Be,flowModules:Ye}}async function getFlow$1(Le){var Be,Ye;try{const tt=await api.get("/omni/onboarding/flow",{headers:{"X-Incode-Hardware-Id":Le}});return recordEnforceCaptureAttemptLimits(Le,(Be=tt.data)==null?void 0:Be.enforceCaptureAttemptLimits),handleResponse(tt)}catch(tt){if(tt instanceof WebClientError&&((Ye=tt.response)==null?void 0:Ye.status)===400)return defaultFlow$1;throw tt}}const PERMISSION_ERROR_CODES={DENIED:"PERMISSION_DENIED",REFRESH:"PERMISSION_REFRESH"},PERMISSION_ERROR_MESSAGE="Error in permissions",createPermissionError=Le=>({code:Le,message:PERMISSION_ERROR_MESSAGE,error:new Error(Le)});var FlowType=(Le=>(Le.ID="ID",Le.FACE="Face",Le))(FlowType||{});function getErrorStatusCode(Le){var tt;if(Le instanceof WebClientError)return Le.statusCode;const Be=Le,Ye=(Be==null?void 0:Be.statusCode)??((tt=Be==null?void 0:Be.response)==null?void 0:tt.status)??(Be==null?void 0:Be.status);return typeof Ye=="number"?Ye:void 0}function toError(Le,Be){return Le instanceof Error?Le:new Error(Be)}function createFlowInitializationError(Le){const Be=getErrorStatusCode(Le);if(Be===401){const tt="Session expired";return{code:"SESSION_EXPIRED",type:"SESSION_EXPIRED",message:tt,statusCode:Be,error:new Error(tt)}}const Ye="Failed to initialize FlowManager";return{code:"FETCH_FLOW_ERROR",type:"FETCH_FLOW_ERROR",message:Ye,statusCode:Be,error:toError(Le,Ye)}}class AbstractFlowManager{constructor(Be){this.subscribers=[],this.flow=null,this.sessionToken=null,this.captureConfig=null,this.captureConfiguration=null,this.parentSize={width:window.innerWidth,height:window.innerHeight},this.uiConfig=null;const Ye={currentStep:null,isLoading:!1,attempts:0,errorDetails:null,successData:null,flowOutcome:"pending",sessionToken:null,...Be};this.initialState=Object.freeze({...Ye}),this.state={...this.initialState}}async isPermissionsEnabled(){if(!navigator.permissions)return appLog.info("flow","permissions: navigator.permissions unavailable"),!1;try{const Be=await navigator.permissions.query({name:"camera"});return appLog.info("flow",`permissions: camera state=${Be.state}`),Be.state==="granted"}catch(Be){return appLog.warn("flow",`permissions.query threw ${appLog.describeError(Be)}`),!1}}subscribe(Be){return this.subscribers.push(Be),Be(this.getState()),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Be)}}notifySubscribers(){const Be=this.getState();this.subscribers.forEach(Ye=>Ye(Be))}setState(Be){this.state={...this.state,...Be},this.notifySubscribers()}getState(){return{...this.state}}getToken(){return this.sessionToken}getParentSize(){return this.parentSize}incrementAttempts(){this.setState({attempts:this.state.attempts+1})}resetAttempts(){this.setState({attempts:0})}canRetry(){const Be=this.getEnforcedAttemptsLeft();return Be!==null?Be>0:this.state.attempts<this.getMaxAttempts()}getAttemptsLeft(){const Be=this.getEnforcedAttemptsLeft();return Be!==null?Be:Math.max(0,this.getMaxAttempts()-this.state.attempts)}getAttemptBudgetKind(){return null}getEnforcedAttemptsLeft(){const Be=this.getAttemptBudgetKind();return!Be||!this.sessionToken?null:getEnforcedAttemptsLeft(this.sessionToken,Be,this.getMaxAttempts())}async initialize(Be){var tt,nt;if(this.setState({isLoading:!0,errorDetails:null,flowOutcome:"pending",attempts:0,successData:null,sessionToken:Be.sessionToken}),this.parentSize=(tt=Be.parentSize)!=null&&tt.width&&((nt=Be.parentSize)!=null&&nt.height)?Be.parentSize:this.parentSize,this.sessionToken=Be.sessionToken,this.sessionToken&&Be.uiConfig&&(this.uiConfig=Be.uiConfig??null),Be.captureConfig)appLog.info("flow","init config source=captureConfig"),this.captureConfig=Be.captureConfig;else if(Be.flow)appLog.info("flow","init config source=flow"),this.flow=Be.flow,recordEnforceCaptureAttemptLimits(Be.sessionToken,Be.flow.enforceCaptureAttemptLimits);else{appLog.info("flow","init config source=fetch");try{this.flow=await this.fetchFlowConfiguration(this.sessionToken)}catch(ft){appLog.error("flow",`fetchFlow failed ${appLog.describeError(ft)}`);const ht=createFlowInitializationError(ft);this.setState({errorDetails:ht,isLoading:!1,flowOutcome:"error",currentStep:"error"});return}}this.captureConfiguration=this.getCaptureConfiguration(),appLog.info("flow","determine initial step");const Ye=await this.determineInitialStep(this.captureConfiguration);appLog.info("flow",`initial step=${String(Ye)}`),this.setState({currentStep:Ye,isLoading:!1})}reset(){this.state={...this.initialState},this.flow=null,this.sessionToken=null,this.captureConfiguration=null,this.captureConfig=null,this.setState(this.state)}fetchFlowConfiguration(Be){return getFlow$1(Be)}getFlow(){return this.flow}onClose(Be){const Ye=Be==="ID"?"errors.userCancelledIdFlow":"errors.userCancelledFaceFlow";onboardingAnalytics.update(),MlWasmApi.pseInFlight||MlWasmApi.reset(),this.completeWithError({code:"USER_CANCELLED",message:i18n.t(Ye),error:new Error("User cancelled")})}}const getCustomFields=({token:Le})=>api.get("/omni/get/custom-fields",{headers:{"X-Incode-Hardware-Id":Le}}).then(Be=>Be.data).catch(Be=>{var Ye;return Promise.reject(((Ye=Be==null?void 0:Be.response)==null?void 0:Ye.data)??Be)}),getDeviceRiskModuleConfiguration=async Le=>api.get("/omni/device-risk-client-id",{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data).catch(()=>({enabled:!1})),collectDeviceRiskResults=async Le=>api.post("/omni/collect-device-risk-results",null,{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data).catch(()=>({})),shouldDoSardineContextFromSardine=Le=>Le===void 0?!1:typeof Le.SardineClientID=="string"&&typeof Le.SardineSessionKey=="string"&&typeof Le.SardineUserID=="string",loadSardineSDK=async Le=>{const Be=Le?"api.sandbox.sardine.ai":"api.sardine.ai",Ye=document.createElement("script");return Ye.type="text/javascript",Ye.async=!0,Ye.src=`https://${Be}/assets/loader.min.js`,new Promise(tt=>{Ye.onload=()=>tt();const nt=document.getElementsByTagName("script")[0];nt.parentNode.insertBefore(Ye,nt)})};let sardineContext=null;const getSardineContext=()=>sardineContext,createSardineContextFromSardine=({sardineClientId:Le,sardineSessionKey:Be,sardineUserId:Ye,isSandbox:tt,token:nt,interviewId:ft})=>window._Sardine.createContext({clientId:Le,sessionKey:ft,flow:`Landing page ${location.pathname}`,environment:tt?"sandbox":"production",parentElement:document.body,parentSessionKey:Be,userIdHash:Ye,onDeviceResponse(ht){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:ht.deviceId,uuid:ht.uuid},interviewId:ft,sardineClientId:Le,sardineSessionKey:Be,sardineUserId:Ye},token:nt})}}),createSardineContextIncode=({sardineClientId:Le,isSandbox:Be,token:Ye,interviewId:tt})=>window._Sardine.createContext({clientId:Le,sessionKey:tt,flow:`Landing page ${location.pathname}`,environment:"production",parentElement:document.body,userIdHash:tt,onDeviceResponse(nt){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:nt.deviceId,uuid:nt.uuid},interviewId:tt,sardineClientId:Le},token:Ye})}}),enableDeviceRiskModule=async({token:Le,isSandbox:Be=!0,interviewId:Ye})=>{if(isOfflineMode())return null;const{customFields:tt}=await getCustomFields({token:Le}).catch(()=>({customFields:{SardineClientID:void 0,SardineSessionKey:void 0,SardineUserID:void 0}}));shouldDoSardineContextFromSardine(tt)&&(await loadSardineSDK(Be),sardineContext=createSardineContextFromSardine({sardineClientId:tt.SardineClientID,sardineSessionKey:tt.SardineSessionKey,sardineUserId:tt.SardineUserID,isSandbox:Be,token:Le,interviewId:Ye}));const nt=await getDeviceRiskModuleConfiguration(Le);return nt.enabled&&nt.riskClientId&&(await loadSardineSDK(!1),sardineContext=createSardineContextIncode({sardineClientId:nt.riskClientId,isSandbox:!1,token:Le,interviewId:Ye})),sardineContext},eventModuleNames={selfie:"SELFIE",authFace:"AUTH_FACE",mlConsent:"ML_CONSENT",combinedConsent:"COMBINED_CONSENT",privacyConsent:"PRIVACY_CONSENT",curpValidation:"CURP_VALIDATION",faceMatch:"FACE_MATCH",qr:"QR",videoSelfie:"VIDEO_ONBOARDING",passport:"ID",front:"ID",back:"ID",idOcr:"ID_OCR",document:"DOCUMENT_CAPTURE",creditCard:"CREDIT_CARD_FRONT",creditCardBack:"CREDIT_CARD_BACK",conference:"CONFERENCE",otp:"OTP",signature:"SIGNATURE",ekyc:"EXTERNAL_VERIFICATION",payments:"PAYMENTS",globalWatchList:"GLOBAL_WATCHLIST",customWatchList:"CUSTOM_WATCHLIST",email:"EMAIL",phone:"PHONE",instantVerifyEmail:"INSTANT_VERIFY_EMAIL",instantVerifyConsent:"INSTANT_VERIFY_CONSENT",forms:"FORMS",customModule:"CUSTOM_MODULE",mDocWallet:"MDOC_WALLET"},eventScreenNames={idOcrLoading:"ID_OCR.loading",idOcrInputting:"ID_OCR.inputting",idOcrSubmitting:"ID_OCR.submitting",idOcrError:"ID_OCR.error",faceMatch:"FACE_MATCH",faceCaptureTutorial:"SELFIE_CAPTURE_TUTORIAL",faceCaptureCamera:"SELFIE_CAMERA_CAPTURE",faceCaptureError:"SELFIE_ATTEMPT_FAILED",faceCaptureSuccess:"SELFIE_UPLOAD_SUCCEEDED",faceCaptureUpload:"SELFIE_UPLOAD_PROGRESS",mlConsent:"MACHINE_LEARNING_CONSENT",combinedConsent:"COMBINED_CONSENT",curpEnter:"ENTER_CURP",curpValidate:"VALIDATE_CURP",curpGenerate:"GENERATE_CURP",curpValidation:"CURP_VALIDATION_PROGRESS",curpValidationFailed:"CURP_VALIDATION_FAILED",curpValidationSuccess:"CURP_VALIDATION_SUCCEEDED",qrTutorial:"QR_TUTORIAL",qrScan:"QR_SCAN",smsOtp:"OTP",simpleOTP:"OTP",signatureInput:"SIGNATURE_INPUT",frontTutorial:"FRONT_ID_CAPTURE_TUTORIAL",frontCameraCapture:"FRONT_ID_CAMERA_CAPTURE",frontHelp:"FRONT_ID_HELP",frontReviewPhoto:"FRONT_ID_REVIEW_PHOTO",frontUploadProgress:"FRONT_ID_UPLOAD_PROGRESS",frontAttemptFailed:"FRONT_ID_ATTEMPT_FAILED",frontUploadSuccess:"FRONT_ID_UPLOAD_SUCCEEDED",backTutorial:"BACK_ID_CAPTURE_TUTORIAL",backCameraCapture:"BACK_ID_CAMERA_CAPTURE",backReviewPhoto:"BACK_ID_REVIEW_PHOTO",backUploadProgress:"BACK_ID_UPLOAD_PROGRESS",backAttemptFailed:"BACK_ID_ATTEMPT_FAILED",backUploadSuccess:"BACK_ID_UPLOAD_SUCCEEDED",backHelp:"BACK_ID_HELP",passportTutorial:"TUTORIAL_PASSPORT",passportCameraCapture:"PASSPORT_CAMERA_CAPTURE",passportReviewPhoto:"PASSPORT_REVIEW_PHOTO",passportUploadProgress:"PASSPORT_UPLOAD_PROGRESS",passportUploadSuccess:"PASSPORT_UPLOAD_SUCCEEDED",passportAttemptFailed:"PASSPORT_ATTEMPT_FAILED",passportHelp:"PASSPORT_HELP",passportIdError:"PASSPORT_ERROR",passportManualCapture:"PASSPORT_MANUAL_CAPTURE",passportNoAttemptsLeft:"PASSPORT_NO_ATTEMPTS_LEFT",frontIdError:"FRONT_ID_ERROR",backIdError:"BACK_ID_ERROR",frontIdNoAttemptsLeft:"FRONT_ID_NO_ATTEMPTS_LEFT",backIdNoAttemptsLeft:"BACK_ID_NO_ATTEMPTS_LEFT",frontIdManualCapture:"FRONT_ID_MANUAL_CAPTURE",backIdManualCapture:"BACK_ID_MANUAL_CAPTURE",selfieManualCapture:"SELFIE_MANUAL_CAPTURE",selfieNoAttemptsLeft:"SELFIE_NO_ATTEMPTS_LEFT",idCameraDeviceChooser:"ID_CAMERA_DEVICE_CHOOSER",idCameraPermissionSlider:"ID_CAMERA_PERMISSION_SLIDER",idCameraPermissionAllow:"ID_CAMERA_PERMISSION_ALLOW",idCameraPermissionRequesting:"ID_CAMERA_PERMISSION_REQUESTING",idCameraPermissionDenied:"ID_CAMERA_PERMISSION_DENIED",idCameraPermissionInstructions:"ID_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionAllow:"SELFIE_CAMERA_PERMISSION_ALLOW",selfieCameraPermissionRequesting:"SELFIE_CAMERA_PERMISSION_REQUESTING",selfieCameraPermissionDenied:"SELFIE_CAMERA_PERMISSION_DENIED",selfieCameraPermissionInstructions:"SELFIE_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionSlider:"SELFIE_CAMERA_PERMISSION_SLIDER",selfieNoConnection:"SELFIE_NO_CONNECTION",documentTutorial:"DOCUMENT_CAPTURE_TUTORIAL",documentManualCapture:"DOCUMENT_MANUAL_CAPTURE",documentNoAttemptsLeft:"DOCUMENT_NO_ATTEMPTS_LEFT",documentCameraCapture:"DOCUMENT_CAMERA_CAPTURE",documentHelp:"DOCUMENT_HELP",documentReviewPhoto:"DOCUMENT_REVIEW_PHOTO",documentUploadProgress:"DOCUMENT_UPLOAD_IN_PROGRESS",documentAttemptFailed:"DOCUMENT_ATTEMPT_FAILED",documentUploadSuccess:"DOCUMENT_UPLOAD_SUCCEEDED",conferenceWait:"CONFERENCE_WAIT",conferenceVideoChat:"CONFERENCE_VIDEO_CHAT",conferenceMessageChat:"CONFERENCE_MESSAGE_CHAT",videoSelfieTutorial:"VIDEO_SELFIE_TUTORIAL",videoSelfie:"VIDEO_SELFIE",videoSelfieFaceCapture:"VIDEO_SELFIE_FACE_CAPTURE",videoSelfieFaceUploadProgress:"VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",videoSelfieFaceAttemptFailed:"VIDEO_SELFIE_FACE_ATTEMPT_FAILED",videoSelfieFaceUploadSucceeded:"VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",videoSelfieFrontIdCapture:"VIDEO_SELFIE_FRONT_ID_CAPTURE",videoSelfieFrontIdUploadProgress:"VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",videoSelfieFrontIdAttemptFailed:"VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",videoSelfieFrontIdUploadSucceeded:"VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",videoSelfieBackIdCapture:"VIDEO_SELFIE_BACK_ID_CAPTURE",videoSelfieBackIdUploadProgress:"VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",videoSelfieBackIdAttemptFailed:"VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",videoSelfieBackIdUploadSucceeded:"VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",videoSelfieDocumentCapture:"VIDEO_SELFIE_DOCUMENT_CAPTURE",videoSelfieVoiceQuestion:"VIDEO_SELFIE_VOICE_QUESTION",videoSelfieVoiceFinalQuestion:"VIDEO_SELFIE_VOICE_FINAL_QUESTION",videoSelfieVideoUpload:"VIDEO SELFIE VIDEO UPLOAD",ekycInput:"EKYC_INPUT",ekycProgress:"EKYC_PROGRESS",ekycSucceeded:"EKYC_SUCCEEDED",ekycFailed:"EKYC_FAILED",paymentsInput:"PAYMENTS_INPUT",paymentsProgress:"PAYMENTS_PROGRESS",paymentsSucceeded:"PAYMENTS_SUCCEEDED",paymentsFailed:"PAYMENTS_FAILED",forms:"FORMS",globalWatchListInput:"GLOBAL_WATCHLIST_INPUT",globalWatchListProgress:"GLOBAL_WATCHLIST_PROGRESS",globalWatchListSuccess:"GLOBAL_WATCHLIST_SUCCEEDED",globalWatchListFailed:"GLOBAL_WATCHLIST_FAILED",customWatchListInput:"CUSTOM_WATCHLIST_INPUT",customWatchListProgress:"CUSTOM_WATCHLIST_PROGRESS",customWatchListSuccess:"CUSTOM_WATCHLIST_SUCCEEDED",customWatchListFailed:"CUSTOM_WATCHLIST_FAILED",emailInput:"EMAIL_INPUT",phoneInput:"PHONE_INPUT",instantVerify:"INSTANT_VERIFY",authFace:"AUTH_FACE",authFaceError:"AUTH_FACE_ATTEMPT_FAILED",authFaceUpload:"AUTH_FACE_UPLOAD_PROGRESS",authFaceUploadSuccess:"AUTH_FACE_UPLOAD_SUCCEEDED",authFaceUploadFailed:"AUTH_FACE_UPLOAD_FAILED",customModuleCallback:"CUSTOM_MODULE_CALLBACK",customModuleProcessing:"CUSTOM_MODULE_PROCESSING",digitalIdFileSelection:"DIGITAL_ID_FILE_SELECTION",digitalIdFileReview:"DIGITAL_ID_FILE_REVIEW",digitalIdUploadProgress:"DIGITAL_ID_UPLOAD_PROGRESS",digitalIdUploadSuccess:"DIGITAL_ID_UPLOAD_SUCCEEDED",digitalIdUploadFailed:"DIGITAL_ID_UPLOAD_FAILED",digitalIdAnalysisProgress:"DIGITAL_ID_ANALYSIS_PROGRESS",digitalIdVerificationSuccess:"DIGITAL_ID_VERIFICATION_SUCCESS",digitalIdVerificationFailed:"DIGITAL_ID_VERIFICATION_FAILED",documentChooser:"DOCUMENT_CHOOSER",landingPage:"LANDING_PAGE",privacyConsent:"PRIVACY_CONSENT",mDocWalletError:"MDOC_WALLET_ERROR"},streamingEvents={strSessionDidConnect:"strSessionDidConnect",strSessionDidDisconnect:"strSessionDidDisconnect",strSessionDidFailWithError:"strSessionDidFailWithError",strStreamVideoCaptureStart:"strStreamVideoCaptureStart",strStreamVideoCaptureStop:"strStreamVideoCaptureStop",strStreamPublisherCreated:"strStreamPublisherCreated",strStreamPublisherDestroyed:"strStreamPublisherDestroyed",strStreamPublisherDidFailWithError:"strStreamPublisherDidFailWithError"},videoSelfieEvents={imageTooBlurry:"imageTooBlurry",fillFrame:"fillFrame",checkCameraOrLighting:"checkCameraOrLighting",frontIdCaptureStarted:"frontIdCaptureStarted",lookAtCamera:"lookAtCamera",moveCloser:"moveCloser",lookingForFrontId:"lookingForFrontId",lookingForBackId:"lookingForBackId",cameraSwitchToBack:"cameraSwitchToBack",cameraSwitchToFront:"cameraSwitchToFront",audioStreamOpened:"audioStreamOpened",audioStreamClosed:"audioStreamClosed",videoSelfieVideoUploadInProgress:"videoSelfieVideoUploadInProgress",videoSelfieTosNotAccepted:"videoSelfieTosNotAccepted",videoSelfieTosAccepted:"videoSelfieTosAccepted",videoSelfieStreamCreated:"videoSelfieStreamCreated",videoSelfieStreamDestroyed:"videoSelfieStreamDestroyed",videoSelfieReconnecting:"videoSelfieReconnecting",videoSelfieReconnected:"videoSelfieReconnected"},tutorialScreenNamesMapper={passport:eventScreenNames.passportTutorial,front:eventScreenNames.frontTutorial,back:eventScreenNames.backTutorial,selfie:eventScreenNames.faceCaptureTutorial},cameraScreenNamesMapper={front:"front",back:"back",passport:"passport",creditCard:"front",creditCardBack:"back",document:"document"};function screenEvent({module:Le,payload:Be,token:Ye,screen:tt,code:nt}){try{addEvent({token:Ye,module:Le,code:nt,screen:tt,clientTimestamp:new Date().getTime(),payload:{...Be??{}}})}catch(ft){console.error(ft)}}function updateSardineConfigOnScreenChange(Le,Be){const Ye=getSardineContext(),tt=Be?`${Le} - ${Be}`:Le;Ye&&Ye.updateConfig({flow:tt})}function useScreenEvents({module:Le,screen:Be,payload:Ye={},token:tt}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Le,Be),screenEvent({module:Le,payload:Ye,code:"screenOpened",token:tt,screen:Be}),()=>{screenEvent({module:Le,payload:Ye,code:"screenClosed",token:tt,screen:Be}),updateSardineConfigOnScreenChange(Le)}),[])}function useScreenTransitionEvents({module:Le,screen:Be,token:Ye}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Le,Be),screenEvent({module:Le,screen:Be,code:"screenOpened",token:Ye}),()=>{screenEvent({module:Le,screen:Be,code:"screenClosed",token:Ye}),updateSardineConfigOnScreenChange(Le)}),[Le,Be,Ye])}function useModuleEvents({module:Le,payload:Be={},token:Ye,screen:tt,includeAppLogs:nt}){React.useLayoutEffect(()=>{const ft=async()=>{const ht=await getModuleFeatureFlags(Le);screenEvent({module:Le,screen:tt,payload:{...Be,...ht},code:"moduleOpened",token:Ye})};return updateSardineConfigOnScreenChange(Le,tt),ft(),()=>{const ht=async()=>{const gt=await getModuleFeatureFlags(Le);screenEvent({module:Le,payload:{...Be,...gt,...nt?{appLogs:appLog.getAppLogs()}:{}},screen:tt,code:"moduleClosed",token:Ye})};setTimeout(()=>{ht()},0)}},[])}const addScreenEvent=({module:Le,token:Be,screen:Ye,payload:tt,shouldOpen:nt,sardineScreen:ft})=>{nt&&updateSardineConfigOnScreenChange(Le,ft??Ye),screenEvent({module:Le,payload:tt,token:Be,screen:Ye,code:nt?"screenOpened":"screenClosed"})};function getIdCaptureReviewScreen(Le){return Le==="front"?eventScreenNames.frontReviewPhoto:Le==="back"?eventScreenNames.backReviewPhoto:eventScreenNames.passportReviewPhoto}function getIdCaptureNoAttemptsScreen(Le){return Le==="front"?eventScreenNames.frontIdNoAttemptsLeft:Le==="back"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.passportNoAttemptsLeft}function getIdCaptureManualScreen(Le){return Le==="front"?eventScreenNames.frontIdManualCapture:Le==="back"?eventScreenNames.backIdManualCapture:eventScreenNames.passportManualCapture}function getCaptureIdReviewScreen(Le){return Le==="document"?eventScreenNames.documentReviewPhoto:getIdCaptureReviewScreen(Le)}function getCaptureIdManualScreen(Le){return Le==="document"?eventScreenNames.documentManualCapture:getIdCaptureManualScreen(Le)}function getCaptureIdNoAttemptsScreen(Le){return Le==="document"?eventScreenNames.documentNoAttemptsLeft:getIdCaptureNoAttemptsScreen(Le)}function getCaptureIdErrorScreen(Le){return Le==="document"?eventScreenNames.documentAttemptFailed:Le==="front"?eventScreenNames.frontIdError:Le==="back"?eventScreenNames.backIdError:Le==="passport"?eventScreenNames.passportIdError:eventScreenNames.frontIdError}function getIdV2SardineScreen(Le,Be){return Le==="passport"?Be==="uploading"?eventScreenNames.passportUploadProgress:Be==="success"?eventScreenNames.passportUploadSuccess:Be==="error"?eventScreenNames.passportIdError:Be==="manual"?eventScreenNames.passportManualCapture:Be==="noAttempts"?eventScreenNames.passportNoAttemptsLeft:eventScreenNames.passportCameraCapture:Le==="back"?Be==="uploading"?eventScreenNames.backUploadProgress:Be==="success"?eventScreenNames.backUploadSuccess:Be==="error"?eventScreenNames.backIdError:Be==="manual"?eventScreenNames.backIdManualCapture:Be==="noAttempts"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.backCameraCapture:Be==="uploading"?eventScreenNames.frontUploadProgress:Be==="success"?eventScreenNames.frontUploadSuccess:Be==="error"?eventScreenNames.frontIdError:Be==="manual"?eventScreenNames.frontIdManualCapture:Be==="noAttempts"?eventScreenNames.frontIdNoAttemptsLeft:eventScreenNames.frontCameraCapture}const FlowPage=({uiConfig:Le,onClose:Be,onCloseCancel:Ye,hideFooterBranding:tt,hideHeaderBranding:nt,...ft})=>{var At,xt,Et,kt,Ct,yt,vt,bt,wt,It,Tt,_t,Bt,Pt;const ht=!!((At=Le==null?void 0:Le.closeButton)!=null&&At.show),gt=!!((Et=(xt=Le==null?void 0:Le.branding)==null?void 0:xt.logo)!=null&&Et.src||(Ct=(kt=Le==null?void 0:Le.branding)==null?void 0:kt.logo)!=null&&Ct.height);return jsxRuntimeExports.jsx(Page$1,{closeButton:{onClose:Be,show:ht,position:(yt=Le==null?void 0:Le.closeButton)==null?void 0:yt.position,offset:(vt=Le==null?void 0:Le.closeButton)==null?void 0:vt.offset,color:(bt=Le==null?void 0:Le.closeButton)==null?void 0:bt.color,onCancel:Ye},...gt?{logo:{src:(It=(wt=Le==null?void 0:Le.branding)==null?void 0:wt.logo)==null?void 0:It.src,height:(_t=(Tt=Le==null?void 0:Le.branding)==null?void 0:Tt.logo)==null?void 0:_t.height}}:{},hideFooterBranding:tt||((Bt=Le==null?void 0:Le.branding)==null?void 0:Bt.hideFooterBranding),hideHeaderBranding:nt||((Pt=Le==null?void 0:Le.branding)==null?void 0:Pt.hideHeaderBranding),...ft})},breakpoints$1={xs:"568px",sm:"667px",md:"812px",lg:"926px"},ArrowRightIcon=({width:Le=13,height:Be=14})=>{const tt=useTokens().color.text.body.primary;return jsxRuntimeExports.jsx("svg",{width:Le,height:Be,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntimeExports.jsx("path",{d:"M0 8.08009V5.92009H9.198L4.698 1.87009L6.228 0.340088L12.6 6.28009V7.70209L6.228 13.6601L4.698 12.1301L9.198 8.08009H0Z",fill:tt})})},arrowEl=jsxRuntimeExports.jsx(ArrowRightIcon,{}),BoldWithArrow=({i18nKey:Le})=>{const Be=useTokens();return jsxRuntimeExports.jsx(Flex$1,{as:"span",inline:!0,gap:"0.3em",forceGap:!0,align:"center",fontWeight:700,whiteSpace:"nowrap",color:Be.color.text.body.primary,children:jsxRuntimeExports.jsx(Trans,{i18nKey:Le,components:{arrow:arrowEl}})})},spin=mt`
|
|
2528
|
+
`,nt=F.createShader(F.VERTEX_SHADER),ft=F.createShader(F.FRAGMENT_SHADER);if(!nt||!ft)throw new Error("Failed to create shaders");if(F.shaderSource(nt,Ye),F.shaderSource(ft,tt),F.compileShader(nt),!F.getShaderParameter(nt,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(nt));if(F.compileShader(ft),!F.getShaderParameter(ft,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(ft));var ht=F.createProgram();if(!ht)throw new Error("Failed to create shader program");if(F.attachShader(ht,nt),F.attachShader(ht,ft),F.linkProgram(ht),!F.getProgramParameter(ht,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(ht));F.useProgram(ht);for(var gt=137,At=new Float32Array(4*gt),xt=2*Math.PI/gt,Et=0;Et<gt;Et++){var kt=Et*xt;At[4*Et]=0,At[4*Et+1]=0,At[4*Et+2]=Math.cos(kt)*(U.width/2),At[4*Et+3]=Math.sin(kt)*(U.height/2)}var Ct=F.createBuffer();F.bindBuffer(F.ARRAY_BUFFER,Ct),F.bufferData(F.ARRAY_BUFFER,At,F.STATIC_DRAW);var yt=F.getAttribLocation(ht,"position");F.enableVertexAttribArray(yt),F.vertexAttribPointer(yt,2,F.FLOAT,!1,0,0),F.viewport(0,0,U.width,U.height),F.clearColor(0,0,0,1),F.clear(F.COLOR_BUFFER_BIT),F.drawArrays(F.LINES,0,2*gt);var vt=new Uint8ClampedArray(U.width*U.height*4);return F.readPixels(0,0,U.width,U.height,F.RGBA,F.UNSIGNED_BYTE,vt),new ImageData(vt,U.width,U.height)}catch{return new ImageData(1,1)}finally{F&&(F.bindBuffer(F.ARRAY_BUFFER,null),F.useProgram(null),F.viewport(0,0,F.drawingBufferWidth,F.drawingBufferHeight),F.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:d(E(Le,U.width,U.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var j=function(Le,Be,Ye,tt){for(var nt=(Ye-Be)/tt,ft=0,ht=0;ht<tt;ht++)ft+=Le(Be+(ht+.5)*nt);return ft*nt};i$2("math",function(){return e(void 0,void 0,void 0,function(){return n(this,function(Le){return[2,{acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),atan:j(Math.atan,-1,1,97),cos:j(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:j(Math.sin,-Math.PI,Math.PI,97),sinh:j(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:j(Math.tan,0,2*Math.PI,97),tanh:j(Math.tanh,-9/7,7/9,97)}]})})});const version$3="1.95.0",devDependencies={"@fingerprintjs/fingerprintjs-pro":"3.12.3","@thumbmarkjs/thumbmarkjs":"0.20.6"};let fingerprintApiKey;function setFingerprintApiKey(Le){fingerprintApiKey=Le}const FINGERPRINT_PRO_ALGORITHM={algorithmName:"fingerprintjs-pro",algorithmVersion:devDependencies["@fingerprintjs/fingerprintjs-pro"]},THUMBMARK_ALGORITHM={algorithmName:"thumbmarkjs",algorithmVersion:devDependencies["@thumbmarkjs/thumbmarkjs"]};let fingerPrintPromise=null;const FINGERPRINT_STORAGE_KEY="fingerprint_result";let ipPromise=null;async function getIp(){if(ipPromise)return ipPromise;if(AbortSignal.timeout)ipPromise=fetch("https://api.ipify.org?format=json",{signal:AbortSignal.timeout(3e3)}).then(Le=>Le.json()).then(Le=>Le.ip).catch(()=>"");else{const Le=new Promise((Be,Ye)=>{setTimeout(()=>Ye(new Error("Request timeout")),3e3)});ipPromise=Promise.race([fetch("https://api.ipify.org?format=json").then(Be=>Be.json()).then(Be=>Be.ip),Le]).catch(()=>"")}return ipPromise}function getCachedFingerprint(){try{const Le=localStorage.getItem(FINGERPRINT_STORAGE_KEY);return Le?JSON.parse(Le):null}catch{return null}}function setCachedFingerprint(Le){try{localStorage.setItem(FINGERPRINT_STORAGE_KEY,JSON.stringify({visitorId:Le.visitorId}))}catch{}}async function getFingerPrintFromFingerprint(Le){const Be=getCachedFingerprint();return Be?Promise.resolve({visitorId:Be.visitorId,ip:Le?void 0:await getIp(),...FINGERPRINT_PRO_ALGORITHM}):fingerPrintPromise||(fingerPrintPromise=H.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(Ye=>Ye.get({extendedResult:!0})).then(Ye=>(setCachedFingerprint(Ye),{visitorId:Ye.visitorId,ip:Ye.ip,...FINGERPRINT_PRO_ALGORITHM})),fingerPrintPromise)}let thumbprintPromise=null;async function getFingerprintFromThumbprint(Le){return thumbprintPromise||(thumbprintPromise=w$9().then(async Be=>({visitorId:Be,ip:Le?void 0:await getIp(),...THUMBMARK_ALGORITHM})),thumbprintPromise)}async function getFingerprint(Le=!1){return isOfflineMode()?getFingerprintFromThumbprint(!0):getFeatureFlag("new_fingerprint")?getFingerprintFromThumbprint(Le):getFingerPrintFromFingerprint(Le)}const SDK_BUILD_VERSION="1.95.0+8b67f50";class MetadataUtils{async initializeMetadata(Be,Ye=!1){var xt,Et,kt;MlWasmApi.setSdkPlatform("WEBAPP"),MlWasmApi.setSdkVersion(Be||SDK_BUILD_VERSION);const{os:tt,device:nt}=getUAParserResults(),[ft,ht]=await Promise.all([getFingerprint(Ye).catch(()=>({visitorId:"",ip:""})),MlWasmApi.getVersions().catch(()=>null)]),gt={kind:mobile.isDesktop()?"desktop":"mobile",model:`${nt.vendor||""} ${nt.model||""}`.trim(),os:tt.name,osVersion:tt.version,osVer:tt.version,screenDimensions:{width:screen.width,height:screen.height},numTouchPoints:navigator.maxTouchPoints,fingerprintHash:ft.visitorId||"",ip:ft.ip||"",backgroundMode:!1};MlWasmApi.setDeviceInfo(gt);const At={wasmBuild:((xt=ht==null?void 0:ht.versions)==null?void 0:xt.lib)??"",cppApiVersion:((Et=ht==null?void 0:ht.versions)==null?void 0:Et.cpp_api)??"",jsApiVersion:((kt=ht==null?void 0:ht.versions)==null?void 0:kt.js_api)??"",userAgent:navigator.userAgent,getUserMediaAvailability:{webkit:navigator.webkitGetUserMedia!==void 0,moz:navigator.mozGetUserMedia!==void 0,o:navigator.oGetUserMedia!==void 0,ms:navigator.msGetUserMedia!==void 0},webglFingerprint:webgl(),inspectorOpened:!1,isMockedBrowser:isBrowserSimulation()};MlWasmApi.setBrowserInfo(At,!1),FingerprintSignalsReporter$1.start()}updateCameraInfo(Be){const Ye=Be.getSettings(),tt=Be.getCapabilities?Be.getCapabilities():{},nt=Be.label?[Be.label]:[],ht={facingMode:Ye.facingMode==="user"?"frontal":Ye.facingMode==="environment"?"back":Ye.facingMode||"unknown",settings:Ye,capabilities:tt,labels:nt};MlWasmApi.setCameraInfo(ht),FingerprintSignalsReporter$1.markFingerprintDataUpdated()}}class MotionStatusCheck{constructor(Be,Ye,tt,nt,ft,ht,gt,At,xt,Et,kt,Ct){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=10,this.maxFrequency_=60,this.maxPoints_=1200,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.deviceMotionListener=yt=>{if(yt.accelerationIncludingGravity){const vt={x:yt.accelerationIncludingGravity.x,y:yt.accelerationIncludingGravity.y,z:yt.accelerationIncludingGravity.z};this.checkFields(vt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,vt))}if(yt.acceleration){const vt={x:yt.acceleration.x,y:yt.acceleration.y,z:yt.acceleration.z};this.checkFields(vt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,vt))}if(yt.rotationRate){const vt={x:yt.rotationRate.alpha,y:yt.rotationRate.beta,z:yt.rotationRate.gamma};this.checkFields(vt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,vt))}},this.deviceOrientationListener=yt=>{const vt={x:yt.alpha,y:yt.beta,z:yt.gamma};this.checkFields(vt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,vt))},this.accThreshold_=Be,this.gyroThreshold_=Ye,this.accGrOldThreshold_=tt,this.accOldThreshold_=nt,this.gyroscopeOldThreshold_=ft,this.orientationOldThreshold_=ht,this.maeAccThreshold_=gt,this.maeGyroThreshold_=At,this.maeAccGrOldThreshold_=xt,this.maeAccOldThreshold_=Et,this.maeGyroscopeOldThreshold_=kt,this.maeOrientationOldThreshold_=Ct}async requestMotionPermission(){return DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"?(sessionStorage.setItem("motionSensorsPermissionsRequested",String(!0)),DeviceMotionEvent.requestPermission().then(Be=>(Be!=="granted"&&(this.permission_=!1),Be)).catch(console.error)):"granted"}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!this.isRunning_||!this.acl_)return;const Be={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(Be)&&(this.paramsAcc_.ptsNum+=1,this.updateParams(this.paramsAcc_,Be))}updateGyro(){if(!this.isRunning_||!this.gyro_)return;const Be={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(Be)&&(this.paramsGyro_.ptsNum+=1,this.updateParams(this.paramsGyro_,Be))}check(){if(!this.permission_)return"UNCLEAR";const Be=this.checkStability();return Be===null?"UNCLEAR":Be?"FAIL":"PASS"}getDetails(){return{aggregate:this.check(),permissionGranted:this.permission_,hasAccelerometer:this.acl_!==null,hasGyroscope:this.gyro_!==null,isRunning:this.isRunning_}}checkStability(){if(!this.isRunning_)return null;const Ye=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(gt=>gt!==null),tt=Ye.length>0?Ye.every(gt=>gt):null,ft=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(gt=>gt!==null),ht=ft.length>0?ft.every(gt=>gt):null;return tt===null?ht===null?null:ht:ht!==null?tt&&ht:tt}updateParams(Be,Ye){Be.ptsNum>this.maxPoints_&&(this.resetParams(Be),Be.ptsNum=1);const tt=Ye.x-Be.meanX,nt=Ye.y-Be.meanY,ft=Ye.z-Be.meanZ;Be.meanX+=tt/Be.ptsNum,Be.meanY+=nt/Be.ptsNum,Be.meanZ+=ft/Be.ptsNum,Be.m2X+=tt*(Ye.x-Be.meanX),Be.m2Y+=nt*(Ye.y-Be.meanY),Be.m2Z+=ft*(Ye.z-Be.meanZ),Be.cumulativeAbsErrorX+=Math.abs(Ye.x-Be.meanX),Be.cumulativeAbsErrorY+=Math.abs(Ye.y-Be.meanY),Be.cumulativeAbsErrorZ+=Math.abs(Ye.z-Be.meanZ)}resetParams(Be){Be.meanX=0,Be.meanY=0,Be.meanZ=0,Be.m2X=0,Be.m2Y=0,Be.m2Z=0,Be.cumulativeAbsErrorX=0,Be.cumulativeAbsErrorY=0,Be.cumulativeAbsErrorZ=0,Be.ptsNum=0}calculateStd(Be){const Ye={x:Be.m2X/Be.ptsNum,y:Be.m2Y/Be.ptsNum,z:Be.m2Z/Be.ptsNum};return{x:Math.sqrt(Ye.x),y:Math.sqrt(Ye.y),z:Math.sqrt(Ye.z)}}calculateMae(Be){return{x:Be.cumulativeAbsErrorX/Be.ptsNum,y:Be.cumulativeAbsErrorY/Be.ptsNum,z:Be.cumulativeAbsErrorZ/Be.ptsNum}}checkFields(Be){return Be.x!==null&&Be.y!==null&&Be.z!==null}isBelowStdThreshold(Be,Ye){if(Be.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateStd(Be);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}isBelowMaeThreshold(Be,Ye){if(Be.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateMae(Be);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}}class OnboardingAnalytics extends MetadataUtils{constructor(){super(),this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.metadata="",this.onDeviceBarcodeDecoded=!1,this.motionStatusCheck=new MotionStatusCheck(.1,.005,.1,.1,.5,2.5,.1,.005,.1,.1,.5,2.5)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setOnDeviceBarcodeDecoded(Be){this.onDeviceBarcodeDecoded=Be}getOnDeviceBarcodeDecoded(){return this.onDeviceBarcodeDecoded}setSimdIsEnabled(Be){this.simdIsEnabled=Be}setWasmVersion(Be){this.wasmVersion=Be}setProfiles(Be){this.profiles=Be}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getMotionStatusCheck(){return this.motionStatusCheck}getAnalysisStatus(){return this.analysisStatus}getMetadata(){return this.metadata}async analyzeFrame(Be){const Ye=await base64ToImageData(Be);await MlWasmApi.analyzeFrame(Ye)}async startOnboardingCheck(){return this.motionStatusCheck.requestMotionPermission()}async startMotionSensors(Be){this.motionStatusCheck.start();try{await MlWasmApi.rsp(Be),MlWasmApi.ssl(Be)}catch(Ye){appLog.warn("sensors",`startMotionSensors failed ${appLog.describeError(Ye)}`)}}stopMotionSensors(){this.motionStatusCheck.stop()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmApi.estimatePerformance()}update(){if(MlWasmApi.isInitialized())try{const Be=MlWasmApi.getWorkflowState();if(Be!==""){const Ye=JSON.parse(Be);Ye.profiles=Array.from(this.profiles.values()).map(nt=>WasmWorkflowProfileName[nt.name]),Ye.estimatedPerformance=this.estimatedPerformance,Ye.simdIsEnabled=this.simdIsEnabled,Ye.wasmVersion=this.wasmVersion,this.pipelineLogs=Ye;const tt=this.motionStatusCheck.check();this.motionStatus!=="PASS"&&(this.motionStatus=tt),MlWasmApi.setMotionStatus(this.motionStatus),this.analysisStatus=MlWasmApi.getCheck()}this.metadata=MlWasmApi.getMetadata()}catch(Be){console.error(`Exception: ${Be}`)}}}const onboardingAnalytics=OnboardingAnalytics.getInstance(),ENFORCE_KEY="incode_enforce_capture_attempts",BUDGET_KEY="incode_capture_attempt_budget",getEnforceStorageKey=Le=>`${ENFORCE_KEY}_${Le}`,getBudgetStorageKey=(Le,Be)=>`${BUDGET_KEY}_${Le}_${Be}`,readBudget=(Le,Be)=>{try{const Ye=sessionStorage.getItem(getBudgetStorageKey(Le,Be));if(Ye){const tt=JSON.parse(Ye);if(tt&&typeof tt=="object")return{used:typeof tt.used=="number"&&tt.used>0?tt.used:0,max:typeof tt.max=="number"?tt.max:null,remaining:typeof tt.remaining=="number"?Math.max(0,tt.remaining):null}}}catch{}return{used:0,max:null,remaining:null}},writeBudget=(Le,Be,Ye)=>{try{sessionStorage.setItem(getBudgetStorageKey(Le,Be),JSON.stringify(Ye))}catch{}},recordEnforceCaptureAttemptLimits=(Le,Be)=>{if(!(!Le||typeof Be!="boolean"))try{sessionStorage.setItem(getEnforceStorageKey(Le),Be?"1":"0")}catch{}},isCaptureAttemptEnforcementEnabled=Le=>{if(!Le)return!1;try{return sessionStorage.getItem(getEnforceStorageKey(Le))==="1"}catch{return!1}},recordCaptureAttempt=(Le,Be)=>{if(!isCaptureAttemptEnforcementEnabled(Le))return;const Ye=readBudget(Le,Be);writeBudget(Le,Be,{...Ye,used:Ye.used+1,remaining:Ye.remaining===null?null:Math.max(0,Ye.remaining-1)})},applyBackendAttemptsLimit=(Le,Be,Ye)=>{if(!Le||!Ye||typeof Ye!="object"||typeof Ye.max!="number"&&typeof Ye.remaining!="number")return;const tt=readBudget(Le,Be);writeBudget(Le,Be,{used:tt.used,max:typeof Ye.max=="number"?Ye.max:tt.max,remaining:typeof Ye.remaining=="number"?Math.max(0,Ye.remaining):tt.remaining})},getEnforcedAttemptsLeft=(Le,Be,Ye)=>{if(!isCaptureAttemptEnforcementEnabled(Le))return null;const tt=readBudget(Le,Be);if(tt.remaining!==null)return tt.remaining;const nt=tt.max??Ye;return!Number.isFinite(nt)||nt<=0?null:Math.max(0,nt-tt.used)},defaultFlow$1={name:"",checkTutorials:!0,checkAuthorization:!0,redirectDesktopToMobile:!1,disableUnsupportedBrowserScreen:!1,qrPhishingResistance:!1,addContinueToDesktop:!1,redirectOriginOnly:!1,displayOnboardingResultOnDesktop:!1,enableMultipleOnboardings:!1,disableLaunchScreen:!1,disableSmsOption:!1,mergeSessionRecordings:!1,mandatoryConsentCheck:!0,enableSardineRisk:!1,flowModules:[{key:"PHONE",configuration:{otpVerification:!1,otpExpirationInMinutes:10,prefill:!1}},{key:"GEOLOCATION",configuration:{allowUserToSkipGeolocation:!1}},{key:"ID",configuration:{showTutorial:!0,enableId:!0,enablePassport:!0,onlyFront:!1,onlyBack:!1,barcodeCapture:!1,fetchAdditionalPage:!1,secondId:!1,autoCaptureTimeout:18,deviceIdleTimeout:60,captureAttempts:3,manualUploadIdCapture:!1,deviceWallet:!1,digiLocker:!1,showDocumentChooserScreen:!0,enableIdRecording:!0,perCountryPerDocOverrides:{}}},{key:"ADDRESS",configuration:{disableSkipPoa:!1,title:"",text:""}},{key:"ID_OCR",configuration:{editableOcr:!1}},{key:"SELFIE",configuration:{showTutorial:!0,showPreview:!1,assistedOnboarding:!1,enableFaceRecording:!0,autoCaptureTimeout:20,captureAttempts:3,validateLenses:!0,validateFaceMask:!0,validateHeadCover:!0,validateClosedEyes:!0,validateBrightness:!0,deepsightLiveness:"SINGLE_FRAME"}},{key:"FACE_MATCH",configuration:{matchingType:"selfieVsId",disableFaceMatchAnimation:!1}},{key:"SIGNATURE",configuration:{title:"",subTitle:""}},{key:"VIDEO_ONBOARDING",configuration:{useAsSelfie:!1,showTutorials:!0,companyName:"",checkLiveness:!0,checkIdScan:!0,checkDocumentScan:!0,compareIdEnabled:!0,compareOcrEnabled:!1,compareBackIdEnabled:!1,compareBackOcrEnabled:!1,checkVoiceConsent:!0,voiceConsentQuestions:0,selfieQualityAffectsScore:!1,maxWaitingVideoSelfieFile:0,lastSecondsVideoQualityCheck:!1,lastSecondsVideoQualityCheckDuration:0}}]};function normalizeFlowModules(Le){const Be=Le.flatMap((ft,ht,gt)=>{if(ft.key==="TUTORIAL_ID"){const xt=ft.configuration,kt=[{key:"ID",configuration:xt}];return xt.secondId&&kt.push({key:"SECOND_ID",configuration:xt}),kt}const At=gt[ht-1];return ft.key==="ID"&&(At==null?void 0:At.key)==="TUTORIAL_ID"?[]:[ft]}),Ye=ft=>ft,tt=ft=>ft.filter(ht=>ht.key!=="SELFIE");return(Be.some(ft=>ft.key==="VIDEO_ONBOARDING"&&ft.configuration.useAsSelfie===!0)?tt:Ye)(Be)}function handleResponse(Le){const Be=Le.data,Ye=normalizeFlowModules(Be.flowModules);return{...Be,flowModules:Ye}}async function getFlow$1(Le){var Be,Ye;try{const tt=await api.get("/omni/onboarding/flow",{headers:{"X-Incode-Hardware-Id":Le}});return recordEnforceCaptureAttemptLimits(Le,(Be=tt.data)==null?void 0:Be.enforceCaptureAttemptLimits),handleResponse(tt)}catch(tt){if(tt instanceof WebClientError&&((Ye=tt.response)==null?void 0:Ye.status)===400)return defaultFlow$1;throw tt}}const PERMISSION_ERROR_CODES={DENIED:"PERMISSION_DENIED",REFRESH:"PERMISSION_REFRESH"},PERMISSION_ERROR_MESSAGE="Error in permissions",createPermissionError=Le=>({code:Le,message:PERMISSION_ERROR_MESSAGE,error:new Error(Le)});var FlowType=(Le=>(Le.ID="ID",Le.FACE="Face",Le))(FlowType||{});function getErrorStatusCode(Le){var tt;if(Le instanceof WebClientError)return Le.statusCode;const Be=Le,Ye=(Be==null?void 0:Be.statusCode)??((tt=Be==null?void 0:Be.response)==null?void 0:tt.status)??(Be==null?void 0:Be.status);return typeof Ye=="number"?Ye:void 0}function toError(Le,Be){return Le instanceof Error?Le:new Error(Be)}function createFlowInitializationError(Le){const Be=getErrorStatusCode(Le);if(Be===401){const tt="Session expired";return{code:"SESSION_EXPIRED",type:"SESSION_EXPIRED",message:tt,statusCode:Be,error:new Error(tt)}}const Ye="Failed to initialize FlowManager";return{code:"FETCH_FLOW_ERROR",type:"FETCH_FLOW_ERROR",message:Ye,statusCode:Be,error:toError(Le,Ye)}}class AbstractFlowManager{constructor(Be){this.subscribers=[],this.flow=null,this.sessionToken=null,this.captureConfig=null,this.captureConfiguration=null,this.parentSize={width:window.innerWidth,height:window.innerHeight},this.uiConfig=null;const Ye={currentStep:null,isLoading:!1,attempts:0,errorDetails:null,successData:null,flowOutcome:"pending",sessionToken:null,...Be};this.initialState=Object.freeze({...Ye}),this.state={...this.initialState}}async isPermissionsEnabled(){if(!navigator.permissions)return appLog.info("flow","permissions: navigator.permissions unavailable"),!1;try{const Be=await navigator.permissions.query({name:"camera"});return appLog.info("flow",`permissions: camera state=${Be.state}`),Be.state==="granted"}catch(Be){return appLog.warn("flow",`permissions.query threw ${appLog.describeError(Be)}`),!1}}subscribe(Be){return this.subscribers.push(Be),Be(this.getState()),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Be)}}notifySubscribers(){const Be=this.getState();this.subscribers.forEach(Ye=>Ye(Be))}setState(Be){this.state={...this.state,...Be},this.notifySubscribers()}getState(){return{...this.state}}getToken(){return this.sessionToken}getParentSize(){return this.parentSize}incrementAttempts(){this.setState({attempts:this.state.attempts+1})}resetAttempts(){this.setState({attempts:0})}canRetry(){const Be=this.getEnforcedAttemptsLeft();return Be!==null?Be>0:this.state.attempts<this.getMaxAttempts()}getAttemptsLeft(){const Be=this.getEnforcedAttemptsLeft();return Be!==null?Be:Math.max(0,this.getMaxAttempts()-this.state.attempts)}getAttemptBudgetKind(){return null}getEnforcedAttemptsLeft(){const Be=this.getAttemptBudgetKind();return!Be||!this.sessionToken?null:getEnforcedAttemptsLeft(this.sessionToken,Be,this.getMaxAttempts())}async initialize(Be){var tt,nt;if(this.setState({isLoading:!0,errorDetails:null,flowOutcome:"pending",attempts:0,successData:null,sessionToken:Be.sessionToken}),this.parentSize=(tt=Be.parentSize)!=null&&tt.width&&((nt=Be.parentSize)!=null&&nt.height)?Be.parentSize:this.parentSize,this.sessionToken=Be.sessionToken,this.sessionToken&&Be.uiConfig&&(this.uiConfig=Be.uiConfig??null),Be.captureConfig)appLog.info("flow","init config source=captureConfig"),this.captureConfig=Be.captureConfig;else if(Be.flow)appLog.info("flow","init config source=flow"),this.flow=Be.flow,recordEnforceCaptureAttemptLimits(Be.sessionToken,Be.flow.enforceCaptureAttemptLimits);else{appLog.info("flow","init config source=fetch");try{this.flow=await this.fetchFlowConfiguration(this.sessionToken)}catch(ft){appLog.error("flow",`fetchFlow failed ${appLog.describeError(ft)}`);const ht=createFlowInitializationError(ft);this.setState({errorDetails:ht,isLoading:!1,flowOutcome:"error",currentStep:"error"});return}}this.captureConfiguration=this.getCaptureConfiguration(),appLog.info("flow","determine initial step");const Ye=await this.determineInitialStep(this.captureConfiguration);appLog.info("flow",`initial step=${String(Ye)}`),this.setState({currentStep:Ye,isLoading:!1})}reset(){this.state={...this.initialState},this.flow=null,this.sessionToken=null,this.captureConfiguration=null,this.captureConfig=null,this.setState(this.state)}fetchFlowConfiguration(Be){return getFlow$1(Be)}getFlow(){return this.flow}onClose(Be){const Ye=Be==="ID"?"errors.userCancelledIdFlow":"errors.userCancelledFaceFlow";onboardingAnalytics.update(),MlWasmApi.pseInFlight||MlWasmApi.reset(),this.completeWithError({code:"USER_CANCELLED",message:i18n.t(Ye),error:new Error("User cancelled")})}}const getCustomFields=({token:Le})=>api.get("/omni/get/custom-fields",{headers:{"X-Incode-Hardware-Id":Le}}).then(Be=>Be.data).catch(Be=>{var Ye;return Promise.reject(((Ye=Be==null?void 0:Be.response)==null?void 0:Ye.data)??Be)}),getDeviceRiskModuleConfiguration=async Le=>api.get("/omni/device-risk-client-id",{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data).catch(()=>({enabled:!1})),collectDeviceRiskResults=async Le=>api.post("/omni/collect-device-risk-results",null,{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data).catch(()=>({})),shouldDoSardineContextFromSardine=Le=>Le===void 0?!1:typeof Le.SardineClientID=="string"&&typeof Le.SardineSessionKey=="string"&&typeof Le.SardineUserID=="string",loadSardineSDK=async Le=>{const Be=Le?"api.sandbox.sardine.ai":"api.sardine.ai",Ye=document.createElement("script");return Ye.type="text/javascript",Ye.async=!0,Ye.src=`https://${Be}/assets/loader.min.js`,new Promise(tt=>{Ye.onload=()=>tt();const nt=document.getElementsByTagName("script")[0];nt.parentNode.insertBefore(Ye,nt)})};let sardineContext=null;const getSardineContext=()=>sardineContext,createSardineContextFromSardine=({sardineClientId:Le,sardineSessionKey:Be,sardineUserId:Ye,isSandbox:tt,token:nt,interviewId:ft})=>window._Sardine.createContext({clientId:Le,sessionKey:ft,flow:`Landing page ${location.pathname}`,environment:tt?"sandbox":"production",parentElement:document.body,parentSessionKey:Be,userIdHash:Ye,onDeviceResponse(ht){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:ht.deviceId,uuid:ht.uuid},interviewId:ft,sardineClientId:Le,sardineSessionKey:Be,sardineUserId:Ye},token:nt})}}),createSardineContextIncode=({sardineClientId:Le,isSandbox:Be,token:Ye,interviewId:tt})=>window._Sardine.createContext({clientId:Le,sessionKey:tt,flow:`Landing page ${location.pathname}`,environment:"production",parentElement:document.body,userIdHash:tt,onDeviceResponse(nt){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:nt.deviceId,uuid:nt.uuid},interviewId:tt,sardineClientId:Le},token:Ye})}}),enableDeviceRiskModule=async({token:Le,isSandbox:Be=!0,interviewId:Ye})=>{if(isOfflineMode())return null;const{customFields:tt}=await getCustomFields({token:Le}).catch(()=>({customFields:{SardineClientID:void 0,SardineSessionKey:void 0,SardineUserID:void 0}}));shouldDoSardineContextFromSardine(tt)&&(await loadSardineSDK(Be),sardineContext=createSardineContextFromSardine({sardineClientId:tt.SardineClientID,sardineSessionKey:tt.SardineSessionKey,sardineUserId:tt.SardineUserID,isSandbox:Be,token:Le,interviewId:Ye}));const nt=await getDeviceRiskModuleConfiguration(Le);return nt.enabled&&nt.riskClientId&&(await loadSardineSDK(!1),sardineContext=createSardineContextIncode({sardineClientId:nt.riskClientId,isSandbox:!1,token:Le,interviewId:Ye})),sardineContext},eventModuleNames={selfie:"SELFIE",authFace:"AUTH_FACE",mlConsent:"ML_CONSENT",combinedConsent:"COMBINED_CONSENT",privacyConsent:"PRIVACY_CONSENT",curpValidation:"CURP_VALIDATION",faceMatch:"FACE_MATCH",qr:"QR",videoSelfie:"VIDEO_ONBOARDING",passport:"ID",front:"ID",back:"ID",idOcr:"ID_OCR",document:"DOCUMENT_CAPTURE",creditCard:"CREDIT_CARD_FRONT",creditCardBack:"CREDIT_CARD_BACK",conference:"CONFERENCE",otp:"OTP",signature:"SIGNATURE",ekyc:"EXTERNAL_VERIFICATION",payments:"PAYMENTS",globalWatchList:"GLOBAL_WATCHLIST",customWatchList:"CUSTOM_WATCHLIST",email:"EMAIL",phone:"PHONE",instantVerifyEmail:"INSTANT_VERIFY_EMAIL",instantVerifyConsent:"INSTANT_VERIFY_CONSENT",forms:"FORMS",customModule:"CUSTOM_MODULE",mDocWallet:"MDOC_WALLET"},eventScreenNames={idOcrLoading:"ID_OCR.loading",idOcrInputting:"ID_OCR.inputting",idOcrSubmitting:"ID_OCR.submitting",idOcrError:"ID_OCR.error",faceMatch:"FACE_MATCH",faceCaptureTutorial:"SELFIE_CAPTURE_TUTORIAL",faceCaptureCamera:"SELFIE_CAMERA_CAPTURE",faceCaptureError:"SELFIE_ATTEMPT_FAILED",faceCaptureSuccess:"SELFIE_UPLOAD_SUCCEEDED",faceCaptureUpload:"SELFIE_UPLOAD_PROGRESS",mlConsent:"MACHINE_LEARNING_CONSENT",combinedConsent:"COMBINED_CONSENT",curpEnter:"ENTER_CURP",curpValidate:"VALIDATE_CURP",curpGenerate:"GENERATE_CURP",curpValidation:"CURP_VALIDATION_PROGRESS",curpValidationFailed:"CURP_VALIDATION_FAILED",curpValidationSuccess:"CURP_VALIDATION_SUCCEEDED",qrTutorial:"QR_TUTORIAL",qrScan:"QR_SCAN",smsOtp:"OTP",simpleOTP:"OTP",signatureInput:"SIGNATURE_INPUT",frontTutorial:"FRONT_ID_CAPTURE_TUTORIAL",frontCameraCapture:"FRONT_ID_CAMERA_CAPTURE",frontHelp:"FRONT_ID_HELP",frontReviewPhoto:"FRONT_ID_REVIEW_PHOTO",frontUploadProgress:"FRONT_ID_UPLOAD_PROGRESS",frontAttemptFailed:"FRONT_ID_ATTEMPT_FAILED",frontUploadSuccess:"FRONT_ID_UPLOAD_SUCCEEDED",backTutorial:"BACK_ID_CAPTURE_TUTORIAL",backCameraCapture:"BACK_ID_CAMERA_CAPTURE",backReviewPhoto:"BACK_ID_REVIEW_PHOTO",backUploadProgress:"BACK_ID_UPLOAD_PROGRESS",backAttemptFailed:"BACK_ID_ATTEMPT_FAILED",backUploadSuccess:"BACK_ID_UPLOAD_SUCCEEDED",backHelp:"BACK_ID_HELP",passportTutorial:"TUTORIAL_PASSPORT",passportCameraCapture:"PASSPORT_CAMERA_CAPTURE",passportReviewPhoto:"PASSPORT_REVIEW_PHOTO",passportUploadProgress:"PASSPORT_UPLOAD_PROGRESS",passportUploadSuccess:"PASSPORT_UPLOAD_SUCCEEDED",passportAttemptFailed:"PASSPORT_ATTEMPT_FAILED",passportHelp:"PASSPORT_HELP",passportIdError:"PASSPORT_ERROR",passportManualCapture:"PASSPORT_MANUAL_CAPTURE",passportNoAttemptsLeft:"PASSPORT_NO_ATTEMPTS_LEFT",frontIdError:"FRONT_ID_ERROR",backIdError:"BACK_ID_ERROR",frontIdNoAttemptsLeft:"FRONT_ID_NO_ATTEMPTS_LEFT",backIdNoAttemptsLeft:"BACK_ID_NO_ATTEMPTS_LEFT",frontIdManualCapture:"FRONT_ID_MANUAL_CAPTURE",backIdManualCapture:"BACK_ID_MANUAL_CAPTURE",selfieManualCapture:"SELFIE_MANUAL_CAPTURE",selfieNoAttemptsLeft:"SELFIE_NO_ATTEMPTS_LEFT",idCameraDeviceChooser:"ID_CAMERA_DEVICE_CHOOSER",idCameraPermissionSlider:"ID_CAMERA_PERMISSION_SLIDER",idCameraPermissionAllow:"ID_CAMERA_PERMISSION_ALLOW",idCameraPermissionRequesting:"ID_CAMERA_PERMISSION_REQUESTING",idCameraPermissionDenied:"ID_CAMERA_PERMISSION_DENIED",idCameraPermissionInstructions:"ID_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionAllow:"SELFIE_CAMERA_PERMISSION_ALLOW",selfieCameraPermissionRequesting:"SELFIE_CAMERA_PERMISSION_REQUESTING",selfieCameraPermissionDenied:"SELFIE_CAMERA_PERMISSION_DENIED",selfieCameraPermissionInstructions:"SELFIE_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionSlider:"SELFIE_CAMERA_PERMISSION_SLIDER",selfieNoConnection:"SELFIE_NO_CONNECTION",documentTutorial:"DOCUMENT_CAPTURE_TUTORIAL",documentManualCapture:"DOCUMENT_MANUAL_CAPTURE",documentNoAttemptsLeft:"DOCUMENT_NO_ATTEMPTS_LEFT",documentCameraCapture:"DOCUMENT_CAMERA_CAPTURE",documentHelp:"DOCUMENT_HELP",documentReviewPhoto:"DOCUMENT_REVIEW_PHOTO",documentUploadProgress:"DOCUMENT_UPLOAD_IN_PROGRESS",documentAttemptFailed:"DOCUMENT_ATTEMPT_FAILED",documentUploadSuccess:"DOCUMENT_UPLOAD_SUCCEEDED",conferenceWait:"CONFERENCE_WAIT",conferenceVideoChat:"CONFERENCE_VIDEO_CHAT",conferenceMessageChat:"CONFERENCE_MESSAGE_CHAT",videoSelfieTutorial:"VIDEO_SELFIE_TUTORIAL",videoSelfie:"VIDEO_SELFIE",videoSelfieFaceCapture:"VIDEO_SELFIE_FACE_CAPTURE",videoSelfieFaceUploadProgress:"VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",videoSelfieFaceAttemptFailed:"VIDEO_SELFIE_FACE_ATTEMPT_FAILED",videoSelfieFaceUploadSucceeded:"VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",videoSelfieFrontIdCapture:"VIDEO_SELFIE_FRONT_ID_CAPTURE",videoSelfieFrontIdUploadProgress:"VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",videoSelfieFrontIdAttemptFailed:"VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",videoSelfieFrontIdUploadSucceeded:"VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",videoSelfieBackIdCapture:"VIDEO_SELFIE_BACK_ID_CAPTURE",videoSelfieBackIdUploadProgress:"VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",videoSelfieBackIdAttemptFailed:"VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",videoSelfieBackIdUploadSucceeded:"VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",videoSelfieDocumentCapture:"VIDEO_SELFIE_DOCUMENT_CAPTURE",videoSelfieVoiceQuestion:"VIDEO_SELFIE_VOICE_QUESTION",videoSelfieVoiceFinalQuestion:"VIDEO_SELFIE_VOICE_FINAL_QUESTION",videoSelfieVideoUpload:"VIDEO SELFIE VIDEO UPLOAD",ekycInput:"EKYC_INPUT",ekycProgress:"EKYC_PROGRESS",ekycSucceeded:"EKYC_SUCCEEDED",ekycFailed:"EKYC_FAILED",paymentsInput:"PAYMENTS_INPUT",paymentsProgress:"PAYMENTS_PROGRESS",paymentsSucceeded:"PAYMENTS_SUCCEEDED",paymentsFailed:"PAYMENTS_FAILED",forms:"FORMS",globalWatchListInput:"GLOBAL_WATCHLIST_INPUT",globalWatchListProgress:"GLOBAL_WATCHLIST_PROGRESS",globalWatchListSuccess:"GLOBAL_WATCHLIST_SUCCEEDED",globalWatchListFailed:"GLOBAL_WATCHLIST_FAILED",customWatchListInput:"CUSTOM_WATCHLIST_INPUT",customWatchListProgress:"CUSTOM_WATCHLIST_PROGRESS",customWatchListSuccess:"CUSTOM_WATCHLIST_SUCCEEDED",customWatchListFailed:"CUSTOM_WATCHLIST_FAILED",emailInput:"EMAIL_INPUT",phoneInput:"PHONE_INPUT",instantVerify:"INSTANT_VERIFY",authFace:"AUTH_FACE",authFaceError:"AUTH_FACE_ATTEMPT_FAILED",authFaceUpload:"AUTH_FACE_UPLOAD_PROGRESS",authFaceUploadSuccess:"AUTH_FACE_UPLOAD_SUCCEEDED",authFaceUploadFailed:"AUTH_FACE_UPLOAD_FAILED",customModuleCallback:"CUSTOM_MODULE_CALLBACK",customModuleProcessing:"CUSTOM_MODULE_PROCESSING",digitalIdFileSelection:"DIGITAL_ID_FILE_SELECTION",digitalIdFileReview:"DIGITAL_ID_FILE_REVIEW",digitalIdUploadProgress:"DIGITAL_ID_UPLOAD_PROGRESS",digitalIdUploadSuccess:"DIGITAL_ID_UPLOAD_SUCCEEDED",digitalIdUploadFailed:"DIGITAL_ID_UPLOAD_FAILED",digitalIdAnalysisProgress:"DIGITAL_ID_ANALYSIS_PROGRESS",digitalIdVerificationSuccess:"DIGITAL_ID_VERIFICATION_SUCCESS",digitalIdVerificationFailed:"DIGITAL_ID_VERIFICATION_FAILED",documentChooser:"DOCUMENT_CHOOSER",landingPage:"LANDING_PAGE",privacyConsent:"PRIVACY_CONSENT",mDocWalletError:"MDOC_WALLET_ERROR"},streamingEvents={strSessionDidConnect:"strSessionDidConnect",strSessionDidDisconnect:"strSessionDidDisconnect",strSessionDidFailWithError:"strSessionDidFailWithError",strStreamVideoCaptureStart:"strStreamVideoCaptureStart",strStreamVideoCaptureStop:"strStreamVideoCaptureStop",strStreamPublisherCreated:"strStreamPublisherCreated",strStreamPublisherDestroyed:"strStreamPublisherDestroyed",strStreamPublisherDidFailWithError:"strStreamPublisherDidFailWithError"},videoSelfieEvents={imageTooBlurry:"imageTooBlurry",fillFrame:"fillFrame",checkCameraOrLighting:"checkCameraOrLighting",frontIdCaptureStarted:"frontIdCaptureStarted",lookAtCamera:"lookAtCamera",moveCloser:"moveCloser",lookingForFrontId:"lookingForFrontId",lookingForBackId:"lookingForBackId",cameraSwitchToBack:"cameraSwitchToBack",cameraSwitchToFront:"cameraSwitchToFront",audioStreamOpened:"audioStreamOpened",audioStreamClosed:"audioStreamClosed",videoSelfieVideoUploadInProgress:"videoSelfieVideoUploadInProgress",videoSelfieTosNotAccepted:"videoSelfieTosNotAccepted",videoSelfieTosAccepted:"videoSelfieTosAccepted",videoSelfieStreamCreated:"videoSelfieStreamCreated",videoSelfieStreamDestroyed:"videoSelfieStreamDestroyed",videoSelfieReconnecting:"videoSelfieReconnecting",videoSelfieReconnected:"videoSelfieReconnected"},tutorialScreenNamesMapper={passport:eventScreenNames.passportTutorial,front:eventScreenNames.frontTutorial,back:eventScreenNames.backTutorial,selfie:eventScreenNames.faceCaptureTutorial},cameraScreenNamesMapper={front:"front",back:"back",passport:"passport",creditCard:"front",creditCardBack:"back",document:"document"};function screenEvent({module:Le,payload:Be,token:Ye,screen:tt,code:nt}){try{addEvent({token:Ye,module:Le,code:nt,screen:tt,clientTimestamp:new Date().getTime(),payload:{...Be??{}}})}catch(ft){console.error(ft)}}function updateSardineConfigOnScreenChange(Le,Be){const Ye=getSardineContext(),tt=Be?`${Le} - ${Be}`:Le;Ye&&Ye.updateConfig({flow:tt})}function useScreenEvents({module:Le,screen:Be,payload:Ye={},token:tt}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Le,Be),screenEvent({module:Le,payload:Ye,code:"screenOpened",token:tt,screen:Be}),()=>{screenEvent({module:Le,payload:Ye,code:"screenClosed",token:tt,screen:Be}),updateSardineConfigOnScreenChange(Le)}),[])}function useScreenTransitionEvents({module:Le,screen:Be,token:Ye}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Le,Be),screenEvent({module:Le,screen:Be,code:"screenOpened",token:Ye}),()=>{screenEvent({module:Le,screen:Be,code:"screenClosed",token:Ye}),updateSardineConfigOnScreenChange(Le)}),[Le,Be,Ye])}function useModuleEvents({module:Le,payload:Be={},token:Ye,screen:tt,includeAppLogs:nt}){React.useLayoutEffect(()=>{const ft=async()=>{const ht=await getModuleFeatureFlags(Le);screenEvent({module:Le,screen:tt,payload:{...Be,...ht},code:"moduleOpened",token:Ye})};return updateSardineConfigOnScreenChange(Le,tt),ft(),()=>{const ht=async()=>{const gt=await getModuleFeatureFlags(Le);screenEvent({module:Le,payload:{...Be,...gt,...nt?{appLogs:appLog.getAppLogs()}:{}},screen:tt,code:"moduleClosed",token:Ye})};setTimeout(()=>{ht()},0)}},[])}const addScreenEvent=({module:Le,token:Be,screen:Ye,payload:tt,shouldOpen:nt,sardineScreen:ft})=>{nt&&updateSardineConfigOnScreenChange(Le,ft??Ye),screenEvent({module:Le,payload:tt,token:Be,screen:Ye,code:nt?"screenOpened":"screenClosed"})};function getIdCaptureReviewScreen(Le){return Le==="front"?eventScreenNames.frontReviewPhoto:Le==="back"?eventScreenNames.backReviewPhoto:eventScreenNames.passportReviewPhoto}function getIdCaptureNoAttemptsScreen(Le){return Le==="front"?eventScreenNames.frontIdNoAttemptsLeft:Le==="back"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.passportNoAttemptsLeft}function getIdCaptureManualScreen(Le){return Le==="front"?eventScreenNames.frontIdManualCapture:Le==="back"?eventScreenNames.backIdManualCapture:eventScreenNames.passportManualCapture}function getCaptureIdReviewScreen(Le){return Le==="document"?eventScreenNames.documentReviewPhoto:getIdCaptureReviewScreen(Le)}function getCaptureIdManualScreen(Le){return Le==="document"?eventScreenNames.documentManualCapture:getIdCaptureManualScreen(Le)}function getCaptureIdNoAttemptsScreen(Le){return Le==="document"?eventScreenNames.documentNoAttemptsLeft:getIdCaptureNoAttemptsScreen(Le)}function getCaptureIdErrorScreen(Le){return Le==="document"?eventScreenNames.documentAttemptFailed:Le==="front"?eventScreenNames.frontIdError:Le==="back"?eventScreenNames.backIdError:Le==="passport"?eventScreenNames.passportIdError:eventScreenNames.frontIdError}function getIdV2SardineScreen(Le,Be){return Le==="passport"?Be==="uploading"?eventScreenNames.passportUploadProgress:Be==="success"?eventScreenNames.passportUploadSuccess:Be==="error"?eventScreenNames.passportIdError:Be==="manual"?eventScreenNames.passportManualCapture:Be==="noAttempts"?eventScreenNames.passportNoAttemptsLeft:eventScreenNames.passportCameraCapture:Le==="back"?Be==="uploading"?eventScreenNames.backUploadProgress:Be==="success"?eventScreenNames.backUploadSuccess:Be==="error"?eventScreenNames.backIdError:Be==="manual"?eventScreenNames.backIdManualCapture:Be==="noAttempts"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.backCameraCapture:Be==="uploading"?eventScreenNames.frontUploadProgress:Be==="success"?eventScreenNames.frontUploadSuccess:Be==="error"?eventScreenNames.frontIdError:Be==="manual"?eventScreenNames.frontIdManualCapture:Be==="noAttempts"?eventScreenNames.frontIdNoAttemptsLeft:eventScreenNames.frontCameraCapture}const FlowPage=({uiConfig:Le,onClose:Be,onCloseCancel:Ye,hideFooterBranding:tt,hideHeaderBranding:nt,...ft})=>{var At,xt,Et,kt,Ct,yt,vt,bt,wt,It,Tt,_t,Bt,Pt;const ht=!!((At=Le==null?void 0:Le.closeButton)!=null&&At.show),gt=!!((Et=(xt=Le==null?void 0:Le.branding)==null?void 0:xt.logo)!=null&&Et.src||(Ct=(kt=Le==null?void 0:Le.branding)==null?void 0:kt.logo)!=null&&Ct.height);return jsxRuntimeExports.jsx(Page$1,{closeButton:{onClose:Be,show:ht,position:(yt=Le==null?void 0:Le.closeButton)==null?void 0:yt.position,offset:(vt=Le==null?void 0:Le.closeButton)==null?void 0:vt.offset,color:(bt=Le==null?void 0:Le.closeButton)==null?void 0:bt.color,onCancel:Ye},...gt?{logo:{src:(It=(wt=Le==null?void 0:Le.branding)==null?void 0:wt.logo)==null?void 0:It.src,height:(_t=(Tt=Le==null?void 0:Le.branding)==null?void 0:Tt.logo)==null?void 0:_t.height}}:{},hideFooterBranding:tt||((Bt=Le==null?void 0:Le.branding)==null?void 0:Bt.hideFooterBranding),hideHeaderBranding:nt||((Pt=Le==null?void 0:Le.branding)==null?void 0:Pt.hideHeaderBranding),...ft})},breakpoints$1={xs:"568px",sm:"667px",md:"812px",lg:"926px"},ArrowRightIcon=({width:Le=13,height:Be=14})=>{const tt=useTokens().color.text.body.primary;return jsxRuntimeExports.jsx("svg",{width:Le,height:Be,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntimeExports.jsx("path",{d:"M0 8.08009V5.92009H9.198L4.698 1.87009L6.228 0.340088L12.6 6.28009V7.70209L6.228 13.6601L4.698 12.1301L9.198 8.08009H0Z",fill:tt})})},arrowEl=jsxRuntimeExports.jsx(ArrowRightIcon,{}),BoldWithArrow=({i18nKey:Le})=>{const Be=useTokens();return jsxRuntimeExports.jsx(Flex$1,{as:"span",inline:!0,gap:"0.3em",forceGap:!0,align:"center",fontWeight:700,whiteSpace:"nowrap",color:Be.color.text.body.primary,children:jsxRuntimeExports.jsx(Trans,{i18nKey:Le,components:{arrow:arrowEl}})})},spin=mt`
|
|
2529
2529
|
from {
|
|
2530
2530
|
transform: rotate(0deg);
|
|
2531
2531
|
}
|
|
@@ -10059,7 +10059,7 @@ Event: ${getEventDescription(Le)}`),!0;if(_isDeniedUrl(Le,Be.denyUrls))return DE
|
|
|
10059
10059
|
Event: ${getEventDescription(Le)}.
|
|
10060
10060
|
Url: ${_getEventFilterUrl(Le)}`),!0;if(!_isAllowedUrl(Le,Be.allowUrls))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
10061
10061
|
Event: ${getEventDescription(Le)}.
|
|
10062
|
-
Url: ${_getEventFilterUrl(Le)}`),!0}return!1}function _isIgnoredError(Le,Be){return Be!=null&&Be.length?getPossibleEventMessages(Le).some(Ye=>stringMatchesSomePattern(Ye,Be)):!1}function _isIgnoredTransaction(Le,Be){if(!(Be!=null&&Be.length))return!1;const Ye=Le.transaction;return Ye?stringMatchesSomePattern(Ye,Be):!1}function _isDeniedUrl(Le,Be){if(!(Be!=null&&Be.length))return!1;const Ye=_getEventFilterUrl(Le);return Ye?stringMatchesSomePattern(Ye,Be):!1}function _isAllowedUrl(Le,Be){if(!(Be!=null&&Be.length))return!0;const Ye=_getEventFilterUrl(Le);return Ye?stringMatchesSomePattern(Ye,Be):!0}function _getLastValidUrl(Le=[]){for(let Be=Le.length-1;Be>=0;Be--){const Ye=Le[Be];if(Ye&&Ye.filename!=="<anonymous>"&&Ye.filename!=="[native code]")return Ye.filename||null}return null}function _getEventFilterUrl(Le){var Be,Ye;try{const tt=[...((Be=Le.exception)==null?void 0:Be.values)??[]].reverse().find(ft=>{var ht,gt,At;return((ht=ft.mechanism)==null?void 0:ht.parent_id)===void 0&&((At=(gt=ft.stacktrace)==null?void 0:gt.frames)==null?void 0:At.length)}),nt=(Ye=tt==null?void 0:tt.stacktrace)==null?void 0:Ye.frames;return nt?_getLastValidUrl(nt):null}catch{return DEBUG_BUILD$2&&debug.error(`Cannot extract url for event ${getEventDescription(Le)}`),null}}function _isUselessError(Le){var Be,Ye;return(Ye=(Be=Le.exception)==null?void 0:Be.values)!=null&&Ye.length?!Le.message&&!Le.exception.values.some(tt=>tt.stacktrace||tt.type&&tt.type!=="Error"||tt.value):!1}function applyAggregateErrorsToEvent(Le,Be,Ye,tt,nt,ft){var gt;if(!((gt=nt.exception)!=null&>.values)||!ft||!isInstanceOf(ft.originalException,Error))return;const ht=nt.exception.values.length>0?nt.exception.values[nt.exception.values.length-1]:void 0;ht&&(nt.exception.values=aggregateExceptionsFromError(Le,Be,tt,ft.originalException,Ye,nt.exception.values,ht,0))}function aggregateExceptionsFromError(Le,Be,Ye,tt,nt,ft,ht,gt){if(ft.length>=Ye+1)return ft;let At=[...ft];if(isInstanceOf(tt[nt],Error)){applyExceptionGroupFieldsForParentException(ht,gt);const xt=Le(Be,tt[nt]),Et=At.length;applyExceptionGroupFieldsForChildException(xt,nt,Et,gt),At=aggregateExceptionsFromError(Le,Be,Ye,tt[nt],nt,[xt,...At],xt,Et)}return Array.isArray(tt.errors)&&tt.errors.forEach((xt,Et)=>{if(isInstanceOf(xt,Error)){applyExceptionGroupFieldsForParentException(ht,gt);const kt=Le(Be,xt),Ct=At.length;applyExceptionGroupFieldsForChildException(kt,`errors[${Et}]`,Ct,gt),At=aggregateExceptionsFromError(Le,Be,Ye,xt,nt,[kt,...At],kt,Ct)}}),At}function applyExceptionGroupFieldsForParentException(Le,Be){Le.mechanism={handled:!0,type:"auto.core.linked_errors",...Le.mechanism,...Le.type==="AggregateError"&&{is_exception_group:!0},exception_id:Be}}function applyExceptionGroupFieldsForChildException(Le,Be,Ye,tt){Le.mechanism={handled:!0,...Le.mechanism,type:"chained",source:Be,exception_id:Ye,parent_id:tt}}function addConsoleInstrumentationHandler(Le){const Be="console";addHandler(Be,Le),maybeInstrument(Be,instrumentConsole)}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach(function(Le){Le in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,Le,function(Be){return originalConsoleMethods[Le]=Be,function(...Ye){triggerHandlers("console",{args:Ye,level:Le});const nt=originalConsoleMethods[Le];nt==null||nt.apply(GLOBAL_OBJ.console,Ye)}})})}function severityLevelFromString(Le){return Le==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(Le)?Le:"log"}const INTEGRATION_NAME$4="Dedupe",_dedupeIntegration=()=>{let Le;return{name:INTEGRATION_NAME$4,processEvent(Be){if(Be.type)return Be;try{if(_shouldDropEvent(Be,Le))return DEBUG_BUILD$2&&debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return Le=Be}}},dedupeIntegration=_dedupeIntegration;function _shouldDropEvent(Le,Be){return Be?!!(_isSameMessageEvent(Le,Be)||_isSameExceptionEvent(Le,Be)):!1}function _isSameMessageEvent(Le,Be){const Ye=Le.message,tt=Be.message;return!(!Ye&&!tt||Ye&&!tt||!Ye&&tt||Ye!==tt||!_isSameFingerprint(Le,Be)||!_isSameStacktrace(Le,Be))}function _isSameExceptionEvent(Le,Be){const Ye=_getExceptionFromEvent(Be),tt=_getExceptionFromEvent(Le);return!(!Ye||!tt||Ye.type!==tt.type||Ye.value!==tt.value||!_isSameFingerprint(Le,Be)||!_isSameStacktrace(Le,Be))}function _isSameStacktrace(Le,Be){let Ye=getFramesFromEvent(Le),tt=getFramesFromEvent(Be);if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt||(Ye=Ye,tt=tt,tt.length!==Ye.length))return!1;for(let nt=0;nt<tt.length;nt++){const ft=tt[nt],ht=Ye[nt];if(ft.filename!==ht.filename||ft.lineno!==ht.lineno||ft.colno!==ht.colno||ft.function!==ht.function)return!1}return!0}function _isSameFingerprint(Le,Be){let Ye=Le.fingerprint,tt=Be.fingerprint;if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt)return!1;Ye=Ye,tt=tt;try{return Ye.join("")===tt.join("")}catch{return!1}}function _getExceptionFromEvent(Le){var Be,Ye;return(Ye=(Be=Le.exception)==null?void 0:Be.values)==null?void 0:Ye[0]}function getBreadcrumbLogLevelFromHttpStatusCode(Le){if(Le!==void 0)return Le>=400&&Le<500?"warning":Le>=500?"error":void 0}const WINDOW$2=GLOBAL_OBJ;function supportsHistory(){return"history"in WINDOW$2&&!!WINDOW$2.history}function _isFetchSupported(){if(!("fetch"in WINDOW$2))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function isNativeFunction(Le){return Le&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(Le.toString())}function supportsNativeFetch(){var Ye;if(typeof EdgeRuntime=="string")return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(WINDOW$2.fetch))return!0;let Le=!1;const Be=WINDOW$2.document;if(Be&&typeof Be.createElement=="function")try{const tt=Be.createElement("iframe");tt.hidden=!0,Be.head.appendChild(tt),(Ye=tt.contentWindow)!=null&&Ye.fetch&&(Le=isNativeFunction(tt.contentWindow.fetch)),Be.head.removeChild(tt)}catch(tt){DEBUG_BUILD$2&&debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",tt)}return Le}function addFetchInstrumentationHandler(Le,Be){const Ye="fetch";addHandler(Ye,Le),maybeInstrument(Ye,()=>instrumentFetch(void 0,Be))}function instrumentFetch(Le,Be=!1){Be&&!supportsNativeFetch()||fill(GLOBAL_OBJ,"fetch",function(Ye){return function(...tt){const nt=new Error,{method:ft,url:ht}=parseFetchArgs(tt),gt={args:tt,fetchData:{method:ft,url:ht},startTimestamp:timestampInSeconds()*1e3,virtualError:nt,headers:getHeadersFromFetchArgs(tt)};return triggerHandlers("fetch",{...gt}),Ye.apply(GLOBAL_OBJ,tt).then(async At=>(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,response:At}),At),At=>{if(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,error:At}),isError(At)&&At.stack===void 0&&(At.stack=nt.stack,addNonEnumerableProperty(At,"framesToPop",1)),At instanceof TypeError&&(At.message==="Failed to fetch"||At.message==="Load failed"||At.message==="NetworkError when attempting to fetch resource."))try{const xt=new URL(gt.fetchData.url);At.message=`${At.message} (${xt.host})`}catch{}throw At})}})}function hasProp(Le,Be){return!!Le&&typeof Le=="object"&&!!Le[Be]}function getUrlFromResource(Le){return typeof Le=="string"?Le:Le?hasProp(Le,"url")?Le.url:Le.toString?Le.toString():"":""}function parseFetchArgs(Le){if(Le.length===0)return{method:"GET",url:""};if(Le.length===2){const[Ye,tt]=Le;return{url:getUrlFromResource(Ye),method:hasProp(tt,"method")?String(tt.method).toUpperCase():"GET"}}const Be=Le[0];return{url:getUrlFromResource(Be),method:hasProp(Be,"method")?String(Be.method).toUpperCase():"GET"}}function getHeadersFromFetchArgs(Le){const[Be,Ye]=Le;try{if(typeof Ye=="object"&&Ye!==null&&"headers"in Ye&&Ye.headers)return new Headers(Ye.headers);if(isRequest(Be))return new Headers(Be.headers)}catch{}}function getSDKSource(){return"npm"}const WINDOW$1=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout(()=>{ignoreOnError--})}function wrap(Le,Be={}){function Ye(nt){return typeof nt=="function"}if(!Ye(Le))return Le;try{const nt=Le.__sentry_wrapped__;if(nt)return typeof nt=="function"?nt:Le;if(getOriginalFunction(Le))return Le}catch{return Le}const tt=function(...nt){try{const ft=nt.map(ht=>wrap(ht,Be));return Le.apply(this,ft)}catch(ft){throw ignoreNextOnError(),withScope(ht=>{ht.addEventProcessor(gt=>(Be.mechanism&&(addExceptionTypeValue(gt,void 0),addExceptionMechanism(gt,Be.mechanism)),gt.extra={...gt.extra,arguments:nt},gt)),captureException(ft)}),ft}};try{for(const nt in Le)Object.prototype.hasOwnProperty.call(Le,nt)&&(tt[nt]=Le[nt])}catch{}markFunctionWrapped(tt,Le),addNonEnumerableProperty(Le,"__sentry_wrapped__",tt);try{Object.getOwnPropertyDescriptor(tt,"name").configurable&&Object.defineProperty(tt,"name",{get(){return Le.name}})}catch{}return tt}function getHttpRequestData(){const Le=getLocationHref(),{referrer:Be}=WINDOW$1.document||{},{userAgent:Ye}=WINDOW$1.navigator||{},tt={...Be&&{Referer:Be},...Ye&&{"User-Agent":Ye}};return{url:Le,headers:tt}}function exceptionFromError(Le,Be){const Ye=parseStackFrames(Le,Be),tt={type:extractType(Be),value:extractMessage(Be)};return Ye.length&&(tt.stacktrace={frames:Ye}),tt.type===void 0&&tt.value===""&&(tt.value="Unrecoverable error caught"),tt}function eventFromPlainObject(Le,Be,Ye,tt){const nt=getClient(),ft=nt==null?void 0:nt.getOptions().normalizeDepth,ht=getErrorPropertyFromObject(Be),gt={__serialized__:normalizeToSize(Be,ft)};if(ht)return{exception:{values:[exceptionFromError(Le,ht)]},extra:gt};const At={exception:{values:[{type:isEvent(Be)?Be.constructor.name:tt?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(Be,{isUnhandledRejection:tt})}]},extra:gt};if(Ye){const xt=parseStackFrames(Le,Ye);xt.length&&(At.exception.values[0].stacktrace={frames:xt})}return At}function eventFromError(Le,Be){return{exception:{values:[exceptionFromError(Le,Be)]}}}function parseStackFrames(Le,Be){const Ye=Be.stacktrace||Be.stack||"",tt=getSkipFirstStackStringLines(Be),nt=getPopFirstTopFrames(Be);try{return Le(Ye,tt,nt)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(Le){return Le&&reactMinifiedRegexp.test(Le.message)?1:0}function getPopFirstTopFrames(Le){return typeof Le.framesToPop=="number"?Le.framesToPop:0}function isWebAssemblyException(Le){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?Le instanceof WebAssembly.Exception:!1}function extractType(Le){const Be=Le==null?void 0:Le.name;return!Be&&isWebAssemblyException(Le)?Le.message&&Array.isArray(Le.message)&&Le.message.length==2?Le.message[0]:"WebAssembly.Exception":Be}function extractMessage(Le){const Be=Le==null?void 0:Le.message;return isWebAssemblyException(Le)?Array.isArray(Le.message)&&Le.message.length==2?Le.message[1]:"wasm exception":Be?Be.error&&typeof Be.error.message=="string"?Be.error.message:Be:"No error message"}function eventFromException(Le,Be,Ye,tt){const nt=(Ye==null?void 0:Ye.syntheticException)||void 0,ft=eventFromUnknownInput(Le,Be,nt,tt);return addExceptionMechanism(ft),ft.level="error",Ye!=null&&Ye.event_id&&(ft.event_id=Ye.event_id),resolvedSyncPromise(ft)}function eventFromMessage(Le,Be,Ye="info",tt,nt){const ft=(tt==null?void 0:tt.syntheticException)||void 0,ht=eventFromString(Le,Be,ft,nt);return ht.level=Ye,tt!=null&&tt.event_id&&(ht.event_id=tt.event_id),resolvedSyncPromise(ht)}function eventFromUnknownInput(Le,Be,Ye,tt,nt){let ft;if(isErrorEvent$1(Be)&&Be.error)return eventFromError(Le,Be.error);if(isDOMError(Be)||isDOMException(Be)){const ht=Be;if("stack"in Be)ft=eventFromError(Le,Be);else{const gt=ht.name||(isDOMError(ht)?"DOMError":"DOMException"),At=ht.message?`${gt}: ${ht.message}`:gt;ft=eventFromString(Le,At,Ye,tt),addExceptionTypeValue(ft,At)}return"code"in ht&&(ft.tags={...ft.tags,"DOMException.code":`${ht.code}`}),ft}return isError(Be)?eventFromError(Le,Be):isPlainObject(Be)||isEvent(Be)?(ft=eventFromPlainObject(Le,Be,Ye,nt),addExceptionMechanism(ft,{synthetic:!0}),ft):(ft=eventFromString(Le,Be,Ye,tt),addExceptionTypeValue(ft,`${Be}`),addExceptionMechanism(ft,{synthetic:!0}),ft)}function eventFromString(Le,Be,Ye,tt){const nt={};if(tt&&Ye){const ft=parseStackFrames(Le,Ye);ft.length&&(nt.exception={values:[{value:Be,stacktrace:{frames:ft}}]}),addExceptionMechanism(nt,{synthetic:!0})}if(isParameterizedString(Be)){const{__sentry_template_string__:ft,__sentry_template_values__:ht}=Be;return nt.logentry={message:ft,params:ht},nt}return nt.message=Be,nt}function getNonErrorObjectExceptionValue(Le,{isUnhandledRejection:Be}){const Ye=extractExceptionKeysForMessage(Le),tt=Be?"promise rejection":"exception";return isErrorEvent$1(Le)?`Event \`ErrorEvent\` captured as ${tt} with message \`${Le.message}\``:isEvent(Le)?`Event \`${getObjectClassName(Le)}\` (type=${Le.type}) captured as ${tt}`:`Object captured as ${tt} with keys: ${Ye}`}function getObjectClassName(Le){try{const Be=Object.getPrototypeOf(Le);return Be?Be.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(Le){for(const Be in Le)if(Object.prototype.hasOwnProperty.call(Le,Be)){const Ye=Le[Be];if(Ye instanceof Error)return Ye}}class BrowserClient extends Client{constructor(Be){var Et;const Ye=applyDefaultOptions(Be),tt=WINDOW$1.SENTRY_SDK_SOURCE||getSDKSource();applySdkMetadata(Ye,"browser",["browser"],tt),(Et=Ye._metadata)!=null&&Et.sdk&&(Ye._metadata.sdk.settings={infer_ip:Ye.sendDefaultPii?"auto":"never",...Ye._metadata.sdk.settings}),super(Ye);const{sendDefaultPii:nt,sendClientReports:ft,enableLogs:ht,_experiments:gt,enableMetrics:At}=this._options,xt=At??(gt==null?void 0:gt.enableMetrics)??!0;WINDOW$1.document&&(ft||ht||xt)&&WINDOW$1.document.addEventListener("visibilitychange",()=>{WINDOW$1.document.visibilityState==="hidden"&&(ft&&this._flushOutcomes(),ht&&_INTERNAL_flushLogsBuffer(this),xt&&_INTERNAL_flushMetricsBuffer(this))}),nt&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(Be,Ye){return eventFromException(this._options.stackParser,Be,Ye,this._options.attachStacktrace)}eventFromMessage(Be,Ye="info",tt){return eventFromMessage(this._options.stackParser,Be,Ye,tt,this._options.attachStacktrace)}_prepareEvent(Be,Ye,tt,nt){return Be.platform=Be.platform||"javascript",super._prepareEvent(Be,Ye,tt,nt)}}function applyDefaultOptions(Le){var Be;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(Be=WINDOW$1.SENTRY_RELEASE)==null?void 0:Be.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...Le}}const DEBUG_BUILD$1=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,WINDOW=GLOBAL_OBJ,DEBOUNCE_DURATION=1e3;let debounceTimerID,lastCapturedEventType,lastCapturedEventTargetId;function addClickKeypressInstrumentationHandler(Le){const Be="dom";addHandler(Be,Le),maybeInstrument(Be,instrumentDOM)}function instrumentDOM(){if(!WINDOW.document)return;const Le=triggerHandlers.bind(null,"dom"),Be=makeDOMEventHandler(Le,!0);WINDOW.document.addEventListener("click",Be,!1),WINDOW.document.addEventListener("keypress",Be,!1),["EventTarget","Node"].forEach(Ye=>{var ft,ht;const nt=(ft=WINDOW[Ye])==null?void 0:ft.prototype;(ht=nt==null?void 0:nt.hasOwnProperty)!=null&&ht.call(nt,"addEventListener")&&(fill(nt,"addEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},Ct=kt[At]=kt[At]||{refCount:0};if(!Ct.handler){const yt=makeDOMEventHandler(Le);Ct.handler=yt,gt.call(this,At,yt,Et)}Ct.refCount++}catch{}return gt.call(this,At,xt,Et)}}),fill(nt,"removeEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__||{},Ct=kt[At];Ct&&(Ct.refCount--,Ct.refCount<=0&&(gt.call(this,At,Ct.handler,Et),Ct.handler=void 0,delete kt[At]),Object.keys(kt).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return gt.call(this,At,xt,Et)}}))})}function isSimilarToLastCapturedEvent(Le){if(Le.type!==lastCapturedEventType)return!1;try{if(!Le.target||Le.target._sentryId!==lastCapturedEventTargetId)return!1}catch{}return!0}function shouldSkipDOMEvent(Le,Be){return Le!=="keypress"?!1:Be!=null&&Be.tagName?!(Be.tagName==="INPUT"||Be.tagName==="TEXTAREA"||Be.isContentEditable):!0}function makeDOMEventHandler(Le,Be=!1){return Ye=>{if(!Ye||Ye._sentryCaptured)return;const tt=getEventTarget(Ye);if(shouldSkipDOMEvent(Ye.type,tt))return;addNonEnumerableProperty(Ye,"_sentryCaptured",!0),tt&&!tt._sentryId&&addNonEnumerableProperty(tt,"_sentryId",uuid4());const nt=Ye.type==="keypress"?"input":Ye.type;isSimilarToLastCapturedEvent(Ye)||(Le({event:Ye,name:nt,global:Be}),lastCapturedEventType=Ye.type,lastCapturedEventTargetId=tt?tt._sentryId:void 0),clearTimeout(debounceTimerID),debounceTimerID=WINDOW.setTimeout(()=>{lastCapturedEventTargetId=void 0,lastCapturedEventType=void 0},DEBOUNCE_DURATION)}}function getEventTarget(Le){try{return Le.target}catch{return null}}let lastHref;function addHistoryInstrumentationHandler(Le){const Be="history";addHandler(Be,Le),maybeInstrument(Be,instrumentHistory)}function instrumentHistory(){if(WINDOW.addEventListener("popstate",()=>{const Be=WINDOW.location.href,Ye=lastHref;if(lastHref=Be,Ye===Be)return;triggerHandlers("history",{from:Ye,to:Be})}),!supportsHistory())return;function Le(Be){return function(...Ye){const tt=Ye.length>2?Ye[2]:void 0;if(tt){const nt=lastHref,ft=getAbsoluteUrl(String(tt));if(lastHref=ft,nt===ft)return Be.apply(this,Ye);triggerHandlers("history",{from:nt,to:ft})}return Be.apply(this,Ye)}}fill(WINDOW.history,"pushState",Le),fill(WINDOW.history,"replaceState",Le)}function getAbsoluteUrl(Le){try{return new URL(Le,WINDOW.location.origin).toString()}catch{return Le}}const cachedImplementations={};function getNativeImplementation(Le){const Be=cachedImplementations[Le];if(Be)return Be;let Ye=WINDOW[Le];if(isNativeFunction(Ye))return cachedImplementations[Le]=Ye.bind(WINDOW);const tt=WINDOW.document;if(tt&&typeof tt.createElement=="function")try{const nt=tt.createElement("iframe");nt.hidden=!0,tt.head.appendChild(nt);const ft=nt.contentWindow;ft!=null&&ft[Le]&&(Ye=ft[Le]),tt.head.removeChild(nt)}catch(nt){DEBUG_BUILD$1&&debug.warn(`Could not create sandbox iframe for ${Le} check, bailing to window.${Le}: `,nt)}return Ye&&(cachedImplementations[Le]=Ye.bind(WINDOW))}function clearCachedImplementation(Le){cachedImplementations[Le]=void 0}const SENTRY_XHR_DATA_KEY="__sentry_xhr_v3__";function addXhrInstrumentationHandler(Le){const Be="xhr";addHandler(Be,Le),maybeInstrument(Be,instrumentXHR)}function instrumentXHR(){if(!WINDOW.XMLHttpRequest)return;const Le=XMLHttpRequest.prototype;Le.open=new Proxy(Le.open,{apply(Be,Ye,tt){const nt=new Error,ft=timestampInSeconds()*1e3,ht=isString(tt[0])?tt[0].toUpperCase():void 0,gt=parseXhrUrlArg(tt[1]);if(!ht||!gt)return Be.apply(Ye,tt);Ye[SENTRY_XHR_DATA_KEY]={method:ht,url:gt,request_headers:{}},ht==="POST"&>.match(/sentry_key/)&&(Ye.__sentry_own_request__=!0);const At=()=>{const xt=Ye[SENTRY_XHR_DATA_KEY];if(xt&&Ye.readyState===4){try{xt.status_code=Ye.status}catch{}const Et={endTimestamp:timestampInSeconds()*1e3,startTimestamp:ft,xhr:Ye,virtualError:nt};triggerHandlers("xhr",Et)}};return"onreadystatechange"in Ye&&typeof Ye.onreadystatechange=="function"?Ye.onreadystatechange=new Proxy(Ye.onreadystatechange,{apply(xt,Et,kt){return At(),xt.apply(Et,kt)}}):Ye.addEventListener("readystatechange",At),Ye.setRequestHeader=new Proxy(Ye.setRequestHeader,{apply(xt,Et,kt){const[Ct,yt]=kt,vt=Et[SENTRY_XHR_DATA_KEY];return vt&&isString(Ct)&&isString(yt)&&(vt.request_headers[Ct.toLowerCase()]=yt),xt.apply(Et,kt)}}),Be.apply(Ye,tt)}}),Le.send=new Proxy(Le.send,{apply(Be,Ye,tt){const nt=Ye[SENTRY_XHR_DATA_KEY];if(!nt)return Be.apply(Ye,tt);tt[0]!==void 0&&(nt.body=tt[0]);const ft={startTimestamp:timestampInSeconds()*1e3,xhr:Ye};return triggerHandlers("xhr",ft),Be.apply(Ye,tt)}})}function parseXhrUrlArg(Le){if(isString(Le))return Le;try{return Le.toString()}catch{}}const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE=40;function makeFetchTransport(Le,Be=getNativeImplementation("fetch")){let Ye=0,tt=0;async function nt(ft){const ht=ft.body.length;Ye+=ht,tt++;const gt={body:ft.body,method:"POST",referrerPolicy:"strict-origin",headers:Le.headers,keepalive:Ye<=6e4&&tt<15,...Le.fetchOptions};try{const At=await Be(Le.url,gt);return{statusCode:At.status,headers:{"x-sentry-rate-limits":At.headers.get("X-Sentry-Rate-Limits"),"retry-after":At.headers.get("Retry-After")}}}catch(At){throw clearCachedImplementation("fetch"),At}finally{Ye-=ht,tt--}}return createTransport(Le,nt,makePromiseBuffer(Le.bufferSize||DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE))}const CHROME_PRIORITY=30,GECKO_PRIORITY=50;function createFrame(Le,Be,Ye,tt){const nt={filename:Le,function:Be==="<anonymous>"?UNKNOWN_FUNCTION:Be,in_app:!0};return Ye!==void 0&&(nt.lineno=Ye),tt!==void 0&&(nt.colno=tt),nt}const chromeRegexNoFnName=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeDataUriRegex=/at (.+?) ?\(data:(.+?),/,chromeStackParserFn=Le=>{const Be=Le.match(chromeDataUriRegex);if(Be)return{filename:`<data:${Be[2]}>`,function:Be[1]};const Ye=chromeRegexNoFnName.exec(Le);if(Ye){const[,nt,ft,ht]=Ye;return createFrame(nt,UNKNOWN_FUNCTION,+ft,+ht)}const tt=chromeRegex.exec(Le);if(tt){if(tt[2]&&tt[2].indexOf("eval")===0){const gt=chromeEvalRegex.exec(tt[2]);gt&&(tt[2]=gt[1],tt[3]=gt[2],tt[4]=gt[3])}const[ft,ht]=extractSafariExtensionDetails(tt[1]||UNKNOWN_FUNCTION,tt[2]);return createFrame(ht,ft,tt[3]?+tt[3]:void 0,tt[4]?+tt[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chromeStackParserFn],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=Le=>{const Be=geckoREgex.exec(Le);if(Be){if(Be[3]&&Be[3].indexOf(" > eval")>-1){const ft=geckoEvalRegex.exec(Be[3]);ft&&(Be[1]=Be[1]||"eval",Be[3]=ft[1],Be[4]=ft[2],Be[5]="")}let tt=Be[3],nt=Be[1]||UNKNOWN_FUNCTION;return[nt,tt]=extractSafariExtensionDetails(nt,tt),createFrame(tt,nt,Be[4]?+Be[4]:void 0,Be[5]?+Be[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(Le,Be)=>{const Ye=Le.indexOf("safari-extension")!==-1,tt=Le.indexOf("safari-web-extension")!==-1;return Ye||tt?[Le.indexOf("@")!==-1?Le.split("@")[0]:UNKNOWN_FUNCTION,Ye?`safari-extension:${Be}`:`safari-web-extension:${Be}`]:[Le,Be]},DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,MAX_ALLOWED_STRING_LENGTH=1024,INTEGRATION_NAME$3="Breadcrumbs",_breadcrumbsIntegration=(Le={})=>{const Be={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...Le};return{name:INTEGRATION_NAME$3,setup(Ye){Be.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(Ye)),Be.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(Ye,Be.dom)),Be.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(Ye)),Be.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(Ye)),Be.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(Ye)),Be.sentry&&Ye.on("beforeSendEvent",_getSentryBreadcrumbHandler(Ye))}}},breadcrumbsIntegration=_breadcrumbsIntegration;function _getSentryBreadcrumbHandler(Le){return function(Ye){getClient()===Le&&addBreadcrumb({category:`sentry.${Ye.type==="transaction"?"transaction":"event"}`,event_id:Ye.event_id,level:Ye.level,message:getEventDescription(Ye)},{event:Ye})}}function _getDomBreadcrumbHandler(Le,Be){return function(tt){if(getClient()!==Le)return;let nt,ft,ht=typeof Be=="object"?Be.serializeAttribute:void 0,gt=typeof Be=="object"&&typeof Be.maxStringLength=="number"?Be.maxStringLength:void 0;gt&>>MAX_ALLOWED_STRING_LENGTH&&(DEBUG_BUILD&&debug.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${gt} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),gt=MAX_ALLOWED_STRING_LENGTH),typeof ht=="string"&&(ht=[ht]);try{const xt=tt.event,Et=_isEvent(xt)?xt.target:xt;nt=htmlTreeAsString(Et,{keyAttrs:ht,maxStringLength:gt}),ft=getComponentName(Et)}catch{nt="<unknown>"}if(nt.length===0)return;const At={category:`ui.${tt.name}`,message:nt};ft&&(At.data={"ui.component_name":ft}),addBreadcrumb(At,{event:tt.event,name:tt.name,global:tt.global})}}function _getConsoleBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;const tt={category:"console",data:{arguments:Ye.args,logger:"console"},level:severityLevelFromString(Ye.level),message:safeJoin(Ye.args," ")};if(Ye.level==="assert")if(Ye.args[0]===!1)tt.message=`Assertion failed: ${safeJoin(Ye.args.slice(1)," ")||"console.assert"}`,tt.data.arguments=Ye.args.slice(1);else return;addBreadcrumb(tt,{input:Ye.args,level:Ye.level})}}function _getXhrBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;const{startTimestamp:tt,endTimestamp:nt}=Ye,ft=Ye.xhr[SENTRY_XHR_DATA_KEY];if(!tt||!nt||!ft)return;const{method:ht,url:gt,status_code:At,body:xt}=ft,Et={method:ht,url:gt,status_code:At},kt={xhr:Ye.xhr,input:xt,startTimestamp:tt,endTimestamp:nt},Ct={category:"xhr",data:Et,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(At)};Le.emit("beforeOutgoingRequestBreadcrumb",Ct,kt),addBreadcrumb(Ct,kt)}}function _getFetchBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;const{startTimestamp:tt,endTimestamp:nt}=Ye;if(nt&&!(Ye.fetchData.url.match(/sentry_key/)&&Ye.fetchData.method==="POST"))if(Ye.fetchData.method,Ye.fetchData.url,Ye.error){const ft=Ye.fetchData,ht={data:Ye.error,input:Ye.args,startTimestamp:tt,endTimestamp:nt},gt={category:"fetch",data:ft,level:"error",type:"http"};Le.emit("beforeOutgoingRequestBreadcrumb",gt,ht),addBreadcrumb(gt,ht)}else{const ft=Ye.response,ht={...Ye.fetchData,status_code:ft==null?void 0:ft.status};Ye.fetchData.request_body_size,Ye.fetchData.response_body_size,ft==null||ft.status;const gt={input:Ye.args,response:ft,startTimestamp:tt,endTimestamp:nt},At={category:"fetch",data:ht,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(ht.status_code)};Le.emit("beforeOutgoingRequestBreadcrumb",At,gt),addBreadcrumb(At,gt)}}}function _getHistoryBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;let tt=Ye.from,nt=Ye.to;const ft=parseUrl(WINDOW$1.location.href);let ht=tt?parseUrl(tt):void 0;const gt=parseUrl(nt);ht!=null&&ht.path||(ht=ft),ft.protocol===gt.protocol&&ft.host===gt.host&&(nt=gt.relative),ft.protocol===ht.protocol&&ft.host===ht.host&&(tt=ht.relative),addBreadcrumb({category:"navigation",data:{from:tt,to:nt}})}}function _isEvent(Le){return!!Le&&!!Le.target}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],INTEGRATION_NAME$2="BrowserApiErrors",_browserApiErrorsIntegration=(Le={})=>{const Be={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...Le};return{name:INTEGRATION_NAME$2,setupOnce(){Be.setTimeout&&fill(WINDOW$1,"setTimeout",_wrapTimeFunction),Be.setInterval&&fill(WINDOW$1,"setInterval",_wrapTimeFunction),Be.requestAnimationFrame&&fill(WINDOW$1,"requestAnimationFrame",_wrapRAF),Be.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$1&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const Ye=Be.eventTarget;Ye&&(Array.isArray(Ye)?Ye:DEFAULT_EVENT_TARGET).forEach(nt=>_wrapEventTarget(nt,Be))}}},browserApiErrorsIntegration=_browserApiErrorsIntegration;function _wrapTimeFunction(Le){return function(...Be){const Ye=Be[0];return Be[0]=wrap(Ye,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${getFunctionName(Le)}`}}),Le.apply(this,Be)}}function _wrapRAF(Le){return function(Be){return Le.apply(this,[wrap(Be,{mechanism:{data:{handler:getFunctionName(Le)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(Le){return function(...Be){const Ye=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(nt=>{nt in Ye&&typeof Ye[nt]=="function"&&fill(Ye,nt,function(ft){const ht={mechanism:{data:{handler:getFunctionName(ft)},handled:!1,type:`auto.browser.browserapierrors.xhr.${nt}`}},gt=getOriginalFunction(ft);return gt&&(ht.mechanism.data.handler=getFunctionName(gt)),wrap(ft,ht)})}),Le.apply(this,Be)}}function _wrapEventTarget(Le,Be){var nt,ft;const tt=(nt=WINDOW$1[Le])==null?void 0:nt.prototype;(ft=tt==null?void 0:tt.hasOwnProperty)!=null&&ft.call(tt,"addEventListener")&&(fill(tt,"addEventListener",function(ht){return function(gt,At,xt){try{isEventListenerObject(At)&&(At.handleEvent=wrap(At.handleEvent,{mechanism:{data:{handler:getFunctionName(At),target:Le},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return Be.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,gt,At),ht.apply(this,[gt,wrap(At,{mechanism:{data:{handler:getFunctionName(At),target:Le},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),xt])}}),fill(tt,"removeEventListener",function(ht){return function(gt,At,xt){try{const Et=At.__sentry_wrapped__;Et&&ht.call(this,gt,Et,xt)}catch{}return ht.call(this,gt,At,xt)}}))}function isEventListenerObject(Le){return typeof Le.handleEvent=="function"}function unregisterOriginalCallback(Le,Be,Ye){Le&&typeof Le=="object"&&"removeEventListener"in Le&&typeof Le.removeEventListener=="function"&&Le.removeEventListener(Be,Ye)}const browserSessionIntegration=()=>({name:"BrowserSession",setupOnce(){if(typeof WINDOW$1.document>"u"){DEBUG_BUILD&&debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}startSession({ignoreDuration:!0}),captureSession(),addHistoryInstrumentationHandler(({from:Le,to:Be})=>{Le!==void 0&&Le!==Be&&(startSession({ignoreDuration:!0}),captureSession())})}}),INTEGRATION_NAME$1="GlobalHandlers",_globalHandlersIntegration=(Le={})=>{const Be={onerror:!0,onunhandledrejection:!0,...Le};return{name:INTEGRATION_NAME$1,setupOnce(){Error.stackTraceLimit=50},setup(Ye){Be.onerror&&(_installGlobalOnErrorHandler(Ye),globalHandlerLog("onerror")),Be.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(Ye),globalHandlerLog("onunhandledrejection"))}}},globalHandlersIntegration=_globalHandlersIntegration;function _installGlobalOnErrorHandler(Le){addGlobalErrorInstrumentationHandler(Be=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Le||shouldIgnoreOnError())return;const{msg:nt,url:ft,line:ht,column:gt,error:At}=Be,xt=_enhanceEventWithInitialFrame(eventFromUnknownInput(Ye,At||nt,void 0,tt,!1),ft,ht,gt);xt.level="error",captureEvent(xt,{originalException:At,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function _installGlobalOnUnhandledRejectionHandler(Le){addGlobalUnhandledRejectionInstrumentationHandler(Be=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Le||shouldIgnoreOnError())return;const nt=_getUnhandledRejectionError(Be),ft=isPrimitive(nt)?_eventFromRejectionWithPrimitive(nt):eventFromUnknownInput(Ye,nt,void 0,tt,!0);ft.level="error",captureEvent(ft,{originalException:nt,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function _getUnhandledRejectionError(Le){if(isPrimitive(Le))return Le;try{if("reason"in Le)return Le.reason;if("detail"in Le&&"reason"in Le.detail)return Le.detail.reason}catch{}return Le}function _eventFromRejectionWithPrimitive(Le){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(Le)}`}]}}}function _enhanceEventWithInitialFrame(Le,Be,Ye,tt){const nt=Le.exception=Le.exception||{},ft=nt.values=nt.values||[],ht=ft[0]=ft[0]||{},gt=ht.stacktrace=ht.stacktrace||{},At=gt.frames=gt.frames||[],xt=tt,Et=Ye,kt=getFilenameFromUrl(Be)??getLocationHref();return At.length===0&&At.push({colno:xt,filename:kt,function:UNKNOWN_FUNCTION,in_app:!0,lineno:Et}),Le}function globalHandlerLog(Le){DEBUG_BUILD&&debug.log(`Global Handler attached: ${Le}`)}function getOptions(){const Le=getClient();return(Le==null?void 0:Le.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function getFilenameFromUrl(Le){if(!(!isString(Le)||Le.length===0)){if(Le.startsWith("data:")){const Be=Le.match(/^data:([^;]+)/),Ye=Be?Be[1]:"text/javascript",tt=Le.includes("base64,");return`<data:${Ye}${tt?",base64":""}>`}return Le}}const httpContextIntegration=()=>({name:"HttpContext",preprocessEvent(Le){var tt;if(!WINDOW$1.navigator&&!WINDOW$1.location&&!WINDOW$1.document)return;const Be=getHttpRequestData(),Ye={...Be.headers,...(tt=Le.request)==null?void 0:tt.headers};Le.request={...Be,...Le.request,headers:Ye}}}),DEFAULT_KEY="cause",DEFAULT_LIMIT=5,INTEGRATION_NAME="LinkedErrors",_linkedErrorsIntegration=(Le={})=>{const Be=Le.limit||DEFAULT_LIMIT,Ye=Le.key||DEFAULT_KEY;return{name:INTEGRATION_NAME,preprocessEvent(tt,nt,ft){const ht=ft.getOptions();applyAggregateErrorsToEvent(exceptionFromError,ht.stackParser,Ye,Be,tt,nt)}}},linkedErrorsIntegration=_linkedErrorsIntegration;function checkAndWarnIfIsEmbeddedBrowserExtension(){return _isEmbeddedBrowserExtension()?(DEBUG_BUILD&&consoleSandbox(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function _isEmbeddedBrowserExtension(){var ft;if(typeof WINDOW$1.window>"u")return!1;const Le=WINDOW$1;if(Le.nw)return!1;const Be=Le.chrome||Le.browser;if(!((ft=Be==null?void 0:Be.runtime)!=null&&ft.id))return!1;const Ye=getLocationHref(),tt=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(WINDOW$1===WINDOW$1.top&&tt.some(ht=>Ye.startsWith(`${ht}://`)))}function getDefaultIntegrations(Le){return[inboundFiltersIntegration(),functionToStringIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),browserSessionIntegration()]}function init(Le={}){const Be=!Le.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();let Ye=Le.defaultIntegrations==null?getDefaultIntegrations():Le.defaultIntegrations;const tt={...Le,enabled:Be?!1:Le.enabled,stackParser:stackParserFromStackParserOptions(Le.stackParser||defaultStackParser),integrations:getIntegrationsToSetup({integrations:Le.integrations,defaultIntegrations:Ye}),transport:Le.transport||makeFetchTransport};return initAndBind(BrowserClient,tt)}const DEPRECATION_PERIOD_MONTHS=12,SDK_RELEASE_DATE="2026-11-05",DEPRECATED_SDK_WARNING_MESSAGE="You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";let hasWarned=!1;const parseReleaseDate=Le=>{const Be=/^(\d{4})-(\d{2})-(\d{2})$/.exec(Le);if(!Be)return null;const Ye=Number(Be[1]),tt=Number(Be[2])-1,nt=Number(Be[3]),ft=new Date(Date.UTC(Ye,tt,nt));return ft.getUTCFullYear()!==Ye||ft.getUTCMonth()!==tt||ft.getUTCDate()!==nt?null:ft},isSdkDeprecated=(Le,Be=new Date)=>{const Ye=parseReleaseDate(Le);if(!Ye)return!1;const tt=new Date(Date.UTC(Ye.getUTCFullYear(),Ye.getUTCMonth()+DEPRECATION_PERIOD_MONTHS,Ye.getUTCDate()));return Be.getTime()>=tt.getTime()},warnIfSdkDeprecated=(Le=SDK_RELEASE_DATE,Be=new Date)=>{hasWarned||!isSdkDeprecated(Le,Be)||(hasWarned=!0,console.warn(DEPRECATED_SDK_WARNING_MESSAGE))};function setupFiles(){const Le={pollingIntervalSeconds:.25,maxMillisBeforeAckWhenClosed:100,moreAnnoyingDebuggerStatements:1,onDetectOpen:()=>{var xt;addDeviceStats((xt=state.token)==null?void 0:xt.token,{inspectorOpened:!0}),MlWasmApi.setInspectorOpened(!0)},onDetectClose:void 0,startup:"asap",onCheckOpennessWhilePaused:"throw"};Object.seal(Le);const Be=new Worker(URL.createObjectURL(new Blob([`"use strict";
|
|
10062
|
+
Url: ${_getEventFilterUrl(Le)}`),!0}return!1}function _isIgnoredError(Le,Be){return Be!=null&&Be.length?getPossibleEventMessages(Le).some(Ye=>stringMatchesSomePattern(Ye,Be)):!1}function _isIgnoredTransaction(Le,Be){if(!(Be!=null&&Be.length))return!1;const Ye=Le.transaction;return Ye?stringMatchesSomePattern(Ye,Be):!1}function _isDeniedUrl(Le,Be){if(!(Be!=null&&Be.length))return!1;const Ye=_getEventFilterUrl(Le);return Ye?stringMatchesSomePattern(Ye,Be):!1}function _isAllowedUrl(Le,Be){if(!(Be!=null&&Be.length))return!0;const Ye=_getEventFilterUrl(Le);return Ye?stringMatchesSomePattern(Ye,Be):!0}function _getLastValidUrl(Le=[]){for(let Be=Le.length-1;Be>=0;Be--){const Ye=Le[Be];if(Ye&&Ye.filename!=="<anonymous>"&&Ye.filename!=="[native code]")return Ye.filename||null}return null}function _getEventFilterUrl(Le){var Be,Ye;try{const tt=[...((Be=Le.exception)==null?void 0:Be.values)??[]].reverse().find(ft=>{var ht,gt,At;return((ht=ft.mechanism)==null?void 0:ht.parent_id)===void 0&&((At=(gt=ft.stacktrace)==null?void 0:gt.frames)==null?void 0:At.length)}),nt=(Ye=tt==null?void 0:tt.stacktrace)==null?void 0:Ye.frames;return nt?_getLastValidUrl(nt):null}catch{return DEBUG_BUILD$2&&debug.error(`Cannot extract url for event ${getEventDescription(Le)}`),null}}function _isUselessError(Le){var Be,Ye;return(Ye=(Be=Le.exception)==null?void 0:Be.values)!=null&&Ye.length?!Le.message&&!Le.exception.values.some(tt=>tt.stacktrace||tt.type&&tt.type!=="Error"||tt.value):!1}function applyAggregateErrorsToEvent(Le,Be,Ye,tt,nt,ft){var gt;if(!((gt=nt.exception)!=null&>.values)||!ft||!isInstanceOf(ft.originalException,Error))return;const ht=nt.exception.values.length>0?nt.exception.values[nt.exception.values.length-1]:void 0;ht&&(nt.exception.values=aggregateExceptionsFromError(Le,Be,tt,ft.originalException,Ye,nt.exception.values,ht,0))}function aggregateExceptionsFromError(Le,Be,Ye,tt,nt,ft,ht,gt){if(ft.length>=Ye+1)return ft;let At=[...ft];if(isInstanceOf(tt[nt],Error)){applyExceptionGroupFieldsForParentException(ht,gt);const xt=Le(Be,tt[nt]),Et=At.length;applyExceptionGroupFieldsForChildException(xt,nt,Et,gt),At=aggregateExceptionsFromError(Le,Be,Ye,tt[nt],nt,[xt,...At],xt,Et)}return Array.isArray(tt.errors)&&tt.errors.forEach((xt,Et)=>{if(isInstanceOf(xt,Error)){applyExceptionGroupFieldsForParentException(ht,gt);const kt=Le(Be,xt),Ct=At.length;applyExceptionGroupFieldsForChildException(kt,`errors[${Et}]`,Ct,gt),At=aggregateExceptionsFromError(Le,Be,Ye,xt,nt,[kt,...At],kt,Ct)}}),At}function applyExceptionGroupFieldsForParentException(Le,Be){Le.mechanism={handled:!0,type:"auto.core.linked_errors",...Le.mechanism,...Le.type==="AggregateError"&&{is_exception_group:!0},exception_id:Be}}function applyExceptionGroupFieldsForChildException(Le,Be,Ye,tt){Le.mechanism={handled:!0,...Le.mechanism,type:"chained",source:Be,exception_id:Ye,parent_id:tt}}function addConsoleInstrumentationHandler(Le){const Be="console";addHandler(Be,Le),maybeInstrument(Be,instrumentConsole)}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach(function(Le){Le in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,Le,function(Be){return originalConsoleMethods[Le]=Be,function(...Ye){triggerHandlers("console",{args:Ye,level:Le});const nt=originalConsoleMethods[Le];nt==null||nt.apply(GLOBAL_OBJ.console,Ye)}})})}function severityLevelFromString(Le){return Le==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(Le)?Le:"log"}const INTEGRATION_NAME$4="Dedupe",_dedupeIntegration=()=>{let Le;return{name:INTEGRATION_NAME$4,processEvent(Be){if(Be.type)return Be;try{if(_shouldDropEvent(Be,Le))return DEBUG_BUILD$2&&debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return Le=Be}}},dedupeIntegration=_dedupeIntegration;function _shouldDropEvent(Le,Be){return Be?!!(_isSameMessageEvent(Le,Be)||_isSameExceptionEvent(Le,Be)):!1}function _isSameMessageEvent(Le,Be){const Ye=Le.message,tt=Be.message;return!(!Ye&&!tt||Ye&&!tt||!Ye&&tt||Ye!==tt||!_isSameFingerprint(Le,Be)||!_isSameStacktrace(Le,Be))}function _isSameExceptionEvent(Le,Be){const Ye=_getExceptionFromEvent(Be),tt=_getExceptionFromEvent(Le);return!(!Ye||!tt||Ye.type!==tt.type||Ye.value!==tt.value||!_isSameFingerprint(Le,Be)||!_isSameStacktrace(Le,Be))}function _isSameStacktrace(Le,Be){let Ye=getFramesFromEvent(Le),tt=getFramesFromEvent(Be);if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt||(Ye=Ye,tt=tt,tt.length!==Ye.length))return!1;for(let nt=0;nt<tt.length;nt++){const ft=tt[nt],ht=Ye[nt];if(ft.filename!==ht.filename||ft.lineno!==ht.lineno||ft.colno!==ht.colno||ft.function!==ht.function)return!1}return!0}function _isSameFingerprint(Le,Be){let Ye=Le.fingerprint,tt=Be.fingerprint;if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt)return!1;Ye=Ye,tt=tt;try{return Ye.join("")===tt.join("")}catch{return!1}}function _getExceptionFromEvent(Le){var Be,Ye;return(Ye=(Be=Le.exception)==null?void 0:Be.values)==null?void 0:Ye[0]}function getBreadcrumbLogLevelFromHttpStatusCode(Le){if(Le!==void 0)return Le>=400&&Le<500?"warning":Le>=500?"error":void 0}const WINDOW$2=GLOBAL_OBJ;function supportsHistory(){return"history"in WINDOW$2&&!!WINDOW$2.history}function _isFetchSupported(){if(!("fetch"in WINDOW$2))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function isNativeFunction(Le){return Le&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(Le.toString())}function supportsNativeFetch(){var Ye;if(typeof EdgeRuntime=="string")return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(WINDOW$2.fetch))return!0;let Le=!1;const Be=WINDOW$2.document;if(Be&&typeof Be.createElement=="function")try{const tt=Be.createElement("iframe");tt.hidden=!0,Be.head.appendChild(tt),(Ye=tt.contentWindow)!=null&&Ye.fetch&&(Le=isNativeFunction(tt.contentWindow.fetch)),Be.head.removeChild(tt)}catch(tt){DEBUG_BUILD$2&&debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",tt)}return Le}function addFetchInstrumentationHandler(Le,Be){const Ye="fetch";addHandler(Ye,Le),maybeInstrument(Ye,()=>instrumentFetch(void 0,Be))}function instrumentFetch(Le,Be=!1){Be&&!supportsNativeFetch()||fill(GLOBAL_OBJ,"fetch",function(Ye){return function(...tt){const nt=new Error,{method:ft,url:ht}=parseFetchArgs(tt),gt={args:tt,fetchData:{method:ft,url:ht},startTimestamp:timestampInSeconds()*1e3,virtualError:nt,headers:getHeadersFromFetchArgs(tt)};return triggerHandlers("fetch",{...gt}),Ye.apply(GLOBAL_OBJ,tt).then(async At=>(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,response:At}),At),At=>{if(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,error:At}),isError(At)&&At.stack===void 0&&(At.stack=nt.stack,addNonEnumerableProperty(At,"framesToPop",1)),At instanceof TypeError&&(At.message==="Failed to fetch"||At.message==="Load failed"||At.message==="NetworkError when attempting to fetch resource."))try{const xt=new URL(gt.fetchData.url);At.message=`${At.message} (${xt.host})`}catch{}throw At})}})}function hasProp(Le,Be){return!!Le&&typeof Le=="object"&&!!Le[Be]}function getUrlFromResource(Le){return typeof Le=="string"?Le:Le?hasProp(Le,"url")?Le.url:Le.toString?Le.toString():"":""}function parseFetchArgs(Le){if(Le.length===0)return{method:"GET",url:""};if(Le.length===2){const[Ye,tt]=Le;return{url:getUrlFromResource(Ye),method:hasProp(tt,"method")?String(tt.method).toUpperCase():"GET"}}const Be=Le[0];return{url:getUrlFromResource(Be),method:hasProp(Be,"method")?String(Be.method).toUpperCase():"GET"}}function getHeadersFromFetchArgs(Le){const[Be,Ye]=Le;try{if(typeof Ye=="object"&&Ye!==null&&"headers"in Ye&&Ye.headers)return new Headers(Ye.headers);if(isRequest(Be))return new Headers(Be.headers)}catch{}}function getSDKSource(){return"npm"}const WINDOW$1=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout(()=>{ignoreOnError--})}function wrap(Le,Be={}){function Ye(nt){return typeof nt=="function"}if(!Ye(Le))return Le;try{const nt=Le.__sentry_wrapped__;if(nt)return typeof nt=="function"?nt:Le;if(getOriginalFunction(Le))return Le}catch{return Le}const tt=function(...nt){try{const ft=nt.map(ht=>wrap(ht,Be));return Le.apply(this,ft)}catch(ft){throw ignoreNextOnError(),withScope(ht=>{ht.addEventProcessor(gt=>(Be.mechanism&&(addExceptionTypeValue(gt,void 0),addExceptionMechanism(gt,Be.mechanism)),gt.extra={...gt.extra,arguments:nt},gt)),captureException(ft)}),ft}};try{for(const nt in Le)Object.prototype.hasOwnProperty.call(Le,nt)&&(tt[nt]=Le[nt])}catch{}markFunctionWrapped(tt,Le),addNonEnumerableProperty(Le,"__sentry_wrapped__",tt);try{Object.getOwnPropertyDescriptor(tt,"name").configurable&&Object.defineProperty(tt,"name",{get(){return Le.name}})}catch{}return tt}function getHttpRequestData(){const Le=getLocationHref(),{referrer:Be}=WINDOW$1.document||{},{userAgent:Ye}=WINDOW$1.navigator||{},tt={...Be&&{Referer:Be},...Ye&&{"User-Agent":Ye}};return{url:Le,headers:tt}}function exceptionFromError(Le,Be){const Ye=parseStackFrames(Le,Be),tt={type:extractType(Be),value:extractMessage(Be)};return Ye.length&&(tt.stacktrace={frames:Ye}),tt.type===void 0&&tt.value===""&&(tt.value="Unrecoverable error caught"),tt}function eventFromPlainObject(Le,Be,Ye,tt){const nt=getClient(),ft=nt==null?void 0:nt.getOptions().normalizeDepth,ht=getErrorPropertyFromObject(Be),gt={__serialized__:normalizeToSize(Be,ft)};if(ht)return{exception:{values:[exceptionFromError(Le,ht)]},extra:gt};const At={exception:{values:[{type:isEvent(Be)?Be.constructor.name:tt?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(Be,{isUnhandledRejection:tt})}]},extra:gt};if(Ye){const xt=parseStackFrames(Le,Ye);xt.length&&(At.exception.values[0].stacktrace={frames:xt})}return At}function eventFromError(Le,Be){return{exception:{values:[exceptionFromError(Le,Be)]}}}function parseStackFrames(Le,Be){const Ye=Be.stacktrace||Be.stack||"",tt=getSkipFirstStackStringLines(Be),nt=getPopFirstTopFrames(Be);try{return Le(Ye,tt,nt)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(Le){return Le&&reactMinifiedRegexp.test(Le.message)?1:0}function getPopFirstTopFrames(Le){return typeof Le.framesToPop=="number"?Le.framesToPop:0}function isWebAssemblyException(Le){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?Le instanceof WebAssembly.Exception:!1}function extractType(Le){const Be=Le==null?void 0:Le.name;return!Be&&isWebAssemblyException(Le)?Le.message&&Array.isArray(Le.message)&&Le.message.length==2?Le.message[0]:"WebAssembly.Exception":Be}function extractMessage(Le){const Be=Le==null?void 0:Le.message;return isWebAssemblyException(Le)?Array.isArray(Le.message)&&Le.message.length==2?Le.message[1]:"wasm exception":Be?Be.error&&typeof Be.error.message=="string"?Be.error.message:Be:"No error message"}function eventFromException(Le,Be,Ye,tt){const nt=(Ye==null?void 0:Ye.syntheticException)||void 0,ft=eventFromUnknownInput(Le,Be,nt,tt);return addExceptionMechanism(ft),ft.level="error",Ye!=null&&Ye.event_id&&(ft.event_id=Ye.event_id),resolvedSyncPromise(ft)}function eventFromMessage(Le,Be,Ye="info",tt,nt){const ft=(tt==null?void 0:tt.syntheticException)||void 0,ht=eventFromString(Le,Be,ft,nt);return ht.level=Ye,tt!=null&&tt.event_id&&(ht.event_id=tt.event_id),resolvedSyncPromise(ht)}function eventFromUnknownInput(Le,Be,Ye,tt,nt){let ft;if(isErrorEvent$1(Be)&&Be.error)return eventFromError(Le,Be.error);if(isDOMError(Be)||isDOMException(Be)){const ht=Be;if("stack"in Be)ft=eventFromError(Le,Be);else{const gt=ht.name||(isDOMError(ht)?"DOMError":"DOMException"),At=ht.message?`${gt}: ${ht.message}`:gt;ft=eventFromString(Le,At,Ye,tt),addExceptionTypeValue(ft,At)}return"code"in ht&&(ft.tags={...ft.tags,"DOMException.code":`${ht.code}`}),ft}return isError(Be)?eventFromError(Le,Be):isPlainObject(Be)||isEvent(Be)?(ft=eventFromPlainObject(Le,Be,Ye,nt),addExceptionMechanism(ft,{synthetic:!0}),ft):(ft=eventFromString(Le,Be,Ye,tt),addExceptionTypeValue(ft,`${Be}`),addExceptionMechanism(ft,{synthetic:!0}),ft)}function eventFromString(Le,Be,Ye,tt){const nt={};if(tt&&Ye){const ft=parseStackFrames(Le,Ye);ft.length&&(nt.exception={values:[{value:Be,stacktrace:{frames:ft}}]}),addExceptionMechanism(nt,{synthetic:!0})}if(isParameterizedString(Be)){const{__sentry_template_string__:ft,__sentry_template_values__:ht}=Be;return nt.logentry={message:ft,params:ht},nt}return nt.message=Be,nt}function getNonErrorObjectExceptionValue(Le,{isUnhandledRejection:Be}){const Ye=extractExceptionKeysForMessage(Le),tt=Be?"promise rejection":"exception";return isErrorEvent$1(Le)?`Event \`ErrorEvent\` captured as ${tt} with message \`${Le.message}\``:isEvent(Le)?`Event \`${getObjectClassName(Le)}\` (type=${Le.type}) captured as ${tt}`:`Object captured as ${tt} with keys: ${Ye}`}function getObjectClassName(Le){try{const Be=Object.getPrototypeOf(Le);return Be?Be.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(Le){for(const Be in Le)if(Object.prototype.hasOwnProperty.call(Le,Be)){const Ye=Le[Be];if(Ye instanceof Error)return Ye}}class BrowserClient extends Client{constructor(Be){var Et;const Ye=applyDefaultOptions(Be),tt=WINDOW$1.SENTRY_SDK_SOURCE||getSDKSource();applySdkMetadata(Ye,"browser",["browser"],tt),(Et=Ye._metadata)!=null&&Et.sdk&&(Ye._metadata.sdk.settings={infer_ip:Ye.sendDefaultPii?"auto":"never",...Ye._metadata.sdk.settings}),super(Ye);const{sendDefaultPii:nt,sendClientReports:ft,enableLogs:ht,_experiments:gt,enableMetrics:At}=this._options,xt=At??(gt==null?void 0:gt.enableMetrics)??!0;WINDOW$1.document&&(ft||ht||xt)&&WINDOW$1.document.addEventListener("visibilitychange",()=>{WINDOW$1.document.visibilityState==="hidden"&&(ft&&this._flushOutcomes(),ht&&_INTERNAL_flushLogsBuffer(this),xt&&_INTERNAL_flushMetricsBuffer(this))}),nt&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(Be,Ye){return eventFromException(this._options.stackParser,Be,Ye,this._options.attachStacktrace)}eventFromMessage(Be,Ye="info",tt){return eventFromMessage(this._options.stackParser,Be,Ye,tt,this._options.attachStacktrace)}_prepareEvent(Be,Ye,tt,nt){return Be.platform=Be.platform||"javascript",super._prepareEvent(Be,Ye,tt,nt)}}function applyDefaultOptions(Le){var Be;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(Be=WINDOW$1.SENTRY_RELEASE)==null?void 0:Be.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...Le}}const DEBUG_BUILD$1=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,WINDOW=GLOBAL_OBJ,DEBOUNCE_DURATION=1e3;let debounceTimerID,lastCapturedEventType,lastCapturedEventTargetId;function addClickKeypressInstrumentationHandler(Le){const Be="dom";addHandler(Be,Le),maybeInstrument(Be,instrumentDOM)}function instrumentDOM(){if(!WINDOW.document)return;const Le=triggerHandlers.bind(null,"dom"),Be=makeDOMEventHandler(Le,!0);WINDOW.document.addEventListener("click",Be,!1),WINDOW.document.addEventListener("keypress",Be,!1),["EventTarget","Node"].forEach(Ye=>{var ft,ht;const nt=(ft=WINDOW[Ye])==null?void 0:ft.prototype;(ht=nt==null?void 0:nt.hasOwnProperty)!=null&&ht.call(nt,"addEventListener")&&(fill(nt,"addEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},Ct=kt[At]=kt[At]||{refCount:0};if(!Ct.handler){const yt=makeDOMEventHandler(Le);Ct.handler=yt,gt.call(this,At,yt,Et)}Ct.refCount++}catch{}return gt.call(this,At,xt,Et)}}),fill(nt,"removeEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__||{},Ct=kt[At];Ct&&(Ct.refCount--,Ct.refCount<=0&&(gt.call(this,At,Ct.handler,Et),Ct.handler=void 0,delete kt[At]),Object.keys(kt).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return gt.call(this,At,xt,Et)}}))})}function isSimilarToLastCapturedEvent(Le){if(Le.type!==lastCapturedEventType)return!1;try{if(!Le.target||Le.target._sentryId!==lastCapturedEventTargetId)return!1}catch{}return!0}function shouldSkipDOMEvent(Le,Be){return Le!=="keypress"?!1:Be!=null&&Be.tagName?!(Be.tagName==="INPUT"||Be.tagName==="TEXTAREA"||Be.isContentEditable):!0}function makeDOMEventHandler(Le,Be=!1){return Ye=>{if(!Ye||Ye._sentryCaptured)return;const tt=getEventTarget(Ye);if(shouldSkipDOMEvent(Ye.type,tt))return;addNonEnumerableProperty(Ye,"_sentryCaptured",!0),tt&&!tt._sentryId&&addNonEnumerableProperty(tt,"_sentryId",uuid4());const nt=Ye.type==="keypress"?"input":Ye.type;isSimilarToLastCapturedEvent(Ye)||(Le({event:Ye,name:nt,global:Be}),lastCapturedEventType=Ye.type,lastCapturedEventTargetId=tt?tt._sentryId:void 0),clearTimeout(debounceTimerID),debounceTimerID=WINDOW.setTimeout(()=>{lastCapturedEventTargetId=void 0,lastCapturedEventType=void 0},DEBOUNCE_DURATION)}}function getEventTarget(Le){try{return Le.target}catch{return null}}let lastHref;function addHistoryInstrumentationHandler(Le){const Be="history";addHandler(Be,Le),maybeInstrument(Be,instrumentHistory)}function instrumentHistory(){if(WINDOW.addEventListener("popstate",()=>{const Be=WINDOW.location.href,Ye=lastHref;if(lastHref=Be,Ye===Be)return;triggerHandlers("history",{from:Ye,to:Be})}),!supportsHistory())return;function Le(Be){return function(...Ye){const tt=Ye.length>2?Ye[2]:void 0;if(tt){const nt=lastHref,ft=getAbsoluteUrl(String(tt));if(lastHref=ft,nt===ft)return Be.apply(this,Ye);triggerHandlers("history",{from:nt,to:ft})}return Be.apply(this,Ye)}}fill(WINDOW.history,"pushState",Le),fill(WINDOW.history,"replaceState",Le)}function getAbsoluteUrl(Le){try{return new URL(Le,WINDOW.location.origin).toString()}catch{return Le}}const cachedImplementations={};function getNativeImplementation(Le){const Be=cachedImplementations[Le];if(Be)return Be;let Ye=WINDOW[Le];if(isNativeFunction(Ye))return cachedImplementations[Le]=Ye.bind(WINDOW);const tt=WINDOW.document;if(tt&&typeof tt.createElement=="function")try{const nt=tt.createElement("iframe");nt.hidden=!0,tt.head.appendChild(nt);const ft=nt.contentWindow;ft!=null&&ft[Le]&&(Ye=ft[Le]),tt.head.removeChild(nt)}catch(nt){DEBUG_BUILD$1&&debug.warn(`Could not create sandbox iframe for ${Le} check, bailing to window.${Le}: `,nt)}return Ye&&(cachedImplementations[Le]=Ye.bind(WINDOW))}function clearCachedImplementation(Le){cachedImplementations[Le]=void 0}const SENTRY_XHR_DATA_KEY="__sentry_xhr_v3__";function addXhrInstrumentationHandler(Le){const Be="xhr";addHandler(Be,Le),maybeInstrument(Be,instrumentXHR)}function instrumentXHR(){if(!WINDOW.XMLHttpRequest)return;const Le=XMLHttpRequest.prototype;Le.open=new Proxy(Le.open,{apply(Be,Ye,tt){const nt=new Error,ft=timestampInSeconds()*1e3,ht=isString(tt[0])?tt[0].toUpperCase():void 0,gt=parseXhrUrlArg(tt[1]);if(!ht||!gt)return Be.apply(Ye,tt);Ye[SENTRY_XHR_DATA_KEY]={method:ht,url:gt,request_headers:{}},ht==="POST"&>.match(/sentry_key/)&&(Ye.__sentry_own_request__=!0);const At=()=>{const xt=Ye[SENTRY_XHR_DATA_KEY];if(xt&&Ye.readyState===4){try{xt.status_code=Ye.status}catch{}const Et={endTimestamp:timestampInSeconds()*1e3,startTimestamp:ft,xhr:Ye,virtualError:nt};triggerHandlers("xhr",Et)}};return"onreadystatechange"in Ye&&typeof Ye.onreadystatechange=="function"?Ye.onreadystatechange=new Proxy(Ye.onreadystatechange,{apply(xt,Et,kt){return At(),xt.apply(Et,kt)}}):Ye.addEventListener("readystatechange",At),Ye.setRequestHeader=new Proxy(Ye.setRequestHeader,{apply(xt,Et,kt){const[Ct,yt]=kt,vt=Et[SENTRY_XHR_DATA_KEY];return vt&&isString(Ct)&&isString(yt)&&(vt.request_headers[Ct.toLowerCase()]=yt),xt.apply(Et,kt)}}),Be.apply(Ye,tt)}}),Le.send=new Proxy(Le.send,{apply(Be,Ye,tt){const nt=Ye[SENTRY_XHR_DATA_KEY];if(!nt)return Be.apply(Ye,tt);tt[0]!==void 0&&(nt.body=tt[0]);const ft={startTimestamp:timestampInSeconds()*1e3,xhr:Ye};return triggerHandlers("xhr",ft),Be.apply(Ye,tt)}})}function parseXhrUrlArg(Le){if(isString(Le))return Le;try{return Le.toString()}catch{}}const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE=40;function makeFetchTransport(Le,Be=getNativeImplementation("fetch")){let Ye=0,tt=0;async function nt(ft){const ht=ft.body.length;Ye+=ht,tt++;const gt={body:ft.body,method:"POST",referrerPolicy:"strict-origin",headers:Le.headers,keepalive:Ye<=6e4&&tt<15,...Le.fetchOptions};try{const At=await Be(Le.url,gt);return{statusCode:At.status,headers:{"x-sentry-rate-limits":At.headers.get("X-Sentry-Rate-Limits"),"retry-after":At.headers.get("Retry-After")}}}catch(At){throw clearCachedImplementation("fetch"),At}finally{Ye-=ht,tt--}}return createTransport(Le,nt,makePromiseBuffer(Le.bufferSize||DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE))}const CHROME_PRIORITY=30,GECKO_PRIORITY=50;function createFrame(Le,Be,Ye,tt){const nt={filename:Le,function:Be==="<anonymous>"?UNKNOWN_FUNCTION:Be,in_app:!0};return Ye!==void 0&&(nt.lineno=Ye),tt!==void 0&&(nt.colno=tt),nt}const chromeRegexNoFnName=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeDataUriRegex=/at (.+?) ?\(data:(.+?),/,chromeStackParserFn=Le=>{const Be=Le.match(chromeDataUriRegex);if(Be)return{filename:`<data:${Be[2]}>`,function:Be[1]};const Ye=chromeRegexNoFnName.exec(Le);if(Ye){const[,nt,ft,ht]=Ye;return createFrame(nt,UNKNOWN_FUNCTION,+ft,+ht)}const tt=chromeRegex.exec(Le);if(tt){if(tt[2]&&tt[2].indexOf("eval")===0){const gt=chromeEvalRegex.exec(tt[2]);gt&&(tt[2]=gt[1],tt[3]=gt[2],tt[4]=gt[3])}const[ft,ht]=extractSafariExtensionDetails(tt[1]||UNKNOWN_FUNCTION,tt[2]);return createFrame(ht,ft,tt[3]?+tt[3]:void 0,tt[4]?+tt[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chromeStackParserFn],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=Le=>{const Be=geckoREgex.exec(Le);if(Be){if(Be[3]&&Be[3].indexOf(" > eval")>-1){const ft=geckoEvalRegex.exec(Be[3]);ft&&(Be[1]=Be[1]||"eval",Be[3]=ft[1],Be[4]=ft[2],Be[5]="")}let tt=Be[3],nt=Be[1]||UNKNOWN_FUNCTION;return[nt,tt]=extractSafariExtensionDetails(nt,tt),createFrame(tt,nt,Be[4]?+Be[4]:void 0,Be[5]?+Be[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(Le,Be)=>{const Ye=Le.indexOf("safari-extension")!==-1,tt=Le.indexOf("safari-web-extension")!==-1;return Ye||tt?[Le.indexOf("@")!==-1?Le.split("@")[0]:UNKNOWN_FUNCTION,Ye?`safari-extension:${Be}`:`safari-web-extension:${Be}`]:[Le,Be]},DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,MAX_ALLOWED_STRING_LENGTH=1024,INTEGRATION_NAME$3="Breadcrumbs",_breadcrumbsIntegration=(Le={})=>{const Be={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...Le};return{name:INTEGRATION_NAME$3,setup(Ye){Be.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(Ye)),Be.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(Ye,Be.dom)),Be.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(Ye)),Be.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(Ye)),Be.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(Ye)),Be.sentry&&Ye.on("beforeSendEvent",_getSentryBreadcrumbHandler(Ye))}}},breadcrumbsIntegration=_breadcrumbsIntegration;function _getSentryBreadcrumbHandler(Le){return function(Ye){getClient()===Le&&addBreadcrumb({category:`sentry.${Ye.type==="transaction"?"transaction":"event"}`,event_id:Ye.event_id,level:Ye.level,message:getEventDescription(Ye)},{event:Ye})}}function _getDomBreadcrumbHandler(Le,Be){return function(tt){if(getClient()!==Le)return;let nt,ft,ht=typeof Be=="object"?Be.serializeAttribute:void 0,gt=typeof Be=="object"&&typeof Be.maxStringLength=="number"?Be.maxStringLength:void 0;gt&>>MAX_ALLOWED_STRING_LENGTH&&(DEBUG_BUILD&&debug.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${gt} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),gt=MAX_ALLOWED_STRING_LENGTH),typeof ht=="string"&&(ht=[ht]);try{const xt=tt.event,Et=_isEvent(xt)?xt.target:xt;nt=htmlTreeAsString(Et,{keyAttrs:ht,maxStringLength:gt}),ft=getComponentName(Et)}catch{nt="<unknown>"}if(nt.length===0)return;const At={category:`ui.${tt.name}`,message:nt};ft&&(At.data={"ui.component_name":ft}),addBreadcrumb(At,{event:tt.event,name:tt.name,global:tt.global})}}function _getConsoleBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;const tt={category:"console",data:{arguments:Ye.args,logger:"console"},level:severityLevelFromString(Ye.level),message:safeJoin(Ye.args," ")};if(Ye.level==="assert")if(Ye.args[0]===!1)tt.message=`Assertion failed: ${safeJoin(Ye.args.slice(1)," ")||"console.assert"}`,tt.data.arguments=Ye.args.slice(1);else return;addBreadcrumb(tt,{input:Ye.args,level:Ye.level})}}function _getXhrBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;const{startTimestamp:tt,endTimestamp:nt}=Ye,ft=Ye.xhr[SENTRY_XHR_DATA_KEY];if(!tt||!nt||!ft)return;const{method:ht,url:gt,status_code:At,body:xt}=ft,Et={method:ht,url:gt,status_code:At},kt={xhr:Ye.xhr,input:xt,startTimestamp:tt,endTimestamp:nt},Ct={category:"xhr",data:Et,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(At)};Le.emit("beforeOutgoingRequestBreadcrumb",Ct,kt),addBreadcrumb(Ct,kt)}}function _getFetchBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;const{startTimestamp:tt,endTimestamp:nt}=Ye;if(nt&&!(Ye.fetchData.url.match(/sentry_key/)&&Ye.fetchData.method==="POST"))if(Ye.fetchData.method,Ye.fetchData.url,Ye.error){const ft=Ye.fetchData,ht={data:Ye.error,input:Ye.args,startTimestamp:tt,endTimestamp:nt},gt={category:"fetch",data:ft,level:"error",type:"http"};Le.emit("beforeOutgoingRequestBreadcrumb",gt,ht),addBreadcrumb(gt,ht)}else{const ft=Ye.response,ht={...Ye.fetchData,status_code:ft==null?void 0:ft.status};Ye.fetchData.request_body_size,Ye.fetchData.response_body_size,ft==null||ft.status;const gt={input:Ye.args,response:ft,startTimestamp:tt,endTimestamp:nt},At={category:"fetch",data:ht,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(ht.status_code)};Le.emit("beforeOutgoingRequestBreadcrumb",At,gt),addBreadcrumb(At,gt)}}}function _getHistoryBreadcrumbHandler(Le){return function(Ye){if(getClient()!==Le)return;let tt=Ye.from,nt=Ye.to;const ft=parseUrl(WINDOW$1.location.href);let ht=tt?parseUrl(tt):void 0;const gt=parseUrl(nt);ht!=null&&ht.path||(ht=ft),ft.protocol===gt.protocol&&ft.host===gt.host&&(nt=gt.relative),ft.protocol===ht.protocol&&ft.host===ht.host&&(tt=ht.relative),addBreadcrumb({category:"navigation",data:{from:tt,to:nt}})}}function _isEvent(Le){return!!Le&&!!Le.target}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],INTEGRATION_NAME$2="BrowserApiErrors",_browserApiErrorsIntegration=(Le={})=>{const Be={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...Le};return{name:INTEGRATION_NAME$2,setupOnce(){Be.setTimeout&&fill(WINDOW$1,"setTimeout",_wrapTimeFunction),Be.setInterval&&fill(WINDOW$1,"setInterval",_wrapTimeFunction),Be.requestAnimationFrame&&fill(WINDOW$1,"requestAnimationFrame",_wrapRAF),Be.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$1&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const Ye=Be.eventTarget;Ye&&(Array.isArray(Ye)?Ye:DEFAULT_EVENT_TARGET).forEach(nt=>_wrapEventTarget(nt,Be))}}},browserApiErrorsIntegration=_browserApiErrorsIntegration;function _wrapTimeFunction(Le){return function(...Be){const Ye=Be[0];return Be[0]=wrap(Ye,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${getFunctionName(Le)}`}}),Le.apply(this,Be)}}function _wrapRAF(Le){return function(Be){return Le.apply(this,[wrap(Be,{mechanism:{data:{handler:getFunctionName(Le)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(Le){return function(...Be){const Ye=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(nt=>{nt in Ye&&typeof Ye[nt]=="function"&&fill(Ye,nt,function(ft){const ht={mechanism:{data:{handler:getFunctionName(ft)},handled:!1,type:`auto.browser.browserapierrors.xhr.${nt}`}},gt=getOriginalFunction(ft);return gt&&(ht.mechanism.data.handler=getFunctionName(gt)),wrap(ft,ht)})}),Le.apply(this,Be)}}function _wrapEventTarget(Le,Be){var nt,ft;const tt=(nt=WINDOW$1[Le])==null?void 0:nt.prototype;(ft=tt==null?void 0:tt.hasOwnProperty)!=null&&ft.call(tt,"addEventListener")&&(fill(tt,"addEventListener",function(ht){return function(gt,At,xt){try{isEventListenerObject(At)&&(At.handleEvent=wrap(At.handleEvent,{mechanism:{data:{handler:getFunctionName(At),target:Le},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return Be.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,gt,At),ht.apply(this,[gt,wrap(At,{mechanism:{data:{handler:getFunctionName(At),target:Le},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),xt])}}),fill(tt,"removeEventListener",function(ht){return function(gt,At,xt){try{const Et=At.__sentry_wrapped__;Et&&ht.call(this,gt,Et,xt)}catch{}return ht.call(this,gt,At,xt)}}))}function isEventListenerObject(Le){return typeof Le.handleEvent=="function"}function unregisterOriginalCallback(Le,Be,Ye){Le&&typeof Le=="object"&&"removeEventListener"in Le&&typeof Le.removeEventListener=="function"&&Le.removeEventListener(Be,Ye)}const browserSessionIntegration=()=>({name:"BrowserSession",setupOnce(){if(typeof WINDOW$1.document>"u"){DEBUG_BUILD&&debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}startSession({ignoreDuration:!0}),captureSession(),addHistoryInstrumentationHandler(({from:Le,to:Be})=>{Le!==void 0&&Le!==Be&&(startSession({ignoreDuration:!0}),captureSession())})}}),INTEGRATION_NAME$1="GlobalHandlers",_globalHandlersIntegration=(Le={})=>{const Be={onerror:!0,onunhandledrejection:!0,...Le};return{name:INTEGRATION_NAME$1,setupOnce(){Error.stackTraceLimit=50},setup(Ye){Be.onerror&&(_installGlobalOnErrorHandler(Ye),globalHandlerLog("onerror")),Be.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(Ye),globalHandlerLog("onunhandledrejection"))}}},globalHandlersIntegration=_globalHandlersIntegration;function _installGlobalOnErrorHandler(Le){addGlobalErrorInstrumentationHandler(Be=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Le||shouldIgnoreOnError())return;const{msg:nt,url:ft,line:ht,column:gt,error:At}=Be,xt=_enhanceEventWithInitialFrame(eventFromUnknownInput(Ye,At||nt,void 0,tt,!1),ft,ht,gt);xt.level="error",captureEvent(xt,{originalException:At,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function _installGlobalOnUnhandledRejectionHandler(Le){addGlobalUnhandledRejectionInstrumentationHandler(Be=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Le||shouldIgnoreOnError())return;const nt=_getUnhandledRejectionError(Be),ft=isPrimitive(nt)?_eventFromRejectionWithPrimitive(nt):eventFromUnknownInput(Ye,nt,void 0,tt,!0);ft.level="error",captureEvent(ft,{originalException:nt,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function _getUnhandledRejectionError(Le){if(isPrimitive(Le))return Le;try{if("reason"in Le)return Le.reason;if("detail"in Le&&"reason"in Le.detail)return Le.detail.reason}catch{}return Le}function _eventFromRejectionWithPrimitive(Le){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(Le)}`}]}}}function _enhanceEventWithInitialFrame(Le,Be,Ye,tt){const nt=Le.exception=Le.exception||{},ft=nt.values=nt.values||[],ht=ft[0]=ft[0]||{},gt=ht.stacktrace=ht.stacktrace||{},At=gt.frames=gt.frames||[],xt=tt,Et=Ye,kt=getFilenameFromUrl(Be)??getLocationHref();return At.length===0&&At.push({colno:xt,filename:kt,function:UNKNOWN_FUNCTION,in_app:!0,lineno:Et}),Le}function globalHandlerLog(Le){DEBUG_BUILD&&debug.log(`Global Handler attached: ${Le}`)}function getOptions(){const Le=getClient();return(Le==null?void 0:Le.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function getFilenameFromUrl(Le){if(!(!isString(Le)||Le.length===0)){if(Le.startsWith("data:")){const Be=Le.match(/^data:([^;]+)/),Ye=Be?Be[1]:"text/javascript",tt=Le.includes("base64,");return`<data:${Ye}${tt?",base64":""}>`}return Le}}const httpContextIntegration=()=>({name:"HttpContext",preprocessEvent(Le){var tt;if(!WINDOW$1.navigator&&!WINDOW$1.location&&!WINDOW$1.document)return;const Be=getHttpRequestData(),Ye={...Be.headers,...(tt=Le.request)==null?void 0:tt.headers};Le.request={...Be,...Le.request,headers:Ye}}}),DEFAULT_KEY="cause",DEFAULT_LIMIT=5,INTEGRATION_NAME="LinkedErrors",_linkedErrorsIntegration=(Le={})=>{const Be=Le.limit||DEFAULT_LIMIT,Ye=Le.key||DEFAULT_KEY;return{name:INTEGRATION_NAME,preprocessEvent(tt,nt,ft){const ht=ft.getOptions();applyAggregateErrorsToEvent(exceptionFromError,ht.stackParser,Ye,Be,tt,nt)}}},linkedErrorsIntegration=_linkedErrorsIntegration;function checkAndWarnIfIsEmbeddedBrowserExtension(){return _isEmbeddedBrowserExtension()?(DEBUG_BUILD&&consoleSandbox(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function _isEmbeddedBrowserExtension(){var ft;if(typeof WINDOW$1.window>"u")return!1;const Le=WINDOW$1;if(Le.nw)return!1;const Be=Le.chrome||Le.browser;if(!((ft=Be==null?void 0:Be.runtime)!=null&&ft.id))return!1;const Ye=getLocationHref(),tt=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(WINDOW$1===WINDOW$1.top&&tt.some(ht=>Ye.startsWith(`${ht}://`)))}function getDefaultIntegrations(Le){return[inboundFiltersIntegration(),functionToStringIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),browserSessionIntegration()]}function init(Le={}){const Be=!Le.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();let Ye=Le.defaultIntegrations==null?getDefaultIntegrations():Le.defaultIntegrations;const tt={...Le,enabled:Be?!1:Le.enabled,stackParser:stackParserFromStackParserOptions(Le.stackParser||defaultStackParser),integrations:getIntegrationsToSetup({integrations:Le.integrations,defaultIntegrations:Ye}),transport:Le.transport||makeFetchTransport};return initAndBind(BrowserClient,tt)}const DEPRECATION_PERIOD_MONTHS=12,SDK_RELEASE_DATE="2026-11-06",DEPRECATED_SDK_WARNING_MESSAGE="You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";let hasWarned=!1;const parseReleaseDate=Le=>{const Be=/^(\d{4})-(\d{2})-(\d{2})$/.exec(Le);if(!Be)return null;const Ye=Number(Be[1]),tt=Number(Be[2])-1,nt=Number(Be[3]),ft=new Date(Date.UTC(Ye,tt,nt));return ft.getUTCFullYear()!==Ye||ft.getUTCMonth()!==tt||ft.getUTCDate()!==nt?null:ft},isSdkDeprecated=(Le,Be=new Date)=>{const Ye=parseReleaseDate(Le);if(!Ye)return!1;const tt=new Date(Date.UTC(Ye.getUTCFullYear(),Ye.getUTCMonth()+DEPRECATION_PERIOD_MONTHS,Ye.getUTCDate()));return Be.getTime()>=tt.getTime()},warnIfSdkDeprecated=(Le=SDK_RELEASE_DATE,Be=new Date)=>{hasWarned||!isSdkDeprecated(Le,Be)||(hasWarned=!0,console.warn(DEPRECATED_SDK_WARNING_MESSAGE))};function setupFiles(){const Le={pollingIntervalSeconds:.25,maxMillisBeforeAckWhenClosed:100,moreAnnoyingDebuggerStatements:1,onDetectOpen:()=>{var xt;addDeviceStats((xt=state.token)==null?void 0:xt.token,{inspectorOpened:!0}),MlWasmApi.setInspectorOpened(!0)},onDetectClose:void 0,startup:"asap",onCheckOpennessWhilePaused:"throw"};Object.seal(Le);const Be=new Worker(URL.createObjectURL(new Blob([`"use strict";
|
|
10063
10063
|
onmessage = (ev) => { postMessage({isOpenBeat:true});
|
|
10064
10064
|
debugger; for (let i = 0; i < ev.data.moreDebugs; i++) { debugger; }
|
|
10065
10065
|
postMessage({isOpenBeat:false});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "./dist/onBoarding.umd.js",
|
|
4
4
|
"module": "./dist/onBoarding.mjs",
|
|
5
5
|
"types": "./dist/onBoarding.d.ts",
|
|
6
|
-
"version": "1.95.0
|
|
6
|
+
"version": "1.95.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/IncodeTechnologies/ms-incodesmile-web.git",
|