@sekyro/web 0.1.0-rc.17 → 0.1.0-rc.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -2
- package/dist/{capture-session-doc-TATPATSZ.js → capture-session-doc-VXWWQEP4.js} +1 -1
- package/dist/{capture-session-v3-Dxus1Se9.d.ts → capture-session-v3-CFSVWYzi.d.ts} +13 -2
- package/dist/{capture-session-v3-DyUA2uCL.d.cts → capture-session-v3-Cs4yV3HJ.d.cts} +13 -2
- package/dist/chunk-4GJXUVZK.js +1 -0
- package/dist/chunk-5Y3UST3W.js +1 -0
- package/dist/chunk-64V55KD7.js +1 -0
- package/dist/chunk-6K4D3U6Q.js +1 -0
- package/dist/chunk-CQ7SKLMC.js +1 -0
- package/dist/{chunk-TWB4LTCE.js → chunk-JUEOHNVW.js} +1 -1
- package/dist/chunk-L45YTRJJ.js +1 -0
- package/dist/chunk-PLH6ZR6J.js +1 -0
- package/dist/chunk-RNJA5GDF.js +1 -0
- package/dist/chunk-ZO6IHP2I.js +1 -0
- package/dist/chunk-ZPXL26BF.js +1 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -1
- package/dist/create-document-capture-FVSQPUF6.js +1 -0
- package/dist/create-portrait-capture-INDCF65X.js +1 -0
- package/dist/{create-verification-CIwl0NIg.d.cts → create-verification-1BrMZqPJ.d.cts} +82 -16
- package/dist/{create-verification-CNCMU1kK.d.ts → create-verification-CuoYJ3kj.d.ts} +82 -16
- package/dist/{icao-gate-5FzqyitT.d.ts → icao-gate-BSbyqLUh.d.ts} +25 -9
- package/dist/{icao-gate-C-lfjEpH.d.cts → icao-gate-D-wePfoV.d.cts} +25 -9
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +1 -1
- package/dist/internal/index.d.cts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +1 -1
- package/dist/plan-runner-WEUIMCYU.js +1 -0
- package/dist/{types-CKgMWVnP.d.cts → types-DPl0hsmI.d.cts} +29 -5
- package/dist/{types-CKgMWVnP.d.ts → types-DPl0hsmI.d.ts} +29 -5
- package/package.json +1 -1
- package/sbom.cdx.json +7 -7
- package/dist/chunk-2BFYVMUU.js +0 -1
- package/dist/chunk-3SL74TFR.js +0 -1
- package/dist/chunk-4RS4LP7D.js +0 -1
- package/dist/chunk-G6MU3B5V.js +0 -1
- package/dist/chunk-GYNWLJYW.js +0 -1
- package/dist/chunk-J4NL62VQ.js +0 -1
- package/dist/chunk-MMTOOH32.js +0 -1
- package/dist/chunk-QBPD7FRF.js +0 -1
- package/dist/chunk-SDWHJJ4W.js +0 -1
- package/dist/chunk-ULMH32G5.js +0 -1
- package/dist/create-document-capture-5FJI57YI.js +0 -1
- package/dist/create-portrait-capture-53XBURNT.js +0 -1
- package/dist/plan-runner-WRY4FOWW.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { b0 as DocCatalogEntry, b1 as LiveMrzTuning, b2 as TextLockTuning, b3 as OcrEngineClient, b4 as DocAssistReport, b5 as ReadyInfo, b6 as LoadFailure, b7 as OcrEngineOptions, b8 as SubmitRuntime, a3 as LivenessCaptureOptions, a2 as LivenessCaptureHandle, aL as VerificationStep, aJ as VerificationResult, aA as StepSnapshot, _ as LivePhotoGateUpdate, b9 as HostedClientLike } from '../create-verification-1BrMZqPJ.cjs';
|
|
2
|
+
export { ba as ANALYSIS_LONG_EDGE, bb as ASPECT_BANDS, bc as AttestationError, bd as BLUR_REFUSE_SHARPNESS_MAX, be as BlurStatus, bf as CAPTURE_CANDIDATE_SPACING_MS, bg as CAPTURE_EXTRA_CANDIDATES, bh as CLIP_MIME_ALLOWLIST, bi as CaptureEngine, bj as CaptureSessionDoc, bk as CaptureSessionDocEvents, bl as CaptureSessionDocOptions, bm as DOC_ANALYSIS_DEFAULTS, bn as DOC_BLACK_FRAME_LUMA, bo as DOC_BLACK_FRAME_TICKS, bp as DOC_CADENCE_HZ, bq as DOC_CAMERA_TUNING_DEFAULTS, br as DOC_CATALOG, bs as DOC_DETECT_WIDTH, bt as DOC_FEEDBACK_STATES, bu as DOC_FIRST_FRAME_MS, bv as DOC_GATE_V1_DEFAULTS, bw as DOC_SHUTTER_DEFAULTS, bx as DeviceReadHint, by as DocArtifacts, bz as DocAssist, bA as DocAssistEngine, bB as DocAssistTick, bC as DocCameraTuning, bD as DocCaptureReport, bE as DocCaptureVia, bF as DocChecksPayload, bG as DocEngineLike, bH as DocFeedbackAggregator, bI as DocFeedbackKey, bJ as DocFeedbackState, bK as DocFormat, bL as DocFrameAnalysis, bM as DocFrameMeasures, bN as DocGateQuality, bO as DocGateThresholds, bP as DocGateTick, bQ as DocGateTickInput, bR as DocGateV1, bS as DocQuad, bT as DocQuadPoint, bU as DocShutterReason, bV as DocShutterTuning, bW as DocSide, bX as DocumentCaptureController, bY as DocumentCaptureInternals, bZ as EMPTY_GUIDE_METRICS, b_ as EncodedDocument, b$ as FLIP_FILL_MIN, c0 as FLIP_GAP_MS, c1 as FLIP_TIMEOUT_MS, c2 as FocusCaps, c3 as FramingStatus, c4 as GUIDE_LOCK_DEFAULTS, c5 as GlareStatus, c6 as GrabbedFrame, c7 as GuideBlocker, c8 as GuideLock, c9 as GuideLockTick, ca as GuideLockTuning, cb as GuideMetrics, cc as GuideRect, cd as INFERENCE_RETRY_ATTEMPTS, ce as INFERENCE_RETRY_DEFAULT_S, W as ISSUER_CODES, cf as LANDMARKER_MODEL, cg as LENS_STORAGE_KEY, ch as LENS_TRY_MAX, ci as LIVE_MRZ_DEFAULTS, cj as LIVE_PHOTO_IDLE_MS, ck as LIVE_PHOTO_MAX_HZ, cl as LandmarkedFace, cm as LandmarkerLike, cn as LensKind, co as LensSource, cp as LightingStatus, cq as LiveMrzCapture, cr as LiveMrzState, cs as LivePhotoGate, ct as LivePhotoKit, cu as LivePhotoKitInternals, cv as LivePhotoKitOptions, cw as LivePhotoStill, cx as LivenessCaptureInternalHandle, cy as LivenessCaptureInternals, cz as LivenessFlowDeps, cA as LivenessFlowOutcome, cB as MANUAL_SHUTTER_MS, cC as MR_DOC_CATALOG, cD as NO_REPORT_MS, cE as OpenDocCameraDeps, cF as PORTRAIT_JPEG_QUALITY, cG as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cH as PRELOAD_BUDGET_MS, cI as PROCESSING_POLL_DELAY_MS, cJ as PROCESSING_POLL_MAX, cK as PortraitCaptureController, cL as PortraitCaptureInternals, cM as REGISTRY_RETRY_DELAY_MS, cN as ReticleType, cO as SAME_FACE_MAX_DROPS, cP as ScanEvent, cQ as ScanLayout, cR as ScanNotice, cS as ScanPhase, cT as ScanReport, cU as ScanSide, cV as ScanState, cW as SubmitExecutor, cX as TEXT_LOCK_DEFAULTS, cY as TRANSPORT_REPLAY_ATTEMPTS, cZ as TRANSPORT_REPLAY_DELAY_MS, c_ as VerificationInternals, c$ as analyzeDocFrame, d0 as analyzeGuide, d1 as aspectBand, d2 as aspectFits, d3 as buildDeviceReadHint, d4 as coverPointToVideo, d5 as createDocumentCaptureInternal, d6 as createFaceLandmarker, d7 as createLivePhotoKit, d8 as createLivenessCaptureInternal, d9 as createPortraitCaptureInternal, da as createVerificationInternal, db as docZoomFor, dc as encodeDocumentImage, dd as facesOf, de as feedbackVoteOf, df as focusOk, dg as guideQuad, dh as guideRegionInFrame, di as initialScanState, dj as lensKindOf, dk as mapEngineState, dl as mapErrorKind, dm as mapGuidanceHint, dn as nextScanState, dp as observePortraitFrame, dq as openDocCamera, dr as passportBandOf, ds as portraitMatchStep, dt as preloadedDetectorFactory, du as quadAreaFrac, dv as quadBounds, dw as quadIou, dx as quadTiltRatio, dy as randomUuid, dz as rankBackCameras, dA as readStoredLens, dB as resetLivenessAssetsForTests, dC as resolveDocCameraTuning, dD as resolveDocShutterTuning, dE as resolveGuideLockTuning, dF as runLivenessFlow, dG as runSubmission, dH as scannerFormatFor, dI as setPreloadLoaderForTests, dJ as settledHint, dK as singleShotFocusAt, dL as specularFraction, dM as supportsFocusMode, dN as warmDocDetector, dO as writeStoredLens } from '../create-verification-1BrMZqPJ.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,
|
|
5
|
-
export {
|
|
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-
|
|
4
|
+
import { H as HostedSessionView, f as CheckType, l as CheckReason, ah as PlanStepView } from '../types-DPl0hsmI.cjs';
|
|
5
|
+
export { ax as ICAO_FALLBACK, Z as IcaoCaptureTuning, ay as IcaoProfile, R as ResolvedIcaoTuning, az as resolveIcaoTuning } from '../types-DPl0hsmI.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-D-wePfoV.cjs';
|
|
7
7
|
import '../detect-worker-DclNxkZT.cjs';
|
|
8
|
-
import '../capture-session-v3-
|
|
8
|
+
import '../capture-session-v3-Cs4yV3HJ.cjs';
|
|
9
9
|
|
|
10
10
|
type DocumentTypeId = DocCatalogEntry["docType"];
|
|
11
11
|
/** Same shape as the hosted view's `acceptedDocuments`. */
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { b0 as DocCatalogEntry, b1 as LiveMrzTuning, b2 as TextLockTuning, b3 as OcrEngineClient, b4 as DocAssistReport, b5 as ReadyInfo, b6 as LoadFailure, b7 as OcrEngineOptions, b8 as SubmitRuntime, a3 as LivenessCaptureOptions, a2 as LivenessCaptureHandle, aL as VerificationStep, aJ as VerificationResult, aA as StepSnapshot, _ as LivePhotoGateUpdate, b9 as HostedClientLike } from '../create-verification-CuoYJ3kj.js';
|
|
2
|
+
export { ba as ANALYSIS_LONG_EDGE, bb as ASPECT_BANDS, bc as AttestationError, bd as BLUR_REFUSE_SHARPNESS_MAX, be as BlurStatus, bf as CAPTURE_CANDIDATE_SPACING_MS, bg as CAPTURE_EXTRA_CANDIDATES, bh as CLIP_MIME_ALLOWLIST, bi as CaptureEngine, bj as CaptureSessionDoc, bk as CaptureSessionDocEvents, bl as CaptureSessionDocOptions, bm as DOC_ANALYSIS_DEFAULTS, bn as DOC_BLACK_FRAME_LUMA, bo as DOC_BLACK_FRAME_TICKS, bp as DOC_CADENCE_HZ, bq as DOC_CAMERA_TUNING_DEFAULTS, br as DOC_CATALOG, bs as DOC_DETECT_WIDTH, bt as DOC_FEEDBACK_STATES, bu as DOC_FIRST_FRAME_MS, bv as DOC_GATE_V1_DEFAULTS, bw as DOC_SHUTTER_DEFAULTS, bx as DeviceReadHint, by as DocArtifacts, bz as DocAssist, bA as DocAssistEngine, bB as DocAssistTick, bC as DocCameraTuning, bD as DocCaptureReport, bE as DocCaptureVia, bF as DocChecksPayload, bG as DocEngineLike, bH as DocFeedbackAggregator, bI as DocFeedbackKey, bJ as DocFeedbackState, bK as DocFormat, bL as DocFrameAnalysis, bM as DocFrameMeasures, bN as DocGateQuality, bO as DocGateThresholds, bP as DocGateTick, bQ as DocGateTickInput, bR as DocGateV1, bS as DocQuad, bT as DocQuadPoint, bU as DocShutterReason, bV as DocShutterTuning, bW as DocSide, bX as DocumentCaptureController, bY as DocumentCaptureInternals, bZ as EMPTY_GUIDE_METRICS, b_ as EncodedDocument, b$ as FLIP_FILL_MIN, c0 as FLIP_GAP_MS, c1 as FLIP_TIMEOUT_MS, c2 as FocusCaps, c3 as FramingStatus, c4 as GUIDE_LOCK_DEFAULTS, c5 as GlareStatus, c6 as GrabbedFrame, c7 as GuideBlocker, c8 as GuideLock, c9 as GuideLockTick, ca as GuideLockTuning, cb as GuideMetrics, cc as GuideRect, cd as INFERENCE_RETRY_ATTEMPTS, ce as INFERENCE_RETRY_DEFAULT_S, W as ISSUER_CODES, cf as LANDMARKER_MODEL, cg as LENS_STORAGE_KEY, ch as LENS_TRY_MAX, ci as LIVE_MRZ_DEFAULTS, cj as LIVE_PHOTO_IDLE_MS, ck as LIVE_PHOTO_MAX_HZ, cl as LandmarkedFace, cm as LandmarkerLike, cn as LensKind, co as LensSource, cp as LightingStatus, cq as LiveMrzCapture, cr as LiveMrzState, cs as LivePhotoGate, ct as LivePhotoKit, cu as LivePhotoKitInternals, cv as LivePhotoKitOptions, cw as LivePhotoStill, cx as LivenessCaptureInternalHandle, cy as LivenessCaptureInternals, cz as LivenessFlowDeps, cA as LivenessFlowOutcome, cB as MANUAL_SHUTTER_MS, cC as MR_DOC_CATALOG, cD as NO_REPORT_MS, cE as OpenDocCameraDeps, cF as PORTRAIT_JPEG_QUALITY, cG as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cH as PRELOAD_BUDGET_MS, cI as PROCESSING_POLL_DELAY_MS, cJ as PROCESSING_POLL_MAX, cK as PortraitCaptureController, cL as PortraitCaptureInternals, cM as REGISTRY_RETRY_DELAY_MS, cN as ReticleType, cO as SAME_FACE_MAX_DROPS, cP as ScanEvent, cQ as ScanLayout, cR as ScanNotice, cS as ScanPhase, cT as ScanReport, cU as ScanSide, cV as ScanState, cW as SubmitExecutor, cX as TEXT_LOCK_DEFAULTS, cY as TRANSPORT_REPLAY_ATTEMPTS, cZ as TRANSPORT_REPLAY_DELAY_MS, c_ as VerificationInternals, c$ as analyzeDocFrame, d0 as analyzeGuide, d1 as aspectBand, d2 as aspectFits, d3 as buildDeviceReadHint, d4 as coverPointToVideo, d5 as createDocumentCaptureInternal, d6 as createFaceLandmarker, d7 as createLivePhotoKit, d8 as createLivenessCaptureInternal, d9 as createPortraitCaptureInternal, da as createVerificationInternal, db as docZoomFor, dc as encodeDocumentImage, dd as facesOf, de as feedbackVoteOf, df as focusOk, dg as guideQuad, dh as guideRegionInFrame, di as initialScanState, dj as lensKindOf, dk as mapEngineState, dl as mapErrorKind, dm as mapGuidanceHint, dn as nextScanState, dp as observePortraitFrame, dq as openDocCamera, dr as passportBandOf, ds as portraitMatchStep, dt as preloadedDetectorFactory, du as quadAreaFrac, dv as quadBounds, dw as quadIou, dx as quadTiltRatio, dy as randomUuid, dz as rankBackCameras, dA as readStoredLens, dB as resetLivenessAssetsForTests, dC as resolveDocCameraTuning, dD as resolveDocShutterTuning, dE as resolveGuideLockTuning, dF as runLivenessFlow, dG as runSubmission, dH as scannerFormatFor, dI as setPreloadLoaderForTests, dJ as settledHint, dK as singleShotFocusAt, dL as specularFraction, dM as supportsFocusMode, dN as warmDocDetector, dO as writeStoredLens } from '../create-verification-CuoYJ3kj.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,
|
|
5
|
-
export {
|
|
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-
|
|
4
|
+
import { H as HostedSessionView, f as CheckType, l as CheckReason, ah as PlanStepView } from '../types-DPl0hsmI.js';
|
|
5
|
+
export { ax as ICAO_FALLBACK, Z as IcaoCaptureTuning, ay as IcaoProfile, R as ResolvedIcaoTuning, az as resolveIcaoTuning } from '../types-DPl0hsmI.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-BSbyqLUh.js';
|
|
7
7
|
import '../detect-worker-DclNxkZT.js';
|
|
8
|
-
import '../capture-session-v3-
|
|
8
|
+
import '../capture-session-v3-CFSVWYzi.js';
|
|
9
9
|
|
|
10
10
|
type DocumentTypeId = DocCatalogEntry["docType"];
|
|
11
11
|
/** Same shape as the hosted view's `acceptedDocuments`. */
|
package/dist/internal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-
|
|
1
|
+
import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-PLH6ZR6J.js";import{a as Vt,b as Xt,c as Zt,d as Jt,e as Qt,f as jt,g as qt,h as $t,i as er,j as ae,k as se,m as Ee,n as me}from"../chunk-4GJXUVZK.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,K as dt,L as Mt,M as Ft,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-ZO6IHP2I.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-RNJA5GDF.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 Nt,b as vt,c as gt,d as bt,e as Gt,f as ht,g as Ut,h as Yt,i as Ht,j as Wt,k as kt,l as Kt,m as Bt}from"../chunk-7ZCZY3ZP.js";import{a as wt,b as zt}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 tr,i as rr,j as or,k as pr,l as ir,m as nr,s as Ie}from"../chunk-L45YTRJJ.js";import{d as S,j as T,k as c,l,m as y,p as f,r as u,s as O,t as A,u as I,v as x,w as C,x as P,y as D}from"../chunk-64V55KD7.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,n as R}from"../chunk-6K4D3U6Q.js";import"../chunk-GT2ZLGF7.js";import"../chunk-ZPXL26BF.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-CQ7SKLMC.js";import"../chunk-FPXL63KZ.js";import"../chunk-5Y3UST3W.js";import"../chunk-JUEOHNVW.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,Ft as CAPTURE_CANDIDATE_SPACING_MS,Mt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,r as CIRCLE_RADIUS_FACTOR,Vt as CLIPPED_LUMA,u as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,rr as DOCUMENT_TYPE_ORDER,Je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,It as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,$e as DOC_CAMERA_TUNING_DEFAULTS,de as DOC_CATALOG,Be as DOC_DETECT_WIDTH,We as DOC_FEEDBACK_STATES,Ot as DOC_FIRST_FRAME_MS,we as DOC_GATE_V1_DEFAULTS,Ct 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,bt as ICAO_CANVAS,wt as ICAO_FALLBACK,Yt as ICAO_GATE_CRITERIA,Xt as ICAO_SHARP_REF,I as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,tr 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,pr as acceptedIssuers,or as acceptedTypesFor,qe as analyzeDocFrame,Tt as analyzeGuide,Ce as aspectBand,Pe as aspectFits,qt as backgroundStats,$ as browserFamily,Z as buildDeviceReadHint,B as classifyCardSide,K as classifyCardSideWith,st as coverPointToVideo,oe as createDocumentCaptureInternal,ne as createFaceLandmarker,Bt 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,gt as eyeLineRoll,Wt as eyeOpenness,jt as eyeSpecular,Nt as faceGeometry,Qt as faceLighting,$t as faceSharpness,ie as facesOf,ke as feedbackVoteOf,nr as flagOf,mt as focusOk,te as formatMismatch,l as frontierStep,ct as guideQuad,St as guideRegionInFrame,er as icaoPixelStats,Gt 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,dt as passportBandOf,kt as percentile,b as photoSharpness,Ut as portraitCropRegion,Ie as portraitMatchStep,vt 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,Jt as regionStats,s as resetLivenessAssetsForTests,F as resetTurnstileForTests,Y as resizeLongEdge,ir as resolveAcceptedDocuments,et as resolveDocCameraTuning,Pt as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,j as resolveWebOcrPlan,D as runLivenessFlow,P as runSubmission,Me as scannerFormatFor,Kt 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,ht as windowOverflow,it as writeStoredLens};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as z}from"./chunk-A3FUGHAH.js";import{a as H,b as _,e as U,f as w,i as K}from"./chunk-PLH6ZR6J.js";import{n as F}from"./chunk-4GJXUVZK.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import{A as V,I as O,i as T}from"./chunk-ZO6IHP2I.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import{x as B}from"./chunk-RNJA5GDF.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,b as x,q as I}from"./chunk-64V55KD7.js";import"./chunk-6K4D3U6Q.js";import"./chunk-GT2ZLGF7.js";import"./chunk-ZPXL26BF.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-CQ7SKLMC.js";import"./chunk-FPXL63KZ.js";import{h as A}from"./chunk-5Y3UST3W.js";import{a as R}from"./chunk-JUEOHNVW.js";import"./chunk-OKWG3PVH.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";function E(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(),s=i===null?null:w(i,{isMobile:e.isMobile()});return s?.kind==="portrait"?s:null},P=async(i,s)=>{if(e.destroyed())return;s.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}s.setFlowState("checking");let l={media:{portrait:d},gate:A(i.gate),...i.tuningVersion!==void 0?{tuningVersion:i.tuningVersion}:{}};return n.submitCheck("portrait_icao",l,{idempotencyKey:r})},()=>{g=d})}catch{u=!0}if(s.setFlowState("done"),e.destroyed())return;let t=h();(t===null||t.phase!=="capture")&&a?.controller===s&&m(),e.runner().republish()},b=i=>e.runner().submit("face_match",(s,d)=>s.submitCheck("face_match",g!==null?{imageKey:g}:{},{idempotencyKey:d})).then(()=>{},()=>{u=!0,i()});return{bind:(i,s)=>{if(i.phase==="match")return m(),y!==i.attemptsRemaining&&!u&&(y=i.attemptsRemaining,b(s)),{...i,uploadFailed:u,resubmit:()=>(u=!1,y=i.attemptsRemaining,s(),b(s)),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,s()})),{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=F({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":e.cameraMode?.()??x(L(e.currentView()),null));return a={video:t.video,controller:n},n.handle.on("captured",r=>{c=c.then(()=>P(r,n)).catch(()=>{})}),n.handle}}},destroy:m}}function G(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/${R}`},body:JSON.stringify({reports:g}),keepalive:!0}).catch(()=>{})}catch{}}}function $(e){let a=e.apiOrigin;return z("sdk",typeof a=="string"&&/staging|sandbox|localhost/.test(a)?"sandbox":"live")}function ce(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,l,p=!1;try{await a.submit("doc_ocr",async(S,j)=>{if(r===null){let D=await I(S,"image","image/jpeg",t.image.size,{engine:"document"});await S.uploadToSpaces(D.uploadUrl,t.image,"image/jpeg"),r=(await S.completeMedia(D.key)).key}return n.setFlowState("checking"),l===void 0&&(l=n.takeDeviceRead(t)),S.submitCheck("doc_ocr",{imageKey:r,side:t.side,...l!==null?{deviceRead:l}:{}},{idempotencyKey:j})})}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,l)=>{if(!_(t.documents).includes(r)||!H(t.documents,r).includes(l))throw new RangeError(`${l} from ${r} is not accepted`);(c?.issuer!==r||c.documentType!==l)&&y(),c={issuer:r,documentType:l},n()},capture:r=>{if(c===null)throw new Error("selectDocument() first");if(u!==null&&u.video===r.video)return u.flow.handle;y();let l=c,p=l.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,v=B({video:r.video,documentType:l.documentType,issuer:l.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:T(o?.camera),shutter:O(o?.scan),guideLock:V(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=G(e.runtime.client);return{webOcr:{captureDocument:o.capture?.document,salt:o.sessionId,baseUrl:$(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 M=()=>{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=U({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 l=m,p=e.baseCapture??{},v=p.engineOptions?.telemetry;return{...p,engineOptions:{...p.engineOptions??{},measureQuality:l.engineOptions.measureQuality,telemetry:o=>{v?.(o),l.engineOptions.telemetry(o)}}}},s=E({keptPortraitInput:()=>m?.lastPortraitInput()??null,runner:()=>a,currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{}}),d=K({...e,bindDocument:k,bindPortrait:s.bind,onLivePhoto:t=>(P.add(t),()=>P.delete(t))});return a=d,{...d,captureInternals:i,destroy:()=>{y(),s.destroy(),M(),P.clear()}}}export{ce as createPlanRunner,G as reportSink,$ as sdkAssetBase};
|
|
@@ -360,7 +360,7 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
|
|
|
360
360
|
* - `platform_unsupported` (M-nfc): a chip read is required and this client
|
|
361
361
|
* can't read one (web); the session stays open for a native app.
|
|
362
362
|
*/
|
|
363
|
-
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported";
|
|
363
|
+
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "starter_credit_claimed";
|
|
364
364
|
/**
|
|
365
365
|
* The profile-v2 policy reasons a session can end on: the two session-level
|
|
366
366
|
* reasons plus the failed check's policy reasons (`document_type_not_accepted`,
|
|
@@ -373,6 +373,23 @@ type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" |
|
|
|
373
373
|
* `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
|
|
374
374
|
*/
|
|
375
375
|
type CameraUnavailableCause = "denied" | "no_camera";
|
|
376
|
+
/**
|
|
377
|
+
* A capture failure the page showed (`POST /hosted/capture-issue`, 2026-11-04): a diagnostic record on the session that
|
|
378
|
+
* never changes it, never bills and never counts as an attempt. No personal data, no free text: `name` is a thrown
|
|
379
|
+
* error's `name` (letters only, at most 40 characters).
|
|
380
|
+
*/
|
|
381
|
+
interface CaptureIssueReport {
|
|
382
|
+
check: "liveness" | "document";
|
|
383
|
+
/** The public capture error kind shown, or `unavailable` (the SDK reason then rides in `engineKind`). */
|
|
384
|
+
kind: "permission" | "notfound" | "inuse" | "insecure" | "unsupported" | "generic" | "unavailable";
|
|
385
|
+
name?: string;
|
|
386
|
+
phase?: "preflight" | "acquiring" | "models" | "recording" | "keyframes" | "upload";
|
|
387
|
+
/** The engine kind before the public collapse, or the `unavailable` reason code (lower case, at most 32 characters). */
|
|
388
|
+
engineKind?: string;
|
|
389
|
+
/** Which capture attempt of the page failed (0 = the first). The client reports one issue per attempt and cause. */
|
|
390
|
+
attempt?: number;
|
|
391
|
+
formFactor?: "phone" | "tablet" | "desktop";
|
|
392
|
+
}
|
|
376
393
|
/**
|
|
377
394
|
* How the person proves their identity when the app makes the document
|
|
378
395
|
* optional for registry nationals (profile v2 step 3): type their national
|
|
@@ -868,9 +885,13 @@ interface HostedCaptureTuning {
|
|
|
868
885
|
}
|
|
869
886
|
/**
|
|
870
887
|
* Who films the face (`HostedSessionView.capture.mode`, a flow setting):
|
|
871
|
-
* `self` (the person, front camera)
|
|
888
|
+
* `self` (the person, front camera), `assisted` (an agent, back camera) or
|
|
889
|
+
* `choice` (the person picks `self` or `assisted` on the first camera step,
|
|
890
|
+
* once for the session: {@link ResolvedCaptureMode}).
|
|
872
891
|
*/
|
|
873
|
-
type CaptureMode = "self" | "assisted";
|
|
892
|
+
type CaptureMode = "self" | "assisted" | "choice";
|
|
893
|
+
/** The mode a camera runs in: the session's {@link CaptureMode}, or the person's pick under `choice`. */
|
|
894
|
+
type ResolvedCaptureMode = "self" | "assisted";
|
|
874
895
|
/** `capture.livePhoto` (flow model 2026-10-23, Step 3). */
|
|
875
896
|
interface HostedLivePhotoTuning {
|
|
876
897
|
oneCapture: boolean;
|
|
@@ -1345,7 +1366,10 @@ interface LivenessCaptureInput {
|
|
|
1345
1366
|
captureMs?: number;
|
|
1346
1367
|
/** The camera the clip was filmed with (`environment` = back). */
|
|
1347
1368
|
facingMode?: 'user' | 'environment';
|
|
1348
|
-
/**
|
|
1369
|
+
/**
|
|
1370
|
+
* The capture mode the SDK applied: the session's `capture.mode`, or under `choice` the person's pick
|
|
1371
|
+
* (`Verification.chooseCaptureMode`). The server checks the pick is one the session allows.
|
|
1372
|
+
*/
|
|
1349
1373
|
mode?: 'self' | 'assisted';
|
|
1350
1374
|
/** The device kind. With `mode` set, the server applies the upright requirement (`capture_not_upright`) to `phone` only. */
|
|
1351
1375
|
formFactor?: 'phone' | 'tablet' | 'desktop';
|
|
@@ -1534,4 +1558,4 @@ interface SubmitCheckBody {
|
|
|
1534
1558
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
1535
1559
|
}
|
|
1536
1560
|
|
|
1537
|
-
export { type
|
|
1561
|
+
export { type IdentityMethod as $, type AcceptedDocumentType as A, type BackgroundUniformity as B, type ConsentLocale as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedFlowRef as G, type HostedSessionView as H, type IdentityConfirmDecision as I, type HostedIcaoPolicy as J, type HostedIntegrity as K, type HostedLivePhotoTuning as L, type MediaKind as M, type HostedLivenessCaptureTuning as N, type HostedNativeCaptureTuning as O, type PresignUploadResult as P, type HostedOcrTuning as Q, type ResolvedIcaoTuning as R, type ScreenRampColour as S, type HostedOtpView as T, type HostedPlanView as U, type HostedPortraitView as V, type HostedStepView as W, type HostedVoiceLocale as X, type HostedVoiceView as Y, type IcaoCaptureTuning as Z, type IcaoReportEntry as _, type HostedConsentView as a, type IdentitySummarySource as a0, type IdentitySummaryView as a1, type LivenessReason as a2, type MatchReason as a3, type MethodChoiceView as a4, type NationalEidOption as a5, type NfcChipReason as a6, type NfcStepView as a7, type OtpChoiceView as a8, type PhoneCountryRule as a9, type PersonMask as aA, type AttestationInput as aB, type CaptureNoncesResult as aC, type CaptureProof as aD, type DocDeviceRead as aE, type DocOcrInput as aF, type DocSide as aG, type EmailOtpInput as aH, type FaceMatchInput as aI, type LivenessCaptureInput as aJ, type LivenessInput as aK, type PhoneOtpInput as aL, type PopulationInput as aM, type PresignRequest as aN, type RecordConsentResult as aO, type SessionStepView as aP, type SessionView as aQ, type SubmitCheckBody as aR, type PhoneFormat as aa, type PhoneOtpReason as ab, type PlanAttempts as ac, type PlanChoiceKind as ad, type PlanChoiceOption as ae, type PlanChoiceView as af, type PlanSectionView as ag, type PlanStepView as ah, type PolicyFailureReason as ai, type PopulationReason as aj, type PortraitIcaoInput as ak, type PortraitIcaoReason as al, type ResolvedCaptureMode as am, type RetakeHint as an, type ScreenRampChallenge as ao, type ScreenRampRendered as ap, type ScreenRampReport as aq, type SessionFailureReason as ar, type SessionOutcome as as, type SessionStatus as at, type StepSection as au, type VerificationAssurance as av, type VerificationLevel as aw, ICAO_FALLBACK as ax, type IcaoProfile as ay, resolveIcaoTuning as az, type CameraUnavailableCause as b, type CaptureIssueReport as c, type CaptureContext as d, type CompleteMediaResult as e, type CheckType as f, type CheckInputByType as g, type IcaoCriterion as h, type AgeEstimationReason as i, type CaptureMode as j, type CaptureProvenance as k, type CheckReason as l, type CheckState as m, type ContactChannel as n, type DocReason as o, type EidAuthInput as p, type EidReason as q, type EmailOtpReason as r, type HostedAcceptedDocuments as s, type HostedBranding as t, type HostedBrandingColorKey as u, type HostedCaptureTuning as v, type HostedDocumentCaptureTuning as w, type HostedDocumentScanTuning as x, type HostedEidView as y, type HostedEmailOtpView as z };
|
|
@@ -360,7 +360,7 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
|
|
|
360
360
|
* - `platform_unsupported` (M-nfc): a chip read is required and this client
|
|
361
361
|
* can't read one (web); the session stays open for a native app.
|
|
362
362
|
*/
|
|
363
|
-
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported";
|
|
363
|
+
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "starter_credit_claimed";
|
|
364
364
|
/**
|
|
365
365
|
* The profile-v2 policy reasons a session can end on: the two session-level
|
|
366
366
|
* reasons plus the failed check's policy reasons (`document_type_not_accepted`,
|
|
@@ -373,6 +373,23 @@ type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" |
|
|
|
373
373
|
* `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
|
|
374
374
|
*/
|
|
375
375
|
type CameraUnavailableCause = "denied" | "no_camera";
|
|
376
|
+
/**
|
|
377
|
+
* A capture failure the page showed (`POST /hosted/capture-issue`, 2026-11-04): a diagnostic record on the session that
|
|
378
|
+
* never changes it, never bills and never counts as an attempt. No personal data, no free text: `name` is a thrown
|
|
379
|
+
* error's `name` (letters only, at most 40 characters).
|
|
380
|
+
*/
|
|
381
|
+
interface CaptureIssueReport {
|
|
382
|
+
check: "liveness" | "document";
|
|
383
|
+
/** The public capture error kind shown, or `unavailable` (the SDK reason then rides in `engineKind`). */
|
|
384
|
+
kind: "permission" | "notfound" | "inuse" | "insecure" | "unsupported" | "generic" | "unavailable";
|
|
385
|
+
name?: string;
|
|
386
|
+
phase?: "preflight" | "acquiring" | "models" | "recording" | "keyframes" | "upload";
|
|
387
|
+
/** The engine kind before the public collapse, or the `unavailable` reason code (lower case, at most 32 characters). */
|
|
388
|
+
engineKind?: string;
|
|
389
|
+
/** Which capture attempt of the page failed (0 = the first). The client reports one issue per attempt and cause. */
|
|
390
|
+
attempt?: number;
|
|
391
|
+
formFactor?: "phone" | "tablet" | "desktop";
|
|
392
|
+
}
|
|
376
393
|
/**
|
|
377
394
|
* How the person proves their identity when the app makes the document
|
|
378
395
|
* optional for registry nationals (profile v2 step 3): type their national
|
|
@@ -868,9 +885,13 @@ interface HostedCaptureTuning {
|
|
|
868
885
|
}
|
|
869
886
|
/**
|
|
870
887
|
* Who films the face (`HostedSessionView.capture.mode`, a flow setting):
|
|
871
|
-
* `self` (the person, front camera)
|
|
888
|
+
* `self` (the person, front camera), `assisted` (an agent, back camera) or
|
|
889
|
+
* `choice` (the person picks `self` or `assisted` on the first camera step,
|
|
890
|
+
* once for the session: {@link ResolvedCaptureMode}).
|
|
872
891
|
*/
|
|
873
|
-
type CaptureMode = "self" | "assisted";
|
|
892
|
+
type CaptureMode = "self" | "assisted" | "choice";
|
|
893
|
+
/** The mode a camera runs in: the session's {@link CaptureMode}, or the person's pick under `choice`. */
|
|
894
|
+
type ResolvedCaptureMode = "self" | "assisted";
|
|
874
895
|
/** `capture.livePhoto` (flow model 2026-10-23, Step 3). */
|
|
875
896
|
interface HostedLivePhotoTuning {
|
|
876
897
|
oneCapture: boolean;
|
|
@@ -1345,7 +1366,10 @@ interface LivenessCaptureInput {
|
|
|
1345
1366
|
captureMs?: number;
|
|
1346
1367
|
/** The camera the clip was filmed with (`environment` = back). */
|
|
1347
1368
|
facingMode?: 'user' | 'environment';
|
|
1348
|
-
/**
|
|
1369
|
+
/**
|
|
1370
|
+
* The capture mode the SDK applied: the session's `capture.mode`, or under `choice` the person's pick
|
|
1371
|
+
* (`Verification.chooseCaptureMode`). The server checks the pick is one the session allows.
|
|
1372
|
+
*/
|
|
1349
1373
|
mode?: 'self' | 'assisted';
|
|
1350
1374
|
/** The device kind. With `mode` set, the server applies the upright requirement (`capture_not_upright`) to `phone` only. */
|
|
1351
1375
|
formFactor?: 'phone' | 'tablet' | 'desktop';
|
|
@@ -1534,4 +1558,4 @@ interface SubmitCheckBody {
|
|
|
1534
1558
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
1535
1559
|
}
|
|
1536
1560
|
|
|
1537
|
-
export { type
|
|
1561
|
+
export { type IdentityMethod as $, type AcceptedDocumentType as A, type BackgroundUniformity as B, type ConsentLocale as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedFlowRef as G, type HostedSessionView as H, type IdentityConfirmDecision as I, type HostedIcaoPolicy as J, type HostedIntegrity as K, type HostedLivePhotoTuning as L, type MediaKind as M, type HostedLivenessCaptureTuning as N, type HostedNativeCaptureTuning as O, type PresignUploadResult as P, type HostedOcrTuning as Q, type ResolvedIcaoTuning as R, type ScreenRampColour as S, type HostedOtpView as T, type HostedPlanView as U, type HostedPortraitView as V, type HostedStepView as W, type HostedVoiceLocale as X, type HostedVoiceView as Y, type IcaoCaptureTuning as Z, type IcaoReportEntry as _, type HostedConsentView as a, type IdentitySummarySource as a0, type IdentitySummaryView as a1, type LivenessReason as a2, type MatchReason as a3, type MethodChoiceView as a4, type NationalEidOption as a5, type NfcChipReason as a6, type NfcStepView as a7, type OtpChoiceView as a8, type PhoneCountryRule as a9, type PersonMask as aA, type AttestationInput as aB, type CaptureNoncesResult as aC, type CaptureProof as aD, type DocDeviceRead as aE, type DocOcrInput as aF, type DocSide as aG, type EmailOtpInput as aH, type FaceMatchInput as aI, type LivenessCaptureInput as aJ, type LivenessInput as aK, type PhoneOtpInput as aL, type PopulationInput as aM, type PresignRequest as aN, type RecordConsentResult as aO, type SessionStepView as aP, type SessionView as aQ, type SubmitCheckBody as aR, type PhoneFormat as aa, type PhoneOtpReason as ab, type PlanAttempts as ac, type PlanChoiceKind as ad, type PlanChoiceOption as ae, type PlanChoiceView as af, type PlanSectionView as ag, type PlanStepView as ah, type PolicyFailureReason as ai, type PopulationReason as aj, type PortraitIcaoInput as ak, type PortraitIcaoReason as al, type ResolvedCaptureMode as am, type RetakeHint as an, type ScreenRampChallenge as ao, type ScreenRampRendered as ap, type ScreenRampReport as aq, type SessionFailureReason as ar, type SessionOutcome as as, type SessionStatus as at, type StepSection as au, type VerificationAssurance as av, type VerificationLevel as aw, ICAO_FALLBACK as ax, type IcaoProfile as ay, resolveIcaoTuning as az, type CameraUnavailableCause as b, type CaptureIssueReport as c, type CaptureContext as d, type CompleteMediaResult as e, type CheckType as f, type CheckInputByType as g, type IcaoCriterion as h, type AgeEstimationReason as i, type CaptureMode as j, type CaptureProvenance as k, type CheckReason as l, type CheckState as m, type ContactChannel as n, type DocReason as o, type EidAuthInput as p, type EidReason as q, type EmailOtpReason as r, type HostedAcceptedDocuments as s, type HostedBranding as t, type HostedBrandingColorKey as u, type HostedCaptureTuning as v, type HostedDocumentCaptureTuning as w, type HostedDocumentScanTuning as x, type HostedEidView as y, type HostedEmailOtpView as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/web",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.19",
|
|
4
4
|
"description": "Sekyro AI web SDK \u2014 browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "web",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.19",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.19",
|
|
102
102
|
"description": "Sekyro AI web SDK — browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.19?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"name": "tasks-vision",
|
|
151
151
|
"group": "@mediapipe",
|
|
152
152
|
"version": "0.10.35",
|
|
153
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
153
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.19|@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.
|
|
186
|
+
"ref": "@sekyro/web@0.1.0-rc.19",
|
|
187
187
|
"dependsOn": [
|
|
188
|
-
"@sekyro/web@0.1.0-rc.
|
|
188
|
+
"@sekyro/web@0.1.0-rc.19|@mediapipe/tasks-vision@0.10.35"
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
192
|
+
"ref": "@sekyro/web@0.1.0-rc.19|@mediapipe/tasks-vision@0.10.35"
|
|
193
193
|
}
|
|
194
194
|
]
|
|
195
195
|
}
|
package/dist/chunk-2BFYVMUU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var m=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp9","video/webm;codecs=vp8,opus","video/webm;codecs=vp8","video/webm"];function w(){let e=globalThis.MediaRecorder;return!e||typeof e.isTypeSupported!="function"?"":m.find(r=>e.isTypeSupported(r))??""}var f="video/webm";function y(e){if(e instanceof TypeError)return"insecure";switch(e?.name??""){case"NotAllowedError":case"PermissionDeniedError":return"permission";case"NotFoundError":case"DevicesNotFoundError":return"notfound";case"NotReadableError":case"TrackStartError":return"inuse";case"OverconstrainedError":case"ConstraintNotSatisfiedError":return"overconstrained";default:return"generic"}}function v(){let e=globalThis;if(typeof e.window<"u"&&e.window.isSecureContext===!1)return"INSECURE_CONTEXT";let r=e.navigator?.mediaDevices;return!r||typeof r.getUserMedia!="function"?"UNSUPPORTED":"OK"}function E(){let e=globalThis.MediaRecorder;return typeof e<"u"&&typeof e.isTypeSupported=="function"}var l=8*1024*1024;function S(e){return e.size>l}function u(e){let r=(e||"").toLowerCase();return r.startsWith("image/jpeg")?"jpg":r.startsWith("video/mp4")?"mp4":(r.startsWith("video/webm"),"webm")}function b(e){let{token:r,clip:o,keyframe:t}=e,c=e.ts??Date.now(),d=o.type||f,p=t.type||"image/jpeg",n=new FormData;return n.append("token",r),n.append("clip",new File([o],`liveness-${c}.${u(d)}`,{type:d})),n.append("keyframe",new File([t],`keyframe-${c}.${u(p)}`,{type:p})),n}var i=Symbol.for("sekyro.web.cameraStreams"),a=globalThis,s=a[i]??(a[i]=new Set);function g(e){try{s.add(e)}catch{}}function M(e){let r=0;for(let o of[...s])if(o!==e){s.delete(o);try{for(let t of o.getTracks())t.readyState!=="ended"&&(t.stop(),r+=1)}catch{}}return r}export{m as a,w as b,f as c,y as d,v as e,E as f,l as g,S as h,u as i,b as j,g as k,M as l};
|
package/dist/chunk-3SL74TFR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as K,e as pe,f as me,g as fe,i as he,j as X,l as Q,n as Se,o as ge,v as ye,x as O,y as Z}from"./chunk-J4NL62VQ.js";import{c as de,d as ue,e as le}from"./chunk-FPXL63KZ.js";import{c as F,g as $,h as be}from"./chunk-ULMH32G5.js";var _e=["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 Fe=["carte_identite","passport","residence_permit"];function Ke(e,t){let i=e.byIssuer?.[t]??e.default;return Fe.filter(s=>i==="*"||i.includes(s))}function xt(e,t=_e){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(s=>Ke(e,s).length>0).sort()}function Ce(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}var Ze=640,Ye=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),Pe=6,ke=1500,Re={sharpness:1,exposure:1,meanLuma:128},Me=null;function je(e,t){try{Me??(Me=document.createElement("canvas"));let i=Me,s=96/Math.max(1,t.width);i.width=Math.max(1,Math.round(t.width*s)),i.height=Math.max(1,Math.round(t.height*s));let r=i.getContext("2d");if(r===null)return Re;r.drawImage(e,t.x,t.y,t.width,t.height,0,0,i.width,i.height);let c=r.getImageData(0,0,i.width,i.height);return{sharpness:ue(c),exposure:le(c),meanLuma:de(c)}}catch{return Re}}async function We(e,t){let i=e.source;return"convertToBlob"in i?i.convertToBlob({type:"image/jpeg",quality:t}):new Promise((s,r)=>{i.toBlob(c=>c===null?r(new Error("encode failed")):s(c),"image/jpeg",t)})}function Ht(e,t={}){let i=t.now??(()=>performance.now()),s=t.setTimer??((l,n)=>setTimeout(l,n)),r=t.clearTimer??(l=>clearTimeout(l)),c=t.encode??We,p=t.quality??je,d=e.tuningVersion??null,h=new Set,C=!1,b=e.video??null,S=null,y=t.grabFrame??null,k=null,A=1e3/Pe,R=null,E=null,L=!1,w=!1,I=Number.NEGATIVE_INFINITY,M=null,H=0,x=null,V=null,D=Promise.all([import("./icao-gate-PWBMKRGC.js"),import("./icao-tuning-4GGVX6B4.js"),import("./create-portrait-capture-53XBURNT.js"),import("./landmarker-KB7LVXAU.js"),import("./background-monitor-A7FKJOAG.js")]).then(async([l,n,o,a,u])=>{let f=n.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);f.background.required&&(E=u.createBackgroundMonitor({tuning:f.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:i})),S=l.createIcaoGate(f,{policy:e.policy??"reject"}),y??(y=o.defaultGrabber()),k=o.observe,A=1e3/Math.min(Pe,f.cadenceHz);let _=(t.createLandmarker??a.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),g=await new Promise((m,P)=>{let v=setTimeout(()=>{P(new Error("landmarker init timeout")),_.then(T=>T.close(),()=>{})},a.LANDMARKER_INIT_TIMEOUT_MS);_.then(T=>{clearTimeout(v),m(T)},T=>{clearTimeout(v),P(T)})});C?g.close():R=g}).catch(()=>{L=!0}),Y=l=>{for(let n of h)n({holding:w||L,update:l})},B=()=>{if(M=null,!(C||R===null||S===null||y===null||k===null||b===null)){if(i()-I>ke){Y(null);return}try{let l=y(b,Ze);if(l!==null){let n=Math.max(i(),H+1);H=n;let o=R.detect(l.source,n),a=b.videoWidth||l.width,u=b.videoHeight||l.height,f=k(o,l,a,u);f.geometry!==null&&E!==null&&(f.backgroundCheck=E.measure(l,f.geometry.box,a,u));let _=S.push(f,i());w=_.ready,Y(_)}}catch{}M=s(B,A)}},j=()=>{let l=i()-I>ke;I=i(),l&&(S?.reset(),w=!1,x=null,V=null),M===null&&R!==null&&!C&&(M=s(B,0))},J=()=>{let l=y===null||b===null?null:y(b,null);if(l===null||S===null||Math.max(l.width,l.height)<e.still.minLongSidePx)return Promise.resolve(null);let n=S.summary();return c(l,e.still.jpegQuality).then(o=>({image:o,width:l.width,height:l.height,gate:n}),()=>null)},W=null;return{engineOptions:{measureQuality:(l,n)=>{b=l,j();let o=p(l,n);return w||L?o:{...o,sharpness:0}},telemetry:l=>{if(l.type!=="fired"||C)return;x=J();let n=W;n!==null&&x.then(o=>o===null?void 0:n(o).catch(()=>{})),w=!1,M!==null&&r(M),M=null,I=Number.NEGATIVE_INFINITY}},decorate:l=>{let n=new WeakMap,o=new Map,a=g=>{let m=n.get(g);return m===void 0&&(m=(async()=>{let P=await ge(l,"image","image/jpeg",g.image.size,{engine:"portrait"});return await l.uploadToSpaces(P.uploadUrl,g.image,"image/jpeg"),(await l.completeMedia(P.key)).key})(),m.catch(()=>n.delete(g)),n.set(g,m)),m};W=a;let u=async g=>{let m;try{m=await a(g)}catch(P){let v=P?.code;if(typeof v=="string"&&Ye.has(v))throw P;return null}return{media:{portrait:m},gate:be(g.gate),...d!==null?{tuningVersion:d}:{}}},f=l.submitCheck.bind(l),_=(async(g,m,P)=>{if(g!=="liveness")return f(g,m,P);let v=P?.idempotencyKey,T=v===void 0?void 0:o.get(v);if(T===void 0){let ae=x;T=ae===null?Promise.resolve(null):ae.then(ce=>ce===null?null:u(ce)),v!==void 0&&(o.set(v,T),T.catch(()=>o.delete(v)))}let z=await T;if(z===null)return f("liveness",m,P);let Ue=await f("liveness",{...m,portraitIcao:z},P);return V=z,Ue});return new Proxy(l,{get(g,m){if(m==="submitCheck")return _;let P=Reflect.get(g,m);return typeof P=="function"?P.bind(g):P}})},onGate:l=>(h.add(l),()=>h.delete(l)),lastPortraitInput:()=>V,destroy:()=>{C=!0,x=null,V=null,M!==null&&r(M),M=null,h.clear(),D.then(()=>{R?.close(),R=null,E?.close(),E=null})}}}function Ee(e){return e.idNumberBound??e.nniBound}function Ae(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function Ie(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var ve=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",sandbox_nni_not_seeded:"sandbox_id_number_not_seeded",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),Qe=new Map(Object.entries(ve)),Ft=new Map(Object.entries(ve).map(([e,t])=>[t,e]));function Te(e){return Qe.get(e)??e}var $e=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"]),qe=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),te=["document","population_registry","national_eid"],ne=["phone_otp","email_otp"],Ne={identity_method:te,contact:ne},Je=["population_registry","document"],xe="platform_unsupported",ze=new Set(["prefilled","user_entered","prefilled_or_entered"]),Xe={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 N(e){return e.section??Xe[e.checkType]??null}function ie(e,t){let i=e.plan?.choice;if(i===void 0||i.locked)return;let s=i.options.find(r=>r.id!==i.selected&&r.available!==!1&&t.includes(r.service));return s===void 0?void 0:{nodeId:i.nodeId,option:s}}function oe(e){let t=e.plan,i=t?.choice;if(t===void 0||i===void 0||i.locked||t.current===null||t.current===i.nodeId||X(e))return null;let s=Ne[i.kind]??[...te,...ne],r=i.options.flatMap(d=>d.available===!1||!s.includes(d.service)?[]:[d.nationalEid!=null?{id:d.id,service:d.service,nationalEid:d.nationalEid}:{id:d.id,service:d.service}]),c=t.steps.find(d=>d.id===t.current)?.service,p=i.selected??r.find(d=>d.service===c)?.id??null;return r.some(d=>d.id!==p)?{nodeId:i.nodeId,kind:i.kind,current:p,options:r}:null}function Le(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function et(e){let t=(e.plan?.sections??[]).map(r=>({id:r.id,state:r.state})),i={sessionId:e.sessionId,orgName:e.orgName,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(r=>r.id),progress:t,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 tt(e){let t={attemptsRemaining:me(e),attemptsExhausted:e.attemptsExhausted===!0};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}var Ve={phone_otp:"phone",email_otp:"email"};function nt(e,t){let i=ie(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return i===void 0?void 0:Ve[i.option.service]}function it(e,t,i,s){let r=t.checkType==="email_otp",c=(r?t.emailOtp:t.otp)??{},p=r?t.emailOtp?.emailSource:t.otp?.numberSource,d=p!==void 0&&ze.has(p)?p:r?"prefilled_or_entered":"user_entered",h=typeof c.sentToMasked=="string"&&c.sentToMasked.length>0,C=nt(e,r?"email_otp":"phone_otp"),b={key:t.checkType,context:i,section:N(t),phase:h?"verify":"send",canSwitch:C!==void 0,...s},S=r?{kind:"email_otp",...b,emailSource:d,needsEmail:d!=="prefilled"}:{kind:"phone_otp",...b,numberSource:d,needsPhone:d!=="prefilled",channels:(t.otp?.channels??[]).filter(y=>y==="whatsapp"||y==="sms")};if(C!==void 0&&(S.switchChannel=C),h&&(S.sentToMasked=c.sentToMasked),!r&&t.otp?.channel!==void 0&&(S.channel=t.otp.channel),!r&&Array.isArray(t.phoneCountries)&&(S.phoneCountries=t.phoneCountries.filter(y=>typeof y=="string"&&/^[A-Z]{2}$/.test(y))),!r&&Array.isArray(t.phoneRules)){let y=S.phoneCountries??[];S.phoneRules=t.phoneRules.flatMap(k=>{let A=st(k);return A!==void 0&&y.includes(A.code)?[A]:[]})}return!r&&t.phoneInternational===!0&&(S.phoneInternational=!0),c.expiresAt!==void 0&&(S.codeExpiresAt=c.expiresAt),c.resendAvailableAt!==void 0&&(S.resendAvailableAt=c.resendAvailableAt),S}var ot=/^[\d[\]\-|()?:^]{1,64}$/;function rt(e){try{return typeof e=="string"&&ot.test(e)&&new RegExp(e)!==null}catch{return!1}}var Oe=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function st(e){let{code:t,dial:i,trunk:s,lengths:r,formats:c}=e??{};if(typeof t!="string"||typeof i!="string"||!/^\d{1,3}$/.test(i)||s!==void 0&&(typeof s!="string"||!/^\d{1,3}$/.test(s))||!Array.isArray(r)||r.length===0||!r.every(Oe))return;let p={code:t,dial:i,lengths:[...r].sort((d,h)=>d-h)};if(s!==void 0&&(p.trunk=s),c!==void 0){if(!(Array.isArray(c)&&c.length<=8&&c.every(h=>rt(h?.leading)&&Array.isArray(h.groups)&&h.groups.every(Oe)&&r.includes(h.groups.reduce((C,b)=>C+b,0)))))return;p.formats=c.map(h=>({leading:h.leading,groups:[...h.groups]}))}return p}function at(e,t,i,s){let r=Ee(e)===!0?"bound":Ae(t)===!0?"document":"typed",c=r==="typed"&&t.state==="input_required"&&t.reason!==void 0&&Te(t.reason)==="id_number_recheck",p=Le(oe(e)),d=!s.attemptsExhausted&&p.length===1&&p[0]?.service==="document";return{kind:"registry",key:"registry",context:i,section:N(t),state:t.state==="input_required"?"input_required":"pending",source:r,recheck:c,canUseDocument:d,...s}}function ct(e,t,i,s){let r=[...t.acceptedSides??[]];return{kind:"document",key:"document",context:i,section:N(t),side:r.includes("recto")?"verso":"recto",acceptedSides:r,documents:Ce(e),...s}}function dt(e){let t=Q(e,"liveness");return t?.state==="passed"||t?.state==="review"}function we(e,t,i,s,r){let c=t.icao?.report;return{kind:"portrait",key:`portrait:${r}`,context:i,section:N(t),phase:r,report:Array.isArray(c)?c:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:$(e),retakeOnly:r==="capture"&&t.state==="input_required"&&e.capture?.livePhoto?.oneCapture===!0&&dt(e),...s}}var ee={minLongSidePx:1280,jpegQuality:.95};function ut(e,t){let i=e.capture?.livePhoto;if(i?.oneCapture!==!0)return null;let s=Q(e,"portrait_icao"),r=i.still??ee;return{icao:t==="liveness"&&$(e)!==null&&s!==void 0&&s.state==="pending"&&s.reason===void 0,still:{minLongSidePx:r.minLongSidePx??ee.minLongSidePx,jpegQuality:r.jpegQuality??ee.jpegQuality}}}function lt(e,t,i,s){let r=t.eid,c=N(t);if(r===void 0||r.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:i,section:c,checkType:"eid_auth",reason:"update_required"};let p=Le(oe(e)),d=p.length===1&&Je.includes(p[0]?.service??"")?p[0]:void 0,h=d===void 0?void 0:K[d.service],C=h!==void 0,b={kind:"eid",key:"eid",context:i,section:c,provider:r.provider,providerName:r.providerName,country:r.country,challenge:"app_code",phase:r.awaiting==="code"?"code":"identifier",identifierBound:r.identifierBound===!0,canUseCamera:C,afterPass:r.afterPass==="continue"?"continue":"end",...s};return C&&(b.cameraMethod=h),r.expiresAt!==void 0&&(b.codeExpiresAt=r.expiresAt),r.resendAvailableAt!==void 0&&(b.resendAvailableAt=r.resendAvailableAt),r.resendsRemaining!==void 0&&(b.resendsRemaining=r.resendsRemaining),r.codeAttemptsRemaining!==void 0&&(b.codeAttemptsRemaining=r.codeAttemptsRemaining),b}function pt(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let i=Q(e,"portrait_icao");return i!==void 0&&(i.state==="passed"||i.state==="review")?i:null}function mt(e){return pe(e).filter(t=>t.state==="failed").pop()?.attemptsExhausted===!0}function ft(e,t){let i=e.failureReason,s;i===xe?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":mt(e)?s="attempts_exhausted":s="rejected";let r=s==="platform_unsupported"?{sessionId:e.sessionId,status:"unavailable"}:Se(e,{autoRetry:!1}),c={kind:"result",key:"result",context:t,section:null,display:s,result:r};return i!==void 0&&(c.failureReason=i),e.retryAfter!==void 0&&(c.retryAfter=e.retryAfter),c}function ht(e,t,i){let s=e.identitySummary;if(s==null)return null;let r={kind:"identity_summary",key:"identity_summary",context:t,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 p of St){let d=s[p];typeof d=="string"&&d!==""&&(r[p]=d)}let c=Ie(s);return c!==void 0&&(r.idNumberMasked=c,r.nniMasked=c),r}var St=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function G(e,t,i,s){return{kind:"unsupported",key:`unsupported:${i}`,context:e,section:t,checkType:i,reason:s}}function gt(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function yt(e,t){let i=Ne[e.kind]??[...te,...ne],s=gt(e),r=e.options.flatMap(p=>{if(p.available===!1||!i.includes(p.service))return[];let d={id:p.id,service:p.service};return p.nationalEid!=null&&(d.nationalEid=p.nationalEid),[d]});if(r.length===0){let p=e.options.length>0&&e.options.every(d=>d.service==="nfc");return G(t,s,"choice",p?"platform_unsupported":"update_required")}let c={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:r};if(e.kind==="identity_method"){let p={kind:"method",key:"method",context:t,section:s,options:r.map(h=>K[h.service]),choice:c},d=r.find(h=>h.nationalEid!==void 0)?.nationalEid;return d!==void 0&&(p.nationalEid=d),p}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:s,options:r.map(p=>Ve[p.service]),selected:null,locked:!1,choice:c}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:s,choice:c}}function q(e,t={}){let i=et(e);if(X(e)||e.failureReason===xe)return ft(e,i);let s=e.plan;if(s===void 0||!Array.isArray(s.sections))return G(i,null,"plan","update_required");let r=fe(e);if(r!==null)return yt(r,i);let c=s.current===null?void 0:s.steps.find(S=>S.id===s.current),p=S=>{let y={kind:"processing",key:"processing",context:i,section:S!==void 0?N(S):s.sections.find(k=>k.state==="current")?.id??null,stalled:!1};return typeof S?.service=="string"&&S.service!==""&&(y.service=S.service),y};if(s.current===null)return p(s.steps.find(S=>S.state==="processing"));if(c===void 0)return G(i,null,"step","update_required");if(!$e.has(c.service))return c.interaction==="server"?p(c):G(i,N(c),c.service,"update_required");if(qe.has(c.service)||!he(c))return p(c);let d=c,h=tt(d),C=d.checkType,b=N(d);switch(C){case"phone_otp":case"email_otp":return it(e,d,i,h);case"population_registry":return at(e,d,i,h);case"eid_auth":return lt(e,d,i,h);case"doc_ocr":return ct(e,d,i,h);case"identity_confirm":return ht(e,i,b)??p(d);case"portrait_icao":return we(e,d,i,h,"capture");case"liveness":case"face_match":{let S=pt(e,d);if(S!==null)return we(e,S,i,h,"match");let y=d.requiresMobile===!0,k=$(e);return y&&t.isMobile===!1?{kind:"mobile_required",key:"mobile_required",context:i,section:b,checkType:C}:{kind:"liveness",key:"biometric",context:i,section:b,mode:C==="face_match"?"selfie":"liveness",requiresMobile:y,instructions:k===null?"standard":"icao",icao:k,livePhoto:ut(e,C),...h}}case"nfc_chip":return G(i,b,C,"platform_unsupported");default:return G(i,b,C,"update_required")}}var bt=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,_t=Object.freeze({normalize:e=>e.trim().toUpperCase().replace(/\s+/g," "),check:e=>bt.test(e),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"});function Ct(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}var Pt=Object.freeze({normalize:e=>e.trim(),check:e=>Ct(e),registrySources:Object.freeze(["MR.anrpts"]),describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}),kt=Object.freeze({"MR:national_id":Pt});function re(e,t){return kt[`${e.toUpperCase()}:${t}`]??_t}var Rt=Object.freeze({MRT:"MR"});function De(e,t){let i=e.trim().toUpperCase();return re(Rt[i]??i,t)}function Ge(e){let t=De(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}function He(e){return re("MR","national_id").check(e)}function se(e){let t="";for(let i of e){let s=i.codePointAt(0)??0;s>=1632&&s<=1641?t+=String(s-1632):s>=1776&&s<=1785?t+=String(s-1776):i!==" "&&i!=="-"&&i!==" "&&(t+=i)}return t}var Mt=[1e3,2e3,4e3,8e3,15e3],Et=3e4,At=/^\+[1-9]\d{6,14}$/,It=/^\d{6}$/,vt=/^\d{6}$/,Tt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Be=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"]),Ot=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function sn(e){let t=!1,i=null,s="",r=!1,c=!1,p=!1,d={},h={},C=new Set,b=!1,S=null,y="idle",k=new Map,A=new Map,R=(n,o,a)=>{let u=`${n}.${o}`,f=k.get(u);if(f!==void 0)return f;let _=A.get(n),g=(_===void 0?a():_.then(a)).finally(()=>{k.delete(u)});k.set(u,g);let m=g.then(()=>{},()=>{});return A.set(n,m),m.then(()=>{A.get(n)===m&&A.delete(n)}),g},E=async(n,o,a)=>{await e.ensureConsent();let u;try{u=await ye(e.runtime,o)}catch(_){if(_ instanceof F&&Be.has(_.code)){await e.refreshView();return}throw _}if(a?.(),e.destroyed())return;let f=u;f.plan!==void 0&&e.setView!==void 0?e.setView(f):await e.refreshView()},L=async n=>{await e.ensureConsent();let o;try{try{o=await n(e.runtime.client)}catch(a){if(!(a instanceof F)||a.code!=="consent_required")throw a;await e.runtime.ensureConsent({force:!0}),o=await n(e.runtime.client)}}catch(a){if(a instanceof F&&Be.has(a.code)){await e.refreshView();return}throw a}e.destroyed()||(o!==void 0&&e.setView!==void 0?e.setView(o):await e.refreshView())},w=(n,o)=>R("choice",`${n}:${o}`,()=>L(a=>a.choose(n,o))),I=(n,o)=>n.options.some(a=>a.id===o)?w(n.nodeId,o):Promise.reject(new RangeError(`option ${String(o)} is not offered`)),M=(n,o)=>{let a=e.currentView(),u=a===null?void 0:ie(a,n);return u===void 0?Promise.reject(new RangeError(`the ${o} is not offered`)):w(u.nodeId,u.option.id)},H=n=>R("identity",n,()=>L(o=>o.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):o.confirmIdentity(n))),x=(n,o)=>{let a=n.kind,u=a==="phone_otp",f=u?"phone":"email",_={action:"send"};if(u?n.needsPhone:n.needsEmail){let g=o[f]??h[a],m=u?g?.replace(/[\s().-]/g,""):g?.trim();if(m===void 0||!(u?At:Tt).test(m))return Promise.reject(u?new O("phone","format"):new Z("email","format"));_[f]=m}if(u){let g=n.channels,m=o.channel??(g.length===1?g[0]:void 0);if(g.length>0){if(m===void 0)return Promise.reject(new Z("channel","required"));if(!g.includes(m))return Promise.reject(new Z("channel","unavailable"))}m!==void 0&&(_.channel=m),_.phoneRules=1}return R(a,"send",()=>E(a,(g,m)=>g.submitCheck(a,_,{idempotencyKey:m}),()=>{d[a]=e.now(),_[f]!==void 0&&(h[a]=_[f])}))},V=(n,o)=>It.test(o)?R(n,"verify",()=>E(n,(a,u)=>a.submitCheck(n,{action:"verify",code:o},{idempotencyKey:u}))):Promise.reject(new O("code","format")),D=(n,o)=>R("eid_auth",n,()=>E("eid_auth",(a,u)=>a.submitCheck("eid_auth",o,{idempotencyKey:u}))),Y=(n,o)=>{if(n.identifierBound)return D("start",{action:"start"});let a=se(o??"");if(n.country==="MR"){if(!/^\d{10}$/.test(a))return Promise.reject(new O("nni","format"));if(!He(a))return Promise.reject(new O("nni","check_digit"))}else if(a==="")return Promise.reject(new O("nni","format"));return D("start",{action:"start",identifier:a})},B=(n,o,a)=>{if(n.source!=="typed")return Promise.reject(new RangeError("this session already holds the ID number"));let u=se(o);return/^\d{10}$/.test(u)?Ge({type:"national_id",issuingCountry:"MR",number:u})?R("population_registry","submitIdNumber",()=>E("population_registry",(f,_)=>f.submitCheck("population_registry",{idNumber:u,nni:u},{idempotencyKey:_}),()=>{S=`\u2022\u2022\u2022\u2022\u2022\u2022${u.slice(-4)}`})):Promise.reject(new O(a,"check_digit")):Promise.reject(new O(a,"format"))},j=n=>{switch(n.kind){case"phone_otp":case"email_otp":{let o={...n,send:(u={})=>x(n,u),verify:u=>V(n.kind,u),switchTo:()=>n.canSwitch&&n.switchChannel!==void 0?M([n.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option"))},a=d[n.kind];return o.resendAvailableAt===void 0&&a!==void 0&&(o.resendAvailableAt=new Date(a+Et).toISOString()),o}case"eid":return{...n,start:o=>Y(n,o),verify:o=>vt.test(o)?D("verify",{action:"verify",code:o}):Promise.reject(new O("code","format")),resend:()=>n.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):D("resend",{action:"resend"}),useCamera:()=>n.canUseCamera&&n.cameraMethod!==void 0?M(n.cameraMethod==="document_photo"?["document"]:["population_registry"],"camera path"):Promise.reject(new RangeError("the camera path is not offered"))};case"method":return{...n,select:o=>{let a=n.choice.options.find(u=>K[u.service]===o);return a!==void 0?I(n.choice,a.id):Promise.reject(new RangeError(`method ${String(o)} is not offered`))},choose:o=>I(n.choice,o)};case"choice":return{...n,choose:o=>I(n.choice,o)};case"registry":return{...n,submitIdNumber:o=>B(n,o,"idNumber"),submitNni:o=>B(n,o,"nni"),confirm:()=>R("population_registry","confirm",()=>E("population_registry",(o,a)=>o.submitCheck("population_registry",{},{idempotencyKey:a}))),useDocument:()=>n.canUseDocument?M(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered"))};case"document":return e.bindDocument!==void 0?e.bindDocument(n,l):{...n,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(n,l):{...n,uploadFailed:!1,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("portrait capture is not available in this build")}};case"contact_choice":return{...n,select:o=>{let a=o==="phone"?"phone_otp":o==="email"?"email_otp":void 0,u=n.choice.options.find(f=>f.service===a);return u!==void 0?I(n.choice,u.id):Promise.reject(new RangeError(`contact ${String(o)} is not offered`))},choose:o=>I(n.choice,o)};case"identity_summary":return{...n,...n.idNumberMasked===void 0&&n.summaryKind==="partial"&&S!==null?{idNumberMasked:S,nniMasked:S}:{},portrait:async()=>{let o=e.runtime.client;if(!n.portraitAvailable||o.identityPortrait===void 0)return null;try{return await o.identityPortrait()}catch{return null}},confirm:()=>H("confirm"),retake:()=>n.retakeAvailable?H("retake"):Promise.reject(new RangeError("no retake is left"))};case"liveness":return{...n,capture:o=>e.liveness(o),onLivePhoto:o=>n.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(o):()=>{}};case"mobile_required":case"processing":return{...n,refresh:async()=>{r=!1,await e.refreshView()}};case"unsupported":case"result":return{...n};default:{let o=n;throw new Error(`runner: unhandled step ${JSON.stringify(o)}`)}}},J=async()=>{if(!c){c=!0;try{for(let n of Mt){if(await e.sleep(n),!t||e.destroyed())return;let o=await e.refreshView().catch(()=>null);if(o!==null&&q(o,{isMobile:e.isMobile()}).kind!=="processing")return}r=!0,l()}finally{c=!1}}},W=n=>{if(n.kind!=="liveness"||n.mode!=="selfie")return null;let o={kind:"processing",key:"processing",context:n.context,section:n.section,stalled:!1};if(y==="inflight")return o;if(!b||y==="done")return null;let a=e.keptFaceKey?.()??null;return a===null?null:(y="inflight",E("face_match",(u,f)=>u.submitCheck("face_match",{imageKey:a},{idempotencyKey:f}),()=>{y="done"}).then(()=>{y==="inflight"&&(y="done",l())},()=>{y="done",l()}),o)},U=(n,o=!1)=>{if(!t||e.destroyed()||e.chainBusy())return;let a=q(n,{isMobile:e.isMobile()});a.kind==="registry"&&a.recheck&&(b=!0,y="idle"),a=W(a)??a,a.kind==="processing"?a.stalled=r:r=!1;let u=j(a),f=a.kind==="result"?void 0:a.context.switchable,_=f===void 0?u:{...u,chooseOption:m=>I({nodeId:f.nodeId,kind:f.kind,selected:f.current,options:f.options},m)},g=JSON.stringify(_);a.kind==="registry"&&a.source==="document"&&a.state==="pending"&&!C.has("registry")&&(C.add("registry"),_.confirm().catch(m=>{(!(m instanceof F)||Ot.has(m.code))&&C.delete("registry")})),!(!o&&g===s)&&(s=g,i=_,e.emitStep(_),a.kind==="processing"&&!r&&y!=="inflight"&&J(),a.kind==="result"&&!p&&(p=!0,e.emitResult(a.result)))};function l(){let n=e.currentView();n!==null&&U(n,!0)}return{run:async()=>{if(e.destroyed())throw new Error("verification destroyed");t=!0;let n=await e.ensureView();return i===null&&U(n),i??j(q(n,{isMobile:e.isMobile()}))},current:()=>i,onView:n=>U(n),onChainIdle:()=>{let n=e.currentView();n!==null&&U(n)},republish:l,submit:E}}export{Ke as a,xt as b,Pe as c,ke as d,Ht as e,q as f,Mt as g,Et as h,sn as i};
|
package/dist/chunk-4RS4LP7D.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as j,h as be,i as he,j as ye,l as Se}from"./chunk-G6LKLN4U.js";import{f as ge}from"./chunk-TDLIXFDT.js";import{l as fe}from"./chunk-SDWHJJ4W.js";import{a as me,e as pe}from"./chunk-GT2ZLGF7.js";var Ge={low:{maxLongEdge:1920,payloadTargetBytes:7e5,qMin:.7,qMax:.92},mid:{maxLongEdge:2240,payloadTargetBytes:12e5,qMin:.7,qMax:.92},good:{maxLongEdge:2560,payloadTargetBytes:16e5,qMin:.7,qMax:.92}};function qe(e){let{deviceMemory:t,effectiveType:n,saveData:r,downlinkMbps:i,sourceLongEdge:l}=e,s=r===!0||n==="slow-2g"||n==="2g"||i!=null&&i>0&&i<1,u=t!=null&&t<=2,c=n==="4g"||i!=null&&i>=5,f=t!=null&&t>=6,p;s||u?p="low":c&&f?p="good":p="mid";let b=Ge[p],S=l&&l>0?Math.min(b.maxLongEdge,l):b.maxLongEdge;return{tier:p,...b,maxLongEdge:S}}function Me(e){let t={};try{let n=navigator;typeof n.deviceMemory=="number"&&(t.deviceMemory=n.deviceMemory);let r=n.connection;r&&(t.effectiveType=r.effectiveType,t.saveData=r.saveData,t.downlinkMbps=r.downlink)}catch{}return typeof e=="number"&&e>0&&(t.sourceLongEdge=e),qe(t)}function He(e,t,n){let r=Math.min(1,Math.max(0,(e-.28)/.21999999999999997)),i=(t+n)/2;return Math.max(t,n-r*(n-i))}function Xe(e,t,n){let r=Math.max(e,t),i=r>0?Math.min(1,n/r):1;return{width:Math.max(1,Math.round(e*i)),height:Math.max(1,Math.round(t*i))}}async function Ve(e,t){let n=t.startQ,r=await e(n);for(let i=0;i<4&&!(r.size<=t.budgetBytes||n<=t.qMin);i++)n=Math.max(t.qMin,n-.08),r=await e(n);return{blob:r,quality:n}}async function ke(e,t,n,r,i){if(t<=0||n<=0)return null;let{width:l,height:s}=Xe(t,n,r.maxLongEdge),u=document.createElement("canvas");u.width=l,u.height=s;let c=u.getContext("2d");if(!c)return null;c.drawImage(e,0,0,l,s);let f=I=>new Promise((h,w)=>{u.toBlob(d=>d?h(d):w(new Error("canvas toBlob returned null")),"image/jpeg",I)}),p=He(i,r.qMin,r.qMax),{blob:b,quality:S}=await Ve(f,{startQ:p,qMin:r.qMin,budgetBytes:r.payloadTargetBytes}).finally(()=>{u.width=0,u.height=0});if(b.size>5242880)throw new Error("encoded document exceeds the 5242880-byte media cap");return{blob:b,quality:S,width:l,height:s}}async function $(e){let t=Me(Math.max(e.width,e.height)),n=await ke(e,e.width,e.height,t,.5);if(n===null)throw new Error("canvas encode unavailable");return{blob:n.blob,width:n.width,height:n.height}}async function dt(e){let t=await createImageBitmap(e);try{return await $(t)}finally{t.close()}}var pt=250,ft=.6,gt=1800,bt=6e3,ht=2e3,De=.16;function Z(e,t){return{layout:e,phase:"framing",captured:{},pending:[],lastCaptureAt:t,lastReportAt:t,manualShutter:!1,restPhase:"framing",readSides:[],needFlip:!1,flipped:!1,flipTimeoutSpent:!1,timeoutCapture:!1,lastShotByTimeout:!1}}var we=e=>e==="recto"?"verso":"recto",Ce=e=>e.phase==="framing"||e.phase==="locking"||e.phase==="flipCue"||e.phase==="reaskRecto",ee=e=>(e.captured.recto!==void 0?1:0)+(e.captured.verso!==void 0?1:0)+e.pending.length;function J(e,t){return e.lastCaptureAt>=0&&e.lastReportAt>=0?e:{...e,lastCaptureAt:e.lastCaptureAt<0?t:e.lastCaptureAt,lastReportAt:e.lastReportAt<0?t:e.lastReportAt}}function Ye(e,t,n){if(e.phase==="result")return{...e,lastReportAt:n};let r=!t.present||e.captureArea!==void 0&&t.areaFrac<.6*e.captureArea,{flipped:i,awaySince:l}=e;r&&(l=l??n),l!==void 0&&n-l>=250&&(i=!0),r||(l=void 0);let s=e.flipTimeoutSpent&&!(i&&!e.flipped),u={...e,lastReportAt:n,flipped:i,awaySince:l,flipTimeoutSpent:s,lastArea:t.areaFrac};if(!Ce(e))return u;if(e.needFlip&&!i){if(!t.ready)return{...u,phase:e.restPhase,goodSince:void 0};let c=e.lastShot!==void 0&&e.pending.includes(e.lastShot);if(s||c)return{...u,goodSince:void 0,phase:e.restPhase};let f=e.goodSince??n;return n-f>=1800?{...u,goodSince:f,phase:"capturing",flipTimeoutSpent:!0,timeoutCapture:!0}:{...u,goodSince:f,phase:e.restPhase}}return t.ready?{...u,phase:"capturing",goodSince:e.goodSince??n}:{...u,goodSince:void 0,phase:t.locking?"locking":e.restPhase}}function Qe(e,t){if(!Ce(e)||e.manualShutter)return e;let n=t-e.lastReportAt>=2e3,r=t-e.lastCaptureAt>=6e3;return n||r?{...e,manualShutter:!0}:e}function Ke(e,t,n){let r=e.layout==="singlePage",i=r?{recto:t}:e.captured,l=r?[]:[...e.pending,t],s={...e,captured:i,pending:l,lastShot:t,lastCaptureAt:n,lastReportAt:-1,manualShutter:!1,goodSince:void 0,notice:void 0,awaySince:void 0,flipped:!1,lastShotByTimeout:e.timeoutCapture,timeoutCapture:!1,captureArea:e.lastArea};return r||ee({captured:i,pending:l})>=2?{...s,phase:"reading",restPhase:"framing",current:void 0,needFlip:!1}:{...s,phase:"flipCue",restPhase:"flipCue",current:void 0,needFlip:!0}}function Re(e,t,n){return e.pending.includes(t)?{...e,pending:e.pending.filter(r=>r!==t),lastShot:e.lastShot===t?void 0:e.lastShot,phase:e.phase==="capturing"?e.phase:"flipCue",restPhase:"flipCue",current:we(n),needFlip:!0,flipTimeoutSpent:!0,goodSince:void 0,manualShutter:!0,notice:"same_face",lastCaptureAt:-1,lastReportAt:-1}:e}function je(e,t,n){if(!e.pending.includes(t))return e;if(e.captured[n]!==void 0)return Re(e,t,n);let r=e.pending.filter(c=>c!==t),i={...e,pending:r,captured:{...e.captured,[n]:t}};if(ee(i)!==1||e.layout==="singlePage")return i;let l=we(n),s=l==="recto"&&e.restPhase==="reaskRecto"?"reaskRecto":"flipCue",u=e.phase==="flipCue"||e.phase==="reaskRecto"||e.phase==="framing";return{...i,restPhase:s,current:l,phase:u?s:e.phase}}function $e(e,t){let n=t.id??e.captured[t.side],r={...e.captured};(t.id===void 0||r[t.side]===t.id)&&delete r[t.side];let i=e.pending.filter(f=>f!==n),l=e.layout==="twoSided"&&ee({captured:r,pending:i})>0,s=e.lastShotByTimeout||n===e.lastShot!==e.flipped,u=l&&!s,c=u?t.side==="recto"?"reaskRecto":"flipCue":"framing";return{...e,captured:r,pending:i,readSides:e.readSides.filter(f=>f!==t.side),lastShot:e.lastShot===n?void 0:e.lastShot,notice:t.issue,goodSince:void 0,manualShutter:!1,phase:c,restPhase:c,current:t.side,needFlip:u,flipped:!1,flipTimeoutSpent:!1,awaySince:void 0,lastCaptureAt:-1,lastReportAt:-1}}function xe(e,t){switch(t.type){case"report":return Ye(J(e,t.at),t.report,t.at);case"tick":return Qe(J(e,t.at),t.at);case"captured":return Ke(J(e,t.at),t.id,t.at);case"captureFailed":return{...e,phase:e.restPhase,goodSince:void 0,lastCaptureAt:t.at,manualShutter:!0,timeoutCapture:!1};case"classified":return je(e,t.id,t.side);case"duplicate":return Re(e,t.id,t.side);case"readOk":{let n=e.readSides.includes(t.side)?e.readSides:[...e.readSides,t.side],r=["recto","verso"].filter(l=>e.captured[l]!==void 0),i=e.phase==="reading"&&e.pending.length===0&&r.every(l=>n.includes(l));return{...e,readSides:n,flipTimeoutSpent:!1,phase:i?"result":e.phase}}case"readFailed":return $e(e,t);case"clockRestart":return e.lastCaptureAt<0&&e.lastReportAt<0&&e.awaySince===void 0?e:{...e,awaySince:void 0,lastCaptureAt:-1,lastReportAt:-1};case"retake":return{...Z(e.layout,-1),lastCaptureAt:-1,lastReportAt:-1};default:return e}}function Je(e,t,n=!1){let r=e(t);return r===null?"recto":!n||r.y+r.height/2>=t.height/2?"verso":"recto"}async function Ze(e,t=!1){let{detectMrzBand:n}=await import("./mrz-band-VYHOTDHY.js");return Je(n,e,t)}async function te(e,t=480,n,r=n!=null){let i=n??{x:0,y:0,width:e.width,height:e.height},l=Math.max(1,Math.round(i.height/i.width*t)),s=document.createElement("canvas");s.width=t,s.height=l;try{let u=s.getContext("2d");return u===null?"recto":(u.drawImage(e,i.x,i.y,i.width,i.height,0,0,t,l),await Ze(u.getImageData(0,0,t,l),r))}finally{s.width=0,s.height=0}}async function St(e,t=480){try{let n=await createImageBitmap(e),r=Math.max(1,Math.round(n.height/n.width*t)),i=document.createElement("canvas");i.width=t,i.height=r;let l=i.getContext("2d");return l===null?(n.close(),null):(l.drawImage(n,0,0,t,r),n.close(),l.getImageData(0,0,t,r))}catch{return null}}var ne=(e,t,n)=>Math.min(n,Math.max(t,Math.round(e))),V=e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4;async function ve(e,t,n,r){let i=r.decode??(c=>createImageBitmap(c)),l=async()=>e.stillRead(await i(t),r.region??[0,0,1,1],r.detectorLimit),s;try{s=await l()}catch{try{await new Promise(c=>setTimeout(c,r.retryMs??300)),s=await l()}catch{return null}}let u=s.mrzBox;return u===void 0?null:{engine:r.engine,source:"live_mrz",format:n.format,lineCount:ne(n.lineCount,2,3),checkDigitsValid:!0,stillConfirmed:s.valid&&s.digest===n.digest,band:[V(u[0]),V(u[1]),V(Math.min(u[2],1-u[0])),V(Math.min(u[3],1-u[1]))],digest:n.digest,framesToValid:ne(n.framesToValid,1,1e3),msToValid:ne(n.msToValid,0,12e4)}}function kt(e){let t=null;return e?.then(n=>{t=n}),()=>t}var et=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]),tt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,6,64,11,11]);function Le(e,t=globalThis){let n=t.WebAssembly?.validate;if(typeof n!="function")return{ok:!1,reason:"simd"};try{if(!n.call(t.WebAssembly,et)||!n.call(t.WebAssembly,tt))return{ok:!1,reason:"simd"}}catch{return{ok:!1,reason:"simd"}}if(typeof t.Worker!="function")return{ok:!1,reason:"worker"};if(typeof t.createImageBitmap!="function")return{ok:!1,reason:"bitmap"};let r=t.navigator?.deviceMemory;return typeof r=="number"&&r<e.minDeviceMemoryGb?{ok:!1,reason:"memory"}:{ok:!0}}function _e(e=globalThis){let t=e.navigator?.connection;return t?.saveData===!0||["slow-2g","2g","3g"].includes(t?.effectiveType??"")}var T=class extends Error{constructor(t){super(t),this.name="OcrEngineError",this.code=t}};function Te(){let e=t=>(t.close(),Promise.reject(new T("unsupported")));return{ready:Promise.resolve("unsupported"),busy:!1,bandRead:e,stillRead:e,layoutRead:e,dispose:()=>{}}}function Ee(e){let t;try{if(e.createWorker)t=e.createWorker();else if(e.workerUrl!==void 0)t=new Worker(e.workerUrl,{type:"module",name:"sekyro-ocr"});else return Te()}catch{return Te()}let n=new Map,r=0,i=!1,l=!1,s=!1;t.addEventListener("message",d=>{let g=d.data,C=n.get(g.id);C&&(n.delete(g.id),C.resolve(g))});let u=()=>{for(let d of n.values())d.reject(new T("error"));n.clear(),f()};t.addEventListener("error",u),t.addEventListener("messageerror",u);function c(d,g=[]){if(i)return Promise.reject(new T("disposed"));let C=++r;return new Promise((B,O)=>{n.set(C,{resolve:B,reject:O});try{t.postMessage({...d,id:C},g)}catch{n.delete(C),O(new T("error"))}})}function f(){if(!i){i=!0;try{t.postMessage({id:++r,kind:"dispose"})}catch{}t.terminate();for(let d of n.values())d.reject(new T("disposed"));n.clear()}}let p=(async()=>{let d=await c({kind:"init",baseUrl:e.baseUrl,salt:e.salt,detectorLimit:e.tuning.detectorLimit,maxDownloadMs:e.tuning.maxDownloadMs});if(d.kind==="failed")return d.reason;if(d.kind!=="ready")return"error";let g=await c({kind:"warmup"});return g.kind!=="ready"?"error":{warmupMs:g.warmupMs,downloadMs:d.downloadMs,cached:d.cached}})().catch(()=>"error"),b,S=new Promise(d=>{b=setTimeout(()=>d("timeout"),e.tuning.loadTimeoutMs)}),I=Promise.race([p,S]).then(d=>(clearTimeout(b),typeof d=="string"?f():s=!0,i&&typeof d!="string"?"error":d));(e.page===void 0?globalThis.addEventListener?globalThis:null:e.page)?.addEventListener("pagehide",f,{once:!0});async function w(d,g,C){if(i)throw g.close(),new T("disposed");if(!s)throw g.close(),new T("not_ready");if(l)throw g.close(),new T("busy");l=!0;let B;try{let O=new Promise((M,A)=>{B=setTimeout(()=>{A(new T("timeout")),f()},e.tuning.readTimeoutMs??1e4)}),P=await Promise.race([c(d,[g]),O]);if(P.kind===C){let{id:M,...A}=P;return A}throw new T(P.kind==="error"?P.code:P.kind==="failed"?P.reason:"error")}finally{clearTimeout(B),l=!1}}return{ready:I,get busy(){return l},bandRead:(d,g=e.tuning.detectorLimit)=>w({kind:"band",bitmap:d,detectorLimit:g},d,"band"),stillRead:(d,g,C=e.tuning.detectorLimit)=>w({kind:"still",bitmap:d,region:g,detectorLimit:C},d,"band"),layoutRead:(d,g)=>w({kind:"layout",bitmap:d,detectorLimit:g},d,"layout"),dispose:f}}var U="sekyro-ocr-1",re=e=>e!==null&&typeof e=="object"?e:{},v=(e,t,n,r)=>typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n?e:r,Oe=(e,t)=>typeof e=="boolean"?e:t,Pe=e=>{let t=typeof e=="string"?/^sekyro-ocr-(\d{1,4})$/.exec(e):null;return t?Number(t[1]):Number.POSITIVE_INFINITY};function Ae(e,t={}){let n=re(e),r=re(n.liveMrz),i=re(n.frontLock),l=Pe(t.engine??U),s=t.mode==="off",u=d=>d.enabled===!0?d.arm==="live"?"live":"control":null,c=u(r),f=u(i),p=(d,g)=>!s&&g==="live"&&Pe(d.minEngine??U)<=l,b=ye,S=p(r,c)?{detectorLimit:v(r.detectorLimit,320,1600,b.detectorLimit),bandMaxWidthPx:v(r.bandMaxWidthPx,320,4096,b.bandMaxWidthPx),minBandWidthPx:v(r.minBandWidthPx,0,4096,b.minBandWidthPx),bandTop:v(r.bandTop,0,.95,b.bandTop),minIntervalMs:v(r.minIntervalMs,0,5e3,b.minIntervalMs),stableReads:Math.round(v(r.stableReads,1,10,b.stableReads)),profileReads:Math.round(v(r.profileReads,1,100,b.profileReads)),maxReadMs:v(r.maxReadMs,50,6e4,b.maxReadMs),searchTimeoutMs:v(r.searchTimeoutMs,1e3,12e4,b.searchTimeoutMs),hint:Oe(r.hint,!0),stillConfirm:Oe(r.stillConfirm,!0)}:null,I=he,h=(d,g,C)=>v(i[d],g,C,I[d]),w=p(i,f)?{minLines:Math.round(h("minLines",1,50)),fillMin:h("fillMin",0,1),fillMax:h("fillMax",0,2),offsetMax:h("offsetMax",0,1),steadyFillDelta:h("steadyFillDelta",0,1),steadyOffsetDelta:h("steadyOffsetDelta",0,1),layoutShiftMax:h("layoutShiftMax",0,1),lineCountDelta:Math.round(h("lineCountDelta",0,50)),lockMs:h("lockMs",0,3e4),steadyMs:h("steadyMs",0,3e4),minFrames:Math.round(h("minFrames",1,100)),minIntervalMs:h("minIntervalMs",0,5e3),maxWidthPx:h("maxWidthPx",160,2048),detectorLimit:h("detectorLimit",320,1600),searchTimeoutMs:h("searchTimeoutMs",1e3,12e4)}:null;return{enabled:S!==null||w!==null,liveMrz:S,textLock:w,liveMrzArm:c,frontLockArm:f,load:{detectorLimit:S?.detectorLimit??w?.detectorLimit??b.detectorLimit,loadTimeoutMs:v(r.loadTimeoutMs,1e3,12e4,2e4),maxDownloadMs:v(r.maxDownloadMs,1e3,12e4,2e4),minDeviceMemoryGb:v(r.minDeviceMemoryGb,0,64,2)},reportSampleRate:v(r.reportSampleRate,0,1,1)}}function Be(e,t){return e.enabled?!(t.probe??Le)({minDeviceMemoryGb:e.load.minDeviceMemoryGb}).ok||(t.slow??_e)()?{ok:!1,reason:"unsupported"}:{ok:!0,engine:Ee({baseUrl:t.baseUrl,salt:t.salt,tuning:{detectorLimit:e.load.detectorLimit,maxDownloadMs:e.load.maxDownloadMs,loadTimeoutMs:e.load.loadTimeoutMs},...t.workerUrl!==void 0?{workerUrl:t.workerUrl}:{},...t.createWorker!==void 0?{createWorker:t.createWorker}:{},...t.page!==void 0?{page:t.page}:{}})}:{ok:!1,reason:"off"}}function nt(e=typeof navigator<"u"?navigator.userAgent:""){return/SamsungBrowser\//.test(e)?"samsung":/Firefox\/|FxiOS\//.test(e)?"firefox":/Chrome\/|CriOS\/|Chromium\//.test(e)&&!/Edg\/|OPR\//.test(e)?"chrome":/Safari\//.test(e)&&/Version\/|Mobile\//.test(e)&&!/Chrome\/|CriOS\//.test(e)?"safari":"other"}var F=e=>e===void 0||!Number.isFinite(e)?void 0:Math.min(6e5,Math.max(0,Math.round(e))),oe=(e,t,n)=>e===void 0||!Number.isFinite(e)?void 0:Math.min(n,Math.max(t,Math.round(e)));function Ie(e){let t=e.assist??null,n=e.load!==null&&e.load!==void 0&&typeof e.load=="object"?e.load:null,r=typeof e.load=="string"?e.load:null,i=t!==null?t.outcome:r==="unsupported"||r==="download"||r==="integrity"?r:r==="error"||r==="timeout"?"error":"off",l={kind:"live_mrz",platform:"web",engine:e.engine??U,arm:e.arm,capture:e.capture,outcome:i,reads:oe(t?.reads??0,0,1e4)??0,browser:e.browser??nt()},s=(u,c)=>{c!==void 0&&(l[u]=c)};return s("format",t?.format),s("framesToValid",oe(t?.framesToValid,1,1e4)),s("msToValid",F(t?.msToValid)),s("framesToLock",oe(t?.framesToLock,1,1e4)),s("msToLock",F(t?.msToLock)),s("msToCapture",F(e.msToCapture)),s("readP50Ms",F(t?.readP50Ms)),s("readP90Ms",F(t?.readP90Ms)),s("deviceClass",t?.deviceClass),n!==null&&(s("warmupMs",F(n.warmupMs)),s("downloadMs",F(n.downloadMs)),s("cached",n.cached)),s("stillConfirmed",e.stillConfirmed),s("typeMismatch",e.typeMismatch),l}function ae(e,t){return e===void 0?!1:t==="passport"?e!=="TD3":e==="TD3"}var rt=2;async function ot(e){let t=await import("./capture-session-doc-TATPATSZ.js");return new t.CaptureSessionDoc(e)}function at(e){return{topLeft:{x:e.x,y:e.y},topRight:{x:e.x+e.width,y:e.y},bottomRight:{x:e.x+e.width,y:e.y+e.height},bottomLeft:{x:e.x,y:e.y+e.height}}}function it(e,t,n){let r=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft],i=0;for(let l=0;l<r.length;l+=1){let s=r[l],u=r[(l+1)%r.length];i+=s.x*u.y-u.x*s.y}return t>0&&n>0?Math.abs(i)/2/(t*n):0}function Nt(){import("./capture-session-doc-TATPATSZ.js").then(e=>e.warmDocDetector()).catch(()=>{})}function Ut(e){return st(e,{}).handle}function st(e,t){let n=me(),r=pe({enabled:e.keepScreenAwake!==!1}),i=t.decode??(o=>createImageBitmap(o)),l=t.blurRefuseSharpnessMax??.16,s=t.now??(()=>performance.now()),u=e.documentType==="passport"||e.side==="single",c=Z(u?"singlePage":"twoSided",s());if(!u&&(e.side==="recto"||e.side==="verso")){let o=e.side==="recto"?"verso":"recto";c={...c,captured:{[o]:"server"},readSides:[o],current:e.side,phase:"flipCue",restPhase:"flipCue"}}let f="idle",p=null,b=null,S=!0,I=0,h=0,w=!1,d=!1,g="",C=null,B,O=null,P=[],M=t.webOcr!==void 0?Ae(t.webOcr.captureDocument,{mode:e.liveMrz?.mode??"auto"}):null,A=null,z=M===null||!M.enabled?"off":null,G=null,q=null,ie=new WeakMap,Y="";if(M!==null&&M.enabled&&t.webOcr!==void 0){let o=t.webOcr,a=Be(M,{baseUrl:e.liveMrz?.assetBaseUrl??o.baseUrl,salt:o.salt,...e.liveMrz?.workerUrl!==void 0?{workerUrl:e.liveMrz.workerUrl}:{},...o.createWorker!==void 0?{createWorker:o.createWorker}:{}});if(a.ok){A=a.engine;let m=new Se({textLock:M.textLock,liveMrz:M.liveMrz});G=m;let y=a.engine;y.ready.then(L=>{z=L,typeof L!="string"&&S&&m.setEngine(y)})}else z=a.reason}let N=o=>{let a=JSON.stringify(o);a!==Y&&(Y=a,n.emit("mrz",o))},se=(o,a)=>{let m=t.webOcr?.reports;if(m===void 0||M===null||o===void 0)return;let y=o.format==="ID-3"||o.side==="single"?"single":o.side==="verso"?"verso":"recto",L=y!=="recto"?M.liveMrzArm??M.frontLockArm:M.frontLockArm;if(L===null||Math.random()>=M.reportSampleRate)return;let _=o.via==="live_mrz"?q:null,x=()=>{let E=_?.value??null;m([Ie({arm:L,capture:y,assist:o.ocr??null,load:L==="control"?"off":z,...o.msToCapture!==void 0?{msToCapture:o.msToCapture}:{},...E!==null&&E.stillConfirmed!==void 0?{stillConfirmed:E.stillConfirmed}:{},...a!==void 0?{typeMismatch:ae(a.format,e.documentType==="passport"?"passport":"card")}:{}})])};_!==null&&_.value===null?Promise.race([_.promise,new Promise(E=>setTimeout(E,3e3))]).then(x):x()},W=o=>{!S||o===f||(f=o,r.setActive(o==="starting"||o==="scanning"),n.emit("state",o))},We=(o,a)=>a===void 0?null:u?"single":o.captured.recto===a?"recto":o.captured.verso===a?"verso":null,Fe=o=>({phase:o.phase,captured:u?o.captured.recto!==void 0?["single"]:[]:["recto","verso"].filter(a=>o.captured[a]!==void 0),expected:u?null:o.current??null,notice:o.notice??null,lastShot:We(o,o.lastShot),manualShutter:o.manualShutter,torchAvailable:p?.torchAvailable()??!1,torch:d}),ue=()=>{let o=p;o!==null&&o.captureNow().catch(()=>R({type:"captureFailed",at:s()}))};function R(o){if(!S)return;let a=c;c=xe(c,o),c.phase==="capturing"&&a.phase!=="capturing"&&Promise.resolve().then(ue),c.phase==="result"&&a.phase!=="result"&&(W("done"),le());let m=Fe(c),y=JSON.stringify(m);y!==g&&(g=y,n.emit("scan",m))}function le(){O!==null&&clearInterval(O),O=null;for(let o of P.splice(0))o();p?.destroy(),p=null,r.setActive(!1)}let ce=()=>p?.captureReport?.(),Q=!1,de=(o,a)=>{if(!(o===void 0||t.onFaceReport===void 0))try{t.onFaceReport(o,a)}catch{}},H=o=>{Y="",!(p===null||c.phase==="reading"||c.phase==="result")&&(Q=!1,p.rearm(u?"single":c.current??o))},ze=async(o,a,m,y)=>{if(q=null,y!==void 0&&A!==null&&M?.liveMrz?.hint===!0){let D={promise:ve(A,o,y,{engine:U,detectorLimit:M.liveMrz.detectorLimit}).catch(()=>null),value:null};D.promise.then(k=>{D.value=k}),q=D}y!==void 0&&ae(y.format,e.documentType==="passport"?"passport":"card")&&N({state:"mismatch",format:y.format});let L=ce();de(L,"captured"),Q=!0,se(L,y);let _=m===void 0?C:m===null?null:{quad:at(m),frameWidth:0,frameHeight:0,inStill:!0},x={decoded:null},E=()=>(x.decoded??(x.decoded=Promise.resolve().then(()=>i(o)).catch(()=>null)),x.decoded);try{await Ne(o,a,_,E,q)}finally{x.decoded!==null&&(await x.decoded)?.close()}},Ne=async(o,a,m,y,L)=>{let _=`shot-${I+=1}`;if(R({type:"captured",id:_,at:s()}),e.haptics!==!1)try{globalThis.navigator?.vibrate?.(30)}catch{}if(!w&&l>0){let D=await(t.measureSharpness!==void 0?t.measureSharpness(o,m):y().then(k=>k===null?-1:be(k,j(m?.quad??null,m?.inStill===!0?k:{width:m?.frameWidth??0,height:m?.frameHeight??0},k)))).catch(()=>-1);if(!S)return;if(Number.isFinite(D)&&D>=0&&D<l){w=!0;let k=u?"recto":c.current??(c.captured.recto===void 0?"recto":"verso");R({type:"readFailed",side:k,id:_,issue:"blurry"}),H(k);return}}w=!1;let x;if(u)x="single";else{let D=c.current,k=await(t.classify!==void 0?t.classify(o):y().then(X=>X===null?D??"recto":m?.inStill===!0?te(X,480,null,!0):te(X,480,j(m?.quad??null,{width:m?.frameWidth??0,height:m?.frameHeight??0},X)))).catch(()=>D??"recto");if(!S)return;if(c.captured[k]!==void 0&&h<rt){h+=1,R({type:"duplicate",id:_,side:k}),H(k==="recto"?"verso":"recto");return}x=c.captured[k]!==void 0&&D!==void 0?D:k,h=0,R({type:"classified",id:_,side:x})}let E=x==="verso"?"verso":"recto";try{let D=t.encode!==void 0?await t.encode(o):await y().then(k=>{if(k===null)throw new Error("the still could not be decoded");return $(k)});if(!S)return;L!==null&&ie.set(D.blob,L),n.emit("captured",{image:D.blob,side:x,documentType:e.documentType,...e.issuer!==void 0?{issuer:e.issuer}:{},width:D.width,height:D.height,previewDataUrl:a}),t.deferRead!==!0&&R({type:"readOk",side:E})}catch{R({type:"readFailed",side:E,id:_,issue:"technical"}),n.emit("error",{kind:"generic",retryable:!0})}H(E==="recto"?"verso":"recto")},Ue=o=>{P.push(o.on("statechange",({state:a})=>{a==="preflight"||a==="acquiring"?W("starting"):a==="positioning"?W("scanning"):a==="captured"?W("captured"):a==="error"&&W("error")}),o.on("feedback",({key:a,reticle:m})=>n.emit("feedback",{key:a,reticle:m})),o.on("checks",a=>{n.emit("gate",{progress:a.p,quad:a.quad,frameWidth:a.frameWidth,frameHeight:a.frameHeight,...a.guide!==void 0?{guide:{detected:a.guide.detected,fill:a.guide.fill,offsetX:a.guide.offsetX??0,offsetY:a.guide.offsetY??0}}:{}});let m=a.ocr?.mrz;m!==void 0&&(m.state==="fallback"?N({state:"fallback",reason:m.reason}):m.state==="valid"?N({state:"valid",format:m.format}):m.state==="reading"?N({state:"reading",...m.format?{format:m.format}:{},...m.coach?{coach:m.coach}:{}}):N({state:"searching"}));let y=a.quad===null?0:it(a.quad,a.frameWidth,a.frameHeight);C=a.quad===null?null:{quad:a.quad,frameWidth:a.frameWidth,frameHeight:a.frameHeight},R({type:"report",report:{present:a.quad!==null&&a.plausible||a.guide?.detected===!0,ready:a.ready===!0,locking:a.p>=.5,areaFrac:y},at:s()})}),o.on("error",({kind:a,retryable:m})=>n.emit("error",{kind:fe(a),retryable:m})),o.on("artifacts",a=>{ze(a.keyframe,a.previewDataUrl,a.docRegion,a.liveMrz)}))},K=()=>(b??(b=(async()=>{if(S){if(p===null){let o;try{o=await(t.createEngine??ot)({...t.engineOptions??{},...B!==void 0?{guide:B}:{},video:e.video,format:ge(e.documentType),side:u?"single":e.side??"recto",autoCapture:!1,...G!==null?{ocr:G}:{}})}catch{W("error"),n.emit("error",{kind:"generic",retryable:!0});return}if(!S){o.destroy();return}p=o,Ue(o);let a=t.tickMs??500;a>0&&(O=setInterval(()=>R({type:"tick",at:s()}),a))}R({type:"clockRestart"}),M!==null&&M.liveMrzArm==="live"&&(z==="unsupported"||z==="off")&&N({state:"fallback",reason:z}),await p.start()}})().finally(()=>{b=null})),b);return{handle:{get state(){return f},on:(o,a)=>n.on(o,a),start:K,retry:()=>{if(p===null&&c.phase==="result"){R({type:"retake"}),h=0,w=!1,K();return}if(p!==null&&f!=="error"){R({type:"retake"}),h=0,w=!1,p.rearm(u?"single":void 0);return}K()},setSide:o=>{u||o==="single"||(c.current!==o&&(c={...c,current:o}),R({type:"clockRestart"}),c.phase!=="reading"&&c.phase!=="result"&&p?.rearm(o))},shutter:ue,focusAt:(o,a)=>{p?.focusAt?.(o,a)},setGuide:o=>{B=o,p?.setGuide?.(o)},setTorch:o=>{d=o,p?.setTorch(o),R({type:"tick",at:s()})},destroy:()=>{if(S&&p!==null&&f!=="done"){let o=ce();!Q&&o!==void 0&&o.ticks>0&&de(o,"abandoned"),se(o,void 0)}S=!1,le(),G?.setEngine(null),A?.dispose(),A=null,n.clear()}},setFlowState:o=>{(c.phase==="reading"||c.phase==="result")&&W(o==="done"&&c.phase!=="result"?"scanning":o)},settle:(o,a)=>{let m=o==="verso"?"verso":"recto";R(a.ok?{type:"readOk",side:m}:{type:"readFailed",side:m,issue:a.issue}),a.ok||H(m)},takeDeviceRead:o=>ie.get(o.image)?.value??null}}export{dt as a,pt as b,ft as c,gt as d,bt as e,ht as f,De as g,Z as h,xe as i,Je as j,Ze as k,St as l,ve as m,kt as n,U as o,Ae as p,Be as q,nt as r,Ie as s,ae as t,rt as u,Nt as v,Ut as w,st as x};
|
package/dist/chunk-G6MU3B5V.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ue,d as ce}from"./chunk-CJHMFPL6.js";import{a as se}from"./chunk-RI3E7GBN.js";import{a as G,e as re,g as ae,m as oe}from"./chunk-7ZCZY3ZP.js";import{b as ie}from"./chunk-BPE5NSQ2.js";import{a as ee,d as te,e as ne}from"./chunk-GT2ZLGF7.js";import{e as Q}from"./chunk-FUHDOEBP.js";import{d as $,k as Z}from"./chunk-2BFYVMUU.js";var xe=250,be=180,we=96;function le(n){let{data:t,width:e,height:r}=n,a=new Uint8Array(e*r);for(let o=0,u=0;o<a.length;o+=1,u+=4)a[o]=Math.round(.299*(t[u]??0)+.587*(t[u+1]??0)+.114*(t[u+2]??0));return{data:a,width:e,height:r}}function q(n,t){return{x0:Math.max(0,Math.floor(n.x)),y0:Math.max(0,Math.floor(n.y)),x1:Math.min(t.width,Math.ceil(n.x+n.width)),y1:Math.min(t.height,Math.ceil(n.y+n.height))}}function T(n,t,e){let r=q(t,n),a=e===void 0?null:q(e,n),o=0,u=0,s=0,d=0;for(let c=r.y0;c<r.y1;c+=1)for(let y=r.x0;y<r.x1;y+=1){if(a!==null&&y>=a.x0&&y<a.x1&&c>=a.y0&&c<a.y1)continue;let M=n.data[c*n.width+y];o+=1,u+=M,s+=M*M,M>=xe&&(d+=1)}if(o===0)return{mean:0,sd:0,clipped:0,count:0};let m=u/o;return{mean:m,sd:Math.sqrt(Math.max(0,s/o-m*m)),clipped:d/o,count:o}}function me(n){let{box:t}=n,r=(n.leftEye.y+n.rightEye.y)/2-.1*t.height,a=t.y+.85*t.height;return{x:t.x+.15*t.width,y:r,width:.7*t.width,height:Math.max(1,a-r)}}function ve(n,t){let e=me(t),r=T(n,e);if(r.count===0)return null;let a=Math.min(Math.max(t.nose.x,e.x+1),e.x+e.width-1),o=T(n,{x:e.x,y:e.y,width:a-e.x,height:e.height}),u=T(n,{x:a,y:e.y,width:e.x+e.width-a,height:e.height}),s=u.mean>0?o.mean/u.mean:o.mean>0?Number.POSITIVE_INFINITY:1;return{faceLuma:r.mean,halfRatio:s,clipped:r.clipped}}function Ce(n,t){let e=0,r=0;for(let a of[t.leftEyeBox,t.rightEyeBox]){let o=a.width*.15,u=a.height*.5,s=T(n,{x:a.x-o,y:a.y-u,width:a.width+2*o,height:a.height+2*u});e+=s.count,r+=s.clipped*s.count}return e===0?null:r/e}function Pe(n,t){let e=re(t),{box:r}=t,a={x:r.x-.2*r.width,y:e.y,width:1.4*r.width,height:r.y+r.height-e.y},o=0,u=0,s=0;for(let m of[e.x,e.x+.8*e.width]){let c=T(n,{x:m,y:e.y+.04*e.height,width:.2*e.width,height:.25*e.height},a);o+=c.count,u+=c.mean*c.count,s+=(c.sd*c.sd+c.mean*c.mean)*c.count}if(o===0)return null;let d=u/o;return{luma:d,sd:Math.sqrt(Math.max(0,s/o-d*d)),count:o}}function ke(n,t){let e=q(me(t),n),r=Math.max(1,Math.floor(Math.max(e.x1-e.x0,e.y1-e.y0)/we)),a=(m,c)=>n.data[c*n.width+m],o=0,u=0,s=0;for(let m=e.y0+r;m<e.y1-r;m+=r)for(let c=e.x0+r;c<e.x1-r;c+=r){let y=a(c,m-r)+a(c-r,m)+a(c+r,m)+a(c,m+r)-4*a(c,m);o+=1,u+=y,s+=y*y}if(o===0)return null;let d=u/o;return Math.min(1,Math.max(0,s/o-d*d)/be)}function de(n,t){return{lighting:ve(n,t),eyeSpecular:Ce(n,t),background:Pe(n,t),sharpness:ke(n,t)}}var Me="/models-v3",Le=640,Se=1600,Fe=.92;function N(n){return{width:n.videoWidth||0,height:n.videoHeight||0}}function W(n,t){if(typeof document<"u"){let e=document.createElement("canvas");return e.width=n,e.height=t,e}return typeof OffscreenCanvas=="function"?new OffscreenCanvas(n,t):null}function Te(){let n=null;return(t,e)=>{let{width:r,height:a}=N(t);if(r===0||a===0)return null;let o=e===null?1:Math.min(1,e/Math.max(r,a)),u=Math.round(r*o),s=Math.round(a*o),d;e===null?d=W(u,s):((n===null||n.width!==u||n.height!==s)&&(n=W(u,s)),d=n);let m=d?.getContext("2d",{willReadFrequently:!0});if(d==null||m==null)return null;m.drawImage(t,0,0,u,s);let c=null;try{c=m.getImageData(0,0,u,s)}catch{c=null}return{source:d,width:u,height:s,pixels:c}}}async function Ee(n,t,e,r){let a=Math.round(e*t.width/t.height),o=W(a,e),u=o?.getContext("2d");if(o==null||u==null)throw new Error("canvas unavailable");return u.fillStyle="#fff",u.fillRect(0,0,a,e),u.drawImage(n.source,t.x,t.y,t.width,t.height,0,0,a,e),"convertToBlob"in o?o.convertToBlob({type:"image/jpeg",quality:r}):new Promise((s,d)=>{o.toBlob(m=>m===null?d(new Error("encode failed")):s(m),"image/jpeg",r)})}var Y=class extends Error{};function Ie(n,t,e){return new Promise((r,a)=>{let o=setTimeout(()=>{a(new Y(`init exceeded ${t}ms`)),n.then(e,()=>{})},t);n.then(u=>{clearTimeout(o),r(u)},u=>{clearTimeout(o),a(u)})})}function Re(n){let t=$(n),e=t==="overconstrained"?"generic":t;return{kind:e,retryable:e!=="insecure"&&e!=="unsupported"}}function Ge(n,t,e,r){let a=n.length===1?n[0]:void 0,o=a===void 0?null:G(a.landmarks,e,r),u=null;if(a!==void 0&&t.pixels!==null){let s=G(a.landmarks,t.width,t.height),d=le(t.pixels);s!==null&&(u=de(d,s))}return{frameWidth:e,frameHeight:r,faces:n.length,geometry:o,matrix:a?.matrix??null,blendshapes:a?.blendshapes??null,stats:u}}function Xe(n,t={},e=()=>"self"){let r=ie(n.tuning,n.tuningVersion),a=ee(),o=t.now??(()=>performance.now()),u=t.setTimer??((i,l)=>setTimeout(i,l)),s=t.clearTimer??(i=>clearTimeout(i)),d=t.grabFrame??Te(),m=t.encodeRegion??Ee,c=t.getUserMedia??(i=>navigator.mediaDevices.getUserMedia(i)),y=t.createLandmarker??ce,M=n.assetBaseUrl??Me,j=ne({enabled:n.keepScreenAwake!==!1}),L=oe(r,{policy:n.policy??"reject"}),b=n.video,K=se({tuning:r.backgroundCheck,assetBaseUrl:M,...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:o}),h="idle",C=null,x=null,E=null,B=!1,f=!1,g=0,z=0,A=[],w="user",O=!1,he=t.canChooseFacing??te,S=i=>{h===i||f||(h=i,j.setActive(i==="starting"||i==="gating"),a.emit("state",i))},U=()=>{E!==null&&s(E),E=null},I=()=>{U();for(let i of C?.getTracks()??[])i.stop();C=null;try{b.srcObject=null}catch{}},H=i=>{I(),S("error"),a.emit("error",i)},X=()=>{let i=Math.max(o(),z+1);return z=i,i},fe=async i=>{let l=d(b,null),{width:P,height:k}=l??N(b);if(l===null||x===null){L.reset();return}let p=x.detect(l.source,X()),v=(p.length===1?p:A.length===1?A:[])[0],F=v===void 0?null:G(v.landmarks,P,k);if(F===null){L.reset();return}let R=ae(F,P,k,{margin:r.cropMargin,minWidth:r.resolution.minWidth,minHeight:r.resolution.minHeight}),V=Math.max(r.resolution.minHeight,Math.min(R.height,Se)),ye=await m(l,R,V,Fe);if(f||i!==g)return;let J={image:ye,width:Math.round(V*R.width/R.height),height:V,gate:L.summary()};r.tuningVersion!==null&&(J.tuningVersion=r.tuningVersion),U(),S("captured"),a.emit("captured",J)},_=async i=>{if(!(f||i!==g||h!=="gating"||x===null)){if(!B){B=!0;try{let l=d(b,Le);if(l!==null){let{width:P,height:k}=N(b),p=x.detect(l.source,X());A=p;let v=Ge(p,l,P||l.width,k||l.height);v.geometry!==null&&r.background.required&&(v.backgroundCheck=K.measure(l,v.geometry.box,P||l.width,k||l.height));let F=L.push(v,o());if(f||i!==g||(a.emit("gate",F),F.ready&&(await fe(i),h!=="gating")))return}}catch{}finally{B=!1}}!f&&i===g&&h==="gating"&&(E=u(()=>{_(i)},1e3/r.cadenceHz))}},ge=()=>Ie(y(M),2e4,i=>i.close()),pe=async i=>{if(e()!=="assisted")return"user";let l=i??(O?void 0:n.facing);if(l!==void 0)return l;if(O)return w;try{return await he()?"environment":"user"}catch{return"user"}},D=async i=>{if(f||h==="starting"||h==="gating")return;g+=1;let l=g;L.reset(),S("starting");let P=await pe(i?.facing);if(f||l!==g)return;if(C!==null&&P!==w&&I(),w=P,O=!0,C===null&&t.getUserMedia===void 0&&(typeof navigator>"u"||typeof navigator.mediaDevices?.getUserMedia!="function")){H({kind:typeof window<"u"&&window.isSecureContext===!1?"insecure":"unsupported",retryable:!1});return}let k=x!==null?Promise.resolve(x):ge();k.catch(()=>{});try{if(C===null){let p=await c({video:{facingMode:w,width:{ideal:r.camera.width},height:{ideal:r.camera.height}},audio:!1});if(f||l!==g){for(let v of p.getTracks())v.stop();return}C=p,Z(p),w=Q(p)??w,b.srcObject=C,b.muted=!0,b.playsInline=!0,await b.play().catch(()=>{})}}catch(p){!f&&l===g&&H(Re(p));return}try{x=await k}catch{!f&&l===g&&H({kind:"generic",retryable:!0});return}f||l!==g||(S("gating"),_(l))};return{handle:{get state(){return h},get captureMode(){return e()},get facingMode(){return w},on:(i,l)=>a.on(i,l),start:D,retry:()=>{if(!f){if(C!==null&&x!==null&&h!=="error"){g+=1;let i=g;U(),L.reset(),S("gating"),_(i);return}h="idle",D()}},switchCamera:()=>{if(f||e()!=="assisted"||h!=="idle"&&h!=="starting"&&h!=="gating"&&h!=="error")return!1;let i=w==="user"?"environment":"user";return g+=1,I(),w=i,h="idle",D({facing:i}),!0},destroy:()=>{f||(g+=1,I(),j.setActive(!1),f=!0,x?.close(),x=null,K.close(),a.clear())}},setFlowState:i=>{(h==="captured"||h==="uploading"||h==="checking"||h==="done"&&i==="done")&&S(i)}}}function Je(){import("@mediapipe/tasks-vision").catch(()=>{})}export{xe as a,be as b,le as c,T as d,ve as e,Ce as f,Pe as g,ke as h,de as i,Le as j,Se as k,Fe as l,Te as m,Ge as n,Xe as o,Je as p};
|