@sekyro/web 0.1.0-rc.39 → 0.1.0-rc.40
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/CHANGELOG.md +6 -0
- package/dist/{capture-session-doc-J4MIDQOS.js → capture-session-doc-DFLSX6BB.js} +1 -1
- package/dist/{capture-session-v3-DjWqEJG0.d.cts → capture-session-v3-C-9FB_vX.d.cts} +1 -1
- package/dist/{capture-session-v3-BnRN9WuV.d.ts → capture-session-v3-DEpGJ_fI.d.ts} +1 -1
- package/dist/{chunk-HMOOVRKA.js → chunk-22AW4NJD.js} +1 -1
- package/dist/{chunk-WI7GAUCH.js → chunk-4NO6MQPH.js} +1 -1
- package/dist/{chunk-P5OIQXVM.js → chunk-BPAGOPYL.js} +1 -1
- package/dist/{chunk-7FGOUBAN.js → chunk-FYU7J2DC.js} +1 -1
- package/dist/{chunk-TGSMTRG5.js → chunk-L3TNFMQK.js} +1 -1
- package/dist/{chunk-UKYJYZZS.js → chunk-M3637QGB.js} +1 -1
- package/dist/{chunk-PNOGF72U.js → chunk-QZUFICG3.js} +1 -1
- package/dist/{chunk-3565JBSZ.js → chunk-SJ5OJ677.js} +1 -1
- package/dist/chunk-Y5GRT27C.js +3 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -1
- package/dist/{create-document-capture-SMEKDBGF.js → create-document-capture-4ZOSBL3Y.js} +1 -1
- package/dist/{create-verification-C6Hoh_0h.d.ts → create-verification-B8c9xBnz.d.ts} +6 -4
- package/dist/{create-verification-BSOb3N6w.d.cts → create-verification-BadlGBh3.d.cts} +6 -4
- package/dist/{icao-gate-C-fkVe6r.d.cts → icao-gate-BqXxEAq6.d.cts} +1 -1
- package/dist/{icao-gate-Bux2CcJc.d.ts → icao-gate-C7D7Lce7.d.ts} +1 -1
- package/dist/{icao-policy-C5XcEwqj.d.ts → icao-policy-Bo7TQyTd.d.ts} +2 -2
- package/dist/{icao-policy-B_daycJk.d.cts → icao-policy-CgSI4oFo.d.cts} +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +2 -2
- package/dist/internal/index.d.cts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +1 -1
- package/dist/{plan-runner-ZVYJ3UI3.js → plan-runner-3BLEJWHF.js} +1 -1
- package/dist/{types-BUnFqG97.d.cts → types-BAAj6TOZ.d.cts} +11 -1
- package/dist/{types-BUnFqG97.d.ts → types-BAAj6TOZ.d.ts} +11 -1
- package/package.json +1 -1
- package/sbom.cdx.json +19 -19
- package/dist/chunk-26XZRWBD.js +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { bf as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bg as HostedClientLike, bh as DocCatalogEntry, bi as DeviceTier, bj as LiveMrzTuning, bk as TextLockTuning, bl as OcrEngineClient, bm as DocAssistReport, bn as ReadyInfo, bo as LoadFailure, bp as OcrEngineOptions } from '../create-verification-
|
|
2
|
-
export { bq as ANALYSIS_LONG_EDGE, br as ASPECT_BANDS, bs as AttestationError, bt as BLUR_REFUSE_SHARPNESS_MAX, bu as BlurStatus, bv as CAPTURE_CANDIDATE_SPACING_MS, bw as CAPTURE_EXTRA_CANDIDATES, bx as CHALLENGE_EXECUTE_TIMEOUT_MS, by as CHALLENGE_READY_TIMEOUT_MS, bz as CLIP_MIME_ALLOWLIST, bA as CaptureEngine, bB as CaptureSessionDoc, bC as CaptureSessionDocEvents, bD as CaptureSessionDocOptions, bE as ChallengeAction, bF as ChallengeError, m as ChallengeErrorCode, bG as DOC_ANALYSIS_DEFAULTS, bH as DOC_BLACK_FRAME_LUMA, bI as DOC_BLACK_FRAME_TICKS, bJ as DOC_CADENCE_HZ, bK as DOC_CAMERA_TUNING_DEFAULTS, bL as DOC_CATALOG, bM as DOC_DETECT_WIDTH, bN as DOC_FEEDBACK_STATES, bO as DOC_FIRST_FRAME_MS, bP as DOC_GATE_V1_DEFAULTS, bQ as DOC_SHUTTER_DEFAULTS, bR as DeviceReadHint, bS as DocArtifacts, bT as DocAssist, bU as DocAssistEngine, bV as DocAssistTick, bW as DocCameraTuning, bX as DocCaptureReport, bY as DocCaptureVia, bZ as DocChecksPayload, b_ as DocEngineLike, b$ as DocFeedbackAggregator, c0 as DocFeedbackKey, c1 as DocFeedbackState, c2 as DocFormat, c3 as DocFrameAnalysis, c4 as DocFrameMeasures, c5 as DocGateQuality, c6 as DocGateThresholds, c7 as DocGateTick, c8 as DocGateTickInput, c9 as DocGateV1, ca as DocQuad, cb as DocQuadPoint, cc as DocShutterReason, cd as DocShutterTuning, ce as DocSide, cf as DocumentCaptureController, cg as DocumentCaptureInternals, ch as EMPTY_GUIDE_METRICS, ci as EncodedDocument, cj as ExecuteChallengeOptions, ck as FLIP_FILL_MIN, cl as FLIP_GAP_MS, cm as FLIP_TIMEOUT_MS, cn as FocusCaps, co as FramingStatus, cp as GUIDE_LOCK_DEFAULTS, cq as GlareStatus, cr as GrabbedFrame, cs as GuideBlocker, ct as GuideLock, cu as GuideLockTick, cv as GuideLockTuning, cw as GuideMetrics, cx as GuideRect, cy as INFERENCE_RETRY_ATTEMPTS, cz as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cA as LANDMARKER_MODEL, cB as LENS_STORAGE_KEY, cC as LIVE_MRZ_DEFAULTS, cD as LIVE_PHOTO_IDLE_MS, cE as LIVE_PHOTO_MAX_HZ, cF as LandmarkedFace, cG as LandmarkerLike, cH as LensSource, cI as LightingStatus, cJ as LiveMrzCapture, cK as LiveMrzState, cL as LivePhotoGate, cM as LivePhotoKit, cN as LivePhotoKitInternals, cO as LivePhotoKitOptions, cP as LivePhotoStill, cQ as LivenessCaptureInternalHandle, cR as LivenessCaptureInternals, cS as LivenessFlowDeps, cT as LivenessFlowOutcome, cU as MANUAL_SHUTTER_MS, cV as MR_DOC_CATALOG, cW as NO_REPORT_MS, cX as OpenDocCameraDeps, cY as PORTRAIT_JPEG_QUALITY, cZ as PRELOAD_BLAZE_INIT_TIMEOUT_MS, c_ as PRELOAD_BUDGET_MS, c$ as PROCESSING_POLL_DELAY_MS, d0 as PROCESSING_POLL_MAX, d1 as PortraitCaptureController, d2 as PortraitCaptureInternals, d3 as REGISTRY_RETRY_DELAY_MS, d4 as ReticleType, d5 as SAME_FACE_MAX_DROPS, d6 as ScanEvent, d7 as ScanLayout, d8 as ScanNotice, d9 as ScanPhase, da as ScanReport, db as ScanSide, dc as ScanState, dd as SubmitExecutor, de as TEXT_LOCK_DEFAULTS, df as TRANSPORT_REPLAY_ATTEMPTS, dg as TRANSPORT_REPLAY_DELAY_MS, dh as VerificationInternals, di as analyzeDocFrame, dj as analyzeGuide, dk as aspectBand, dl as aspectFits, dm as buildDeviceReadHint, dn as coverPointToVideo, dp as createDocumentCaptureInternal, dq as createFaceLandmarker, dr as createLivePhotoKit, ds as createLivenessCaptureInternal, dt as createPortraitCaptureInternal, du as createVerificationInternal, dv as docZoomFor, dw as encodeDocumentImage, dx as executeChallenge, dy as facesOf, dz as feedbackVoteOf, dA as focusOk, dB as guideQuad, dC as guideRegionInFrame, dD as initialScanState, dE as mapEngineState, dF as mapErrorKind, dG as mapGuidanceHint, dH as nextScanState, dI as observePortraitFrame, dJ as openDocCamera, dK as passportBandOf, dL as portraitMatchStep, dM as preloadedDetectorFactory, dN as quadAreaFrac, dO as quadBounds, dP as quadIou, dQ as quadTiltRatio, dR as randomUuid, dS as readStoredLens, dT as resetChallengeFrameForTests, dU as resetLivenessAssetsForTests, dV as resolveDocCameraTuning, dW as resolveDocShutterTuning, dX as resolveGuideLockTuning, dY as runLivenessFlow, dZ as runSubmission, d_ as scannerFormatFor, d$ as setPreloadLoaderForTests, e0 as settledHint, e1 as singleShotFocusAt, e2 as specularFraction, e3 as supportsFocusMode, e4 as warmDocDetector, e5 as writeStoredLens } from '../create-verification-
|
|
1
|
+
import { bf as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bg as HostedClientLike, bh as DocCatalogEntry, bi as DeviceTier, bj as LiveMrzTuning, bk as TextLockTuning, bl as OcrEngineClient, bm as DocAssistReport, bn as ReadyInfo, bo as LoadFailure, bp as OcrEngineOptions } from '../create-verification-BadlGBh3.cjs';
|
|
2
|
+
export { bq as ANALYSIS_LONG_EDGE, br as ASPECT_BANDS, bs as AttestationError, bt as BLUR_REFUSE_SHARPNESS_MAX, bu as BlurStatus, bv as CAPTURE_CANDIDATE_SPACING_MS, bw as CAPTURE_EXTRA_CANDIDATES, bx as CHALLENGE_EXECUTE_TIMEOUT_MS, by as CHALLENGE_READY_TIMEOUT_MS, bz as CLIP_MIME_ALLOWLIST, bA as CaptureEngine, bB as CaptureSessionDoc, bC as CaptureSessionDocEvents, bD as CaptureSessionDocOptions, bE as ChallengeAction, bF as ChallengeError, m as ChallengeErrorCode, bG as DOC_ANALYSIS_DEFAULTS, bH as DOC_BLACK_FRAME_LUMA, bI as DOC_BLACK_FRAME_TICKS, bJ as DOC_CADENCE_HZ, bK as DOC_CAMERA_TUNING_DEFAULTS, bL as DOC_CATALOG, bM as DOC_DETECT_WIDTH, bN as DOC_FEEDBACK_STATES, bO as DOC_FIRST_FRAME_MS, bP as DOC_GATE_V1_DEFAULTS, bQ as DOC_SHUTTER_DEFAULTS, bR as DeviceReadHint, bS as DocArtifacts, bT as DocAssist, bU as DocAssistEngine, bV as DocAssistTick, bW as DocCameraTuning, bX as DocCaptureReport, bY as DocCaptureVia, bZ as DocChecksPayload, b_ as DocEngineLike, b$ as DocFeedbackAggregator, c0 as DocFeedbackKey, c1 as DocFeedbackState, c2 as DocFormat, c3 as DocFrameAnalysis, c4 as DocFrameMeasures, c5 as DocGateQuality, c6 as DocGateThresholds, c7 as DocGateTick, c8 as DocGateTickInput, c9 as DocGateV1, ca as DocQuad, cb as DocQuadPoint, cc as DocShutterReason, cd as DocShutterTuning, ce as DocSide, cf as DocumentCaptureController, cg as DocumentCaptureInternals, ch as EMPTY_GUIDE_METRICS, ci as EncodedDocument, cj as ExecuteChallengeOptions, ck as FLIP_FILL_MIN, cl as FLIP_GAP_MS, cm as FLIP_TIMEOUT_MS, cn as FocusCaps, co as FramingStatus, cp as GUIDE_LOCK_DEFAULTS, cq as GlareStatus, cr as GrabbedFrame, cs as GuideBlocker, ct as GuideLock, cu as GuideLockTick, cv as GuideLockTuning, cw as GuideMetrics, cx as GuideRect, cy as INFERENCE_RETRY_ATTEMPTS, cz as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cA as LANDMARKER_MODEL, cB as LENS_STORAGE_KEY, cC as LIVE_MRZ_DEFAULTS, cD as LIVE_PHOTO_IDLE_MS, cE as LIVE_PHOTO_MAX_HZ, cF as LandmarkedFace, cG as LandmarkerLike, cH as LensSource, cI as LightingStatus, cJ as LiveMrzCapture, cK as LiveMrzState, cL as LivePhotoGate, cM as LivePhotoKit, cN as LivePhotoKitInternals, cO as LivePhotoKitOptions, cP as LivePhotoStill, cQ as LivenessCaptureInternalHandle, cR as LivenessCaptureInternals, cS as LivenessFlowDeps, cT as LivenessFlowOutcome, cU as MANUAL_SHUTTER_MS, cV as MR_DOC_CATALOG, cW as NO_REPORT_MS, cX as OpenDocCameraDeps, cY as PORTRAIT_JPEG_QUALITY, cZ as PRELOAD_BLAZE_INIT_TIMEOUT_MS, c_ as PRELOAD_BUDGET_MS, c$ as PROCESSING_POLL_DELAY_MS, d0 as PROCESSING_POLL_MAX, d1 as PortraitCaptureController, d2 as PortraitCaptureInternals, d3 as REGISTRY_RETRY_DELAY_MS, d4 as ReticleType, d5 as SAME_FACE_MAX_DROPS, d6 as ScanEvent, d7 as ScanLayout, d8 as ScanNotice, d9 as ScanPhase, da as ScanReport, db as ScanSide, dc as ScanState, dd as SubmitExecutor, de as TEXT_LOCK_DEFAULTS, df as TRANSPORT_REPLAY_ATTEMPTS, dg as TRANSPORT_REPLAY_DELAY_MS, dh as VerificationInternals, di as analyzeDocFrame, dj as analyzeGuide, dk as aspectBand, dl as aspectFits, dm as buildDeviceReadHint, dn as coverPointToVideo, dp as createDocumentCaptureInternal, dq as createFaceLandmarker, dr as createLivePhotoKit, ds as createLivenessCaptureInternal, dt as createPortraitCaptureInternal, du as createVerificationInternal, dv as docZoomFor, dw as encodeDocumentImage, dx as executeChallenge, dy as facesOf, dz as feedbackVoteOf, dA as focusOk, dB as guideQuad, dC as guideRegionInFrame, dD as initialScanState, dE as mapEngineState, dF as mapErrorKind, dG as mapGuidanceHint, dH as nextScanState, dI as observePortraitFrame, dJ as openDocCamera, dK as passportBandOf, dL as portraitMatchStep, dM as preloadedDetectorFactory, dN as quadAreaFrac, dO as quadBounds, dP as quadIou, dQ as quadTiltRatio, dR as randomUuid, dS as readStoredLens, dT as resetChallengeFrameForTests, dU as resetLivenessAssetsForTests, dV as resolveDocCameraTuning, dW as resolveDocShutterTuning, dX as resolveGuideLockTuning, dY as runLivenessFlow, dZ as runSubmission, d_ as scannerFormatFor, d$ as setPreloadLoaderForTests, e0 as settledHint, e1 as singleShotFocusAt, e2 as specularFraction, e3 as supportsFocusMode, e4 as warmDocDetector, e5 as writeStoredLens } from '../create-verification-BadlGBh3.cjs';
|
|
3
3
|
export { O as OCR_ASSET_SET } from '../assets.generated-DpkbvoII.cjs';
|
|
4
4
|
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-CVqpMNGA.cjs';
|
|
5
|
-
import { aa as HostedSessionView, i as CheckType, aH as PlanStepView } from '../types-
|
|
6
|
-
export {
|
|
7
|
-
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-
|
|
5
|
+
import { aa as HostedSessionView, i as CheckType, aH as PlanStepView } from '../types-BAAj6TOZ.cjs';
|
|
6
|
+
export { bv as ICAO_FALLBACK, bp as IcaoCaptureTuning, bw as IcaoProfile, bx as ResolvedIcaoTuning, by as resolveIcaoTuning } from '../types-BAAj6TOZ.cjs';
|
|
7
|
+
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-BqXxEAq6.cjs';
|
|
8
8
|
import '../detect-worker-CHqsPJoM.cjs';
|
|
9
|
-
import '../capture-session-v3-
|
|
9
|
+
import '../capture-session-v3-C-9FB_vX.cjs';
|
|
10
10
|
|
|
11
11
|
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
12
12
|
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { bf as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bg as HostedClientLike, bh as DocCatalogEntry, bi as DeviceTier, bj as LiveMrzTuning, bk as TextLockTuning, bl as OcrEngineClient, bm as DocAssistReport, bn as ReadyInfo, bo as LoadFailure, bp as OcrEngineOptions } from '../create-verification-
|
|
2
|
-
export { bq as ANALYSIS_LONG_EDGE, br as ASPECT_BANDS, bs as AttestationError, bt as BLUR_REFUSE_SHARPNESS_MAX, bu as BlurStatus, bv as CAPTURE_CANDIDATE_SPACING_MS, bw as CAPTURE_EXTRA_CANDIDATES, bx as CHALLENGE_EXECUTE_TIMEOUT_MS, by as CHALLENGE_READY_TIMEOUT_MS, bz as CLIP_MIME_ALLOWLIST, bA as CaptureEngine, bB as CaptureSessionDoc, bC as CaptureSessionDocEvents, bD as CaptureSessionDocOptions, bE as ChallengeAction, bF as ChallengeError, m as ChallengeErrorCode, bG as DOC_ANALYSIS_DEFAULTS, bH as DOC_BLACK_FRAME_LUMA, bI as DOC_BLACK_FRAME_TICKS, bJ as DOC_CADENCE_HZ, bK as DOC_CAMERA_TUNING_DEFAULTS, bL as DOC_CATALOG, bM as DOC_DETECT_WIDTH, bN as DOC_FEEDBACK_STATES, bO as DOC_FIRST_FRAME_MS, bP as DOC_GATE_V1_DEFAULTS, bQ as DOC_SHUTTER_DEFAULTS, bR as DeviceReadHint, bS as DocArtifacts, bT as DocAssist, bU as DocAssistEngine, bV as DocAssistTick, bW as DocCameraTuning, bX as DocCaptureReport, bY as DocCaptureVia, bZ as DocChecksPayload, b_ as DocEngineLike, b$ as DocFeedbackAggregator, c0 as DocFeedbackKey, c1 as DocFeedbackState, c2 as DocFormat, c3 as DocFrameAnalysis, c4 as DocFrameMeasures, c5 as DocGateQuality, c6 as DocGateThresholds, c7 as DocGateTick, c8 as DocGateTickInput, c9 as DocGateV1, ca as DocQuad, cb as DocQuadPoint, cc as DocShutterReason, cd as DocShutterTuning, ce as DocSide, cf as DocumentCaptureController, cg as DocumentCaptureInternals, ch as EMPTY_GUIDE_METRICS, ci as EncodedDocument, cj as ExecuteChallengeOptions, ck as FLIP_FILL_MIN, cl as FLIP_GAP_MS, cm as FLIP_TIMEOUT_MS, cn as FocusCaps, co as FramingStatus, cp as GUIDE_LOCK_DEFAULTS, cq as GlareStatus, cr as GrabbedFrame, cs as GuideBlocker, ct as GuideLock, cu as GuideLockTick, cv as GuideLockTuning, cw as GuideMetrics, cx as GuideRect, cy as INFERENCE_RETRY_ATTEMPTS, cz as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cA as LANDMARKER_MODEL, cB as LENS_STORAGE_KEY, cC as LIVE_MRZ_DEFAULTS, cD as LIVE_PHOTO_IDLE_MS, cE as LIVE_PHOTO_MAX_HZ, cF as LandmarkedFace, cG as LandmarkerLike, cH as LensSource, cI as LightingStatus, cJ as LiveMrzCapture, cK as LiveMrzState, cL as LivePhotoGate, cM as LivePhotoKit, cN as LivePhotoKitInternals, cO as LivePhotoKitOptions, cP as LivePhotoStill, cQ as LivenessCaptureInternalHandle, cR as LivenessCaptureInternals, cS as LivenessFlowDeps, cT as LivenessFlowOutcome, cU as MANUAL_SHUTTER_MS, cV as MR_DOC_CATALOG, cW as NO_REPORT_MS, cX as OpenDocCameraDeps, cY as PORTRAIT_JPEG_QUALITY, cZ as PRELOAD_BLAZE_INIT_TIMEOUT_MS, c_ as PRELOAD_BUDGET_MS, c$ as PROCESSING_POLL_DELAY_MS, d0 as PROCESSING_POLL_MAX, d1 as PortraitCaptureController, d2 as PortraitCaptureInternals, d3 as REGISTRY_RETRY_DELAY_MS, d4 as ReticleType, d5 as SAME_FACE_MAX_DROPS, d6 as ScanEvent, d7 as ScanLayout, d8 as ScanNotice, d9 as ScanPhase, da as ScanReport, db as ScanSide, dc as ScanState, dd as SubmitExecutor, de as TEXT_LOCK_DEFAULTS, df as TRANSPORT_REPLAY_ATTEMPTS, dg as TRANSPORT_REPLAY_DELAY_MS, dh as VerificationInternals, di as analyzeDocFrame, dj as analyzeGuide, dk as aspectBand, dl as aspectFits, dm as buildDeviceReadHint, dn as coverPointToVideo, dp as createDocumentCaptureInternal, dq as createFaceLandmarker, dr as createLivePhotoKit, ds as createLivenessCaptureInternal, dt as createPortraitCaptureInternal, du as createVerificationInternal, dv as docZoomFor, dw as encodeDocumentImage, dx as executeChallenge, dy as facesOf, dz as feedbackVoteOf, dA as focusOk, dB as guideQuad, dC as guideRegionInFrame, dD as initialScanState, dE as mapEngineState, dF as mapErrorKind, dG as mapGuidanceHint, dH as nextScanState, dI as observePortraitFrame, dJ as openDocCamera, dK as passportBandOf, dL as portraitMatchStep, dM as preloadedDetectorFactory, dN as quadAreaFrac, dO as quadBounds, dP as quadIou, dQ as quadTiltRatio, dR as randomUuid, dS as readStoredLens, dT as resetChallengeFrameForTests, dU as resetLivenessAssetsForTests, dV as resolveDocCameraTuning, dW as resolveDocShutterTuning, dX as resolveGuideLockTuning, dY as runLivenessFlow, dZ as runSubmission, d_ as scannerFormatFor, d$ as setPreloadLoaderForTests, e0 as settledHint, e1 as singleShotFocusAt, e2 as specularFraction, e3 as supportsFocusMode, e4 as warmDocDetector, e5 as writeStoredLens } from '../create-verification-
|
|
1
|
+
import { bf as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bg as HostedClientLike, bh as DocCatalogEntry, bi as DeviceTier, bj as LiveMrzTuning, bk as TextLockTuning, bl as OcrEngineClient, bm as DocAssistReport, bn as ReadyInfo, bo as LoadFailure, bp as OcrEngineOptions } from '../create-verification-B8c9xBnz.js';
|
|
2
|
+
export { bq as ANALYSIS_LONG_EDGE, br as ASPECT_BANDS, bs as AttestationError, bt as BLUR_REFUSE_SHARPNESS_MAX, bu as BlurStatus, bv as CAPTURE_CANDIDATE_SPACING_MS, bw as CAPTURE_EXTRA_CANDIDATES, bx as CHALLENGE_EXECUTE_TIMEOUT_MS, by as CHALLENGE_READY_TIMEOUT_MS, bz as CLIP_MIME_ALLOWLIST, bA as CaptureEngine, bB as CaptureSessionDoc, bC as CaptureSessionDocEvents, bD as CaptureSessionDocOptions, bE as ChallengeAction, bF as ChallengeError, m as ChallengeErrorCode, bG as DOC_ANALYSIS_DEFAULTS, bH as DOC_BLACK_FRAME_LUMA, bI as DOC_BLACK_FRAME_TICKS, bJ as DOC_CADENCE_HZ, bK as DOC_CAMERA_TUNING_DEFAULTS, bL as DOC_CATALOG, bM as DOC_DETECT_WIDTH, bN as DOC_FEEDBACK_STATES, bO as DOC_FIRST_FRAME_MS, bP as DOC_GATE_V1_DEFAULTS, bQ as DOC_SHUTTER_DEFAULTS, bR as DeviceReadHint, bS as DocArtifacts, bT as DocAssist, bU as DocAssistEngine, bV as DocAssistTick, bW as DocCameraTuning, bX as DocCaptureReport, bY as DocCaptureVia, bZ as DocChecksPayload, b_ as DocEngineLike, b$ as DocFeedbackAggregator, c0 as DocFeedbackKey, c1 as DocFeedbackState, c2 as DocFormat, c3 as DocFrameAnalysis, c4 as DocFrameMeasures, c5 as DocGateQuality, c6 as DocGateThresholds, c7 as DocGateTick, c8 as DocGateTickInput, c9 as DocGateV1, ca as DocQuad, cb as DocQuadPoint, cc as DocShutterReason, cd as DocShutterTuning, ce as DocSide, cf as DocumentCaptureController, cg as DocumentCaptureInternals, ch as EMPTY_GUIDE_METRICS, ci as EncodedDocument, cj as ExecuteChallengeOptions, ck as FLIP_FILL_MIN, cl as FLIP_GAP_MS, cm as FLIP_TIMEOUT_MS, cn as FocusCaps, co as FramingStatus, cp as GUIDE_LOCK_DEFAULTS, cq as GlareStatus, cr as GrabbedFrame, cs as GuideBlocker, ct as GuideLock, cu as GuideLockTick, cv as GuideLockTuning, cw as GuideMetrics, cx as GuideRect, cy as INFERENCE_RETRY_ATTEMPTS, cz as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cA as LANDMARKER_MODEL, cB as LENS_STORAGE_KEY, cC as LIVE_MRZ_DEFAULTS, cD as LIVE_PHOTO_IDLE_MS, cE as LIVE_PHOTO_MAX_HZ, cF as LandmarkedFace, cG as LandmarkerLike, cH as LensSource, cI as LightingStatus, cJ as LiveMrzCapture, cK as LiveMrzState, cL as LivePhotoGate, cM as LivePhotoKit, cN as LivePhotoKitInternals, cO as LivePhotoKitOptions, cP as LivePhotoStill, cQ as LivenessCaptureInternalHandle, cR as LivenessCaptureInternals, cS as LivenessFlowDeps, cT as LivenessFlowOutcome, cU as MANUAL_SHUTTER_MS, cV as MR_DOC_CATALOG, cW as NO_REPORT_MS, cX as OpenDocCameraDeps, cY as PORTRAIT_JPEG_QUALITY, cZ as PRELOAD_BLAZE_INIT_TIMEOUT_MS, c_ as PRELOAD_BUDGET_MS, c$ as PROCESSING_POLL_DELAY_MS, d0 as PROCESSING_POLL_MAX, d1 as PortraitCaptureController, d2 as PortraitCaptureInternals, d3 as REGISTRY_RETRY_DELAY_MS, d4 as ReticleType, d5 as SAME_FACE_MAX_DROPS, d6 as ScanEvent, d7 as ScanLayout, d8 as ScanNotice, d9 as ScanPhase, da as ScanReport, db as ScanSide, dc as ScanState, dd as SubmitExecutor, de as TEXT_LOCK_DEFAULTS, df as TRANSPORT_REPLAY_ATTEMPTS, dg as TRANSPORT_REPLAY_DELAY_MS, dh as VerificationInternals, di as analyzeDocFrame, dj as analyzeGuide, dk as aspectBand, dl as aspectFits, dm as buildDeviceReadHint, dn as coverPointToVideo, dp as createDocumentCaptureInternal, dq as createFaceLandmarker, dr as createLivePhotoKit, ds as createLivenessCaptureInternal, dt as createPortraitCaptureInternal, du as createVerificationInternal, dv as docZoomFor, dw as encodeDocumentImage, dx as executeChallenge, dy as facesOf, dz as feedbackVoteOf, dA as focusOk, dB as guideQuad, dC as guideRegionInFrame, dD as initialScanState, dE as mapEngineState, dF as mapErrorKind, dG as mapGuidanceHint, dH as nextScanState, dI as observePortraitFrame, dJ as openDocCamera, dK as passportBandOf, dL as portraitMatchStep, dM as preloadedDetectorFactory, dN as quadAreaFrac, dO as quadBounds, dP as quadIou, dQ as quadTiltRatio, dR as randomUuid, dS as readStoredLens, dT as resetChallengeFrameForTests, dU as resetLivenessAssetsForTests, dV as resolveDocCameraTuning, dW as resolveDocShutterTuning, dX as resolveGuideLockTuning, dY as runLivenessFlow, dZ as runSubmission, d_ as scannerFormatFor, d$ as setPreloadLoaderForTests, e0 as settledHint, e1 as singleShotFocusAt, e2 as specularFraction, e3 as supportsFocusMode, e4 as warmDocDetector, e5 as writeStoredLens } from '../create-verification-B8c9xBnz.js';
|
|
3
3
|
export { O as OCR_ASSET_SET } from '../assets.generated-DpkbvoII.js';
|
|
4
4
|
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-CVqpMNGA.js';
|
|
5
|
-
import { aa as HostedSessionView, i as CheckType, aH as PlanStepView } from '../types-
|
|
6
|
-
export {
|
|
7
|
-
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-
|
|
5
|
+
import { aa as HostedSessionView, i as CheckType, aH as PlanStepView } from '../types-BAAj6TOZ.js';
|
|
6
|
+
export { bv as ICAO_FALLBACK, bp as IcaoCaptureTuning, bw as IcaoProfile, bx as ResolvedIcaoTuning, by as resolveIcaoTuning } from '../types-BAAj6TOZ.js';
|
|
7
|
+
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-C7D7Lce7.js';
|
|
8
8
|
import '../detect-worker-CHqsPJoM.js';
|
|
9
|
-
import '../capture-session-v3-
|
|
9
|
+
import '../capture-session-v3-DEpGJ_fI.js';
|
|
10
10
|
|
|
11
11
|
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
12
12
|
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
package/dist/internal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-
|
|
1
|
+
import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-SJ5OJ677.js";import{a as W,b as ve,c as ge,d as he,e as Ge,f as be,g as He,h as Ye,i as Ue,j as k,k as K,l as w,m as X,n as Z,o as J,p as Q,q as j,r as q,s as $,t as ee,u as te,y as re}from"../chunk-4NO6MQPH.js";import{a as Bt,b as Vt,c as Xt,d as Zt,e as Jt,f as Qt,g as jt,h as qt,i as $t,j as ne,k as ie,m as se,n as Ee}from"../chunk-VWGKUQ3C.js";import{a as Ft,b as Nt,c as vt,d as gt,e as ht,f as Gt,g as bt,h as Ht,i as Yt,j as Ut,k as Wt,l as kt,m as Kt}from"../chunk-53POX7U4.js";import{a as wt,b as zt}from"../chunk-33KKMPJ5.js";import{b as oe,c as pe,d as ae}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import"../chunk-GI3UFGRQ.js";import{a as P,b as d,c as M,d as F,e as N}from"../chunk-ZVD6VHM2.js";import{A as Ct,B as At,C as Ot,D as xt,E as It,F as ut,G as Dt,H as Pt,I as dt,J as Mt,a as Ke,b as we,c as ze,d as je,e as qe,f as $e,g as et,h as tt,i as rt,j as ot,k as pt,l as at,m as nt,n as it,o as st,p as Et,q as mt,r as _t,s as Lt,t as lt,u as ct,v as St,w as Rt,x as yt,y as Tt,z as ft}from"../chunk-L3TNFMQK.js";import{a as v,b as g,c as h,d as G,e as b,f as H,g as Y,h as U,i as z,j as B,l as V}from"../chunk-MQHTFHSN.js";import{a as We,b as ke}from"../chunk-SMKCBUJL.js";import{a as Be,b as Ve,c as Xe,d as Ze,e as Je,f as Qe}from"../chunk-3WQJI7UL.js";import{b as De,c as Pe,d as de,e as Me,f as Fe,g as Ne}from"../chunk-BRLQIJYF.js";import{C as Oe,b as ye,c as Te,d as fe,e as Ce,g as Ae,h as er,i as tr,j as rr,k as or,l as pr,m as ar}from"../chunk-Y5GRT27C.js";import{A as I,C as u,D,i as c,j as S,k as R,l as y,o as T,v as f,w as C,x as A,y as O,z as x}from"../chunk-M3637QGB.js";import{a,b as n,c as i,d as s,i as E,j as m,k as _,l as L,n as l}from"../chunk-BPAGOPYL.js";import"../chunk-7QZWBDI5.js";import"../chunk-FYU7J2DC.js";import"../chunk-SX7TUC3V.js";import"../chunk-W357WDNU.js";import"../chunk-POIQGEZM.js";import{p as xe,q as Ie,r as ue}from"../chunk-CPUECYAJ.js";import"../chunk-FPXL63KZ.js";import"../chunk-QZUFICG3.js";import"../chunk-U5TL63CG.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-TSA6GHUG.js";import"../chunk-22AW4NJD.js";import"../chunk-FSSMUAKC.js";import{a as Re}from"../chunk-QB62OPX5.js";import"../chunk-WNBEOK5Q.js";export{ne as ANALYSIS_LONG_EDGE,De as ASPECT_BANDS,I as AttestationError,He as BLUR_REFUSE_SHARPNESS_MAX,Mt as CAPTURE_CANDIDATE_SPACING_MS,dt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,M as CHALLENGE_EXECUTE_TIMEOUT_MS,d as CHALLENGE_READY_TIMEOUT_MS,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,f as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,P as ChallengeError,tr as DOCUMENT_TYPE_ORDER,je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,Ot as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,tt as DOC_CAMERA_TUNING_DEFAULTS,Me as DOC_CATALOG,Be as DOC_DETECT_WIDTH,Ke as DOC_FEEDBACK_STATES,Ct as DOC_FIRST_FRAME_MS,Ve as DOC_GATE_V1_DEFAULTS,It as DOC_SHUTTER_DEFAULTS,V as DocAssist,ze as DocFeedbackAggregator,Qe as DocGateV1,Lt as EMPTY_GUIDE_METRICS,ge as FLIP_FILL_MIN,ve as FLIP_GAP_MS,he as FLIP_TIMEOUT_MS,Rt as GUIDE_LOCK_DEFAULTS,Tt as GuideLock,gt as ICAO_CANVAS,wt as ICAO_FALLBACK,Ht as ICAO_GATE_CRITERIA,Vt as ICAO_SHARP_REF,O as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,er as ISSUER_CODES,oe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,xe as LENS_TRY_MAX,B as LIVE_MRZ_DEFAULTS,_e as LIVE_PHOTO_IDLE_MS,me as LIVE_PHOTO_MAX_HZ,Ge as MANUAL_SHUTTER_MS,We as MRZ_BAND_DEFAULTS,Fe as MR_DOC_CATALOG,be as NO_REPORT_MS,Re as OCR_ASSET_SET,ce as OTP_RESEND_COOLDOWN_MS,ie as PORTRAIT_JPEG_QUALITY,a as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,le as PROCESSING_BACKOFF_MS,Te as PROCESSING_POLL_DELAY_MS,fe as PROCESSING_POLL_MAX,h as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,te as SAME_FACE_MAX_DROPS,v as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,C as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,J as WEB_OCR_ENGINE,or as acceptedIssuers,rr as acceptedTypesFor,et as analyzeDocFrame,ct as analyzeGuide,Pe as aspectBand,de as aspectFits,jt as backgroundStats,q as browserFamily,X as buildDeviceReadHint,K as classifyCardSide,k as classifyCardSideWith,st as coverPointToVideo,re as createDocumentCaptureInternal,ae as createFaceLandmarker,Kt as createIcaoGate,Le as createLivePhotoKit,l as createLivenessCaptureInternal,Ee as createPortraitCaptureInternal,Se as createStepRunner,Ae as createVerificationInternal,b as cropImage,e as detectFormFactor,t as detectIsMobile,ke as detectMrzBand,Et as docZoomFor,W as encodeDocumentImage,N as executeChallenge,vt as eyeLineRoll,Ut as eyeOpenness,Qt as eyeSpecular,Ft as faceGeometry,Jt as faceLighting,qt as faceSharpness,pe as facesOf,we as feedbackVoteOf,ar as flagOf,mt as focusOk,ee as formatMismatch,R as frontierStep,St as guideQuad,lt as guideRegionInFrame,$t as icaoPixelStats,ht as icaoWindow,Ye as initialScanState,c as isExecutable,S as isTerminalView,Yt as judgeIcao,Ie as lensKindOf,$ as liveMrzWireReport,Xt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,T as mapSessionResult,U as measureBitmapSharpness,Y as measureRegionSharpness,Ue as nextScanState,se as observePortraitFrame,_t as openDocCamera,Pt as passportBandOf,Wt as percentile,g as photoSharpness,bt as portraitCropRegion,Oe as portraitMatchStep,Nt as poseFromMatrix,E as preloadedDetectorFactory,Xe as quadAreaFrac,Je as quadBounds,Ze as quadIou,$e as quadTiltRatio,Ce as randomUuid,ue as rankBackCameras,pt as readStoredLens,Zt as regionStats,F as resetChallengeFrameForTests,s as resetLivenessAssetsForTests,H as resizeLongEdge,pr as resolveAcceptedDocuments,rt as resolveDocCameraTuning,ut as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,Q as resolveWebOcrPlan,D as runLivenessFlow,u as runSubmission,Ne as scannerFormatFor,kt as scoreFrame,i as setPreloadLoaderForTests,Z as settledHint,it as singleShotFocusAt,qe as specularFraction,j as startWebOcr,y as stepOf,G as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ft as warmDocDetector,Gt as windowOverflow,at as writeStoredLens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as ie}from"./chunk-BD4KIQQD.js";import"./chunk-JLVZ35QK.js";import{a as ee,b as te,e as oe,f as K,g as O,j as ae}from"./chunk-3565JBSZ.js";import{y as Z}from"./chunk-WI7GAUCH.js";import{n as re}from"./chunk-VWGKUQ3C.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import{F as Y,i as W,x as X}from"./chunk-TGSMTRG5.js";import"./chunk-MQHTFHSN.js";import"./chunk-SMKCBUJL.js";import"./chunk-3WQJI7UL.js";import"./chunk-BRLQIJYF.js";import{b as j,c as q,r as Q,t as J,u as L}from"./chunk-UKYJYZZS.js";import"./chunk-P5OIQXVM.js";import"./chunk-7QZWBDI5.js";import"./chunk-7FGOUBAN.js";import{b as N}from"./chunk-SX7TUC3V.js";import"./chunk-W357WDNU.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as x,i as ne}from"./chunk-PNOGF72U.js";import"./chunk-U5TL63CG.js";import"./chunk-TSA6GHUG.js";import{a as z}from"./chunk-HMOOVRKA.js";import"./chunk-FSSMUAKC.js";import"./chunk-QB62OPX5.js";import"./chunk-WNBEOK5Q.js";var he=2e4,we=new Set(["media_type_unsupported","media_type_mismatch"]),le=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function se(e){let r=null,a=Promise.resolve(),c=!1,m=null,y=null,w=!1,C=null,I=!1,D=!1,M=()=>{r?.controller.handle.destroy(),r=null},n=()=>{let s=e.currentView(),t=s===null?null:O(s,{isMobile:e.isMobile()});return t?.kind==="portrait"?t:null},l=()=>{if(e.destroyed())return"self";let s=e.currentView(),t=s===null?void 0:K(s);return t==="self"||t==="assisted"?t:t==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??J(t??Q(s),null)},p=e.captureModeSwitch,h=p===void 0?void 0:{session:()=>{let s=e.currentView();return s!==null&&K(s)==="choice"?"choice":l()},onModeChange:s=>p.choose(s)},v=async(s,t)=>{if(e.destroyed())return;let u=l();t.setFlowState("uploading"),c=!1;let o=null;try{await e.runner().submit("portrait_icao",async(d,S)=>{if(o===null){let f=await L(d,"image","image/jpeg",s.image.size,{engine:"portrait"});await d.uploadToSpaces(f.uploadUrl,s.image,"image/jpeg"),o=(await d.completeMedia(f.key)).key}t.setFlowState("checking");let P={media:{portrait:o},gate:ne(s.gate),...s.tuningVersion!==void 0?{tuningVersion:s.tuningVersion}:{},source:"camera",capture:{mode:u,facingMode:s.facingMode}};return d.submitCheck("portrait_icao",P,{idempotencyKey:S})})}catch(d){c=!0,d instanceof x&&le.has(d.code)&&await e.refreshView?.().catch(()=>{})}if(t.setFlowState("done"),e.destroyed())return;let i=n();(i===null||i.phase!=="capture")&&r?.controller===t&&M(),e.runner().republish()},F=s=>e.runner().submit("face_match",(t,u)=>t.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:u})).then(()=>{},()=>{c=!0,s()}),b=null,k=async s=>{let t=n();if(t===null||t.phase!=="capture"||!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:u}=await import("./upload-file-EGXXM6TQ.js"),o=await u(s,e.uploadInternals);if(e.destroyed())return;M(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(d,S)=>{if(i===null){let f=await d.presign("image",o.contentType,o.blob.size,{source:"upload"});await d.uploadToSpaces(f.uploadUrl,o.blob,o.contentType),i=(await d.completeMedia(f.key)).key}let P={media:{portrait:i},source:"upload"};return d.submitCheck("portrait_icao",P,{idempotencyKey:S})})}catch(d){throw d instanceof x&&we.has(d.code)?new TypeError("unsupported_file"):(d instanceof x&&le.has(d.code)&&await e.refreshView?.().catch(()=>{}),d)}},_=null,T=s=>{if(_!==null)return _;let t=n();if(t===null||t.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let u={fixReview:{accept:s}},o=e.runner().submit("portrait_icao",(i,d)=>i.submitCheck("portrait_icao",u,{idempotencyKey:d})).catch(async i=>{throw i instanceof x&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{_=null});return _=o,o},B=s=>{let t=()=>k(s),u=(b===null?t():b.then(t,t)).finally(()=>{b===u&&(b=null)});return b=u,u};return{bind:(s,t)=>{if(s.phase==="review")return M(),{...s,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("the adjusted photo waits for confirmFix()")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:T};if(s.phase==="match")return M(),m!==s.attemptsRemaining&&!c&&(m=s.attemptsRemaining,F(t)),{...s,uploadFailed:c,resubmit:()=>(c=!1,m=s.attemptsRemaining,t(),F(t)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:T};if(m=null,s.reuse===!0&&s.phase==="capture")return M(),!I&&C!==s.attemptsRemaining&&(C=s.attemptsRemaining,I=!0,e.runner().submit("portrait_icao",(o,i)=>o.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{D=!1},()=>{D=!0}).finally(()=>{I=!1,t()})),{kind:"processing",key:"processing",context:s.context,section:s.section,stalled:D&&!I,refresh:()=>(D=!1,C=null,t(),Promise.resolve())};let u=e.keptPortraitInput?.()??null;return u!==null&&(w||u!==y&&s.report===null&&s.reason===void 0&&!s.retakeOnly)?(w||(y=u,w=!0,e.runner().submit("portrait_icao",(o,i)=>o.submitCheck("portrait_icao",u,{idempotencyKey:i})).catch(()=>{}).finally(()=>{w=!1,t()})),{kind:"processing",key:"processing",context:s.context,section:s.section,stalled:!1,refresh:()=>Promise.resolve()}):{...s,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:o=>{if(r!==null&&r.video===o.video)return r.controller.handle;M(),c=!1;let i=re({video:o.video,tuning:s.tuning,tuningVersion:s.tuningVersion,...s.icao!=null?{policy:s.icao.policy}:{},...o.keepScreenAwake!==void 0?{keepScreenAwake:o.keepScreenAwake}:{},...o.assetBaseUrl!==void 0?{assetBaseUrl:o.assetBaseUrl}:{}},e.internals,l,h);r={video:o.video,controller:i};let d=i.handle.destroy;i.handle.destroy=()=>{r?.controller===i&&(r=null),d()},i.handle.on("error",f=>{e.reportCaptureIssue?.(j("portrait",f,0))});let S=!1,P=(f,E)=>{let g=i.gateScores();g!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:f,...E!==null?{failing:E}:{},...g})};return i.handle.on("gate",f=>{!S&&!f.ready&&(i.gateScores()?.elapsedMs??0)>=he&&(S=!0,P("stuck",f.failing))}),i.handle.on("captured",f=>{P("captured",null),S=!1,a=a.then(()=>v(f,i)).catch(()=>{})}),i.handle},uploadPortrait:B,confirmFix:T}},destroy:M}}var ve=.92,Pe=()=>N("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),be=e=>{let r=document.createElement("canvas");r.width=e.videoWidth,r.height=e.videoHeight;let a=r.getContext("2d");return a===null||r.width===0||r.height===0?Promise.reject(new Error("the camera has no frame yet")):(a.drawImage(e,0,0,r.width,r.height),new Promise((c,m)=>r.toBlob(y=>y===null?m(new Error("the still could not be encoded")):c(y),"image/jpeg",ve)))},ke=(e,r)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=r,e.play().catch(()=>{})}catch{}};function ue(e){let r=null,a=null,c=n=>{let l=(a===null?n():a.then(n,n)).finally(()=>{a===l&&(a=null)});return a=l,l},m=()=>{r?.handle.destroy(),r=null},y=()=>{let n=e.currentView(),l=n===null?null:O(n,{isMobile:e.isMobile()});return l?.kind==="proof_of_address"?l:null},w=async(n,l)=>{if(l.length===0)throw new RangeError("no_pages");if(l.length>n.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:p,prepareUploadFile:h}=await import("./upload-file-EGXXM6TQ.js"),v=await Promise.all(l.map(b=>p(b)));if(v.includes("bad"))throw new TypeError("unsupported_file");if(v.includes("pdf")){if(l.length>1)throw new RangeError("too_many_pages");let b=l[0];if(b.size>n.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:b,contentType:"application/pdf"}]}let F=[];for(let b of l){let k=await h(b,e.uploadInternals);F.push({kind:"image",blob:k.blob,contentType:k.contentType})}return F},C=async(n,l,p)=>{let h=null;try{await e.runner().submit("poa",async(v,F)=>{if(h===null){let k=[];for(let _ of p){let T=l==="upload"?await v.presign(_.kind,_.contentType,_.blob.size,{source:"upload"}):await L(v,_.kind,_.contentType,_.blob.size,{engine:"poa_page"});await v.uploadToSpaces(T.uploadUrl,_.blob,_.contentType),k.push((await v.completeMedia(T.key)).key)}h=k}let b=p[0]?.kind==="document_file"?{part:n,source:"upload",pdfKey:h[0]}:{part:n,source:l,imageKeys:h};return v.submitCheck("poa",b,{idempotencyKey:F})})}catch(v){throw v instanceof x&&(v.code==="media_type_unsupported"||v.code==="media_type_mismatch")?new TypeError("unsupported_file"):(v instanceof x&&(v.code==="document_upload_not_allowed"||v.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),v)}},I=async(n,l)=>{let p=y();if(p===null||!p.photo.uploadOffered)throw new RangeError("upload_not_offered");if(n==="holder_letter"&&p.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let h=await w(p,l);e.destroyed()||(m(),await C(n,"upload",h))},D=(n,l)=>{let p=null,h=[],v=!0,F=()=>{for(let k of p?.getTracks()??[])k.stop();p=null},b={get pages(){return h},start:async()=>{if(!v||p!==null)return;let k=await(e.pageCamera?.open??Pe)();if(!v){for(let _ of k.getTracks())_.stop();return}p=k,(e.pageCamera?.attach??ke)(n,k)},takePage:async()=>{if(h.length>=l)throw new RangeError("too_many_pages");let k=await(e.pageCamera?.grab??be)(n);if(h.length>=l)throw new RangeError("too_many_pages");return h=[...h,k],k},removePage:k=>{h=h.filter((_,T)=>T!==k)},submitPages:()=>c(async()=>{if(h.length===0)throw new RangeError("no_pages");let k=y();if(k===null)throw new RangeError("camera_not_offered");let _=k.phase==="holder_letter"?"holder_letter":"document";await C(_,"camera",h.map(T=>({kind:"image",blob:T,contentType:"image/jpeg"}))),r?.handle===b?m():b.destroy()}),destroy:()=>{v=!1,h=[],F(),r?.handle===b&&(r=null)}};return b},M=async()=>{let n=y();if(n===null||!n.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;m();let l={part:"document"};await e.runner().submit("poa",(p,h)=>p.submitCheck("poa",l,{idempotencyKey:h}))};return{bind:n=>({...n,...n.licenceAddressAccepted?{useLicenceAddress:()=>c(M)}:{},uploadPages:l=>c(()=>I("document",l)),uploadHolderLetter:l=>c(()=>I("holder_letter",l)),capturePage:l=>{if(n.photo.source==="upload")throw new RangeError("camera_not_offered");if(r!==null&&r.video===l.video)return r.handle;m();let p=D(l.video,n.maxPages);return r={video:l.video,handle:p},p}}),destroy:m}}function ce(e,r){let a=null,c=null,m=!1,y=null,w=null,C=[],I=(n,l)=>{n.off=l.on(n.event,n.handler)},D=()=>(c??(c=e.then(n=>{if(m)return null;let l=r(n),p=l.handle;for(let h of C)h.removed||I(h,p);return y!==null&&p.setSide(y),w!==null&&p.setGuide(w.guide),a=l,p}).catch(()=>{if(c=null,!m)for(let n of C)!n.removed&&n.event==="error"&&n.handler({kind:"generic",retryable:!0});return null})),c);return{handle:{get state(){return a?.handle.state??"idle"},on:(n,l)=>{let p={event:n,handler:l,off:null,removed:!1};return C.push(p),a!==null&&I(p,a.handle),()=>{p.removed=!0,p.off?.()}},start:async()=>{let n=await D();n!==null&&!m&&await n.start()},retry:()=>{a!==null?a.handle.retry():D().then(n=>n?.start())},setSide:n=>{a!==null?a.handle.setSide(n):y=n},shutter:()=>a?.handle.shutter(),setTorch:n=>a?.handle.setTorch(n),focusAt:(n,l)=>a?.handle.focusAt(n,l),setGuide:n=>{a!==null?a.handle.setGuide(n):w={guide:n}},destroy:()=>{m=!0,a?.handle.destroy(),C.length=0}},get plan(){return a?.plan??null},setFlowState:n=>a?.setFlowState(n),settle:(n,l)=>a?.settle(n,l),takeDeviceRead:n=>a?.takeDeviceRead(n)??null}}var Ce=1500,Se=["ID-1","ID-2","ID-3"],_e=["recto","verso","single"],Ie=["td1","td2","td3"],De=["pdf417","qr","datamatrix","aztec"],Me=["yes","no","some"],Re=["dmy","mdy","ymd"],Fe=["gregorian","hijri","solar_hijri","thai_buddhist"],Te=24,H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),V=(e,r)=>typeof e=="string"&&r.includes(e),de=(e,r)=>e===null||V(e,r);function Ae(e){if(!H(e))return null;let{side:r,portrait:a,mrz:c,barcode:m,scripts:y}=e;return!V(r,_e)||typeof a!="boolean"||!de(c,Ie)||!de(m,De)||!Array.isArray(y)||!y.every(w=>typeof w=="string")?null:{side:r,portrait:a,mrz:c,barcode:m,scripts:[...y]}}function Ee(e){if(!H(e))return null;let{id:r,format:a,mrzCode:c,chip:m,dates:y,sides:w}=e;if(typeof r!="string"||!V(a,Se)||!(c===null||typeof c=="string")||!V(m,Me)||!H(y)||!V(y.order,Re)||!V(y.calendar,Fe)||!Array.isArray(w)||w.length<1||w.length>2)return null;let C=w.map(Ae);return C.some(I=>I===null)?null:{id:r,format:a,mrzCode:c,chip:m,dates:{order:y.order,calendar:y.calendar},sides:C}}function xe(e,r,a){if(!H(e)||e.country!==r||e.documentType!==a)return null;let{version:c,series:m}=e;if(typeof c!="number"||!Number.isInteger(c)||!Array.isArray(m)||m.length>Te)return null;let y=m.map(Ee);return y.some(w=>w===null)?null:{country:r,documentType:a,version:c,series:y}}function pe(e){return e.series.map(r=>({format:r.format,sides:r.sides}))}function Oe(e){return H(e)&&"success"in e&&"data"in e?e.data:e}function me(e,r={}){let a=e;if(a===null||typeof a.apiOrigin!="string"||typeof a.sessionToken!="string")return;let c=a.apiOrigin,m=a.sessionToken,y=r.timeoutMs??Ce;return(w,C)=>{let I=r.fetchImpl??(typeof fetch=="function"?fetch:void 0);if(I===void 0)return Promise.resolve(null);let D=typeof AbortController=="function"?new AbortController:void 0,M,n=new Promise(p=>{M=setTimeout(()=>{D?.abort(),p(null)},y)}),l=(async()=>{let p=`country=${encodeURIComponent(w)}&type=${encodeURIComponent(C)}`,h=await I(`${c}/api/v2/hosted/document-facts?${p}`,{method:"GET",headers:{"x-session-token":m,"x-sekyro-sdk":`@sekyro/web/${z}`},cache:"default",...D!==void 0?{signal:D.signal}:{}});return h.ok?xe(Oe(await h.json()),w,C):null})().catch(()=>null);return Promise.race([l,n]).finally(()=>clearTimeout(M))}}function fe(e){let r=e;if(typeof r.apiOrigin!="string"||typeof r.sessionToken!="string")return;let a=`${r.apiOrigin}/api/v2/hosted/capture-reports`,c=r.sessionToken;return m=>{try{fetch(a,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${z}`},body:JSON.stringify({reports:m}),keepalive:!0}).catch(()=>{})}catch{}}}function ge(e){let r=e.apiOrigin;return ie("sdk",typeof r=="string"&&/staging|sandbox|localhost/.test(r)?"sandbox":"live")}function Le(e){return ge(e).replace(/\/ocr$/,"/barcode")}function yt(e){let r=null,a=null,c=null,m=q(),y=Promise.resolve(),w=()=>{c?.flow.handle.destroy(),c=null},C=null,I=()=>e.documentInternals?.catalogCapture??e.currentView()?.capture?.document?.catalog===!0,D=(t,u)=>{let o=`${t}:${u}`;if(C?.key===o)return C;if(C=null,!I()||e.documentInternals?.captureSeries!==void 0)return null;let i=e.documentFacts??me(e.runtime.client);if(i===void 0)return null;let d={key:o,promise:Promise.resolve(null),settled:!1,value:null};return d.promise=i(t,u).catch(()=>null).then(S=>(d.value=S,d.settled=!0,S)),C=d,d},M=t=>t===null?{}:{documentType:t.documentType,documentCountry:t.issuer},n=async(t,u,o)=>{if(e.destroyed())return;u.setFlowState("uploading");let i=null,d=M(o),S,P=!1,f=e.currentView()?.documents!==void 0;try{await r.submit("doc_ocr",async(G,ye)=>{if(i===null){let $=await L(G,"image","image/jpeg",t.image.size,{engine:"document"});await G.uploadToSpaces($.uploadUrl,t.image,"image/jpeg"),i=(await G.completeMedia($.key)).key}return u.setFlowState("checking"),S===void 0&&(S=u.takeDeviceRead(t)),G.submitCheck("doc_ocr",{imageKey:i,side:t.side,...S!==null?{deviceRead:S}:{},...f?{source:"camera"}:{},...d},{idempotencyKey:ye})})}catch{P=!0}finally{u.setFlowState("done")}if(e.destroyed())return;if(P){u.settle(t.side,{ok:!1,issue:"technical"});return}let E=e.currentView(),g=E===null?null:O(E,{isMobile:e.isMobile()});if(g?.kind!=="document"){u.settle(t.side,{ok:!0}),c?.flow===u?w():u.handle.destroy();return}if(g.reason==="document_type_not_accepted"||g.reason==="document_type_not_supported"){a=null,c?.flow===u&&w(),r.republish();return}let R=g.acceptedSides;t.side!=="single"&&g.side!==t.side&&(R.includes(t.side)||g.reason==="side_missing")&&!(R.includes("recto")&&R.includes("verso"))?(u.settle(t.side,{ok:!0}),a?.documentType!=="passport"&&u.handle.setSide(g.side)):t.side!=="single"&&R.length===0?(u.settle(t.side,{ok:!1,issue:"reread"}),u.handle.retry()):u.settle(t.side,{ok:!1,issue:"reread"})},l=null,p=async t=>{let u=e.currentView(),o=u===null?null:O(u,{isMobile:e.isMobile()});if(u===null||o?.kind!=="document")throw new RangeError("upload_not_offered");if(!o.photo.uploadOffered)throw new RangeError("upload_not_offered");let i=a,d=i?.documentType==="passport"?"single":o.side,{prepareUploadFile:S}=await import("./upload-file-EGXXM6TQ.js"),P=await S(t,e.uploadInternals);if(e.destroyed())return;w();let f=null,E=M(i);try{await r.submit("doc_ocr",async(g,R)=>{if(f===null){let A=await g.presign("image",P.contentType,P.blob.size,{source:"upload"});await g.uploadToSpaces(A.uploadUrl,P.blob,P.contentType),f=(await g.completeMedia(A.key)).key}return g.submitCheck("doc_ocr",{imageKey:f,side:d,source:"upload",...E},{idempotencyKey:R})})}catch(g){throw g instanceof x&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof x&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),g)}},h=(t,u)=>({...t,uploadDocument:o=>{let i=()=>p(o),d=(l===null?i():l.then(i,i)).finally(()=>{l===d&&(l=null)});return l=d,d},issuer:a?.issuer??null,documentType:a?.documentType??null,captureSide:a===null?null:a.documentType==="passport"?"single":t.side,selectDocument:(o,i)=>{if(!te(t.documents).includes(o)||!ee(t.documents,o).includes(i))throw new RangeError(`${i} from ${o} is not accepted`);(a?.issuer!==o||a.documentType!==i)&&w(),a={issuer:o,documentType:i},D(o,i),u()},capture:o=>{if(a===null)throw new Error("selectDocument() first");if(c!==null&&c.video===o.video)return c.flow.handle;w();let i=a,d=i.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,S=g=>Z({video:o.video,documentType:i.documentType,issuer:i.issuer,...d!==void 0?{side:d}:{},...o.keepScreenAwake!==void 0?{keepScreenAwake:o.keepScreenAwake}:{},...o.liveMrz!==void 0?{liveMrz:o.liveMrz}:{},...o.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:o.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let R=e.currentView()?.capture?.document,A=e.documentInternals?.blurRefuseSharpnessMax??R?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:W(R?.camera),shutter:Y(R?.scan),guideLock:X(R?.guide),...e.documentInternals?.engineOptions??{}},...typeof A=="number"&&Number.isFinite(A)&&A>=0&&A<=1?{blurRefuseSharpnessMax:A}:{},catalogCapture:e.documentInternals?.catalogCapture??R?.catalog===!0,...g!==null&&e.documentInternals?.captureSeries===void 0?{captureSeries:pe(g)}:{}}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:Le(e.runtime.client)}},...(()=>{let R=e.currentView();if(R===null||e.documentInternals?.webOcr!==void 0)return{};let A=fe(e.runtime.client);return{webOcr:{captureDocument:R.capture?.document,salt:R.sessionId,baseUrl:ge(e.runtime.client),...A!==void 0?{reports:A}:{}}}})()}),P=D(i.issuer,i.documentType),f=P===null||P.settled?S(P?.value??null):ce(P.promise,S);c={video:o.video,flow:f};let E=f.handle.destroy;return f.handle.destroy=()=>{c?.flow===f&&(c=null),E()},m.newHandle(),f.handle.on("state",g=>m.note(g)),f.handle.on("error",g=>{m.noteError(),e.reportCaptureIssue?.(j("document",g,m.value))}),f.handle.on("captured",g=>{y=y.then(()=>n(g,f,i)).catch(()=>{})}),f.handle}}),v=null,F=null,b=new Set,k=e.runtime.client;e.runtime.client=new Proxy(k,{get(t,u){if(u==="submitCheck")return(F??t).submitCheck.bind(F??t);let o=Reflect.get(t,u);return typeof o=="function"?o.bind(t):o}});let _=()=>{v?.destroy(),v=null,F=null},T=t=>{let u=e.currentView(),o=u===null?null:O(u,{isMobile:e.isMobile()});if(u===null||o?.kind!=="liveness"||o.livePhoto?.icao!==!0)return;if(v===null){let P=oe({tuning:u.capture?.icao??null,tuningVersion:u.capture?.tuningVersion??null,...o.icao!=null?{policy:o.icao.policy}:{},still:o.livePhoto.still,...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.livePhotoInternals);v=P,F=P.decorate(k),P.onGate(f=>{for(let E of b)E(f)})}let i=v,d=e.baseCapture??{},S=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:i.engineOptions.measureQuality,telemetry:P=>{S?.(P),i.engineOptions.telemetry(P)}}}},B=se({keptPortraitInput:()=>v?.lastPortraitInput()??null,runner:()=>r,currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:()=>e.refreshView(),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:t=>fe(e.runtime.client)?.([t])}),U=ue({runner:()=>r,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:()=>e.refreshView()}),s=ae({...e,bindDocument:h,bindPortrait:B.bind,bindProofOfAddress:U.bind,stopCameras:()=>{w(),B.destroy(),U.destroy(),_(),e.stopLiveness?.()},onLivePhoto:t=>(b.add(t),()=>b.delete(t))});return r=s,{...s,captureInternals:T,destroy:()=>{w(),B.destroy(),U.destroy(),_(),b.clear()}}}export{Le as barcodeAssetBase,yt as createPlanRunner,fe as reportSink,ge as sdkAssetBase};
|
|
1
|
+
import{d as ie}from"./chunk-BD4KIQQD.js";import"./chunk-JLVZ35QK.js";import{a as ee,b as te,e as oe,f as K,g as O,j as ae}from"./chunk-SJ5OJ677.js";import{y as Z}from"./chunk-4NO6MQPH.js";import{n as re}from"./chunk-VWGKUQ3C.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import{F as Y,i as W,x as X}from"./chunk-L3TNFMQK.js";import"./chunk-MQHTFHSN.js";import"./chunk-SMKCBUJL.js";import"./chunk-3WQJI7UL.js";import"./chunk-BRLQIJYF.js";import{b as j,c as q,r as Q,t as J,u as L}from"./chunk-M3637QGB.js";import"./chunk-BPAGOPYL.js";import"./chunk-7QZWBDI5.js";import"./chunk-FYU7J2DC.js";import{b as N}from"./chunk-SX7TUC3V.js";import"./chunk-W357WDNU.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as x,i as ne}from"./chunk-QZUFICG3.js";import"./chunk-U5TL63CG.js";import"./chunk-TSA6GHUG.js";import{a as z}from"./chunk-22AW4NJD.js";import"./chunk-FSSMUAKC.js";import"./chunk-QB62OPX5.js";import"./chunk-WNBEOK5Q.js";var he=2e4,we=new Set(["media_type_unsupported","media_type_mismatch"]),le=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function se(e){let r=null,a=Promise.resolve(),c=!1,m=null,y=null,w=!1,C=null,I=!1,D=!1,M=()=>{r?.controller.handle.destroy(),r=null},n=()=>{let s=e.currentView(),t=s===null?null:O(s,{isMobile:e.isMobile()});return t?.kind==="portrait"?t:null},l=()=>{if(e.destroyed())return"self";let s=e.currentView(),t=s===null?void 0:K(s);return t==="self"||t==="assisted"?t:t==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??J(t??Q(s),null)},p=e.captureModeSwitch,h=p===void 0?void 0:{session:()=>{let s=e.currentView();return s!==null&&K(s)==="choice"?"choice":l()},onModeChange:s=>p.choose(s)},v=async(s,t)=>{if(e.destroyed())return;let u=l();t.setFlowState("uploading"),c=!1;let o=null;try{await e.runner().submit("portrait_icao",async(d,S)=>{if(o===null){let f=await L(d,"image","image/jpeg",s.image.size,{engine:"portrait"});await d.uploadToSpaces(f.uploadUrl,s.image,"image/jpeg"),o=(await d.completeMedia(f.key)).key}t.setFlowState("checking");let P={media:{portrait:o},gate:ne(s.gate),...s.tuningVersion!==void 0?{tuningVersion:s.tuningVersion}:{},source:"camera",capture:{mode:u,facingMode:s.facingMode}};return d.submitCheck("portrait_icao",P,{idempotencyKey:S})})}catch(d){c=!0,d instanceof x&&le.has(d.code)&&await e.refreshView?.().catch(()=>{})}if(t.setFlowState("done"),e.destroyed())return;let i=n();(i===null||i.phase!=="capture")&&r?.controller===t&&M(),e.runner().republish()},F=s=>e.runner().submit("face_match",(t,u)=>t.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:u})).then(()=>{},()=>{c=!0,s()}),b=null,k=async s=>{let t=n();if(t===null||t.phase!=="capture"||!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:u}=await import("./upload-file-EGXXM6TQ.js"),o=await u(s,e.uploadInternals);if(e.destroyed())return;M(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(d,S)=>{if(i===null){let f=await d.presign("image",o.contentType,o.blob.size,{source:"upload"});await d.uploadToSpaces(f.uploadUrl,o.blob,o.contentType),i=(await d.completeMedia(f.key)).key}let P={media:{portrait:i},source:"upload"};return d.submitCheck("portrait_icao",P,{idempotencyKey:S})})}catch(d){throw d instanceof x&&we.has(d.code)?new TypeError("unsupported_file"):(d instanceof x&&le.has(d.code)&&await e.refreshView?.().catch(()=>{}),d)}},_=null,T=s=>{if(_!==null)return _;let t=n();if(t===null||t.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let u={fixReview:{accept:s}},o=e.runner().submit("portrait_icao",(i,d)=>i.submitCheck("portrait_icao",u,{idempotencyKey:d})).catch(async i=>{throw i instanceof x&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{_=null});return _=o,o},B=s=>{let t=()=>k(s),u=(b===null?t():b.then(t,t)).finally(()=>{b===u&&(b=null)});return b=u,u};return{bind:(s,t)=>{if(s.phase==="review")return M(),{...s,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("the adjusted photo waits for confirmFix()")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:T};if(s.phase==="match")return M(),m!==s.attemptsRemaining&&!c&&(m=s.attemptsRemaining,F(t)),{...s,uploadFailed:c,resubmit:()=>(c=!1,m=s.attemptsRemaining,t(),F(t)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:T};if(m=null,s.reuse===!0&&s.phase==="capture")return M(),!I&&C!==s.attemptsRemaining&&(C=s.attemptsRemaining,I=!0,e.runner().submit("portrait_icao",(o,i)=>o.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{D=!1},()=>{D=!0}).finally(()=>{I=!1,t()})),{kind:"processing",key:"processing",context:s.context,section:s.section,stalled:D&&!I,refresh:()=>(D=!1,C=null,t(),Promise.resolve())};let u=e.keptPortraitInput?.()??null;return u!==null&&(w||u!==y&&s.report===null&&s.reason===void 0&&!s.retakeOnly)?(w||(y=u,w=!0,e.runner().submit("portrait_icao",(o,i)=>o.submitCheck("portrait_icao",u,{idempotencyKey:i})).catch(()=>{}).finally(()=>{w=!1,t()})),{kind:"processing",key:"processing",context:s.context,section:s.section,stalled:!1,refresh:()=>Promise.resolve()}):{...s,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:o=>{if(r!==null&&r.video===o.video)return r.controller.handle;M(),c=!1;let i=re({video:o.video,tuning:s.tuning,tuningVersion:s.tuningVersion,...s.icao!=null?{policy:s.icao.policy}:{},...o.keepScreenAwake!==void 0?{keepScreenAwake:o.keepScreenAwake}:{},...o.assetBaseUrl!==void 0?{assetBaseUrl:o.assetBaseUrl}:{}},e.internals,l,h);r={video:o.video,controller:i};let d=i.handle.destroy;i.handle.destroy=()=>{r?.controller===i&&(r=null),d()},i.handle.on("error",f=>{e.reportCaptureIssue?.(j("portrait",f,0))});let S=!1,P=(f,E)=>{let g=i.gateScores();g!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:f,...E!==null?{failing:E}:{},...g})};return i.handle.on("gate",f=>{!S&&!f.ready&&(i.gateScores()?.elapsedMs??0)>=he&&(S=!0,P("stuck",f.failing))}),i.handle.on("captured",f=>{P("captured",null),S=!1,a=a.then(()=>v(f,i)).catch(()=>{})}),i.handle},uploadPortrait:B,confirmFix:T}},destroy:M}}var ve=.92,Pe=()=>N("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),be=e=>{let r=document.createElement("canvas");r.width=e.videoWidth,r.height=e.videoHeight;let a=r.getContext("2d");return a===null||r.width===0||r.height===0?Promise.reject(new Error("the camera has no frame yet")):(a.drawImage(e,0,0,r.width,r.height),new Promise((c,m)=>r.toBlob(y=>y===null?m(new Error("the still could not be encoded")):c(y),"image/jpeg",ve)))},ke=(e,r)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=r,e.play().catch(()=>{})}catch{}};function ue(e){let r=null,a=null,c=n=>{let l=(a===null?n():a.then(n,n)).finally(()=>{a===l&&(a=null)});return a=l,l},m=()=>{r?.handle.destroy(),r=null},y=()=>{let n=e.currentView(),l=n===null?null:O(n,{isMobile:e.isMobile()});return l?.kind==="proof_of_address"?l:null},w=async(n,l)=>{if(l.length===0)throw new RangeError("no_pages");if(l.length>n.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:p,prepareUploadFile:h}=await import("./upload-file-EGXXM6TQ.js"),v=await Promise.all(l.map(b=>p(b)));if(v.includes("bad"))throw new TypeError("unsupported_file");if(v.includes("pdf")){if(l.length>1)throw new RangeError("too_many_pages");let b=l[0];if(b.size>n.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:b,contentType:"application/pdf"}]}let F=[];for(let b of l){let k=await h(b,e.uploadInternals);F.push({kind:"image",blob:k.blob,contentType:k.contentType})}return F},C=async(n,l,p)=>{let h=null;try{await e.runner().submit("poa",async(v,F)=>{if(h===null){let k=[];for(let _ of p){let T=l==="upload"?await v.presign(_.kind,_.contentType,_.blob.size,{source:"upload"}):await L(v,_.kind,_.contentType,_.blob.size,{engine:"poa_page"});await v.uploadToSpaces(T.uploadUrl,_.blob,_.contentType),k.push((await v.completeMedia(T.key)).key)}h=k}let b=p[0]?.kind==="document_file"?{part:n,source:"upload",pdfKey:h[0]}:{part:n,source:l,imageKeys:h};return v.submitCheck("poa",b,{idempotencyKey:F})})}catch(v){throw v instanceof x&&(v.code==="media_type_unsupported"||v.code==="media_type_mismatch")?new TypeError("unsupported_file"):(v instanceof x&&(v.code==="document_upload_not_allowed"||v.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),v)}},I=async(n,l)=>{let p=y();if(p===null||!p.photo.uploadOffered)throw new RangeError("upload_not_offered");if(n==="holder_letter"&&p.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let h=await w(p,l);e.destroyed()||(m(),await C(n,"upload",h))},D=(n,l)=>{let p=null,h=[],v=!0,F=()=>{for(let k of p?.getTracks()??[])k.stop();p=null},b={get pages(){return h},start:async()=>{if(!v||p!==null)return;let k=await(e.pageCamera?.open??Pe)();if(!v){for(let _ of k.getTracks())_.stop();return}p=k,(e.pageCamera?.attach??ke)(n,k)},takePage:async()=>{if(h.length>=l)throw new RangeError("too_many_pages");let k=await(e.pageCamera?.grab??be)(n);if(h.length>=l)throw new RangeError("too_many_pages");return h=[...h,k],k},removePage:k=>{h=h.filter((_,T)=>T!==k)},submitPages:()=>c(async()=>{if(h.length===0)throw new RangeError("no_pages");let k=y();if(k===null)throw new RangeError("camera_not_offered");let _=k.phase==="holder_letter"?"holder_letter":"document";await C(_,"camera",h.map(T=>({kind:"image",blob:T,contentType:"image/jpeg"}))),r?.handle===b?m():b.destroy()}),destroy:()=>{v=!1,h=[],F(),r?.handle===b&&(r=null)}};return b},M=async()=>{let n=y();if(n===null||!n.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;m();let l={part:"document"};await e.runner().submit("poa",(p,h)=>p.submitCheck("poa",l,{idempotencyKey:h}))};return{bind:n=>({...n,...n.licenceAddressAccepted?{useLicenceAddress:()=>c(M)}:{},uploadPages:l=>c(()=>I("document",l)),uploadHolderLetter:l=>c(()=>I("holder_letter",l)),capturePage:l=>{if(n.photo.source==="upload")throw new RangeError("camera_not_offered");if(r!==null&&r.video===l.video)return r.handle;m();let p=D(l.video,n.maxPages);return r={video:l.video,handle:p},p}}),destroy:m}}function ce(e,r){let a=null,c=null,m=!1,y=null,w=null,C=[],I=(n,l)=>{n.off=l.on(n.event,n.handler)},D=()=>(c??(c=e.then(n=>{if(m)return null;let l=r(n),p=l.handle;for(let h of C)h.removed||I(h,p);return y!==null&&p.setSide(y),w!==null&&p.setGuide(w.guide),a=l,p}).catch(()=>{if(c=null,!m)for(let n of C)!n.removed&&n.event==="error"&&n.handler({kind:"generic",retryable:!0});return null})),c);return{handle:{get state(){return a?.handle.state??"idle"},on:(n,l)=>{let p={event:n,handler:l,off:null,removed:!1};return C.push(p),a!==null&&I(p,a.handle),()=>{p.removed=!0,p.off?.()}},start:async()=>{let n=await D();n!==null&&!m&&await n.start()},retry:()=>{a!==null?a.handle.retry():D().then(n=>n?.start())},setSide:n=>{a!==null?a.handle.setSide(n):y=n},shutter:()=>a?.handle.shutter(),setTorch:n=>a?.handle.setTorch(n),focusAt:(n,l)=>a?.handle.focusAt(n,l),setGuide:n=>{a!==null?a.handle.setGuide(n):w={guide:n}},destroy:()=>{m=!0,a?.handle.destroy(),C.length=0}},get plan(){return a?.plan??null},setFlowState:n=>a?.setFlowState(n),settle:(n,l)=>a?.settle(n,l),takeDeviceRead:n=>a?.takeDeviceRead(n)??null}}var Ce=1500,Se=["ID-1","ID-2","ID-3"],_e=["recto","verso","single"],Ie=["td1","td2","td3"],De=["pdf417","qr","datamatrix","aztec"],Me=["yes","no","some"],Re=["dmy","mdy","ymd"],Fe=["gregorian","hijri","solar_hijri","thai_buddhist"],Te=24,H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),V=(e,r)=>typeof e=="string"&&r.includes(e),de=(e,r)=>e===null||V(e,r);function Ae(e){if(!H(e))return null;let{side:r,portrait:a,mrz:c,barcode:m,scripts:y}=e;return!V(r,_e)||typeof a!="boolean"||!de(c,Ie)||!de(m,De)||!Array.isArray(y)||!y.every(w=>typeof w=="string")?null:{side:r,portrait:a,mrz:c,barcode:m,scripts:[...y]}}function Ee(e){if(!H(e))return null;let{id:r,format:a,mrzCode:c,chip:m,dates:y,sides:w}=e;if(typeof r!="string"||!V(a,Se)||!(c===null||typeof c=="string")||!V(m,Me)||!H(y)||!V(y.order,Re)||!V(y.calendar,Fe)||!Array.isArray(w)||w.length<1||w.length>2)return null;let C=w.map(Ae);return C.some(I=>I===null)?null:{id:r,format:a,mrzCode:c,chip:m,dates:{order:y.order,calendar:y.calendar},sides:C}}function xe(e,r,a){if(!H(e)||e.country!==r||e.documentType!==a)return null;let{version:c,series:m}=e;if(typeof c!="number"||!Number.isInteger(c)||!Array.isArray(m)||m.length>Te)return null;let y=m.map(Ee);return y.some(w=>w===null)?null:{country:r,documentType:a,version:c,series:y}}function pe(e){return e.series.map(r=>({format:r.format,sides:r.sides}))}function Oe(e){return H(e)&&"success"in e&&"data"in e?e.data:e}function me(e,r={}){let a=e;if(a===null||typeof a.apiOrigin!="string"||typeof a.sessionToken!="string")return;let c=a.apiOrigin,m=a.sessionToken,y=r.timeoutMs??Ce;return(w,C)=>{let I=r.fetchImpl??(typeof fetch=="function"?fetch:void 0);if(I===void 0)return Promise.resolve(null);let D=typeof AbortController=="function"?new AbortController:void 0,M,n=new Promise(p=>{M=setTimeout(()=>{D?.abort(),p(null)},y)}),l=(async()=>{let p=`country=${encodeURIComponent(w)}&type=${encodeURIComponent(C)}`,h=await I(`${c}/api/v2/hosted/document-facts?${p}`,{method:"GET",headers:{"x-session-token":m,"x-sekyro-sdk":`@sekyro/web/${z}`},cache:"default",...D!==void 0?{signal:D.signal}:{}});return h.ok?xe(Oe(await h.json()),w,C):null})().catch(()=>null);return Promise.race([l,n]).finally(()=>clearTimeout(M))}}function fe(e){let r=e;if(typeof r.apiOrigin!="string"||typeof r.sessionToken!="string")return;let a=`${r.apiOrigin}/api/v2/hosted/capture-reports`,c=r.sessionToken;return m=>{try{fetch(a,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${z}`},body:JSON.stringify({reports:m}),keepalive:!0}).catch(()=>{})}catch{}}}function ge(e){let r=e.apiOrigin;return ie("sdk",typeof r=="string"&&/staging|sandbox|localhost/.test(r)?"sandbox":"live")}function Le(e){return ge(e).replace(/\/ocr$/,"/barcode")}function yt(e){let r=null,a=null,c=null,m=q(),y=Promise.resolve(),w=()=>{c?.flow.handle.destroy(),c=null},C=null,I=()=>e.documentInternals?.catalogCapture??e.currentView()?.capture?.document?.catalog===!0,D=(t,u)=>{let o=`${t}:${u}`;if(C?.key===o)return C;if(C=null,!I()||e.documentInternals?.captureSeries!==void 0)return null;let i=e.documentFacts??me(e.runtime.client);if(i===void 0)return null;let d={key:o,promise:Promise.resolve(null),settled:!1,value:null};return d.promise=i(t,u).catch(()=>null).then(S=>(d.value=S,d.settled=!0,S)),C=d,d},M=t=>t===null?{}:{documentType:t.documentType,documentCountry:t.issuer},n=async(t,u,o)=>{if(e.destroyed())return;u.setFlowState("uploading");let i=null,d=M(o),S,P=!1,f=e.currentView()?.documents!==void 0;try{await r.submit("doc_ocr",async(G,ye)=>{if(i===null){let $=await L(G,"image","image/jpeg",t.image.size,{engine:"document"});await G.uploadToSpaces($.uploadUrl,t.image,"image/jpeg"),i=(await G.completeMedia($.key)).key}return u.setFlowState("checking"),S===void 0&&(S=u.takeDeviceRead(t)),G.submitCheck("doc_ocr",{imageKey:i,side:t.side,...S!==null?{deviceRead:S}:{},...f?{source:"camera"}:{},...d},{idempotencyKey:ye})})}catch{P=!0}finally{u.setFlowState("done")}if(e.destroyed())return;if(P){u.settle(t.side,{ok:!1,issue:"technical"});return}let E=e.currentView(),g=E===null?null:O(E,{isMobile:e.isMobile()});if(g?.kind!=="document"){u.settle(t.side,{ok:!0}),c?.flow===u?w():u.handle.destroy();return}if(g.reason==="document_type_not_accepted"||g.reason==="document_type_not_supported"){a=null,c?.flow===u&&w(),r.republish();return}let R=g.acceptedSides;t.side!=="single"&&g.side!==t.side&&(R.includes(t.side)||g.reason==="side_missing")&&!(R.includes("recto")&&R.includes("verso"))?(u.settle(t.side,{ok:!0}),a?.documentType!=="passport"&&u.handle.setSide(g.side)):t.side!=="single"&&R.length===0?(u.settle(t.side,{ok:!1,issue:"reread"}),u.handle.retry()):u.settle(t.side,{ok:!1,issue:"reread"})},l=null,p=async t=>{let u=e.currentView(),o=u===null?null:O(u,{isMobile:e.isMobile()});if(u===null||o?.kind!=="document")throw new RangeError("upload_not_offered");if(!o.photo.uploadOffered)throw new RangeError("upload_not_offered");let i=a,d=i?.documentType==="passport"?"single":o.side,{prepareUploadFile:S}=await import("./upload-file-EGXXM6TQ.js"),P=await S(t,e.uploadInternals);if(e.destroyed())return;w();let f=null,E=M(i);try{await r.submit("doc_ocr",async(g,R)=>{if(f===null){let A=await g.presign("image",P.contentType,P.blob.size,{source:"upload"});await g.uploadToSpaces(A.uploadUrl,P.blob,P.contentType),f=(await g.completeMedia(A.key)).key}return g.submitCheck("doc_ocr",{imageKey:f,side:d,source:"upload",...E},{idempotencyKey:R})})}catch(g){throw g instanceof x&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof x&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),g)}},h=(t,u)=>({...t,uploadDocument:o=>{let i=()=>p(o),d=(l===null?i():l.then(i,i)).finally(()=>{l===d&&(l=null)});return l=d,d},issuer:a?.issuer??null,documentType:a?.documentType??null,captureSide:a===null?null:a.documentType==="passport"?"single":t.side,selectDocument:(o,i)=>{if(!te(t.documents).includes(o)||!ee(t.documents,o).includes(i))throw new RangeError(`${i} from ${o} is not accepted`);(a?.issuer!==o||a.documentType!==i)&&w(),a={issuer:o,documentType:i},D(o,i),u()},capture:o=>{if(a===null)throw new Error("selectDocument() first");if(c!==null&&c.video===o.video)return c.flow.handle;w();let i=a,d=i.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,S=g=>Z({video:o.video,documentType:i.documentType,issuer:i.issuer,...d!==void 0?{side:d}:{},...o.keepScreenAwake!==void 0?{keepScreenAwake:o.keepScreenAwake}:{},...o.liveMrz!==void 0?{liveMrz:o.liveMrz}:{},...o.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:o.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let R=e.currentView()?.capture?.document,A=e.documentInternals?.blurRefuseSharpnessMax??R?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:W(R?.camera),shutter:Y(R?.scan),guideLock:X(R?.guide),...e.documentInternals?.engineOptions??{}},...typeof A=="number"&&Number.isFinite(A)&&A>=0&&A<=1?{blurRefuseSharpnessMax:A}:{},catalogCapture:e.documentInternals?.catalogCapture??R?.catalog===!0,...g!==null&&e.documentInternals?.captureSeries===void 0?{captureSeries:pe(g)}:{}}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:Le(e.runtime.client)}},...(()=>{let R=e.currentView();if(R===null||e.documentInternals?.webOcr!==void 0)return{};let A=fe(e.runtime.client);return{webOcr:{captureDocument:R.capture?.document,salt:R.sessionId,baseUrl:ge(e.runtime.client),...A!==void 0?{reports:A}:{}}}})()}),P=D(i.issuer,i.documentType),f=P===null||P.settled?S(P?.value??null):ce(P.promise,S);c={video:o.video,flow:f};let E=f.handle.destroy;return f.handle.destroy=()=>{c?.flow===f&&(c=null),E()},m.newHandle(),f.handle.on("state",g=>m.note(g)),f.handle.on("error",g=>{m.noteError(),e.reportCaptureIssue?.(j("document",g,m.value))}),f.handle.on("captured",g=>{y=y.then(()=>n(g,f,i)).catch(()=>{})}),f.handle}}),v=null,F=null,b=new Set,k=e.runtime.client;e.runtime.client=new Proxy(k,{get(t,u){if(u==="submitCheck")return(F??t).submitCheck.bind(F??t);let o=Reflect.get(t,u);return typeof o=="function"?o.bind(t):o}});let _=()=>{v?.destroy(),v=null,F=null},T=t=>{let u=e.currentView(),o=u===null?null:O(u,{isMobile:e.isMobile()});if(u===null||o?.kind!=="liveness"||o.livePhoto?.icao!==!0)return;if(v===null){let P=oe({tuning:u.capture?.icao??null,tuningVersion:u.capture?.tuningVersion??null,...o.icao!=null?{policy:o.icao.policy}:{},still:o.livePhoto.still,...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.livePhotoInternals);v=P,F=P.decorate(k),P.onGate(f=>{for(let E of b)E(f)})}let i=v,d=e.baseCapture??{},S=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:i.engineOptions.measureQuality,telemetry:P=>{S?.(P),i.engineOptions.telemetry(P)}}}},B=se({keptPortraitInput:()=>v?.lastPortraitInput()??null,runner:()=>r,currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:()=>e.refreshView(),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:t=>fe(e.runtime.client)?.([t])}),U=ue({runner:()=>r,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:()=>e.refreshView()}),s=ae({...e,bindDocument:h,bindPortrait:B.bind,bindProofOfAddress:U.bind,stopCameras:()=>{w(),B.destroy(),U.destroy(),_(),e.stopLiveness?.()},onLivePhoto:t=>(b.add(t),()=>b.delete(t))});return r=s,{...s,captureInternals:T,destroy:()=>{w(),B.destroy(),U.destroy(),_(),b.clear()}}}export{Le as barcodeAssetBase,yt as createPlanRunner,fe as reportSink,ge as sdkAssetBase};
|
|
@@ -1885,8 +1885,18 @@ interface TesterGateInput {
|
|
|
1885
1885
|
capture?: LivenessCaptureInput;
|
|
1886
1886
|
}
|
|
1887
1887
|
/** Answer of `POST /hosted/tester-gate`: the hosted view after the gate, and whether an enrolled tester was recognised. */
|
|
1888
|
+
/**
|
|
1889
|
+
* Why the tester gate did not recognise the person (2026-11-19), so the page says what to do:
|
|
1890
|
+
* - `retake`: the face could not be checked clearly (a liveness score to confirm, a capture to film again, no usable
|
|
1891
|
+
* face). Film again: this try does not count;
|
|
1892
|
+
* - `liveness`: the liveness check failed (one of the tries is used);
|
|
1893
|
+
* - `no_match`: the face matches no enrolled tester (one of the tries is used).
|
|
1894
|
+
* Absent on a bind, and from an older backend.
|
|
1895
|
+
*/
|
|
1896
|
+
type TesterGateMissReason = "retake" | "liveness" | "no_match";
|
|
1888
1897
|
type TesterGateResponse = HostedSessionView & {
|
|
1889
1898
|
bound: boolean;
|
|
1899
|
+
missReason?: TesterGateMissReason;
|
|
1890
1900
|
};
|
|
1891
1901
|
/**
|
|
1892
1902
|
* Why a Sandbox session ran on simulated test data instead of real checks:
|
|
@@ -2217,4 +2227,4 @@ interface SubmitCheckBody {
|
|
|
2217
2227
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
2218
2228
|
}
|
|
2219
2229
|
|
|
2220
|
-
export { type HostedLivePhotoTuning as $, type AcceptedDocumentType as A, type FormCustomQuestionView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type FormFieldName as G, type FormFieldQuestionView as H, type FormInput as I, type FormIssueCode as J, type FormLocale as K, type FormQuestionOptions as L, type FormQuestionType as M, type FormQuestionView as N, type HostedAcceptedDocuments as O, type HostedCaptureTuning as P, type HostedChallengeView as Q, type HostedConsentView as R, type HostedDocumentCaptureTuning as S, type HostedDocumentScanTuning as T, type HostedDocumentsView as U, type HostedEidView as V, type HostedEmailOtpView as W, type HostedFlowRef as X, type HostedFormView as Y, type HostedIcaoPolicy as Z, type HostedIntegrity as _, type ArmedRamp as a, type SandboxSimulatedReason as a$, type HostedNativeAppView as a0, type HostedNativeCaptureTuning as a1, type HostedOcrTuning as a2, type HostedOtpView as a3, type HostedPlanView as a4, type HostedPoaRuleKindView as a5, type HostedPoaRuleView as a6, type HostedPortraitPendingFix as a7, type HostedPortraitView as a8, type HostedProofOfAddressView as a9, type PhotoSource as aA, type PhotoSourcePick as aB, type PlanAttempts as aC, type PlanChoiceKind as aD, type PlanChoiceOption as aE, type PlanChoiceView as aF, type PlanSectionView as aG, type PlanStepView as aH, type PoaImagesInput as aI, type PoaInput as aJ, type PoaKind as aK, type PoaLicenceInput as aL, type PoaNameMatchMode as aM, type PoaPdfInput as aN, type PoaReason as aO, type PoaRuleSource as aP, type PopulationInput as aQ, type PopulationReason as aR, type PortraitFix as aS, type PortraitFixReviewInput as aT, type PortraitIcaoInput as aU, type PortraitIcaoReason as aV, type PortraitOutputFormat as aW, type PresignRequest as aX, type PresignUploadResult as aY, type RecordConsentResult as aZ, type ResolvedCaptureMode as a_, type HostedSessionView as aa, type HostedSimulationView as ab, type HostedStepView as ac, type HostedTesterGateView as ad, type HostedVoiceLocale as ae, type HostedVoiceView as af, type IcaoCriterion as ag, type IcaoReportEntry as ah, type IdentityConfirmDecision as ai, type IdentityMethod as aj, type IdentitySummarySource as ak, type IdentitySummaryView as al, type LivenessCaptureInput as am, type LivenessInput as an, type LivenessReason as ao, type MatchReason as ap, type MediaKind as aq, type MethodChoiceView as ar, type NationalEidOption as as, type NfcChipReason as at, type NfcStepView as au, type OtpChoiceView as av, type PhoneCountryRule as aw, type PhoneFormat as ax, type PhoneOtpInput as ay, type PhoneOtpReason as az, type AttestationInput as b, type SandboxSimulation as b0, type SessionDecidingStep as b1, type SessionFailureReason as b2, type SessionReason as b3, type SessionStatus as b4, type SessionStepView as b5, type SessionView as b6, type SimulatedCaptureInput as b7, type StepResult as b8, type StepSection as b9, type SubmitCheckBody as ba, type TesterGateInput as bb, type
|
|
2230
|
+
export { type HostedLivePhotoTuning as $, type AcceptedDocumentType as A, type FormCustomQuestionView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type FormFieldName as G, type FormFieldQuestionView as H, type FormInput as I, type FormIssueCode as J, type FormLocale as K, type FormQuestionOptions as L, type FormQuestionType as M, type FormQuestionView as N, type HostedAcceptedDocuments as O, type HostedCaptureTuning as P, type HostedChallengeView as Q, type HostedConsentView as R, type HostedDocumentCaptureTuning as S, type HostedDocumentScanTuning as T, type HostedDocumentsView as U, type HostedEidView as V, type HostedEmailOtpView as W, type HostedFlowRef as X, type HostedFormView as Y, type HostedIcaoPolicy as Z, type HostedIntegrity as _, type ArmedRamp as a, type SandboxSimulatedReason as a$, type HostedNativeAppView as a0, type HostedNativeCaptureTuning as a1, type HostedOcrTuning as a2, type HostedOtpView as a3, type HostedPlanView as a4, type HostedPoaRuleKindView as a5, type HostedPoaRuleView as a6, type HostedPortraitPendingFix as a7, type HostedPortraitView as a8, type HostedProofOfAddressView as a9, type PhotoSource as aA, type PhotoSourcePick as aB, type PlanAttempts as aC, type PlanChoiceKind as aD, type PlanChoiceOption as aE, type PlanChoiceView as aF, type PlanSectionView as aG, type PlanStepView as aH, type PoaImagesInput as aI, type PoaInput as aJ, type PoaKind as aK, type PoaLicenceInput as aL, type PoaNameMatchMode as aM, type PoaPdfInput as aN, type PoaReason as aO, type PoaRuleSource as aP, type PopulationInput as aQ, type PopulationReason as aR, type PortraitFix as aS, type PortraitFixReviewInput as aT, type PortraitIcaoInput as aU, type PortraitIcaoReason as aV, type PortraitOutputFormat as aW, type PresignRequest as aX, type PresignUploadResult as aY, type RecordConsentResult as aZ, type ResolvedCaptureMode as a_, type HostedSessionView as aa, type HostedSimulationView as ab, type HostedStepView as ac, type HostedTesterGateView as ad, type HostedVoiceLocale as ae, type HostedVoiceView as af, type IcaoCriterion as ag, type IcaoReportEntry as ah, type IdentityConfirmDecision as ai, type IdentityMethod as aj, type IdentitySummarySource as ak, type IdentitySummaryView as al, type LivenessCaptureInput as am, type LivenessInput as an, type LivenessReason as ao, type MatchReason as ap, type MediaKind as aq, type MethodChoiceView as ar, type NationalEidOption as as, type NfcChipReason as at, type NfcStepView as au, type OtpChoiceView as av, type PhoneCountryRule as aw, type PhoneFormat as ax, type PhoneOtpInput as ay, type PhoneOtpReason as az, type AttestationInput as b, type SandboxSimulation as b0, type SessionDecidingStep as b1, type SessionFailureReason as b2, type SessionReason as b3, type SessionStatus as b4, type SessionStepView as b5, type SessionView as b6, type SimulatedCaptureInput as b7, type StepResult as b8, type StepSection as b9, type BackgroundUniformity as bA, type SubmitCheckBody as ba, type TesterGateInput as bb, type TesterGateMissReason as bc, type TesterGateResponse as bd, type VerificationAssurance as be, type VerificationLevel as bf, type ScreenRampColour as bg, type AgeEstimationReason as bh, type CameraUnavailableCause as bi, type CaptureEnvironment as bj, type CaptureIssueReport as bk, type CaptureProvenance as bl, type HostedBranding as bm, type HostedBrandingColorKey as bn, type HostedLivenessCaptureTuning as bo, type IcaoCaptureTuning as bp, type RetakeHint as bq, type ScreenRampChallenge as br, type ScreenRampPaint as bs, type ScreenRampRendered as bt, type ScreenRampReport as bu, ICAO_FALLBACK as bv, type IcaoProfile as bw, type ResolvedIcaoTuning as bx, resolveIcaoTuning as by, type PersonMask as bz, type CaptureMode as c, type CaptureNoncesResult as d, type CaptureProof as e, type CheckInputByType as f, type CheckReason as g, type CheckState as h, type CheckType as i, type ClosedBy as j, type CompleteMediaResult as k, type ConsentLocale as l, type ContactChannel as m, type DocDeviceRead as n, type DocOcrInput as o, type DocReason as p, type DocSide as q, type EidAuthInput as r, type EidReason as s, type EmailOtpInput as t, type EmailOtpReason as u, type FaceMatchReason as v, type FormAddressValue as w, type FormAnswerValue as x, type FormChoiceView as y, type FormConsentView as z };
|
|
@@ -1885,8 +1885,18 @@ interface TesterGateInput {
|
|
|
1885
1885
|
capture?: LivenessCaptureInput;
|
|
1886
1886
|
}
|
|
1887
1887
|
/** Answer of `POST /hosted/tester-gate`: the hosted view after the gate, and whether an enrolled tester was recognised. */
|
|
1888
|
+
/**
|
|
1889
|
+
* Why the tester gate did not recognise the person (2026-11-19), so the page says what to do:
|
|
1890
|
+
* - `retake`: the face could not be checked clearly (a liveness score to confirm, a capture to film again, no usable
|
|
1891
|
+
* face). Film again: this try does not count;
|
|
1892
|
+
* - `liveness`: the liveness check failed (one of the tries is used);
|
|
1893
|
+
* - `no_match`: the face matches no enrolled tester (one of the tries is used).
|
|
1894
|
+
* Absent on a bind, and from an older backend.
|
|
1895
|
+
*/
|
|
1896
|
+
type TesterGateMissReason = "retake" | "liveness" | "no_match";
|
|
1888
1897
|
type TesterGateResponse = HostedSessionView & {
|
|
1889
1898
|
bound: boolean;
|
|
1899
|
+
missReason?: TesterGateMissReason;
|
|
1890
1900
|
};
|
|
1891
1901
|
/**
|
|
1892
1902
|
* Why a Sandbox session ran on simulated test data instead of real checks:
|
|
@@ -2217,4 +2227,4 @@ interface SubmitCheckBody {
|
|
|
2217
2227
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
2218
2228
|
}
|
|
2219
2229
|
|
|
2220
|
-
export { type HostedLivePhotoTuning as $, type AcceptedDocumentType as A, type FormCustomQuestionView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type FormFieldName as G, type FormFieldQuestionView as H, type FormInput as I, type FormIssueCode as J, type FormLocale as K, type FormQuestionOptions as L, type FormQuestionType as M, type FormQuestionView as N, type HostedAcceptedDocuments as O, type HostedCaptureTuning as P, type HostedChallengeView as Q, type HostedConsentView as R, type HostedDocumentCaptureTuning as S, type HostedDocumentScanTuning as T, type HostedDocumentsView as U, type HostedEidView as V, type HostedEmailOtpView as W, type HostedFlowRef as X, type HostedFormView as Y, type HostedIcaoPolicy as Z, type HostedIntegrity as _, type ArmedRamp as a, type SandboxSimulatedReason as a$, type HostedNativeAppView as a0, type HostedNativeCaptureTuning as a1, type HostedOcrTuning as a2, type HostedOtpView as a3, type HostedPlanView as a4, type HostedPoaRuleKindView as a5, type HostedPoaRuleView as a6, type HostedPortraitPendingFix as a7, type HostedPortraitView as a8, type HostedProofOfAddressView as a9, type PhotoSource as aA, type PhotoSourcePick as aB, type PlanAttempts as aC, type PlanChoiceKind as aD, type PlanChoiceOption as aE, type PlanChoiceView as aF, type PlanSectionView as aG, type PlanStepView as aH, type PoaImagesInput as aI, type PoaInput as aJ, type PoaKind as aK, type PoaLicenceInput as aL, type PoaNameMatchMode as aM, type PoaPdfInput as aN, type PoaReason as aO, type PoaRuleSource as aP, type PopulationInput as aQ, type PopulationReason as aR, type PortraitFix as aS, type PortraitFixReviewInput as aT, type PortraitIcaoInput as aU, type PortraitIcaoReason as aV, type PortraitOutputFormat as aW, type PresignRequest as aX, type PresignUploadResult as aY, type RecordConsentResult as aZ, type ResolvedCaptureMode as a_, type HostedSessionView as aa, type HostedSimulationView as ab, type HostedStepView as ac, type HostedTesterGateView as ad, type HostedVoiceLocale as ae, type HostedVoiceView as af, type IcaoCriterion as ag, type IcaoReportEntry as ah, type IdentityConfirmDecision as ai, type IdentityMethod as aj, type IdentitySummarySource as ak, type IdentitySummaryView as al, type LivenessCaptureInput as am, type LivenessInput as an, type LivenessReason as ao, type MatchReason as ap, type MediaKind as aq, type MethodChoiceView as ar, type NationalEidOption as as, type NfcChipReason as at, type NfcStepView as au, type OtpChoiceView as av, type PhoneCountryRule as aw, type PhoneFormat as ax, type PhoneOtpInput as ay, type PhoneOtpReason as az, type AttestationInput as b, type SandboxSimulation as b0, type SessionDecidingStep as b1, type SessionFailureReason as b2, type SessionReason as b3, type SessionStatus as b4, type SessionStepView as b5, type SessionView as b6, type SimulatedCaptureInput as b7, type StepResult as b8, type StepSection as b9, type SubmitCheckBody as ba, type TesterGateInput as bb, type
|
|
2230
|
+
export { type HostedLivePhotoTuning as $, type AcceptedDocumentType as A, type FormCustomQuestionView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type FormFieldName as G, type FormFieldQuestionView as H, type FormInput as I, type FormIssueCode as J, type FormLocale as K, type FormQuestionOptions as L, type FormQuestionType as M, type FormQuestionView as N, type HostedAcceptedDocuments as O, type HostedCaptureTuning as P, type HostedChallengeView as Q, type HostedConsentView as R, type HostedDocumentCaptureTuning as S, type HostedDocumentScanTuning as T, type HostedDocumentsView as U, type HostedEidView as V, type HostedEmailOtpView as W, type HostedFlowRef as X, type HostedFormView as Y, type HostedIcaoPolicy as Z, type HostedIntegrity as _, type ArmedRamp as a, type SandboxSimulatedReason as a$, type HostedNativeAppView as a0, type HostedNativeCaptureTuning as a1, type HostedOcrTuning as a2, type HostedOtpView as a3, type HostedPlanView as a4, type HostedPoaRuleKindView as a5, type HostedPoaRuleView as a6, type HostedPortraitPendingFix as a7, type HostedPortraitView as a8, type HostedProofOfAddressView as a9, type PhotoSource as aA, type PhotoSourcePick as aB, type PlanAttempts as aC, type PlanChoiceKind as aD, type PlanChoiceOption as aE, type PlanChoiceView as aF, type PlanSectionView as aG, type PlanStepView as aH, type PoaImagesInput as aI, type PoaInput as aJ, type PoaKind as aK, type PoaLicenceInput as aL, type PoaNameMatchMode as aM, type PoaPdfInput as aN, type PoaReason as aO, type PoaRuleSource as aP, type PopulationInput as aQ, type PopulationReason as aR, type PortraitFix as aS, type PortraitFixReviewInput as aT, type PortraitIcaoInput as aU, type PortraitIcaoReason as aV, type PortraitOutputFormat as aW, type PresignRequest as aX, type PresignUploadResult as aY, type RecordConsentResult as aZ, type ResolvedCaptureMode as a_, type HostedSessionView as aa, type HostedSimulationView as ab, type HostedStepView as ac, type HostedTesterGateView as ad, type HostedVoiceLocale as ae, type HostedVoiceView as af, type IcaoCriterion as ag, type IcaoReportEntry as ah, type IdentityConfirmDecision as ai, type IdentityMethod as aj, type IdentitySummarySource as ak, type IdentitySummaryView as al, type LivenessCaptureInput as am, type LivenessInput as an, type LivenessReason as ao, type MatchReason as ap, type MediaKind as aq, type MethodChoiceView as ar, type NationalEidOption as as, type NfcChipReason as at, type NfcStepView as au, type OtpChoiceView as av, type PhoneCountryRule as aw, type PhoneFormat as ax, type PhoneOtpInput as ay, type PhoneOtpReason as az, type AttestationInput as b, type SandboxSimulation as b0, type SessionDecidingStep as b1, type SessionFailureReason as b2, type SessionReason as b3, type SessionStatus as b4, type SessionStepView as b5, type SessionView as b6, type SimulatedCaptureInput as b7, type StepResult as b8, type StepSection as b9, type BackgroundUniformity as bA, type SubmitCheckBody as ba, type TesterGateInput as bb, type TesterGateMissReason as bc, type TesterGateResponse as bd, type VerificationAssurance as be, type VerificationLevel as bf, type ScreenRampColour as bg, type AgeEstimationReason as bh, type CameraUnavailableCause as bi, type CaptureEnvironment as bj, type CaptureIssueReport as bk, type CaptureProvenance as bl, type HostedBranding as bm, type HostedBrandingColorKey as bn, type HostedLivenessCaptureTuning as bo, type IcaoCaptureTuning as bp, type RetakeHint as bq, type ScreenRampChallenge as br, type ScreenRampPaint as bs, type ScreenRampRendered as bt, type ScreenRampReport as bu, ICAO_FALLBACK as bv, type IcaoProfile as bw, type ResolvedIcaoTuning as bx, resolveIcaoTuning as by, type PersonMask as bz, type CaptureMode as c, type CaptureNoncesResult as d, type CaptureProof as e, type CheckInputByType as f, type CheckReason as g, type CheckState as h, type CheckType as i, type ClosedBy as j, type CompleteMediaResult as k, type ConsentLocale as l, type ContactChannel as m, type DocDeviceRead as n, type DocOcrInput as o, type DocReason as p, type DocSide as q, type EidAuthInput as r, type EidReason as s, type EmailOtpInput as t, type EmailOtpReason as u, type FaceMatchReason as v, type FormAddressValue as w, type FormAnswerValue as x, type FormChoiceView as y, type FormConsentView as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/web",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.40",
|
|
4
4
|
"description": "Sekyro AI web SDK \u2014 browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "web",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.40",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.40",
|
|
102
102
|
"description": "Sekyro AI web SDK — browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.40?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"name": "tasks-vision",
|
|
151
151
|
"group": "@mediapipe",
|
|
152
152
|
"version": "0.10.35",
|
|
153
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
153
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.40|@mediapipe/tasks-vision@0.10.35",
|
|
154
154
|
"licenses": [
|
|
155
155
|
{
|
|
156
156
|
"license": {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"name": "thumbmarkjs",
|
|
186
186
|
"group": "@thumbmarkjs",
|
|
187
187
|
"version": "1.12.0",
|
|
188
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
188
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.40|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
189
189
|
"licenses": [
|
|
190
190
|
{
|
|
191
191
|
"license": {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
"name": "emscripten",
|
|
221
221
|
"group": "@types",
|
|
222
222
|
"version": "1.41.6",
|
|
223
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
223
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.40|@types/emscripten@1.41.6",
|
|
224
224
|
"licenses": [
|
|
225
225
|
{
|
|
226
226
|
"license": {
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"type": "library",
|
|
255
255
|
"name": "type-fest",
|
|
256
256
|
"version": "4.41.0",
|
|
257
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
257
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.40|type-fest@4.41.0",
|
|
258
258
|
"licenses": [
|
|
259
259
|
{
|
|
260
260
|
"expression": "(MIT OR CC0-1.0)",
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"type": "library",
|
|
287
287
|
"name": "zxing-wasm",
|
|
288
288
|
"version": "2.1.0",
|
|
289
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
289
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.40|zxing-wasm@2.1.0",
|
|
290
290
|
"licenses": [
|
|
291
291
|
{
|
|
292
292
|
"license": {
|
|
@@ -319,30 +319,30 @@
|
|
|
319
319
|
],
|
|
320
320
|
"dependencies": [
|
|
321
321
|
{
|
|
322
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
322
|
+
"ref": "@sekyro/web@0.1.0-rc.40",
|
|
323
323
|
"dependsOn": [
|
|
324
|
-
"@sekyro/web@0.1.0-rc.
|
|
325
|
-
"@sekyro/web@0.1.0-rc.
|
|
326
|
-
"@sekyro/web@0.1.0-rc.
|
|
324
|
+
"@sekyro/web@0.1.0-rc.40|@mediapipe/tasks-vision@0.10.35",
|
|
325
|
+
"@sekyro/web@0.1.0-rc.40|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
326
|
+
"@sekyro/web@0.1.0-rc.40|zxing-wasm@2.1.0"
|
|
327
327
|
]
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
330
|
+
"ref": "@sekyro/web@0.1.0-rc.40|@mediapipe/tasks-vision@0.10.35"
|
|
331
331
|
},
|
|
332
332
|
{
|
|
333
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
333
|
+
"ref": "@sekyro/web@0.1.0-rc.40|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
336
|
+
"ref": "@sekyro/web@0.1.0-rc.40|@types/emscripten@1.41.6"
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
339
|
+
"ref": "@sekyro/web@0.1.0-rc.40|type-fest@4.41.0"
|
|
340
340
|
},
|
|
341
341
|
{
|
|
342
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
342
|
+
"ref": "@sekyro/web@0.1.0-rc.40|zxing-wasm@2.1.0",
|
|
343
343
|
"dependsOn": [
|
|
344
|
-
"@sekyro/web@0.1.0-rc.
|
|
345
|
-
"@sekyro/web@0.1.0-rc.
|
|
344
|
+
"@sekyro/web@0.1.0-rc.40|@types/emscripten@1.41.6",
|
|
345
|
+
"@sekyro/web@0.1.0-rc.40|type-fest@4.41.0"
|
|
346
346
|
]
|
|
347
347
|
}
|
|
348
348
|
]
|
package/dist/chunk-26XZRWBD.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{B as ft,C as mt,D as ht,E as yt,a as ot,b as rt,c as it,d as Z,e as J,f as ie,g as st,h as K,i as at,j as M,k as j,l as T,m as D,n as U,o as X,p as ut,q as z,r as se,s as ct,t as dt,u as lt,v as pt}from"./chunk-UKYJYZZS.js";import{n as et}from"./chunk-P5OIQXVM.js";import{a as ze}from"./chunk-7QZWBDI5.js";import{c as G,e as tt,g as nt,h as ae}from"./chunk-PNOGF72U.js";import{c as Je,d as ke}from"./chunk-TSA6GHUG.js";import{b as Xe}from"./chunk-HMOOVRKA.js";function gt(e){let t=e.now??(()=>Date.now()),n=e.setTimer??((h,p)=>setTimeout(h,p)),i=e.clearTimer??(h=>clearTimeout(h)),r=null,u=!1,s=!1,c=!1,f=0,S=null,_=()=>{S!==null&&i(S),S=null},A=()=>{let h=e.armRamp;h===void 0||u||s||c||t()<f||(u=!0,h().catch(()=>{}).then(p=>{if(u=!1,!c){if(p===void 0){f=t()+2e3;return}if(p.challenge===void 0){s=!0;return}r={challenge:p.challenge,expiresAt:p.expiresAt},_(),S=n(()=>{S=null,!c&&r!==null&&e.waiting()&&A()},Math.max(1e3,p.expiresAt-t()-2e4))}}))};return{arm(){r!==null&&r.expiresAt-t()>2e4||A()},take(){let h=r;return r=null,_(),h!==null&&h.expiresAt-t()>=12e3?h.challenge:void 0},stop(){c=!0,r=null,_()}}}function ue(e){return e.idNumberBound??e.nniBound}function ee(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function St(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var Xt="https://api.sekyro.ai",zt=5e3,en=24e4,tn=9e4,nn=25*6e4,on=20*6e4,rn=3,sn=3e3,an=1500,un=10;function _t(e){return e instanceof Error&&e.name==="ChallengeError"&&e.code||"challenge_failed"}var kt=new Set(["aborted","embedder_opaque","site_key_rejected"]);function cn(e){return new Promise(t=>setTimeout(t,e))}function dn(){let e=globalThis.crypto;if(e!==void 0&&typeof e.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(e!==void 0&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let i=0;i<16;i+=1)t[i]=Math.floor(Math.random()*256);t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;let n=[...t].map(i=>i.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function Po(e){return ln(e,{})}function ln(e,t){let n=e.apiOrigin??Xt,i=e.autoRetry??!0,r=e.rearm??"auto",u=t.client??new nt({apiOrigin:n,sessionToken:e.clientToken,fetch:e.fetch,locale:e.locale}),s=new Proxy(u,{get(o,a){if(a==="submitCheck")return Bt;let d=Reflect.get(o,a,o);return typeof d=="function"?d.bind(o):d}}),c=t.sleep??cn,f=t.uuid??dn,S=t.getChallengeToken??((o,a)=>import("./challenge-frame-YBTLAQ5G.js").then(d=>d.executeChallenge({frameUrl:o.url,siteKey:o.siteKey,action:"liveness",subject:a.subject,signal:a.signal}))),_=ze(),A=null,h=null,p=!1,O=new AbortController,k=null,de=null,te=null,ne=()=>te??ct(k),oe=()=>dt(se(k),ne()),E=o=>{k=o,!M(o)&&(Be(on)||Dt(o))&&_e(o),_.emit("view",o),A?.onView(o)},x=()=>k!==null?Promise.resolve(k):(de??(de=s.getSession().then(o=>(E(o),o)).finally(()=>{de=null})),de),I=async()=>{let o=await s.getSession();return E(o),o},le=async(o,a)=>{o.plan!==void 0?E(o):await I()},pe=null,Me=async o=>{let a=await x();if(o||!a.consentRecorded){let d=await s.recordConsent(e.locale);d.plan!==void 0?E(d):k!==null&&E({...k,consentRecorded:!0})}re()&&_e(a)},F=o=>o?.force===!0?Me(!0):(pe??(pe=Me(!1).finally(()=>{pe=null})),pe),fe={client:s,ensureConsent:o=>F(o),sleep:c,uuid:f,...t.random!==void 0?{random:t.random}:{},onBusy:o=>{p||_.emit("busy",o)}},Oe=!1,Ee=null,me=o=>{if(o.status==="verified"||o.status==="not_verified"||o.status==="review"){if(Oe)return;Oe=!0}Ee=JSON.stringify(o),_.emit("result",o)},Nt=o=>{Ee!==JSON.stringify(o)&&me(o)},Ie=async o=>{let a=k;o&&(a=await I().catch(()=>k));let d=a===null?null:K(a);return d!==null&&!p&&_.emit("method",d),d!==null},ve=null,Te=!1,Ve=!1,Fe=()=>mt(fe,(o,a)=>o.submitCheck("population_registry",{},{idempotencyKey:a})),Ne=o=>ue(o)===!0||ee(T(o,"population_registry"))===!0,Ht=async()=>{try{let o=await x();if(M(o)||K(o)!==null||j(o)?.checkType!=="population_registry")return;if(!Ne(o)&&ee(T(o,"population_registry"))===void 0&&(o=await I()),!Ne(o)){Ve=!0;return}await F(),await le(await Fe(),"population_registry");let a=k===null?void 0:T(k,"population_registry");if(a?.state==="input_required"&&a.reason==="registry_unavailable"&&ie(a)>0){if(await c(zt),p)return;await le(await Fe(),"population_registry")}}catch(o){if(o instanceof G&&(o.code==="check_not_active"||o.code==="step_not_on_path")){await I().catch(()=>{});return}Te=!0;return}k!==null&&M(k)&&me(X(k,{autoRetry:i}))},He=()=>(ve??(ve=Ht()),ve),v=t.now??Date.now,q=null,Y,he,Lt=0,ye=(o,a)=>`${o.url}
|
|
2
|
-
${o.siteKey}
|
|
3
|
-
${a}`,Le=0,ge,Se=(o,a)=>{Le+=1;let d=v(),y=S(o,{signal:O.signal,subject:a}),m={key:ye(o,a),at:d,token:y};return y.then(()=>{m.issuedAt=v(),he=void 0},C=>{let g=_t(C);if(m.failed=g,p||g==="aborted")return;he=g;let{detail:b,readyMs:l}=C;W({check:"attestation",kind:"unavailable",engineKind:g,attempt:Lt++,challengeMs:v()-d,readyMs:l,detail:b,inApp:Xe()})}),y.catch(()=>{}),m},De=(o,a)=>o!==null&&o.key===a&&(o.issuedAt===void 0||v()-o.issuedAt<en),_e=(o,a={})=>{let d=o?.challenge??null;if(o===null||d===null||p)return;let y=D(o.sessionId),m=q;(a.replaceFailed===!0&&m?.failed!==void 0&&!kt.has(m.failed)||!De(m,ye(d,y)))&&(q=Se(d,y))},Ue=async(o,a)=>{let d=ye(o,a),y=q;q=null;let m=De(y,d)?y:Se(o,a),C=m===y?0:1,g,b=new Promise(l=>{g=setTimeout(()=>l("late"),tn)});try{for(;;){let l=await Promise.race([m.token.then(P=>({token:P}),P=>({error:_t(P)})),b]);if(l==="late")return!p&&q===null&&(q=m),{error:he??"timeout"};if("token"in l)return ge=Math.max(0,Math.round((m.issuedAt??v())-m.at)),l;if(p||kt.has(l.error)||C>=rn||C>0&&await Promise.race([c(sn*C),b])==="late")return l;if(p)return{error:"aborted"};C+=1,m=Se(o,a)}}finally{clearTimeout(g)}},H=null,Dt=o=>J(o).some(a=>(a.checkType==="phone_otp"||a.checkType==="email_otp")&&a.state!=="passed"&&a.state!=="skipped"),Be=o=>H===null||v()-H>=o,re=()=>Be(nn),Ut=o=>{let a=o.attestation;return typeof a?.turnstileToken=="string"&&a.turnstileToken.length>0},qe=new Map,Ge=async()=>{let o=await x(),a=o.challenge;if(a==null||o.simulation!==void 0)return;let d=await Ue(a,D(o.sessionId));if(!("token"in d))throw new G({status:400,code:"attestation_invalid",message:`browser check: ${d.error}`});return d.token},Bt=async(o,a,d={})=>{let y=a;if("attestation"in y)try{let l=await u.submitCheck(o,a,d);return Ut(y)&&(H=v()),l}catch(l){throw l instanceof G&&l.code==="attestation_invalid"&&(H=null),l}let m=(o==="phone_otp"||o==="email_otp")&&y.action!=="verify",C=d.idempotencyKey,g=C!==void 0?qe.get(C):void 0;g===void 0&&(m||re())&&(g=await Ge(),C!==void 0&&g!==void 0&&qe.set(C,g));let b=(l,P)=>l!==void 0?{...P,browserCheckToken:l}:P;try{let l=await u.submitCheck(o,a,b(g,d));return g!==void 0&&(H=v()),l}catch(l){if(!(l instanceof G)||l.code!=="attestation_invalid"||(H=null,g!==void 0))throw l;let P=await Ge(),L=C!==void 0?{...d,idempotencyKey:f()}:d,N=await u.submitCheck(o,a,b(P,L));return P!==void 0&&(H=v()),N}},Ke=async(o={})=>{if(Y=void 0,o.always!==!0&&!re())return{};let a=await x(),d=a.challenge;if(d==null)return{};let y=await Ue(d,D(a.sessionId));if("token"in y)return{channel:"hosted_web",turnstileToken:y.token};if(Y=y.error,a.simulation!==void 0)return{channel:"hosted_web"};throw new ft(y.error)},qt=()=>Y,Gt=()=>({checks:Math.min(50,Le),...ge!==void 0?{challengeMs:Math.min(6e5,ge)}:{}}),W=o=>{if(p)return;let a=s.reportCaptureIssue;if(a===void 0)return;let d=o.formFactor;try{d??(d=Je())}catch{}try{Promise.resolve(a.call(s,{...o,...d!==void 0?{formFactor:d}:{}})).catch(()=>{})}catch{}},R=null,$=null,je=new WeakMap,Ye=Promise.resolve(),Q=0,Kt=async()=>{let o=await x();for(let a=0;a<un&&!p&&!M(o)&&j(o)===void 0&&J(o).some(d=>d.state==="processing")&&(await c(an),!p);a+=1)o=await I();return o},jt=async(o,a,d)=>{let{capture:y}=o,m=()=>p,C=()=>o.alive&&o.attempt===d,g=l=>{C()&&y.setFlowState(l)},b=l=>{if(!m()&&(l.status==="unavailable"&&l.reasonCode!==void 0&&!ot(l.reasonCode)&&W({check:"liveness",kind:"unavailable",phase:"upload",engineKind:l.reasonCode,attempt:Math.max(0,o.issues.value)}),me(l),!!C())){if(l.status==="retry"&&r==="auto"){y.handle.retry();return}y.setFlowState("done")}};if(a.degraded==="NO_RECORDER"){let l=k?.sessionId??(await x().catch(()=>null))?.sessionId??"";b(U(l,"no_recorder"));return}g("uploading");try{if(await He(),m())return;let l=await x(),P;if(!M(l)&&K(l)!==null){await Ie(!1),b(U(l.sessionId,"method_required"));return}if(!M(l)){if(j(l)?.checkType==="population_registry"){b(U(l.sessionId,Ve?"nni_unbound":Te?"network":"registry_unavailable"));return}if(await F(),m())return;P=k??l;let L=await ht({...fe,artifacts:a,getAttestation:Ke,attestationError:qt,attestationFacts:Gt,clipKeys:{get:()=>je.get(a)??null,set:N=>{je.set(a,N)}},getView:()=>k??l,refreshView:I,applySubmit:le,onPhase:g,isCancelled:m,onKeyframePromoted:N=>{h=N}});if(m())return;if(L.kind==="unavailable"){L.reason==="attestation"&&($={bound:o,artifacts:a});let N=U(l.sessionId,L.reason),Ze=L.reason==="attestation"?Y:void 0;b(Ze!==void 0?{...N,attestationError:Ze}:N);return}if(L.kind==="resync"&&await I(),k!==null&&K(k)!==null){await Ie(!1),b(U(l.sessionId,"method_required"));return}l=await Kt()}b(X(l,{autoRetry:i,previous:P}))}catch{if(m())return;b(U(k?.sessionId??"","network"))}},We=(o,a)=>{let d=o.attempt;Q>0&&o.alive&&o.capture.setFlowState("uploading"),Q+=1,Ye=Ye.then(()=>jt(o,a,d)).finally(()=>{Q-=1,Q===0&&A?.onChainIdle()}).catch(()=>{})},$e=o=>{R?.capture.handle.destroy(),R!==null&&(R.alive=!1,R.ramp.stop());let a=gt({armRamp:typeof s.armRamp=="function"?()=>s.armRamp():void 0,waiting:()=>m.alive&&oe()==="self"&&(y.handle.state==="starting"||y.handle.state==="gating")}),d=Promise.resolve(),y=et(o,A?.captureInternals?.(o)??t.capture,()=>k?.capture?.liveness?.keyframe?.rank===!0,oe,()=>a.take()??k?.capture?.liveness?.screenRamp,{session:()=>se(k),onModeChange:g=>{te=g}}),m={capture:y,alive:!0,ramp:a,attempt:0,issues:it()};R=m,y.handle.on("error",g=>{W(rt("liveness",g,m.issues.value))}),y.handle.on("state",g=>{if(m.issues.note(g),g==="starting"){m.attempt+=1,$?.bound===m&&($=null),re()&&_e(k,{replaceFailed:!0});let b=k===null?void 0:j(k)?.checkType;d=b==="liveness"||b==="face_match"?F().catch(()=>{}):Promise.resolve()}(g==="starting"||g==="gating")&&oe()==="self"&&d.then(()=>{m.alive&&a.arm()})}),y.handle.on("captured",g=>{Promise.resolve().then(()=>We(m,g))});let C=y.handle;return{get state(){return C.state},get captureMode(){return C.captureMode},get facingMode(){return C.facingMode},on:(g,b)=>C.on(g,b),start:async g=>{if(k===null&&await x().catch(()=>{}),!!m.alive)return C.start(g)},retry:()=>{let g=$;if(g!==null&&g.bound===m&&m.alive){$=null,We(m,g.artifacts);return}C.retry()},switchCamera:()=>C.switchCamera(),canSwitchCaptureMode:()=>C.canSwitchCaptureMode(),setCaptureMode:g=>C.setCaptureMode(g),destroy:()=>{m.alive=!1,a.stop(),R===m&&(R=null),C.destroy()}}},Yt=async()=>{if(p)return null;try{let o=await x();return p?null:K(o)}catch{return null}},Wt=async()=>{if(p)return"self";try{let o=await x();if(p)return"self";let a=se(o);return a==="choice"?ne()??a:a}catch{return"self"}},$t=async()=>{if(p)return!1;try{let o=await x();return p||M(o)||ke()?!1:z(o,j(o))==="phone"||z(o,T(o,"liveness"))==="phone"}catch{return!1}},Qt=async()=>{if(p)return!1;try{let o=await x();return!p&&o.returning===!0}catch{return!1}},Zt=async o=>{let a=(await x()).plan?.choice,d=a?.options.find(m=>Z[m.service]===o);if(!d)throw new RangeError(`method ${String(o)} is not offered`);let y=await s.choose(a.nodeId,d.id);p||E(y)},Qe=null,Jt=()=>(Qe??(Qe=import("./plan-runner-ZVYJ3UI3.js").then(o=>{let a=o.createPlanRunner({runtime:fe,currentView:()=>k,cameraMode:oe,captureModeSwitch:{pick:ne,choose:d=>{te=d}},ensureView:x,refreshView:I,ensureConsent:()=>F(),liveness:$e,stopLiveness:()=>{R!==null&&(R.alive=!1,R.ramp.stop(),R.capture.handle.destroy(),R=null)},chainBusy:()=>Q>0,destroyed:()=>p,sleep:c,isMobile:ke,now:t.now??Date.now,keptFaceKey:()=>h,setView:E,baseCapture:t.capture,emitStep:d=>{p||_.emit("step",d)},emitResult:Nt,reportCaptureIssue:W,documentInternals:t.document,documentFacts:t.documentFacts,portraitInternals:t.portrait,livePhotoInternals:t.livePhoto,uploadInternals:t.upload,pageCameraInternals:t.pageCamera});return A=a,a})),Qe);return{consent:()=>F(),startRegistry:He,methodChoice:Yt,selectMethod:Zt,reportCameraUnavailable:async o=>{await F();let a=s.reportCameraUnavailable;if(a===void 0)throw new TypeError("this client cannot report a missing camera");let d=await a.call(s,o).catch(y=>{if(y instanceof G&&y.code==="check_out_of_order")return s.getSession();throw y});p||E(d)},reportCaptureIssue:W,testerGate:async o=>{let a=s.testerGate;if(a===void 0)throw new TypeError("this client cannot run the tester gate");let d=o.clip,y=tt(o.clipMime??"");if(d===void 0||!pt.includes(y))throw new TypeError("the capture has no clip");await F();let m=await lt(s,"clip",y,d.size,{engine:o.engine,durationMs:o.clipMs});await s.uploadToSpaces(m.uploadUrl,d,y);let{key:C}=await s.completeMedia(m.key),g=await Ke({always:!0}),b=await a.call(s,{clipKey:C,attestation:g,captureChannel:o.captureChannel,capture:{...yt(o),attestationError:Y}}),{bound:l,...P}=b;return p||(P.plan!==void 0?E(P):await I()),{bound:l===!0}},mobileRequired:$t,captureMode:Wt,chooseCaptureMode:o=>{te=o},get captureChoice(){return ne()},returning:Qt,liveness:$e,run:async()=>{if(p)throw new Error("verification destroyed");return(await Jt()).run()},currentStep:()=>A?.current()??null,voiceClips:async()=>{if(p)return null;try{let o=await x();return p?null:o.voice??null}catch{return null}},on:(o,a)=>_.on(o,a),destroy:()=>{p=!0,O.abort(),A?.destroy(),R!==null&&(R.alive=!1,R.capture.handle.destroy(),R=null),_.clear()}}}var Ct=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"];var pn=["carte_identite","passport","residence_permit","drivers_license"],fn=["carte_identite","passport","residence_permit"];function mn(e,t){let n=e.byIssuer?.[t]??e.default;return pn.filter(i=>n==="*"?fn.includes(i):n.includes(i))}function Io(e,t=Ct){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(i=>mn(e,i).length>0).sort()}function bt(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}function vo(e){return/^[A-Z]{2}$/.test(e)?String.fromCodePoint(...[...e].map(t=>127462+t.charCodeAt(0)-65)):""}var w={fullNameMin:2,fullName:200,email:254,occupation:120,shortText:120,longText:1e3,addressLine:120,addressLines:4,city:80,postcode:16,number:1e12,dateMin:"1900-01-01",dateMax:"2100-12-31"},hn=new Set(["full_name","birth_date","email","phone","address","country","occupation"]),yn=new Set(["short_text","long_text","single_choice","multiple_choice","yes_no","date","number"]),gn=new Set(["ar","fa","he","ur"]);function wt(e){return gn.has(e.split("-")[0]?.toLowerCase()??"")?"rtl":"ltr"}function At(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.locale!="string"||!Array.isArray(t.questions)||t.questions.length===0)return null;let n=t.consents??[];if(!Array.isArray(n))return null;for(let r of t.questions)if(!Sn(r))return null;for(let r of n)if(!_n(r))return null;let i={locale:t.locale,questions:t.questions,consents:n};return typeof t.title=="string"&&t.title.trim()!==""&&(i.title=t.title),typeof t.intro=="string"&&t.intro.trim()!==""&&(i.intro=t.intro),typeof t.prefill=="object"&&t.prefill!==null&&!Array.isArray(t.prefill)&&(i.prefill=t.prefill),i}function Sn(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id!="string"||typeof t.required!="boolean"?!1:t.kind==="field"?typeof t.field=="string"&&hn.has(t.field):t.kind!=="custom"||typeof t.type!="string"||!yn.has(t.type)||typeof t.label!="string"?!1:t.type==="single_choice"||t.type==="multiple_choice"?Array.isArray(t.choices)&&t.choices.length>=2&&t.choices.every(n=>typeof n=="object"&&n!==null&&typeof n.value=="string"&&typeof n.label=="string"):!0}function _n(e){if(typeof e!="object"||e===null)return!1;let t=e;if(typeof t.id!="string"||typeof t.required!="boolean"||typeof t.text!="string")return!1;if(t.link===void 0)return!0;let n=t.link;return typeof n=="object"&&n!==null&&typeof n.url=="string"&&/^https:\/\//.test(n.url)&&typeof n.label=="string"}var kn=/^(\d{4})-(\d{2})-(\d{2})$/;function Cn(e){if(typeof e!="string")return!1;let t=kn.exec(e);return t===null?!1:new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]))).toISOString().slice(0,10)===e&&e>=w.dateMin&&e<=w.dateMax}function bn(e){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<w.number&&Math.round(e*100)/100===e}function Rt(e){for(let t of e.matchAll(/\d[\d -]{11,}\d/g)){let n=t[0].replace(/[ -]/g,"");if(n.length>=13&&n.length<=19&&wn(n))return!0}return!1}function wn(e){let t=0;for(let n=0;n<e.length;n++){let i=Number(e[e.length-1-n]);n%2===1&&(i*=2,i>9&&(i-=9)),t+=i}return t%10===0}var An=/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/,Rn=/^\+[1-9]\d{6,14}$/,xt=/^[A-Z]{2}$/,xn=e=>e===void 0||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0;function Pn(e=Date.now()){return new Date(e).toISOString().slice(0,10)}function Vo(e,t,n=Pn()){let i=[];for(let r of e.questions){let u=t.answers[r.id];if(xn(u)){r.required&&i.push({id:r.id,code:"required"});continue}let s=r.kind==="field"?Mn(r.field,u,n):En(r,u,n);s!==null&&i.push({id:r.id,...s})}for(let r of e.consents)r.required&&t.consents[r.id]!==!0&&i.push({id:r.id,code:"consent_required"});return i}function ce(e,t,n=1){if(typeof e!="string")return{code:"required"};let i=e.trim();return[...i].length>t?{code:"too_long",params:{max:t}}:[...i].length<n?{code:"too_short",params:{min:n}}:Rt(i)?{code:"card_number"}:null}function Pt(e,t,n={}){return Cn(e)?n.period==="past"&&e>=t?{code:"date_not_past"}:n.period==="future"&&e<=t?{code:"date_not_future"}:n.min!==void 0&&e<n.min?{code:"date_too_early",params:{date:n.min}}:n.max!==void 0&&e>n.max?{code:"date_too_late",params:{date:n.max}}:null:{code:"date_invalid"}}function Mn(e,t,n){switch(e){case"full_name":return ce(t,w.fullName,w.fullNameMin);case"occupation":return ce(t,w.occupation);case"birth_date":return Pt(t,n,{period:"past"});case"email":return typeof t=="string"&&t.trim().length<=w.email&&An.test(t.trim())?null:{code:"email_invalid"};case"phone":return typeof t=="string"&&Rn.test(t)?null:{code:"phone_invalid"};case"country":return typeof t=="string"&&xt.test(t)?null:{code:"choice_invalid"};case"address":return On(t)?null:{code:"address_invalid"};default:return null}}function On(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Array.isArray(t.lines)?t.lines.filter(i=>typeof i=="string"&&i.trim()!==""):[];return typeof t.country=="string"&&xt.test(t.country)&&typeof t.city=="string"&&t.city.trim()!==""&&t.city.trim().length<=w.city&&n.length>=1&&n.length<=w.addressLines&&n.every(i=>i.trim().length<=w.addressLine&&!Rt(i))&&(t.postcode===void 0||typeof t.postcode=="string"&&t.postcode.trim().length<=w.postcode)}function En(e,t,n){let i=new Set((e.choices??[]).map(r=>r.value));switch(e.type){case"short_text":return ce(t,w.shortText);case"long_text":return ce(t,w.longText);case"single_choice":return typeof t=="string"&&i.has(t)?null:{code:"choice_invalid"};case"multiple_choice":return Array.isArray(t)&&t.length>0&&new Set(t).size===t.length&&t.every(r=>i.has(r))?null:{code:"choice_invalid"};case"yes_no":return typeof t=="boolean"?null:{code:"choice_invalid"};case"date":{let r=e.options??{};return Pt(t,n,{...typeof r.min=="string"?{min:r.min}:{},...typeof r.max=="string"?{max:r.max}:{},...r.period==="past"||r.period==="future"?{period:r.period}:{}})}case"number":{if(typeof t!="number"||!Number.isFinite(t)||Math.abs(t)>=w.number)return{code:"number_invalid"};let r=e.options??{};return r.integer===!0&&!Number.isInteger(t)?{code:"number_not_integer"}:bn(t)?typeof r.min=="number"&&t<r.min?{code:"number_too_small",params:{min:r.min}}:typeof r.max=="number"&&t>r.max?{code:"number_too_large",params:{max:r.max}}:null:{code:"number_decimals"}}default:return null}}var Fo={full_name:w.fullName,occupation:w.occupation,email:w.email,short_text:w.shortText,long_text:w.longText};var Mt=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),In=new Map(Object.entries(Mt)),Ho=new Map(Object.entries(Mt).map(([e,t])=>[t,e]));function Ot(e){return In.get(e)??e}var Yo=["national_number","document_photo","national_eid"],vn=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","portrait","face_match","aml_screening","face_dedup","age_estimation","proof_of_address","form"]),Tn=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),be=["document","population_registry","national_eid"],we=["phone_otp","email_otp"],vt={identity_method:be,contact:we},Vn=["population_registry","document"],Ae="platform_unsupported",Fn=new Set(["prefilled","user_entered","prefilled_or_entered"]),Nn={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo",poa:"documents",form:"form"};function V(e){return e.section??Nn[e.checkType]??null}function Hn(e,t){let n=e.plan?.choice;if(n===void 0||n.locked)return;let i=n.options.find(r=>r.id!==n.selected&&r.available!==!1&&t.includes(r.service));return i===void 0?void 0:{nodeId:n.nodeId,option:i}}function Wo(e,t){let n=e.options.filter(s=>s.id!==e.current);if(t===void 0)return{switchTo:n,methods:[]};let i=s=>s.countries!==void 0&&s.countries.length>0;if(t===null)return{switchTo:n.filter(s=>!i(s)),methods:[]};let r=t.toUpperCase(),u=s=>!i(s)||s.countries.includes(r);return{switchTo:n.filter(u),methods:n.filter(s=>i(s)&&u(s))}}function $o(e,t,n){let i=e.names?.[t.toUpperCase()],r=i?.[n]??i?.en;if(r!==void 0&&r!=="")return r;let u=e.nationalEid?.providerName;return u!==void 0&&u!==""?u:void 0}function Qo(e){return e===void 0?[]:[...new Set(e.options.filter(t=>t.id!==e.current).flatMap(t=>t.countries??[]).map(t=>t.toUpperCase()))]}function Re(e){let t=e.plan,n=t?.choice;if(t===void 0||n===void 0||n.locked||t.current===null||t.current===n.nodeId||M(e))return null;let i=vt[n.kind]??[...be,...we],r=n.options.flatMap(c=>{if(c.available===!1||!i.includes(c.service))return[];let f=c.nationalEid!=null?{id:c.id,service:c.service,nationalEid:c.nationalEid}:{id:c.id,service:c.service},S=c.countries??(c.nationalEid!=null?[c.nationalEid.country]:void 0);return S!==void 0&&S.length>0&&(f.countries=S),c.names!=null&&Object.keys(c.names).length>0&&(f.names=c.names),[f]}),u=t.steps.find(c=>c.id===t.current)?.service,s=n.selected??r.find(c=>c.service===u)?.id??null;return r.some(c=>c.id!==s)?{nodeId:n.nodeId,kind:n.kind,current:s,options:r}:null}function Tt(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function Ln(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:n,skipCapture:i}=t;if(typeof n!="string"||n===""||typeof i!="boolean")return;let r=ut(e);return r!==void 0?{otpCode:n,skipCapture:i,reason:r}:{otpCode:n,skipCapture:i}}function Dn(e){let t=e.levelTarget?.max;return typeof t=="number"&&t<=1?"contact":e.purpose??"identity"}function Un(e){let t=(e.plan?.sections??[]).map(s=>({id:s.id,state:s.state})),n={sessionId:D(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(s=>s.id),progress:t,purpose:e.purpose??"identity",levelName:Dn(e)};e.branding!==void 0&&(n.branding=e.branding),e.cameraUnavailableHandled===!0&&(n.cameraUnavailableHandled=!0);let i=Ln(e);i!==void 0&&(n.simulation=i);let r=e.testerGate;r?.offered===!0&&typeof r.attemptsLeft=="number"&&r.attemptsLeft>0&&(n.testerGate={attemptsLeft:r.attemptsLeft});let u=Re(e);return u!==null&&(n.switchable=u),n}function Bn(e){let t={attemptsRemaining:ie(e),attemptsExhausted:e.attempts.used>=e.attempts.max};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}var Vt={phone_otp:"phone",email_otp:"email"};function qn(e,t){let n=Hn(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return n===void 0?void 0:Vt[n.option.service]}function Gn(e,t,n,i){let r=t.checkType==="email_otp",u=(r?t.emailOtp:t.otp)??{},s=r?t.emailOtp?.emailSource:t.otp?.numberSource,c=s!==void 0&&Fn.has(s)?s:r?"prefilled_or_entered":"user_entered",f=typeof u.sentToMasked=="string"&&u.sentToMasked.length>0,S=u.prefilled===!0,_=qn(e,r?"email_otp":"phone_otp"),A={key:t.checkType,context:n,section:V(t),phase:f?"verify":"send",canSwitch:_!==void 0,...i},h=r?{kind:"email_otp",...A,emailSource:c,needsEmail:c!=="prefilled"&&!S}:{kind:"phone_otp",...A,numberSource:c,needsPhone:c!=="prefilled"&&!S,channels:(t.otp?.channels??[]).filter(p=>p==="whatsapp"||p==="sms")};if(_!==void 0&&(h.switchChannel=_),S&&(h.prefilled=!0),f&&(h.sentToMasked=u.sentToMasked),!r&&t.otp?.channel!==void 0&&(h.channel=t.otp.channel),!r&&Array.isArray(t.phoneCountries)&&(h.phoneCountries=t.phoneCountries.filter(p=>typeof p=="string"&&/^[A-Z]{2}$/.test(p))),!r&&Array.isArray(t.phoneRules)){let p=h.phoneCountries??[];h.phoneRules=t.phoneRules.flatMap(O=>{let k=Yn(O);return k!==void 0&&p.includes(k.code)?[k]:[]})}return!r&&t.phoneInternational===!0&&(h.phoneInternational=!0),u.expiresAt!==void 0&&(h.codeExpiresAt=u.expiresAt),u.resendAvailableAt!==void 0&&(h.resendAvailableAt=u.resendAvailableAt),h}var Kn=/^[\d[\]\-|()?:^]{1,64}$/;function jn(e){try{return typeof e=="string"&&Kn.test(e)&&new RegExp(e)!==null}catch{return!1}}var Et=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function Yn(e){let{code:t,dial:n,trunk:i,lengths:r,formats:u}=e??{};if(typeof t!="string"||typeof n!="string"||!/^\d{1,3}$/.test(n)||i!==void 0&&(typeof i!="string"||!/^\d{1,3}$/.test(i))||!Array.isArray(r)||r.length===0||!r.every(Et))return;let s={code:t,dial:n,lengths:[...r].sort((c,f)=>c-f)};if(i!==void 0&&(s.trunk=i),u!==void 0){if(!(Array.isArray(u)&&u.length<=8&&u.every(f=>jn(f?.leading)&&Array.isArray(f.groups)&&f.groups.every(Et)&&r.includes(f.groups.reduce((S,_)=>S+_,0)))))return;s.formats=u.map(f=>({leading:f.leading,groups:[...f.groups]}))}return s}function Wn(e,t,n,i){let r=ue(e)===!0?"bound":ee(t)===!0?"document":"typed",u=r==="typed"&&t.state==="input_required"&&t.reason!==void 0&&Ot(t.reason)==="id_number_recheck",s=Tt(Re(e)),c=!i.attemptsExhausted&&s.length===1&&s[0]?.service==="document";return{kind:"registry",key:"registry",context:n,section:V(t),state:t.state==="input_required"?"input_required":"pending",source:r,recheck:u,canUseDocument:c,...i}}function $n(e,t,n,i,r){let u=[...t.acceptedSides??[]],s={kind:"document",key:"document",context:n,section:V(t),side:u.includes("recto")?"verso":"recto",acceptedSides:u,documents:bt(e),photo:Pe(xe(e.documents),r),...i};return e.detectedCountry!==void 0&&(s.detectedCountry=e.detectedCountry),Jn(e)&&(s.ageStepUp=!0),s}function xe(e,t=!0){let n=e?.source==="upload"||e?.source==="choice"?e.source:"camera",i=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:n,pick:i,uploadOffered:t&&e?.uploadOffered===!0}}function Pe(e,t){return t?{...e,cameraOnPhone:!0}:e}var Qn=10*1024*1024;function Zn(e,t,n,i,r){let u=e.proofOfAddress,s=u?.pdf?.maxBytes,c=u?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:n,section:V(t),phase:c,rule:u?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:u?.nameMatch??"exact_person",photo:Pe(xe(u),r),maxPages:3,pdf:{maxBytes:typeof s=="number"&&s>0?s:Qn,maxPages:3},licenceAddressAccepted:c==="document"&&u?.licenceAddressAccepted===!0,...i}}function Jn(e){let t=J(e).find(i=>i.checkType==="age_estimation"),n=t?.reason;return t?.state==="failed"&&(n==="age_uncertain"||n==="age_unavailable")}function Xn(e){let t=T(e,"liveness");return t?.state==="passed"||t?.state==="review"}function It(e,t,n,i,r,u=!1){let s=t.icao?.report,c=e.portrait,f=r==="capture"?c?.pendingFix??null:null;f!==null&&(r="review");let S=Ft(e);return{kind:"portrait",key:`portrait:${r}`,context:n,section:V(t),phase:r,report:Array.isArray(s)?s:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:ae(e),retakeOnly:r==="capture"&&t.state==="input_required"&&S===void 0&&e.capture?.livePhoto?.oneCapture===!0&&Xn(e),photo:Pe(xe(c,r==="capture"),u&&r==="capture"),pendingFix:f,...S!==void 0?{captureMode:S}:{},...c?.reuse?.pending===!0?{reuse:!0}:{},...i}}function Ft(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}var Ce={minLongSidePx:1280,jpegQuality:.95};function zn(e,t){let n=e.capture?.livePhoto;if(n?.oneCapture!==!0)return null;let i=T(e,"portrait_icao"),r=n.still??Ce;return{icao:t==="liveness"&&ae(e)!==null&&Ft(e)===void 0&&i!==void 0&&i.state==="pending"&&i.reason===void 0,still:{minLongSidePx:r.minLongSidePx??Ce.minLongSidePx,jpegQuality:r.jpegQuality??Ce.jpegQuality}}}function eo(e,t,n,i){let r=t.eid,u=V(t);if(r===void 0||r.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:n,section:u,checkType:"eid_auth",reason:"update_required"};let s=Tt(Re(e)),c=s.length===1&&Vn.includes(s[0]?.service??"")?s[0]:void 0,f=c===void 0?void 0:Z[c.service],S=f!==void 0,_={kind:"eid",key:"eid",context:n,section:u,provider:r.provider,providerName:r.providerName,country:r.country,challenge:"app_code",phase:r.awaiting==="code"?"code":"identifier",identifierBound:r.identifierBound===!0,canUseCamera:S,afterPass:r.afterPass==="continue"?"continue":"end",...i};return S&&(_.cameraMethod=f),r.expiresAt!==void 0&&(_.codeExpiresAt=r.expiresAt),r.resendAvailableAt!==void 0&&(_.resendAvailableAt=r.resendAvailableAt),r.resendsRemaining!==void 0&&(_.resendsRemaining=r.resendsRemaining),r.codeAttemptsRemaining!==void 0&&(_.codeAttemptsRemaining=r.codeAttemptsRemaining),_}function to(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let n=T(e,"portrait_icao");return n!==void 0&&(n.state==="passed"||n.state==="review")?n:null}var no={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function oo(e){return e.reasonCode===Ae?"platform_unsupported":e.status==="review_pending"?"review":e.status==="verified"?"verified":e.reasonCode==="device_cooldown"?"cooldown":e.reasonCode==="starter_credit_claimed"?"policy":(e.status==="not_verified"&&e.reason!==void 0?no[e.reason]:void 0)??"rejected"}function ro(e,t){let n=oo(e),i=n==="platform_unsupported"?{sessionId:D(e.sessionId),status:"unavailable",reasonCode:Ae}:X(e,{autoRetry:!1}),r={kind:"result",key:"result",context:t,section:null,display:n,result:i};return e.status==="not_verified"&&e.reason!==void 0&&(r.reason=e.reason),e.reasonCode!==void 0&&(r.reasonCode=e.reasonCode),e.status==="not_verified"&&e.step!==void 0&&(r.step=e.step),e.retryAfter!==void 0&&(r.retryAfter=e.retryAfter),r}function io(e,t,n){let i=e.identitySummary;if(i==null)return null;let r={kind:"identity_summary",key:"identity_summary",context:t,section:n??"identity",summaryKind:i.kind==="partial"?"partial":i.kind??"full",source:i.source,portraitAvailable:i.portrait?.available===!0,retakeAvailable:i.retakeAvailable===!0};for(let s of so){let c=i[s];typeof c=="string"&&c!==""&&(r[s]=c)}let u=St(i);return u!==void 0&&(r.idNumberMasked=u,r.nniMasked=u),r}var so=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function B(e,t,n,i){return{kind:"unsupported",key:`unsupported:${n}`,context:e,section:t,checkType:n,reason:i}}function ao(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function uo(e,t){let n=vt[e.kind]??[...be,...we],i=ao(e),r=e.options.flatMap(s=>{if(s.available===!1||!n.includes(s.service))return[];let c={id:s.id,service:s.service};s.nationalEid!=null&&(c.nationalEid=s.nationalEid);let f=(s.channels??[]).filter(S=>S==="whatsapp"||S==="sms");return s.service==="phone_otp"&&f.length>0&&(c.channels=f),[c]});if(r.length===0){let s=e.options.length>0&&e.options.every(c=>c.service==="nfc");return B(t,i,"choice",s?"platform_unsupported":"update_required")}let u={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:r};if(e.kind==="identity_method"){let s={kind:"method",key:"method",context:t,section:i,options:r.map(f=>Z[f.service]),choice:u},c=r.find(f=>f.nationalEid!==void 0)?.nationalEid;return c!==void 0&&(s.nationalEid=c),s}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:i,options:r.map(s=>Vt[s.service]),selected:null,locked:!1,choice:u}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:i,choice:u}}function co(e,t,n,i){let r=e.nativeApp,u=typeof r=="object"&&r!==null?r:{},s={sekyroApp:u.sekyroApp===!0};return typeof u.link=="string"&&u.link!==""&&(s.link=u.link),s.sekyroApp&&typeof u.sekyroAppLink=="string"&&u.sekyroAppLink.startsWith("sekyro://")&&(s.sekyroAppLink=u.sekyroAppLink),{kind:"native_app_required",key:`native_app_required:${i}`,context:t,section:n,checkType:i,nativeApp:s}}function Zo(e,t={}){let n=Un(e);if(M(e)||e.reasonCode===Ae)return ro(e,n);let i=e.plan;if(i===void 0||!Array.isArray(i.sections))return B(n,null,"plan","update_required");let r=st(e);if(r!==null)return uo(r,n);let u=i.current===null?void 0:i.steps.find(h=>h.id===i.current),s=h=>{let p={kind:"processing",key:"processing",context:n,section:h!==void 0?V(h):i.sections.find(O=>O.state==="current")?.id??null,stalled:!1};return typeof h?.service=="string"&&h.service!==""&&(p.service=h.service),p};if(i.current===null)return s(i.steps.find(h=>h.state==="processing"));if(u===void 0)return B(n,null,"step","update_required");if(!vn.has(u.service))return u.interaction==="server"?s(u):B(n,V(u),u.service,"update_required");if(Tn.has(u.service)||!at(u))return s(u);let c=u,f=Bn(c),S=c.checkType,_=V(c);if(c.requiresNativeApp===!0)return co(e,n,_,S);let A=t.isMobile===!1?z(e,c):null;if(A==="phone")return{kind:"mobile_required",key:"mobile_required",context:n,section:_,checkType:S};switch(S){case"phone_otp":case"email_otp":return Gn(e,c,n,f);case"population_registry":return Wn(e,c,n,f);case"eid_auth":return eo(e,c,n,f);case"doc_ocr":return $n(e,c,n,f,A==="upload_or_phone");case"identity_confirm":return io(e,n,_)??s(c);case"portrait_icao":return It(e,c,n,f,"capture",A==="upload_or_phone");case"liveness":case"face_match":{let h=to(e,c);if(h!==null)return It(e,h,n,f,"match");let p=c.requiresMobile===!0,O=ae(e);return{kind:"liveness",key:"biometric",context:n,section:_,mode:S==="face_match"?"selfie":"liveness",requiresMobile:p,instructions:O===null?"standard":"icao",icao:O,livePhoto:zn(e,S),...f}}case"poa":return Zn(e,c,n,f,A==="upload_or_phone");case"form":{let h=At(c.form);return h===null?B(n,_,S,"update_required"):{kind:"form",key:"form",context:n,section:_,form:h,dir:wt(h.locale),...f}}case"nfc_chip":return B(n,_,S,"platform_unsupported");default:return B(n,_,S,"update_required")}}export{Xt as a,zt as b,an as c,un as d,dn as e,Po as f,ln as g,Ct as h,pn as i,mn as j,Io as k,bt as l,vo as m,w as n,wt as o,Cn as p,bn as q,Rt as r,Pn as s,Vo as t,Yo as u,Ae as v,V as w,Wo as x,$o as y,Qo as z,Re as A,Tt as B,to as C,Zo as D};
|