@sekyro/web 0.1.0-rc.31 → 0.1.0-rc.33
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 +16 -0
- package/README.md +1 -0
- package/dist/{capture-session-doc-2LIRRKFX.js → capture-session-doc-FAMDLRRZ.js} +1 -1
- package/dist/{capture-session-v3-XtBrXpoW.d.cts → capture-session-v3-BS2Rl4Kp.d.cts} +1 -1
- package/dist/{capture-session-v3-Fbj-X2Ij.d.ts → capture-session-v3-CYh0Jmyf.d.ts} +1 -1
- package/dist/{challenge-frame-YAQJ5YMB.js → challenge-frame-YBTLAQ5G.js} +1 -1
- package/dist/{chunk-TN4JWBFJ.js → chunk-65YTEYLU.js} +1 -1
- package/dist/chunk-B5H5ED6O.js +1 -0
- package/dist/{chunk-GXL6ZD4I.js → chunk-C4WK5D33.js} +1 -1
- package/dist/{chunk-3K3A7O7J.js → chunk-G2BD6INN.js} +1 -1
- package/dist/{chunk-SUANHBF4.js → chunk-HFRU66NW.js} +1 -1
- package/dist/{chunk-XFDWFJLY.js → chunk-IUNPV67T.js} +1 -1
- package/dist/chunk-MJKHDXCU.js +1 -0
- package/dist/{chunk-MD4YXLPK.js → chunk-NO22WG7R.js} +1 -1
- package/dist/{chunk-6Z4MIKGF.js → chunk-W6Y2335Q.js} +1 -1
- package/dist/chunk-YDG77RHN.js +1 -0
- package/dist/{chunk-2MX4J26D.js → chunk-YL2B72KC.js} +2 -2
- package/dist/chunk-ZVD6VHM2.js +1 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -1
- package/dist/create-document-capture-WFTNVMCE.js +1 -0
- package/dist/{create-verification-lXGU3ac4.d.cts → create-verification-BAoA5Z9o.d.cts} +10 -5
- package/dist/{create-verification-RdG6qv51.d.ts → create-verification-C1Svvmup.d.ts} +10 -5
- package/dist/{detector-scanic-KMAVOHGF.js → detector-scanic-S4PB2RNW.js} +1 -1
- package/dist/{icao-gate-Cp1C4IEZ.d.ts → icao-gate-BBStoG81.d.ts} +11 -3
- package/dist/{icao-gate-DVNkPclI.d.cts → icao-gate-C731iewN.d.cts} +11 -3
- package/dist/{icao-policy-CcrwfsVr.d.ts → icao-policy-Dy5Z1vSp.d.ts} +2 -2
- package/dist/{icao-policy-c2Ykm9r2.d.cts → icao-policy-R7Jk5qF_.d.cts} +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +2 -2
- package/dist/internal/index.d.cts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +1 -1
- package/dist/{plan-runner-T2ZTSBI4.js → plan-runner-LSQTIO6L.js} +1 -1
- package/dist/{types-B47mZ5TT.d.cts → types-BjzuJVOc.d.cts} +5 -2
- package/dist/{types-B47mZ5TT.d.ts → types-BjzuJVOc.d.ts} +5 -2
- package/package.json +1 -1
- package/sbom.cdx.json +19 -19
- package/dist/chunk-6ERQTXMY.js +0 -1
- package/dist/chunk-CMXN4SOZ.js +0 -1
- package/dist/chunk-OUC57KMS.js +0 -1
- package/dist/chunk-R3JMNYW5.js +0 -1
- package/dist/create-document-capture-X35M4UAK.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-
|
|
2
|
-
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-
|
|
1
|
+
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-BAoA5Z9o.cjs';
|
|
2
|
+
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-BAoA5Z9o.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-CVqpMNGA.cjs';
|
|
4
|
-
import { a9 as HostedSessionView, h as CheckType, aG as PlanStepView } from '../types-
|
|
5
|
-
export { bs as ICAO_FALLBACK, bm as IcaoCaptureTuning, bt as IcaoProfile, bu as ResolvedIcaoTuning, bv as resolveIcaoTuning } from '../types-
|
|
6
|
-
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-
|
|
4
|
+
import { a9 as HostedSessionView, h as CheckType, aG as PlanStepView } from '../types-BjzuJVOc.cjs';
|
|
5
|
+
export { bs as ICAO_FALLBACK, bm as IcaoCaptureTuning, bt as IcaoProfile, bu as ResolvedIcaoTuning, bv as resolveIcaoTuning } from '../types-BjzuJVOc.cjs';
|
|
6
|
+
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-C731iewN.cjs';
|
|
7
7
|
import '../detect-worker-CHqsPJoM.cjs';
|
|
8
|
-
import '../capture-session-v3-
|
|
8
|
+
import '../capture-session-v3-BS2Rl4Kp.cjs';
|
|
9
9
|
|
|
10
10
|
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
11
11
|
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-
|
|
2
|
-
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-
|
|
1
|
+
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-C1Svvmup.js';
|
|
2
|
+
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-C1Svvmup.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-CVqpMNGA.js';
|
|
4
|
-
import { a9 as HostedSessionView, h as CheckType, aG as PlanStepView } from '../types-
|
|
5
|
-
export { bs as ICAO_FALLBACK, bm as IcaoCaptureTuning, bt as IcaoProfile, bu as ResolvedIcaoTuning, bv as resolveIcaoTuning } from '../types-
|
|
6
|
-
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-
|
|
4
|
+
import { a9 as HostedSessionView, h as CheckType, aG as PlanStepView } from '../types-BjzuJVOc.js';
|
|
5
|
+
export { bs as ICAO_FALLBACK, bm as IcaoCaptureTuning, bt as IcaoProfile, bu as ResolvedIcaoTuning, bv as resolveIcaoTuning } from '../types-BjzuJVOc.js';
|
|
6
|
+
export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-BBStoG81.js';
|
|
7
7
|
import '../detect-worker-CHqsPJoM.js';
|
|
8
|
-
import '../capture-session-v3-
|
|
8
|
+
import '../capture-session-v3-CYh0Jmyf.js';
|
|
9
9
|
|
|
10
10
|
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
11
11
|
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
package/dist/internal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-
|
|
1
|
+
import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-G2BD6INN.js";import{a as W,b as ve,c as ge,d as he,e as Ge,f as be,g as He,h as Ye,i as Ue,j as k,k as K,l as w,m as X,n as Z,o as J,p as Q,q as j,r as q,s as $,t as ee,u as te,x as re}from"../chunk-W6Y2335Q.js";import{a as Bt,b as Vt,c as Xt,d as Zt,e as Jt,f as Qt,g as jt,h as qt,i as $t,j as ne,k as ie,m as se,n as Ee}from"../chunk-VWGKUQ3C.js";import{a as Ft,b as Nt,c as vt,d as gt,e as ht,f as Gt,g as bt,h as Ht,i as Yt,j as Ut,k as Wt,l as kt,m as Kt}from"../chunk-53POX7U4.js";import{a as wt,b as zt}from"../chunk-33KKMPJ5.js";import{b as oe,c as pe,d as ae}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import"../chunk-GI3UFGRQ.js";import{a as P,b as d,c as M,d as F,e as N}from"../chunk-ZVD6VHM2.js";import{A as Ct,B as At,C as Ot,D as xt,E as It,F as ut,G as Dt,H as Pt,I as dt,J as Mt,a as Ke,b as we,c as ze,d as je,e as qe,f as $e,g as et,h as tt,i as rt,j as ot,k as pt,l as at,m as nt,n as it,o as st,p as Et,q as mt,r as _t,s as Lt,t as lt,u as ct,v as St,w as Rt,x as yt,y as Tt,z as ft}from"../chunk-IUNPV67T.js";import{a as v,b as g,c as h,d as G,e as b,f as H,g as Y,h as U,i as z,j as B,l as V}from"../chunk-G6LKLN4U.js";import{a as We,b as ke}from"../chunk-SMKCBUJL.js";import{a as Be,b as Ve,c as Xe,d as Ze,e as Je,f as Qe}from"../chunk-C4WK5D33.js";import{b as De,c as Pe,d as de,e as Me,f as Fe,g as Ne}from"../chunk-MJKHDXCU.js";import{b as ye,c as Te,d as fe,e as Ce,g as Ae,h as er,i as tr,j as rr,k as or,l as pr,m as ar,z as Oe}from"../chunk-YL2B72KC.js";import{A as I,C as u,D,i as c,j as S,k as R,l as y,o as T,v as f,w as C,x as A,y as O,z as x}from"../chunk-HFRU66NW.js";import{a,b as n,c as i,d as s,i as E,j as m,k as _,l as L,n as l}from"../chunk-B5H5ED6O.js";import"../chunk-7QZWBDI5.js";import"../chunk-65YTEYLU.js";import"../chunk-SX7TUC3V.js";import"../chunk-POIQGEZM.js";import{p as xe,q as Ie,r as ue}from"../chunk-CPUECYAJ.js";import"../chunk-FPXL63KZ.js";import"../chunk-YDG77RHN.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-TSA6GHUG.js";import"../chunk-NO22WG7R.js";import"../chunk-FSSMUAKC.js";import{a as Re}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ne as ANALYSIS_LONG_EDGE,De as ASPECT_BANDS,I as AttestationError,He as BLUR_REFUSE_SHARPNESS_MAX,Mt as CAPTURE_CANDIDATE_SPACING_MS,dt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,M as CHALLENGE_EXECUTE_TIMEOUT_MS,d as CHALLENGE_READY_TIMEOUT_MS,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,f as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,P as ChallengeError,tr as DOCUMENT_TYPE_ORDER,je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,Ot as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,tt as DOC_CAMERA_TUNING_DEFAULTS,Me as DOC_CATALOG,Be as DOC_DETECT_WIDTH,Ke as DOC_FEEDBACK_STATES,Ct as DOC_FIRST_FRAME_MS,Ve as DOC_GATE_V1_DEFAULTS,It as DOC_SHUTTER_DEFAULTS,V as DocAssist,ze as DocFeedbackAggregator,Qe as DocGateV1,Lt as EMPTY_GUIDE_METRICS,ge as FLIP_FILL_MIN,ve as FLIP_GAP_MS,he as FLIP_TIMEOUT_MS,Rt as GUIDE_LOCK_DEFAULTS,Tt as GuideLock,gt as ICAO_CANVAS,wt as ICAO_FALLBACK,Ht as ICAO_GATE_CRITERIA,Vt as ICAO_SHARP_REF,O as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,er as ISSUER_CODES,oe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,xe as LENS_TRY_MAX,B as LIVE_MRZ_DEFAULTS,_e as LIVE_PHOTO_IDLE_MS,me as LIVE_PHOTO_MAX_HZ,Ge as MANUAL_SHUTTER_MS,We as MRZ_BAND_DEFAULTS,Fe as MR_DOC_CATALOG,be as NO_REPORT_MS,Re as OCR_ASSET_SET,ce as OTP_RESEND_COOLDOWN_MS,ie as PORTRAIT_JPEG_QUALITY,a as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,le as PROCESSING_BACKOFF_MS,Te as PROCESSING_POLL_DELAY_MS,fe as PROCESSING_POLL_MAX,h as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,te as SAME_FACE_MAX_DROPS,v as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,C as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,J as WEB_OCR_ENGINE,or as acceptedIssuers,rr as acceptedTypesFor,et as analyzeDocFrame,ct as analyzeGuide,Pe as aspectBand,de as aspectFits,jt as backgroundStats,q as browserFamily,X as buildDeviceReadHint,K as classifyCardSide,k as classifyCardSideWith,st as coverPointToVideo,re as createDocumentCaptureInternal,ae as createFaceLandmarker,Kt as createIcaoGate,Le as createLivePhotoKit,l as createLivenessCaptureInternal,Ee as createPortraitCaptureInternal,Se as createStepRunner,Ae as createVerificationInternal,b as cropImage,e as detectFormFactor,t as detectIsMobile,ke as detectMrzBand,Et as docZoomFor,W as encodeDocumentImage,N as executeChallenge,vt as eyeLineRoll,Ut as eyeOpenness,Qt as eyeSpecular,Ft as faceGeometry,Jt as faceLighting,qt as faceSharpness,pe as facesOf,we as feedbackVoteOf,ar as flagOf,mt as focusOk,ee as formatMismatch,R as frontierStep,St as guideQuad,lt as guideRegionInFrame,$t as icaoPixelStats,ht as icaoWindow,Ye as initialScanState,c as isExecutable,S as isTerminalView,Yt as judgeIcao,Ie as lensKindOf,$ as liveMrzWireReport,Xt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,T as mapSessionResult,U as measureBitmapSharpness,Y as measureRegionSharpness,Ue as nextScanState,se as observePortraitFrame,_t as openDocCamera,Pt as passportBandOf,Wt as percentile,g as photoSharpness,bt as portraitCropRegion,Oe as portraitMatchStep,Nt as poseFromMatrix,E as preloadedDetectorFactory,Xe as quadAreaFrac,Je as quadBounds,Ze as quadIou,$e as quadTiltRatio,Ce as randomUuid,ue as rankBackCameras,pt as readStoredLens,Zt as regionStats,F as resetChallengeFrameForTests,s as resetLivenessAssetsForTests,H as resizeLongEdge,pr as resolveAcceptedDocuments,rt as resolveDocCameraTuning,ut as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,Q as resolveWebOcrPlan,D as runLivenessFlow,u as runSubmission,Ne as scannerFormatFor,kt as scoreFrame,i as setPreloadLoaderForTests,Z as settledHint,it as singleShotFocusAt,qe as specularFraction,j as startWebOcr,y as stepOf,G as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ft as warmDocDetector,Gt as windowOverflow,at as writeStoredLens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as te}from"./chunk-ZKF2XMNX.js";import"./chunk-JLVZ35QK.js";import{a as J,b as W,e as Z,f as O,g as V,j as ee}from"./chunk-3K3A7O7J.js";import{x as q}from"./chunk-6Z4MIKGF.js";import{n as X}from"./chunk-VWGKUQ3C.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import{F as Q,i as $,x as N}from"./chunk-XFDWFJLY.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-GXL6ZD4I.js";import"./chunk-R3JMNYW5.js";import{b as H,c as j,r as z,t as K,u as B}from"./chunk-SUANHBF4.js";import"./chunk-6ERQTXMY.js";import"./chunk-7QZWBDI5.js";import"./chunk-TN4JWBFJ.js";import{b as G}from"./chunk-SX7TUC3V.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as D,i as Y}from"./chunk-OUC57KMS.js";import"./chunk-TSA6GHUG.js";import{a as F}from"./chunk-MD4YXLPK.js";import"./chunk-FSSMUAKC.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";var le=2e4,ue=new Set(["media_type_unsupported","media_type_mismatch"]),ne=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function re(e){let o=null,h=Promise.resolve(),c=!1,_=null,S=null,C=!1,E=null,A=!1,M=!1,T=()=>{o?.controller.handle.destroy(),o=null},u=()=>{let t=e.currentView(),n=t===null?null:V(t,{isMobile:e.isMobile()});return n?.kind==="portrait"?n:null},a=()=>{if(e.destroyed())return"self";let t=e.currentView(),n=t===null?void 0:O(t);return n==="self"||n==="assisted"?n:n==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??K(n??z(t),null)},f=e.captureModeSwitch,m=f===void 0?void 0:{session:()=>{let t=e.currentView();return t!==null&&O(t)==="choice"?"choice":a()},onModeChange:t=>f.choose(t)},y=async(t,n)=>{if(e.destroyed())return;let d=a();n.setFlowState("uploading"),c=!1;let s=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(s===null){let k=await B(r,"image","image/jpeg",t.image.size,{engine:"portrait"});await r.uploadToSpaces(k.uploadUrl,t.image,"image/jpeg"),s=(await r.completeMedia(k.key)).key}n.setFlowState("checking");let g={media:{portrait:s},gate:Y(t.gate),...t.tuningVersion!==void 0?{tuningVersion:t.tuningVersion}:{},source:"camera",capture:{mode:d,facingMode:t.facingMode}};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){c=!0,r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{})}if(n.setFlowState("done"),e.destroyed())return;let i=u();(i===null||i.phase!=="capture")&&o?.controller===n&&T(),e.runner().republish()},R=t=>e.runner().submit("face_match",(n,d)=>n.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:d})).then(()=>{},()=>{c=!0,t()}),b=null,w=async t=>{let n=u();if(n===null||n.phase!=="capture"||!n.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:d}=await import("./upload-file-EGXXM6TQ.js"),s=await d(t,e.uploadInternals);if(e.destroyed())return;T(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(i===null){let k=await r.presign("image",s.contentType,s.blob.size,{source:"upload"});await r.uploadToSpaces(k.uploadUrl,s.blob,s.contentType),i=(await r.completeMedia(k.key)).key}let g={media:{portrait:i},source:"upload"};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){throw r instanceof D&&ue.has(r.code)?new TypeError("unsupported_file"):(r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{}),r)}},P=null,I=t=>{if(P!==null)return P;let n=u();if(n===null||n.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let d={fixReview:{accept:t}},s=e.runner().submit("portrait_icao",(i,r)=>i.submitCheck("portrait_icao",d,{idempotencyKey:r})).catch(async i=>{throw i instanceof D&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{P=null});return P=s,s},l=t=>{let n=()=>w(t),d=(b===null?n():b.then(n,n)).finally(()=>{b===d&&(b=null)});return b=d,d};return{bind:(t,n)=>{if(t.phase==="review")return T(),{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("the adjusted photo waits for confirmFix()")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:I};if(t.phase==="match")return T(),_!==t.attemptsRemaining&&!c&&(_=t.attemptsRemaining,R(n)),{...t,uploadFailed:c,resubmit:()=>(c=!1,_=t.attemptsRemaining,n(),R(n)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:I};if(_=null,t.reuse===!0&&t.phase==="capture")return T(),!A&&E!==t.attemptsRemaining&&(E=t.attemptsRemaining,A=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{M=!1},()=>{M=!0}).finally(()=>{A=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:M&&!A,refresh:()=>(M=!1,E=null,n(),Promise.resolve())};let d=e.keptPortraitInput?.()??null;return d!==null&&(C||d!==S&&t.report===null&&t.reason===void 0&&!t.retakeOnly)?(C||(S=d,C=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",d,{idempotencyKey:i})).catch(()=>{}).finally(()=>{C=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:!1,refresh:()=>Promise.resolve()}):{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:s=>{if(o!==null&&o.video===s.video)return o.controller.handle;T(),c=!1;let i=X({video:s.video,tuning:t.tuning,tuningVersion:t.tuningVersion,...t.icao!=null?{policy:t.icao.policy}:{},...s.keepScreenAwake!==void 0?{keepScreenAwake:s.keepScreenAwake}:{},...s.assetBaseUrl!==void 0?{assetBaseUrl:s.assetBaseUrl}:{}},e.internals,a,m);o={video:s.video,controller:i};let r=i.handle.destroy;i.handle.destroy=()=>{o?.controller===i&&(o=null),r()},i.handle.on("error",k=>{e.reportCaptureIssue?.(H("portrait",k,0))});let v=!1,g=(k,L)=>{let x=i.gateScores();x!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:k,...L!==null?{failing:L}:{},...x})};return i.handle.on("gate",k=>{!v&&!k.ready&&(i.gateScores()?.elapsedMs??0)>=le&&(v=!0,g("stuck",k.failing))}),i.handle.on("captured",k=>{g("captured",null),v=!1,h=h.then(()=>y(k,i)).catch(()=>{})}),i.handle},uploadPortrait:l,confirmFix:I}},destroy:T}}var de=.92,ce=()=>G("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),pe=e=>{let o=document.createElement("canvas");o.width=e.videoWidth,o.height=e.videoHeight;let h=o.getContext("2d");return h===null||o.width===0||o.height===0?Promise.reject(new Error("the camera has no frame yet")):(h.drawImage(e,0,0,o.width,o.height),new Promise((c,_)=>o.toBlob(S=>S===null?_(new Error("the still could not be encoded")):c(S),"image/jpeg",de)))},me=(e,o)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=o,e.play().catch(()=>{})}catch{}};function oe(e){let o=null,h=null,c=u=>{let a=(h===null?u():h.then(u,u)).finally(()=>{h===a&&(h=null)});return h=a,a},_=()=>{o?.handle.destroy(),o=null},S=()=>{let u=e.currentView(),a=u===null?null:V(u,{isMobile:e.isMobile()});return a?.kind==="proof_of_address"?a:null},C=async(u,a)=>{if(a.length===0)throw new RangeError("no_pages");if(a.length>u.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:f,prepareUploadFile:m}=await import("./upload-file-EGXXM6TQ.js"),y=await Promise.all(a.map(b=>f(b)));if(y.includes("bad"))throw new TypeError("unsupported_file");if(y.includes("pdf")){if(a.length>1)throw new RangeError("too_many_pages");let b=a[0];if(b.size>u.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:b,contentType:"application/pdf"}]}let R=[];for(let b of a){let w=await m(b,e.uploadInternals);R.push({kind:"image",blob:w.blob,contentType:w.contentType})}return R},E=async(u,a,f)=>{let m=null;try{await e.runner().submit("poa",async(y,R)=>{if(m===null){let w=[];for(let P of f){let I=a==="upload"?await y.presign(P.kind,P.contentType,P.blob.size,{source:"upload"}):await B(y,P.kind,P.contentType,P.blob.size,{engine:"poa_page"});await y.uploadToSpaces(I.uploadUrl,P.blob,P.contentType),w.push((await y.completeMedia(I.key)).key)}m=w}let b=f[0]?.kind==="document_file"?{part:u,source:"upload",pdfKey:m[0]}:{part:u,source:a,imageKeys:m};return y.submitCheck("poa",b,{idempotencyKey:R})})}catch(y){throw y instanceof D&&(y.code==="media_type_unsupported"||y.code==="media_type_mismatch")?new TypeError("unsupported_file"):(y instanceof D&&(y.code==="document_upload_not_allowed"||y.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),y)}},A=async(u,a)=>{let f=S();if(f===null||!f.photo.uploadOffered)throw new RangeError("upload_not_offered");if(u==="holder_letter"&&f.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let m=await C(f,a);e.destroyed()||(_(),await E(u,"upload",m))},M=(u,a)=>{let f=null,m=[],y=!0,R=()=>{for(let w of f?.getTracks()??[])w.stop();f=null},b={get pages(){return m},start:async()=>{if(!y||f!==null)return;let w=await(e.pageCamera?.open??ce)();if(!y){for(let P of w.getTracks())P.stop();return}f=w,(e.pageCamera?.attach??me)(u,w)},takePage:async()=>{if(m.length>=a)throw new RangeError("too_many_pages");let w=await(e.pageCamera?.grab??pe)(u);if(m.length>=a)throw new RangeError("too_many_pages");return m=[...m,w],w},removePage:w=>{m=m.filter((P,I)=>I!==w)},submitPages:()=>c(async()=>{if(m.length===0)throw new RangeError("no_pages");let w=S();if(w===null)throw new RangeError("camera_not_offered");let P=w.phase==="holder_letter"?"holder_letter":"document";await E(P,"camera",m.map(I=>({kind:"image",blob:I,contentType:"image/jpeg"}))),o?.handle===b?_():b.destroy()}),destroy:()=>{y=!1,m=[],R(),o?.handle===b&&(o=null)}};return b},T=async()=>{let u=S();if(u===null||!u.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;_();let a={part:"document"};await e.runner().submit("poa",(f,m)=>f.submitCheck("poa",a,{idempotencyKey:m}))};return{bind:u=>({...u,...u.licenceAddressAccepted?{useLicenceAddress:()=>c(T)}:{},uploadPages:a=>c(()=>A("document",a)),uploadHolderLetter:a=>c(()=>A("holder_letter",a)),capturePage:a=>{if(u.photo.source==="upload")throw new RangeError("camera_not_offered");if(o!==null&&o.video===a.video)return o.handle;_();let f=M(a.video,u.maxPages);return o={video:a.video,handle:f},f}}),destroy:_}}function ie(e){let o=e;if(typeof o.apiOrigin!="string"||typeof o.sessionToken!="string")return;let h=`${o.apiOrigin}/api/v2/hosted/capture-reports`,c=o.sessionToken;return _=>{try{fetch(h,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${F}`},body:JSON.stringify({reports:_}),keepalive:!0}).catch(()=>{})}catch{}}}function ae(e){let o=e.apiOrigin;return te("sdk",typeof o=="string"&&/staging|sandbox|localhost/.test(o)?"sandbox":"live")}function fe(e){return ae(e).replace(/\/ocr$/,"/barcode")}function ze(e){let o=null,h=null,c=null,_=j(),S=Promise.resolve(),C=()=>{c?.flow.handle.destroy(),c=null},E=l=>l===null?{}:{documentType:l.documentType,documentCountry:l.issuer},A=async(l,p,t)=>{if(e.destroyed())return;p.setFlowState("uploading");let n=null,d=E(t),s,i=!1,r=e.currentView()?.documents!==void 0;try{await o.submit("doc_ocr",async(x,se)=>{if(n===null){let U=await B(x,"image","image/jpeg",l.image.size,{engine:"document"});await x.uploadToSpaces(U.uploadUrl,l.image,"image/jpeg"),n=(await x.completeMedia(U.key)).key}return p.setFlowState("checking"),s===void 0&&(s=p.takeDeviceRead(l)),x.submitCheck("doc_ocr",{imageKey:n,side:l.side,...s!==null?{deviceRead:s}:{},...r?{source:"camera"}:{},...d},{idempotencyKey:se})})}catch{i=!0}finally{p.setFlowState("done")}if(e.destroyed())return;if(i){p.settle(l.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),g=v===null?null:V(v,{isMobile:e.isMobile()});if(g?.kind!=="document"){p.settle(l.side,{ok:!0}),c?.flow===p?C():p.handle.destroy();return}if(g.reason==="document_type_not_accepted"||g.reason==="document_type_not_supported"){h=null,c?.flow===p&&C(),o.republish();return}let k=g.acceptedSides;l.side!=="single"&&(k.includes(l.side)||g.reason==="side_missing")&&!(k.includes("recto")&&k.includes("verso"))?(p.settle(l.side,{ok:!0}),h?.documentType!=="passport"&&p.handle.setSide(g.side)):g.reason==="document_sides_mismatch"&&k.length===0?(p.settle(l.side,{ok:!1,issue:"reread"}),p.handle.retry()):p.settle(l.side,{ok:!1,issue:"reread"})},M=null,T=async l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="document")throw new RangeError("upload_not_offered");if(!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let n=h,d=n?.documentType==="passport"?"single":t.side,{prepareUploadFile:s}=await import("./upload-file-EGXXM6TQ.js"),i=await s(l,e.uploadInternals);if(e.destroyed())return;C();let r=null,v=E(n);try{await o.submit("doc_ocr",async(g,k)=>{if(r===null){let L=await g.presign("image",i.contentType,i.blob.size,{source:"upload"});await g.uploadToSpaces(L.uploadUrl,i.blob,i.contentType),r=(await g.completeMedia(L.key)).key}return g.submitCheck("doc_ocr",{imageKey:r,side:d,source:"upload",...v},{idempotencyKey:k})})}catch(g){throw g instanceof D&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof D&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),g)}},u=(l,p)=>({...l,uploadDocument:t=>{let n=()=>T(t),d=(M===null?n():M.then(n,n)).finally(()=>{M===d&&(M=null)});return M=d,d},issuer:h?.issuer??null,documentType:h?.documentType??null,captureSide:h===null?null:h.documentType==="passport"?"single":l.side,selectDocument:(t,n)=>{if(!W(l.documents).includes(t)||!J(l.documents,t).includes(n))throw new RangeError(`${n} from ${t} is not accepted`);(h?.issuer!==t||h.documentType!==n)&&C(),h={issuer:t,documentType:n},p()},capture:t=>{if(h===null)throw new Error("selectDocument() first");if(c!==null&&c.video===t.video)return c.flow.handle;C();let n=h,d=n.documentType==="passport"?"single":l.acceptedSides.length>0?l.side:void 0,s=q({video:t.video,documentType:n.documentType,issuer:n.issuer,...d!==void 0?{side:d}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.liveMrz!==void 0?{liveMrz:t.liveMrz}:{},...t.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:t.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let r=e.currentView()?.capture?.document,v=e.documentInternals?.blurRefuseSharpnessMax??r?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:$(r?.camera),shutter:Q(r?.scan),guideLock:N(r?.guide),...e.documentInternals?.engineOptions??{}},...typeof v=="number"&&Number.isFinite(v)&&v>=0&&v<=1?{blurRefuseSharpnessMax:v}:{},catalogCapture:e.documentInternals?.catalogCapture??r?.catalog===!0}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:fe(e.runtime.client)}},...(()=>{let r=e.currentView();if(r===null||e.documentInternals?.webOcr!==void 0)return{};let v=ie(e.runtime.client);return{webOcr:{captureDocument:r.capture?.document,salt:r.sessionId,baseUrl:ae(e.runtime.client),...v!==void 0?{reports:v}:{}}}})()});c={video:t.video,flow:s};let i=s.handle.destroy;return s.handle.destroy=()=>{c?.flow===s&&(c=null),i()},_.newHandle(),s.handle.on("state",r=>_.note(r)),s.handle.on("error",r=>{_.noteError(),e.reportCaptureIssue?.(H("document",r,_.value))}),s.handle.on("captured",r=>{S=S.then(()=>A(r,s,n)).catch(()=>{})}),s.handle}}),a=null,f=null,m=new Set,y=e.runtime.client;e.runtime.client=new Proxy(y,{get(l,p){if(p==="submitCheck")return(f??l).submitCheck.bind(f??l);let t=Reflect.get(l,p);return typeof t=="function"?t.bind(l):t}});let R=()=>{a?.destroy(),a=null,f=null},b=l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="liveness"||t.livePhoto?.icao!==!0)return;if(a===null){let i=Z({tuning:p.capture?.icao??null,tuningVersion:p.capture?.tuningVersion??null,...t.icao!=null?{policy:t.icao.policy}:{},still:t.livePhoto.still,...l.assetBaseUrl!==void 0?{assetBaseUrl:l.assetBaseUrl}:{}},e.livePhotoInternals);a=i,f=i.decorate(y),i.onGate(r=>{for(let v of m)v(r)})}let n=a,d=e.baseCapture??{},s=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:n.engineOptions.measureQuality,telemetry:i=>{s?.(i),n.engineOptions.telemetry(i)}}}},w=re({keptPortraitInput:()=>a?.lastPortraitInput()??null,runner:()=>o,currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:()=>e.refreshView(),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:l=>ie(e.runtime.client)?.([l])}),P=oe({runner:()=>o,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:()=>e.refreshView()}),I=ee({...e,bindDocument:u,bindPortrait:w.bind,bindProofOfAddress:P.bind,stopCameras:()=>{C(),w.destroy(),P.destroy(),R(),e.stopLiveness?.()},onLivePhoto:l=>(m.add(l),()=>m.delete(l))});return o=I,{...I,captureInternals:b,destroy:()=>{C(),w.destroy(),P.destroy(),R(),m.clear()}}}export{fe as barcodeAssetBase,ze as createPlanRunner,ie as reportSink,ae as sdkAssetBase};
|
|
1
|
+
import{d as te}from"./chunk-ZKF2XMNX.js";import"./chunk-JLVZ35QK.js";import{a as J,b as W,e as Z,f as O,g as V,j as ee}from"./chunk-G2BD6INN.js";import{x as q}from"./chunk-W6Y2335Q.js";import{n as X}from"./chunk-VWGKUQ3C.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import{F as Q,i as $,x as N}from"./chunk-IUNPV67T.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-C4WK5D33.js";import"./chunk-MJKHDXCU.js";import{b as H,c as j,r as z,t as K,u as B}from"./chunk-HFRU66NW.js";import"./chunk-B5H5ED6O.js";import"./chunk-7QZWBDI5.js";import"./chunk-65YTEYLU.js";import{b as G}from"./chunk-SX7TUC3V.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as D,i as Y}from"./chunk-YDG77RHN.js";import"./chunk-TSA6GHUG.js";import{a as F}from"./chunk-NO22WG7R.js";import"./chunk-FSSMUAKC.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";var le=2e4,ue=new Set(["media_type_unsupported","media_type_mismatch"]),ne=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function re(e){let o=null,h=Promise.resolve(),c=!1,_=null,S=null,C=!1,E=null,A=!1,M=!1,T=()=>{o?.controller.handle.destroy(),o=null},u=()=>{let t=e.currentView(),n=t===null?null:V(t,{isMobile:e.isMobile()});return n?.kind==="portrait"?n:null},a=()=>{if(e.destroyed())return"self";let t=e.currentView(),n=t===null?void 0:O(t);return n==="self"||n==="assisted"?n:n==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??K(n??z(t),null)},f=e.captureModeSwitch,m=f===void 0?void 0:{session:()=>{let t=e.currentView();return t!==null&&O(t)==="choice"?"choice":a()},onModeChange:t=>f.choose(t)},y=async(t,n)=>{if(e.destroyed())return;let d=a();n.setFlowState("uploading"),c=!1;let s=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(s===null){let k=await B(r,"image","image/jpeg",t.image.size,{engine:"portrait"});await r.uploadToSpaces(k.uploadUrl,t.image,"image/jpeg"),s=(await r.completeMedia(k.key)).key}n.setFlowState("checking");let g={media:{portrait:s},gate:Y(t.gate),...t.tuningVersion!==void 0?{tuningVersion:t.tuningVersion}:{},source:"camera",capture:{mode:d,facingMode:t.facingMode}};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){c=!0,r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{})}if(n.setFlowState("done"),e.destroyed())return;let i=u();(i===null||i.phase!=="capture")&&o?.controller===n&&T(),e.runner().republish()},R=t=>e.runner().submit("face_match",(n,d)=>n.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:d})).then(()=>{},()=>{c=!0,t()}),b=null,w=async t=>{let n=u();if(n===null||n.phase!=="capture"||!n.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:d}=await import("./upload-file-EGXXM6TQ.js"),s=await d(t,e.uploadInternals);if(e.destroyed())return;T(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(i===null){let k=await r.presign("image",s.contentType,s.blob.size,{source:"upload"});await r.uploadToSpaces(k.uploadUrl,s.blob,s.contentType),i=(await r.completeMedia(k.key)).key}let g={media:{portrait:i},source:"upload"};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){throw r instanceof D&&ue.has(r.code)?new TypeError("unsupported_file"):(r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{}),r)}},P=null,I=t=>{if(P!==null)return P;let n=u();if(n===null||n.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let d={fixReview:{accept:t}},s=e.runner().submit("portrait_icao",(i,r)=>i.submitCheck("portrait_icao",d,{idempotencyKey:r})).catch(async i=>{throw i instanceof D&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{P=null});return P=s,s},l=t=>{let n=()=>w(t),d=(b===null?n():b.then(n,n)).finally(()=>{b===d&&(b=null)});return b=d,d};return{bind:(t,n)=>{if(t.phase==="review")return T(),{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("the adjusted photo waits for confirmFix()")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:I};if(t.phase==="match")return T(),_!==t.attemptsRemaining&&!c&&(_=t.attemptsRemaining,R(n)),{...t,uploadFailed:c,resubmit:()=>(c=!1,_=t.attemptsRemaining,n(),R(n)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:I};if(_=null,t.reuse===!0&&t.phase==="capture")return T(),!A&&E!==t.attemptsRemaining&&(E=t.attemptsRemaining,A=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{M=!1},()=>{M=!0}).finally(()=>{A=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:M&&!A,refresh:()=>(M=!1,E=null,n(),Promise.resolve())};let d=e.keptPortraitInput?.()??null;return d!==null&&(C||d!==S&&t.report===null&&t.reason===void 0&&!t.retakeOnly)?(C||(S=d,C=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",d,{idempotencyKey:i})).catch(()=>{}).finally(()=>{C=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:!1,refresh:()=>Promise.resolve()}):{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:s=>{if(o!==null&&o.video===s.video)return o.controller.handle;T(),c=!1;let i=X({video:s.video,tuning:t.tuning,tuningVersion:t.tuningVersion,...t.icao!=null?{policy:t.icao.policy}:{},...s.keepScreenAwake!==void 0?{keepScreenAwake:s.keepScreenAwake}:{},...s.assetBaseUrl!==void 0?{assetBaseUrl:s.assetBaseUrl}:{}},e.internals,a,m);o={video:s.video,controller:i};let r=i.handle.destroy;i.handle.destroy=()=>{o?.controller===i&&(o=null),r()},i.handle.on("error",k=>{e.reportCaptureIssue?.(H("portrait",k,0))});let v=!1,g=(k,L)=>{let x=i.gateScores();x!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:k,...L!==null?{failing:L}:{},...x})};return i.handle.on("gate",k=>{!v&&!k.ready&&(i.gateScores()?.elapsedMs??0)>=le&&(v=!0,g("stuck",k.failing))}),i.handle.on("captured",k=>{g("captured",null),v=!1,h=h.then(()=>y(k,i)).catch(()=>{})}),i.handle},uploadPortrait:l,confirmFix:I}},destroy:T}}var de=.92,ce=()=>G("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),pe=e=>{let o=document.createElement("canvas");o.width=e.videoWidth,o.height=e.videoHeight;let h=o.getContext("2d");return h===null||o.width===0||o.height===0?Promise.reject(new Error("the camera has no frame yet")):(h.drawImage(e,0,0,o.width,o.height),new Promise((c,_)=>o.toBlob(S=>S===null?_(new Error("the still could not be encoded")):c(S),"image/jpeg",de)))},me=(e,o)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=o,e.play().catch(()=>{})}catch{}};function oe(e){let o=null,h=null,c=u=>{let a=(h===null?u():h.then(u,u)).finally(()=>{h===a&&(h=null)});return h=a,a},_=()=>{o?.handle.destroy(),o=null},S=()=>{let u=e.currentView(),a=u===null?null:V(u,{isMobile:e.isMobile()});return a?.kind==="proof_of_address"?a:null},C=async(u,a)=>{if(a.length===0)throw new RangeError("no_pages");if(a.length>u.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:f,prepareUploadFile:m}=await import("./upload-file-EGXXM6TQ.js"),y=await Promise.all(a.map(b=>f(b)));if(y.includes("bad"))throw new TypeError("unsupported_file");if(y.includes("pdf")){if(a.length>1)throw new RangeError("too_many_pages");let b=a[0];if(b.size>u.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:b,contentType:"application/pdf"}]}let R=[];for(let b of a){let w=await m(b,e.uploadInternals);R.push({kind:"image",blob:w.blob,contentType:w.contentType})}return R},E=async(u,a,f)=>{let m=null;try{await e.runner().submit("poa",async(y,R)=>{if(m===null){let w=[];for(let P of f){let I=a==="upload"?await y.presign(P.kind,P.contentType,P.blob.size,{source:"upload"}):await B(y,P.kind,P.contentType,P.blob.size,{engine:"poa_page"});await y.uploadToSpaces(I.uploadUrl,P.blob,P.contentType),w.push((await y.completeMedia(I.key)).key)}m=w}let b=f[0]?.kind==="document_file"?{part:u,source:"upload",pdfKey:m[0]}:{part:u,source:a,imageKeys:m};return y.submitCheck("poa",b,{idempotencyKey:R})})}catch(y){throw y instanceof D&&(y.code==="media_type_unsupported"||y.code==="media_type_mismatch")?new TypeError("unsupported_file"):(y instanceof D&&(y.code==="document_upload_not_allowed"||y.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),y)}},A=async(u,a)=>{let f=S();if(f===null||!f.photo.uploadOffered)throw new RangeError("upload_not_offered");if(u==="holder_letter"&&f.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let m=await C(f,a);e.destroyed()||(_(),await E(u,"upload",m))},M=(u,a)=>{let f=null,m=[],y=!0,R=()=>{for(let w of f?.getTracks()??[])w.stop();f=null},b={get pages(){return m},start:async()=>{if(!y||f!==null)return;let w=await(e.pageCamera?.open??ce)();if(!y){for(let P of w.getTracks())P.stop();return}f=w,(e.pageCamera?.attach??me)(u,w)},takePage:async()=>{if(m.length>=a)throw new RangeError("too_many_pages");let w=await(e.pageCamera?.grab??pe)(u);if(m.length>=a)throw new RangeError("too_many_pages");return m=[...m,w],w},removePage:w=>{m=m.filter((P,I)=>I!==w)},submitPages:()=>c(async()=>{if(m.length===0)throw new RangeError("no_pages");let w=S();if(w===null)throw new RangeError("camera_not_offered");let P=w.phase==="holder_letter"?"holder_letter":"document";await E(P,"camera",m.map(I=>({kind:"image",blob:I,contentType:"image/jpeg"}))),o?.handle===b?_():b.destroy()}),destroy:()=>{y=!1,m=[],R(),o?.handle===b&&(o=null)}};return b},T=async()=>{let u=S();if(u===null||!u.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;_();let a={part:"document"};await e.runner().submit("poa",(f,m)=>f.submitCheck("poa",a,{idempotencyKey:m}))};return{bind:u=>({...u,...u.licenceAddressAccepted?{useLicenceAddress:()=>c(T)}:{},uploadPages:a=>c(()=>A("document",a)),uploadHolderLetter:a=>c(()=>A("holder_letter",a)),capturePage:a=>{if(u.photo.source==="upload")throw new RangeError("camera_not_offered");if(o!==null&&o.video===a.video)return o.handle;_();let f=M(a.video,u.maxPages);return o={video:a.video,handle:f},f}}),destroy:_}}function ie(e){let o=e;if(typeof o.apiOrigin!="string"||typeof o.sessionToken!="string")return;let h=`${o.apiOrigin}/api/v2/hosted/capture-reports`,c=o.sessionToken;return _=>{try{fetch(h,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${F}`},body:JSON.stringify({reports:_}),keepalive:!0}).catch(()=>{})}catch{}}}function ae(e){let o=e.apiOrigin;return te("sdk",typeof o=="string"&&/staging|sandbox|localhost/.test(o)?"sandbox":"live")}function fe(e){return ae(e).replace(/\/ocr$/,"/barcode")}function ze(e){let o=null,h=null,c=null,_=j(),S=Promise.resolve(),C=()=>{c?.flow.handle.destroy(),c=null},E=l=>l===null?{}:{documentType:l.documentType,documentCountry:l.issuer},A=async(l,p,t)=>{if(e.destroyed())return;p.setFlowState("uploading");let n=null,d=E(t),s,i=!1,r=e.currentView()?.documents!==void 0;try{await o.submit("doc_ocr",async(x,se)=>{if(n===null){let U=await B(x,"image","image/jpeg",l.image.size,{engine:"document"});await x.uploadToSpaces(U.uploadUrl,l.image,"image/jpeg"),n=(await x.completeMedia(U.key)).key}return p.setFlowState("checking"),s===void 0&&(s=p.takeDeviceRead(l)),x.submitCheck("doc_ocr",{imageKey:n,side:l.side,...s!==null?{deviceRead:s}:{},...r?{source:"camera"}:{},...d},{idempotencyKey:se})})}catch{i=!0}finally{p.setFlowState("done")}if(e.destroyed())return;if(i){p.settle(l.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),g=v===null?null:V(v,{isMobile:e.isMobile()});if(g?.kind!=="document"){p.settle(l.side,{ok:!0}),c?.flow===p?C():p.handle.destroy();return}if(g.reason==="document_type_not_accepted"||g.reason==="document_type_not_supported"){h=null,c?.flow===p&&C(),o.republish();return}let k=g.acceptedSides;l.side!=="single"&&(k.includes(l.side)||g.reason==="side_missing")&&!(k.includes("recto")&&k.includes("verso"))?(p.settle(l.side,{ok:!0}),h?.documentType!=="passport"&&p.handle.setSide(g.side)):g.reason==="document_sides_mismatch"&&k.length===0?(p.settle(l.side,{ok:!1,issue:"reread"}),p.handle.retry()):p.settle(l.side,{ok:!1,issue:"reread"})},M=null,T=async l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="document")throw new RangeError("upload_not_offered");if(!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let n=h,d=n?.documentType==="passport"?"single":t.side,{prepareUploadFile:s}=await import("./upload-file-EGXXM6TQ.js"),i=await s(l,e.uploadInternals);if(e.destroyed())return;C();let r=null,v=E(n);try{await o.submit("doc_ocr",async(g,k)=>{if(r===null){let L=await g.presign("image",i.contentType,i.blob.size,{source:"upload"});await g.uploadToSpaces(L.uploadUrl,i.blob,i.contentType),r=(await g.completeMedia(L.key)).key}return g.submitCheck("doc_ocr",{imageKey:r,side:d,source:"upload",...v},{idempotencyKey:k})})}catch(g){throw g instanceof D&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof D&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),g)}},u=(l,p)=>({...l,uploadDocument:t=>{let n=()=>T(t),d=(M===null?n():M.then(n,n)).finally(()=>{M===d&&(M=null)});return M=d,d},issuer:h?.issuer??null,documentType:h?.documentType??null,captureSide:h===null?null:h.documentType==="passport"?"single":l.side,selectDocument:(t,n)=>{if(!W(l.documents).includes(t)||!J(l.documents,t).includes(n))throw new RangeError(`${n} from ${t} is not accepted`);(h?.issuer!==t||h.documentType!==n)&&C(),h={issuer:t,documentType:n},p()},capture:t=>{if(h===null)throw new Error("selectDocument() first");if(c!==null&&c.video===t.video)return c.flow.handle;C();let n=h,d=n.documentType==="passport"?"single":l.acceptedSides.length>0?l.side:void 0,s=q({video:t.video,documentType:n.documentType,issuer:n.issuer,...d!==void 0?{side:d}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.liveMrz!==void 0?{liveMrz:t.liveMrz}:{},...t.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:t.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let r=e.currentView()?.capture?.document,v=e.documentInternals?.blurRefuseSharpnessMax??r?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:$(r?.camera),shutter:Q(r?.scan),guideLock:N(r?.guide),...e.documentInternals?.engineOptions??{}},...typeof v=="number"&&Number.isFinite(v)&&v>=0&&v<=1?{blurRefuseSharpnessMax:v}:{},catalogCapture:e.documentInternals?.catalogCapture??r?.catalog===!0}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:fe(e.runtime.client)}},...(()=>{let r=e.currentView();if(r===null||e.documentInternals?.webOcr!==void 0)return{};let v=ie(e.runtime.client);return{webOcr:{captureDocument:r.capture?.document,salt:r.sessionId,baseUrl:ae(e.runtime.client),...v!==void 0?{reports:v}:{}}}})()});c={video:t.video,flow:s};let i=s.handle.destroy;return s.handle.destroy=()=>{c?.flow===s&&(c=null),i()},_.newHandle(),s.handle.on("state",r=>_.note(r)),s.handle.on("error",r=>{_.noteError(),e.reportCaptureIssue?.(H("document",r,_.value))}),s.handle.on("captured",r=>{S=S.then(()=>A(r,s,n)).catch(()=>{})}),s.handle}}),a=null,f=null,m=new Set,y=e.runtime.client;e.runtime.client=new Proxy(y,{get(l,p){if(p==="submitCheck")return(f??l).submitCheck.bind(f??l);let t=Reflect.get(l,p);return typeof t=="function"?t.bind(l):t}});let R=()=>{a?.destroy(),a=null,f=null},b=l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="liveness"||t.livePhoto?.icao!==!0)return;if(a===null){let i=Z({tuning:p.capture?.icao??null,tuningVersion:p.capture?.tuningVersion??null,...t.icao!=null?{policy:t.icao.policy}:{},still:t.livePhoto.still,...l.assetBaseUrl!==void 0?{assetBaseUrl:l.assetBaseUrl}:{}},e.livePhotoInternals);a=i,f=i.decorate(y),i.onGate(r=>{for(let v of m)v(r)})}let n=a,d=e.baseCapture??{},s=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:n.engineOptions.measureQuality,telemetry:i=>{s?.(i),n.engineOptions.telemetry(i)}}}},w=re({keptPortraitInput:()=>a?.lastPortraitInput()??null,runner:()=>o,currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:()=>e.refreshView(),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:l=>ie(e.runtime.client)?.([l])}),P=oe({runner:()=>o,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:()=>e.refreshView()}),I=ee({...e,bindDocument:u,bindPortrait:w.bind,bindProofOfAddress:P.bind,stopCameras:()=>{C(),w.destroy(),P.destroy(),R(),e.stopLiveness?.()},onLivePhoto:l=>(m.add(l),()=>m.delete(l))});return o=I,{...I,captureInternals:b,destroy:()=>{C(),w.destroy(),P.destroy(),R(),m.clear()}}}export{fe as barcodeAssetBase,ze as createPlanRunner,ie as reportSink,ae as sdkAssetBase};
|
|
@@ -409,9 +409,12 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
|
|
|
409
409
|
* {@link HostedSessionView.retryAfter} says when it may try again;
|
|
410
410
|
* - `platform_unsupported` (M-nfc): a chip read is required and this client
|
|
411
411
|
* can't read one (web); the session stays open for a native app;
|
|
412
|
-
* - `blocked_by_org`: one of the organization's blocks stopped the session
|
|
412
|
+
* - `blocked_by_org`: one of the organization's blocks stopped the session;
|
|
413
|
+
* - `identity_not_verified` (view-only, with `reason: "rejected"`): the session failed in a way the page
|
|
414
|
+
* does not explain (suspected fraud, or an automatic block). Never stored, never in the partner API or
|
|
415
|
+
* webhooks; the result screen says only that the identity was not verified and whom to contact.
|
|
413
416
|
*/
|
|
414
|
-
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "blocked_by_org" | "starter_credit_claimed";
|
|
417
|
+
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "blocked_by_org" | "starter_credit_claimed" | "identity_not_verified";
|
|
415
418
|
/**
|
|
416
419
|
* Why the person has no camera (spec 2026-10-29 §3.4, 2026-10-30): `denied` when the camera permission was refused,
|
|
417
420
|
* `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
|
|
@@ -409,9 +409,12 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
|
|
|
409
409
|
* {@link HostedSessionView.retryAfter} says when it may try again;
|
|
410
410
|
* - `platform_unsupported` (M-nfc): a chip read is required and this client
|
|
411
411
|
* can't read one (web); the session stays open for a native app;
|
|
412
|
-
* - `blocked_by_org`: one of the organization's blocks stopped the session
|
|
412
|
+
* - `blocked_by_org`: one of the organization's blocks stopped the session;
|
|
413
|
+
* - `identity_not_verified` (view-only, with `reason: "rejected"`): the session failed in a way the page
|
|
414
|
+
* does not explain (suspected fraud, or an automatic block). Never stored, never in the partner API or
|
|
415
|
+
* webhooks; the result screen says only that the identity was not verified and whom to contact.
|
|
413
416
|
*/
|
|
414
|
-
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "blocked_by_org" | "starter_credit_claimed";
|
|
417
|
+
type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "blocked_by_org" | "starter_credit_claimed" | "identity_not_verified";
|
|
415
418
|
/**
|
|
416
419
|
* Why the person has no camera (spec 2026-10-29 §3.4, 2026-10-30): `denied` when the camera permission was refused,
|
|
417
420
|
* `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
|
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.33",
|
|
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.33",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.33",
|
|
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.33?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.33|@mediapipe/tasks-vision@0.10.35",
|
|
154
154
|
"licenses": [
|
|
155
155
|
{
|
|
156
156
|
"license": {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"name": "thumbmarkjs",
|
|
186
186
|
"group": "@thumbmarkjs",
|
|
187
187
|
"version": "1.12.0",
|
|
188
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
188
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.33|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
189
189
|
"licenses": [
|
|
190
190
|
{
|
|
191
191
|
"license": {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
"name": "emscripten",
|
|
221
221
|
"group": "@types",
|
|
222
222
|
"version": "1.41.6",
|
|
223
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
223
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.33|@types/emscripten@1.41.6",
|
|
224
224
|
"licenses": [
|
|
225
225
|
{
|
|
226
226
|
"license": {
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"type": "library",
|
|
255
255
|
"name": "type-fest",
|
|
256
256
|
"version": "4.41.0",
|
|
257
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
257
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.33|type-fest@4.41.0",
|
|
258
258
|
"licenses": [
|
|
259
259
|
{
|
|
260
260
|
"expression": "(MIT OR CC0-1.0)",
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"type": "library",
|
|
287
287
|
"name": "zxing-wasm",
|
|
288
288
|
"version": "2.1.0",
|
|
289
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
289
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.33|zxing-wasm@2.1.0",
|
|
290
290
|
"licenses": [
|
|
291
291
|
{
|
|
292
292
|
"license": {
|
|
@@ -319,30 +319,30 @@
|
|
|
319
319
|
],
|
|
320
320
|
"dependencies": [
|
|
321
321
|
{
|
|
322
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
322
|
+
"ref": "@sekyro/web@0.1.0-rc.33",
|
|
323
323
|
"dependsOn": [
|
|
324
|
-
"@sekyro/web@0.1.0-rc.
|
|
325
|
-
"@sekyro/web@0.1.0-rc.
|
|
326
|
-
"@sekyro/web@0.1.0-rc.
|
|
324
|
+
"@sekyro/web@0.1.0-rc.33|@mediapipe/tasks-vision@0.10.35",
|
|
325
|
+
"@sekyro/web@0.1.0-rc.33|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
326
|
+
"@sekyro/web@0.1.0-rc.33|zxing-wasm@2.1.0"
|
|
327
327
|
]
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
330
|
+
"ref": "@sekyro/web@0.1.0-rc.33|@mediapipe/tasks-vision@0.10.35"
|
|
331
331
|
},
|
|
332
332
|
{
|
|
333
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
333
|
+
"ref": "@sekyro/web@0.1.0-rc.33|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
336
|
+
"ref": "@sekyro/web@0.1.0-rc.33|@types/emscripten@1.41.6"
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
339
|
+
"ref": "@sekyro/web@0.1.0-rc.33|type-fest@4.41.0"
|
|
340
340
|
},
|
|
341
341
|
{
|
|
342
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
342
|
+
"ref": "@sekyro/web@0.1.0-rc.33|zxing-wasm@2.1.0",
|
|
343
343
|
"dependsOn": [
|
|
344
|
-
"@sekyro/web@0.1.0-rc.
|
|
345
|
-
"@sekyro/web@0.1.0-rc.
|
|
344
|
+
"@sekyro/web@0.1.0-rc.33|@types/emscripten@1.41.6",
|
|
345
|
+
"@sekyro/web@0.1.0-rc.33|type-fest@4.41.0"
|
|
346
346
|
]
|
|
347
347
|
}
|
|
348
348
|
]
|
package/dist/chunk-6ERQTXMY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Y,d as ee,e as O,f as te,g as ne}from"./chunk-7QZWBDI5.js";import{C as X,a as j}from"./chunk-TN4JWBFJ.js";import{f as Q,l as Z}from"./chunk-CPUECYAJ.js";import{c as $}from"./chunk-TSA6GHUG.js";import{c as J,h as C}from"./chunk-FSSMUAKC.js";var ue=12e4,re=13e4,le=3e3,fe=1200,P=Symbol.for("@sekyro/web.preload.v1");function g(){let e=globalThis;return e[P]??(e[P]=new Map),e[P]}function S(e){let n=(e??J).replace(/\/+$/,"");return n===""?"/":n}function se(e){let n=g(),r=n.get(e);return r===void 0&&(r={status:"idle",promise:null,scheduled:null,detectorPromise:null,detector:null,listeners:new Set},n.set(e,r)),r}function A(e,n){if(e.status!==n){e.status=n;for(let r of[...e.listeners])r(n)}}var x=e=>C({preferred:["blaze"],v3AssetBaseUrl:e,blazeInitTimeoutMs:ue}),F=x;function Pe(e){F=e??x}function Ae(){for(let e of g().values())e.detector?.destroy();g().clear(),F=x}function pe(){return typeof window<"u"&&typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"}function me(){return navigator.connection?.saveData===!0}function ve(e){let n=window;if(typeof n.requestIdleCallback=="function"){let s=n.requestIdleCallback(e,{timeout:le});return()=>n.cancelIdleCallback?.(s)}let r=setTimeout(e,fe);return()=>clearTimeout(r)}function ge(e,n){let r,s=new Promise(i=>{r=i}),m=!1,d=()=>{},u={promise:s,settle:i=>{m||(m=!0,d(),e.scheduled===u&&(e.scheduled=null),r(i))}};return e.scheduled=u,d=ve(()=>{m||u.settle(I(e,n))}),s}function I(e,n){if((e.status==="loading"||e.status==="ready")&&e.promise!==null)return e.promise;A(e,"loading");let r=new Promise(i=>i(F(n)));e.detectorPromise=r;let s,m=new Promise((i,f)=>{s=setTimeout(()=>{r.then(h=>h.destroy(),()=>{}),f(new Error(`detector preload exceeded ${re} ms`))},re)}),u=Promise.race([r,m]).then(i=>e.detectorPromise!==r?(i.destroy(),e.status):(e.detector=i,A(e,"ready"),"ready"),i=>(e.detectorPromise===r&&(e.detectorPromise=null,e.detector=null,A(e,"failed"),console.warn("[@sekyro/web] face-detector preload failed:",i)),e.status)).finally(()=>clearTimeout(s));return e.promise=u,e.scheduled?.settle(u),u}function we(e={}){if(!pe())return Promise.resolve("idle");let n=S(e.assetBaseUrl),r=se(n);return e.respectSaveData===!0&&me()?Promise.resolve(r.status):(r.status==="loading"||r.status==="ready")&&r.promise!==null?r.promise:e.idle===!0?r.scheduled?.promise??ge(r,n):I(r,n)}function ke(e){return g().get(S(e))?.status??"idle"}function De(e,n){let r=se(S(n));return r.listeners.add(e),()=>{r.listeners.delete(e)}}function _e(e){let n=g().get(S(e));n!==void 0&&(n.scheduled?.settle("idle"),n.detector?.destroy(),n.detector=null,n.detectorPromise=null,n.promise=null,A(n,"idle"))}function he(e){return{get tier(){return e.tier},get fallbackReason(){return e.fallbackReason},detect:(...n)=>e.detect(...n),destroy:()=>{}}}function oe(e){let n=S(e),r=g().get(n);if(!(r===void 0||r.detector===null&&r.detectorPromise===null&&r.scheduled===null))return async()=>{r.scheduled!==null&&I(r,n);let s=r.promise;for(;r.detector===null&&s!==null&&(await s,r.promise!==s);)s=r.promise;return r.detector!==null?he(r.detector):C({v3AssetBaseUrl:n})}}function Ce(e){switch(e){case"fcv3.no_face":case"fcv3.center_face":case"fcv3.straighten":return"center";case"fcv3.come_closer":return"closer";case"fcv3.move_back":return"farther";case"fcv3.more_light":case"fcv3.too_bright":return"light";case"fcv3.hold_still":case"fcv3.steady_camera":return"still";case"fcv3.hold_upright":return"upright";case"fcv3.one_face":return"one_face";default:return null}}function Se(e){switch(e){case"preflight":case"acquiring":return"starting";case"positioning":return"gating";default:return e}}function ie(e){switch(e){case"permission":case"notfound":case"inuse":case"insecure":case"unsupported":return e;case"backcamera":return"notfound";default:{let n=e;return"generic"}}}function Le(e,n,r){if(r===void 0)return{kind:ie(e),retryable:n};let s=Z(r.name);return{kind:ie(e),retryable:n,detail:{...s!==void 0?{name:s}:{},phase:r.phase,engineKind:e}}}var ye=new Set(["captured","uploading","checking"]);function Ee(e,n={},r,s=()=>"self",m=()=>{},d){let u=n.now??(()=>performance.now()),i=n.canChooseFacing??ee,f="user",h=te(),p=s(),l=Y(),B=!Q(),H=n.engineOptions,ae=H?.createDetector===void 0&&H?.createWorker===void 0?{createDetector:()=>{let t=oe(e.assetBaseUrl);return t!==void 0?t():C({v3AssetBaseUrl:e.assetBaseUrl})}}:{},U={video:e.video,mode:B?"photo":"clip",rankKeyframes:r,facingMode:void 0,v3AssetBaseUrl:e.assetBaseUrl,screenRamp:()=>p==="self"&&l.count("ramp")>0?m():void 0,...n.engineOptions??{},...ae},o=n.createEngine?.(U)??new X(U),v="idle",L=null,y=0,w=!1,k="full",E=null,b=null,D=0,_=0,K=()=>{e.video.videoWidth>0&&e.video.videoHeight>0&&(D=e.video.videoWidth,_=e.video.videoHeight)},V=ne({enabled:e.keepScreenAwake!==!1}),M=t=>{v=t,V.setActive(t==="starting"||t==="gating"||t==="recording"),l.emit("state",t)},R=()=>l.emit("gate",{progress:y,hint:L,faceDetected:w}),G=()=>{let t=o.animations??"full";t!==k&&(k=t,l.emit("profile",{animations:k}))},de=[o.on("statechange",({state:t})=>{let a=Se(t);a==="starting"&&v!=="starting"&&(L=null,y=0,w=!1,E=null,b=null,D=0,_=0),M(a),G(),a==="recording"&&(K(),E=u(),L="hold",y=1,R())}),o.on("checks",t=>{K(),y=t.progress,w=t.factors.presence>0,R(),G()}),o.on("guidance",({key:t})=>{L=Ce(t),R()}),o.on("frozen",({previewDataUrl:t})=>{b=u(),l.emit("frozen",{previewDataUrl:t})}),o.on("ramp",t=>l.emit("ramp",t)),o.on("artifacts",t=>{if(v!=="captured")return;let a=$(),c=t.clipStats,q=c!==void 0?Math.round(c.durationMs):E!==null&&b!==null?Math.max(0,Math.round(b-E)):void 0,N=c!==void 0&&c.frames>1&&c.durationMs>0?Math.round(c.frames*1e4/c.durationMs)/10:void 0;l.emit("captured",{keyframe:t.keyframe,...t.clip!==void 0?{clip:t.clip}:{},...t.clipMimeType!==void 0?{clipMime:t.clipMimeType}:{},width:e.video.videoWidth||D,height:e.video.videoHeight||_,...q!==void 0?{clipMs:q}:{},...c!==void 0?{clipFrames:c.frames}:{},...N!==void 0?{fps:N}:{},...t.clipRetakes!==void 0?{clipRetakes:t.clipRetakes}:{},...t.clipMimeType!==void 0?{codec:j(t.clipMimeType)}:{},captureChannel:a==="desktop"?"desktop":"mobile",formFactor:a,...B?{degraded:"NO_RECORDER"}:{},engine:"v3",facingMode:o.facingMode,mode:p,...t.timing,...t.screenRamp!==void 0?{screenRamp:t.screenRamp}:{},...t.provenance!==void 0?{provenance:t.provenance}:{}})}),o.on("error",({kind:t,retryable:a,detail:c})=>{t==="backcamera"&&ce()||l.emit("error",Le(t,a,c))})],z=!1;function ce(){return T||z||p!=="assisted"||d===void 0||d.session()!=="choice"?!1:(z=!0,d.onModeChange("self"),p="self",f=O("self"),M("mode_switch"),o.restart(f),!0)}let W=async()=>d!==void 0&&d.session()==="choice"&&await i().catch(()=>!1),T=!1;return{handle:{get state(){return v},get captureMode(){return s()},get facingMode(){return o.facingMode??f},on:(t,a)=>l.on(t,a),start:t=>(p=s(),h.facing(p,e.facing),f=h.facing(p,t?.facing),o.start({facingMode:f})),retry:()=>o.retry(),switchCamera:()=>h.refuseSwitch(s()),canSwitchCaptureMode:W,setCaptureMode:async t=>{if(t===s()||!await W()||T||ye.has(v)||d===void 0)return!1;d.onModeChange(t),p=t;let a=O(t);return f=a,v==="idle"||(M("mode_switch"),o.restart(a)),!0},destroy:()=>{T=!0;for(let t of de)t();V.setActive(!1),o.destroy(),l.clear()}},setFlowState:t=>{v!==t&&M(t)}}}function ze(e){return Ee(e).handle}export{ue as a,re as b,Pe as c,Ae as d,we as e,ke as f,De as g,_e as h,oe as i,Ce as j,Se as k,ie as l,Le as m,Ee as n,ze as o};
|
package/dist/chunk-CMXN4SOZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var b=new Set(["challenge_frame_blocked","challenge_script_blocked","site_key_rejected","challenge_failed","timeout","embedder_opaque"]),i=class extends Error{constructor(n,t){super(`Sekyro challenge failed: ${n}${t!==void 0?` (${t})`:""}`),this.name="ChallengeError",this.code=n,t!==void 0&&(this.detail=t)}},E=3e4,_=12e4,p="sekyro.challenge.",v="position:fixed;width:1px;height:1px;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none;border:0",d=null,g=Promise.resolve();function F(){u(),g=Promise.resolve(),m=!1}function c(){return new i("aborted")}function C(){let e=globalThis.crypto;return e!==void 0&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function h(e){return new URL(e,document.baseURI).origin}function u(){let e=d;if(e!==null){d=null,window.removeEventListener("message",e.listener),e.iframe.remove();for(let n of e.waiters.values())n.reject(new i("challenge_frame_blocked"));e.waiters.clear()}}function M(e,n){if(n.source!==e.iframe.contentWindow||n.origin!==e.origin)return;let t=n.data;if(typeof t!="object"||t===null)return;let r=t;if(typeof r.type!="string"||!r.type.startsWith(p)||r.v!==1)return;if(r.type==="sekyro.challenge.ready"){e.readyMs??(e.readyMs=Date.now()-e.insertedAt),e.isReady=!0,e.onReady?.();return}if(typeof r.id!="string")return;let a=e.waiters.get(r.id);if(a!==void 0){if(r.type==="sekyro.challenge.token"&&typeof r.token=="string"&&r.token!=="")e.waiters.delete(r.id),a.resolve(r.token);else if(r.type==="sekyro.challenge.error"){e.waiters.delete(r.id);let o=typeof r.code=="string"&&b.has(r.code)?r.code:"challenge_failed",s=typeof r.detail=="string"||typeof r.detail=="number"?String(r.detail).slice(0,32):void 0;a.reject(new i(o,s))}}}function k(e){if(d!==null&&d.url===e)return d;u();let n=document.createElement("iframe");n.setAttribute("title","Security check"),n.setAttribute("aria-hidden","true"),n.setAttribute("tabindex","-1"),n.setAttribute("referrerpolicy","no-referrer"),n.setAttribute("style",v);let t={url:e,origin:h(e),iframe:n,isReady:!1,insertedAt:Date.now(),onReady:null,waiters:new Map,listener:r=>M(t,r)};return window.addEventListener("message",t.listener),n.src=e,document.body.appendChild(n),d=t,t}function A(e,n,t){return e.isReady?Promise.resolve():new Promise((r,a)=>{let o=()=>{clearTimeout(l),t?.removeEventListener("abort",s),e.onReady=null},s=()=>{o(),a(c())},l=setTimeout(()=>{o(),a(new i("challenge_frame_blocked"))},n);t?.addEventListener("abort",s,{once:!0}),e.onReady=()=>{o(),r()}})}async function y(e){if(e.signal?.aborted)throw c();let n=k(e.frameUrl);try{return await x(n,e)}catch(t){throw t instanceof i&&n.readyMs!==void 0&&(t.readyMs??(t.readyMs=n.readyMs)),t}}async function x(e,n){let t=n.signal;await A(e,n.readyTimeoutMs??E,t);let r=e.iframe.contentWindow;if(r===null)throw new i("challenge_frame_blocked");let a=n.timeoutMs??_,o=C(),s,l;try{return await new Promise((w,f)=>{e.waiters.set(o,{resolve:w,reject:f}),s=setTimeout(()=>f(new i("timeout")),a),t!==void 0&&(l=()=>f(c()),t.addEventListener("abort",l,{once:!0})),r.postMessage({type:"sekyro.challenge.request",v:1,id:o,siteKey:n.siteKey,action:n.action,subject:n.subject},e.origin)})}finally{clearTimeout(s),t!==void 0&&l!==void 0&&t.removeEventListener("abort",l),e.waiters.delete(o)}}var m=!1;function R(e,n){if(m)return;let t;if(n==="challenge_frame_blocked"){let r=e;try{r=h(e)}catch{}t=`Sekyro: the security check frame could not load. Allow \`frame-src ${r}\` in your Content-Security-Policy.`}else if(n==="embedder_opaque")t="Sekyro: the security check needs a page with an origin. Do not run the SDK in a sandboxed or data: document.";else return;m=!0,console.warn(t)}async function S(e){if(globalThis.origin==="null")throw new i("embedder_opaque");if(e.signal?.aborted)throw c();try{return await y(e)}catch(n){if(u(),e.signal?.aborted||n instanceof i&&n.code==="aborted")throw c();if(n instanceof i&&n.code==="timeout")throw n;try{return await y(e)}catch(t){throw u(),e.signal?.aborted?c():t instanceof i?t:new i("challenge_failed")}}}function T(e){let n=()=>S(e).catch(r=>{throw r instanceof i&&R(e.frameUrl,r.code),r}),t=g.then(n,n);return g=t.catch(()=>{}),t}export{i as a,E as b,_ as c,F as d,T as e};
|
package/dist/chunk-OUC57KMS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-TSA6GHUG.js";import{a as h,c as y}from"./chunk-MD4YXLPK.js";var S=["session_token_invalid","session_token_required","session_token_session_mismatch","session_not_found","rate_limit_exceeded","consent_required","session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_type_unsupported","force_outcome_forbidden","attestation_invalid","platform_unregistered","app_attest_invalid","too_many_challenges","inference_unavailable","mobile_required","nni_locked","document_nni_mismatch","media_content_type_not_allowed","media_too_large","media_key_invalid","media_key_forbidden","media_not_found","media_unreadable","media_session_invalid","idempotency_key_collision","idempotency_in_progress","idempotency_key_required","validation_error","internal_error","unknown_error","upload_failed","network_error","timeout","nfc_outcome_not_accepted","identity_confirm_required","identity_confirm_locked","choice_not_found","choice_locked","choice_option_unavailable","step_not_on_path","check_not_active","sekyro_app_not_allowed","sekyro_app_unverified","id_number_locked","document_id_number_mismatch","simulated_capture_forbidden","native_app_required"];function K(n){return S.includes(n)}var c=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}};function _(n,e,s=Math.random){let t=(n??e)*1e3,o=Math.min(Math.max(t,500),2e4),r=Math.round(o*(1+(s()*2-1)*.25));return Math.min(Math.max(r,500),2e4)}var R=6e4,b=4,I=3e4,M=9e5,E=200,P=5,C=400,A=new Set(["server_busy","request_timeout"]),v=2;function l(n){return(n.split(";")[0]??"").trim()}var O={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},N=`@sekyro/web/${h}`,H=N,g=class{constructor(e){this.sessionId=null;this.bootstrap=null;this.captureNonces=[];this.captureFetch=null;this.reportedIssues=new Map;this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let s=e.fetch;this.fetchImpl=(t,o)=>(s??globalThis.fetch).call(globalThis,t,o),this.requestTimeoutMs=e.requestTimeoutMs??I,this.retryAttempts=e.inProgressRetry?.attempts??P,this.retryDelayMs=e.inProgressRetry?.delayMs??C,this.random=e.random??Math.random}async getSession(){let e=await this.api("GET","/hosted/session");return this.sessionId=e.sessionId,e}async recordConsent(e){return this.api("POST","/hosted/consent",{body:{locale:e},busyRetry:!0})}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async testerGate(e){return this.api("POST","/hosted/tester-gate",{body:{input:e}})}async reportCaptureIssue(e){let s=typeof e.name=="string"?e.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",t=typeof e.engineKind=="string"&&/^[a-z_]{1,32}$/.test(e.engineKind)?e.engineKind:void 0,o=typeof e.attempt=="number"&&Number.isInteger(e.attempt)&&e.attempt>=0&&e.attempt<=1e3?e.attempt:void 0,r=[e.check,o??"",e.kind,s,e.phase??""].join("|"),a=this.reportedIssues.get(r);if(a!==void 0)return a;let d={check:e.check,kind:e.kind,...s!==""?{name:s}:{},...e.phase!==void 0?{phase:e.phase}:{},...t!==void 0?{engineKind:t}:{},...o!==void 0?{attempt:o}:{},...e.formFactor!==void 0?{formFactor:e.formFactor}:{},...typeof e.detail=="string"&&/^\d{1,10}$/.test(e.detail)?{detail:e.detail}:{},...T(e.challengeMs)?{challengeMs:e.challengeMs}:{},...T(e.readyMs)?{readyMs:e.readyMs}:{},...e.inApp===!0?{inApp:!0}:{}},i=this.api("POST","/hosted/capture-issue",{body:d,empty:!0}).catch(()=>{this.reportedIssues.delete(r)});return this.reportedIssues.set(r,i),i}async choose(e,s){let t=await this.api("POST","/hosted/choice",{body:{nodeId:e,option:s},busyRetry:!0});return this.sessionId=t.sessionId,t}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,s,t,o={}){let r=await this.ensureSessionId(),a={kind:e,contentType:l(s),contentLength:t,...o.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${r}/media`,{body:a})}armCapture(e=2){this.fillCaptureNonces(e)}async presignCapture(e,s,t,o={}){let r=await this.ensureSessionId(),a=await this.takeCaptureNonce(),d=a===void 0?void 0:{nonce:a,...o.engine!==void 0?{engine:o.engine.slice(0,32)}:{},...o.durationMs!==void 0&&Number.isFinite(o.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(o.durationMs)))}:{}},i={kind:e,contentType:l(s),contentLength:t,capture:d};return this.api("POST",`/sessions/${r}/media`,{body:i})}async takeCaptureNonce(){let e=()=>{let s=Date.now();return this.captureNonces=this.captureNonces.filter(t=>t.expiresAt-R>s),this.captureNonces.shift()?.nonce};for(let s=0;s<2;s++){let t=e();if(t!==void 0)return t;await this.fillCaptureNonces(1)}return e()}fillCaptureNonces(e){return this.captureFetch??(this.captureFetch=(async()=>{try{let s=await this.ensureSessionId(),t=await this.api("POST",`/sessions/${s}/media/capture-nonces`,{body:{count:Math.min(b,Math.max(1,e))}}),o=Date.now()+Math.max(0,t.expiresIn)*1e3;for(let r of Array.isArray(t.nonces)?t.nonces:[])typeof r=="string"&&r.length>0&&this.captureNonces.push({nonce:r,expiresAt:o});this.captureNonces=this.captureNonces.slice(-b)}catch{}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,s,t){let o;try{o=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":l(t)},body:s,signal:AbortSignal.timeout(M)})}catch(r){throw m(r)}if(!o.ok){let r=(await o.text().catch(()=>"")).slice(0,E);throw new c({status:o.status,code:"upload_failed",message:`media upload failed (HTTP ${o.status})${r?`: ${r}`:""}`})}}async completeMedia(e){let s=await this.ensureSessionId();return this.api("POST",`/sessions/${s}/media/complete`,{body:{key:e}})}async submitCheck(e,s,t={}){let o=await this.ensureSessionId(),r={input:s,forceOutcome:t.forceOutcome};return this.api("POST",`/sessions/${o}/checks/${e}`,{body:r,idempotencyKey:t.idempotencyKey,...t.browserCheckToken!==void 0?{browserCheckToken:t.browserCheckToken}:{},busyRetry:t.idempotencyKey!==void 0})}async uploadAndSubmit(e,s,t,o={}){let r=l(s.contentType),a=await this.presign(s.kind,r,s.blob.size);await this.uploadToSpaces(a.uploadUrl,s.blob,r);let d=await this.completeMedia(a.key),i={...t,[O[e]]:d.key};return this.submitCheck(e,i,o)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,s,t={}){let o=e==="GET"||t.busyRetry===!0,r=`${this.apiOrigin}/api/v2${s}`,a={"x-session-token":this.sessionToken,"x-sekyro-sdk":H};t.body!==void 0&&(a["content-type"]="application/json"),t.idempotencyKey!==void 0&&(a["x-idempotency-key"]=t.idempotencyKey),t.browserCheckToken!==void 0&&(a["sekyro-browser-check"]=t.browserCheckToken);try{let d=y.timezone();d!==void 0&&(a["sekyro-client-timezone"]=d)}catch{}a["sekyro-client-form-factor"]=f();try{let d=await y.deviceHeader();d!==void 0&&(a["sekyro-client-device"]=d)}catch{}for(let d=0;;d++){let i;try{i=await this.fetchImpl(r,{method:e,headers:a,...t.body!==void 0?{body:JSON.stringify(t.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(p){throw m(p)}if(i.ok){if(t.empty===!0)return;if(t.blob===!0)try{return await i.blob()}catch(w){throw m(w)}let p;try{p=await i.json()}catch{throw new c({status:i.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${i.status})`})}return x(p)}let u=await D(i);if(u.code==="idempotency_in_progress"&&d<this.retryAttempts){this.retryDelayMs>0&&await k(this.retryDelayMs);continue}if(o&&u.status===503&&A.has(u.code)){o=!1,await k(_(u.retryAfterSeconds,v,this.random));continue}throw u}}};function T(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0&&n<=6e5}function m(n){if((typeof n=="object"&&n!==null?n.name:void 0)==="TimeoutError")return new c({status:0,code:"timeout",message:"request timed out"});let s=n instanceof Error?n.message:String(n);return new c({status:0,code:"network_error",message:`network request failed: ${s}`})}function x(n){return n!==null&&typeof n=="object"&&"success"in n&&"data"in n?n.data:n}async function D(n){let e="unknown_error",s=`request failed (HTTP ${n.status})`,t=Number.NaN,o;try{let d=await n.json();if(d!==null&&typeof d=="object"){let i=d;typeof i.code=="string"&&i.code.length>0&&(e=i.code),typeof i.message=="string"&&i.message.length>0&&(s=i.message),typeof i.retryAfterSeconds=="number"&&(t=i.retryAfterSeconds),Array.isArray(i.details?.issues)?o=i.details:Array.isArray(i.details?.errors)&&(o={...i.details,issues:[]})}}catch{}let r=n.headers.get("retry-after"),a=r===null?Math.floor(t):Number.parseInt(r,10);return new c({status:n.status,code:e,message:s,...Number.isFinite(a)&&a>=0?{retryAfterSeconds:a}:{},details:o})}function k(n){return new Promise(e=>setTimeout(e,n))}function j(n){let e=n?.portrait,s=e?.icao,t=e?.purpose==="id_document";return s==null?t?{policy:"reject",profile:"id_document"}:null:{policy:s.policy==="alert"?"alert":"reject",profile:t||s.profile==="id_document"?"id_document":"selfie"}}function B(n){return{...n.baselineEyeOpenness!==void 0?{baselineEyeOpenness:n.baselineEyeOpenness}:{},...n.baselineEyeOpennessLeft!==void 0&&n.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:n.baselineEyeOpennessLeft,baselineEyeOpennessRight:n.baselineEyeOpennessRight}:{},criteria:n.verdict??{},...n.backgroundCheck!==void 0?{backgroundCheck:n.backgroundCheck}:{}}}export{S as a,K as b,c,_ as d,l as e,N as f,g,j as h,B as i};
|