@sekyro/web 0.1.0-rc.12 → 0.1.0-rc.13

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{capture-session-doc-KW5VR4IR.js → capture-session-doc-7LQAOCHJ.js} +1 -1
  3. package/dist/{capture-session-v3-DqUUcIU-.d.ts → capture-session-v3-C5DRPBhM.d.ts} +1 -1
  4. package/dist/{capture-session-v3-xNtY5m-7.d.cts → capture-session-v3-Db4n6d-k.d.cts} +1 -1
  5. package/dist/chunk-57VOMVKM.js +1 -0
  6. package/dist/{chunk-4IVRXJR2.js → chunk-5OIC5TZS.js} +1 -1
  7. package/dist/{chunk-U6YQAQBD.js → chunk-H6H2RT6M.js} +1 -1
  8. package/dist/{chunk-YZH5PR5R.js → chunk-IBA5CPDV.js} +1 -1
  9. package/dist/{chunk-EF52BRBD.js → chunk-JRSIMNB5.js} +1 -1
  10. package/dist/chunk-UBDG5IAP.js +1 -0
  11. package/dist/{chunk-OBLQOE66.js → chunk-VJM76LUI.js} +1 -1
  12. package/dist/chunk-WTQE6IGL.js +1 -0
  13. package/dist/chunk-XBVSYVKA.js +1 -0
  14. package/dist/client/index.cjs +1 -1
  15. package/dist/client/index.d.cts +5 -5
  16. package/dist/client/index.d.ts +5 -5
  17. package/dist/client/index.js +1 -1
  18. package/dist/core/index.cjs +1 -1
  19. package/dist/core/index.d.cts +3 -3
  20. package/dist/core/index.d.ts +3 -3
  21. package/dist/core/index.js +1 -1
  22. package/dist/{create-document-capture-PXOJHLWV.js → create-document-capture-RTFDQSBC.js} +1 -1
  23. package/dist/{create-verification-D4749F6L.d.cts → create-verification-BV_T0-CR.d.cts} +33 -12
  24. package/dist/{create-verification-CDOTGHQj.d.ts → create-verification-P6i3tyce.d.ts} +33 -12
  25. package/dist/{icao-gate-BRuIgOE2.d.cts → icao-gate-B0GDH_JS.d.cts} +8 -3
  26. package/dist/{icao-gate-CphntEQ2.d.ts → icao-gate-BP11XO-h.d.ts} +8 -3
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.cts +36 -10
  29. package/dist/index.d.ts +36 -10
  30. package/dist/index.js +1 -1
  31. package/dist/internal/index.cjs +1 -1
  32. package/dist/internal/index.d.cts +7 -6
  33. package/dist/internal/index.d.ts +7 -6
  34. package/dist/internal/index.js +1 -1
  35. package/dist/plan-runner-RVVF5DJV.js +1 -0
  36. package/dist/{types-4rgeNIlz.d.cts → types-DPWT_KMn.d.cts} +38 -11
  37. package/dist/{types-4rgeNIlz.d.ts → types-DPWT_KMn.d.ts} +38 -11
  38. package/package.json +1 -1
  39. package/sbom.cdx.json +7 -7
  40. package/dist/chunk-6DPFJNGL.js +0 -1
  41. package/dist/chunk-IF6YOFFO.js +0 -1
  42. package/dist/chunk-MUVEJRGK.js +0 -1
  43. package/dist/chunk-Y7S7LYCL.js +0 -1
  44. package/dist/plan-runner-2FJLUALJ.js +0 -1
@@ -1,11 +1,11 @@
1
- import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-D4749F6L.cjs';
2
- export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_CADENCE_HZ, bm as DOC_CAMERA_TUNING_DEFAULTS, bn as DOC_CATALOG, bo as DOC_DETECT_WIDTH, bp as DOC_FEEDBACK_STATES, bq as DOC_GATE_V1_DEFAULTS, br as DOC_SHUTTER_DEFAULTS, bs as DeviceReadHint, bt as DocArtifacts, bu as DocAssist, bv as DocAssistEngine, bw as DocAssistTick, bx as DocCameraTuning, by as DocCaptureReport, bz as DocCaptureVia, bA as DocChecksPayload, bB as DocEngineLike, bC as DocFeedbackAggregator, bD as DocFeedbackKey, bE as DocFeedbackState, bF as DocFormat, bG as DocFrameAnalysis, bH as DocFrameMeasures, bI as DocGateQuality, bJ as DocGateThresholds, bK as DocGateTick, bL as DocGateTickInput, bM as DocGateV1, bN as DocQuad, bO as DocQuadPoint, bP as DocShutterReason, bQ as DocShutterTuning, bR as DocSide, bS as DocumentCaptureController, bT as DocumentCaptureInternals, bU as EMPTY_GUIDE_METRICS, bV as EncodedDocument, bW as FLIP_FILL_MIN, bX as FLIP_GAP_MS, bY as FLIP_TIMEOUT_MS, bZ as FocusCaps, b_ as FramingStatus, b$ as GUIDE_LOCK_DEFAULTS, c0 as GlareStatus, c1 as GrabbedFrame, c2 as GuideBlocker, c3 as GuideLock, c4 as GuideLockTick, c5 as GuideLockTuning, c6 as GuideMetrics, c7 as GuideRect, c8 as INFERENCE_RETRY_ATTEMPTS, c9 as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, ca as LANDMARKER_MODEL, cb as LENS_STORAGE_KEY, cc as LENS_TRY_MAX, cd as LIVE_MRZ_DEFAULTS, ce as LIVE_PHOTO_IDLE_MS, cf as LIVE_PHOTO_MAX_HZ, cg as LandmarkedFace, ch as LandmarkerLike, ci as LensKind, cj as LensSource, ck as LightingStatus, cl as LiveMrzCapture, cm as LiveMrzState, cn as LivePhotoGate, co as LivePhotoKit, cp as LivePhotoKitInternals, cq as LivePhotoKitOptions, cr as LivePhotoStill, cs as LivenessCaptureInternalHandle, ct as LivenessCaptureInternals, cu as LivenessFlowDeps, cv as LivenessFlowOutcome, cw as MANUAL_SHUTTER_MS, cx as MR_DOC_CATALOG, cy as NO_REPORT_MS, cz as OpenDocCameraDeps, cA as PORTRAIT_JPEG_QUALITY, cB as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cC as PRELOAD_BUDGET_MS, cD as PROCESSING_POLL_DELAY_MS, cE as PROCESSING_POLL_MAX, cF as PortraitCaptureController, cG as PortraitCaptureInternals, cH as REGISTRY_RETRY_DELAY_MS, cI as ReticleType, cJ as SAME_FACE_MAX_DROPS, cK as ScanEvent, cL as ScanLayout, cM as ScanNotice, cN as ScanPhase, cO as ScanReport, cP as ScanSide, cQ as ScanState, cR as SubmitExecutor, cS as TEXT_LOCK_DEFAULTS, cT as TRANSPORT_REPLAY_ATTEMPTS, cU as TRANSPORT_REPLAY_DELAY_MS, cV as VerificationInternals, cW as analyzeDocFrame, cX as analyzeGuide, cY as aspectBand, cZ as aspectFits, c_ as buildDeviceReadHint, c$ as coverPointToVideo, d0 as createDocumentCaptureInternal, d1 as createFaceLandmarker, d2 as createLivePhotoKit, d3 as createLivenessCaptureInternal, d4 as createPortraitCaptureInternal, d5 as createVerificationInternal, d6 as docZoomFor, d7 as encodeDocumentImage, d8 as facesOf, d9 as feedbackVoteOf, da as focusOk, db as guideQuad, dc as guideRegionInFrame, dd as initialScanState, de as lensKindOf, df as mapEngineState, dg as mapErrorKind, dh as mapGuidanceHint, di as nextScanState, dj as observePortraitFrame, dk as openDocCamera, dl as passportBandOf, dm as portraitMatchStep, dn as preloadedDetectorFactory, dp as quadAreaFrac, dq as quadBounds, dr as quadIou, ds as quadTiltRatio, dt as randomUuid, du as rankBackCameras, dv as readStoredLens, dw as resetLivenessAssetsForTests, dx as resolveDocCameraTuning, dy as resolveDocShutterTuning, dz as resolveGuideLockTuning, dA as runLivenessFlow, dB as runSubmission, dC as scannerFormatFor, dD as setPreloadLoaderForTests, dE as settledHint, dF as singleShotFocusAt, dG as specularFraction, dH as supportsFocusMode, dI as warmDocDetector, dJ as writeStoredLens } from '../create-verification-D4749F6L.cjs';
1
+ import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-BV_T0-CR.cjs';
2
+ export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_CADENCE_HZ, bm as DOC_CAMERA_TUNING_DEFAULTS, bn as DOC_CATALOG, bo as DOC_DETECT_WIDTH, bp as DOC_FEEDBACK_STATES, bq as DOC_GATE_V1_DEFAULTS, br as DOC_SHUTTER_DEFAULTS, bs as DeviceReadHint, bt as DocArtifacts, bu as DocAssist, bv as DocAssistEngine, bw as DocAssistTick, bx as DocCameraTuning, by as DocCaptureReport, bz as DocCaptureVia, bA as DocChecksPayload, bB as DocEngineLike, bC as DocFeedbackAggregator, bD as DocFeedbackKey, bE as DocFeedbackState, bF as DocFormat, bG as DocFrameAnalysis, bH as DocFrameMeasures, bI as DocGateQuality, bJ as DocGateThresholds, bK as DocGateTick, bL as DocGateTickInput, bM as DocGateV1, bN as DocQuad, bO as DocQuadPoint, bP as DocShutterReason, bQ as DocShutterTuning, bR as DocSide, bS as DocumentCaptureController, bT as DocumentCaptureInternals, bU as EMPTY_GUIDE_METRICS, bV as EncodedDocument, bW as FLIP_FILL_MIN, bX as FLIP_GAP_MS, bY as FLIP_TIMEOUT_MS, bZ as FocusCaps, b_ as FramingStatus, b$ as GUIDE_LOCK_DEFAULTS, c0 as GlareStatus, c1 as GrabbedFrame, c2 as GuideBlocker, c3 as GuideLock, c4 as GuideLockTick, c5 as GuideLockTuning, c6 as GuideMetrics, c7 as GuideRect, c8 as INFERENCE_RETRY_ATTEMPTS, c9 as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, ca as LANDMARKER_MODEL, cb as LENS_STORAGE_KEY, cc as LENS_TRY_MAX, cd as LIVE_MRZ_DEFAULTS, ce as LIVE_PHOTO_IDLE_MS, cf as LIVE_PHOTO_MAX_HZ, cg as LandmarkedFace, ch as LandmarkerLike, ci as LensKind, cj as LensSource, ck as LightingStatus, cl as LiveMrzCapture, cm as LiveMrzState, cn as LivePhotoGate, co as LivePhotoKit, cp as LivePhotoKitInternals, cq as LivePhotoKitOptions, cr as LivePhotoStill, cs as LivenessCaptureInternalHandle, ct as LivenessCaptureInternals, cu as LivenessFlowDeps, cv as LivenessFlowOutcome, cw as MANUAL_SHUTTER_MS, cx as MR_DOC_CATALOG, cy as NO_REPORT_MS, cz as OpenDocCameraDeps, cA as PORTRAIT_JPEG_QUALITY, cB as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cC as PRELOAD_BUDGET_MS, cD as PROCESSING_POLL_DELAY_MS, cE as PROCESSING_POLL_MAX, cF as PortraitCaptureController, cG as PortraitCaptureInternals, cH as REGISTRY_RETRY_DELAY_MS, cI as ReticleType, cJ as SAME_FACE_MAX_DROPS, cK as ScanEvent, cL as ScanLayout, cM as ScanNotice, cN as ScanPhase, cO as ScanReport, cP as ScanSide, cQ as ScanState, cR as SubmitExecutor, cS as TEXT_LOCK_DEFAULTS, cT as TRANSPORT_REPLAY_ATTEMPTS, cU as TRANSPORT_REPLAY_DELAY_MS, cV as VerificationInternals, cW as analyzeDocFrame, cX as analyzeGuide, cY as aspectBand, cZ as aspectFits, c_ as buildDeviceReadHint, c$ as coverPointToVideo, d0 as createDocumentCaptureInternal, d1 as createFaceLandmarker, d2 as createLivePhotoKit, d3 as createLivenessCaptureInternal, d4 as createPortraitCaptureInternal, d5 as createVerificationInternal, d6 as docZoomFor, d7 as encodeDocumentImage, d8 as facesOf, d9 as feedbackVoteOf, da as focusOk, db as guideQuad, dc as guideRegionInFrame, dd as initialScanState, de as lensKindOf, df as mapEngineState, dg as mapErrorKind, dh as mapGuidanceHint, di as nextScanState, dj as observePortraitFrame, dk as openDocCamera, dl as passportBandOf, dm as portraitMatchStep, dn as preloadedDetectorFactory, dp as quadAreaFrac, dq as quadBounds, dr as quadIou, ds as quadTiltRatio, dt as randomUuid, du as rankBackCameras, dv as readStoredLens, dw as resetLivenessAssetsForTests, dx as resolveDocCameraTuning, dy as resolveDocShutterTuning, dz as resolveGuideLockTuning, dA as runLivenessFlow, dB as runSubmission, dC as scannerFormatFor, dD as setPreloadLoaderForTests, dE as settledHint, dF as singleShotFocusAt, dG as specularFraction, dH as supportsFocusMode, dI as warmDocDetector, dJ as writeStoredLens } from '../create-verification-BV_T0-CR.cjs';
3
3
  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-B5omafmk.cjs';
4
- import { H as HostedSessionView, e as CheckType, k as CheckReason, ae as PlanStepView } from '../types-4rgeNIlz.cjs';
5
- export { at as ICAO_FALLBACK, Y as IcaoCaptureTuning, au as IcaoProfile, R as ResolvedIcaoTuning, av as resolveIcaoTuning } from '../types-4rgeNIlz.cjs';
6
- export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-BRuIgOE2.cjs';
4
+ import { H as HostedSessionView, e as CheckType, k as CheckReason, ae as PlanStepView } from '../types-DPWT_KMn.cjs';
5
+ export { at as ICAO_FALLBACK, Y as IcaoCaptureTuning, au as IcaoProfile, R as ResolvedIcaoTuning, av as resolveIcaoTuning } from '../types-DPWT_KMn.cjs';
6
+ export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-B0GDH_JS.cjs';
7
7
  import '../detect-worker-DclNxkZT.cjs';
