@sekyro/react 0.1.0-rc.17 → 0.1.0-rc.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/README.md +15 -7
- package/dist/chunk-64KUMWHB.js +2 -0
- package/dist/chunk-7Z4LVT2A.js +2 -0
- package/dist/chunk-DIE7UVV7.js +2 -0
- package/dist/chunk-E7PG3JL4.js +2 -0
- package/dist/chunk-HVH6GGI4.js +2 -0
- package/dist/chunk-MM5EYC7B.js +2 -0
- package/dist/chunk-MX5SNIDY.js +2 -0
- package/dist/{chunk-Z7US4CLZ.js → chunk-OFPS67YV.js} +1 -1
- package/dist/chunk-ONYT4GJ4.js +2 -0
- package/dist/chunk-PESMIB3E.js +2 -0
- package/dist/{chunk-A6UYUVEG.js → chunk-TLMGY7AK.js} +1 -1
- package/dist/chunk-TWZZGFO5.js +2 -0
- package/dist/chunk-YZ5ZR6UR.js +2 -0
- package/dist/document-capture-view-DMRIMB3Z.js +2 -0
- package/dist/eid-view-DZBYRACA.js +2 -0
- package/dist/email-otp-view-GW2VEEPW.js +2 -0
- package/dist/flow-views-T3Y6QDXH.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/overlay-de-C7OXK65Q.js +2 -0
- package/dist/overlay-es-WGFBBRYI.js +2 -0
- package/dist/overlay-pt-EJEA6RF7.js +2 -0
- package/dist/portrait-capture-view-TL5ZZNZF.js +2 -0
- package/dist/portrait-review-view-W7DDLF64.js +2 -0
- package/dist/styles.css +23 -0
- package/dist/{theme-DuvMUYA9.d.ts → theme-YmIQ6Ux1.d.cts} +36 -15
- package/dist/{theme-DuvMUYA9.d.cts → theme-YmIQ6Ux1.d.ts} +36 -15
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +31 -13
- package/dist/verification/index.d.ts +31 -13
- package/dist/verification/index.js +1 -1
- package/dist/verification.css +17 -3
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-25KWDPLY.js +0 -2
- package/dist/chunk-6I7GU4FS.js +0 -2
- package/dist/chunk-DY5WQVPE.js +0 -2
- package/dist/chunk-JT7YHK7F.js +0 -2
- package/dist/chunk-LPGHMDD4.js +0 -2
- package/dist/chunk-NV7HZJM4.js +0 -2
- package/dist/chunk-T3PAN4NN.js +0 -2
- package/dist/chunk-XTQARDSJ.js +0 -2
- package/dist/chunk-YVNQ3UUH.js +0 -2
- package/dist/document-capture-view-WDGHEAUI.js +0 -2
- package/dist/eid-view-HQLNWM6A.js +0 -2
- package/dist/email-otp-view-LCIDGNZT.js +0 -2
- package/dist/flow-views-K3HXMKPU.js +0 -2
- package/dist/overlay-de-YQA44XTY.js +0 -2
- package/dist/overlay-es-6KRUPYG4.js +0 -2
- package/dist/overlay-pt-QEAE4TDI.js +0 -2
- package/dist/portrait-capture-view-I7I6FJQO.js +0 -2
- package/dist/portrait-review-view-A5HGZ7ZN.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-
|
|
2
|
-
export { k as StringKey, A as retakeHintStringKey } from '../theme-
|
|
1
|
+
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-YmIQ6Ux1.cjs';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-YmIQ6Ux1.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
|
|
@@ -16,8 +16,9 @@ interface StepStrings {
|
|
|
16
16
|
"consent.terms.processing": string;
|
|
17
17
|
"consent.terms.sharing": string;
|
|
18
18
|
"consent.terms.retention": string;
|
|
19
|
-
"capture.
|
|
20
|
-
"capture.
|
|
19
|
+
"capture.modeSwitch.toSelfPhoto": string;
|
|
20
|
+
"capture.modeSwitch.toAssistedLabelPhoto": string;
|
|
21
|
+
"capture.modeSwitch.toSelfLabelPhoto": string;
|
|
21
22
|
"reasons.camera_unavailable": string;
|
|
22
23
|
"otp.sendTitle": string;
|
|
23
24
|
"otp.sendDescription": string;
|
|
@@ -44,6 +45,7 @@ interface StepStrings {
|
|
|
44
45
|
"otp.chooseChannel": string;
|
|
45
46
|
"otp.sendBy": string;
|
|
46
47
|
"otp.resendBy": string;
|
|
48
|
+
"otp.sending": string;
|
|
47
49
|
"otp.reason_otp_channel_unavailable": string;
|
|
48
50
|
"otp.reason_otp_destination_not_allowed": string;
|
|
49
51
|
"otp.reason_otp_destination_unknown": string;
|
|
@@ -117,10 +119,11 @@ interface StepStrings {
|
|
|
117
119
|
"session.processing.title": string;
|
|
118
120
|
"session.processing.description": string;
|
|
119
121
|
"handoff.title": string;
|
|
122
|
+
"handoff.lead.document": string;
|
|
123
|
+
"handoff.lead.portrait": string;
|
|
124
|
+
"capture.source.phone": string;
|
|
120
125
|
"session.processing.age_estimation.title": string;
|
|
121
126
|
"session.processing.age_estimation.description": string;
|
|
122
|
-
"session.result.approved.title": string;
|
|
123
|
-
"session.result.approved.description": string;
|
|
124
127
|
"session.result.review.title": string;
|
|
125
128
|
"session.result.review.description": string;
|
|
126
129
|
"session.result.rejected.title": string;
|
|
@@ -129,8 +132,19 @@ interface StepStrings {
|
|
|
129
132
|
"session.result.expired.description": string;
|
|
130
133
|
"session.result.detailsMismatch": string;
|
|
131
134
|
"session.result.deviceVelocity": string;
|
|
135
|
+
"session.result.verified.title": string;
|
|
136
|
+
"session.result.verified.description": string;
|
|
137
|
+
"session.result.inconclusive.title": string;
|
|
138
|
+
"session.result.inconclusive.description": string;
|
|
139
|
+
"session.result.unavailable.title": string;
|
|
140
|
+
"session.result.unavailable.description": string;
|
|
141
|
+
"session.result.policy.title": string;
|
|
142
|
+
"session.result.policy.description": string;
|
|
143
|
+
"session.result.cooldown.title": string;
|
|
144
|
+
"session.result.cooldown.description": string;
|
|
132
145
|
"session.result.deviceStop": string;
|
|
133
146
|
"result.referenceLabel": string;
|
|
147
|
+
"capture.retrySamePerson.message": string;
|
|
134
148
|
"common.loading": string;
|
|
135
149
|
"common.refresh": string;
|
|
136
150
|
"common.noAttemptsLeft": string;
|
|
@@ -223,6 +237,8 @@ interface StepStrings {
|
|
|
223
237
|
"returning.heading": string;
|
|
224
238
|
"capture.checkingTitle": string;
|
|
225
239
|
"method.heading": string;
|
|
240
|
+
"sandbox.otpHint": string;
|
|
241
|
+
"sandbox.skipCapture": string;
|
|
226
242
|
"population.recheck.title": string;
|
|
227
243
|
"population.recheck.description": string;
|
|
228
244
|
"otp.phoneInvalid": string;
|
|
@@ -266,12 +282,15 @@ interface StepStrings {
|
|
|
266
282
|
"native.face.humanIntroLead": string;
|
|
267
283
|
"native.doc.holdIt": string;
|
|
268
284
|
"native.doc.changeCountry": string;
|
|
269
|
-
"native.result.approved": string;
|
|
270
285
|
"native.result.review": string;
|
|
271
286
|
"native.result.rejected": string;
|
|
272
287
|
"native.result.expired": string;
|
|
273
288
|
"native.result.copied": string;
|
|
274
289
|
"native.result.back": string;
|
|
290
|
+
"native.result.verified": string;
|
|
291
|
+
"native.result.inconclusive": string;
|
|
292
|
+
"native.result.unavailable": string;
|
|
293
|
+
"native.result.policy": string;
|
|
275
294
|
"emailOtp.reason_otp_daily_cap_reached"?: string;
|
|
276
295
|
"emailOtp.sendTitle"?: string;
|
|
277
296
|
"emailOtp.sendDescription"?: string;
|
|
@@ -375,7 +394,6 @@ interface StepStrings {
|
|
|
375
394
|
"portrait.fixes.background"?: string;
|
|
376
395
|
"portrait.fixes.exposure"?: string;
|
|
377
396
|
"portrait.fixes.white_balance"?: string;
|
|
378
|
-
"reasons.portrait_recaptured"?: string;
|
|
379
397
|
"reasons.portrait_morph_suspected"?: string;
|
|
380
398
|
"reasons.portrait_reference_mismatch"?: string;
|
|
381
399
|
"reasons.portrait_declined_fix"?: string;
|
|
@@ -559,9 +577,9 @@ declare function PortraitCapture({ step, locale, strings, className, assetBaseUr
|
|
|
559
577
|
/** Self-hosted MediaPipe assets (wasm fileset + `face_landmarker.task`); default `/models-v3`. */
|
|
560
578
|
assetBaseUrl?: string;
|
|
561
579
|
/**
|
|
562
|
-
* The session's verification:
|
|
563
|
-
*
|
|
564
|
-
*
|
|
580
|
+
* The session's verification: the camera waits for the session's capture mode. Under `choice` the camera opens on
|
|
581
|
+
* the person's pick (`self` before one) and switches on the camera view (spec 2026-11-06 §3.3). Without it the
|
|
582
|
+
* camera follows the step handle.
|
|
565
583
|
*/
|
|
566
584
|
verification?: Verification;
|
|
567
585
|
}): react.JSX.Element;
|
|
@@ -626,7 +644,7 @@ interface SekyroVerificationProps {
|
|
|
626
644
|
onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
|
|
627
645
|
/**
|
|
628
646
|
* The link a desktop shows as a QR code when the live photo needs a phone
|
|
629
|
-
* (the session's `
|
|
647
|
+
* (the session's `hostedUrl`); absent = a "continue on your phone" notice.
|
|
630
648
|
* `<SekyroFlow>` defaults it to this page's address.
|
|
631
649
|
*/
|
|
632
650
|
handoffUrl?: string;
|
|
@@ -635,7 +653,7 @@ interface SekyroVerificationProps {
|
|
|
635
653
|
declare function SekyroVerification(props: SekyroVerificationProps): react.JSX.Element;
|
|
636
654
|
|
|
637
655
|
interface SekyroFlowProps extends SekyroVerificationProps {
|
|
638
|
-
/** The session's `
|
|
656
|
+
/** The session's `hostedUrl` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
|
|
639
657
|
hostedUrl?: string;
|
|
640
658
|
/** Override the in-app browser detection (tests / hosts that know better). */
|
|
641
659
|
inAppBrowser?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-
|
|
2
|
-
export { k as StringKey, A as retakeHintStringKey } from '../theme-
|
|
1
|
+
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-YmIQ6Ux1.js';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-YmIQ6Ux1.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
|
|
@@ -16,8 +16,9 @@ interface StepStrings {
|
|
|
16
16
|
"consent.terms.processing": string;
|
|
17
17
|
"consent.terms.sharing": string;
|
|
18
18
|
"consent.terms.retention": string;
|
|
19
|
-
"capture.
|
|
20
|
-
"capture.
|
|
19
|
+
"capture.modeSwitch.toSelfPhoto": string;
|
|
20
|
+
"capture.modeSwitch.toAssistedLabelPhoto": string;
|
|
21
|
+
"capture.modeSwitch.toSelfLabelPhoto": string;
|
|
21
22
|
"reasons.camera_unavailable": string;
|
|
22
23
|
"otp.sendTitle": string;
|
|
23
24
|
"otp.sendDescription": string;
|
|
@@ -44,6 +45,7 @@ interface StepStrings {
|
|
|
44
45
|
"otp.chooseChannel": string;
|
|
45
46
|
"otp.sendBy": string;
|
|
46
47
|
"otp.resendBy": string;
|
|
48
|
+
"otp.sending": string;
|
|
47
49
|
"otp.reason_otp_channel_unavailable": string;
|
|
48
50
|
"otp.reason_otp_destination_not_allowed": string;
|
|
49
51
|
"otp.reason_otp_destination_unknown": string;
|
|
@@ -117,10 +119,11 @@ interface StepStrings {
|
|
|
117
119
|
"session.processing.title": string;
|
|
118
120
|
"session.processing.description": string;
|
|
119
121
|
"handoff.title": string;
|
|
122
|
+
"handoff.lead.document": string;
|
|
123
|
+
"handoff.lead.portrait": string;
|
|
124
|
+
"capture.source.phone": string;
|
|
120
125
|
"session.processing.age_estimation.title": string;
|
|
121
126
|
"session.processing.age_estimation.description": string;
|
|
122
|
-
"session.result.approved.title": string;
|
|
123
|
-
"session.result.approved.description": string;
|
|
124
127
|
"session.result.review.title": string;
|
|
125
128
|
"session.result.review.description": string;
|
|
126
129
|
"session.result.rejected.title": string;
|
|
@@ -129,8 +132,19 @@ interface StepStrings {
|
|
|
129
132
|
"session.result.expired.description": string;
|
|
130
133
|
"session.result.detailsMismatch": string;
|
|
131
134
|
"session.result.deviceVelocity": string;
|
|
135
|
+
"session.result.verified.title": string;
|
|
136
|
+
"session.result.verified.description": string;
|
|
137
|
+
"session.result.inconclusive.title": string;
|
|
138
|
+
"session.result.inconclusive.description": string;
|
|
139
|
+
"session.result.unavailable.title": string;
|
|
140
|
+
"session.result.unavailable.description": string;
|
|
141
|
+
"session.result.policy.title": string;
|
|
142
|
+
"session.result.policy.description": string;
|
|
143
|
+
"session.result.cooldown.title": string;
|
|
144
|
+
"session.result.cooldown.description": string;
|
|
132
145
|
"session.result.deviceStop": string;
|
|
133
146
|
"result.referenceLabel": string;
|
|
147
|
+
"capture.retrySamePerson.message": string;
|
|
134
148
|
"common.loading": string;
|
|
135
149
|
"common.refresh": string;
|
|
136
150
|
"common.noAttemptsLeft": string;
|
|
@@ -223,6 +237,8 @@ interface StepStrings {
|
|
|
223
237
|
"returning.heading": string;
|
|
224
238
|
"capture.checkingTitle": string;
|
|
225
239
|
"method.heading": string;
|
|
240
|
+
"sandbox.otpHint": string;
|
|
241
|
+
"sandbox.skipCapture": string;
|
|
226
242
|
"population.recheck.title": string;
|
|
227
243
|
"population.recheck.description": string;
|
|
228
244
|
"otp.phoneInvalid": string;
|
|
@@ -266,12 +282,15 @@ interface StepStrings {
|
|
|
266
282
|
"native.face.humanIntroLead": string;
|
|
267
283
|
"native.doc.holdIt": string;
|
|
268
284
|
"native.doc.changeCountry": string;
|
|
269
|
-
"native.result.approved": string;
|
|
270
285
|
"native.result.review": string;
|
|
271
286
|
"native.result.rejected": string;
|
|
272
287
|
"native.result.expired": string;
|
|
273
288
|
"native.result.copied": string;
|
|
274
289
|
"native.result.back": string;
|
|
290
|
+
"native.result.verified": string;
|
|
291
|
+
"native.result.inconclusive": string;
|
|
292
|
+
"native.result.unavailable": string;
|
|
293
|
+
"native.result.policy": string;
|
|
275
294
|
"emailOtp.reason_otp_daily_cap_reached"?: string;
|
|
276
295
|
"emailOtp.sendTitle"?: string;
|
|
277
296
|
"emailOtp.sendDescription"?: string;
|
|
@@ -375,7 +394,6 @@ interface StepStrings {
|
|
|
375
394
|
"portrait.fixes.background"?: string;
|
|
376
395
|
"portrait.fixes.exposure"?: string;
|
|
377
396
|
"portrait.fixes.white_balance"?: string;
|
|
378
|
-
"reasons.portrait_recaptured"?: string;
|
|
379
397
|
"reasons.portrait_morph_suspected"?: string;
|
|
380
398
|
"reasons.portrait_reference_mismatch"?: string;
|
|
381
399
|
"reasons.portrait_declined_fix"?: string;
|
|
@@ -559,9 +577,9 @@ declare function PortraitCapture({ step, locale, strings, className, assetBaseUr
|
|
|
559
577
|
/** Self-hosted MediaPipe assets (wasm fileset + `face_landmarker.task`); default `/models-v3`. */
|
|
560
578
|
assetBaseUrl?: string;
|
|
561
579
|
/**
|
|
562
|
-
* The session's verification:
|
|
563
|
-
*
|
|
564
|
-
*
|
|
580
|
+
* The session's verification: the camera waits for the session's capture mode. Under `choice` the camera opens on
|
|
581
|
+
* the person's pick (`self` before one) and switches on the camera view (spec 2026-11-06 §3.3). Without it the
|
|
582
|
+
* camera follows the step handle.
|
|
565
583
|
*/
|
|
566
584
|
verification?: Verification;
|
|
567
585
|
}): react.JSX.Element;
|
|
@@ -626,7 +644,7 @@ interface SekyroVerificationProps {
|
|
|
626
644
|
onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
|
|
627
645
|
/**
|
|
628
646
|
* The link a desktop shows as a QR code when the live photo needs a phone
|
|
629
|
-
* (the session's `
|
|
647
|
+
* (the session's `hostedUrl`); absent = a "continue on your phone" notice.
|
|
630
648
|
* `<SekyroFlow>` defaults it to this page's address.
|
|
631
649
|
*/
|
|
632
650
|
handoffUrl?: string;
|
|
@@ -635,7 +653,7 @@ interface SekyroVerificationProps {
|
|
|
635
653
|
declare function SekyroVerification(props: SekyroVerificationProps): react.JSX.Element;
|
|
636
654
|
|
|
637
655
|
interface SekyroFlowProps extends SekyroVerificationProps {
|
|
638
|
-
/** The session's `
|
|
656
|
+
/** The session's `hostedUrl` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
|
|
639
657
|
hostedUrl?: string;
|
|
640
658
|
/** Override the in-app browser detection (tests / hosts that know better). */
|
|
641
659
|
inAppBrowser?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as xo}from"../chunk-LPGHMDD4.js";import{a as K,d as fo,e as ut,f as qe,g as mo,h as yo}from"../chunk-Z7US4CLZ.js";import{a as go,b as ho,c as Co}from"../chunk-GUTF3SPK.js";import{a as No,b as wo,c as Po,d as _o,e as pt,g as Xe}from"../chunk-JT7YHK7F.js";import{b as so,c as io,d as ao,e as lo,f as co,h as uo,k as po}from"../chunk-DY5WQVPE.js";import{b as no}from"../chunk-6I7GU4FS.js";import{a as ro}from"../chunk-7MMT5M4E.js";import{a as ke}from"../chunk-VRDPGOXM.js";import{a as bn,b as vn,c as Cn,d as Nn,e as wn,f as Ae,g as I}from"../chunk-XTQARDSJ.js";import{a as F,b as re,c as ko,d as se,e as So,f as Ze,g as Je,h as dt,i as bo,l as vo,m as O,n as Qe}from"../chunk-NV7HZJM4.js";import{c as oo}from"../chunk-A6UYUVEG.js";import{a as w,c as Xt,j as kn,l as Sn,m as jt,n as eo,o as to,q as ct,r as he}from"../chunk-25KWDPLY.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as Pn,useState as Eo}from"react";function ft(e){let[t,n]=Eo(()=>e?.currentStep?.()??null),[o,l]=Eo(null);return Pn(()=>{if(e===void 0)return;if(typeof e.run!="function"){l(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",a=>{i&&n(a)});return e.run().then(a=>{i&&n(u=>u??a)},a=>{i&&l(a)}),()=>{i=!1,r()}},[e]),{step:t,error:o}}s(ft,"useVerificationStep");import{useEffect as gt,useId as En,useMemo as In,useRef as ht,useState as oe}from"react";var _n="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",Io;function To(e){return Io??(Io=new Map(_n.split(" ").map(t=>{let[n,o]=t.slice(2).split("/");return[t.slice(0,2),[n,o]]}))),Io.get(e.toUpperCase())}s(To,"entryOf");function Ro(e){return To(e)?.[0]}s(Ro,"dialCodeOf");function Lo(e){return To(e)?.[1]}s(Lo,"nationalPrefixOf");import{normalizeNni as xn}from"@sekyro/web";function je(e){let t=xn(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${t}`:t.startsWith("00")?`+${t.slice(2)}`:t}s(je,"digitsOf");var mt=s((e,t)=>(t.trunk!==void 0&&e.startsWith(t.trunk)?e.slice(t.trunk.length):e).slice(0,Math.max(...t.lengths)),"fitDigits");function et(e,t){let n="",o=0;for(let l of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])o<e.length&&(n+=(o>0?" ":"")+e.slice(o,o+l)),o+=l;return n+e.slice(o)}s(et,"groupDigits");function Mo(e,t){let n=0;for(let o=t;o>0&&n<e.length;n+=1)e[n]!==" "&&(o-=1);return n}s(Mo,"caretAfter");var yt=s((e,t)=>t.find(n=>e.startsWith(n.dial)),"countryOfNumber"),Oo=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as Ho,jsx as v,jsxs as $}from"react/jsx-runtime";var Do=s((e,t,n)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.min(n,Math.max(0,Math.ceil(o/1e3))):0},"secondsUntil"),Tn=600,Rn=30,Ln=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Mn=["whatsapp","sms"],Ao=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_resend_limit","otp_number_invalid","otp_number_not_mobile"]);function Fo(e){let t=je(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s(Fo,"normalizedPhone");var On=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function Dn(e){let t=[];for(let n of e.phoneCountries??["MR"]){let o=e.phoneRules?.find(i=>i.code===n),l=o?.dial??Ro(n);l!==void 0&&!t.some(i=>i.code===n)&&t.push({code:n,dial:`+${l}`,...o!==void 0?{rule:o}:{}})}return t}s(Dn,"phoneCountriesOf");function An(e,t){if(t===null||!e.startsWith(t.dial))return Fo(e);let n=e.slice(t.dial.length).replace(/\D/g,""),o=Lo(t.code);return o!==void 0&&n.startsWith(o)&&(n=n.slice(o.length)),Fo(t.dial+n)}s(An,"e164Of");var Bo=s((e,t)=>(yt(e,t)??t[0])?.code??null,"countryFor");function Fn(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return n=>`${t?.of(n.code)??n.code} (${n.dial})`}s(Fn,"countryLabels");var Vo="other";function kt({step:e,locale:t,strings:n,className:o,defaultPhone:l,onError:i}){let r=I(t,n),{t:a}=r,u=In(()=>Dn(e),[e.phoneCountries,e.phoneRules]),f=l??u[0]?.dial??"",[g,m]=oe(()=>Bo(f,u)),h=u.map(y=>y.code).join(",");gt(()=>{if(g===null||!u.some(y=>y.code===g)){let y=Bo(f,u);m(y);let N=x.current,q=u.find(Q=>Q.code===y)?.dial;q!==void 0&&L(Q=>N!==null&&Q.startsWith(N.dial)?q+Q.slice(N.dial.length):Q.startsWith("+")?Q:q)}},[h,f]);let d=u.find(y=>y.code===g)??null,x=ht(d);d!==null&&(x.current=d);let[k,L]=oe(f),[E,C]=oe(!1),[D,U]=oe(!1),[S,P]=oe(""),[_,M]=oe(!1),[A,ce]=oe(null),[xe,ue]=oe(!1),[Ee,He]=oe(null),de=ht(null),pe=e.phase==="verify"&&!xe,$e=e.phase==="verify",Ie=Co($e),[me,Ue]=go(e.reason==="otp_mismatch",e.attemptsRemaining,()=>P("")),X=En(),fe=ht(null);gt(()=>{let y=setTimeout(()=>fe.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(y)},[pe]);let Te=e.phase==="verify"?e.codeExpiresAt??"sent":null;gt(()=>{Te!==null&&(ue(!1),de.current!==null&&!Ao.has(e.reason??"")&&He(de.current),de.current=null)},[Te]);let W=s(async y=>{M(!0),ce(null);try{await y()}catch(N){ce(ke(N,r.strings)),i?.(N)}finally{M(!1)}},"run"),Z=Mn.filter(y=>(e.channels??[]).includes(y)),ye=e.phoneInternational===!0,T=E||d===null,z=T||k.startsWith("+")&&!k.startsWith(d.dial),Y=z?void 0:d.rule,p=z?k:k.replace(d.dial,"").replace(/\D/g,""),b=Y?mt(p,Y):p,J=z&&!T&&!ye&&e.phoneRules?.length&&!u.some(y=>y.dial.startsWith(k)),Ke=J?null:Y?Y.lengths.includes(b.length)?d.dial+b:null:T&&!k.startsWith("+")?null:An(k,E?null:d),Re=!e.needsPhone||Ke!==null,Ge=s((y,N=!1)=>{let q=e.needsPhone?N?Ee:{number:Ke??k,shown:z||d===null?Ke??k:`${d.dial} ${et(b,Y)}`}:null;de.current=q,W(async()=>{try{await e.send({...q!==null?{phone:q.number}:{},...y!==void 0?{channel:y}:{}})}catch(Q){throw de.current=null,Q}})},"send"),$t=s(y=>{W(()=>e.verify(y))},"submitCode"),Ut=s(y=>{y.preventDefault(),pe?$t(S):Z.length<=1&&Re&&Ge(Z[0])},"onSubmit"),mn=s(y=>{let N=y.target,q=y.nativeEvent.inputType,Q=Math.max(0,N.value.lastIndexOf("+")),ge=je(N.value.slice(Q)),Me=yt(ge,u),Oe=je(N.value.slice(Q,N.selectionStart)).length,at=ge,Zt=ge;if(U(!1),!Me&&(T||ge.startsWith("+")))ye&&C(!0);else{let De=Me??d,te=Me?ge.slice(Me.dial.length):ge;if(m(De.code),C(!1),te===b&&q?.startsWith("delete")&&(q.endsWith("Forward")||(Oe-=1),te=te.slice(0,Oe)+te.slice(Oe+1)),De.rule){let lt=mt(te,De.rule),Qt=te.length-lt.length;Oe-=Qt,te=Qt>0&&!Me&&b.length===lt.length?b:lt}Zt=De.dial+te,at=et(te,De.rule)}L(Zt),N.value=at;let Jt=Mo(at,Oe);N.setSelectionRange(Jt,Jt)},"onNumber"),We=J?a("otp.reason_otp_destination_not_allowed"):D&&Y?a("otp.phoneLengthError",{digits:Oo(Y,a("otp.or"))}):"",Kt=u.length>1||ye,ne=`${X}-phone`,it=Do(e.codeExpiresAt,Ie,Tn),Le=Do(e.resendAvailableAt,Ie,Rn),ze=pe&&e.codeExpiresAt!==void 0&&it===0,Gt=e.needsPhone&&!e.attemptsExhausted,Wt=$e&&(e.codeExpiresAt===void 0||it>0),zt=pe&&Gt?()=>ue(!0):xe&&Wt?()=>ue(!1):null;Ze(zt===null?null:_?()=>{}:zt);let Ye=s(y=>a(y==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[yn,gn]=a("otp.sentTo",{channel:Ye(e.channel)}).split("{number}"),hn=e.reason==="otp_mismatch"?$(O,{tone:"danger",children:[v("span",{children:a("otp.reason_otp_mismatch")}),v("span",{children:Qe(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Ao.has(e.reason)?v(O,{tone:"warning",children:v("span",{children:a(`otp.reason_${e.reason}`)})}):null,Yt=$(Ho,{children:[hn,A!==null?v(O,{tone:"danger",children:v("span",{children:a(A)})}):null]});if(pe){let y=Z.length===0;return $("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":X,onSubmit:Ut,noValidate:!0,children:[v(re,{id:X,title:a("otp.verifyTitle"),lead:$(Ho,{children:[yn,v("bdi",{dir:"ltr",className:"sekyro-mono",children:Ee?.shown??e.sentToMasked}),gn]})}),Yt,$("div",{className:"sekyro-field",children:[v("label",{className:"sekyro-label",htmlFor:`${X}-code`,children:a("otp.codeLabel")}),v(ho,{id:`${X}-code`,value:S,invalid:me,onChange:N=>{N!==""&&Ue(),P(N),N.length===6&&S.length!==6&&!_&&!e.attemptsExhausted&&$t(N)}}),v("span",{className:`sekyro-help sekyro-otp-expiry${ze?" is-danger":""}`,"aria-hidden":!ze||void 0,children:ze?a("otp.expired"):a("otp.expiresIn",{time:Ln(it)})})]}),v("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ze?a("otp.expired"):""}),$(se,{children:[v(w,{type:"submit",full:!0,disabled:_||S.length!==6||e.attemptsExhausted,"aria-busy":_||void 0,children:a("otp.verify")}),$("div",{className:"sekyro-resend-row",children:[y?v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_||Le>0,onClick:()=>Ge(void 0,!0),children:Le>0?a("otp.resendIn",{seconds:Le}):a("otp.resend")}):Le>0?v("p",{className:"sekyro-resend is-waiting",children:a("otp.resendIn",{seconds:Le})}):Z.map(N=>v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_,onClick:()=>Ge(N,!0),children:a("otp.resendBy",{channel:Ye(N)})},N)),Gt?v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_,onClick:()=>ue(!0),"data-testid":"sekyro-otp-change",children:a("otp.changeNumber")}):null]})]})]})}let qt=Fn(r.locale);return $("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":X,onSubmit:Ut,noValidate:!0,children:[v(re,{id:X,title:a("otp.sendTitle"),lead:a("otp.sendDescription")}),Yt,e.needsPhone?$("div",{className:"sekyro-field",children:[v("label",{className:"sekyro-label",htmlFor:ne,children:a("otp.phoneLabel")}),$("div",{className:"sekyro-phone",dir:"ltr",children:[d===null||z&&!E?null:$("div",{className:"sekyro-phone__lead",children:[Kt?$("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${a("otp.countryLabel")}: ${E?a("otp.otherCountry"):qt(d)}`,value:E?Vo:d.code,onChange:y=>{U(!1);let N=u.find(q=>q.code===y.target.value);C(N===void 0),N!==void 0&&m(N.code),L(N===void 0?"":N.dial+(z?"":b))},children:[u.map(y=>v("option",{value:y.code,children:qt(y)},y.code)),ye?v("option",{value:Vo,children:a("otp.otherCountry")}):null]}):null,$("span",{className:"sekyro-phone__dial",id:`${ne}-dial`,"aria-hidden":Kt||void 0,children:[v("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:E?"🌐":On(d.code)}),E?null:d.dial]})]}),v("input",{ref:fe,id:ne,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel","aria-describedby":`${z?"":`${ne}-dial ${ne}-hint `}${We?`${ne}-error`:""}`.trim()||void 0,"aria-invalid":!!We||void 0,placeholder:T?"+":void 0,value:z?k:et(b,Y),onChange:mn,onKeyDown:y=>{y.key==="Enter"&&!Re&&U(!0)},onBlur:y=>{y.relatedTarget?.tagName!=="SELECT"&&U(b!==""&&Ke===null)}})]}),z?null:v("span",{className:"sekyro-help",id:`${ne}-hint`,children:a("otp.phonePlaceholderGeneric")}),We?v("span",{className:"sekyro-help is-danger",id:`${ne}-error`,role:"alert",children:We}):null]}):v("p",{className:"sekyro-text-muted",children:a("otp.prefilledNotice")}),$(se,{children:[Z.length===1?v(w,{type:"submit",full:!0,disabled:_||!Re,"aria-busy":_||void 0,children:a("otp.sendBy",{channel:Ye(Z[0])})}):Z.length>1?$("div",{className:"sekyro-actions__group",role:"group","aria-label":a("otp.chooseChannel"),children:[v("p",{className:"sekyro-label","aria-hidden":"true",children:a("otp.chooseChannel")}),v("div",{className:"sekyro-channel-row",children:Z.map(y=>$(w,{kind:"primary",disabled:_||!Re,"aria-busy":_||void 0,onClick:()=>Ge(y),children:[v(F,{name:y}),Ye(y)]},y))})]}):v(w,{type:"submit",full:!0,disabled:_||!Re,"aria-busy":_||void 0,children:a("otp.send")}),xe&&Wt?v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_,onClick:()=>ue(!1),"data-testid":"sekyro-otp-back-to-code",children:a("otp.backToCode")}):null]})]})}s(kt,"PhoneOtpStep");import{lazy as Vn,Suspense as Hn,useMemo as $n,useState as Un}from"react";import{Component as Bn}from"react";var St=class St extends Bn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(St,"LoadBoundary");var j=St;import{jsx as Se,jsxs as Gn}from"react/jsx-runtime";var Kn={load:s(()=>import("../email-otp-view-LCIDGNZT.js"),"load")};function bt({locale:e,strings:t,...n}){let o=I(e,t),[l,i]=Un(0),r=$n(()=>Vn(()=>Kn.load().then(u=>({default:u.EmailOtpView}))),[l]),a=Gn(O,{tone:"danger",children:[Se("span",{children:o.t("errors.network_error")}),Se(w,{kind:"secondary",onClick:()=>i(u=>u+1),children:o.t("common.retry")})]});return Se(j,{fallback:a,children:Se(Hn,{fallback:Se("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:Se(r,{...n,i18n:o})})},l)}s(bt,"EmailOtpStep");import{lazy as Wn,Suspense as zn,useMemo as Yn,useState as qn}from"react";import{jsx as be,jsxs as Jn}from"react/jsx-runtime";var Zn={load:s(()=>import("../eid-view-HQLNWM6A.js"),"load")};function vt({locale:e,strings:t,...n}){let o=I(e,t),[l,i]=qn(0),r=Yn(()=>Wn(()=>Zn.load().then(u=>({default:u.EidView}))),[l]),a=Jn(O,{tone:"danger",children:[be("span",{children:o.t("errors.network_error")}),be(w,{kind:"secondary",onClick:()=>i(u=>u+1),children:o.t("common.retry")})]});return be(j,{fallback:a,children:be(zn,{fallback:be("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:be(r,{...n,i18n:o})})},l)}s(vt,"EidStep");import{useMemo as nr}from"react";import{lazy as Qn,Suspense as Xn,useMemo as jn,useState as er}from"react";import{jsx as ve,jsxs as or}from"react/jsx-runtime";var tr={load:s(()=>import("../flow-views-K3HXMKPU.js"),"load")};function B({view:e,i18n:t,quiet:n,...o}){let[l,i]=er(0),r=jn(()=>Qn(()=>tr.load().then(u=>({default:u[e]}))),[e,l]),a=or(O,{tone:"danger",children:[ve("span",{children:t.t("errors.network_error")}),ve(w,{kind:"secondary",onClick:()=>i(u=>u+1),children:t.t("common.retry")})]});return ve(j,{fallback:a,children:ve(Xn,{fallback:n===!0?null:ve("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:ve(r,{...o,i18n:t})})},l)}s(B,"Flow");import{jsx as Ct,jsxs as rr}from"react/jsx-runtime";function Nt({step:e,locale:t,strings:n,className:o,onError:l}){let i=I(t,n),{busy:r,error:a,run:u}=Po(i,l),f=nr(()=>e.choice.options.flatMap(m=>{let h=wo(m,i),d=No[m.service];return h===null?[]:[{id:m.id,label:h,glyph:d&&Ct(F,{name:d})}]}),[e.choice.options,i]),g=e.choice.options.find(m=>m.service==="national_eid");return rr("div",{className:o,children:[Ct(ao,{title:i.t("method.heading"),description:i.t("method.description"),options:f,busy:r,error:a,focus:!0,testId:"sekyro-method",onChoose:m=>u(()=>e.choose(m))}),g?.nationalEid?.afterPass==="continue"?Ct(B,{view:"EidContinueHint",i18n:i,provider:g.nationalEid.providerName,quiet:!0}):null]})}s(Nt,"MethodChoice");import{isValidNni as sr,normalizeNni as $o}from"@sekyro/web";import{useId as ir,useState as wt}from"react";import{Fragment as ur,jsx as V,jsxs as Ce}from"react/jsx-runtime";var ar=new Set(["nni_not_found","registry_record_not_found"]),lr=new Set(["nni_invalid","id_number_invalid"]);function tt({step:e,locale:t,strings:n,className:o,onError:l}){let i=I(t,n),{t:r}=i,[a,u]=wt(""),[f,g]=wt(!1),[m,h]=wt(null),d=ir(),x=e.attemptsExhausted,k=s(async M=>{g(!0),h(null);try{await M()}catch(A){h(ke(A,i.strings)),l?.(A)}finally{g(!1)}},"run"),L=s(M=>{if(M.preventDefault(),e.source!=="typed"){k(()=>e.confirm());return}let A=$o(a);if(!/^\d{10}$/.test(A))return h("population.invalid");if(!sr(A))return h("population.reason_id_number_invalid");k(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(A):e.submitNni(A))},"onSubmit"),E=Qe(i,e.attemptsRemaining,x),C=e.reason!==void 0&&ar.has(e.reason),D=e.reason!==void 0&&lr.has(e.reason),U=Ce(ur,{children:[e.reason==="registry_unavailable"?Ce(O,{tone:"warning",children:[V("span",{children:r("population.reason_registry_unavailable")}),V("span",{children:E})]}):null,C&&e.canUseDocument?Ce(O,{tone:"warning",children:[V("span",{children:r("population.reason_registry_record_not_found_or_document")}),V("span",{children:E}),V(w,{kind:"secondary",disabled:f,onClick:()=>{k(()=>e.useDocument())},children:r("population.useDocument")})]}):null,C&&!e.canUseDocument||D?Ce(O,{tone:"danger",children:[V("span",{children:r(C?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),V("span",{children:E})]}):null,x&&e.reason===void 0?V(O,{tone:"danger",children:V("span",{children:E})}):null,m!==null?V(O,{tone:"danger",children:V("span",{children:r(m)})}):null]}),[S,P,_]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return Ce("form",{className:`sekyro-step${o?` ${o}`:""}`,"aria-labelledby":d,onSubmit:L,noValidate:!0,children:[V(re,{id:d,title:r(S),lead:r(P)}),U,e.source==="typed"?Ce("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:`${d}-id-number`,children:r("population.label")}),V("input",{id:`${d}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:a,"aria-describedby":`${d}-id-number-help`,"aria-invalid":m==="population.invalid"||m==="population.reason_id_number_invalid"||void 0,onChange:M=>{h(null),u($o(M.target.value).replace(/\D/g,"").slice(0,10))}}),V("span",{id:`${d}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,V(se,{children:x?null:V(w,{type:"submit",full:!0,disabled:f,"aria-busy":f||void 0,children:r(_)})})]})}s(tt,"IdNumberEntry");function cr(e){return tt(e)}s(cr,"NniEntry");import{acceptedIssuers as gr,acceptedTypesFor as zo,warmDocumentCapture as hr}from"@sekyro/web";import{lazy as kr,Suspense as Sr,useEffect as br,useMemo as vr,useState as xt}from"react";import{acceptedIssuers as dr,acceptedTypesFor as Pt}from"@sekyro/web";import{useEffect as Uo,useId as pr,useMemo as Ko,useState as _t}from"react";import{jsx as H,jsxs as Ne}from"react/jsx-runtime";var Go=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),fr=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),mr=220;function yr(e,t,n=[]){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}let l=t.map(a=>({code:a,name:o?.of(a)??a})),i=new Intl.Collator(e),r=s(a=>{let u=n.indexOf(a);return u<0?n.length:u},"rank");return l.sort((a,u)=>r(a.code)-r(u.code)||i.compare(a.name,u.name))}s(yr,"countryNames");function Wo({step:e,i18n:t,issuer:n,onPicked:o,ageStepUp:l=!1}){let{t:i,locale:r}=t,a=Ko(()=>dr(e.documents),[e.documents]),u=Ko(()=>yr(r,a,Object.keys(e.documents.byIssuer??{})),[r,a,e.documents]),f=a.length===1?a[0]:null,[g,m]=_t(n??f),[h,d]=_t(""),[x,k]=_t(null),L=pr(),E=f===null?[]:Pt(e.documents,f),C=f!==null&&E.length===1?E[0]:null;Uo(()=>{f!==null&&C!==null&&e.selectDocument(f,C)},[f,C]);let D=s((P,_)=>{e.selectDocument(P,_),o?.()},"pick"),U=s(P=>{let _=Pt(e.documents,P);_.length===1?D(P,_[0]):m(P)},"chooseIssuer");if(Uo(()=>{if(x===null||g===null)return;let P=setTimeout(()=>D(g,x),mr);return()=>clearTimeout(P)},[x]),Ze(g!==null&&a.length>1&&n===void 0?()=>{m(null),k(null)}:null),C!==null)return null;if(g===null){let P=Go(h.trim()),_=P===""?u:u.filter(M=>Go(M.name).includes(P)||M.code.toLowerCase()===P);return Ne("section",{className:"sekyro-step",children:[H(re,{title:i("doc.countryTitle"),lead:i(l?"doc.ageStepUp":"doc.pickDescription")}),Ne("div",{className:"sekyro-field",children:[H("label",{className:"sekyro-label",htmlFor:L,children:i("doc.countryLabel")}),H("input",{id:L,type:"search",className:"sekyro-input",placeholder:i("doc.countrySearch"),value:h,onChange:M=>d(M.target.value)})]}),_.length===0?H("p",{className:"sekyro-text-muted",children:i("doc.noCountryMatch")}):H("ul",{className:"sekyro-rows",children:_.map(M=>H("li",{children:Ne("button",{type:"button",className:"sekyro-row-btn",onClick:()=>U(M.code),children:[H("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:fr(M.code)}),M.name]})},M.code))}),H(se,{children:null})]})}let S=Pt(e.documents,g);return Ne("section",{className:"sekyro-step",children:[H(re,{title:i("doc.pickTitle"),lead:i(l&&f!==null?"doc.ageStepUp":"native.doc.holdIt")}),H("div",{className:"sekyro-choices",children:S.map(P=>Ne("button",{type:"button",className:"sekyro-card","aria-pressed":x===P,disabled:x!==null&&x!==P,onClick:()=>k(P),children:[H("span",{className:"sekyro-card__tile",children:H(F,{name:P==="passport"?"passport":"card"})}),Ne("span",{className:"sekyro-card__body",children:[H("span",{className:"sekyro-card__title",children:i(`doc.type.${P}`)}),H("span",{className:"sekyro-card__sub",children:i(`doc.sub.${P}`)})]}),H("span",{className:"sekyro-radio","aria-hidden":"true"})]},P))}),a.length>1?H("button",{type:"button",className:"sekyro-link",onClick:()=>{m(null),k(null)},children:i("native.doc.changeCountry")}):null,H(se,{children:null})]})}s(Wo,"DocumentPicker");import{jsx as ie,jsxs as Nr}from"react/jsx-runtime";var Cr={load:s(()=>import("../document-capture-view-WDGHEAUI.js"),"load")};function Et({step:e,locale:t,strings:n,className:o,liveMrz:l}){let i=I(t,n),[r,a]=xt(0),[u,f]=xt(null),g=gr(e.documents),m=g.length>1,h=e.issuer!==null&&zo(e.documents,e.issuer).length>1,d=e.documentType===null||e.issuer===null||u!==null,x=g.length===1&&zo(e.documents,g[0]).length===1,[k]=xt(()=>d&&!x),L=e.ageStepUp===!0,E=vr(()=>kr(()=>Cr.load().then(D=>({default:D.DocumentCaptureView}))),[r]);br(()=>{hr()},[]);let C=Nr(O,{tone:"danger",children:[ie("span",{children:i.t("errors.network_error")}),ie(w,{kind:"secondary",onClick:()=>a(D=>D+1),children:i.t("doc.retryCamera")})]});return ie("div",{className:o,children:d?ie(Wo,{step:e,i18n:i,ageStepUp:L&&u===null&&k,...u==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):ie(j,{fallback:C,children:ie(Sr,{fallback:ie("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:ie(E,{step:e,i18n:i,ageLead:L&&!k,liveMrz:l,...m?{onChangeCountry:s(()=>f("country"),"onChangeCountry")}:{},...h?{onChangeDocument:s(()=>f("document"),"onChangeDocument")}:{}})})},r)})}s(Et,"DocumentCapture");import{warmPortraitCapture as wr}from"@sekyro/web";import{Component as Pr,lazy as Yo,Suspense as qo,useEffect as _r,useMemo as Zo,useState as Jo}from"react";import{jsx as R,jsxs as It}from"react/jsx-runtime";var xr={load:s(()=>import("../portrait-capture-view-I7I6FJQO.js"),"load")},Er={load:s(()=>import("../portrait-review-view-A5HGZ7ZN.js"),"load")},Rt=class Rt extends Pr{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(Rt,"LoadBoundary");var ot=Rt;function Ir({step:e,i18n:t}){let{t:n}=t,o=he();return It("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[R("h2",{ref:o,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?R("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?It(O,{tone:"danger",children:[R("span",{children:n("portrait.uploadFailed")}),R(w,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):R("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}s(Ir,"MatchPhase");function Tt({step:e,locale:t,strings:n,className:o,assetBaseUrl:l,verification:i}){let r=I(t,n),a=uo(i),[u,f]=Jo(0),[g,m]=Jo(null),h=Zo(()=>Yo(()=>xr.load().then(S=>({default:S.PortraitCaptureView}))),[u]),d=Zo(()=>Yo(()=>Er.load().then(S=>({default:S.PortraitScreens}))),[u]),x=typeof e.uploadPortrait=="function",k=x?e.photo?.source??"camera":"camera",L=x&&k!=="camera"&&e.photo?.uploadOffered===!0,E=k!=="upload",C=k==="upload"?"upload":k==="choice"?g??e.photo?.pick??"source":"camera";if(_r(()=>{e.phase==="capture"&&C==="camera"&&wr()},[e.phase,C]),e.phase==="match")return R("div",{className:o,children:R(Ir,{step:e,i18n:r})});let D=R("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")});if(e.phase==="review"||C!=="camera")return R("div",{className:o,children:R(ot,{fallback:R(w,{kind:"ghost",onClick:()=>f(S=>S+1),children:r.t("common.retry")}),children:R(qo,{fallback:D,children:R(d,{screen:e.phase==="review"||C==="camera"?"review":C,step:e,i18n:r,...E?{onCamera:s(()=>m("camera"),"onCamera")}:{},onUpload:()=>m("upload"),onDeclined:()=>m(null)})})},u)});if(!a.settled)return R("div",{className:o,children:D});if((e.captureMode??a.session)==="choice"&&a.choice===null)return R("div",{className:o,children:R(oo,{value:S=>r.t(S),children:R(lo,{onChoose:a.choose,legend:r.t("capture.modePicker.legendPhoto"),help:r.t("capture.modePicker.helpPhoto")})})});let U=It(O,{tone:"danger",children:[R("span",{children:r.t("errors.network_error")}),R(w,{kind:"secondary",onClick:()=>f(S=>S+1),children:r.t("portrait.retryCamera")})]});return R("div",{className:o,children:R(ot,{fallback:U,children:R(qo,{fallback:D,children:R(h,{step:e,i18n:r,...l!==void 0?{assetBaseUrl:l}:{},...L?{onUpload:s(()=>m("upload"),"onUpload")}:{}})})},u)})}s(Tt,"PortraitCapture");import{cameraUnavailableCauseOf as qr}from"@sekyro/web";import{useCallback as ae,useContext as Zr,useEffect as Ft,useId as Jr,useMemo as Qr,useRef as Pe,useState as le}from"react";var Lt={light:{lineBrand:"#0d3b66",successSoft:"#d5f0e8",successFg:"#005341",onSuccess:"#ffffff",warningSoft:"#fff7e6",warningFg:"#735003",onWarning:"#191a1b",dangerSoft:"#ffdada",dangerFg:"#ca0f07",onDanger:"#ffffff",info:"#0563d4",infoSoft:"#d3e5ff",infoFg:"#064da5",onInfo:"#ffffff"},dark:{lineBrand:"#3f80bf",successSoft:"#002c23",successFg:"#53ffd4",onSuccess:"#030303",warningSoft:"#463102",warningFg:"#ffd98a",onWarning:"#030303",dangerSoft:"#9c1008",dangerFg:"#ffbbbb",onDanger:"#030303",info:"#5da9ff",infoSoft:"#063778",infoFg:"#acd0ff",onInfo:"#030303"},sizes:{buttonHeight:"52px",controlRadius:"10px",cardRadius:"16px",fieldRadius:"10px",iconTile:"56px",iconTileRadius:"16px",headerTile:"40px",choiceTile:"40px",tileRadius:"10px",resultDisc:"64px",resultRing:"8px",progressHeight:"4px",focusRing:"2px",focusRingOffset:"2px",otpBox:"60px",choiceMinHeight:"76px",stepGap:"32px",headingGap:"12px"},motion:{page:"320ms",easeOut:"cubic-bezier(0.16, 1, 0.3, 1)"}};var Fe={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},Tr=["danger","success","warning","info"];function Mt(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(Mt,"channel");function Qo(e){let t=Mt(parseInt(e.slice(1,3),16)),n=Mt(parseInt(e.slice(3,5),16)),o=Mt(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*o}s(Qo,"luminance");function Rr(e,t){let n=Qo(e),o=Qo(t),l=Math.max(n,o),i=Math.min(n,o);return(l+.05)/(i+.05)}s(Rr,"contrastRatio");function Xo(e,t){return Math.min(...Tr.map(n=>Rr(Fe[e][n].fg,t)))}s(Xo,"worstAgainst");function jo(e,t,n){return Math.min(Xo(e,t),Xo(e,n))}s(jo,"worstStatusContrast");function en(e,t){return jo("light",e,t)>=jo("dark",e,t)?"light":"dark"}s(en,"statusSchemeFor");import{useRef as Or,useState as Dr}from"react";import{useEffect as Lr,useId as Mr,useRef as Ot}from"react";import{jsx as we,jsxs as tn}from"react/jsx-runtime";function nt({open:e,title:t,closeLabel:n,onClose:o,children:l,actions:i,role:r,testId:a,returnFocus:u}){let f=Ot(null),g=Ot(null),m=Ot(!1),h=Mr();return Lr(()=>{let d=f.current;if(d!==null){if(e&&!d.open?(g.current=typeof document>"u"?null:document.activeElement,typeof d.showModal=="function"?d.showModal():d.setAttribute("open","")):!e&&d.open&&(typeof d.close=="function"?d.close():d.removeAttribute("open")),!e&&m.current){let x=u?.current??(g.current instanceof HTMLElement?g.current:null);g.current=null,x?.focus()}m.current=e}},[e,u]),we("dialog",{ref:f,className:"sekyro-dialog","aria-labelledby":h,...r==="alertdialog"?{role:r}:{},"data-testid":a,onCancel:d=>{d.preventDefault(),o()},onClick:d=>{d.target===d.currentTarget&&o()},children:tn("div",{className:"sekyro-dialog__panel",children:[tn("div",{className:"sekyro-dialog__head",children:[we("h2",{id:h,className:"sekyro-dialog__title",children:t}),n!==void 0?we("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:o,children:we(F,{name:"close"})}):null]}),l!==void 0?we("div",{className:"sekyro-dialog__body",children:l}):null,i!==void 0?we("div",{className:"sekyro-dialog__actions",children:i}):null]})})}s(nt,"FlowDialog");import{jsx as Be,jsxs as on}from"react/jsx-runtime";var Ar=["intro","data","processing","sharing","retention"];function nn({i18n:e,purpose:t="identity"}){let{t:n}=e,[o,l]=Dr(!1),i=Or(null),[r,a=""]=n("consent.short").split("{terms}");return on("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[on("p",{className:"sekyro-consent__line",children:[r,Be("button",{ref:i,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>l(!0),children:n("consent.termsLink")}),a]}),Be(nt,{open:o,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>l(!1),returnFocus:i,testId:"sekyro-consent-terms",children:Be("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Be(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):Ar.map(u=>Be("p",{children:n(`consent.terms.${u}`)},u))})})]})}s(nn,"ConsentNotice");function rn(e){let t=e.trim().split(/\s+/).filter(o=>o!=="");return(t.length>=2?[t[0],t[1]].map(o=>Array.from(o??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(rn,"initials");import{useSyncExternalStore as Fr}from"react";var ln=s(e=>({colors:{...e?K.dark:K.light},radius:K.radius,fontFamily:K.font}),"brandTheme"),va=ln(!1),sn=/^#[0-9a-f]{6}$/i;function Dt(e,t,n){if(t)return null;let o=ut(e).colors,l=n?.colors?.bg??o?.bg,i=n?.colors?.surface??o?.surface;return l===void 0&&i===void 0||l!==void 0&&!sn.test(l)||i!==void 0&&!sn.test(i)?null:en(l??K.light.bg,i??K.light.surface)}s(Dt,"partnerStatusScheme");function rt(e,t,n){let o=ut(e);if(n&&o.colors!==void 0){let{brand:l,brandFg:i}=o.colors;l!==void 0&&$r(l,K.dark.bg)>=3?o.colors={brand:l,ring:l,...i!==void 0?{brandFg:i}:{}}:delete o.colors}if(Dt(e,n,t)==="dark"){let l=Fe.dark;o.colors={...o.colors,danger:l.danger.base,success:l.success.base,warning:l.warning.fg}}return qe(ln(n),o,fo(t))}s(rt,"verificationTheme");function st(e){let t=Fr(Hr,Vr,()=>!1);return e==="dark"||e==="system"&&t}s(st,"useDarkScheme");var Br="(prefers-color-scheme: dark)",cn=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Br):null,"media"),Vr=s(()=>cn()?.matches??!1,"prefersDark");function Hr(e){let t=cn();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(Hr,"subscribe");function $r(e,t){let[n,o]=[an(e),an(t)];return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}s($r,"contrast");function an(e){let t=[1,3,5].map(n=>{let o=Number.parseInt(e.slice(n,n+2),16)/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(an,"luminance");import{useEffect as Ur,useId as Kr,useState as Gr}from"react";import{jsx as G,jsxs as Ve}from"react/jsx-runtime";var Wr=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]);function zr({outcome:e}){return e==="approved"?Ve("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 80 80","aria-hidden":"true",focusable:"false",children:[G("circle",{className:"sekyro-outcome__ring",cx:"40",cy:"40",r:"40"}),G("circle",{className:"sekyro-outcome__disc",cx:"40",cy:"40",r:"32"}),G("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(22 22) scale(1.5)"})]}):G("span",{className:`sekyro-tile sekyro-tile--${e==="review"?"info":"neutral"} sekyro-outcome-tile`,"aria-hidden":"true",children:G(F,{name:e==="review"?"pending":e==="expired"?"timer":"close"})})}s(zr,"OutcomeMark");function Yr({label:e,id:t,copied:n}){let[o,l]=Gr(!1);return Ur(()=>{if(!o)return;let i=setTimeout(()=>l(!1),1600);return()=>clearTimeout(i)},[o]),Ve("button",{type:"button",className:`sekyro-reference${o?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>l(!0),()=>{})},children:[G("span",{"aria-live":"polite",children:o?n:e}),G("bdi",{dir:"ltr",children:t}),G(F,{name:"copy"})]})}s(Yr,"ReferenceLine");function At({step:e,locale:t,strings:n,className:o,onClose:l}){let i=I(t,n),{t:r}=i,a=Kr(),u=he(),f=e.context.orgName,g=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",m;switch(e.display){case"policy_stop":{let h=e.failureReason??"";if(Wr.has(Xt(h)))m=r("session.result.detailsMismatch",{org:f});else if(h==="device_velocity_exceeded")m=r("session.result.deviceVelocity",{org:f});else if(h==="capture_tampered")m=r("session.result.deviceStop");else if(h==="camera_unavailable")m=r("reasons.camera_unavailable",{org:f});else if(h==="underage_estimated")m=r("reasons.underage_estimated");else if(h==="starter_credit_claimed")m=r("reasons.starter_credit_claimed");else if(h==="blocked_by_org")m=r("reasons.blocked_by_org");else{let d=eo(h);m=d!==null?r(d,{org:f}):r("session.result.rejected.description")}break}case"cooldown":{let h=to(i.locale,e.retryAfter);m=h!==null?r(h.key,{time:h.time}):r("reasons.device_cooldown");break}case"platform_unsupported":m=r("result.platform_unsupported");break;case"attempts_exhausted":m=r("common.noAttemptsLeft");break;default:m=f!==""?r(`native.result.${g}`,{org:f}):r(`session.result.${g}.description`)}return Ve("section",{className:`sekyro-result${o?` ${o}`:""}`,"aria-labelledby":a,"data-testid":"sekyro-result",children:[Ve("div",{className:"sekyro-result__body",children:[G(zr,{outcome:e.display==="cooldown"?"review":g}),Ve("div",{className:"sekyro-heading",children:[G("h2",{id:a,ref:u,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${g}.title`)}),G("p",{className:"sekyro-text-muted",children:m})]}),G(Yr,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),l!==void 0?G("div",{className:"sekyro-actions",children:G(w,{full:!0,onClick:l,children:f!==""?r("native.result.back",{org:f}):r("native.close")})}):null]})}s(At,"VerificationResultScreen");import{Fragment as Vt,jsx as c,jsxs as ee}from"react/jsx-runtime";function Xr(e,t,n){let o=t?K.dark:K.light,l=t?K.roles.dark:K.roles.light,i=e.colors??{},r={},a=i.fg===o.fg&&i.surface===o.surface;i.brand===o.brand&&i.surface===o.surface&&(r["--sekyro-color-brand-soft"]=l.brandSoft),a&&(r["--sekyro-color-line"]=l.line,r["--sekyro-color-line-subtle"]=l.lineSubtle,r["--sekyro-color-line-strong"]=l.lineStrong,r["--sekyro-color-sunken"]=l.sunken),i.fgMuted===o.fgMuted&&i.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=l.fgSubtle),e.fontFamily===K.font&&(r["--sekyro-font-display"]=K.fontDisplay);let u=t?Lt.dark:Lt.light;if(r["--sekyro-color-success-soft"]=u.successSoft,r["--sekyro-color-success-fg"]=u.successFg,r["--sekyro-color-on-success"]=u.onSuccess,r["--sekyro-color-warning-soft"]=u.warningSoft,r["--sekyro-color-warning-fg"]=u.warningFg,r["--sekyro-color-danger-soft"]=u.dangerSoft,r["--sekyro-color-danger-fg"]=u.dangerFg,r["--sekyro-color-on-danger"]=u.onDanger,r["--sekyro-color-info-soft"]=u.infoSoft,r["--sekyro-color-info-fg"]=u.infoFg,i.brand===o.brand&&(r["--sekyro-color-line-brand"]=u.lineBrand),n!==null){let f=Fe[n];for(let g of["danger","success","warning","info"])r[`--sekyro-color-${g}-soft`]=f[g].soft,r[`--sekyro-color-${g}-fg`]=f[g].fg;r["--sekyro-color-on-success"]=f.success.on,r["--sekyro-color-on-danger"]=f.danger.on}return r}s(Xr,"flowRoles");function Ht(e){let{verification:t,locale:n,strings:o,onStep:l,onResult:i}=e,{step:r,error:a}=ft(t);Ft(()=>{r!==null&&l?.(r)},[r,l]),Ft(()=>i===void 0?void 0:t.on("result",i),[t,i]);let u=st(e.colorScheme??"light"),f=r?.context.branding,g=rt(f,e.theme,u),[m,h]=le(!1),d=`sekyro-verification${u?" sekyro-verification--dark":""}${m?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,x=Pe(e.onClose);x.current=e.onClose;let k=Pe(r);k.current=r;let L=ae(()=>{let S=k.current;x.current?.(S?.kind==="result"?{reason:"finished",result:S.result}:{reason:"cancelled"})},[]),[E,C]=le(null),D=ae(()=>{let S=k.current;S!==null&&S.kind!=="result"&&S.context.consentRecorded?C("close"):L()},[L]),U=Qr(()=>t.reportCaptureIssue===void 0?null:S=>t.reportCaptureIssue?.(S),[t]);return c(yo,{theme:g,className:d,children:c(Ae,{locale:n,...o!==void 0?{strings:o}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Xr(g,u,Dt(f,u,e.theme)),children:c(bo.Provider,{value:h,children:c(dt.Provider,{value:e.onClose!==void 0?L:void 0,children:c(Je.Provider,{value:e.onClose!==void 0?D:void 0,children:c(ro.Provider,{value:U,children:ee(io.Provider,{value:jr,children:[c(ns,{...e,step:r,error:a,immersive:m,onLeaveAsk:()=>C("history"),onClosed:L}),c(os,{open:E!==null,onStay:()=>{E==="history"&&Bt(),C(null)},onLeave:()=>{let S=E;C(null),S==="close"||e.onClose!==void 0?L():typeof window<"u"&&pn()}})]})})})})})})})})}s(Ht,"SekyroVerification");var jr={self:c(F,{name:"face"}),assisted:c(F,{name:"camera"})};function es(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,o=n[`session.processing.${t}.title`],l=n[`session.processing.${t}.description`];return typeof o=="string"&&o!==""&&typeof l=="string"&&l!==""?{title:o,description:l}:null}s(es,"processingCopyOf");function ts({error:e,retry:t}){let{t:n}=I(),o=he();return ee(ct,{tone:"danger",testId:"sekyro-error-notice",children:[c("span",{children:n(jt(e.kind))}),e.retryable?c(w,{ref:o,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}s(ts,"CameraErrorNotice");var un="sekyroFlow";function dn(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[un]===!0}s(dn,"onGuard");function Bt(){if(typeof window>"u"||dn())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[un]:!0},"")}s(Bt,"pushGuard");function pn(){window.history.back()}s(pn,"leaveHistory");function os({open:e,onStay:t,onLeave:n}){let{t:o}=I();return c(nt,{open:e,role:"alertdialog",title:o("leave.title"),onClose:t,testId:"sekyro-leave",actions:ee(Vt,{children:[c(w,{full:!0,onClick:t,children:o("leave.stay")}),c(w,{full:!0,kind:"danger",onClick:n,children:o("leave.confirm")})]}),children:c("p",{className:"sekyro-text-muted",children:o("leave.body")})})}s(os,"LeaveDialog");function ns(e){let{step:t,error:n,slots:o,immersive:l}=e,i=I(),{t:r}=i,[a,u]=le(!1),[f,g]=le([]),m=ae(p=>(g(b=>[...b,p]),()=>g(b=>b.filter(J=>J!==p))),[]),[h,d]=le(null),x=ae(p=>d(()=>p),[]),[k,L]=le(0),[E,C]=le(null),D=t?.context.purpose??"identity",U=t?.context.returning===!0,S=e.verification,P=D==="human"||t?.context.cameraUnavailableHandled===!0,_=S.reportCameraUnavailable!==void 0&&P?p=>S.reportCameraUnavailable?.(p)??Promise.resolve():void 0,M=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,A=e.handoffUrl,ce=ae((p,b)=>_===void 0?void 0:c(B,{view:"NoCameraView",i18n:i,quiet:!0,cause:b,onRetry:p,...M?{onContinue:_}:{},...A!==void 0?{handoffUrl:A}:{}}),[i,S,P,M,A]),xe=ae((p,b)=>c(_o,{start:p,context:b,human:D==="human",returning:U,extra:b.canChooseFacing&&c(co,{value:b.facing,onChange:b.setFacing}),notice:b.permissionSettled&&b.permission==="denied"?ce(p,"denied"):void 0}),[D,U,ce]),ue=ae((p,b)=>{let J=qr(p.kind);return(J!==void 0?ce(b,J):void 0)??ee(Vt,{children:[c(ts,{error:p,retry:b}),J!==void 0&&A!==void 0?c(B,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:A}):null]})},[ce,A,i]),Ee=Pe(""),He=e.livenessProps?.slots?.stageOverlay,de=ae(p=>(p.guidance!==""&&!p.coached&&(Ee.current=p.guidance),c(xo,{testId:"sekyro-capture-stage",video:c("video",{ref:p.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:p.settled?r("capture.checkingTitle"):p.guidance!==""?p.guidance:Ee.current,note:p.note,busy:p.settled,progress:p.phase==="seeking"||p.phase==="aligning"?p.progress:1,still:p.still,live:p.live,closeLabel:r("native.close"),overlay:He?.(p.videoRef),ramp:p.ramp?.colour??null,...p.settled?{}:{onClose:s(()=>L(b=>b+1),"onClose")},end:p.switchCamera&&c("button",{type:"button",className:"sekyro-glass",onClick:p.switchCamera,"aria-label":r("capture.switchCamera"),children:c(no,{})})})),[r,He]),pe=Jr(),$e=t,Ie=t!==null&&E===t.key&&t.context.switchable!==void 0,me=h??(t===null||t.kind==="result"?null:Ie?()=>C(null):t.context.switchable!==void 0&&typeof $e?.chooseOption=="function"?()=>C(t.key):null),Ue=Pe(me);Ue.current=me;let X=Pe(t);X.current=t;let fe=Pe({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});fe.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Te=e.backNavigation==="history";if(Ft(()=>{if(!Te||typeof window>"u")return;Bt();let p=s(()=>{if(dn())return;let b=X.current,J=Ue.current;J!==null?(J(),Bt()):b?.kind!=="result"&&b?.context.consentRecorded===!0?fe.current.ask():fe.current.hostClose?fe.current.closed():pn()},"onPop");return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[Te]),n!==null)return c(ct,{tone:"danger",children:c("span",{children:r(ke(n,i.strings))})});if(t===null)return ee("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[c("span",{className:"sekyro-visually-hidden",children:r("common.loading")}),c("span",{className:"sekyro-skeleton__bar is-title"}),c("span",{className:"sekyro-skeleton__bar"}),c("span",{className:"sekyro-skeleton__bar is-short"}),c("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:W}=t,Z=s(p=>{u(!0),p().finally(()=>u(!1))},"refresh"),ye=o?.header??c(is,{context:W,headerId:pe,end:o?.headerEnd,...me!==null?{onBack:me}:{}}),T,z=Ie;if(z)T=c(B,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>C(null)});else switch(t.kind){case"phone_otp":T=c(kt,{step:t});break;case"email_otp":T=c(bt,{step:t});break;case"method":T=c(Nt,{step:t});break;case"registry":T=c(tt,{step:t});break;case"document":T=c(Et,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let p=e.livenessProps?.slots?.intro,b={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:p??xe,...p===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:ue}:{}},...k>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:i.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};T=c(so.Provider,{value:de,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(B,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:b,sekyroIntro:p===void 0},k):c(po,{...b},k)});break}case"portrait":T=ee(Vt,{children:[t.retakeOnly?c(B,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,c(Tt,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":T=c(B,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":T=c(B,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":T=c(B,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":T=e.handoffUrl!==void 0?c(B,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh}):c(Xe,{tone:"brand",icon:"smartphone",title:r("handoff.title"),actions:c(w,{kind:"secondary",full:!0,disabled:a,onClick:()=>Z(t.refresh),children:r("common.refresh")}),children:c("p",{children:r("reasons.mobile_required")})});break;case"processing":{let p=es(i.strings,t.service);T=c(Xe,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:p?.title??r("session.processing.title"),actions:t.stalled?c(w,{kind:"secondary",full:!0,disabled:a,onClick:()=>Z(t.refresh),children:r("common.refresh")}):null,children:c("p",{children:p?.description??r("session.processing.description")})});break}case"eid":T=c(vt,{step:t});break;case"unsupported":{let p=t.reason==="platform_unsupported";T=c(Xe,{tone:"neutral",icon:"smartphone",title:r(p?"needsApp.title":"unsupported.title"),actions:c(rs,{org:W.orgName}),children:c("p",{children:p?W.orgName!==""?r("needsApp.description",{org:W.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:W.orgName})})});break}case"result":T=o?.result?.(t)??c(ss,{step:t});break;default:{let p=t;T=null}}let Y=!l&&!W.consentRecorded&&t.kind!=="result"?c(nn,{i18n:i,purpose:W.purpose}):null;return c(So.Provider,{value:x,children:ee(ko.Provider,{value:Y===null?null:{node:Y,owner:f[0]??null,claim:m},children:[l?null:ye,!l&&t.kind!=="result"&&W.sections.length>1?c(as,{context:W,current:t.section,i18n:i}):null,c(vo,{pageKey:t.key,children:T}),!l&&!z&&t.kind!=="result"&&t.context.switchable!==void 0?c(B,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>C(t.key),quiet:!0},t.key):null,f.length===0?Y:null,l?null:o?.footer!==void 0?o.footer:W.branding?.hideAttribution===!0?null:ee("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[c(F,{name:"lock"}),r("shell.verifiedBy")]})]})})}s(ns,"Body");function rs({org:e}){let{t}=I(),n=Zr(dt);return n===void 0?null:c(w,{full:!0,onClick:n,children:e!==""?t("native.result.back",{org:e}):t("native.close")})}s(rs,"BackToOrg");function ss({step:e}){return c(Je.Consumer,{children:t=>c(At,{step:e,...t!==void 0?{onClose:t}:{}})})}s(ss,"ResultPage");function is({context:e,headerId:t,end:n,onBack:o}){let{t:l}=I(),[i,r]=le(!1),a=i?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:l(e.returning?"returning.heading":"session.title");return c("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:ee("div",{className:"sekyro-org",children:[o!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":l("common.back"),onClick:o,"data-testid":"sekyro-back",children:c(F,{name:"back"})}):null,c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:a!==void 0?c("img",{className:"sekyro-org__logo",src:a,alt:"",onError:()=>r(!0)}):rn(e.orgName)}),ee("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:u}),c("p",{className:"sekyro-org__sub",children:l(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(Je.Consumer,{children:f=>f!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":l("native.close"),onClick:f,children:c(F,{name:"close"})}):null})]})})}s(is,"OrgHeader");function as({context:e,current:t,i18n:n}){let o=t===null?-1:e.sections.indexOf(t),l=e.progress,i=l!==void 0&&l.length===e.sections.length?l:e.sections.map((r,a)=>({id:r,state:a<o?"done":a===o?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:i.map(({id:r,state:a})=>c("li",{className:`sekyro-progress__bar${a==="done"?" is-done":a==="current"?" is-current":""}`,...a==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${r}`]??r})},r))})}s(as,"SectionProgress");import{useEffect as ls,useState as fn}from"react";import{jsx as _e}from"react/jsx-runtime";function cs(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(cs,"pageUrl");function us({hostedUrl:e,inAppBrowser:t,...n}){let[o,l]=fn(t===!0);ls(()=>{t===void 0&&pt()&&l(!0)},[t]);let[i,r]=fn(!1),a=st(n.colorScheme??"light"),u=n.handoffUrl??e??cs();return o&&!i?_e(mo,{theme:qe(rt(void 0,void 0,a),n.theme),className:`sekyro-verification${a?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:_e(Ae,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:_e("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:_e(ds,{url:u,onContinue:()=>r(!0)})})})}):_e(Ht,{...n,...u!==""?{handoffUrl:u}:{}})}s(us,"SekyroFlow");function ds({url:e,onContinue:t}){let n=I();return _e(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}s(ds,"Prompt");export{Et as DocumentCapture,vt as EidStep,bt as EmailOtpStep,tt as IdNumberEntry,Nt as MethodChoice,cr as NniEntry,kt as PhoneOtpStep,Tt as PortraitCapture,us as SekyroFlow,Ht as SekyroVerification,Ae as StepI18nProvider,At as VerificationResultScreen,bn as arSteps,vn as enSteps,Nn as formatTemplate,Cn as frSteps,pt as isInAppBrowser,kn as loadSekyroLocale,wn as resolveSekyroStrings,Sn as retakeHintStringKey,I as useStepI18n,ft as useVerificationStep};
|
|
2
|
+
import{a as Rn}from"../chunk-PESMIB3E.js";import{a as Ce,b as B,c as Tn}from"../chunk-MX5SNIDY.js";import{a as U,d as fn,e as gt,f as Je,g as mn,h as yn}from"../chunk-OFPS67YV.js";import{a as gn,b as hn,c as wn}from"../chunk-GUTF3SPK.js";import{a as Pn,b as _n,c as xn,d as En,e as In,f as kt}from"../chunk-64KUMWHB.js";import{a as tt}from"../chunk-7Z4LVT2A.js";import{d as cn,f as un,g as dn,j as pn}from"../chunk-MM5EYC7B.js";import{b as an}from"../chunk-YZ5ZR6UR.js";import{a as ln}from"../chunk-7MMT5M4E.js";import{a as ge}from"../chunk-VRDPGOXM.js";import{a as Po,b as _o,c as xo,d as Eo,e as Io,f as Ve,g as T}from"../chunk-E7PG3JL4.js";import{a as K,b as te,c as kn,d as ne,e as Sn,f as Qe,g as Xe,h as ht,i as bn,k as je,l as vn,m as Cn,o as Nn,p as O,q as et}from"../chunk-TWZZGFO5.js";import"../chunk-TLMGY7AK.js";import{a as w,c as mt,j as No,l as wo,n as on,o as rn,p as sn,r as yt,s as ve}from"../chunk-ONYT4GJ4.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as To,useState as Ln}from"react";function St(e){let[t,n]=Ln(()=>e?.currentStep?.()??null),[o,a]=Ln(null);return To(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",l=>{i&&n(l)});return e.run().then(l=>{i&&n(c=>c??l)},l=>{i&&a(l)}),()=>{i=!1,r()}},[e]),{step:t,error:o}}s(St,"useVerificationStep");import{useEffect as Ct,useId as Mo,useMemo as Oo,useRef as Nt,useState as oe}from"react";var Ro="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",Mn;function On(e){return Mn??(Mn=new Map(Ro.split(" ").map(t=>{let[n,o]=t.slice(2).split("/");return[t.slice(0,2),[n,o]]}))),Mn.get(e.toUpperCase())}s(On,"entryOf");function An(e){return On(e)?.[0]}s(An,"dialCodeOf");function Dn(e){return On(e)?.[1]}s(Dn,"nationalPrefixOf");import{normalizeNni as Lo}from"@sekyro/web";function nt(e){let t=Lo(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${t}`:t.startsWith("00")?`+${t.slice(2)}`:t}s(nt,"digitsOf");var bt=s((e,t)=>(t.trunk!==void 0&&e.startsWith(t.trunk)?e.slice(t.trunk.length):e).slice(0,Math.max(...t.lengths)),"fitDigits");function ot(e,t){let n="",o=0;for(let a of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])o<e.length&&(n+=(o>0?" ":"")+e.slice(o,o+a)),o+=a;return n+e.slice(o)}s(ot,"groupDigits");function Bn(e,t){let n=0;for(let o=t;o>0&&n<e.length;n+=1)e[n]!==" "&&(o-=1);return n}s(Bn,"caretAfter");var vt=s((e,t)=>t.find(n=>e.startsWith(n.dial)),"countryOfNumber"),Fn=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as Gn,jsx as k,jsxs as H}from"react/jsx-runtime";var Vn=s((e,t,n)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.min(n,Math.max(0,Math.ceil(o/1e3))):0},"secondsUntil"),Ao=600,Do=30,Bo=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Fo=["whatsapp","sms"],Hn=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_resend_limit","otp_number_invalid","otp_number_not_mobile"]);function $n(e){let t=nt(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s($n,"normalizedPhone");var Vo=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function Ho(e){let t=[];for(let n of e.phoneCountries??["MR"]){let o=e.phoneRules?.find(i=>i.code===n),a=o?.dial??An(n);a!==void 0&&!t.some(i=>i.code===n)&&t.push({code:n,dial:`+${a}`,...o!==void 0?{rule:o}:{}})}return t}s(Ho,"phoneCountriesOf");function $o(e,t){if(t===null||!e.startsWith(t.dial))return $n(e);let n=e.slice(t.dial.length).replace(/\D/g,""),o=Dn(t.code);return o!==void 0&&n.startsWith(o)&&(n=n.slice(o.length)),$n(t.dial+n)}s($o,"e164Of");var Un=s((e,t)=>(vt(e,t)??t[0])?.code??null,"countryFor");function Uo(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return n=>`${t?.of(n.code)??n.code} (${n.dial})`}s(Uo,"countryLabels");var Kn="other";function wt({step:e,locale:t,strings:n,className:o,defaultPhone:a,onError:i}){let r=T(t,n),{t:l}=r,c=Oo(()=>Ho(e),[e.phoneCountries,e.phoneRules]),p=a??c[0]?.dial??"",[m,g]=oe(()=>Un(p,c)),b=c.map(y=>y.code).join(",");Ct(()=>{if(m===null||!c.some(y=>y.code===m)){let y=Un(p,c);g(y);let N=h.current,J=c.find(j=>j.code===y)?.dial;J!==void 0&&E(j=>N!==null&&j.startsWith(N.dial)?J+j.slice(N.dial.length):j.startsWith("+")?j:J)}},[b,p]);let d=c.find(y=>y.code===m)??null,h=Nt(d);d!==null&&(h.current=d);let[v,E]=oe(p),[I,_]=oe(!1),[R,D]=oe(!1),[x,C]=oe(""),[S,A]=oe(!1),[$,ie]=oe(null),[de,he]=oe(null),[Ie,pe]=oe(!1),[Te,Ge]=oe(null),fe=Nt(null),me=e.phase==="verify"&&!Ie,We=e.phase==="verify",Re=wn(We),[ke,ze]=gn(e.reason==="otp_mismatch",e.attemptsRemaining,()=>C("")),ee=Mo(),ye=Nt(null);Ct(()=>{let y=setTimeout(()=>ye.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(y)},[me]);let Le=e.phase==="verify"?e.codeExpiresAt??"sent":null;Ct(()=>{Le!==null&&(pe(!1),fe.current!==null&&!Hn.has(e.reason??"")&&Ge(fe.current),fe.current=null)},[Le]);let z=s(async y=>{A(!0),he(null);try{await y()}catch(N){he(ge(N,r.strings)),i?.(N)}finally{A(!1),ie(null)}},"run"),q=Fo.filter(y=>(e.channels??[]).includes(y)),Se=e.phoneInternational===!0,L=I||d===null,Y=L||v.startsWith("+")&&!v.startsWith(d.dial),X=Y?void 0:d.rule,Me=Y?v:v.replace(d.dial,"").replace(/\D/g,""),Z=X?bt(Me,X):Me,f=Y&&!L&&!Se&&e.phoneRules?.length&&!c.some(y=>y.dial.startsWith(v)),P=f?null:X?X.lengths.includes(Z.length)?d.dial+Z:null:L&&!v.startsWith("+")?null:$o(v,I?null:d),G=!e.needsPhone||P!==null,Ye=s((y,N=!1)=>{let J=e.needsPhone?N?Te:{number:P??v,shown:Y||d===null?P??v:`${d.dial} ${ot(Z,X)}`}:null;fe.current=J,ie(y??null),z(async()=>{try{await e.send({...J!==null?{phone:J.number}:{},...y!==void 0?{channel:y}:{}})}catch(j){throw fe.current=null,j}})},"send"),Gt=s(y=>{z(()=>e.verify(y))},"submitCode"),Wt=s(y=>{y.preventDefault(),me?Gt(x):q.length<=1&&G&&Ye(q[0])},"onSubmit"),So=s(y=>{let N=y.target,J=y.nativeEvent.inputType,j=Math.max(0,N.value.lastIndexOf("+")),be=nt(N.value.slice(j)),De=vt(be,c),Be=nt(N.value.slice(j,N.selectionStart)).length,pt=be,en=be;if(D(!1),!De&&(L||be.startsWith("+")))Se&&_(!0);else{let Fe=De??d,ae=De?be.slice(De.dial.length):be;if(g(Fe.code),_(!1),ae===Z&&J?.startsWith("delete")&&(J.endsWith("Forward")||(Be-=1),ae=ae.slice(0,Be)+ae.slice(Be+1)),Fe.rule){let ft=bt(ae,Fe.rule),nn=ae.length-ft.length;Be-=nn,ae=nn>0&&!De&&Z.length===ft.length?Z:ft}en=Fe.dial+ae,pt=ot(ae,Fe.rule)}E(en),N.value=pt;let tn=Bn(pt,Be);N.setSelectionRange(tn,tn)},"onNumber"),Ze=f?l("otp.reason_otp_destination_not_allowed"):R&&X?l("otp.phoneLengthError",{digits:Fn(X,l("otp.or"))}):"",zt=c.length>1||Se,le=`${ee}-phone`,dt=Vn(e.codeExpiresAt,Re,Ao),Oe=Vn(e.resendAvailableAt,Re,Do),qe=me&&e.codeExpiresAt!==void 0&&dt===0,Yt=e.needsPhone&&!e.attemptsExhausted,Zt=We&&(e.codeExpiresAt===void 0||dt>0),qt=me&&Yt?()=>pe(!0):Ie&&Zt?()=>pe(!1):null;Qe(qt===null?null:S?()=>{}:qt);let Ae=s(y=>l(y==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Jt=s(y=>S&&$!==null&&$===y,"busyFor"),[bo,vo]=l("otp.sentTo",{channel:Ae(e.channel)}).split("{number}"),Qt=e.context.simulation?.otpCode,Co=e.reason==="otp_mismatch"?H(O,{tone:"danger",children:[k("span",{children:l("otp.reason_otp_mismatch")}),k("span",{children:et(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Hn.has(e.reason)?k(O,{tone:"warning",children:k("span",{children:l(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?k(O,{tone:"warning",children:k("span",{children:l("reasons.tester_phone_mismatch")})}):null,Xt=H(Gn,{children:[Co,de!==null?k(O,{tone:"danger",children:k("span",{children:l(de)})}):null]});if(me){let y=q.length===0;return H("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":ee,onSubmit:Wt,noValidate:!0,children:[k(te,{id:ee,title:l("otp.verifyTitle"),lead:Qt!==void 0?k(Cn,{template:l("sandbox.otpHint"),code:Qt}):H(Gn,{children:[bo,k("bdi",{dir:"ltr",className:"sekyro-mono",children:Te?.shown??e.sentToMasked}),vo]})}),Xt,H("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:`${ee}-code`,children:l("otp.codeLabel")}),k(hn,{id:`${ee}-code`,value:x,invalid:ke,onChange:N=>{N!==""&&ze(),C(N),N.length===6&&x.length!==6&&!S&&!e.attemptsExhausted&&Gt(N)}}),k("span",{className:`sekyro-help sekyro-otp-expiry${qe?" is-danger":""}`,"aria-hidden":!qe||void 0,children:qe?l("otp.expired"):l("otp.expiresIn",{time:Bo(dt)})})]}),k("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:qe?l("otp.expired"):""}),H(ne,{children:[k(w,{type:"submit",full:!0,disabled:S||x.length!==6||e.attemptsExhausted,"aria-busy":S||void 0,children:l("otp.verify")}),H("div",{className:"sekyro-resend-row",children:[y?k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:S||Oe>0,onClick:()=>Ye(void 0,!0),children:Oe>0?l("otp.resendIn",{seconds:Oe}):l("otp.resend")}):Oe>0?k("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:Oe})}):q.map(N=>k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:S,onClick:()=>Ye(N,!0),children:l("otp.resendBy",{channel:Ae(N)})},N)),Yt?k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:S,onClick:()=>pe(!0),"data-testid":"sekyro-otp-change",children:l("otp.changeNumber")}):null]})]})]})}let jt=Uo(r.locale);return H("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":ee,onSubmit:Wt,noValidate:!0,children:[k(te,{id:ee,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Xt,e.needsPhone?H("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:le,children:l("otp.phoneLabel")}),H("div",{className:"sekyro-phone",dir:"ltr",children:[d===null||Y&&!I?null:H("div",{className:"sekyro-phone__lead",children:[zt?H("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${l("otp.countryLabel")}: ${I?l("otp.otherCountry"):jt(d)}`,value:I?Kn:d.code,onChange:y=>{D(!1);let N=c.find(J=>J.code===y.target.value);_(N===void 0),N!==void 0&&g(N.code),E(N===void 0?"":N.dial+(Y?"":Z))},children:[c.map(y=>k("option",{value:y.code,children:jt(y)},y.code)),Se?k("option",{value:Kn,children:l("otp.otherCountry")}):null]}):null,H("span",{className:"sekyro-phone__dial",id:`${le}-dial`,"aria-hidden":zt||void 0,children:[k("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:I?"🌐":Vo(d.code)}),I?null:d.dial]})]}),k("input",{ref:ye,id:le,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel","aria-describedby":`${Y?"":`${le}-dial ${le}-hint `}${Ze?`${le}-error`:""}`.trim()||void 0,"aria-invalid":!!Ze||void 0,placeholder:L?"+":void 0,value:Y?v:ot(Z,X),onChange:So,onKeyDown:y=>{y.key==="Enter"&&!G&&D(!0)},onBlur:y=>{y.relatedTarget?.tagName!=="SELECT"&&D(Z!==""&&P===null)}})]}),Y?null:k("span",{className:"sekyro-help",id:`${le}-hint`,children:l("otp.phonePlaceholderGeneric")}),Ze?k("span",{className:"sekyro-help is-danger",id:`${le}-error`,role:"alert",children:Ze}):null]}):k("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),H(ne,{children:[q.length===1?k(w,{type:"submit",full:!0,disabled:S||!G,"aria-busy":Jt(q[0])||void 0,children:l("otp.sendBy",{channel:Ae(q[0])})}):q.length>1?H("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[k("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),k("div",{className:"sekyro-channel-row",children:q.map(y=>H(w,{kind:"primary",disabled:S||!G,"aria-busy":Jt(y)||void 0,onClick:()=>Ye(y),children:[k(K,{name:y}),Ae(y)]},y))})]}):k(w,{type:"submit",full:!0,disabled:S||!G,"aria-busy":S||void 0,children:l("otp.send")}),k("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:S&&$!==null?l("otp.sending",{channel:Ae($)}):""}),Ie&&Zt?k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:S,onClick:()=>pe(!1),"data-testid":"sekyro-otp-back-to-code",children:l("otp.backToCode")}):null]})]})}s(wt,"PhoneOtpStep");import{lazy as Ko,Suspense as Go,useMemo as Wo,useState as zo}from"react";import{jsx as Ne,jsxs as Zo}from"react/jsx-runtime";var Yo={load:s(()=>import("../email-otp-view-GW2VEEPW.js"),"load")};function Pt({locale:e,strings:t,...n}){let o=T(e,t),[a,i]=zo(0),r=Wo(()=>Ko(()=>Yo.load().then(c=>({default:c.EmailOtpView}))),[a]),l=Zo(O,{tone:"danger",children:[Ne("span",{children:o.t("errors.network_error")}),Ne(w,{kind:"secondary",onClick:()=>i(c=>c+1),children:o.t("common.retry")})]});return Ne(Ce,{fallback:l,children:Ne(Go,{fallback:Ne("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:Ne(r,{...n,i18n:o})})},a)}s(Pt,"EmailOtpStep");import{lazy as qo,Suspense as Jo,useMemo as Qo,useState as Xo}from"react";import{jsx as we,jsxs as er}from"react/jsx-runtime";var jo={load:s(()=>import("../eid-view-DZBYRACA.js"),"load")};function _t({locale:e,strings:t,...n}){let o=T(e,t),[a,i]=Xo(0),r=Qo(()=>qo(()=>jo.load().then(c=>({default:c.EidView}))),[a]),l=er(O,{tone:"danger",children:[we("span",{children:o.t("errors.network_error")}),we(w,{kind:"secondary",onClick:()=>i(c=>c+1),children:o.t("common.retry")})]});return we(Ce,{fallback:l,children:we(Jo,{fallback:we("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:we(r,{...n,i18n:o})})},a)}s(_t,"EidStep");import{useMemo as tr}from"react";import{jsx as xt,jsxs as nr}from"react/jsx-runtime";function Et({step:e,locale:t,strings:n,className:o,onError:a}){let i=T(t,n),{busy:r,error:l,run:c}=xn(i,a),p=tr(()=>e.choice.options.flatMap(g=>{let b=_n(g,i),d=Pn[g.service];return b===null?[]:[{id:g.id,label:b,glyph:d&&xt(K,{name:d})}]}),[e.choice.options,i]),m=e.choice.options.find(g=>g.service==="national_eid");return nr("div",{className:o,children:[xt(un,{title:i.t("method.heading"),description:i.t("method.description"),options:p,busy:r,error:l,focus:!0,testId:"sekyro-method",onChoose:g=>c(()=>e.choose(g))}),m?.nationalEid?.afterPass==="continue"?xt(B,{view:"EidContinueHint",i18n:i,provider:m.nationalEid.providerName,quiet:!0}):null]})}s(Et,"MethodChoice");import{isValidNni as or,normalizeNni as Wn}from"@sekyro/web";import{useId as rr,useState as It}from"react";import{Fragment as lr,jsx as F,jsxs as Pe}from"react/jsx-runtime";var sr=new Set(["nni_not_found","registry_record_not_found"]),ir=new Set(["nni_invalid","id_number_invalid"]);function rt({step:e,locale:t,strings:n,className:o,onError:a}){let i=T(t,n),{t:r}=i,[l,c]=It(""),[p,m]=It(!1),[g,b]=It(null),d=rr(),h=e.attemptsExhausted,v=s(async A=>{m(!0),b(null);try{await A()}catch($){b(ge($,i.strings)),a?.($)}finally{m(!1)}},"run"),E=s(A=>{if(A.preventDefault(),e.source!=="typed"){v(()=>e.confirm());return}let $=Wn(l);if(!/^\d{10}$/.test($))return b("population.invalid");if(!or($))return b("population.reason_id_number_invalid");v(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber($):e.submitNni($))},"onSubmit"),I=et(i,e.attemptsRemaining,h),_=e.reason!==void 0&&sr.has(e.reason),R=e.reason!==void 0&&ir.has(e.reason),D=Pe(lr,{children:[e.reason==="registry_unavailable"?Pe(O,{tone:"warning",children:[F("span",{children:r("population.reason_registry_unavailable")}),F("span",{children:I})]}):null,_&&e.canUseDocument?Pe(O,{tone:"warning",children:[F("span",{children:r("population.reason_registry_record_not_found_or_document")}),F("span",{children:I}),F(w,{kind:"secondary",disabled:p,onClick:()=>{v(()=>e.useDocument())},children:r("population.useDocument")})]}):null,_&&!e.canUseDocument||R?Pe(O,{tone:"danger",children:[F("span",{children:r(_?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),F("span",{children:I})]}):null,h&&e.reason===void 0?F(O,{tone:"danger",children:F("span",{children:I})}):null,g!==null?F(O,{tone:"danger",children:F("span",{children:r(g)})}):null]}),[x,C,S]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return Pe("form",{className:`sekyro-step${o?` ${o}`:""}`,"aria-labelledby":d,onSubmit:E,noValidate:!0,children:[F(te,{id:d,title:r(x),lead:r(C)}),D,e.source==="typed"?Pe("div",{className:"sekyro-field",children:[F("label",{className:"sekyro-label",htmlFor:`${d}-id-number`,children:r("population.label")}),F("input",{id:`${d}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:l,"aria-describedby":`${d}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:A=>{b(null),c(Wn(A.target.value).replace(/\D/g,"").slice(0,10))}}),F("span",{id:`${d}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,F(ne,{children:h?null:F(w,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:r(S)})})]})}s(rt,"IdNumberEntry");function ar(e){return rt(e)}s(ar,"NniEntry");import{acceptedIssuers as mr,acceptedTypesFor as Jn,warmDocumentCapture as yr}from"@sekyro/web";import{lazy as gr,Suspense as hr,useEffect as kr,useMemo as Sr,useState as Lt}from"react";import{acceptedIssuers as cr,acceptedTypesFor as Tt}from"@sekyro/web";import{useEffect as zn,useId as ur,useMemo as Yn,useState as Rt}from"react";import{jsx as V,jsxs as _e}from"react/jsx-runtime";var Zn=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),dr=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),pr=220;function fr(e,t,n=[],o){let a=null;try{a=new Intl.DisplayNames([e],{type:"region"})}catch{}let i=t.map(c=>({code:c,name:a?.of(c)??c})),r=new Intl.Collator(e),l=s(c=>{if(c===o)return-1;let p=n.indexOf(c);return p<0?n.length:p},"rank");return i.sort((c,p)=>l(c.code)-l(p.code)||r.compare(c.name,p.name))}s(fr,"countryNames");function qn({step:e,i18n:t,issuer:n,onPicked:o,ageStepUp:a=!1}){let{t:i,locale:r}=t,l=Yn(()=>cr(e.documents),[e.documents]),c=Yn(()=>fr(r,l,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[r,l,e.documents,e.detectedCountry]),p=l.length===1?l[0]:null,[m,g]=Rt(n??p),[b,d]=Rt(""),[h,v]=Rt(null),E=ur(),I=p===null?[]:Tt(e.documents,p),_=p!==null&&I.length===1?I[0]:null;zn(()=>{p!==null&&_!==null&&e.selectDocument(p,_)},[p,_]);let R=s((C,S)=>{e.selectDocument(C,S),o?.()},"pick"),D=s(C=>{let S=Tt(e.documents,C);S.length===1?R(C,S[0]):g(C)},"chooseIssuer");if(zn(()=>{if(h===null||m===null)return;let C=setTimeout(()=>R(m,h),pr);return()=>clearTimeout(C)},[h]),Qe(m!==null&&l.length>1&&n===void 0?()=>{g(null),v(null)}:null),_!==null)return null;if(m===null){let C=Zn(b.trim()),S=C===""?c:c.filter(A=>Zn(A.name).includes(C)||A.code.toLowerCase()===C);return _e("section",{className:"sekyro-step",children:[V(te,{title:i("doc.countryTitle"),lead:i(a?"doc.ageStepUp":"doc.pickDescription")}),_e("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:E,children:i("doc.countryLabel")}),V("input",{id:E,type:"search",className:"sekyro-input",placeholder:i("doc.countrySearch"),value:b,onChange:A=>d(A.target.value)})]}),S.length===0?V("p",{className:"sekyro-text-muted",children:i("doc.noCountryMatch")}):V("ul",{className:"sekyro-rows",children:S.map(A=>V("li",{children:_e("button",{type:"button",className:"sekyro-row-btn",onClick:()=>D(A.code),children:[V("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:dr(A.code)}),A.name]})},A.code))}),V(ne,{children:null})]})}let x=Tt(e.documents,m);return _e("section",{className:"sekyro-step",children:[V(te,{title:i("doc.pickTitle"),lead:i(a&&p!==null?"doc.ageStepUp":"native.doc.holdIt")}),V("div",{className:"sekyro-choices",children:x.map(C=>_e("button",{type:"button",className:"sekyro-card","aria-pressed":h===C,disabled:h!==null&&h!==C,onClick:()=>v(C),children:[V("span",{className:"sekyro-card__tile",children:V(K,{name:C==="passport"?"passport":"card"})}),_e("span",{className:"sekyro-card__body",children:[V("span",{className:"sekyro-card__title",children:i(`doc.type.${C}`)}),V("span",{className:"sekyro-card__sub",children:i(`doc.sub.${C}`)})]}),V("span",{className:"sekyro-radio","aria-hidden":"true"})]},C))}),l.length>1?V("button",{type:"button",className:"sekyro-link",onClick:()=>{g(null),v(null)},children:i("native.doc.changeCountry")}):null,V(ne,{children:null})]})}s(qn,"DocumentPicker");import{jsx as ce,jsxs as vr}from"react/jsx-runtime";var br={load:s(()=>import("../document-capture-view-DMRIMB3Z.js"),"load")};function Mt({step:e,locale:t,strings:n,className:o,liveMrz:a}){let i=T(t,n),[r,l]=Lt(0),[c,p]=Lt(null),m=mr(e.documents),g=m.length>1,b=e.issuer!==null&&Jn(e.documents,e.issuer).length>1,d=e.documentType===null||e.issuer===null||c!==null,h=m.length===1&&Jn(e.documents,m[0]).length===1,[v]=Lt(()=>d&&!h),E=e.ageStepUp===!0,I=Sr(()=>gr(()=>br.load().then(R=>({default:R.DocumentCaptureView}))),[r]);kr(()=>{yr()},[]);let _=vr(O,{tone:"danger",children:[ce("span",{children:i.t("errors.network_error")}),ce(w,{kind:"secondary",onClick:()=>l(R=>R+1),children:i.t("doc.retryCamera")})]});return ce("div",{className:o,children:d?ce(qn,{step:e,i18n:i,ageStepUp:E&&c===null&&v,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>p(null)}):ce(Ce,{fallback:_,children:ce(hr,{fallback:ce("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:ce(I,{step:e,i18n:i,ageLead:E&&!v,liveMrz:a,...g?{onChangeCountry:s(()=>p("country"),"onChangeCountry")}:{},...b?{onChangeDocument:s(()=>p("document"),"onChangeDocument")}:{}})})},r)})}s(Mt,"DocumentCapture");import{warmPortraitCapture as Cr}from"@sekyro/web";import{Component as Nr,lazy as Qn,Suspense as Xn,useContext as wr,useEffect as Pr,useMemo as jn,useState as eo}from"react";import{jsx as M,jsxs as it}from"react/jsx-runtime";var _r={load:s(()=>import("../portrait-capture-view-TL5ZZNZF.js"),"load")},xr={load:s(()=>import("../portrait-review-view-W7DDLF64.js"),"load")},At=class At extends Nr{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(At,"LoadBoundary");var st=At;function Er({step:e,i18n:t}){let{t:n}=t,o=ve();return it("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[M("h2",{ref:o,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?M("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?it(O,{tone:"danger",children:[M("span",{children:n("portrait.uploadFailed")}),M(w,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):M("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}s(Er,"MatchPhase");function Ot({step:e,locale:t,strings:n,className:o,assetBaseUrl:a,verification:i}){let r=T(t,n),l=dn(i),c=wr(je),[p,m]=eo(0),[g,b]=eo(null),d=jn(()=>Qn(()=>_r.load().then(S=>({default:S.PortraitCaptureView}))),[p]),h=jn(()=>Qn(()=>xr.load().then(S=>({default:S.PortraitScreens}))),[p]),v=typeof e.uploadPortrait=="function",E=v?e.photo?.source??"camera":"camera",I=v&&E!=="camera"&&e.photo?.uploadOffered===!0,_=E!=="upload",R=E==="upload"?"upload":E==="choice"?g??e.photo?.pick??"source":"camera",D=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if(Pr(()=>{e.phase==="capture"&&R==="camera"&&!D&&Cr()},[e.phase,R,D]),e.phase==="match")return M("div",{className:o,children:M(Er,{step:e,i18n:r})});let x=M("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")});if(c!==null&&(c.busy||c.failed!==null)&&e.phase==="capture"&&R==="camera")return it("section",{className:`sekyro-step${o?` ${o}`:""}`,children:[M(te,{title:r.t("session.steps.portrait.title")}),M(ne,{children:M(w,{kind:"secondary",full:!0,disabled:c.busy,onClick:c.reset,children:r.t("portrait.retryCamera")})})]});if(e.phase==="review"||R!=="camera"||D)return M("div",{className:o,children:M(st,{fallback:M(w,{kind:"ghost",onClick:()=>m(S=>S+1),children:r.t("common.retry")}),children:M(Xn,{fallback:x,children:M(h,{screen:e.phase==="review"?"review":D&&R==="camera"?"phone":R==="camera"?"review":R,step:e,i18n:r,..._?{onCamera:s(()=>b("camera"),"onCamera")}:{},onUpload:()=>b("upload"),onDeclined:()=>b(null)})})},p)});if(!l.settled)return M("div",{className:o,children:x});let C=it(O,{tone:"danger",children:[M("span",{children:r.t("errors.network_error")}),M(w,{kind:"secondary",onClick:()=>m(S=>S+1),children:r.t("portrait.retryCamera")})]});return M("div",{className:o,children:M(st,{fallback:C,children:M(Xn,{fallback:x,children:M(d,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{},...I?{onUpload:s(()=>b("upload"),"onUpload")}:{}})})},p)})}s(Ot,"PortraitCapture");import{cameraUnavailableCauseOf as Yr}from"@sekyro/web";import{useCallback as re,useContext as Zr,useEffect as ut,useId as qr,useMemo as Ut,useRef as ue,useState as se}from"react";var Dt={light:{lineBrand:"#0d3b66",successSoft:"#d5f0e8",successFg:"#005341",onSuccess:"#ffffff",warningSoft:"#fff7e6",warningFg:"#735003",onWarning:"#191a1b",dangerSoft:"#ffdada",dangerFg:"#ca0f07",onDanger:"#ffffff",info:"#0563d4",infoSoft:"#d3e5ff",infoFg:"#064da5",onInfo:"#ffffff"},dark:{lineBrand:"#3f80bf",successSoft:"#002c23",successFg:"#53ffd4",onSuccess:"#030303",warningSoft:"#463102",warningFg:"#ffd98a",onWarning:"#030303",dangerSoft:"#9c1008",dangerFg:"#ffbbbb",onDanger:"#030303",info:"#5da9ff",infoSoft:"#063778",infoFg:"#acd0ff",onInfo:"#030303"},sizes:{buttonHeight:"52px",controlRadius:"10px",cardRadius:"16px",fieldRadius:"10px",iconTile:"56px",iconTileRadius:"16px",headerTile:"40px",choiceTile:"40px",tileRadius:"10px",resultDisc:"64px",resultRing:"8px",progressHeight:"4px",focusRing:"2px",focusRingOffset:"2px",otpBox:"60px",choiceMinHeight:"76px",stepGap:"32px",headingGap:"12px"},motion:{page:"320ms",easeOut:"cubic-bezier(0.16, 1, 0.3, 1)"}};var He={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},Ir=["danger","success","warning","info"];function Bt(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(Bt,"channel");function to(e){let t=Bt(parseInt(e.slice(1,3),16)),n=Bt(parseInt(e.slice(3,5),16)),o=Bt(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*o}s(to,"luminance");function Tr(e,t){let n=to(e),o=to(t),a=Math.max(n,o),i=Math.min(n,o);return(a+.05)/(i+.05)}s(Tr,"contrastRatio");function no(e,t){return Math.min(...Ir.map(n=>Tr(He[e][n].fg,t)))}s(no,"worstAgainst");function oo(e,t,n){return Math.min(no(e,t),no(e,n))}s(oo,"worstStatusContrast");function ro(e,t){return oo("light",e,t)>=oo("dark",e,t)?"light":"dark"}s(ro,"statusSchemeFor");import{useRef as Mr,useState as Or}from"react";import{useEffect as Rr,useId as Lr,useRef as Ft}from"react";import{jsx as xe,jsxs as so}from"react/jsx-runtime";function at({open:e,title:t,closeLabel:n,onClose:o,children:a,actions:i,role:r,testId:l,returnFocus:c}){let p=Ft(null),m=Ft(null),g=Ft(!1),b=Lr();return Rr(()=>{let d=p.current;if(d!==null){if(e&&!d.open?(m.current=typeof document>"u"?null:document.activeElement,typeof d.showModal=="function"?d.showModal():d.setAttribute("open","")):!e&&d.open&&(typeof d.close=="function"?d.close():d.removeAttribute("open")),!e&&g.current){let h=c?.current??(m.current instanceof HTMLElement?m.current:null);m.current=null,h?.focus()}g.current=e}},[e,c]),xe("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":b,...r==="alertdialog"?{role:r}:{},"data-testid":l,onCancel:d=>{d.preventDefault(),o()},onClick:d=>{d.target===d.currentTarget&&o()},children:so("div",{className:"sekyro-dialog__panel",children:[so("div",{className:"sekyro-dialog__head",children:[xe("h2",{id:b,className:"sekyro-dialog__title",children:t}),n!==void 0?xe("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:o,children:xe(K,{name:"close"})}):null]}),a!==void 0?xe("div",{className:"sekyro-dialog__body",children:a}):null,i!==void 0?xe("div",{className:"sekyro-dialog__actions",children:i}):null]})})}s(at,"FlowDialog");import{jsx as $e,jsxs as io}from"react/jsx-runtime";var Ar=["intro","data","processing","sharing","retention"];function ao({i18n:e,purpose:t="identity"}){let{t:n}=e,[o,a]=Or(!1),i=Mr(null),[r,l=""]=n("consent.short").split("{terms}");return io("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[io("p",{className:"sekyro-consent__line",children:[r,$e("button",{ref:i,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),l]}),$e(at,{open:o,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:i,testId:"sekyro-consent-terms",children:$e("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?$e(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):Ar.map(c=>$e("p",{children:n(`consent.terms.${c}`)},c))})})]})}s(ao,"ConsentNotice");function lo(e){let t=e.trim().split(/\s+/).filter(o=>o!=="");return(t.length>=2?[t[0],t[1]].map(o=>Array.from(o??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(lo,"initials");import{useSyncExternalStore as Dr}from"react";var po=s(e=>({colors:{...e?U.dark:U.light},radius:U.radius,fontFamily:U.font}),"brandTheme"),ca=po(!1),co=/^#[0-9a-f]{6}$/i;function Vt(e,t,n){if(t)return null;let o=gt(e).colors,a=n?.colors?.bg??o?.bg,i=n?.colors?.surface??o?.surface;return a===void 0&&i===void 0||a!==void 0&&!co.test(a)||i!==void 0&&!co.test(i)?null:ro(a??U.light.bg,i??U.light.surface)}s(Vt,"partnerStatusScheme");function lt(e,t,n){let o=gt(e);if(n&&o.colors!==void 0){let{brand:a,brandFg:i}=o.colors;a!==void 0&&Hr(a,U.dark.bg)>=3?o.colors={brand:a,ring:a,...i!==void 0?{brandFg:i}:{}}:delete o.colors}if(Vt(e,n,t)==="dark"){let a=He.dark;o.colors={...o.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return Je(po(n),o,fn(t))}s(lt,"verificationTheme");function ct(e){let t=Dr(Vr,Fr,()=>!1);return e==="dark"||e==="system"&&t}s(ct,"useDarkScheme");var Br="(prefers-color-scheme: dark)",fo=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Br):null,"media"),Fr=s(()=>fo()?.matches??!1,"prefersDark");function Vr(e){let t=fo();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(Vr,"subscribe");function Hr(e,t){let[n,o]=[uo(e),uo(t)];return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}s(Hr,"contrast");function uo(e){let t=[1,3,5].map(n=>{let o=Number.parseInt(e.slice(n,n+2),16)/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(uo,"luminance");import{useEffect as $r,useId as Ur,useState as Kr}from"react";import{jsx as W,jsxs as Ue}from"react/jsx-runtime";var mo=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),Gr={review:{icon:"pending",tone:"info"},cooldown:{icon:"timer",tone:"info"},rejected:{icon:"close",tone:"neutral"},policy:{icon:"close",tone:"neutral"},inconclusive:{icon:"warning",tone:"neutral"},unavailable:{icon:"timer",tone:"neutral"},expired:{icon:"timer",tone:"neutral"}};function Wr({screen:e}){if(e==="verified")return Ue("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 80 80","aria-hidden":"true",focusable:"false",children:[W("circle",{className:"sekyro-outcome__ring",cx:"40",cy:"40",r:"40"}),W("circle",{className:"sekyro-outcome__disc",cx:"40",cy:"40",r:"32"}),W("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(22 22) scale(1.5)"})]});let{icon:t,tone:n}=Gr[e];return W("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:W(K,{name:t})})}s(Wr,"OutcomeMark");function zr({label:e,id:t,copied:n}){let[o,a]=Kr(!1);return $r(()=>{if(!o)return;let i=setTimeout(()=>a(!1),1600);return()=>clearTimeout(i)},[o]),Ue("button",{type:"button",className:`sekyro-reference${o?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[W("span",{"aria-live":"polite",children:o?n:e}),W("bdi",{dir:"ltr",children:t}),W(K,{name:"copy"})]})}s(zr,"ReferenceLine");function Ht({step:e,locale:t,strings:n,className:o,onClose:a}){let i=T(t,n),{t:r}=i,l=Ur(),c=ve(),p=e.context.orgName,m=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,b=s(h=>p!==""&&h!=="cooldown"?r(`native.result.${h}`,{org:p}):r(`session.result.${h}.description`),"partnerLine"),d;switch(e.display){case"rejected":d=mo.has(mt(m))?r("session.result.detailsMismatch",{org:p}):b("rejected");break;case"policy":{if(mo.has(mt(m)))d=r("session.result.detailsMismatch",{org:p});else if(m==="device_velocity_exceeded")d=r("session.result.deviceVelocity",{org:p});else if(m==="capture_tampered")d=r("session.result.deviceStop");else if(m==="camera_unavailable")d=r("reasons.camera_unavailable",{org:p});else if(m==="underage_estimated")d=r("reasons.underage_estimated");else if(m==="starter_credit_claimed")d=r("reasons.starter_credit_claimed");else if(m==="blocked_by_org")d=r("reasons.blocked_by_org");else{let h=m===""?null:rn(m);d=h!==null?r(h,{org:p}):b("policy")}break}case"cooldown":{let h=sn(i.locale,e.retryAfter);d=h!==null?r(h.key,{time:h.time}):r("session.result.cooldown.description");break}case"platform_unsupported":d=r("result.platform_unsupported");break;default:d=b(g)}return Ue("section",{className:`sekyro-result${o?` ${o}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[Ue("div",{className:"sekyro-result__body",children:[W(Wr,{screen:g}),Ue("div",{className:"sekyro-heading",children:[W("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${g}.title`)}),W("p",{className:"sekyro-text-muted",children:d})]}),W(zr,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),a!==void 0?W("div",{className:"sekyro-actions",children:W(w,{full:!0,onClick:a,children:p!==""?r("native.result.back",{org:p}):r("native.close")})}):null]})}s(Ht,"VerificationResultScreen");import{Fragment as Ke,jsx as u,jsxs as Q}from"react/jsx-runtime";function Jr(e,t,n){let o=t?U.dark:U.light,a=t?U.roles.dark:U.roles.light,i=e.colors??{},r={},l=i.fg===o.fg&&i.surface===o.surface;i.brand===o.brand&&i.surface===o.surface&&(r["--sekyro-color-brand-soft"]=a.brandSoft),l&&(r["--sekyro-color-line"]=a.line,r["--sekyro-color-line-subtle"]=a.lineSubtle,r["--sekyro-color-line-strong"]=a.lineStrong,r["--sekyro-color-sunken"]=a.sunken),i.fgMuted===o.fgMuted&&i.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===U.font&&(r["--sekyro-font-display"]=U.fontDisplay);let c=t?Dt.dark:Dt.light;if(r["--sekyro-color-success-soft"]=c.successSoft,r["--sekyro-color-success-fg"]=c.successFg,r["--sekyro-color-on-success"]=c.onSuccess,r["--sekyro-color-warning-soft"]=c.warningSoft,r["--sekyro-color-warning-fg"]=c.warningFg,r["--sekyro-color-danger-soft"]=c.dangerSoft,r["--sekyro-color-danger-fg"]=c.dangerFg,r["--sekyro-color-on-danger"]=c.onDanger,r["--sekyro-color-info-soft"]=c.infoSoft,r["--sekyro-color-info-fg"]=c.infoFg,i.brand===o.brand&&(r["--sekyro-color-line-brand"]=c.lineBrand),n!==null){let p=He[n];for(let m of["danger","success","warning","info"])r[`--sekyro-color-${m}-soft`]=p[m].soft,r[`--sekyro-color-${m}-fg`]=p[m].fg;r["--sekyro-color-on-success"]=p.success.on,r["--sekyro-color-on-danger"]=p.danger.on}return r}s(Jr,"flowRoles");function Kt(e){let{verification:t,locale:n,strings:o,onStep:a,onResult:i}=e,{step:r,error:l}=St(t);ut(()=>{r!==null&&a?.(r)},[r,a]),ut(()=>i===void 0?void 0:t.on("result",i),[t,i]);let c=ct(e.colorScheme??"light"),p=r?.context.branding,m=lt(p,e.theme,c),[g,b]=se(!1),d=`sekyro-verification${c?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,h=ue(e.onClose);h.current=e.onClose;let v=ue(r);v.current=r;let E=re(()=>{let x=v.current;h.current?.(x?.kind==="result"?{reason:"finished",result:x.result}:{reason:"cancelled"})},[]),[I,_]=se(null),R=re(()=>{let x=v.current;x!==null&&x.kind!=="result"&&x.context.consentRecorded?_("close"):E()},[E]),D=Ut(()=>t.reportCaptureIssue===void 0?null:x=>t.reportCaptureIssue?.(x),[t]);return u(yn,{theme:m,className:d,children:u(Ve,{locale:n,...o!==void 0?{strings:o}:{},children:u("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Jr(m,c,Vt(p,c,e.theme)),children:u(bn.Provider,{value:b,children:u(ht.Provider,{value:e.onClose!==void 0?E:void 0,children:u(Xe.Provider,{value:e.onClose!==void 0?R:void 0,children:Q(ln.Provider,{value:D,children:[u(ns,{...e,step:r,error:l,immersive:g,onLeaveAsk:()=>_("history"),onClosed:E}),u(jr,{open:I!==null,onStay:()=>{I==="history"&&$t(),_(null)},onLeave:()=>{let x=I;_(null),x==="close"||e.onClose!==void 0?E():typeof window<"u"&&ho()}})]})})})})})})})}s(Kt,"SekyroVerification");function Qr(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,o=n[`session.processing.${t}.title`],a=n[`session.processing.${t}.description`];return typeof o=="string"&&o!==""&&typeof a=="string"&&a!==""?{title:o,description:a}:null}s(Qr,"processingCopyOf");function Xr({error:e,retry:t}){let{t:n}=T(),o=ve();return Q(yt,{tone:"danger",testId:"sekyro-error-notice",children:[u("span",{children:n(on(e))}),e.retryable?u(w,{ref:o,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}s(Xr,"CameraErrorNotice");var yo="sekyroFlow";function go(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[yo]===!0}s(go,"onGuard");function $t(){if(typeof window>"u"||go())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[yo]:!0},"")}s($t,"pushGuard");function ho(){window.history.back()}s(ho,"leaveHistory");function jr({open:e,onStay:t,onLeave:n}){let{t:o}=T();return u(at,{open:e,role:"alertdialog",title:o("leave.title"),onClose:t,testId:"sekyro-leave",actions:Q(Ke,{children:[u(w,{full:!0,onClick:t,children:o("leave.stay")}),u(w,{full:!0,kind:"danger",onClick:n,children:o("leave.confirm")})]}),children:u("p",{className:"sekyro-text-muted",children:o("leave.body")})})}s(jr,"LeaveDialog");function es(e,t){let[n,o]=se(!1),[a,i]=se(null),r=e===null?void 0:e.skipCapture,l=ue(r);l.current=r;let c=ue(!1),p=e?.key;ut(()=>i(null),[p]);let m=re(()=>{if(c.current)return;let h=l.current;h!==void 0&&(c.current=!0,o(!0),i(null),h().catch(v=>i(t.t(ge(v,t.strings)))).finally(()=>{c.current=!1,o(!1)}))},[t]),g=re(()=>i(null),[]),b=r!==void 0,d=t.t("sandbox.skipCapture");return Ut(()=>b?{label:d,busy:n,failed:a,run:m,reset:g}:null,[b,d,n,a,m,g])}s(es,"useSkipCapture");function ts({skip:e}){return Q(Ke,{children:[e.failed!==null?u(O,{tone:"danger",children:u("span",{children:e.failed})}):null,u(w,{kind:"ghost",full:!0,disabled:e.busy,"aria-busy":e.busy||void 0,onClick:e.run,"data-testid":"sekyro-skip-capture",children:e.label})]})}s(ts,"SkipAction");function ns(e){let{step:t,error:n,slots:o,immersive:a}=e,i=T(),{t:r}=i,[l,c]=se(!1),[p,m]=se([]),g=re(f=>(m(P=>[...P,f]),()=>m(P=>P.filter(G=>G!==f))),[]),[b,d]=se(null),h=re(f=>d(()=>f),[]),[v,E]=se(0),[I,_]=se(null),R=es(t,i),D=t?.context.purpose??"identity",x=t?.context.returning===!0,C=e.verification,S=D==="human"||t?.context.cameraUnavailableHandled===!0,A=C.reportCameraUnavailable!==void 0&&S?f=>C.reportCameraUnavailable?.(f)??Promise.resolve():void 0,$=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,ie=e.handoffUrl,de=re((f,P)=>A===void 0?void 0:u(B,{view:"NoCameraView",i18n:i,quiet:!0,cause:P,onRetry:f,...$?{onContinue:A}:{},...ie!==void 0?{handoffUrl:ie}:{}}),[i,C,S,$,ie]),he=Ut(()=>En(t),[t]),Ie=re((f,P)=>u(In,{start:f,context:P,human:D==="human",returning:x,notice:P.permissionSettled&&P.permission==="denied"?de(f,"denied"):void 0,...he!==void 0?{retry:he}:{}}),[D,x,de,he]),pe=re((f,P)=>{let G=Yr(f.kind);return(G!==void 0?de(P,G):void 0)??Q(Ke,{children:[u(Xr,{error:f,retry:P}),G!==void 0&&ie!==void 0?u(B,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:ie}):null]})},[de,ie,i]),Te=ue(""),Ge=e.livenessProps?.slots?.stageOverlay,fe=re(f=>(f.guidance!==""&&!f.coached&&(Te.current=f.guidance),u(Rn,{testId:"sekyro-capture-stage",video:u("video",{ref:f.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:f.settled?r("capture.checkingTitle"):f.guidance!==""?f.guidance:Te.current,note:f.note,status:f.status,busy:f.settled,progress:f.phase==="seeking"||f.phase==="aligning"?f.progress:1,still:f.still,live:f.live,closeLabel:r("native.close"),overlay:Ge?.(f.videoRef),ramp:f.ramp?.colour??null,...f.settled?{}:{onClose:s(()=>E(P=>P+1),"onClose")},end:f.modeSwitch!=null?u(an,{view:f.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:f.settled||!f.live?null:u(vn,{onStop:()=>E(P=>P+1)})})),[r,Ge]),me=qr(),We=t,Re=t!==null&&I===t.key&&t.context.switchable!==void 0,ke=b??(t===null||t.kind==="result"?null:Re?()=>_(null):t.context.switchable!==void 0&&typeof We?.chooseOption=="function"?()=>_(t.key):null),ze=ue(ke);ze.current=ke;let ee=ue(t);ee.current=t;let ye=ue({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});ye.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Le=e.backNavigation==="history";if(ut(()=>{if(!Le||typeof window>"u")return;$t();let f=s(()=>{if(go())return;let P=ee.current,G=ze.current;G!==null?(G(),$t()):P?.kind!=="result"&&P?.context.consentRecorded===!0?ye.current.ask():ye.current.hostClose?ye.current.closed():ho()},"onPop");return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[Le]),n!==null)return u(yt,{tone:"danger",children:u("span",{children:r(ge(n,i.strings))})});if(t===null)return Q("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[u("span",{className:"sekyro-visually-hidden",children:r("common.loading")}),u("span",{className:"sekyro-skeleton__bar is-title"}),u("span",{className:"sekyro-skeleton__bar"}),u("span",{className:"sekyro-skeleton__bar is-short"}),u("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:z}=t,q=s(f=>{c(!0),f().finally(()=>c(!1))},"refresh"),Se=o?.header??u(ss,{context:z,headerId:me,end:o?.headerEnd,...ke!==null?{onBack:ke}:{}}),L,Y=Re;if(Y)L=u(B,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>_(null)});else switch(t.kind){case"phone_otp":L=u(wt,{step:t});break;case"email_otp":L=u(Pt,{step:t});break;case"method":L=u(Et,{step:t});break;case"registry":L=u(rt,{step:t});break;case"document":L=u(Mt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let f=e.livenessProps?.slots?.intro,P={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:f??Ie,...f===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:pe}:{}},...v>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:i.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};L=u(cn.Provider,{value:fe,children:t.instructions==="icao"||t.livePhoto?.icao===!0?u(B,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:P,sekyroIntro:f===void 0},v):u(pn,{...P},v)});break}case"portrait":L=Q(Ke,{children:[t.retakeOnly?u(B,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,u(Ot,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":L=u(B,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":L=u(B,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":L=u(B,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":{let f=t.checkType==="doc_ocr"?r("handoff.lead.document"):t.checkType==="portrait_icao"?r("handoff.lead.portrait"):void 0;L=e.handoffUrl!==void 0?u(B,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh,...f!==void 0?{lead:f}:{}}):u(tt,{tone:"brand",icon:"smartphone",title:r("handoff.title"),actions:u(w,{kind:"secondary",full:!0,disabled:l,onClick:()=>q(t.refresh),children:r("common.refresh")}),children:u("p",{children:f??r("reasons.mobile_required")})});break}case"processing":{let f=Qr(i.strings,t.service);L=u(tt,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:f?.title??r("session.processing.title"),actions:t.stalled?u(w,{kind:"secondary",full:!0,disabled:l,onClick:()=>q(t.refresh),children:r("common.refresh")}):null,children:u("p",{children:f?.description??r("session.processing.description")})});break}case"eid":L=u(_t,{step:t});break;case"unsupported":{let f=t.reason==="platform_unsupported";L=u(tt,{tone:"neutral",icon:"smartphone",title:r(f?"needsApp.title":"unsupported.title"),actions:u(os,{org:z.orgName}),children:u("p",{children:f?z.orgName!==""?r("needsApp.description",{org:z.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:z.orgName})})});break}case"result":L=o?.result?.(t)??u(rs,{step:t});break;default:{let f=t;L=null}}let X=!a&&!z.consentRecorded&&t.kind!=="result"?u(ao,{i18n:i,purpose:z.purpose}):null,Me=R!==null&&!a&&!Y?u(ts,{skip:R}):null,Z=Me===null?X:Q(Ke,{children:[Me,X]});return u(Sn.Provider,{value:h,children:u(je.Provider,{value:R,children:u(Tn.Provider,{value:e.handoffUrl,children:Q(kn.Provider,{value:Z===null?null:{node:Z,owner:p[0]??null,claim:g},children:[a?null:Se,!a&&t.kind!=="result"&&z.sections.length>1?u(is,{context:z,current:t.section,i18n:i}):null,u(Nn,{pageKey:t.key,children:L}),!a&&!Y&&t.kind!=="result"&&t.context.switchable!==void 0?u(B,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>_(t.key),quiet:!0},t.key):null,p.length===0?Z:null,a?null:o?.footer!==void 0?o.footer:z.branding?.hideAttribution===!0?null:Q("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[u(K,{name:"lock"}),r("shell.verifiedBy")]})]})})})})}s(ns,"Body");function os({org:e}){let{t}=T(),n=Zr(ht);return n===void 0?null:u(w,{full:!0,onClick:n,children:e!==""?t("native.result.back",{org:e}):t("native.close")})}s(os,"BackToOrg");function rs({step:e}){return u(Xe.Consumer,{children:t=>u(Ht,{step:e,...t!==void 0?{onClose:t}:{}})})}s(rs,"ResultPage");function ss({context:e,headerId:t,end:n,onBack:o}){let{t:a}=T(),[i,r]=se(!1),l=i?void 0:e.branding?.logoUrl,c=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return u("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:Q("div",{className:"sekyro-org",children:[o!==void 0?u("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:o,"data-testid":"sekyro-back",children:u(K,{name:"back"})}):null,u("span",{className:"sekyro-org__tile","aria-hidden":"true",children:l!==void 0?u("img",{className:"sekyro-org__logo",src:l,alt:"",onError:()=>r(!0)}):lo(e.orgName)}),Q("div",{className:"sekyro-org__text",children:[u("h1",{id:t,className:"sekyro-org__name",children:c}),u("p",{className:"sekyro-org__sub",children:a(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?u("div",{className:"sekyro-org__end",children:n}):null,u(Xe.Consumer,{children:p=>p!==void 0?u("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:u(K,{name:"close"})}):null})]})})}s(ss,"OrgHeader");function is({context:e,current:t,i18n:n}){let o=t===null?-1:e.sections.indexOf(t),a=e.progress,i=a!==void 0&&a.length===e.sections.length?a:e.sections.map((r,l)=>({id:r,state:l<o?"done":l===o?"current":"upcoming"}));return u("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:i.map(({id:r,state:l})=>u("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:u("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${r}`]??r})},r))})}s(is,"SectionProgress");import{useEffect as as,useState as ko}from"react";import{jsx as Ee}from"react/jsx-runtime";function ls(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(ls,"pageUrl");function cs({hostedUrl:e,inAppBrowser:t,...n}){let[o,a]=ko(t===!0);as(()=>{t===void 0&&kt()&&a(!0)},[t]);let[i,r]=ko(!1),l=ct(n.colorScheme??"light"),c=n.handoffUrl??e??ls();return o&&!i?Ee(mn,{theme:Je(lt(void 0,void 0,l),n.theme),className:`sekyro-verification${l?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:Ee(Ve,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:Ee("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:Ee(us,{url:c,onContinue:()=>r(!0)})})})}):Ee(Kt,{...n,...c!==""?{handoffUrl:c}:{}})}s(cs,"SekyroFlow");function us({url:e,onContinue:t}){let n=T();return Ee(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}s(us,"Prompt");export{Mt as DocumentCapture,_t as EidStep,Pt as EmailOtpStep,rt as IdNumberEntry,Et as MethodChoice,ar as NniEntry,wt as PhoneOtpStep,Ot as PortraitCapture,cs as SekyroFlow,Kt as SekyroVerification,Ve as StepI18nProvider,Ht as VerificationResultScreen,Po as arSteps,_o as enSteps,Eo as formatTemplate,xo as frSteps,kt as isInAppBrowser,No as loadSekyroLocale,Io as resolveSekyroStrings,wo as retakeHintStringKey,T as useStepI18n,St as useVerificationStep};
|
package/dist/verification.css
CHANGED
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
}
|
|
86
86
|
.sekyro-input:focus-visible { outline: 3px solid var(--sekyro-color-ring); outline-offset: 2px; }
|
|
87
87
|
.sekyro-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
88
|
+
.sekyro-test-code { font-weight: 600; color: var(--sekyro-color-fg); letter-spacing: 0.04em; }
|
|
88
89
|
.sekyro-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
|
|
89
90
|
.sekyro-center { text-align: center; }
|
|
90
91
|
.sekyro-result { text-align: start; }
|
|
@@ -597,6 +598,11 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
|
|
|
597
598
|
background: color-mix(in srgb, var(--sekyro-color-on-stage) 18%, transparent); color: var(--sekyro-color-on-stage);
|
|
598
599
|
-webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
|
|
599
600
|
}
|
|
601
|
+
/* Spec 2026-11-06 §3.3: the capture mode switch, a frosted pill with its icon and short label. */
|
|
602
|
+
.sekyro-glass.sekyro-glass--label {
|
|
603
|
+
display: inline-flex; gap: 0.5rem; align-items: center; inline-size: auto; block-size: auto; min-block-size: 44px;
|
|
604
|
+
max-inline-size: 100%; padding-block: 0.5rem; padding-inline: 0.75rem 1rem; border-radius: 9999px; font: inherit; text-align: start;
|
|
605
|
+
}
|
|
600
606
|
.sekyro-glass.is-on { background: var(--sekyro-color-on-stage); color: var(--sekyro-color-stage); }
|
|
601
607
|
.sekyro-glass:focus-visible, .sekyro-shutter:focus-visible { outline: 3px solid var(--sekyro-color-on-stage); outline-offset: 2px; }
|
|
602
608
|
.sekyro-shutter {
|
|
@@ -657,6 +663,9 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
|
|
|
657
663
|
padding-block: 0.25rem;
|
|
658
664
|
padding-inline: 1rem;
|
|
659
665
|
}
|
|
666
|
+
/* The wash (screen-ramp-layer.tsx) lights the whole screen, its cover fills the stage over the camera; the ink around
|
|
667
|
+
* the oval steps aside so the ring sits on the colour. */
|
|
668
|
+
.sekyro-fc[data-ramp] .sekyro-fc-scrim { visibility: hidden; }
|
|
660
669
|
.sekyro-fc-rim { fill: none; stroke: color-mix(in srgb, var(--sekyro-color-on-stage) 35%, transparent); stroke-width: 1.5; }
|
|
661
670
|
.sekyro-fc-ticks { fill: none; stroke: color-mix(in srgb, var(--sekyro-color-on-stage) 28%, transparent); stroke-width: 3; stroke-linecap: round; }
|
|
662
671
|
.sekyro-fc-ticks.is-done { stroke: var(--sekyro-color-on-camera-success); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--sekyro-color-on-camera-success) 60%, transparent)); }
|
|
@@ -680,6 +689,9 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
|
|
|
680
689
|
.sekyro-fc-mark > svg { inline-size: 14px; block-size: 14px; fill: none; stroke: transparent; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
681
690
|
.sekyro-fc-checks > li.is-met .sekyro-fc-mark { border-color: var(--sekyro-color-on-camera-success); background: var(--sekyro-color-on-camera-success); }
|
|
682
691
|
.sekyro-fc-checks > li.is-met .sekyro-fc-mark > svg { stroke: var(--sekyro-color-stage); }
|
|
692
|
+
/* A criterion the last photo failed (the server's report), until the gate holds it: the row to fix. */
|
|
693
|
+
.sekyro-fc-checks > li.is-flagged { color: var(--sekyro-color-on-stage); }
|
|
694
|
+
.sekyro-fc-checks > li.is-flagged .sekyro-fc-mark { border-color: var(--sekyro-color-warning); border-width: 2px; }
|
|
683
695
|
|
|
684
696
|
/* The face capture (the 0.1 stage) inside the flow: the instruction on the flow's camera scale. */
|
|
685
697
|
.sekyro-verification .sekyro-stage__guidance-text { font: var(--sekyro-type-flow-camera) var(--sekyro-font-display); letter-spacing: var(--sekyro-tracking-flow-camera); }
|
|
@@ -730,9 +742,11 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
|
|
|
730
742
|
.sekyro-summary__row { display: grid; gap: 0.125rem; }
|
|
731
743
|
.sekyro-summary__row dt { font: var(--sekyro-type-flow-caption) var(--sekyro-font); }
|
|
732
744
|
.sekyro-summary__row dd { margin: 0; color: var(--sekyro-color-fg); font: var(--sekyro-type-flow-action) var(--sekyro-font); font-variant-numeric: tabular-nums; }
|
|
733
|
-
|
|
734
|
-
.
|
|
735
|
-
.sekyro-
|
|
745
|
+
/* The handoff QR: always navy modules on a white tile, in dark mode and under a partner theme too (phone cameras read
|
|
746
|
+
dark-on-light codes best). The camera-stage pair is fixed Sekyro navy and white: no theme or branding sets it. */
|
|
747
|
+
.sekyro-qr { inline-size: 12rem; block-size: 12rem; align-self: center; padding: 0.75rem; border: 1px solid var(--sekyro-color-line-subtle); border-radius: var(--sekyro-radius-card); background: var(--sekyro-color-on-stage); }
|
|
748
|
+
.sekyro-qr__bg { fill: var(--sekyro-color-on-stage); }
|
|
749
|
+
.sekyro-qr__fg { fill: var(--sekyro-color-stage); }
|
|
736
750
|
a.sekyro-btn { text-decoration: none; }
|
|
737
751
|
/* WhatsApp and SMS as equals: one row, two buttons of the same kind and width (Salem 2026-11-05). */
|
|
738
752
|
.sekyro-channel-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
|