8
- import '../capture-session-v3-xNtY5m-7.cjs';
8
+ import '../capture-session-v3-Db4n6d-k.cjs';
9
9
 
10
10
  type DocumentTypeId = DocCatalogEntry["docType"];
11
11
  /** Same shape as the hosted view's `acceptedDocuments`. */
@@ -315,6 +315,7 @@ declare function createStepRunner(deps: RunnerDeps): StepRunner;
315
315
  * Reasons the backend parks at `input_required` while attempts remain
316
316
  * (identity-backend/src/checks/check-reasons.ts isRetryable tables — the single
317
317
  * source of truth; identity-hosted/lib/reason-copy.ts mirrors the same rows).
318
+ * Each renamed reason is listed under both its names (person data spec Appendix A.2).
318
319
  */
319
320
  declare const RETRYABLE_REASONS: ReadonlySet<CheckReason>;
320
321
  /** A check the browser may still submit. */
@@ -1,11 +1,11 @@
1
- import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-CDOTGHQj.js';
2
- export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_CADENCE_HZ, bm as DOC_CAMERA_TUNING_DEFAULTS, bn as DOC_CATALOG, bo as DOC_DETECT_WIDTH, bp as DOC_FEEDBACK_STATES, bq as DOC_GATE_V1_DEFAULTS, br as DOC_SHUTTER_DEFAULTS, bs as DeviceReadHint, bt as DocArtifacts, bu as DocAssist, bv as DocAssistEngine, bw as DocAssistTick, bx as DocCameraTuning, by as DocCaptureReport, bz as DocCaptureVia, bA as DocChecksPayload, bB as DocEngineLike, bC as DocFeedbackAggregator, bD as DocFeedbackKey, bE as DocFeedbackState, bF as DocFormat, bG as DocFrameAnalysis, bH as DocFrameMeasures, bI as DocGateQuality, bJ as DocGateThresholds, bK as DocGateTick, bL as DocGateTickInput, bM as DocGateV1, bN as DocQuad, bO as DocQuadPoint, bP as DocShutterReason, bQ as DocShutterTuning, bR as DocSide, bS as DocumentCaptureController, bT as DocumentCaptureInternals, bU as EMPTY_GUIDE_METRICS, bV as EncodedDocument, bW as FLIP_FILL_MIN, bX as FLIP_GAP_MS, bY as FLIP_TIMEOUT_MS, bZ as FocusCaps, b_ as FramingStatus, b$ as GUIDE_LOCK_DEFAULTS, c0 as GlareStatus, c1 as GrabbedFrame, c2 as GuideBlocker, c3 as GuideLock, c4 as GuideLockTick, c5 as GuideLockTuning, c6 as GuideMetrics, c7 as GuideRect, c8 as INFERENCE_RETRY_ATTEMPTS, c9 as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, ca as LANDMARKER_MODEL, cb as LENS_STORAGE_KEY, cc as LENS_TRY_MAX, cd as LIVE_MRZ_DEFAULTS, ce as LIVE_PHOTO_IDLE_MS, cf as LIVE_PHOTO_MAX_HZ, cg as LandmarkedFace, ch as LandmarkerLike, ci as LensKind, cj as LensSource, ck as LightingStatus, cl as LiveMrzCapture, cm as LiveMrzState, cn as LivePhotoGate, co as LivePhotoKit, cp as LivePhotoKitInternals, cq as LivePhotoKitOptions, cr as LivePhotoStill, cs as LivenessCaptureInternalHandle, ct as LivenessCaptureInternals, cu as LivenessFlowDeps, cv as LivenessFlowOutcome, cw as MANUAL_SHUTTER_MS, cx as MR_DOC_CATALOG, cy as NO_REPORT_MS, cz as OpenDocCameraDeps, cA as PORTRAIT_JPEG_QUALITY, cB as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cC as PRELOAD_BUDGET_MS, cD as PROCESSING_POLL_DELAY_MS, cE as PROCESSING_POLL_MAX, cF as PortraitCaptureController, cG as PortraitCaptureInternals, cH as REGISTRY_RETRY_DELAY_MS, cI as ReticleType, cJ as SAME_FACE_MAX_DROPS, cK as ScanEvent, cL as ScanLayout, cM as ScanNotice, cN as ScanPhase, cO as ScanReport, cP as ScanSide, cQ as ScanState, cR as SubmitExecutor, cS as TEXT_LOCK_DEFAULTS, cT as TRANSPORT_REPLAY_ATTEMPTS, cU as TRANSPORT_REPLAY_DELAY_MS, cV as VerificationInternals, cW as analyzeDocFrame, cX as analyzeGuide, cY as aspectBand, cZ as aspectFits, c_ as buildDeviceReadHint, c$ as coverPointToVideo, d0 as createDocumentCaptureInternal, d1 as createFaceLandmarker, d2 as createLivePhotoKit, d3 as createLivenessCaptureInternal, d4 as createPortraitCaptureInternal, d5 as createVerificationInternal, d6 as docZoomFor, d7 as encodeDocumentImage, d8 as facesOf, d9 as feedbackVoteOf, da as focusOk, db as guideQuad, dc as guideRegionInFrame, dd as initialScanState, de as lensKindOf, df as mapEngineState, dg as mapErrorKind, dh as mapGuidanceHint, di as nextScanState, dj as observePortraitFrame, dk as openDocCamera, dl as passportBandOf, dm as portraitMatchStep, dn as preloadedDetectorFactory, dp as quadAreaFrac, dq as quadBounds, dr as quadIou, ds as quadTiltRatio, dt as randomUuid, du as rankBackCameras, dv as readStoredLens, dw as resetLivenessAssetsForTests, dx as resolveDocCameraTuning, dy as resolveDocShutterTuning, dz as resolveGuideLockTuning, dA as runLivenessFlow, dB as runSubmission, dC as scannerFormatFor, dD as setPreloadLoaderForTests, dE as settledHint, dF as singleShotFocusAt, dG as specularFraction, dH as supportsFocusMode, dI as warmDocDetector, dJ as writeStoredLens } from '../create-verification-CDOTGHQj.js';
1
+ import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-P6i3tyce.js';
2
+ export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_CADENCE_HZ, bm as DOC_CAMERA_TUNING_DEFAULTS, bn as DOC_CATALOG, bo as DOC_DETECT_WIDTH, bp as DOC_FEEDBACK_STATES, bq as DOC_GATE_V1_DEFAULTS, br as DOC_SHUTTER_DEFAULTS, bs as DeviceReadHint, bt as DocArtifacts, bu as DocAssist, bv as DocAssistEngine, bw as DocAssistTick, bx as DocCameraTuning, by as DocCaptureReport, bz as DocCaptureVia, bA as DocChecksPayload, bB as DocEngineLike, bC as DocFeedbackAggregator, bD as DocFeedbackKey, bE as DocFeedbackState, bF as DocFormat, bG as DocFrameAnalysis, bH as DocFrameMeasures, bI as DocGateQuality, bJ as DocGateThresholds, bK as DocGateTick, bL as DocGateTickInput, bM as DocGateV1, bN as DocQuad, bO as DocQuadPoint, bP as DocShutterReason, bQ as DocShutterTuning, bR as DocSide, bS as DocumentCaptureController, bT as DocumentCaptureInternals, bU as EMPTY_GUIDE_METRICS, bV as EncodedDocument, bW as FLIP_FILL_MIN, bX as FLIP_GAP_MS, bY as FLIP_TIMEOUT_MS, bZ as FocusCaps, b_ as FramingStatus, b$ as GUIDE_LOCK_DEFAULTS, c0 as GlareStatus, c1 as GrabbedFrame, c2 as GuideBlocker, c3 as GuideLock, c4 as GuideLockTick, c5 as GuideLockTuning, c6 as GuideMetrics, c7 as GuideRect, c8 as INFERENCE_RETRY_ATTEMPTS, c9 as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, ca as LANDMARKER_MODEL, cb as LENS_STORAGE_KEY, cc as LENS_TRY_MAX, cd as LIVE_MRZ_DEFAULTS, ce as LIVE_PHOTO_IDLE_MS, cf as LIVE_PHOTO_MAX_HZ, cg as LandmarkedFace, ch as LandmarkerLike, ci as LensKind, cj as LensSource, ck as LightingStatus, cl as LiveMrzCapture, cm as LiveMrzState, cn as LivePhotoGate, co as LivePhotoKit, cp as LivePhotoKitInternals, cq as LivePhotoKitOptions, cr as LivePhotoStill, cs as LivenessCaptureInternalHandle, ct as LivenessCaptureInternals, cu as LivenessFlowDeps, cv as LivenessFlowOutcome, cw as MANUAL_SHUTTER_MS, cx as MR_DOC_CATALOG, cy as NO_REPORT_MS, cz as OpenDocCameraDeps, cA as PORTRAIT_JPEG_QUALITY, cB as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cC as PRELOAD_BUDGET_MS, cD as PROCESSING_POLL_DELAY_MS, cE as PROCESSING_POLL_MAX, cF as PortraitCaptureController, cG as PortraitCaptureInternals, cH as REGISTRY_RETRY_DELAY_MS, cI as ReticleType, cJ as SAME_FACE_MAX_DROPS, cK as ScanEvent, cL as ScanLayout, cM as ScanNotice, cN as ScanPhase, cO as ScanReport, cP as ScanSide, cQ as ScanState, cR as SubmitExecutor, cS as TEXT_LOCK_DEFAULTS, cT as TRANSPORT_REPLAY_ATTEMPTS, cU as TRANSPORT_REPLAY_DELAY_MS, cV as VerificationInternals, cW as analyzeDocFrame, cX as analyzeGuide, cY as aspectBand, cZ as aspectFits, c_ as buildDeviceReadHint, c$ as coverPointToVideo, d0 as createDocumentCaptureInternal, d1 as createFaceLandmarker, d2 as createLivePhotoKit, d3 as createLivenessCaptureInternal, d4 as createPortraitCaptureInternal, d5 as createVerificationInternal, d6 as docZoomFor, d7 as encodeDocumentImage, d8 as facesOf, d9 as feedbackVoteOf, da as focusOk, db as guideQuad, dc as guideRegionInFrame, dd as initialScanState, de as lensKindOf, df as mapEngineState, dg as mapErrorKind, dh as mapGuidanceHint, di as nextScanState, dj as observePortraitFrame, dk as openDocCamera, dl as passportBandOf, dm as portraitMatchStep, dn as preloadedDetectorFactory, dp as quadAreaFrac, dq as quadBounds, dr as quadIou, ds as quadTiltRatio, dt as randomUuid, du as rankBackCameras, dv as readStoredLens, dw as resetLivenessAssetsForTests, dx as resolveDocCameraTuning, dy as resolveDocShutterTuning, dz as resolveGuideLockTuning, dA as runLivenessFlow, dB as runSubmission, dC as scannerFormatFor, dD as setPreloadLoaderForTests, dE as settledHint, dF as singleShotFocusAt, dG as specularFraction, dH as supportsFocusMode, dI as warmDocDetector, dJ as writeStoredLens } from '../create-verification-P6i3tyce.js';
3
3
  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-B5omafmk.js';
4
- import { H as HostedSessionView, e as CheckType, k as CheckReason, ae as PlanStepView } from '../types-4rgeNIlz.js';
5
- export { at as ICAO_FALLBACK, Y as IcaoCaptureTuning, au as IcaoProfile, R as ResolvedIcaoTuning, av as resolveIcaoTuning } from '../types-4rgeNIlz.js';
6
- export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-CphntEQ2.js';
4
+ import { H as HostedSessionView, e as CheckType, k as CheckReason, ae as PlanStepView } from '../types-DPWT_KMn.js';
5
+ export { at as ICAO_FALLBACK, Y as IcaoCaptureTuning, au as IcaoProfile, R as ResolvedIcaoTuning, av as resolveIcaoTuning } from '../types-DPWT_KMn.js';
6
+ export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-BP11XO-h.js';
7
7
  import '../detect-worker-DclNxkZT.js';
8
- import '../capture-session-v3-DqUUcIU-.js';
8
+ import '../capture-session-v3-C5DRPBhM.js';
9
9
 
10
10
  type DocumentTypeId = DocCatalogEntry["docType"];
11
11
  /** Same shape as the hosted view's `acceptedDocuments`. */
@@ -315,6 +315,7 @@ declare function createStepRunner(deps: RunnerDeps): StepRunner;
315
315
  * Reasons the backend parks at `input_required` while attempts remain
316
316
  * (identity-backend/src/checks/check-reasons.ts isRetryable tables — the single
317
317
  * source of truth; identity-hosted/lib/reason-copy.ts mirrors the same rows).
318
+ * Each renamed reason is listed under both its names (person data spec Appendix A.2).
318
319
  */
319
320
  declare const RETRYABLE_REASONS: ReadonlySet<CheckReason>;
320
321
  /** A check the browser may still submit. */
@@ -1 +1 @@
1
- import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-6DPFJNGL.js";import{a as Bt,b as wt,c as zt,d as Vt,e as Xt,f as Zt,g as Jt,h as Qt,i as jt,j as ae,l as se,n as Ee,o as me}from"../chunk-73M7LS4H.js";import{b as pe,c as ie,d as ne}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import{a as d,b as M,c as F,d as N,e as v}from"../chunk-O5WKNZ2C.js";import{A as yt,B as ft,C as ut,D as Ot,E as At,F as It,G as xt,H as Ct,I as Pt,J as Dt,a as We,b as ke,c as Ke,d as Je,e as Qe,f as je,g as qe,h as $e,i as et,j as tt,k as rt,l as ot,m as pt,n as it,o as nt,p as at,q as st,r as Et,s as mt,t as _t,u as Lt,v as Rt,w as St,x as Tt,y as ct,z as lt}from"../chunk-OBLQOE66.js";import{a as Ye,b as He}from"../chunk-SMKCBUJL.js";import{a as Be,b as we,c as ze,d as Ve,e as Xe,f as Ze}from"../chunk-MXWLCDFX.js";import{a as k,b as Fe,c as Ne,d as ve,e as ge,f as be,g as Ge,h as he,i as Ue,j as K,k as B,l as w,m as Z,n as J,o as Q,p as j,q,r as $,s as ee,t as te,u as re,x as oe}from"../chunk-U6YQAQBD.js";import{a as g,b,c as G,d as h,e as U,f as Y,g as H,h as W,i as z,j as V,l as X}from"../chunk-G6LKLN4U.js";import{a as xe,b as Ce,c as Pe,d as De,e as de,f as Me}from"../chunk-TDLIXFDT.js";import{a as dt,b as Mt,c as Ft,d as Nt,e as vt,f as gt,g as bt,h as Gt,i as ht,j as Ut,k as Yt,l as Ht,m as Wt}from"../chunk-7ZCZY3ZP.js";import{a as kt,b as Kt}from"../chunk-BPE5NSQ2.js";import"../chunk-GI3UFGRQ.js";import{b as ye,c as fe,d as ue,e as Oe,g as Ae,h as qt,i as $t,j as er,k as tr,l as rr,m as or,s as Ie}from"../chunk-Y7S7LYCL.js";import{b as S,h as T,i as c,j as l,k as y,m as f,o as u,p as O,q as A,r as I,s as x,t as C,u as P,v as D}from"../chunk-IF6YOFFO.js";import{a as i,b as n,c as a,d as s,i as E,j as m,k as _,l as L,m as R}from"../chunk-EF52BRBD.js";import"../chunk-GT2ZLGF7.js";import"../chunk-YZH5PR5R.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-FUHDOEBP.js";import"../chunk-POIQGEZM.js";import"../chunk-FHJ7HO3M.js";import"../chunk-FPXL63KZ.js";import"../chunk-MUVEJRGK.js";import"../chunk-4IVRXJR2.js";import"../chunk-OKWG3PVH.js";import{a as le}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ae as ANALYSIS_LONG_EDGE,xe as ASPECT_BANDS,C as AttestationError,Ge as BLUR_REFUSE_SHARPNESS_MAX,Dt as CAPTURE_CANDIDATE_SPACING_MS,Pt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,u as CLIP_MIME_ALLOWLIST,xt as CaptureSessionDoc,$t as DOCUMENT_TYPE_ORDER,Je as DOC_ANALYSIS_DEFAULTS,Ot as DOC_CADENCE_HZ,$e as DOC_CAMERA_TUNING_DEFAULTS,de as DOC_CATALOG,Be as DOC_DETECT_WIDTH,We as DOC_FEEDBACK_STATES,we as DOC_GATE_V1_DEFAULTS,At as DOC_SHUTTER_DEFAULTS,X as DocAssist,Ke as DocFeedbackAggregator,Ze as DocGateV1,Rt as EMPTY_GUIDE_METRICS,Ne as FLIP_FILL_MIN,Fe as FLIP_GAP_MS,ve as FLIP_TIMEOUT_MS,lt as GUIDE_LOCK_DEFAULTS,ft as GuideLock,Nt as ICAO_CANVAS,kt as ICAO_FALLBACK,Gt as ICAO_GATE_CRITERIA,wt as ICAO_SHARP_REF,I as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,qt as ISSUER_CODES,pe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,_t as LENS_TRY_MAX,V as LIVE_MRZ_DEFAULTS,Le as LIVE_PHOTO_IDLE_MS,_e as LIVE_PHOTO_MAX_HZ,ge as MANUAL_SHUTTER_MS,Ye as MRZ_BAND_DEFAULTS,De as MR_DOC_CATALOG,be as NO_REPORT_MS,le as OCR_ASSET_SET,Te as OTP_RESEND_COOLDOWN_MS,se as PORTRAIT_JPEG_QUALITY,i as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,Se as PROCESSING_BACKOFF_MS,fe as PROCESSING_POLL_DELAY_MS,ue as PROCESSING_POLL_MAX,G as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,S as RETRYABLE_REASONS,re as SAME_FACE_MAX_DROPS,g as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,O as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,M as TURNSTILE_EXECUTE_TIMEOUT_MS,d as TURNSTILE_SCRIPT_SRC,Q as WEB_OCR_ENGINE,tr as acceptedIssuers,er as acceptedTypesFor,qe as analyzeDocFrame,Tt as analyzeGuide,Ce as aspectBand,Pe as aspectFits,Jt as backgroundStats,$ as browserFamily,Z as buildDeviceReadHint,B as classifyCardSide,K as classifyCardSideWith,st as coverPointToVideo,oe as createDocumentCaptureInternal,ne as createFaceLandmarker,Wt as createIcaoGate,Re as createLivePhotoKit,R as createLivenessCaptureInternal,me as createPortraitCaptureInternal,ce as createStepRunner,Ae as createVerificationInternal,U as cropImage,e as detectFormFactor,t as detectIsMobile,He as detectMrzBand,Et as docZoomFor,k as encodeDocumentImage,v as executeTurnstile,Ft as eyeLineRoll,Ut as eyeOpenness,Zt as eyeSpecular,dt as faceGeometry,Xt as faceLighting,Qt as faceSharpness,ie as facesOf,ke as feedbackVoteOf,or as flagOf,mt as focusOk,te as formatMismatch,l as frontierStep,ct as guideQuad,St as guideRegionInFrame,jt as icaoPixelStats,vt as icaoWindow,he as initialScanState,T as isExecutable,c as isTerminalView,ht as judgeIcao,tt as lensKindOf,ee as liveMrzWireReport,N as loadTurnstile,zt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,f as mapSessionResult,W as measureBitmapSharpness,H as measureRegionSharpness,Ue as nextScanState,Ee as observePortraitFrame,Lt as openDocCamera,Ct as passportBandOf,Yt as percentile,b as photoSharpness,bt as portraitCropRegion,Ie as portraitMatchStep,Mt as poseFromMatrix,E as preloadedDetectorFactory,ze as quadAreaFrac,Xe as quadBounds,Ve as quadIou,je as quadTiltRatio,Oe as randomUuid,rt as rankBackCameras,pt as readStoredLens,Vt as regionStats,s as resetLivenessAssetsForTests,F as resetTurnstileForTests,Y as resizeLongEdge,rr as resolveAcceptedDocuments,et as resolveDocCameraTuning,It as resolveDocShutterTuning,yt as resolveGuideLockTuning,Kt as resolveIcaoTuning,j as resolveWebOcrPlan,D as runLivenessFlow,P as runSubmission,Me as scannerFormatFor,Ht as scoreFrame,a as setPreloadLoaderForTests,J as settledHint,at as singleShotFocusAt,Qe as specularFraction,q as startWebOcr,y as stepOf,h as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ut as warmDocDetector,gt as windowOverflow,it as writeStoredLens};
1
+ import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-XBVSYVKA.js";import{a as Bt,b as wt,c as zt,d as Vt,e as Xt,f as Zt,g as Jt,h as Qt,i as jt,j as ae,l as se,n as Ee,o as me}from"../chunk-73M7LS4H.js";import{b as pe,c as ie,d as ne}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import{a as d,b as M,c as F,d as N,e as v}from"../chunk-O5WKNZ2C.js";import{A as yt,B as ft,C as ut,D as Ot,E as At,F as It,G as xt,H as Ct,I as Pt,J as Dt,a as We,b as ke,c as Ke,d as Je,e as Qe,f as je,g as qe,h as $e,i as et,j as tt,k as rt,l as ot,m as pt,n as it,o as nt,p as at,q as st,r as Et,s as mt,t as _t,u as Lt,v as Rt,w as St,x as Tt,y as ct,z as lt}from"../chunk-VJM76LUI.js";import{a as Ye,b as He}from"../chunk-SMKCBUJL.js";import{a as Be,b as we,c as ze,d as Ve,e as Xe,f as Ze}from"../chunk-MXWLCDFX.js";import{a as k,b as Fe,c as Ne,d as ve,e as ge,f as be,g as Ge,h as he,i as Ue,j as K,k as B,l as w,m as Z,n as J,o as Q,p as j,q,r as $,s as ee,t as te,u as re,x as oe}from"../chunk-H6H2RT6M.js";import{a as g,b,c as G,d as h,e as U,f as Y,g as H,h as W,i as z,j as V,l as X}from"../chunk-G6LKLN4U.js";import{a as xe,b as Ce,c as Pe,d as De,e as de,f as Me}from"../chunk-TDLIXFDT.js";import{a as dt,b as Mt,c as Ft,d as Nt,e as vt,f as gt,g as bt,h as Gt,i as ht,j as Ut,k as Yt,l as Ht,m as Wt}from"../chunk-7ZCZY3ZP.js";import{a as kt,b as Kt}from"../chunk-BPE5NSQ2.js";import"../chunk-GI3UFGRQ.js";import{b as ye,c as fe,d as ue,e as Oe,g as Ae,h as qt,i as $t,j as er,k as tr,l as rr,m as or,s as Ie}from"../chunk-WTQE6IGL.js";import{c as S,i as T,j as c,k as l,l as y,n as f,p as u,q as O,r as A,s as I,t as x,u as C,v as P,w as D}from"../chunk-UBDG5IAP.js";import{a as i,b as n,c as a,d as s,i as E,j as m,k as _,l as L,m as R}from"../chunk-JRSIMNB5.js";import"../chunk-GT2ZLGF7.js";import"../chunk-IBA5CPDV.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-FUHDOEBP.js";import"../chunk-POIQGEZM.js";import"../chunk-FHJ7HO3M.js";import"../chunk-FPXL63KZ.js";import"../chunk-57VOMVKM.js";import"../chunk-5OIC5TZS.js";import"../chunk-OKWG3PVH.js";import{a as le}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ae as ANALYSIS_LONG_EDGE,xe as ASPECT_BANDS,C as AttestationError,Ge as BLUR_REFUSE_SHARPNESS_MAX,Dt as CAPTURE_CANDIDATE_SPACING_MS,Pt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,u as CLIP_MIME_ALLOWLIST,xt as CaptureSessionDoc,$t as DOCUMENT_TYPE_ORDER,Je as DOC_ANALYSIS_DEFAULTS,Ot as DOC_CADENCE_HZ,$e as DOC_CAMERA_TUNING_DEFAULTS,de as DOC_CATALOG,Be as DOC_DETECT_WIDTH,We as DOC_FEEDBACK_STATES,we as DOC_GATE_V1_DEFAULTS,At as DOC_SHUTTER_DEFAULTS,X as DocAssist,Ke as DocFeedbackAggregator,Ze as DocGateV1,Rt as EMPTY_GUIDE_METRICS,Ne as FLIP_FILL_MIN,Fe as FLIP_GAP_MS,ve as FLIP_TIMEOUT_MS,lt as GUIDE_LOCK_DEFAULTS,ft as GuideLock,Nt as ICAO_CANVAS,kt as ICAO_FALLBACK,Gt as ICAO_GATE_CRITERIA,wt as ICAO_SHARP_REF,I as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,qt as ISSUER_CODES,pe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,_t as LENS_TRY_MAX,V as LIVE_MRZ_DEFAULTS,Le as LIVE_PHOTO_IDLE_MS,_e as LIVE_PHOTO_MAX_HZ,ge as MANUAL_SHUTTER_MS,Ye as MRZ_BAND_DEFAULTS,De as MR_DOC_CATALOG,be as NO_REPORT_MS,le as OCR_ASSET_SET,Te as OTP_RESEND_COOLDOWN_MS,se as PORTRAIT_JPEG_QUALITY,i as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,Se as PROCESSING_BACKOFF_MS,fe as PROCESSING_POLL_DELAY_MS,ue as PROCESSING_POLL_MAX,G as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,S as RETRYABLE_REASONS,re as SAME_FACE_MAX_DROPS,g as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,O as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,M as TURNSTILE_EXECUTE_TIMEOUT_MS,d as TURNSTILE_SCRIPT_SRC,Q as WEB_OCR_ENGINE,tr as acceptedIssuers,er as acceptedTypesFor,qe as analyzeDocFrame,Tt as analyzeGuide,Ce as aspectBand,Pe as aspectFits,Jt as backgroundStats,$ as browserFamily,Z as buildDeviceReadHint,B as classifyCardSide,K as classifyCardSideWith,st as coverPointToVideo,oe as createDocumentCaptureInternal,ne as createFaceLandmarker,Wt as createIcaoGate,Re as createLivePhotoKit,R as createLivenessCaptureInternal,me as createPortraitCaptureInternal,ce as createStepRunner,Ae as createVerificationInternal,U as cropImage,e as detectFormFactor,t as detectIsMobile,He as detectMrzBand,Et as docZoomFor,k as encodeDocumentImage,v as executeTurnstile,Ft as eyeLineRoll,Ut as eyeOpenness,Zt as eyeSpecular,dt as faceGeometry,Xt as faceLighting,Qt as faceSharpness,ie as facesOf,ke as feedbackVoteOf,or as flagOf,mt as focusOk,te as formatMismatch,l as frontierStep,ct as guideQuad,St as guideRegionInFrame,jt as icaoPixelStats,vt as icaoWindow,he as initialScanState,T as isExecutable,c as isTerminalView,ht as judgeIcao,tt as lensKindOf,ee as liveMrzWireReport,N as loadTurnstile,zt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,f as mapSessionResult,W as measureBitmapSharpness,H as measureRegionSharpness,Ue as nextScanState,Ee as observePortraitFrame,Lt as openDocCamera,Ct as passportBandOf,Yt as percentile,b as photoSharpness,bt as portraitCropRegion,Ie as portraitMatchStep,Mt as poseFromMatrix,E as preloadedDetectorFactory,ze as quadAreaFrac,Xe as quadBounds,Ve as quadIou,je as quadTiltRatio,Oe as randomUuid,rt as rankBackCameras,pt as readStoredLens,Vt as regionStats,s as resetLivenessAssetsForTests,F as resetTurnstileForTests,Y as resizeLongEdge,rr as resolveAcceptedDocuments,et as resolveDocCameraTuning,It as resolveDocShutterTuning,yt as resolveGuideLockTuning,Kt as resolveIcaoTuning,j as resolveWebOcrPlan,D as runLivenessFlow,P as runSubmission,Me as scannerFormatFor,Ht as scoreFrame,a as setPreloadLoaderForTests,J as settledHint,at as singleShotFocusAt,Qe as specularFraction,q as startWebOcr,y as stepOf,h as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ut as warmDocDetector,gt as windowOverflow,it as writeStoredLens};
@@ -0,0 +1 @@
1
+ import{e as K}from"./chunk-A3FUGHAH.js";import{a as B,b as H,e as F,f as w,i as U}from"./chunk-XBVSYVKA.js";import{o as A}from"./chunk-73M7LS4H.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import{A as T,F as V,i as x}from"./chunk-VJM76LUI.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import{x as O}from"./chunk-H6H2RT6M.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-7ZCZY3ZP.js";import"./chunk-BPE5NSQ2.js";import"./chunk-GI3UFGRQ.js";import{a as L,o as I}from"./chunk-UBDG5IAP.js";import"./chunk-JRSIMNB5.js";import"./chunk-GT2ZLGF7.js";import"./chunk-IBA5CPDV.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-FHJ7HO3M.js";import"./chunk-FPXL63KZ.js";import{h as _}from"./chunk-57VOMVKM.js";import{a as M}from"./chunk-5OIC5TZS.js";import"./chunk-OKWG3PVH.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";function z(e){let a=null,c=Promise.resolve(),u=!1,g=null,y=null,C=null,k=!1,m=()=>{a?.controller.handle.destroy(),a=null},h=()=>{let i=e.currentView(),l=i===null?null:w(i,{isMobile:e.isMobile()});return l?.kind==="portrait"?l:null},P=async(i,l)=>{if(e.destroyed())return;l.setFlowState("uploading"),u=!1;let d=null;try{await e.runner().submit("portrait_icao",async(n,r)=>{if(d===null){let p=await I(n,"image","image/jpeg",i.image.size,{engine:"portrait"});await n.uploadToSpaces(p.uploadUrl,i.image,"image/jpeg"),d=(await n.completeMedia(p.key)).key}l.setFlowState("checking");let s={media:{portrait:d},gate:_(i.gate),...i.tuningVersion!==void 0?{tuningVersion:i.tuningVersion}:{}};return n.submitCheck("portrait_icao",s,{idempotencyKey:r})},()=>{g=d})}catch{u=!0}if(l.setFlowState("done"),e.destroyed())return;let t=h();(t===null||t.phase!=="capture")&&a?.controller===l&&m(),e.runner().republish()},b=i=>e.runner().submit("face_match",(l,d)=>l.submitCheck("face_match",g!==null?{imageKey:g}:{},{idempotencyKey:d})).then(()=>{},()=>{u=!0,i()});return{bind:(i,l)=>{if(i.phase==="match")return m(),y!==i.attemptsRemaining&&!u&&(y=i.attemptsRemaining,b(l)),{...i,uploadFailed:u,resubmit:()=>(u=!1,y=i.attemptsRemaining,l(),b(l)),capture:()=>{throw new Error("the portrait was already accepted")}};y=null;let d=e.keptPortraitInput?.()??null;return d!==null&&(k||d!==C&&i.report===null&&i.reason===void 0&&!i.retakeOnly)?(k||(C=d,k=!0,e.runner().submit("portrait_icao",(t,n)=>t.submitCheck("portrait_icao",d,{idempotencyKey:n}),()=>{g=d.media.portrait}).catch(()=>{}).finally(()=>{k=!1,l()})),{kind:"processing",key:"processing",context:i.context,section:i.section,stalled:!1,refresh:()=>Promise.resolve()}):{...i,uploadFailed:u,resubmit:()=>Promise.resolve(),capture:t=>{if(a!==null&&a.video===t.video)return a.controller.handle;m(),u=!1;let n=A({video:t.video,tuning:i.tuning,tuningVersion:i.tuningVersion,...i.icao!=null?{policy:i.icao.policy}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.internals,()=>e.destroyed()?"self":L(e.currentView()));return a={video:t.video,controller:n},n.handle.on("captured",r=>{c=c.then(()=>P(r,n)).catch(()=>{})}),n.handle}}},destroy:m}}function j(e){let a=e;if(typeof a.apiOrigin!="string"||typeof a.sessionToken!="string")return;let c=`${a.apiOrigin}/api/v2/hosted/capture-reports`,u=a.sessionToken;return g=>{try{fetch(c,{method:"POST",headers:{"content-type":"application/json","x-session-token":u,"x-sekyro-sdk":`@sekyro/web/${M}`},body:JSON.stringify({reports:g}),keepalive:!0}).catch(()=>{})}catch{}}}function G(e){let a=e.apiOrigin;return K("sdk",typeof a=="string"&&/staging|sandbox|localhost/.test(a)?"sandbox":"live")}function le(e){let a=null,c=null,u=null,g=Promise.resolve(),y=()=>{u?.flow.handle.destroy(),u=null},C=async(t,n)=>{if(e.destroyed())return;n.setFlowState("uploading");let r=null,s,p=!1;try{await a.submit("doc_ocr",async(S,E)=>{if(r===null){let R=await I(S,"image","image/jpeg",t.image.size,{engine:"document"});await S.uploadToSpaces(R.uploadUrl,t.image,"image/jpeg"),r=(await S.completeMedia(R.key)).key}return n.setFlowState("checking"),s===void 0&&(s=n.takeDeviceRead(t)),S.submitCheck("doc_ocr",{imageKey:r,side:t.side,...s!==null?{deviceRead:s}:{}},{idempotencyKey:E})})}catch{p=!0}finally{n.setFlowState("done")}if(e.destroyed())return;if(p){n.settle(t.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),o=v===null?null:w(v,{isMobile:e.isMobile()});if(o?.kind!=="document"){n.settle(t.side,{ok:!0}),u?.flow===n?y():n.handle.destroy();return}if(o.reason==="document_type_not_accepted"){c=null,u?.flow===n&&y(),a.republish();return}t.side==="single"||o.acceptedSides.includes(t.side)||o.reason==="side_missing"?(n.settle(t.side,{ok:!0}),c?.documentType!=="passport"&&n.handle.setSide(o.side)):n.settle(t.side,{ok:!1,issue:"reread"})},k=(t,n)=>({...t,issuer:c?.issuer??null,documentType:c?.documentType??null,captureSide:c===null?null:c.documentType==="passport"?"single":t.side,selectDocument:(r,s)=>{if(!H(t.documents).includes(r)||!B(t.documents,r).includes(s))throw new RangeError(`${s} from ${r} is not accepted`);(c?.issuer!==r||c.documentType!==s)&&y(),c={issuer:r,documentType:s},n()},capture:r=>{if(c===null)throw new Error("selectDocument() first");if(u!==null&&u.video===r.video)return u.flow.handle;y();let s=c,p=s.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,v=O({video:r.video,documentType:s.documentType,issuer:s.issuer,...p!==void 0?{side:p}:{},...r.keepScreenAwake!==void 0?{keepScreenAwake:r.keepScreenAwake}:{},...r.liveMrz!==void 0?{liveMrz:r.liveMrz}:{}},{...e.documentInternals??{},...(()=>{let o=e.currentView()?.capture?.document,f=e.documentInternals?.blurRefuseSharpnessMax??o?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:x(o?.camera),shutter:V(o?.scan),guideLock:T(o?.guide),...e.documentInternals?.engineOptions??{}},...typeof f=="number"&&Number.isFinite(f)&&f>=0&&f<=1?{blurRefuseSharpnessMax:f}:{}}})(),deferRead:!0,...(()=>{let o=e.currentView();if(o===null||e.documentInternals?.webOcr!==void 0)return{};let f=j(e.runtime.client);return{webOcr:{captureDocument:o.capture?.document,salt:o.sessionId,baseUrl:G(e.runtime.client),...f!==void 0?{reports:f}:{}}}})()});return u={video:r.video,flow:v},v.handle.on("captured",o=>{g=g.then(()=>C(o,v)).catch(()=>{})}),v.handle}}),m=null,h=null,P=new Set,b=e.runtime.client;e.runtime.client=new Proxy(b,{get(t,n){if(n==="submitCheck")return(h??t).submitCheck.bind(h??t);let r=Reflect.get(t,n);return typeof r=="function"?r.bind(t):r}});let D=()=>{m?.destroy(),m=null,h=null},i=t=>{let n=e.currentView(),r=n===null?null:w(n,{isMobile:e.isMobile()});if(n===null||r?.kind!=="liveness"||r.livePhoto?.icao!==!0)return;if(m===null){let o=F({tuning:n.capture?.icao??null,tuningVersion:n.capture?.tuningVersion??null,...r.icao!=null?{policy:r.icao.policy}:{},still:r.livePhoto.still,...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.livePhotoInternals);m=o,h=o.decorate(b),o.onGate(f=>{for(let S of P)S(f)})}let s=m,p=e.baseCapture??{},v=p.engineOptions?.telemetry;return{...p,engineOptions:{...p.engineOptions??{},measureQuality:s.engineOptions.measureQuality,telemetry:o=>{v?.(o),s.engineOptions.telemetry(o)}}}},l=z({keptPortraitInput:()=>m?.lastPortraitInput()??null,runner:()=>a,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{}}),d=U({...e,bindDocument:k,bindPortrait:l.bind,onLivePhoto:t=>(P.add(t),()=>P.delete(t))});return a=d,{...d,captureInternals:i,destroy:()=>{y(),l.destroy(),D(),P.clear()}}}export{le as createPlanRunner,j as reportSink,G as sdkAssetBase};
@@ -261,9 +261,9 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
261
261
  */
262
262
  type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
263
263
  type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "uncalibrated_capture_channel" | "capture_back_camera" | "capture_not_upright" | "camera_unavailable";
264
- type PopulationReason = "nni_not_found" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "nni_recheck";
264
+ type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
265
265
  type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness";
266
- type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
266
+ type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
267
267
  /**
268
268
  * Profile v2 step 3 matching reasons: a field the partner sent at session
269
269
  * create (`subject`) differs from the reference identity (document or
@@ -299,7 +299,7 @@ type EmailOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_
299
299
  * never does — on web the step arrives `skipped` (`platform_unsupported`) or
300
300
  * the session shows `failureReason: 'platform_unsupported'`.
301
301
  */
302
- type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_nni_mismatch" | "platform_unsupported";
302
+ type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "platform_unsupported";
303
303
  /**
304
304
  * eid_auth reasons (SDK spec §3.2, generic national eID; Houwiyeti in MR).
305
305
  * Retryable: `eid_identifier_invalid` (re-enter the number), `eid_code_invalid`
@@ -353,9 +353,9 @@ type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "cap
353
353
  * The profile-v2 policy reasons a session can end on: the two session-level
354
354
  * reasons plus the failed check's policy reasons (`document_type_not_accepted`,
355
355
  * `nationality_not_allowed`, `underage`, `age_unverifiable`,
356
- * `document_nni_mismatch`).
356
+ * `document_id_number_mismatch`, formerly `document_nni_mismatch`).
357
357
  */
358
- type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_nni_mismatch" | "camera_unavailable" | "underage_estimated";
358
+ type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_id_number_mismatch" | "document_nni_mismatch" | "camera_unavailable" | "underage_estimated";
359
359
  /**
360
360
  * Why the person has no camera (spec 2026-10-29 §3.4, 2026-10-30): `denied` when the camera permission was refused,
361
361
  * `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
@@ -486,8 +486,8 @@ type IdentitySummarySource = "registry" | "document" | "chip";
486
486
  interface IdentitySummaryView {
487
487
  /**
488
488
  * `full` (document / chip: the record and the photo) or `partial` (the
489
- * registry from a typed NNI: the short name "Mohamed S.", the birth year,
490
- * the NNI's last 4, no photo).
489
+ * registry from a typed number: the short name, the birth year, the number's
490
+ * last 4, no photo).
491
491
  */
492
492
  kind: "full" | "partial" | (string & {});
493
493
  source: IdentitySummarySource | (string & {});
@@ -501,7 +501,10 @@ interface IdentitySummaryView {
501
501
  nationality?: string;
502
502
  documentType?: string;
503
503
  documentNumberMasked?: string;
504
+ /** The bound ID number, masked (last 4). @deprecated Read `idNumberMasked` (the server sends both). */
504
505
  nniMasked?: string;
506
+ /** The bound ID number, masked (last 4). Absent from servers before person data Task A9: read `nniMasked` then. */
507
+ idNumberMasked?: string;
505
508
  /** `YYYY-MM-DD`. */
506
509
  expiryDate?: string;
507
510
  /** A portrait can be fetched ({@link HostedClient.identityPortrait}). */
@@ -709,8 +712,20 @@ interface HostedStepView {
709
712
  * document step already read a valid one — the page submits the registry
710
713
  * check with an EMPTY input (no NNI field) and the backend uses the
711
714
  * document's number. Absent on older APIs.
715
+ * @deprecated Read `idNumberFromDocument` (the server sends both).
712
716
  */
713
717
  nniFromDocument?: boolean;
718
+ /**
719
+ * population_registry only: the twin of `nniFromDocument` (person data spec §5.6),
720
+ * both present or both absent. Absent from servers before person data Task A9.
721
+ */
722
+ idNumberFromDocument?: boolean;
723
+ /**
724
+ * phone_otp only (person data spec Q16, Task A9): the countries the number may be
725
+ * from, ISO alpha-2, the first the default of the country picker. Absent from an
726
+ * older server: the person types a full international number.
727
+ */
728
+ phoneCountries?: string[];
714
729
  /**
715
730
  * liveness / face_match (profile v2 step 4, decision mode `automatic`): the
716
731
  * capture must come from a phone — the liveness band is calibrated on
@@ -1030,8 +1045,16 @@ interface HostedSessionView {
1030
1045
  * the registry check on an unbound session. The VALUE is never exposed. The
1031
1046
  * backend declares it required; optional here so pre-Task-8 fixtures stay
1032
1047
  * valid (additive field, always on the wire from Task 8 onward).
1048
+ * Registry-scoped: an MR national ID number the registry can look up.
1033
1049
  */
1034
1050
  nniBound?: boolean;
1051
+ /**
1052
+ * Person data spec §5.6: the generic name of `nniBound`, with the same meaning:
1053
+ * the session holds an ID number the registry step can look up, so the step is
1054
+ * submitted with an empty input. A bound passport or another country's number is
1055
+ * not registry-bound. Absent from servers before person data Task A9.
1056
+ */
1057
+ idNumberBound?: boolean;
1035
1058
  /**
1036
1059
  * The Sekyro AI-hosted voice-guidance clips of this session, or `null` when no
1037
1060
  * clip set is active (the device voice is used). Optional: older APIs omit
@@ -1301,12 +1324,16 @@ interface LivenessCaptureInput {
1301
1324
  provenance?: CaptureProvenance;
1302
1325
  }
1303
1326
  /**
1304
- * population_registry adapter input. `nni` is the 10-digit NNI for an UNBOUND
1305
- * session; a session minted with a server-side `input.nni` is BOUND to it
1306
- * (Plan A Task 2) — the browser submits `{}` and the backend reads the sealed
1307
- * value. Sending a DIFFERENT nni on a bound session answers 409 `nni_locked`.
1327
+ * population_registry adapter input. `idNumber` is the national number the
1328
+ * person typed on an UNBOUND session; a session minted with `subject.idNumber`
1329
+ * is BOUND to it: the browser submits `{}` and the backend reads the sealed
1330
+ * value. Sending a DIFFERENT number on a bound session answers 409
1331
+ * `id_number_locked` (formerly `nni_locked`). `nni` is the former name of
1332
+ * `idNumber` (both accepted; both with different values is `400 validation_error`).
1308
1333
  */
1309
1334
  interface PopulationInput {
1335
+ idNumber?: string;
1336
+ /** @deprecated Send `idNumber`. */
1310
1337
  nni?: string;
1311
1338
  }
1312
1339
  /**
@@ -261,9 +261,9 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
261
261
  */
262
262
  type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
263
263
  type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "uncalibrated_capture_channel" | "capture_back_camera" | "capture_not_upright" | "camera_unavailable";
264
- type PopulationReason = "nni_not_found" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "nni_recheck";
264
+ type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
265
265
  type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness";
266
- type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
266
+ type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
267
267
  /**
268
268
  * Profile v2 step 3 matching reasons: a field the partner sent at session
269
269
  * create (`subject`) differs from the reference identity (document or
@@ -299,7 +299,7 @@ type EmailOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_
299
299
  * never does — on web the step arrives `skipped` (`platform_unsupported`) or
300
300
  * the session shows `failureReason: 'platform_unsupported'`.
301
301
  */
302
- type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_nni_mismatch" | "platform_unsupported";
302
+ type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "platform_unsupported";
303
303
  /**
304
304
  * eid_auth reasons (SDK spec §3.2, generic national eID; Houwiyeti in MR).
305
305
  * Retryable: `eid_identifier_invalid` (re-enter the number), `eid_code_invalid`
@@ -353,9 +353,9 @@ type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "cap
353
353
  * The profile-v2 policy reasons a session can end on: the two session-level
354
354
  * reasons plus the failed check's policy reasons (`document_type_not_accepted`,
355
355
  * `nationality_not_allowed`, `underage`, `age_unverifiable`,
356
- * `document_nni_mismatch`).
356
+ * `document_id_number_mismatch`, formerly `document_nni_mismatch`).
357
357
  */
358
- type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_nni_mismatch" | "camera_unavailable" | "underage_estimated";
358
+ type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_id_number_mismatch" | "document_nni_mismatch" | "camera_unavailable" | "underage_estimated";
359
359
  /**
360
360
  * Why the person has no camera (spec 2026-10-29 §3.4, 2026-10-30): `denied` when the camera permission was refused,
361
361
  * `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
@@ -486,8 +486,8 @@ type IdentitySummarySource = "registry" | "document" | "chip";
486
486
  interface IdentitySummaryView {
487
487
  /**
488
488
  * `full` (document / chip: the record and the photo) or `partial` (the
489
- * registry from a typed NNI: the short name "Mohamed S.", the birth year,
490
- * the NNI's last 4, no photo).
489
+ * registry from a typed number: the short name, the birth year, the number's
490
+ * last 4, no photo).
491
491
  */
492
492
  kind: "full" | "partial" | (string & {});
493
493
  source: IdentitySummarySource | (string & {});
@@ -501,7 +501,10 @@ interface IdentitySummaryView {
501
501
  nationality?: string;
502
502
  documentType?: string;
503
503
  documentNumberMasked?: string;
504
+ /** The bound ID number, masked (last 4). @deprecated Read `idNumberMasked` (the server sends both). */
504
505
  nniMasked?: string;
506
+ /** The bound ID number, masked (last 4). Absent from servers before person data Task A9: read `nniMasked` then. */
507
+ idNumberMasked?: string;
505
508
  /** `YYYY-MM-DD`. */
506
509
  expiryDate?: string;
507
510
  /** A portrait can be fetched ({@link HostedClient.identityPortrait}). */
@@ -709,8 +712,20 @@ interface HostedStepView {
709
712
  * document step already read a valid one — the page submits the registry
710
713
  * check with an EMPTY input (no NNI field) and the backend uses the
711
714
  * document's number. Absent on older APIs.
715
+ * @deprecated Read `idNumberFromDocument` (the server sends both).
712
716
  */
713
717
  nniFromDocument?: boolean;
718
+ /**
719
+ * population_registry only: the twin of `nniFromDocument` (person data spec §5.6),
720
+ * both present or both absent. Absent from servers before person data Task A9.
721
+ */
722
+ idNumberFromDocument?: boolean;
723
+ /**
724
+ * phone_otp only (person data spec Q16, Task A9): the countries the number may be
725
+ * from, ISO alpha-2, the first the default of the country picker. Absent from an
726
+ * older server: the person types a full international number.
727
+ */
728
+ phoneCountries?: string[];
714
729
  /**
715
730
  * liveness / face_match (profile v2 step 4, decision mode `automatic`): the
716
731
  * capture must come from a phone — the liveness band is calibrated on
@@ -1030,8 +1045,16 @@ interface HostedSessionView {
1030
1045
  * the registry check on an unbound session. The VALUE is never exposed. The
1031
1046
  * backend declares it required; optional here so pre-Task-8 fixtures stay
1032
1047
  * valid (additive field, always on the wire from Task 8 onward).
1048
+ * Registry-scoped: an MR national ID number the registry can look up.
1033
1049
  */
1034
1050
  nniBound?: boolean;
1051
+ /**
1052
+ * Person data spec §5.6: the generic name of `nniBound`, with the same meaning:
1053
+ * the session holds an ID number the registry step can look up, so the step is
1054
+ * submitted with an empty input. A bound passport or another country's number is
1055
+ * not registry-bound. Absent from servers before person data Task A9.
1056
+ */
1057
+ idNumberBound?: boolean;
1035
1058
  /**
1036
1059
  * The Sekyro AI-hosted voice-guidance clips of this session, or `null` when no
1037
1060
  * clip set is active (the device voice is used). Optional: older APIs omit
@@ -1301,12 +1324,16 @@ interface LivenessCaptureInput {
1301
1324
  provenance?: CaptureProvenance;
1302
1325
  }
1303
1326
  /**
1304
- * population_registry adapter input. `nni` is the 10-digit NNI for an UNBOUND
1305
- * session; a session minted with a server-side `input.nni` is BOUND to it
1306
- * (Plan A Task 2) — the browser submits `{}` and the backend reads the sealed
1307
- * value. Sending a DIFFERENT nni on a bound session answers 409 `nni_locked`.
1327
+ * population_registry adapter input. `idNumber` is the national number the
1328
+ * person typed on an UNBOUND session; a session minted with `subject.idNumber`
1329
+ * is BOUND to it: the browser submits `{}` and the backend reads the sealed
1330
+ * value. Sending a DIFFERENT number on a bound session answers 409
1331
+ * `id_number_locked` (formerly `nni_locked`). `nni` is the former name of
1332
+ * `idNumber` (both accepted; both with different values is `400 validation_error`).
1308
1333
  */
1309
1334
  interface PopulationInput {
1335
+ idNumber?: string;
1336
+ /** @deprecated Send `idNumber`. */
1310
1337
  nni?: string;
1311
1338
  }
1312
1339
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/web",
3
- "version": "0.1.0-rc.12",
3
+ "version": "0.1.0-rc.13",
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.12",
101
- "bom-ref": "@sekyro/web@0.1.0-rc.12",
100
+ "version": "0.1.0-rc.13",
101
+ "bom-ref": "@sekyro/web@0.1.0-rc.13",
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.12?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
111
+ "purl": "pkg:npm/%40sekyro/web@0.1.0-rc.13?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.12|@mediapipe/tasks-vision@0.10.35",
153
+ "bom-ref": "@sekyro/web@0.1.0-rc.13|@mediapipe/tasks-vision@0.10.35",
154
154
  "licenses": [
155
155
  {
156
156
  "license": {
@@ -183,13 +183,13 @@
183
183
  ],
184
184
  "dependencies": [
185
185
  {
186
- "ref": "@sekyro/web@0.1.0-rc.12",
186
+ "ref": "@sekyro/web@0.1.0-rc.13",
187
187
  "dependsOn": [
188
- "@sekyro/web@0.1.0-rc.12|@mediapipe/tasks-vision@0.10.35"
188
+ "@sekyro/web@0.1.0-rc.13|@mediapipe/tasks-vision@0.10.35"
189
189
  ]
190
190
  },
191
191
  {
192
- "ref": "@sekyro/web@0.1.0-rc.12|@mediapipe/tasks-vision@0.10.35"
192
+ "ref": "@sekyro/web@0.1.0-rc.13|@mediapipe/tasks-vision@0.10.35"
193
193
  }
194
194
  ]
195
195
  }
@@ -1 +0,0 @@
1
- import{c as j,d as pe,e as me,f as fe,h as he,i as z,k as Y,m as Se,n as ge,u as ye,w as O,x as q}from"./chunk-IF6YOFFO.js";import{c as le,d as de,e as ue}from"./chunk-FPXL63KZ.js";import{c as K,f as $,g as ke}from"./chunk-MUVEJRGK.js";var ve=["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 Me=["carte_identite","passport","residence_permit"];function Ve(e,n){let i=e.byIssuer?.[n]??e.default;return Me.filter(s=>i==="*"||i.includes(s))}function ht(e,n=ve){return[...new Set([...n,...Object.keys(e.byIssuer??{})])].filter(s=>Ve(e,s).length>0).sort()}function _e(e){if(e.acceptedDocuments)return e.acceptedDocuments;let n=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:n}}}var Le=640,He=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),be=6,Pe=1500,Ce={sharpness:1,exposure:1,meanLuma:128},we=null;function De(e,n){try{we??(we=document.createElement("canvas"));let i=we,s=96/Math.max(1,n.width);i.width=Math.max(1,Math.round(n.width*s)),i.height=Math.max(1,Math.round(n.height*s));let a=i.getContext("2d");if(a===null)return Ce;a.drawImage(e,n.x,n.y,n.width,n.height,0,0,i.width,i.height);let c=a.getImageData(0,0,i.width,i.height);return{sharpness:de(c),exposure:ue(c),meanLuma:le(c)}}catch{return Ce}}async function Ne(e,n){let i=e.source;return"convertToBlob"in i?i.convertToBlob({type:"image/jpeg",quality:n}):new Promise((s,a)=>{i.toBlob(c=>c===null?a(new Error("encode failed")):s(c),"image/jpeg",n)})}function vt(e,n={}){let i=n.now??(()=>performance.now()),s=n.setTimer??((t,o)=>setTimeout(t,o)),a=n.clearTimer??(t=>clearTimeout(t)),c=n.encode??Ne,u=n.quality??De,l=e.tuningVersion??null,g=new Set,v=!1,S=e.video??null,f=null,y=n.grabFrame??null,x=null,M=1e3/be,P=null,w=null,D=!1,A=!1,E=Number.NEGATIVE_INFINITY,C=null,B=0,V=null,N=null,G=Promise.all([import("./icao-gate-PWBMKRGC.js"),import("./icao-tuning-4GGVX6B4.js"),import("./create-portrait-capture-C462EIB6.js"),import("./landmarker-KB7LVXAU.js"),import("./background-monitor-A7FKJOAG.js")]).then(async([t,o,r,d,h])=>{let m=o.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);m.background.required&&(w=h.createBackgroundMonitor({tuning:m.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...n.createSegmenter!==void 0?{createSegmenter:n.createSegmenter}:{},now:i})),f=t.createIcaoGate(m,{policy:e.policy??"reject"}),y??(y=r.defaultGrabber()),x=r.observe,M=1e3/Math.min(be,m.cadenceHz);let k=(n.createLandmarker??d.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),p=await new Promise((_,b)=>{let I=setTimeout(()=>{b(new Error("landmarker init timeout")),k.then(T=>T.close(),()=>{})},d.LANDMARKER_INIT_TIMEOUT_MS);k.then(T=>{clearTimeout(I),_(T)},T=>{clearTimeout(I),b(T)})});v?p.close():P=p}).catch(()=>{D=!0}),Q=t=>{for(let o of g)o({holding:A||D,update:t})},F=()=>{if(C=null,!(v||P===null||f===null||y===null||x===null||S===null)){if(i()-E>Pe){Q(null);return}try{let t=y(S,Le);if(t!==null){let o=Math.max(i(),B+1);B=o;let r=P.detect(t.source,o),d=S.videoWidth||t.width,h=S.videoHeight||t.height,m=x(r,t,d,h);m.geometry!==null&&w!==null&&(m.backgroundCheck=w.measure(t,m.geometry.box,d,h));let k=f.push(m,i());A=k.ready,Q(k)}}catch{}C=s(F,M)}},Z=()=>{let t=i()-E>Pe;E=i(),t&&(f?.reset(),A=!1,V=null,N=null),C===null&&P!==null&&!v&&(C=s(F,0))},J=()=>{let t=y===null||S===null?null:y(S,null);if(t===null||f===null||Math.max(t.width,t.height)<e.still.minLongSidePx)return Promise.resolve(null);let o=f.summary();return c(t,e.still.jpegQuality).then(r=>({image:r,width:t.width,height:t.height,gate:o}),()=>null)},L=null;return{engineOptions:{measureQuality:(t,o)=>{S=t,Z();let r=u(t,o);return A||D?r:{...r,sharpness:0}},telemetry:t=>{if(t.type!=="fired"||v)return;V=J();let o=L;o!==null&&V.then(r=>r===null?void 0:o(r).catch(()=>{})),A=!1,C!==null&&a(C),C=null,E=Number.NEGATIVE_INFINITY}},decorate:t=>{let o=new WeakMap,r=new Map,d=p=>{let _=o.get(p);return _===void 0&&(_=(async()=>{let b=await ge(t,"image","image/jpeg",p.image.size,{engine:"portrait"});return await t.uploadToSpaces(b.uploadUrl,p.image,"image/jpeg"),(await t.completeMedia(b.key)).key})(),_.catch(()=>o.delete(p)),o.set(p,_)),_};L=d;let h=async p=>{let _;try{_=await d(p)}catch(b){let I=b?.code;if(typeof I=="string"&&He.has(I))throw b;return null}return{media:{portrait:_},gate:ke(p.gate),...l!==null?{tuningVersion:l}:{}}},m=t.submitCheck.bind(t),k=(async(p,_,b)=>{if(p!=="liveness")return m(p,_,b);let I=b?.idempotencyKey,T=I===void 0?void 0:r.get(I);if(T===void 0){let ae=V;T=ae===null?Promise.resolve(null):ae.then(ce=>ce===null?null:h(ce)),I!==void 0&&(r.set(I,T),T.catch(()=>r.delete(I)))}let X=await T;if(X===null)return m("liveness",_,b);let Re=await m("liveness",{..._,portraitIcao:X},b);return N=X,Re});return new Proxy(t,{get(p,_){if(_==="submitCheck")return k;let b=Reflect.get(p,_);return typeof b=="function"?b.bind(p):b}})},onGate:t=>(g.add(t),()=>g.delete(t)),lastPortraitInput:()=>N,destroy:()=>{v=!0,V=null,N=null,C!==null&&a(C),C=null,g.clear(),G.then(()=>{P?.close(),P=null,w?.close(),w=null})}}}var Ge=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","face_match","aml_screening","face_dedup","age_estimation"]),Ue=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),te=["document","population_registry","national_eid"],ne=["phone_otp","email_otp"],Ee={identity_method:te,contact:ne},Be=["population_registry","document"],Ie="platform_unsupported",Fe=new Set(["prefilled","user_entered","prefilled_or_entered"]),Ke={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"};function R(e){return e.section??Ke[e.checkType]??null}function ie(e,n){let i=e.plan?.choice;if(i===void 0||i.locked)return;let s=i.options.find(a=>a.id!==i.selected&&a.available!==!1&&n.includes(a.service));return s===void 0?void 0:{nodeId:i.nodeId,option:s}}function oe(e){let n=e.plan,i=n?.choice;if(n===void 0||i===void 0||i.locked||n.current===null||n.current===i.nodeId||z(e))return null;let s=Ee[i.kind]??[...te,...ne],a=i.options.flatMap(l=>l.available===!1||!s.includes(l.service)?[]:[l.nationalEid!=null?{id:l.id,service:l.service,nationalEid:l.nationalEid}:{id:l.id,service:l.service}]),c=n.steps.find(l=>l.id===n.current)?.service,u=i.selected??a.find(l=>l.service===c)?.id??null;return a.some(l=>l.id!==u)?{nodeId:i.nodeId,kind:i.kind,current:u,options:a}:null}function Te(e){return e==null?[]:e.options.filter(n=>n.id!==e.current)}function je(e){let n=(e.plan?.sections??[]).map(a=>({id:a.id,state:a.state})),i={sessionId:e.sessionId,orgName:e.orgName,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:n.map(a=>a.id),progress:n,purpose:e.purpose??"identity"};e.branding!==void 0&&(i.branding=e.branding),e.cameraUnavailableHandled===!0&&(i.cameraUnavailableHandled=!0);let s=oe(e);return s!==null&&(i.switchable=s),i}function qe(e){let n={attemptsRemaining:me(e),attemptsExhausted:e.attemptsExhausted===!0};return e.reason!==void 0&&(n.reason=e.reason),e.retakeHint!==void 0&&(n.retakeHint=e.retakeHint),n}var Oe={phone_otp:"phone",email_otp:"email"};function Qe(e,n){let i=ie(e,[n==="phone_otp"?"email_otp":"phone_otp"]);return i===void 0?void 0:Oe[i.option.service]}function Ye(e,n,i,s){let a=n.checkType==="email_otp",c=(a?n.emailOtp:n.otp)??{},u=a?n.emailOtp?.emailSource:n.otp?.numberSource,l=u!==void 0&&Fe.has(u)?u:a?"prefilled_or_entered":"user_entered",g=typeof c.sentToMasked=="string"&&c.sentToMasked.length>0,v=Qe(e,a?"email_otp":"phone_otp"),S={key:n.checkType,context:i,section:R(n),phase:g?"verify":"send",canSwitch:v!==void 0,...s},f=a?{kind:"email_otp",...S,emailSource:l,needsEmail:l!=="prefilled"}:{kind:"phone_otp",...S,numberSource:l,needsPhone:l!=="prefilled",channels:(n.otp?.channels??[]).filter(y=>y==="whatsapp"||y==="sms")};return v!==void 0&&(f.switchChannel=v),g&&(f.sentToMasked=c.sentToMasked),!a&&n.otp?.channel!==void 0&&(f.channel=n.otp.channel),c.expiresAt!==void 0&&(f.codeExpiresAt=c.expiresAt),c.resendAvailableAt!==void 0&&(f.resendAvailableAt=c.resendAvailableAt),f}function $e(e,n,i,s){let a=e.nniBound===!0?"bound":n.nniFromDocument===!0?"document":"typed",c=a==="typed"&&n.state==="input_required"&&n.reason==="nni_recheck",u=Te(oe(e)),l=!s.attemptsExhausted&&u.length===1&&u[0]?.service==="document";return{kind:"registry",key:"registry",context:i,section:R(n),state:n.state==="input_required"?"input_required":"pending",source:a,recheck:c,canUseDocument:l,...s}}function We(e,n,i,s){let a=[...n.acceptedSides??[]];return{kind:"document",key:"document",context:i,section:R(n),side:a.includes("recto")?"verso":"recto",acceptedSides:a,documents:_e(e),...s}}function Ze(e){let n=Y(e,"liveness");return n?.state==="passed"||n?.state==="review"}function xe(e,n,i,s,a){let c=n.icao?.report;return{kind:"portrait",key:`portrait:${a}`,context:i,section:R(n),phase:a,report:Array.isArray(c)?c:null,review:n.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:$(e),retakeOnly:a==="capture"&&n.state==="input_required"&&e.capture?.livePhoto?.oneCapture===!0&&Ze(e),...s}}var ee={minLongSidePx:1280,jpegQuality:.95};function Je(e,n){let i=e.capture?.livePhoto;if(i?.oneCapture!==!0)return null;let s=Y(e,"portrait_icao"),a=i.still??ee;return{icao:n==="liveness"&&$(e)!==null&&s!==void 0&&s.state==="pending"&&s.reason===void 0,still:{minLongSidePx:a.minLongSidePx??ee.minLongSidePx,jpegQuality:a.jpegQuality??ee.jpegQuality}}}function Xe(e,n,i,s){let a=n.eid,c=R(n);if(a===void 0||a.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:i,section:c,checkType:"eid_auth",reason:"update_required"};let u=Te(oe(e)),l=u.length===1&&Be.includes(u[0]?.service??"")?u[0]:void 0,g=l===void 0?void 0:j[l.service],v=g!==void 0,S={kind:"eid",key:"eid",context:i,section:c,provider:a.provider,providerName:a.providerName,country:a.country,challenge:"app_code",phase:a.awaiting==="code"?"code":"identifier",identifierBound:a.identifierBound===!0,canUseCamera:v,afterPass:a.afterPass==="continue"?"continue":"end",...s};return v&&(S.cameraMethod=g),a.expiresAt!==void 0&&(S.codeExpiresAt=a.expiresAt),a.resendAvailableAt!==void 0&&(S.resendAvailableAt=a.resendAvailableAt),a.resendsRemaining!==void 0&&(S.resendsRemaining=a.resendsRemaining),a.codeAttemptsRemaining!==void 0&&(S.codeAttemptsRemaining=a.codeAttemptsRemaining),S}function ze(e,n){if(n.checkType!=="face_match"||n.reason!==void 0)return null;let i=Y(e,"portrait_icao");return i!==void 0&&(i.state==="passed"||i.state==="review")?i:null}function et(e){return pe(e).filter(n=>n.state==="failed").pop()?.attemptsExhausted===!0}function tt(e,n){let i=e.failureReason,s;i===Ie?s="platform_unsupported":e.status==="expired"?s="expired":e.status==="review_pending"?s="review":e.status==="completed"&&e.outcome==="approved"?s="approved":e.status==="completed"&&e.outcome==="review"?s="review":i==="device_cooldown"?s="cooldown":i!==void 0?s="policy_stop":et(e)?s="attempts_exhausted":s="rejected";let a=s==="platform_unsupported"?{sessionId:e.sessionId,status:"unavailable"}:Se(e,{autoRetry:!1}),c={kind:"result",key:"result",context:n,section:null,display:s,result:a};return i!==void 0&&(c.failureReason=i),e.retryAfter!==void 0&&(c.retryAfter=e.retryAfter),c}function nt(e,n,i){let s=e.identitySummary;if(s==null)return null;let a={kind:"identity_summary",key:"identity_summary",context:n,section:i??"identity",summaryKind:s.kind==="partial"?"partial":s.kind??"full",source:s.source,portraitAvailable:s.portrait?.available===!0,retakeAvailable:s.retakeAvailable===!0};for(let c of it){let u=s[c];typeof u=="string"&&u!==""&&(a[c]=u)}return a}var it=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","nniMasked","expiryDate","retakeTarget"];function U(e,n,i,s){return{kind:"unsupported",key:`unsupported:${i}`,context:e,section:n,checkType:i,reason:s}}function ot(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function rt(e,n){let i=Ee[e.kind]??[...te,...ne],s=ot(e),a=e.options.flatMap(u=>{if(u.available===!1||!i.includes(u.service))return[];let l={id:u.id,service:u.service};return u.nationalEid!=null&&(l.nationalEid=u.nationalEid),[l]});if(a.length===0){let u=e.options.length>0&&e.options.every(l=>l.service==="nfc");return U(n,s,"choice",u?"platform_unsupported":"update_required")}let c={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:a};if(e.kind==="identity_method"){let u={kind:"method",key:"method",context:n,section:s,options:a.map(g=>j[g.service]),choice:c},l=a.find(g=>g.nationalEid!==void 0)?.nationalEid;return l!==void 0&&(u.nationalEid=l),u}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:n,section:s,options:a.map(u=>Oe[u.service]),selected:null,locked:!1,choice:c}:{kind:"choice",key:`choice:${e.nodeId}`,context:n,section:s,choice:c}}function W(e,n={}){let i=je(e);if(z(e)||e.failureReason===Ie)return tt(e,i);let s=e.plan;if(s===void 0||!Array.isArray(s.sections))return U(i,null,"plan","update_required");let a=fe(e);if(a!==null)return rt(a,i);let c=s.current===null?void 0:s.steps.find(f=>f.id===s.current),u=f=>{let y={kind:"processing",key:"processing",context:i,section:f!==void 0?R(f):s.sections.find(x=>x.state==="current")?.id??null,stalled:!1};return typeof f?.service=="string"&&f.service!==""&&(y.service=f.service),y};if(s.current===null)return u(s.steps.find(f=>f.state==="processing"));if(c===void 0)return U(i,null,"step","update_required");if(!Ge.has(c.service))return c.interaction==="server"?u(c):U(i,R(c),c.service,"update_required");if(Ue.has(c.service)||!he(c))return u(c);let l=c,g=qe(l),v=l.checkType,S=R(l);switch(v){case"phone_otp":case"email_otp":return Ye(e,l,i,g);case"population_registry":return $e(e,l,i,g);case"eid_auth":return Xe(e,l,i,g);case"doc_ocr":return We(e,l,i,g);case"identity_confirm":return nt(e,i,S)??u(l);case"portrait_icao":return xe(e,l,i,g,"capture");case"liveness":case"face_match":{let f=ze(e,l);if(f!==null)return xe(e,f,i,g,"match");let y=l.requiresMobile===!0,x=$(e);return y&&n.isMobile===!1?{kind:"mobile_required",key:"mobile_required",context:i,section:S,checkType:v}:{kind:"liveness",key:"biometric",context:i,section:S,mode:v==="face_match"?"selfie":"liveness",requiresMobile:y,instructions:x===null?"standard":"icao",icao:x,livePhoto:Je(e,v),...g}}case"nfc_chip":return U(i,S,v,"platform_unsupported");default:return U(i,S,v,"update_required")}}function re(e){return/^\d{10}$/.test(e)&&Number(e)%97===1}function se(e){let n="";for(let i of e){let s=i.codePointAt(0)??0;s>=1632&&s<=1641?n+=String(s-1632):s>=1776&&s<=1785?n+=String(s-1776):i!==" "&&i!=="-"&&i!=="\xA0"&&(n+=i)}return n}var st=[1e3,2e3,4e3,8e3,15e3],at=3e4,ct=/^\+[1-9]\d{7,14}$/,lt=/^\d{6}$/,dt=/^\d{6}$/,ut=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ae=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","identity_confirm_locked","choice_locked","choice_option_unavailable","choice_not_found","step_not_on_path","check_not_active"]),pt=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function Mt(e){let n=!1,i=null,s="",a=!1,c=!1,u=!1,l={},g={},v=new Set,S=!1,f=null,y="idle",x=new Map,M=new Map,P=(t,o,r)=>{let d=`${t}.${o}`,h=x.get(d);if(h!==void 0)return h;let m=M.get(t),k=(m===void 0?r():m.then(r)).finally(()=>{x.delete(d)});x.set(d,k);let p=k.then(()=>{},()=>{});return M.set(t,p),p.then(()=>{M.get(t)===p&&M.delete(t)}),k},w=async(t,o,r)=>{await e.ensureConsent();let d;try{d=await ye(e.runtime,o)}catch(m){if(m instanceof K&&Ae.has(m.code)){await e.refreshView();return}throw m}if(r?.(),e.destroyed())return;let h=d;h.plan!==void 0&&e.setView!==void 0?e.setView(h):await e.refreshView()},D=async t=>{await e.ensureConsent();let o;try{try{o=await t(e.runtime.client)}catch(r){if(!(r instanceof K)||r.code!=="consent_required")throw r;await e.runtime.ensureConsent({force:!0}),o=await t(e.runtime.client)}}catch(r){if(r instanceof K&&Ae.has(r.code)){await e.refreshView();return}throw r}e.destroyed()||(o!==void 0&&e.setView!==void 0?e.setView(o):await e.refreshView())},A=(t,o)=>P("choice",`${t}:${o}`,()=>D(r=>r.choose(t,o))),E=(t,o)=>t.options.some(r=>r.id===o)?A(t.nodeId,o):Promise.reject(new RangeError(`option ${String(o)} is not offered`)),C=(t,o)=>{let r=e.currentView(),d=r===null?void 0:ie(r,t);return d===void 0?Promise.reject(new RangeError(`the ${o} is not offered`)):A(d.nodeId,d.option.id)},B=t=>P("identity",t,()=>D(o=>o.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):o.confirmIdentity(t))),V=(t,o)=>{let r=t.kind,d=r==="phone_otp",h=d?"phone":"email",m={action:"send"};if(d?t.needsPhone:t.needsEmail){let k=o[h]??g[r],p=d?k?.replace(/[\s().-]/g,""):k?.trim();if(p===void 0||!(d?ct:ut).test(p))return Promise.reject(d?new O("phone","format"):new q("email","format"));m[h]=p}if(d){let k=t.channels,p=o.channel??(k.length===1?k[0]:void 0);if(k.length>0){if(p===void 0)return Promise.reject(new q("channel","required"));if(!k.includes(p))return Promise.reject(new q("channel","unavailable"))}p!==void 0&&(m.channel=p)}return P(r,"send",()=>w(r,(k,p)=>k.submitCheck(r,m,{idempotencyKey:p}),()=>{l[r]=e.now(),m[h]!==void 0&&(g[r]=m[h])}))},N=(t,o)=>lt.test(o)?P(t,"verify",()=>w(t,(r,d)=>r.submitCheck(t,{action:"verify",code:o},{idempotencyKey:d}))):Promise.reject(new O("code","format")),G=(t,o)=>P("eid_auth",t,()=>w("eid_auth",(r,d)=>r.submitCheck("eid_auth",o,{idempotencyKey:d}))),Q=(t,o)=>{if(t.identifierBound)return G("start",{action:"start"});let r=se(o??"");if(t.country==="MR"){if(!/^\d{10}$/.test(r))return Promise.reject(new O("nni","format"));if(!re(r))return Promise.reject(new O("nni","check_digit"))}else if(r==="")return Promise.reject(new O("nni","format"));return G("start",{action:"start",identifier:r})},F=t=>{switch(t.kind){case"phone_otp":case"email_otp":{let o={...t,send:(d={})=>V(t,d),verify:d=>N(t.kind,d),switchTo:()=>t.canSwitch&&t.switchChannel!==void 0?C([t.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option"))},r=l[t.kind];return o.resendAvailableAt===void 0&&r!==void 0&&(o.resendAvailableAt=new Date(r+at).toISOString()),o}case"eid":return{...t,start:o=>Q(t,o),verify:o=>dt.test(o)?G("verify",{action:"verify",code:o}):Promise.reject(new O("code","format")),resend:()=>t.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):G("resend",{action:"resend"}),useCamera:()=>t.canUseCamera&&t.cameraMethod!==void 0?C(t.cameraMethod==="document_photo"?["document"]:["population_registry"],"camera path"):Promise.reject(new RangeError("the camera path is not offered"))};case"method":return{...t,select:o=>{let r=t.choice.options.find(d=>j[d.service]===o);return r!==void 0?E(t.choice,r.id):Promise.reject(new RangeError(`method ${String(o)} is not offered`))},choose:o=>E(t.choice,o)};case"choice":return{...t,choose:o=>E(t.choice,o)};case"registry":return{...t,submitNni:o=>{if(t.source!=="typed")return Promise.reject(new RangeError("this session already holds the NNI"));let r=se(o);return/^\d{10}$/.test(r)?re(r)?P("population_registry","submitNni",()=>w("population_registry",(d,h)=>d.submitCheck("population_registry",{nni:r},{idempotencyKey:h}),()=>{f=`\u2022\u2022\u2022\u2022\u2022\u2022${r.slice(-4)}`})):Promise.reject(new O("nni","check_digit")):Promise.reject(new O("nni","format"))},confirm:()=>P("population_registry","confirm",()=>w("population_registry",(o,r)=>o.submitCheck("population_registry",{},{idempotencyKey:r}))),useDocument:()=>t.canUseDocument?C(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered"))};case"document":return e.bindDocument!==void 0?e.bindDocument(t,H):{...t,issuer:null,documentType:null,captureSide:null,selectDocument:()=>{throw new Error("document capture is not available in this build")},capture:()=>{throw new Error("document capture is not available in this build")}};case"portrait":return e.bindPortrait!==void 0?e.bindPortrait(t,H):{...t,uploadFailed:!1,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("portrait capture is not available in this build")}};case"contact_choice":return{...t,select:o=>{let r=o==="phone"?"phone_otp":o==="email"?"email_otp":void 0,d=t.choice.options.find(h=>h.service===r);return d!==void 0?E(t.choice,d.id):Promise.reject(new RangeError(`contact ${String(o)} is not offered`))},choose:o=>E(t.choice,o)};case"identity_summary":return{...t,...t.nniMasked===void 0&&t.summaryKind==="partial"&&f!==null?{nniMasked:f}:{},portrait:async()=>{let o=e.runtime.client;if(!t.portraitAvailable||o.identityPortrait===void 0)return null;try{return await o.identityPortrait()}catch{return null}},confirm:()=>B("confirm"),retake:()=>t.retakeAvailable?B("retake"):Promise.reject(new RangeError("no retake is left"))};case"liveness":return{...t,capture:o=>e.liveness(o),onLivePhoto:o=>t.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(o):()=>{}};case"mobile_required":case"processing":return{...t,refresh:async()=>{a=!1,await e.refreshView()}};case"unsupported":case"result":return{...t};default:{let o=t;throw new Error(`runner: unhandled step ${JSON.stringify(o)}`)}}},Z=async()=>{if(!c){c=!0;try{for(let t of st){if(await e.sleep(t),!n||e.destroyed())return;let o=await e.refreshView().catch(()=>null);if(o!==null&&W(o,{isMobile:e.isMobile()}).kind!=="processing")return}a=!0,H()}finally{c=!1}}},J=t=>{if(t.kind!=="liveness"||t.mode!=="selfie")return null;let o={kind:"processing",key:"processing",context:t.context,section:t.section,stalled:!1};if(y==="inflight")return o;if(!S||y==="done")return null;let r=e.keptFaceKey?.()??null;return r===null?null:(y="inflight",w("face_match",(d,h)=>d.submitCheck("face_match",{imageKey:r},{idempotencyKey:h}),()=>{y="done"}).then(()=>{y==="inflight"&&(y="done",H())},()=>{y="done",H()}),o)},L=(t,o=!1)=>{if(!n||e.destroyed()||e.chainBusy())return;let r=W(t,{isMobile:e.isMobile()});r.kind==="registry"&&r.recheck&&(S=!0,y="idle"),r=J(r)??r,r.kind==="processing"?r.stalled=a:a=!1;let d=F(r),h=r.kind==="result"?void 0:r.context.switchable,m=h===void 0?d:{...d,chooseOption:p=>E({nodeId:h.nodeId,kind:h.kind,selected:h.current,options:h.options},p)},k=JSON.stringify(m);r.kind==="registry"&&r.source==="document"&&r.state==="pending"&&!v.has("registry")&&(v.add("registry"),m.confirm().catch(p=>{(!(p instanceof K)||pt.has(p.code))&&v.delete("registry")})),!(!o&&k===s)&&(s=k,i=m,e.emitStep(m),r.kind==="processing"&&!a&&y!=="inflight"&&Z(),r.kind==="result"&&!u&&(u=!0,e.emitResult(r.result)))};function H(){let t=e.currentView();t!==null&&L(t,!0)}return{run:async()=>{if(e.destroyed())throw new Error("verification destroyed");n=!0;let t=await e.ensureView();return i===null&&L(t),i??F(W(t,{isMobile:e.isMobile()}))},current:()=>i,onView:t=>L(t),onChainIdle:()=>{let t=e.currentView();t!==null&&L(t)},republish:H,submit:w}}export{Ve as a,ht as b,be as c,Pe as d,vt as e,W as f,st as g,at as h,Mt as i};
@@ -1 +0,0 @@
1
- import{c as b,d as x}from"./chunk-MUVEJRGK.js";var q=new Set(["no_face","media_unreadable","clip_too_short","no_face_source","side_missing","unreadable","registry_unavailable","otp_mismatch","otp_expired","otp_send_failed","document_type_not_accepted","age_unverifiable","nationality_unreadable","liveness_inconclusive","match_inconclusive","document_authenticity","probe_not_from_liveness","capture_back_camera","capture_not_upright","chip_read_failed","chip_access_denied","chip_parse_failed","icao_pose","icao_eyes","icao_mouth","icao_occlusion","icao_lighting","icao_background","icao_resolution","portrait_not_from_liveness","nni_recheck","device_integrity_failed","eid_identifier_invalid","eid_code_invalid","eid_code_expired","eid_unavailable","eid_resend_too_soon"]),U={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function f(e){return e.plan?.steps??[]}function M(e){return Math.max(0,e.attempts.max-e.attempts.used)}function Y(e){let t=e.plan?.choice;return t!==void 0&&e.plan?.current===t.nodeId?t:null}function pe(e){let t=Y(e);if(t?.kind!=="identity_method")return null;let n=t.options.map(o=>U[o.service]).filter(o=>o!==void 0),i=t.options.find(o=>o.nationalEid)?.nationalEid;return i?{available:!0,selected:null,options:n,nationalEid:i}:{available:!0,selected:null,options:n}}var D=new Set(["liveness","face_match"]);function v(e){return e!==void 0&&(e.state==="pending"||e.state==="input_required")}function A(e){return e.status!=="created"&&e.status!=="in_progress"}function P(e){let t=e.plan?.current,n=t==null?void 0:f(e).find(i=>i.id===t);return v(n)?n:void 0}function S(e,t){return f(e).find(n=>n.checkType===t)}function y(e){let t=f(e),n=t.findIndex(i=>i.checkType==="liveness");return t.find((i,o)=>o>n&&i.checkType==="face_match")}function H(e,t){let n=S(t,"liveness")?.state,i=y(t)?.state;return(y(e)?.state??"pending")==="pending"&&(n==="passed"||n==="review")&&i!==void 0&&i!=="pending"&&i!=="skipped"}function V(e,t){let n=new Map(f(e).map(i=>[i.id,i.state]));return f(t).filter(i=>i.checkType==="face_match"&&(n.get(i.id)??"pending")==="pending"&&i.state!=="pending"&&i.state!=="skipped").map(i=>i.id)}function k(e,t){return t===void 0?{sessionId:e,status:"unavailable"}:{sessionId:e,status:"unavailable",reason:t}}function _(e,t,n){return n===void 0?{sessionId:e,status:t}:{sessionId:e,status:t,reason:n}}function me(e,t){let{sessionId:n}=e;switch(e.status){case"completed":case"failed":case"review_pending":return j(e,$(e));case"expired":return k(n);case"created":case"in_progress":break;default:{let i=e.status;throw new Error(`mapSessionResult: unhandled status ${i}`)}}return X(e,t)}var B=new Set([0,1,2,3]);function j(e,t){return B.has(e.level)&&(t.level=e.level),typeof e.assurance=="string"&&e.assurance.length>0&&(t.assurance=e.assurance),typeof e.subjectId=="string"&&e.subjectId.length>0&&(t.subjectId=e.subjectId),t}function $(e){let{sessionId:t}=e;switch(e.status){case"completed":return e.outcome==="approved"?{sessionId:t,status:"approved"}:e.outcome==="review"?_(t,"review",h(e,"review")):_(t,"rejected",h(e,"failed"));case"failed":{let n=_(t,"rejected",e.failureReason??h(e,"failed"));return e.failureReason==="device_cooldown"&&e.retryAfter!==void 0&&(n.retryAfter=e.retryAfter),n}default:return _(t,"review",h(e,"review"))}}function z(e,t){if(t===void 0)return!1;let n=f(t).find(i=>i.id===e.id);return n!==void 0&&n.attempts.used===e.attempts.used}function X(e,t){let{sessionId:n}=e,i=f(e).find(s=>D.has(s.checkType)&&s.state==="input_required"&&s.reason!==void 0);if(i?.reason==="mobile_required")return k(n,"mobile_required");if(i?.reason!==void 0){let s=t.autoRetry&&M(i)>0&&(q.has(i.reason)||z(i,t.previous)),c={sessionId:n,status:s?"retry":"rejected",reason:i.reason,attemptsRemaining:M(i)};return i.retakeHint!==void 0&&(c.retakeHint=i.retakeHint),c}let o=P(e);return o===void 0&&f(e).some(s=>s.state==="review")?_(n,"review",h(e,"review")):o?.checkType==="portrait_icao"?k(n,"portrait_required"):k(n)}function h(e,t){let n=f(e).filter(i=>i.state===t&&i.reason!==void 0);return n[t==="failed"?n.length-1:0]?.reason}function I(e,t,n,i,o){return e.presignCapture!==void 0?e.presignCapture(t,n,i,o):e.presign(t,n,i)}function L(e){return{engine:e?.engine,durationMs:e?.clipMs}}var W=["video/webm","video/mp4"],T="image/jpeg",G=2,J=1e3,Q=1e4,Z=3,ee=10,te=30,ne=3,ie=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),oe=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","check_not_active","step_not_on_path"]),g=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}};function se(e){let t=y(e);return S(e,"portrait_icao")?.state!=="pending"&&(t!==void 0?v(t):e.capture?.livePhoto?.oneCapture===!0)}var w=class extends Error{constructor(t){super(t),this.name="AttestationError"}};async function F(e,t,n={}){let i=e.uuid(),o=!1,s=!1,c=0,u=0;for(;;)try{return await t(e.client,i)}catch(r){if(r instanceof w){if(s)throw r;s=!0,n.onAttestationInvalid?.(),i=e.uuid();continue}if(!(r instanceof b))throw r;if(r.code==="consent_required"&&!o){o=!0,await e.ensureConsent({force:!0}),i=e.uuid();continue}if(r.code==="attestation_invalid"&&!s){s=!0,n.onAttestationInvalid?.(),i=e.uuid();continue}if(r.code==="inference_unavailable"&&u<Z){u+=1;let a=Math.min(r.retryAfterSeconds??ee,te);e.onBusy?.({attempt:u,retryAfterSeconds:a}),await e.sleep(a*1e3),n.onAttestationInvalid?.(),i=e.uuid();continue}if(ie.has(r.code)&&c<G){c+=1;let a=r.retryAfterSeconds!==void 0?r.retryAfterSeconds*1e3:void 0;await e.sleep(a!==void 0?Math.min(a,Q):J);continue}throw r}}var re=new Set(["passed","review","processing","skipped"]);async function ge(e){let{artifacts:t}=e,n=t.clip,i=x(t.clipMime??"");if(t.degraded==="NO_RECORDER"||n===void 0||!W.includes(i))return{kind:"unavailable",reason:"no_recorder"};e.client.armCapture?.(2);let o=ae(e,t.keyframe),s=ce(e,n,i,o),c=ue(e,o),u=!1,r=new Set,a=!0,m=0;for(;;){if(e.isCancelled())return{kind:"cancelled"};let l=e.getView();if(A(l))return{kind:"settled"};let R=P(l),E=R?.checkType,C=E==="liveness"&&!u?"liveness":E==="face_match"&&!r.has(R?.id)&&r.size<2&&a?"face_match":null;if(C===null)return{kind:"settled"};if(C==="liveness"&&t.captureChannel==="desktop"&&S(l,"liveness")?.requiresMobile===!0)return{kind:"unavailable",reason:"mobile_required"};try{if(C==="liveness"){u=!0;let d=await s();if(e.isCancelled())return{kind:"cancelled"};H(l,d)&&r.add(y(d)?.id);for(let N of V(l,d))r.add(N);await e.applySubmit(d,"liveness");let p=S(e.getView(),"liveness")?.state;a=p===void 0||re.has(p)}else{r.add(R?.id);let d=await c();if(e.isCancelled())return{kind:"cancelled"};for(let p of V(l,d))r.add(p);await e.applySubmit(d,"face_match")}}catch(d){if(e.isCancelled()||d instanceof g)return{kind:"cancelled"};let p=fe(d);if(p.kind!=="resync"||m>=ne)return p;m+=1,await e.refreshView()}}}function ae(e,t){let n=null,i=null,o=()=>n!==null?Promise.resolve(n):(i??(i=(async()=>{let s=await I(e.client,"image",T,t.size,L(e.artifacts));return await e.client.uploadToSpaces(s.uploadUrl,t,T),n=(await e.client.completeMedia(s.key)).key,e.onKeyframePromoted?.(n),n})().finally(()=>{i=null})),i);return{ensure:o,attempt:()=>o().catch(()=>null),current:()=>n}}function ce(e,t,n,i){let o=null,s,c=null;return()=>F(e,async(u,r)=>{if(o===null||s===void 0){if(e.isCancelled())throw new g;s===void 0&&!se(e.getView())&&(s=null),e.onPhase("uploading");let[a,m]=await Promise.all([o!==null?Promise.resolve(o):(async()=>{let l=await I(u,"clip",n,t.size,L(e.artifacts));return await u.uploadToSpaces(l.uploadUrl,t,n),(await u.completeMedia(l.key)).key})(),s!==void 0?Promise.resolve(s===null?null:s.imageKey):i.attempt()]);o=a,s===void 0&&(s=m===null?null:{imageKey:m})}if(c===null)try{c=await e.getAttestation()}catch(a){throw new w(a instanceof Error?a.message:String(a))}return e.onPhase("checking"),u.submitCheck("liveness",{clipKey:o,attestation:c,captureChannel:e.artifacts.captureChannel,capture:de(e.artifacts),...s!==null?{faceMatch:s}:{}},{idempotencyKey:r})},{onAttestationInvalid:()=>{c=null}})}function ue(e,t){return()=>F(e,async(n,i)=>{if(t.current()===null){if(e.isCancelled())throw new g;e.onPhase("uploading")}let o=await t.ensure();return e.onPhase("checking"),n.submitCheck("face_match",{imageKey:o},{idempotencyKey:i})})}function de(e){let t={width:e.width,height:e.height};for(let n of le)e[n]!==void 0&&(t[n]=e[n]);return t}var le=["engine","facingMode","mode","formFactor","clipMs","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function fe(e){if(e instanceof w)return{kind:"unavailable",reason:"attestation"};if(e instanceof b){if(e.code==="attestation_invalid")return{kind:"unavailable",reason:"attestation"};if(e.code==="inference_unavailable")return{kind:"unavailable",reason:"inference_unavailable"};if(e.code==="mobile_required")return{kind:"unavailable",reason:"mobile_required"};if(oe.has(e.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}var O=class extends Error{constructor(t,n){super(`invalid ${t} (${n})`),this.name="InvalidInputError",this.field=t,this.kind=n}},K=class extends Error{constructor(t,n){super(`invalid ${t} (${n})`),this.name="OtpInputError",this.field=t,this.kind=n}};function Re(e){let t=e?.capture;return t?.mode==="assisted"||t?.mode==="self"?t.mode:t?.cameraSwitch===!0?"assisted":"self"}export{Re as a,q as b,U as c,f as d,M as e,Y as f,pe as g,v as h,A as i,P as j,S as k,k as l,me as m,I as n,W as o,G as p,J as q,Z as r,ee as s,w as t,F as u,ge as v,O as w,K as x};
@@ -1 +0,0 @@
1
- import{a as p}from"./chunk-4IVRXJR2.js";var _=["session_token_invalid","session_token_required","session_token_session_mismatch","session_not_found","rate_limit_exceeded","consent_required","session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_type_unsupported","force_outcome_forbidden","attestation_invalid","platform_unregistered","app_attest_invalid","too_many_challenges","inference_unavailable","mobile_required","nni_locked","document_nni_mismatch","media_content_type_not_allowed","media_too_large","media_key_invalid","media_key_forbidden","media_not_found","media_unreadable","media_session_invalid","idempotency_key_collision","idempotency_in_progress","idempotency_key_required","validation_error","internal_error","unknown_error","upload_failed","network_error","timeout","nfc_outcome_not_accepted","identity_confirm_required","identity_confirm_locked","choice_not_found","choice_locked","choice_option_unavailable","step_not_on_path","check_not_active","sekyro_app_not_allowed","sekyro_app_unverified"];function v(s){return _.includes(s)}var d=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}};var g=6e4,m=4,b=3e4,T=9e5,w=200,k=5,S=400;function l(s){return(s.split(";")[0]??"").trim()}var P={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},f=class{constructor(e){this.sessionId=null;this.bootstrap=null;this.captureNonces=[];this.captureFetch=null;this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let n=e.fetch;this.fetchImpl=(t,i)=>(n??globalThis.fetch).call(globalThis,t,i),this.requestTimeoutMs=e.requestTimeoutMs??b,this.retryAttempts=e.inProgressRetry?.attempts??k,this.retryDelayMs=e.inProgressRetry?.delayMs??S}async getSession(){let e=await this.api("GET","/hosted/session");return this.sessionId=e.sessionId,e}async recordConsent(e){return this.api("POST","/hosted/consent",{body:{locale:e}})}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async choose(e,n){let t=await this.api("POST","/hosted/choice",{body:{nodeId:e,option:n}});return this.sessionId=t.sessionId,t}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,n,t){let i=await this.ensureSessionId(),o={kind:e,contentType:l(n),contentLength:t};return this.api("POST",`/sessions/${i}/media`,{body:o})}armCapture(e=2){this.fillCaptureNonces(e)}async presignCapture(e,n,t,i={}){let o=await this.ensureSessionId(),r=await this.takeCaptureNonce(),c=r===void 0?void 0:{nonce:r,...i.engine!==void 0?{engine:i.engine.slice(0,32)}:{},...i.durationMs!==void 0&&Number.isFinite(i.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(i.durationMs)))}:{}},a={kind:e,contentType:l(n),contentLength:t,capture:c};return this.api("POST",`/sessions/${o}/media`,{body:a})}async takeCaptureNonce(){let e=()=>{let n=Date.now();return this.captureNonces=this.captureNonces.filter(t=>t.expiresAt-g>n),this.captureNonces.shift()?.nonce};for(let n=0;n<2;n++){let t=e();if(t!==void 0)return t;await this.fillCaptureNonces(1)}return e()}fillCaptureNonces(e){return this.captureFetch??(this.captureFetch=(async()=>{try{let n=await this.ensureSessionId(),t=await this.api("POST",`/sessions/${n}/media/capture-nonces`,{body:{count:Math.min(m,Math.max(1,e))}}),i=Date.now()+Math.max(0,t.expiresIn)*1e3;for(let o of Array.isArray(t.nonces)?t.nonces:[])typeof o=="string"&&o.length>0&&this.captureNonces.push({nonce:o,expiresAt:i});this.captureNonces=this.captureNonces.slice(-m)}catch{}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,n,t){let i;try{i=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":l(t)},body:n,signal:AbortSignal.timeout(T)})}catch(o){throw y(o)}if(!i.ok){let o=(await i.text().catch(()=>"")).slice(0,w);throw new d({status:i.status,code:"upload_failed",message:`media upload failed (HTTP ${i.status})${o?`: ${o}`:""}`})}}async completeMedia(e){let n=await this.ensureSessionId();return this.api("POST",`/sessions/${n}/media/complete`,{body:{key:e}})}async submitCheck(e,n,t={}){let i=await this.ensureSessionId(),o={input:n,forceOutcome:t.forceOutcome};return this.api("POST",`/sessions/${i}/checks/${e}`,{body:o,idempotencyKey:t.idempotencyKey})}async uploadAndSubmit(e,n,t,i={}){let o=l(n.contentType),r=await this.presign(n.kind,o,n.blob.size);await this.uploadToSpaces(r.uploadUrl,n.blob,o);let c=await this.completeMedia(r.key),a={...t,[P[e]]:c.key};return this.submitCheck(e,a,i)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,n,t={}){let i=`${this.apiOrigin}/api/v2${n}`,o={"x-session-token":this.sessionToken};t.body!==void 0&&(o["content-type"]="application/json"),t.idempotencyKey!==void 0&&(o["x-idempotency-key"]=t.idempotencyKey);try{let r=p.timezone();r!==void 0&&(o["sekyro-client-timezone"]=r)}catch{}try{let r=await p.deviceHeader();r!==void 0&&(o["sekyro-client-device"]=r)}catch{}for(let r=0;;r++){let c;try{c=await this.fetchImpl(i,{method:e,headers:o,...t.body!==void 0?{body:JSON.stringify(t.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(u){throw y(u)}if(c.ok){if(t.blob===!0)try{return await c.blob()}catch(h){throw y(h)}let u;try{u=await c.json()}catch{throw new d({status:c.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${c.status})`})}return C(u)}let a=await I(c);if(a.code==="idempotency_in_progress"&&r<this.retryAttempts){this.retryDelayMs>0&&await M(this.retryDelayMs);continue}throw a}}};function y(s){if((typeof s=="object"&&s!==null?s.name:void 0)==="TimeoutError")return new d({status:0,code:"timeout",message:"request timed out"});let n=s instanceof Error?s.message:String(s);return new d({status:0,code:"network_error",message:`network request failed: ${n}`})}function C(s){return s!==null&&typeof s=="object"&&"success"in s&&"data"in s?s.data:s}async function I(s){let e="unknown_error",n=`request failed (HTTP ${s.status})`,t=Number.NaN,i;try{let c=await s.json();if(c!==null&&typeof c=="object"){let a=c;typeof a.code=="string"&&a.code.length>0&&(e=a.code),typeof a.message=="string"&&a.message.length>0&&(n=a.message),typeof a.retryAfterSeconds=="number"&&(t=a.retryAfterSeconds),Array.isArray(a.details?.issues)&&(i=a.details)}}catch{}let o=s.headers.get("retry-after"),r=o===null?Math.floor(t):Number.parseInt(o,10);return new d({status:s.status,code:e,message:n,...Number.isFinite(r)&&r>=0?{retryAfterSeconds:r}:{},details:i})}function M(s){return new Promise(e=>setTimeout(e,s))}function N(s){let e=s?.portrait,n=e?.icao,t=e?.purpose==="id_document";return n==null?t?{policy:"reject",profile:"id_document"}:null:{policy:n.policy==="alert"&&!t?"alert":"reject",profile:t||n.profile==="id_document"?"id_document":"selfie"}}function H(s){return{...s.baselineEyeOpenness!==void 0?{baselineEyeOpenness:s.baselineEyeOpenness}:{},criteria:s.verdict??{},...s.backgroundCheck!==void 0?{backgroundCheck:s.backgroundCheck}:{}}}export{_ as a,v as b,d as c,l as d,f as e,N as f,H as g};