@sekyro/react 0.1.0-rc.7 → 0.1.0-rc.9
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 +42 -0
- package/README.md +18 -7
- package/dist/chunk-2KED7D2Q.js +2 -0
- package/dist/chunk-4CUPBFVB.js +2 -0
- package/dist/chunk-4U5FQY26.js +2 -0
- package/dist/chunk-64PTFYXL.js +2 -0
- package/dist/chunk-7C3GZLJB.js +2 -0
- package/dist/{chunk-AMOZXMUP.js → chunk-EZ5TVL6P.js} +1 -1
- package/dist/chunk-H2KIOYQU.js +2 -0
- package/dist/{chunk-Q232JYNO.js → chunk-PYAJMHZH.js} +1 -1
- package/dist/{chunk-P2LX7BBE.js → chunk-RFCYXRRC.js} +1 -1
- package/dist/chunk-RPQZH66I.js +2 -0
- package/dist/chunk-VRS7WSIK.js +2 -0
- package/dist/chunk-WJW3SNXQ.js +2 -0
- package/dist/chunk-XZEX5KTU.js +2 -0
- package/dist/{chunk-4INDRENU.js → chunk-YY76AMUA.js} +1 -1
- package/dist/chunk-ZCAZDOMD.js +2 -0
- package/dist/document-capture-view-2XBWIX6K.js +2 -0
- package/dist/eid-view-4T7Y2NJC.js +2 -0
- package/dist/email-otp-view-76T5QW7H.js +2 -0
- package/dist/flow-views-LEW6T5UR.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1 -1
- package/dist/overlay-de-WAVGHULU.js +2 -0
- package/dist/overlay-es-CHRGVULE.js +2 -0
- package/dist/overlay-pt-2QQ7WMTF.js +2 -0
- package/dist/portrait-capture-view-GORALODC.js +2 -0
- package/dist/styles.css +12 -11
- package/dist/{theme-BpOuzcWh.d.cts → theme-DiGLpM-i.d.cts} +50 -14
- package/dist/{theme-BpOuzcWh.d.ts → theme-DiGLpM-i.d.ts} +50 -14
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +34 -4
- package/dist/verification/index.d.ts +34 -4
- package/dist/verification/index.js +1 -1
- package/dist/verification.css +16 -0
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-3MBJZSJL.js +0 -2
- package/dist/chunk-4RUZQW5T.js +0 -2
- package/dist/chunk-5SVCGLYS.js +0 -2
- package/dist/chunk-63NUMQST.js +0 -2
- package/dist/chunk-65JA6YKG.js +0 -2
- package/dist/chunk-ADMDZLPM.js +0 -2
- package/dist/chunk-B43EDVOK.js +0 -2
- package/dist/chunk-BENNJ4GV.js +0 -2
- package/dist/chunk-QZAPVO6F.js +0 -2
- package/dist/chunk-YUNPD6ZB.js +0 -2
- package/dist/document-capture-view-PT732PJ2.js +0 -2
- package/dist/eid-view-RFSXIECL.js +0 -2
- package/dist/email-otp-view-3WZH74UT.js +0 -2
- package/dist/flow-views-N6KYXL4N.js +0 -2
- package/dist/portrait-capture-view-HYOEOAF4.js +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DiGLpM-i.cjs';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-DiGLpM-i.cjs';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { ReactNode } from 'react';
|
|
4
5
|
import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
|
|
@@ -15,6 +16,7 @@ interface StepStrings {
|
|
|
15
16
|
"consent.terms.processing": string;
|
|
16
17
|
"consent.terms.sharing": string;
|
|
17
18
|
"consent.terms.retention": string;
|
|
19
|
+
"reasons.camera_unavailable": string;
|
|
18
20
|
"otp.sendTitle": string;
|
|
19
21
|
"otp.sendDescription": string;
|
|
20
22
|
"otp.prefilledNotice": string;
|
|
@@ -44,6 +46,7 @@ interface StepStrings {
|
|
|
44
46
|
"otp.reason_otp_destination_not_allowed": string;
|
|
45
47
|
"otp.reason_otp_destination_unknown": string;
|
|
46
48
|
"otp.reason_otp_rate_limited": string;
|
|
49
|
+
"otp.reason_otp_daily_cap_reached": string;
|
|
47
50
|
"session.steps.population.title": string;
|
|
48
51
|
"session.steps.population.description": string;
|
|
49
52
|
"population.label": string;
|
|
@@ -105,6 +108,7 @@ interface StepStrings {
|
|
|
105
108
|
"session.result.expired.description": string;
|
|
106
109
|
"session.result.detailsMismatch": string;
|
|
107
110
|
"session.result.deviceVelocity": string;
|
|
111
|
+
"session.result.deviceStop": string;
|
|
108
112
|
"result.referenceLabel": string;
|
|
109
113
|
"common.loading": string;
|
|
110
114
|
"common.refresh": string;
|
|
@@ -169,6 +173,8 @@ interface StepStrings {
|
|
|
169
173
|
"reasons.icao_background": string;
|
|
170
174
|
"reasons.icao_resolution": string;
|
|
171
175
|
"reasons.portrait_not_from_liveness": string;
|
|
176
|
+
"reasons.tester_document_mismatch": string;
|
|
177
|
+
"reasons.tester_phone_mismatch": string;
|
|
172
178
|
"method.national_eid": string;
|
|
173
179
|
"method.national_eidGeneric": string;
|
|
174
180
|
"consent.short": string;
|
|
@@ -213,6 +219,7 @@ interface StepStrings {
|
|
|
213
219
|
"unsupported.title": string;
|
|
214
220
|
"unsupported.description": string;
|
|
215
221
|
"shell.subtitle": string;
|
|
222
|
+
"shell.subtitleHuman": string;
|
|
216
223
|
"shell.verifiedBy": string;
|
|
217
224
|
"doc.sub.carte_identite": string;
|
|
218
225
|
"doc.sub.residence_permit": string;
|
|
@@ -220,6 +227,8 @@ interface StepStrings {
|
|
|
220
227
|
"native.close": string;
|
|
221
228
|
"native.face.introTitle": string;
|
|
222
229
|
"native.face.introLead": string;
|
|
230
|
+
"native.face.humanIntroTitle": string;
|
|
231
|
+
"native.face.humanIntroLead": string;
|
|
223
232
|
"native.doc.holdIt": string;
|
|
224
233
|
"native.doc.changeCountry": string;
|
|
225
234
|
"native.result.approved": string;
|
|
@@ -228,6 +237,7 @@ interface StepStrings {
|
|
|
228
237
|
"native.result.expired": string;
|
|
229
238
|
"native.result.copied": string;
|
|
230
239
|
"native.result.back": string;
|
|
240
|
+
"emailOtp.reason_otp_daily_cap_reached"?: string;
|
|
231
241
|
"emailOtp.sendTitle"?: string;
|
|
232
242
|
"emailOtp.sendDescription"?: string;
|
|
233
243
|
"emailOtp.prefilledNotice"?: string;
|
|
@@ -319,6 +329,16 @@ interface StepStrings {
|
|
|
319
329
|
"native.scan.reading"?: string;
|
|
320
330
|
"native.scan.putDown"?: string;
|
|
321
331
|
"native.scan.retry"?: string;
|
|
332
|
+
"consent.human.terms.intro"?: string;
|
|
333
|
+
"consent.human.terms.data"?: string;
|
|
334
|
+
"consent.human.terms.processing"?: string;
|
|
335
|
+
"consent.human.terms.sharing"?: string;
|
|
336
|
+
"consent.human.terms.retention"?: string;
|
|
337
|
+
"capture.noCamera.title"?: string;
|
|
338
|
+
"capture.noCamera.body"?: string;
|
|
339
|
+
"capture.noCamera.continue"?: string;
|
|
340
|
+
"capture.noCamera.deniedTitle"?: string;
|
|
341
|
+
"capture.noCamera.deniedBody"?: string;
|
|
322
342
|
"choice.title"?: string;
|
|
323
343
|
"choice.description"?: string;
|
|
324
344
|
"choice.switch"?: string;
|
|
@@ -370,6 +390,13 @@ interface StepStrings {
|
|
|
370
390
|
"inApp.continueAnyway"?: string;
|
|
371
391
|
}
|
|
372
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Loads the copy of a Human-only locale (es, pt, de); resolves at once for ar/fr/en. The components load it by
|
|
395
|
+
* themselves (they render once it is there); call it ahead to have the copy ready on the first render. A failed
|
|
396
|
+
* download leaves the locale on English.
|
|
397
|
+
*/
|
|
398
|
+
declare function loadSekyroLocale(locale: SekyroLocale): Promise<void>;
|
|
399
|
+
|
|
373
400
|
declare const arSteps: StepStrings;
|
|
374
401
|
|
|
375
402
|
declare const enSteps: StepStrings;
|
|
@@ -380,17 +407,19 @@ type SekyroStrings = Strings & StepStrings;
|
|
|
380
407
|
type SekyroStringKey = keyof SekyroStrings;
|
|
381
408
|
type StepTranslate = (key: SekyroStringKey, vars?: Record<string, string | number>) => string;
|
|
382
409
|
declare function formatTemplate(template: string, vars?: Record<string, string | number>): string;
|
|
410
|
+
/** 0.1 built-ins → step built-ins → (es/pt/de) the locale's loaded overlay → overrides. */
|
|
383
411
|
declare function resolveSekyroStrings(locale: SekyroLocale, overrides?: Partial<SekyroStrings>): SekyroStrings;
|
|
384
412
|
interface StepI18n {
|
|
385
413
|
locale: SekyroLocale;
|
|
386
414
|
strings: SekyroStrings;
|
|
387
415
|
t: StepTranslate;
|
|
388
416
|
}
|
|
417
|
+
/** es/pt/de: renders once the locale's overlay is loaded (no English flash). */
|
|
389
418
|
declare function StepI18nProvider({ locale, strings, children }: {
|
|
390
419
|
locale: SekyroLocale;
|
|
391
420
|
strings?: Partial<SekyroStrings>;
|
|
392
421
|
children: ReactNode;
|
|
393
|
-
}): react.JSX.Element;
|
|
422
|
+
}): react.JSX.Element | null;
|
|
394
423
|
/** Props win over the surrounding provider; default English. */
|
|
395
424
|
declare function useStepI18n(locale?: SekyroLocale, strings?: Partial<SekyroStrings>): StepI18n;
|
|
396
425
|
|
|
@@ -480,7 +509,8 @@ interface SekyroVerificationProps {
|
|
|
480
509
|
voice?: false | VoiceOptions;
|
|
481
510
|
livenessProps?: Omit<LivenessCaptureProps, "verification" | "locale" | "dir" | "strings" | "assetBaseUrl" | "voice" | "onCaptured" | "onResult">;
|
|
482
511
|
/**
|
|
483
|
-
* `header` and `footer` replace the partner header and the "Verified by Sekyro AI"
|
|
512
|
+
* `header` and `footer` replace the partner header and the "Verified by Sekyro AI" link (`footer: null` hides it;
|
|
513
|
+
* the link also hides when the org hides the attribution, `branding.hideAttribution`);
|
|
484
514
|
* `headerEnd` sits at the inline end of the partner header (a language menu), before the close button.
|
|
485
515
|
*/
|
|
486
516
|
slots?: {
|
|
@@ -525,4 +555,4 @@ declare function VerificationResultScreen({ step, locale, strings, className, on
|
|
|
525
555
|
onClose?: () => void;
|
|
526
556
|
}): react.JSX.Element;
|
|
527
557
|
|
|
528
|
-
export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, resolveSekyroStrings, useStepI18n, useVerificationStep };
|
|
558
|
+
export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, loadSekyroLocale, resolveSekyroStrings, useStepI18n, useVerificationStep };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DiGLpM-i.js';
|
|
2
|
+
export { k as StringKey, A as retakeHintStringKey } from '../theme-DiGLpM-i.js';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { ReactNode } from 'react';
|
|
4
5
|
import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
|
|
@@ -15,6 +16,7 @@ interface StepStrings {
|
|
|
15
16
|
"consent.terms.processing": string;
|
|
16
17
|
"consent.terms.sharing": string;
|
|
17
18
|
"consent.terms.retention": string;
|
|
19
|
+
"reasons.camera_unavailable": string;
|
|
18
20
|
"otp.sendTitle": string;
|
|
19
21
|
"otp.sendDescription": string;
|
|
20
22
|
"otp.prefilledNotice": string;
|
|
@@ -44,6 +46,7 @@ interface StepStrings {
|
|
|
44
46
|
"otp.reason_otp_destination_not_allowed": string;
|
|
45
47
|
"otp.reason_otp_destination_unknown": string;
|
|
46
48
|
"otp.reason_otp_rate_limited": string;
|
|
49
|
+
"otp.reason_otp_daily_cap_reached": string;
|
|
47
50
|
"session.steps.population.title": string;
|
|
48
51
|
"session.steps.population.description": string;
|
|
49
52
|
"population.label": string;
|
|
@@ -105,6 +108,7 @@ interface StepStrings {
|
|
|
105
108
|
"session.result.expired.description": string;
|
|
106
109
|
"session.result.detailsMismatch": string;
|
|
107
110
|
"session.result.deviceVelocity": string;
|
|
111
|
+
"session.result.deviceStop": string;
|
|
108
112
|
"result.referenceLabel": string;
|
|
109
113
|
"common.loading": string;
|
|
110
114
|
"common.refresh": string;
|
|
@@ -169,6 +173,8 @@ interface StepStrings {
|
|
|
169
173
|
"reasons.icao_background": string;
|
|
170
174
|
"reasons.icao_resolution": string;
|
|
171
175
|
"reasons.portrait_not_from_liveness": string;
|
|
176
|
+
"reasons.tester_document_mismatch": string;
|
|
177
|
+
"reasons.tester_phone_mismatch": string;
|
|
172
178
|
"method.national_eid": string;
|
|
173
179
|
"method.national_eidGeneric": string;
|
|
174
180
|
"consent.short": string;
|
|
@@ -213,6 +219,7 @@ interface StepStrings {
|
|
|
213
219
|
"unsupported.title": string;
|
|
214
220
|
"unsupported.description": string;
|
|
215
221
|
"shell.subtitle": string;
|
|
222
|
+
"shell.subtitleHuman": string;
|
|
216
223
|
"shell.verifiedBy": string;
|
|
217
224
|
"doc.sub.carte_identite": string;
|
|
218
225
|
"doc.sub.residence_permit": string;
|
|
@@ -220,6 +227,8 @@ interface StepStrings {
|
|
|
220
227
|
"native.close": string;
|
|
221
228
|
"native.face.introTitle": string;
|
|
222
229
|
"native.face.introLead": string;
|
|
230
|
+
"native.face.humanIntroTitle": string;
|
|
231
|
+
"native.face.humanIntroLead": string;
|
|
223
232
|
"native.doc.holdIt": string;
|
|
224
233
|
"native.doc.changeCountry": string;
|
|
225
234
|
"native.result.approved": string;
|
|
@@ -228,6 +237,7 @@ interface StepStrings {
|
|
|
228
237
|
"native.result.expired": string;
|
|
229
238
|
"native.result.copied": string;
|
|
230
239
|
"native.result.back": string;
|
|
240
|
+
"emailOtp.reason_otp_daily_cap_reached"?: string;
|
|
231
241
|
"emailOtp.sendTitle"?: string;
|
|
232
242
|
"emailOtp.sendDescription"?: string;
|
|
233
243
|
"emailOtp.prefilledNotice"?: string;
|
|
@@ -319,6 +329,16 @@ interface StepStrings {
|
|
|
319
329
|
"native.scan.reading"?: string;
|
|
320
330
|
"native.scan.putDown"?: string;
|
|
321
331
|
"native.scan.retry"?: string;
|
|
332
|
+
"consent.human.terms.intro"?: string;
|
|
333
|
+
"consent.human.terms.data"?: string;
|
|
334
|
+
"consent.human.terms.processing"?: string;
|
|
335
|
+
"consent.human.terms.sharing"?: string;
|
|
336
|
+
"consent.human.terms.retention"?: string;
|
|
337
|
+
"capture.noCamera.title"?: string;
|
|
338
|
+
"capture.noCamera.body"?: string;
|
|
339
|
+
"capture.noCamera.continue"?: string;
|
|
340
|
+
"capture.noCamera.deniedTitle"?: string;
|
|
341
|
+
"capture.noCamera.deniedBody"?: string;
|
|
322
342
|
"choice.title"?: string;
|
|
323
343
|
"choice.description"?: string;
|
|
324
344
|
"choice.switch"?: string;
|
|
@@ -370,6 +390,13 @@ interface StepStrings {
|
|
|
370
390
|
"inApp.continueAnyway"?: string;
|
|
371
391
|
}
|
|
372
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Loads the copy of a Human-only locale (es, pt, de); resolves at once for ar/fr/en. The components load it by
|
|
395
|
+
* themselves (they render once it is there); call it ahead to have the copy ready on the first render. A failed
|
|
396
|
+
* download leaves the locale on English.
|
|
397
|
+
*/
|
|
398
|
+
declare function loadSekyroLocale(locale: SekyroLocale): Promise<void>;
|
|
399
|
+
|
|
373
400
|
declare const arSteps: StepStrings;
|
|
374
401
|
|
|
375
402
|
declare const enSteps: StepStrings;
|
|
@@ -380,17 +407,19 @@ type SekyroStrings = Strings & StepStrings;
|
|
|
380
407
|
type SekyroStringKey = keyof SekyroStrings;
|
|
381
408
|
type StepTranslate = (key: SekyroStringKey, vars?: Record<string, string | number>) => string;
|
|
382
409
|
declare function formatTemplate(template: string, vars?: Record<string, string | number>): string;
|
|
410
|
+
/** 0.1 built-ins → step built-ins → (es/pt/de) the locale's loaded overlay → overrides. */
|
|
383
411
|
declare function resolveSekyroStrings(locale: SekyroLocale, overrides?: Partial<SekyroStrings>): SekyroStrings;
|
|
384
412
|
interface StepI18n {
|
|
385
413
|
locale: SekyroLocale;
|
|
386
414
|
strings: SekyroStrings;
|
|
387
415
|
t: StepTranslate;
|
|
388
416
|
}
|
|
417
|
+
/** es/pt/de: renders once the locale's overlay is loaded (no English flash). */
|
|
389
418
|
declare function StepI18nProvider({ locale, strings, children }: {
|
|
390
419
|
locale: SekyroLocale;
|
|
391
420
|
strings?: Partial<SekyroStrings>;
|
|
392
421
|
children: ReactNode;
|
|
393
|
-
}): react.JSX.Element;
|
|
422
|
+
}): react.JSX.Element | null;
|
|
394
423
|
/** Props win over the surrounding provider; default English. */
|
|
395
424
|
declare function useStepI18n(locale?: SekyroLocale, strings?: Partial<SekyroStrings>): StepI18n;
|
|
396
425
|
|
|
@@ -480,7 +509,8 @@ interface SekyroVerificationProps {
|
|
|
480
509
|
voice?: false | VoiceOptions;
|
|
481
510
|
livenessProps?: Omit<LivenessCaptureProps, "verification" | "locale" | "dir" | "strings" | "assetBaseUrl" | "voice" | "onCaptured" | "onResult">;
|
|
482
511
|
/**
|
|
483
|
-
* `header` and `footer` replace the partner header and the "Verified by Sekyro AI"
|
|
512
|
+
* `header` and `footer` replace the partner header and the "Verified by Sekyro AI" link (`footer: null` hides it;
|
|
513
|
+
* the link also hides when the org hides the attribution, `branding.hideAttribution`);
|
|
484
514
|
* `headerEnd` sits at the inline end of the partner header (a language menu), before the close button.
|
|
485
515
|
*/
|
|
486
516
|
slots?: {
|
|
@@ -525,4 +555,4 @@ declare function VerificationResultScreen({ step, locale, strings, className, on
|
|
|
525
555
|
onClose?: () => void;
|
|
526
556
|
}): react.JSX.Element;
|
|
527
557
|
|
|
528
|
-
export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, resolveSekyroStrings, useStepI18n, useVerificationStep };
|
|
558
|
+
export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, loadSekyroLocale, resolveSekyroStrings, useStepI18n, useVerificationStep };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{c as ie,d as ae,e as le}from"../chunk-ADMDZLPM.js";import{a as ze}from"../chunk-AMOZXMUP.js";import{a as Ge}from"../chunk-4INDRENU.js";import{a as Ye,b as Qe,c as Je,d as Xe}from"../chunk-B43EDVOK.js";import{a as $e,c as Ue,f as Ke}from"../chunk-QZAPVO6F.js";import{a as G}from"../chunk-P2LX7BBE.js";import{a as Nt,b as Ct,c as wt,d as Pt,e as xt,f as te,g as b}from"../chunk-5SVCGLYS.js";import"../chunk-65JA6YKG.js";import{a as Ze}from"../chunk-3MBJZSJL.js";import{a as $}from"../chunk-Q232JYNO.js";import{a as K,b as z,c as ce,d as We,g as qe}from"../chunk-63NUMQST.js";import{a as v,b as pe}from"../chunk-BENNJ4GV.js";import{a as i,b as h,h as Fe,i as He,k as me,l as se}from"../chunk-4RUZQW5T.js";import{useEffect as _t,useState as je}from"react";function fe(e){let[t,n]=je(()=>e?.currentStep?.()??null),[s,a]=je(null);return _t(()=>{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 r=!0,o=e.on("step",l=>{r&&n(l)});return e.run().then(l=>{r&&n(p=>p??l)},l=>{r&&a(l)}),()=>{r=!1,o()}},[e]),{step:t,error:s}}i(fe,"useVerificationStep");import{useEffect as It,useId as Et,useRef as Vt,useState as de}from"react";import{Fragment as tt,jsx as g,jsxs as B}from"react/jsx-runtime";var et=i((e,t)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.max(0,Math.ceil(n/1e3)):0},"secondsUntil"),Lt=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Tt=["whatsapp","sms"],Rt=new Set(["otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited"]),q="+222";function At(e){let t=e.replace(/[\s-]/g,""),n=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(n)?`+${n}`:null}i(At,"normalizedPhone");function Dt({id:e,label:t,value:n,onChange:s,placeholder:a}){let r=n.startsWith("+")&&!n.startsWith(q),o=r?n:n.slice(n.startsWith(q)?q.length:0).trim(),l=Vt(null);return It(()=>{let p=setTimeout(()=>l.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(p)},[]),B("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:e,children:t}),B("div",{className:"sekyro-phone",dir:"ltr",children:[r?null:B("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[g("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:"🇲🇷"}),q]}),g("input",{ref:l,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...r?{}:{"aria-describedby":`${e}-dial`},placeholder:a,value:o,onChange:p=>{let m=p.target.value.replace(/[^\d +]/g,"");s(m.startsWith("+")?m:q+m.replace(/\D/g,""))}})]})]})}i(Dt,"PhoneField");function ye({step:e,locale:t,strings:n,className:s,defaultPhone:a=q,onError:r}){let o=b(t,n),{t:l}=o,[p,m]=de(a),[k,y]=de(""),[f,S]=de(!1),[w,E]=de(null),V=e.phase==="verify",L=Ge(V),N=Et(),F=i(async P=>{S(!0),E(null);try{await P()}catch(I){E(G(I,o.strings)),r?.(I)}finally{S(!1)}},"run"),D=Tt.filter(P=>(e.channels??[]).includes(P)),u=At(p),C=!e.needsPhone||u!==null,d=i((P,I=!1)=>{F(()=>e.send({...e.needsPhone&&(!I||p!==a)?{phone:u??p}:{},...P!==void 0?{channel:P}:{}}))},"send"),H=i(P=>{F(()=>e.verify(P))},"submitCode"),Me=i(P=>{P.preventDefault(),V?H(k):D.length<=1&&C&&d(D[0])},"onSubmit"),Be=et(e.codeExpiresAt,L),ee=et(e.resendAvailableAt,L),re=V&&e.codeExpiresAt!==void 0&&Be===0,ue=i(P=>l(P==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[ht,bt]=l("otp.sentTo",{channel:ue(e.channel)}).split("{number}"),vt=e.reason==="otp_mismatch"?B(v,{tone:"danger",children:[g("span",{children:l("otp.reason_otp_mismatch")}),g("span",{children:pe(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Rt.has(e.reason)?g(v,{tone:"warning",children:g("span",{children:l(`otp.reason_${e.reason}`)})}):null,Oe=B(tt,{children:[vt,w!==null?g(v,{tone:"danger",children:g("span",{children:l(w)})}):null]});if(V){let P=D.length===0;return B("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":N,onSubmit:Me,noValidate:!0,children:[g(K,{id:N,title:l("otp.verifyTitle"),lead:B(tt,{children:[ht,g("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),bt]})}),Oe,B("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:`${N}-code`,children:l("otp.codeLabel")}),g(ze,{id:`${N}-code`,value:k,invalid:e.reason==="otp_mismatch",onChange:I=>{y(I),I.length===6&&k.length!==6&&!f&&!e.attemptsExhausted&&H(I)}}),g("span",{className:`sekyro-help sekyro-otp-expiry${re?" is-danger":""}`,"aria-hidden":!re||void 0,children:re?l("otp.expired"):l("otp.expiresIn",{time:Lt(Be)})})]}),g("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:re?l("otp.expired"):""}),B(z,{children:[g(h,{type:"submit",full:!0,disabled:f||k.length!==6||e.attemptsExhausted,"aria-busy":f||void 0,children:l("otp.verify")}),P?g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f||ee>0,onClick:()=>d(void 0,!0),children:ee>0?l("otp.resendIn",{seconds:ee}):l("otp.resend")}):ee>0?g("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:ee})}):g("div",{className:"sekyro-resend-row",children:D.map(I=>g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>d(I,!0),children:l("otp.resendBy",{channel:ue(I)})},I))})]})]})}return B("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":N,onSubmit:Me,noValidate:!0,children:[g(K,{id:N,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Oe,e.needsPhone?g(Dt,{id:`${N}-phone`,label:l("otp.phoneLabel"),value:p,onChange:m,placeholder:l("otp.phonePlaceholder").replace(q,"").trim()}):g("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),g(z,{children:D.length>0?B("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[g("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),D.map((P,I)=>g(h,{kind:I===0?"primary":"ghost",full:!0,disabled:f||!C,"aria-busy":I===0&&f||void 0,onClick:()=>d(P),children:l("otp.sendBy",{channel:ue(P)})},P))]}):g(h,{type:"submit",full:!0,disabled:f||!C,"aria-busy":f||void 0,children:l("otp.send")})})]})}i(ye,"PhoneOtpStep");import{lazy as Bt,Suspense as Ot,useMemo as Ft,useState as Ht}from"react";import{Component as Mt}from"react";var ke=class ke extends Mt{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(ke,"LoadBoundary");var O=ke;import{jsx as Y,jsxs as Ut}from"react/jsx-runtime";var $t={load:i(()=>import("../email-otp-view-3WZH74UT.js"),"load")};function Se({locale:e,strings:t,...n}){let s=b(e,t),[a,r]=Ht(0),o=Ft(()=>Bt(()=>$t.load().then(p=>({default:p.EmailOtpView}))),[a]),l=Ut(v,{tone:"danger",children:[Y("span",{children:s.t("errors.network_error")}),Y(h,{kind:"ghost",onClick:()=>r(p=>p+1),children:s.t("common.retry")})]});return Y(O,{fallback:l,children:Y(Ot,{fallback:Y("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Y(o,{...n,i18n:s})})},a)}i(Se,"EmailOtpStep");import{lazy as Kt,Suspense as zt,useMemo as Wt,useState as qt}from"react";import{jsx as Q,jsxs as Yt}from"react/jsx-runtime";var Gt={load:i(()=>import("../eid-view-RFSXIECL.js"),"load")};function ge({locale:e,strings:t,...n}){let s=b(e,t),[a,r]=qt(0),o=Wt(()=>Kt(()=>Gt.load().then(p=>({default:p.EidView}))),[a]),l=Yt(v,{tone:"danger",children:[Q("span",{children:s.t("errors.network_error")}),Q(h,{kind:"ghost",onClick:()=>r(p=>p+1),children:s.t("common.retry")})]});return Q(O,{fallback:l,children:Q(zt,{fallback:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Q(o,{...n,i18n:s})})},a)}i(ge,"EidStep");import{useMemo as to}from"react";import{lazy as Qt,Suspense as Jt,useMemo as Xt,useState as Zt}from"react";import{jsx as J,jsxs as eo}from"react/jsx-runtime";var jt={load:i(()=>import("../flow-views-N6KYXL4N.js"),"load")};function R({view:e,i18n:t,quiet:n,...s}){let[a,r]=Zt(0),o=Xt(()=>Qt(()=>jt.load().then(p=>({default:p[e]}))),[e,a]),l=eo(v,{tone:"danger",children:[J("span",{children:t.t("errors.network_error")}),J(h,{kind:"ghost",onClick:()=>r(p=>p+1),children:t.t("common.retry")})]});return J(O,{fallback:l,children:J(Jt,{fallback:n===!0?null:J("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:J(o,{...s,i18n:t})})},a)}i(R,"Flow");import{jsx as he,jsxs as oo}from"react/jsx-runtime";function be({step:e,locale:t,strings:n,className:s,onError:a}){let r=b(t,n),{busy:o,error:l,run:p}=Je(r,a),m=to(()=>e.choice.options.flatMap(y=>{let f=Qe(y,r),S=Ye[y.service];return f===null?[]:[{id:y.id,label:f,...S!==void 0?{glyph:he($,{name:S})}:{}}]}),[e.choice.options,r]),k=e.choice.options.find(y=>y.service==="national_eid");return oo("div",{className:s,children:[he(Ue,{title:r.t("method.title"),description:r.t("method.description"),options:m,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:y=>p(()=>e.choose(y))}),k?.nationalEid?.afterPass==="continue"?he(R,{view:"EidContinueHint",i18n:r,provider:k.nationalEid.providerName,quiet:!0}):null]})}i(be,"MethodChoice");import{isValidNni as no,normalizeNni as ot}from"@sekyro/web";import{useId as ro,useState as ve}from"react";import{Fragment as so,jsx as x,jsxs as X}from"react/jsx-runtime";function Ne({step:e,locale:t,strings:n,className:s,onError:a}){let r=b(t,n),{t:o}=r,[l,p]=ve(""),[m,k]=ve(!1),[y,f]=ve(null),S=ro(),w=e.attemptsExhausted,E=i(async C=>{k(!0),f(null);try{await C()}catch(d){f(G(d,r.strings)),a?.(d)}finally{k(!1)}},"run"),V=i(C=>{if(C.preventDefault(),e.source!=="typed"){E(()=>e.confirm());return}let d=ot(l);if(!/^\d{10}$/.test(d))return f("population.invalid");if(!no(d))return f("population.reason_nni_invalid");E(()=>e.submitNni(d))},"onSubmit"),L=pe(r,e.attemptsRemaining,w),N=X(so,{children:[e.reason==="registry_unavailable"?X(v,{tone:"warning",children:[x("span",{children:o("population.reason_registry_unavailable")}),x("span",{children:L})]}):null,e.reason==="nni_not_found"&&e.canUseDocument?X(v,{tone:"warning",children:[x("span",{children:o("population.reason_nni_not_found_or_document")}),x("span",{children:L}),x(h,{kind:"ghost",disabled:m,onClick:()=>{E(()=>e.useDocument())},children:o("population.useDocument")})]}):null,e.reason==="nni_not_found"&&!e.canUseDocument||e.reason==="nni_invalid"?X(v,{tone:"danger",children:[x("span",{children:o(e.reason==="nni_not_found"?"population.reason_nni_not_found":"population.reason_nni_invalid")}),x("span",{children:L})]}):null,w&&e.reason===void 0?x(v,{tone:"danger",children:x("span",{children:L})}):null,y!==null?x(v,{tone:"danger",children:x("span",{children:o(y)})}):null]}),[F,D,u]=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 X("form",{className:`sekyro-step${s?` ${s}`:""}`,"aria-labelledby":S,onSubmit:V,noValidate:!0,children:[x(K,{id:S,title:o(F),lead:o(D)}),N,e.source==="typed"?X("div",{className:"sekyro-field",children:[x("label",{className:"sekyro-label",htmlFor:`${S}-nni`,children:o("population.label")}),x("input",{id:`${S}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${S}-nni-help`,"aria-invalid":y==="population.invalid"||y==="population.reason_nni_invalid"||void 0,onChange:C=>{f(null),p(ot(C.target.value).replace(/\D/g,"").slice(0,10))}}),x("span",{id:`${S}-nni-help`,className:"sekyro-help",children:o("population.helper")})]}):null,x(z,{children:w?null:x(h,{type:"submit",full:!0,disabled:m,"aria-busy":m||void 0,children:o(u)})})]})}i(Ne,"NniEntry");import{acceptedIssuers as uo,acceptedTypesFor as mo,warmDocumentCapture as fo}from"@sekyro/web";import{lazy as yo,Suspense as ko,useEffect as So,useMemo as go,useState as at}from"react";import{acceptedIssuers as io,acceptedTypesFor as Ce}from"@sekyro/web";import{useEffect as nt,useId as ao,useMemo as rt,useState as we}from"react";import{jsx as _,jsxs as Z}from"react/jsx-runtime";var st=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),lo=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),co=220;function po(e,t){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(r=>({code:r,name:n?.of(r)??r})),a=new Intl.Collator(e);return s.sort((r,o)=>r.code==="MR"?-1:o.code==="MR"?1:a.compare(r.name,o.name))}i(po,"countryNames");function it({step:e,i18n:t,issuer:n,onPicked:s}){let{t:a,locale:r}=t,o=rt(()=>io(e.documents),[e.documents]),l=rt(()=>po(r,o),[r,o]),p=o.length===1?o[0]:null,[m,k]=we(n??p),[y,f]=we(""),[S,w]=we(null),E=ao(),V=p===null?[]:Ce(e.documents,p),L=p!==null&&V.length===1?V[0]:null;nt(()=>{p!==null&&L!==null&&e.selectDocument(p,L)},[p,L]);let N=i((u,C)=>{e.selectDocument(u,C),s?.()},"pick"),F=i(u=>{let C=Ce(e.documents,u);C.length===1?N(u,C[0]):k(u)},"chooseIssuer");if(nt(()=>{if(S===null||m===null)return;let u=setTimeout(()=>N(m,S),co);return()=>clearTimeout(u)},[S]),L!==null)return null;if(m===null){let u=st(y.trim()),C=u===""?l:l.filter(d=>st(d.name).includes(u)||d.code.toLowerCase()===u);return Z("section",{className:"sekyro-step",children:[_(K,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),Z("div",{className:"sekyro-field",children:[_("label",{className:"sekyro-label",htmlFor:E,children:a("doc.countryLabel")}),_("input",{id:E,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:y,onChange:d=>f(d.target.value)})]}),C.length===0?_("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):_("ul",{className:"sekyro-rows",children:C.map(d=>_("li",{children:Z("button",{type:"button",className:"sekyro-row-btn",onClick:()=>F(d.code),children:[_("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:lo(d.code)}),d.name]})},d.code))}),_(z,{children:null})]})}let D=Ce(e.documents,m);return Z("section",{className:"sekyro-step",children:[_(K,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),_("div",{className:"sekyro-choices",children:D.map(u=>Z("button",{type:"button",className:"sekyro-card","aria-pressed":S===u,disabled:S!==null&&S!==u,onClick:()=>w(u),children:[_($,{name:u==="passport"?"passport":"card"}),Z("span",{className:"sekyro-card__body",children:[_("span",{className:"sekyro-card__title",children:a(`doc.type.${u}`)}),_("span",{className:"sekyro-card__sub",children:a(`doc.sub.${u}`)})]}),_("span",{className:"sekyro-radio","aria-hidden":"true"})]},u))}),o.length>1?_("button",{type:"button",className:"sekyro-link",onClick:()=>{k(null),w(null)},children:a("native.doc.changeCountry")}):null,_(z,{children:null})]})}i(it,"DocumentPicker");import{jsx as W,jsxs as bo}from"react/jsx-runtime";var ho={load:i(()=>import("../document-capture-view-PT732PJ2.js"),"load")};function Pe({step:e,locale:t,strings:n,className:s,liveMrz:a}){let r=b(t,n),[o,l]=at(0),[p,m]=at(null),k=uo(e.documents).length>1,y=e.issuer!==null&&mo(e.documents,e.issuer).length>1,f=go(()=>yo(()=>ho.load().then(w=>({default:w.DocumentCaptureView}))),[o]);So(()=>{fo()},[]);let S=bo(v,{tone:"danger",children:[W("span",{children:r.t("errors.network_error")}),W(h,{kind:"ghost",onClick:()=>l(w=>w+1),children:r.t("doc.retryCamera")})]});return W("div",{className:s,children:e.documentType===null||e.issuer===null||p!==null?W(it,{step:e,i18n:r,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>m(null)}):W(O,{fallback:S,children:W(ko,{fallback:W("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:W(f,{step:e,i18n:r,...a!==void 0?{liveMrz:a}:{},...k?{onChangeCountry:i(()=>m("country"),"onChangeCountry")}:{},...y?{onChangeDocument:i(()=>m("document"),"onChangeDocument")}:{}})})},o)})}i(Pe,"DocumentCapture");import{warmPortraitCapture as vo}from"@sekyro/web";import{Component as No,lazy as Co,Suspense as wo,useEffect as Po,useMemo as xo,useState as _o}from"react";import{jsx as T,jsxs as _e}from"react/jsx-runtime";var Io={load:i(()=>import("../portrait-capture-view-HYOEOAF4.js"),"load")},Ee=class Ee extends No{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ee,"LoadBoundary");var xe=Ee;function Eo({step:e,i18n:t}){let{t:n}=t,s=se();return _e("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[T("h2",{ref:s,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?T("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?_e(v,{tone:"danger",children:[T("span",{children:n("portrait.uploadFailed")}),T(h,{kind:"ghost",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):T("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Eo,"MatchPhase");function Ie({step:e,locale:t,strings:n,className:s,assetBaseUrl:a}){let r=b(t,n),[o,l]=_o(0),p=xo(()=>Co(()=>Io.load().then(k=>({default:k.PortraitCaptureView}))),[o]);if(Po(()=>{e.phase==="capture"&&vo()},[e.phase]),e.phase==="match")return T("div",{className:s,children:T(Eo,{step:e,i18n:r})});let m=_e(v,{tone:"danger",children:[T("span",{children:r.t("errors.network_error")}),T(h,{kind:"ghost",onClick:()=>l(k=>k+1),children:r.t("portrait.retryCamera")})]});return T("div",{className:s,children:T(xe,{fallback:m,children:T(wo,{fallback:T("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:T(p,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{}})})},o)})}i(Ie,"PortraitCapture");import{useCallback as Te,useEffect as kt,useId as Wo,useRef as Re,useState as ne}from"react";var A={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{useId as Vo,useState as Lo}from"react";import{jsx as Ve,jsxs as lt}from"react/jsx-runtime";var To=["intro","data","processing","sharing","retention"];function ct({i18n:e}){let{t}=e,[n,s]=Lo(!1),a=Vo(),[r,o=""]=t("consent.short").split("{terms}");return lt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[lt("p",{className:"sekyro-text-muted",children:[r,Ve("button",{type:"button",className:"sekyro-link","aria-expanded":n,"aria-controls":a,onClick:()=>s(l=>!l),children:t("consent.termsLink")}),o]}),Ve("div",{id:a,hidden:!n,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:To.map(l=>Ve("p",{children:t(`consent.terms.${l}`)},l))})]})}i(ct,"ConsentNotice");function pt(e){let t=e.trim().split(/\s+/).filter(s=>s!=="");return(t.length>=2?[t[0],t[1]].map(s=>Array.from(s??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(pt,"initials");import{useSyncExternalStore as Ro}from"react";var ut=i(e=>({colors:{...e?A.dark:A.light},radius:A.radiusLg,fontFamily:A.font}),"brandTheme"),zr=ut(!1);function mt(e,t,n){let s=ie(e);if(n&&s.colors!==void 0){let{brand:a,brandFg:r}=s.colors;a!==void 0&&Bo(a,A.dark.bg)>=3?s.colors={brand:a,ring:a,...r!==void 0?{brandFg:r}:{}}:delete s.colors}return ae(ut(n),s,t)}i(mt,"verificationTheme");function ft(e){let t=Ro(Mo,Do,()=>!1);return e==="dark"||e==="system"&&t}i(ft,"useDarkScheme");var Ao="(prefers-color-scheme: dark)",yt=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Ao):null,"media"),Do=i(()=>yt()?.matches??!1,"prefersDark");function Mo(e){let t=yt();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(Mo,"subscribe");function Bo(e,t){let[n,s]=[dt(e),dt(t)];return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}i(Bo,"contrast");function dt(e){let t=[1,3,5].map(n=>{let s=Number.parseInt(e.slice(n,n+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(dt,"luminance");import{useEffect as Oo,useId as Fo,useState as Ho}from"react";import{jsx as M,jsxs as oe}from"react/jsx-runtime";var $o=new Set(["document_nni_mismatch","name_mismatch","birth_date_mismatch"]),Uo={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function Ko({outcome:e}){return oe("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[M("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),M("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),M("path",{className:"sekyro-outcome__glyph",d:Uo[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Ko,"OutcomeMark");function zo({label:e,id:t,copied:n}){let[s,a]=Ho(!1);return Oo(()=>{if(!s)return;let r=setTimeout(()=>a(!1),1600);return()=>clearTimeout(r)},[s]),oe("button",{type:"button",className:`sekyro-reference${s?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[M("span",{"aria-live":"polite",children:s?n:e}),M("bdi",{dir:"ltr",children:t}),M($,{name:"copy"})]})}i(zo,"ReferenceLine");function Le({step:e,locale:t,strings:n,className:s,onClose:a}){let r=b(t,n),{t:o}=r,l=Fo(),p=se(),m=e.context.orgName,k=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",y;switch(e.display){case"policy_stop":{let f=e.failureReason??"";if($o.has(f))y=o("session.result.detailsMismatch",{org:m});else if(f==="device_velocity_exceeded")y=o("session.result.deviceVelocity",{org:m});else{let S=Fe(f);y=S!==null?o(S,{org:m}):o("session.result.rejected.description")}break}case"cooldown":{let f=He(r.locale,e.retryAfter);y=f!==null?o(f.key,{time:f.time}):o("reasons.device_cooldown");break}case"platform_unsupported":y=o("result.platform_unsupported");break;case"attempts_exhausted":y=o("common.noAttemptsLeft");break;default:y=m!==""?o(`native.result.${k}`,{org:m}):o(`session.result.${k}.description`)}return oe("section",{className:`sekyro-result${s?` ${s}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[oe("div",{className:"sekyro-result__body",children:[M(Ko,{outcome:e.display==="cooldown"?"review":k}),oe("div",{className:"sekyro-heading",children:[M("h2",{id:l,ref:p,tabIndex:-1,className:"sekyro-text-body",children:o(`session.result.${k}.title`)}),M("p",{className:"sekyro-text-muted",children:y})]}),M(zo,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?M("div",{className:"sekyro-actions",children:M(h,{full:!0,onClick:a,children:m!==""?o("native.result.back",{org:m}):o("native.close")})}):null]})}i(Le,"VerificationResultScreen");import{Fragment as St,jsx as c,jsxs as U}from"react/jsx-runtime";function qo(e,t){let n=t?A.dark:A.light,s=t?A.roles.dark:A.roles.light,a=e.colors??{},r={},o=a.fg===n.fg&&a.surface===n.surface;return a.brand===n.brand&&a.surface===n.surface&&(r["--sekyro-color-brand-soft"]=s.brandSoft),o&&(r["--sekyro-color-line"]=s.line,r["--sekyro-color-line-subtle"]=s.lineSubtle,r["--sekyro-color-line-strong"]=s.lineStrong,r["--sekyro-color-sunken"]=s.sunken),a.fgMuted===n.fgMuted&&a.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=s.fgSubtle),e.fontFamily===A.font&&(r["--sekyro-font-display"]=A.fontDisplay),r}i(qo,"flowRoles");function Ae(e){let{verification:t,locale:n,strings:s,onStep:a,onResult:r}=e,{step:o,error:l}=fe(t);kt(()=>{o!==null&&a?.(o)},[o,a]),kt(()=>r===void 0?void 0:t.on("result",r),[t,r]);let p=ft(e.colorScheme??"light"),m=mt(o?.context.branding,e.theme,p),[k,y]=ne(!1),f=`sekyro-verification${p?" sekyro-verification--dark":""}${k?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,S=Re(e.onClose);S.current=e.onClose;let w=Re(o);w.current=o;let E=Te(()=>{let V=w.current;S.current?.(V?.kind==="result"?{reason:"finished",result:V.result}:{reason:"cancelled"})},[]);return c(le,{theme:m,className:f,children:c(te,{locale:n,...s!==void 0?{strings:s}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:qo(m,p),children:c(We.Provider,{value:y,children:c(ce.Provider,{value:e.onClose!==void 0?E:void 0,children:c(Go,{...e,step:o,error:l,immersive:k})})})})})})}i(Ae,"SekyroVerification");function Go(e){let{step:t,error:n,slots:s,immersive:a}=e,r=b(),{t:o}=r,[l,p]=ne(!1),[m,k]=ne(0),[y,f]=ne(null),S=Te((d,H)=>c(Xe,{start:d,context:H}),[]),w=Re(""),E=e.livenessProps?.slots?.stageOverlay,V=Te(d=>(d.guidance!==""&&!d.coached&&(w.current=d.guidance),c(Ze,{testId:"sekyro-capture-stage",video:c("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.guidance!==""?d.guidance:w.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:E?.(d.videoRef),...d.settled?{}:{onClose:i(()=>k(H=>H+1),"onClose")}})),[o,E]),L=Wo();if(n!==null)return c(me,{tone:"danger",children:c("span",{children:o(G(n,r.strings))})});if(t===null)return c("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o("common.loading")});let{context:N}=t,F=i(d=>{p(!0),d().finally(()=>p(!1))},"refresh"),D=s?.header??c(Qo,{context:N,headerId:L,end:s?.headerEnd}),u,C=y===t.key&&t.context.switchable!==void 0;if(C)u=c(R,{view:"LaneChoiceView",i18n:r,step:t,onClose:()=>f(null)});else switch(t.kind){case"phone_otp":u=c(ye,{step:t});break;case"email_otp":u=c(Se,{step:t});break;case"method":u=c(be,{step:t});break;case"registry":u=c(Ne,{step:t});break;case"document":u=c(Pe,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,H={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??S},...m>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,...e.dir!==void 0?{dir:e.dir}:{},strings:r.strings,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{},...e.voice!==void 0?{voice:e.voice}:{},...e.onLivenessCaptured!==void 0?{onCaptured:e.onLivenessCaptured}:{}};u=c($e.Provider,{value:V,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(R,{view:"LivePhotoLiveness",i18n:r,step:t,livenessProps:H,sekyroIntro:d===void 0},m):c(Ke,{...H},m)});break}case"portrait":u=U(St,{children:[t.retakeOnly?c(R,{view:"PortraitRetakeNotice",i18n:r,quiet:!0}):null,c(Ie,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":u=c(R,{view:"ContactChoiceView",i18n:r,step:t});break;case"choice":u=c(R,{view:"GenericChoiceView",i18n:r,step:t});break;case"identity_summary":u=c(R,{view:"IdentitySummaryView",i18n:r,step:t});break;case"mobile_required":u=e.handoffUrl!==void 0?c(R,{view:"HandoffView",i18n:r,url:e.handoffUrl,refresh:t.refresh}):U(me,{tone:"info",children:[c("strong",{children:o("handoff.title")}),c("span",{children:o("reasons.mobile_required")}),c(h,{kind:"ghost",disabled:l,onClick:()=>F(t.refresh),children:o("common.refresh")})]});break;case"processing":u=U("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[c("h2",{className:"sekyro-text-body",children:o("session.processing.title")}),c("p",{className:"sekyro-text-muted",children:o("session.processing.description")}),t.stalled?c(h,{kind:"ghost",disabled:l,onClick:()=>F(t.refresh),children:o("common.refresh")}):null]});break;case"eid":u=c(ge,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";u=U("section",{className:"sekyro-stack sekyro-stack--1",children:[c("h2",{className:"sekyro-text-body",children:o(d?"needsApp.title":"unsupported.title")}),c("p",{children:d?N.orgName!==""?o("needsApp.description",{org:N.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:N.orgName})})]});break}case"result":u=s?.result?.(t)??c(Yo,{step:t});break;default:{let d=t;u=null}}return U(St,{children:[a?null:D,!a&&t.kind!=="result"&&N.sections.length>1?c(Jo,{context:N,current:t.section,i18n:r}):null,!a&&!N.consentRecorded&&t.kind!=="result"?c(ct,{i18n:r}):null,c(qe,{pageKey:t.key,children:u}),!a&&!C&&t.kind!=="result"&&t.context.switchable!==void 0?c(R,{view:"LaneSwitch",i18n:r,step:t,onOpen:()=>f(t.key),quiet:!0},t.key):null,a?null:s?.footer!==void 0?s.footer:U("p",{className:"sekyro-footer",children:[c($,{name:"lock"}),o("shell.verifiedBy")]})]})}i(Go,"Body");function Yo({step:e}){return c(ce.Consumer,{children:t=>c(Le,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Yo,"ResultPage");function Qo({context:e,headerId:t,end:n}){let{t:s}=b(),[a,r]=ne(!1),o=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:s(e.returning?"returning.title":"session.title");return U("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[U("div",{className:"sekyro-org",children:[c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:o!==void 0?c("img",{className:"sekyro-org__logo",src:o,alt:"",onError:()=>r(!0)}):pt(e.orgName)}),U("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:l}),c("p",{className:"sekyro-org__sub",children:s("shell.subtitle")})]}),n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(ce.Consumer,{children:p=>p!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":s("native.close"),onClick:p,children:c($,{name:"close"})}):null})]}),e.returning?c("p",{className:"sekyro-text-muted",children:s("returning.description")}):null]})}i(Qo,"OrgHeader");function Jo({context:e,current:t,i18n:n}){let s=t===null?-1:e.sections.indexOf(t),a=e.progress,r=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,l)=>({id:o,state:l<s?"done":l===s?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:r.map(({id:o,state:l})=>c("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Jo,"SectionProgress");import{useEffect as Zo,useState as gt}from"react";var Xo=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function De(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Xo.test(t)}i(De,"isInAppBrowser");import{jsx as j}from"react/jsx-runtime";function jo(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(jo,"pageUrl");function en({hostedUrl:e,inAppBrowser:t,...n}){let[s,a]=gt(t===!0);Zo(()=>{t===void 0&&De()&&a(!0)},[t]);let[r,o]=gt(!1),l=n.handoffUrl??e??jo();return s&&!r?j(le,{theme:ae(ie(void 0),n.theme),...n.className!==void 0?{className:n.className}:{},children:j(te,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:j("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-stack sekyro-stack--4",children:j(tn,{url:l,onContinue:()=>o(!0)})})})}):j(Ae,{...n,...l!==""?{handoffUrl:l}:{}})}i(en,"SekyroFlow");function tn({url:e,onContinue:t}){let n=b();return j(R,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(tn,"Prompt");export{Pe as DocumentCapture,ge as EidStep,Se as EmailOtpStep,be as MethodChoice,Ne as NniEntry,ye as PhoneOtpStep,Ie as PortraitCapture,en as SekyroFlow,Ae as SekyroVerification,te as StepI18nProvider,Le as VerificationResultScreen,Nt as arSteps,Ct as enSteps,Pt as formatTemplate,wt as frSteps,De as isInAppBrowser,xt as resolveSekyroStrings,b as useStepI18n,fe as useVerificationStep};
|
|
2
|
+
import{a as st}from"../chunk-VRS7WSIK.js";import{a as B,d as ye,e as ke,f as he}from"../chunk-ZCAZDOMD.js";import{a as Xe}from"../chunk-EZ5TVL6P.js";import{a as et}from"../chunk-YY76AMUA.js";import{a as tt,b as ot,c as nt,d as rt}from"../chunk-7C3GZLJB.js";import{a as q}from"../chunk-PYAJMHZH.js";import{a as Ye,b as Ge,d as Qe,g as Je}from"../chunk-XZEX5KTU.js";import{b as We}from"../chunk-4U5FQY26.js";import{a as Y,b as G,c as Se,d as Ze,g as je}from"../chunk-WJW3SNXQ.js";import{a as ee}from"../chunk-RFCYXRRC.js";import{a as xt,b as It,c as Et,d as Vt,e as Lt,f as ae,g as v}from"../chunk-4CUPBFVB.js";import{a as N,b as ge}from"../chunk-RPQZH66I.js";import{a as b,g as Pt,i as _t,j as Ke,k as ze,l as qe,r as fe,s as j}from"../chunk-64PTFYXL.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as Tt,useState as it}from"react";function Ce(e){let[t,n]=it(()=>e?.currentStep?.()??null),[s,a]=it(null);return Tt(()=>{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 r=!0,o=e.on("step",l=>{r&&n(l)});return e.run().then(l=>{r&&n(c=>c??l)},l=>{r&&a(l)}),()=>{r=!1,o()}},[e]),{step:t,error:s}}i(Ce,"useVerificationStep");import{useEffect as Rt,useId as Mt,useRef as Dt,useState as be}from"react";import{Fragment as lt,jsx as h,jsxs as U}from"react/jsx-runtime";var at=i((e,t)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.max(0,Math.ceil(n/1e3)):0},"secondsUntil"),At=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Bt=["whatsapp","sms"],Ot=new Set(["otp_daily_cap_reached","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited"]),J="+222";function Ft(e){let t=e.replace(/[\s-]/g,""),n=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(n)?`+${n}`:null}i(Ft,"normalizedPhone");function Ht({id:e,label:t,value:n,onChange:s,placeholder:a}){let r=n.startsWith("+")&&!n.startsWith(J),o=r?n:n.slice(n.startsWith(J)?J.length:0).trim(),l=Dt(null);return Rt(()=>{let c=setTimeout(()=>l.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(c)},[]),U("div",{className:"sekyro-field",children:[h("label",{className:"sekyro-label",htmlFor:e,children:t}),U("div",{className:"sekyro-phone",dir:"ltr",children:[r?null:U("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[h("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:"🇲🇷"}),J]}),h("input",{ref:l,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...r?{}:{"aria-describedby":`${e}-dial`},placeholder:a,value:o,onChange:c=>{let u=c.target.value.replace(/[^\d +]/g,"");s(u.startsWith("+")?u:J+u.replace(/\D/g,""))}})]})]})}i(Ht,"PhoneField");function Ne({step:e,locale:t,strings:n,className:s,defaultPhone:a=J,onError:r}){let o=v(t,n),{t:l}=o,[c,u]=be(a),[k,f]=be(""),[m,y]=be(!1),[w,D]=be(null),T=e.phase==="verify",R=et(T),_=Mt(),$=i(async I=>{y(!0),D(null);try{await I()}catch(M){D(ee(M,o.strings)),r?.(M)}finally{y(!1)}},"run"),O=Bt.filter(I=>(e.channels??[]).includes(I)),S=Ft(c),P=!e.needsPhone||S!==null,g=i((I,M=!1)=>{$(()=>e.send({...e.needsPhone&&(!M||c!==a)?{phone:S??c}:{},...I!==void 0?{channel:I}:{}}))},"send"),de=i(I=>{$(()=>e.verify(I))},"submitCode"),ue=i(I=>{I.preventDefault(),T?de(k):O.length<=1&&P&&g(O[0])},"onSubmit"),F=at(e.codeExpiresAt,R),W=at(e.resendAvailableAt,R),X=T&&e.codeExpiresAt!==void 0&&F===0,C=i(I=>l(I==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[me,d]=l("otp.sentTo",{channel:C(e.channel)}).split("{number}"),x=e.reason==="otp_mismatch"?U(N,{tone:"danger",children:[h("span",{children:l("otp.reason_otp_mismatch")}),h("span",{children:ge(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Ot.has(e.reason)?h(N,{tone:"warning",children:h("span",{children:l(`otp.reason_${e.reason}`)})}):null,Z=U(lt,{children:[x,w!==null?h(N,{tone:"danger",children:h("span",{children:l(w)})}):null]});if(T){let I=O.length===0;return U("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":_,onSubmit:ue,noValidate:!0,children:[h(Y,{id:_,title:l("otp.verifyTitle"),lead:U(lt,{children:[me,h("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),d]})}),Z,U("div",{className:"sekyro-field",children:[h("label",{className:"sekyro-label",htmlFor:`${_}-code`,children:l("otp.codeLabel")}),h(Xe,{id:`${_}-code`,value:k,invalid:e.reason==="otp_mismatch",onChange:M=>{f(M),M.length===6&&k.length!==6&&!m&&!e.attemptsExhausted&&de(M)}}),h("span",{className:`sekyro-help sekyro-otp-expiry${X?" is-danger":""}`,"aria-hidden":!X||void 0,children:X?l("otp.expired"):l("otp.expiresIn",{time:At(F)})})]}),h("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:X?l("otp.expired"):""}),U(G,{children:[h(b,{type:"submit",full:!0,disabled:m||k.length!==6||e.attemptsExhausted,"aria-busy":m||void 0,children:l("otp.verify")}),I?h("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m||W>0,onClick:()=>g(void 0,!0),children:W>0?l("otp.resendIn",{seconds:W}):l("otp.resend")}):W>0?h("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:W})}):h("div",{className:"sekyro-resend-row",children:O.map(M=>h("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m,onClick:()=>g(M,!0),children:l("otp.resendBy",{channel:C(M)})},M))})]})]})}return U("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":_,onSubmit:ue,noValidate:!0,children:[h(Y,{id:_,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Z,e.needsPhone?h(Ht,{id:`${_}-phone`,label:l("otp.phoneLabel"),value:c,onChange:u,placeholder:l("otp.phonePlaceholder").replace(J,"").trim()}):h("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),h(G,{children:O.length>0?U("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[h("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),O.map((I,M)=>h(b,{kind:M===0?"primary":"ghost",full:!0,disabled:m||!P,"aria-busy":M===0&&m||void 0,onClick:()=>g(I),children:l("otp.sendBy",{channel:C(I)})},I))]}):h(b,{type:"submit",full:!0,disabled:m||!P,"aria-busy":m||void 0,children:l("otp.send")})})]})}i(Ne,"PhoneOtpStep");import{lazy as Ut,Suspense as Kt,useMemo as zt,useState as qt}from"react";import{Component as $t}from"react";var we=class we extends $t{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(we,"LoadBoundary");var z=we;import{jsx as te,jsxs as Yt}from"react/jsx-runtime";var Wt={load:i(()=>import("../email-otp-view-76T5QW7H.js"),"load")};function Pe({locale:e,strings:t,...n}){let s=v(e,t),[a,r]=qt(0),o=zt(()=>Ut(()=>Wt.load().then(c=>({default:c.EmailOtpView}))),[a]),l=Yt(N,{tone:"danger",children:[te("span",{children:s.t("errors.network_error")}),te(b,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return te(z,{fallback:l,children:te(Kt,{fallback:te("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:te(o,{...n,i18n:s})})},a)}i(Pe,"EmailOtpStep");import{lazy as Gt,Suspense as Qt,useMemo as Jt,useState as Xt}from"react";import{jsx as oe,jsxs as jt}from"react/jsx-runtime";var Zt={load:i(()=>import("../eid-view-4T7Y2NJC.js"),"load")};function _e({locale:e,strings:t,...n}){let s=v(e,t),[a,r]=Xt(0),o=Jt(()=>Gt(()=>Zt.load().then(c=>({default:c.EidView}))),[a]),l=jt(N,{tone:"danger",children:[oe("span",{children:s.t("errors.network_error")}),oe(b,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return oe(z,{fallback:l,children:oe(Qt,{fallback:oe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:oe(o,{...n,i18n:s})})},a)}i(_e,"EidStep");import{useMemo as io}from"react";import{lazy as eo,Suspense as to,useMemo as oo,useState as no}from"react";import{jsx as ne,jsxs as so}from"react/jsx-runtime";var ro={load:i(()=>import("../flow-views-LEW6T5UR.js"),"load")};function E({view:e,i18n:t,quiet:n,...s}){let[a,r]=no(0),o=oo(()=>eo(()=>ro.load().then(c=>({default:c[e]}))),[e,a]),l=so(N,{tone:"danger",children:[ne("span",{children:t.t("errors.network_error")}),ne(b,{kind:"ghost",onClick:()=>r(c=>c+1),children:t.t("common.retry")})]});return ne(z,{fallback:l,children:ne(to,{fallback:n===!0?null:ne("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:ne(o,{...s,i18n:t})})},a)}i(E,"Flow");import{jsx as xe,jsxs as ao}from"react/jsx-runtime";function Ie({step:e,locale:t,strings:n,className:s,onError:a}){let r=v(t,n),{busy:o,error:l,run:c}=nt(r,a),u=io(()=>e.choice.options.flatMap(f=>{let m=ot(f,r),y=tt[f.service];return m===null?[]:[{id:f.id,label:m,glyph:y&&xe(q,{name:y})}]}),[e.choice.options,r]),k=e.choice.options.find(f=>f.service==="national_eid");return ao("div",{className:s,children:[xe(Qe,{title:r.t("method.title"),description:r.t("method.description"),options:u,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:f=>c(()=>e.choose(f))}),k?.nationalEid?.afterPass==="continue"?xe(E,{view:"EidContinueHint",i18n:r,provider:k.nationalEid.providerName,quiet:!0}):null]})}i(Ie,"MethodChoice");import{isValidNni as lo,normalizeNni as pt}from"@sekyro/web";import{useId as po,useState as Ee}from"react";import{Fragment as co,jsx as V,jsxs as re}from"react/jsx-runtime";function Ve({step:e,locale:t,strings:n,className:s,onError:a}){let r=v(t,n),{t:o}=r,[l,c]=Ee(""),[u,k]=Ee(!1),[f,m]=Ee(null),y=po(),w=e.attemptsExhausted,D=i(async P=>{k(!0),m(null);try{await P()}catch(g){m(ee(g,r.strings)),a?.(g)}finally{k(!1)}},"run"),T=i(P=>{if(P.preventDefault(),e.source!=="typed"){D(()=>e.confirm());return}let g=pt(l);if(!/^\d{10}$/.test(g))return m("population.invalid");if(!lo(g))return m("population.reason_nni_invalid");D(()=>e.submitNni(g))},"onSubmit"),R=ge(r,e.attemptsRemaining,w),_=re(co,{children:[e.reason==="registry_unavailable"?re(N,{tone:"warning",children:[V("span",{children:o("population.reason_registry_unavailable")}),V("span",{children:R})]}):null,e.reason==="nni_not_found"&&e.canUseDocument?re(N,{tone:"warning",children:[V("span",{children:o("population.reason_nni_not_found_or_document")}),V("span",{children:R}),V(b,{kind:"ghost",disabled:u,onClick:()=>{D(()=>e.useDocument())},children:o("population.useDocument")})]}):null,e.reason==="nni_not_found"&&!e.canUseDocument||e.reason==="nni_invalid"?re(N,{tone:"danger",children:[V("span",{children:o(e.reason==="nni_not_found"?"population.reason_nni_not_found":"population.reason_nni_invalid")}),V("span",{children:R})]}):null,w&&e.reason===void 0?V(N,{tone:"danger",children:V("span",{children:R})}):null,f!==null?V(N,{tone:"danger",children:V("span",{children:o(f)})}):null]}),[$,O,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 re("form",{className:`sekyro-step${s?` ${s}`:""}`,"aria-labelledby":y,onSubmit:T,noValidate:!0,children:[V(Y,{id:y,title:o($),lead:o(O)}),_,e.source==="typed"?re("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:`${y}-nni`,children:o("population.label")}),V("input",{id:`${y}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${y}-nni-help`,"aria-invalid":f==="population.invalid"||f==="population.reason_nni_invalid"||void 0,onChange:P=>{m(null),c(pt(P.target.value).replace(/\D/g,"").slice(0,10))}}),V("span",{id:`${y}-nni-help`,className:"sekyro-help",children:o("population.helper")})]}):null,V(G,{children:w?null:V(b,{type:"submit",full:!0,disabled:u,"aria-busy":u||void 0,children:o(S)})})]})}i(Ve,"NniEntry");import{acceptedIssuers as ho,acceptedTypesFor as So,warmDocumentCapture as go}from"@sekyro/web";import{lazy as bo,Suspense as vo,useEffect as Co,useMemo as No,useState as ft}from"react";import{acceptedIssuers as uo,acceptedTypesFor as Le}from"@sekyro/web";import{useEffect as ct,useId as mo,useMemo as dt,useState as Te}from"react";import{jsx as L,jsxs as se}from"react/jsx-runtime";var ut=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),fo=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),yo=220;function ko(e,t){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(r=>({code:r,name:n?.of(r)??r})),a=new Intl.Collator(e);return s.sort((r,o)=>r.code==="MR"?-1:o.code==="MR"?1:a.compare(r.name,o.name))}i(ko,"countryNames");function mt({step:e,i18n:t,issuer:n,onPicked:s}){let{t:a,locale:r}=t,o=dt(()=>uo(e.documents),[e.documents]),l=dt(()=>ko(r,o),[r,o]),c=o.length===1?o[0]:null,[u,k]=Te(n??c),[f,m]=Te(""),[y,w]=Te(null),D=mo(),T=c===null?[]:Le(e.documents,c),R=c!==null&&T.length===1?T[0]:null;ct(()=>{c!==null&&R!==null&&e.selectDocument(c,R)},[c,R]);let _=i((S,P)=>{e.selectDocument(S,P),s?.()},"pick"),$=i(S=>{let P=Le(e.documents,S);P.length===1?_(S,P[0]):k(S)},"chooseIssuer");if(ct(()=>{if(y===null||u===null)return;let S=setTimeout(()=>_(u,y),yo);return()=>clearTimeout(S)},[y]),R!==null)return null;if(u===null){let S=ut(f.trim()),P=S===""?l:l.filter(g=>ut(g.name).includes(S)||g.code.toLowerCase()===S);return se("section",{className:"sekyro-step",children:[L(Y,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),se("div",{className:"sekyro-field",children:[L("label",{className:"sekyro-label",htmlFor:D,children:a("doc.countryLabel")}),L("input",{id:D,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:f,onChange:g=>m(g.target.value)})]}),P.length===0?L("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):L("ul",{className:"sekyro-rows",children:P.map(g=>L("li",{children:se("button",{type:"button",className:"sekyro-row-btn",onClick:()=>$(g.code),children:[L("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:fo(g.code)}),g.name]})},g.code))}),L(G,{children:null})]})}let O=Le(e.documents,u);return se("section",{className:"sekyro-step",children:[L(Y,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),L("div",{className:"sekyro-choices",children:O.map(S=>se("button",{type:"button",className:"sekyro-card","aria-pressed":y===S,disabled:y!==null&&y!==S,onClick:()=>w(S),children:[L(q,{name:S==="passport"?"passport":"card"}),se("span",{className:"sekyro-card__body",children:[L("span",{className:"sekyro-card__title",children:a(`doc.type.${S}`)}),L("span",{className:"sekyro-card__sub",children:a(`doc.sub.${S}`)})]}),L("span",{className:"sekyro-radio","aria-hidden":"true"})]},S))}),o.length>1?L("button",{type:"button",className:"sekyro-link",onClick:()=>{k(null),w(null)},children:a("native.doc.changeCountry")}):null,L(G,{children:null})]})}i(mt,"DocumentPicker");import{jsx as Q,jsxs as Po}from"react/jsx-runtime";var wo={load:i(()=>import("../document-capture-view-2XBWIX6K.js"),"load")};function Re({step:e,locale:t,strings:n,className:s,liveMrz:a}){let r=v(t,n),[o,l]=ft(0),[c,u]=ft(null),k=ho(e.documents).length>1,f=e.issuer!==null&&So(e.documents,e.issuer).length>1,m=No(()=>bo(()=>wo.load().then(w=>({default:w.DocumentCaptureView}))),[o]);Co(()=>{go()},[]);let y=Po(N,{tone:"danger",children:[Q("span",{children:r.t("errors.network_error")}),Q(b,{kind:"ghost",onClick:()=>l(w=>w+1),children:r.t("doc.retryCamera")})]});return Q("div",{className:s,children:e.documentType===null||e.issuer===null||c!==null?Q(mt,{step:e,i18n:r,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>u(null)}):Q(z,{fallback:y,children:Q(vo,{fallback:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:Q(m,{step:e,i18n:r,liveMrz:a,...k?{onChangeCountry:i(()=>u("country"),"onChangeCountry")}:{},...f?{onChangeDocument:i(()=>u("document"),"onChangeDocument")}:{}})})},o)})}i(Re,"DocumentCapture");import{warmPortraitCapture as _o}from"@sekyro/web";import{Component as xo,lazy as Io,Suspense as Eo,useEffect as Vo,useMemo as Lo,useState as To}from"react";import{jsx as A,jsxs as De}from"react/jsx-runtime";var Ro={load:i(()=>import("../portrait-capture-view-GORALODC.js"),"load")},Be=class Be extends xo{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Be,"LoadBoundary");var Me=Be;function Mo({step:e,i18n:t}){let{t:n}=t,s=j();return De("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[A("h2",{ref:s,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?A("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?De(N,{tone:"danger",children:[A("span",{children:n("portrait.uploadFailed")}),A(b,{kind:"ghost",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):A("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Mo,"MatchPhase");function Ae({step:e,locale:t,strings:n,className:s,assetBaseUrl:a}){let r=v(t,n),[o,l]=To(0),c=Lo(()=>Io(()=>Ro.load().then(k=>({default:k.PortraitCaptureView}))),[o]);if(Vo(()=>{e.phase==="capture"&&_o()},[e.phase]),e.phase==="match")return A("div",{className:s,children:A(Mo,{step:e,i18n:r})});let u=De(N,{tone:"danger",children:[A("span",{children:r.t("errors.network_error")}),A(b,{kind:"ghost",onClick:()=>l(k=>k+1),children:r.t("portrait.retryCamera")})]});return A("div",{className:s,children:A(Me,{fallback:u,children:A(Eo,{fallback:A("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:A(c,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{}})})},o)})}i(Ae,"PortraitCapture");import{cameraUnavailableCauseOf as Jo}from"@sekyro/web";import{useCallback as pe,useEffect as Nt,useId as Xo,useRef as He,useState as ce}from"react";import{useId as Do,useState as Ao}from"react";import{jsx as ve,jsxs as yt}from"react/jsx-runtime";var Bo=["intro","data","processing","sharing","retention"];function kt({i18n:e,purpose:t="identity"}){let{t:n}=e,[s,a]=Ao(!1),r=Do(),[o,l=""]=n("consent.short").split("{terms}");return yt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[yt("p",{className:"sekyro-text-muted",children:[o,ve("button",{type:"button",className:"sekyro-link","aria-expanded":s,"aria-controls":r,onClick:()=>a(c=>!c),children:n("consent.termsLink")}),l]}),ve("div",{id:r,hidden:!s,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?ve(E,{view:"HumanConsentTerms",i18n:e,quiet:!0}):Bo.map(c=>ve("p",{children:n(`consent.terms.${c}`)},c))})]})}i(kt,"ConsentNotice");function ht(e){let t=e.trim().split(/\s+/).filter(s=>s!=="");return(t.length>=2?[t[0],t[1]].map(s=>Array.from(s??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(ht,"initials");import{useSyncExternalStore as Oo}from"react";var gt=i(e=>({colors:{...e?B.dark:B.light},radius:B.radiusLg,fontFamily:B.font}),"brandTheme"),Xr=gt(!1);function bt(e,t,n){let s=ye(e);if(n&&s.colors!==void 0){let{brand:a,brandFg:r}=s.colors;a!==void 0&&Uo(a,B.dark.bg)>=3?s.colors={brand:a,ring:a,...r!==void 0?{brandFg:r}:{}}:delete s.colors}return ke(gt(n),s,t)}i(bt,"verificationTheme");function vt(e){let t=Oo($o,Ho,()=>!1);return e==="dark"||e==="system"&&t}i(vt,"useDarkScheme");var Fo="(prefers-color-scheme: dark)",Ct=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Fo):null,"media"),Ho=i(()=>Ct()?.matches??!1,"prefersDark");function $o(e){let t=Ct();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i($o,"subscribe");function Uo(e,t){let[n,s]=[St(e),St(t)];return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}i(Uo,"contrast");function St(e){let t=[1,3,5].map(n=>{let s=Number.parseInt(e.slice(n,n+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(St,"luminance");import{useEffect as Ko,useId as zo,useState as qo}from"react";import{jsx as H,jsxs as le}from"react/jsx-runtime";var Wo=new Set(["document_nni_mismatch","name_mismatch","birth_date_mismatch"]),Yo={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function Go({outcome:e}){return le("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[H("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),H("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),H("path",{className:"sekyro-outcome__glyph",d:Yo[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Go,"OutcomeMark");function Qo({label:e,id:t,copied:n}){let[s,a]=qo(!1);return Ko(()=>{if(!s)return;let r=setTimeout(()=>a(!1),1600);return()=>clearTimeout(r)},[s]),le("button",{type:"button",className:`sekyro-reference${s?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[H("span",{"aria-live":"polite",children:s?n:e}),H("bdi",{dir:"ltr",children:t}),H(q,{name:"copy"})]})}i(Qo,"ReferenceLine");function Oe({step:e,locale:t,strings:n,className:s,onClose:a}){let r=v(t,n),{t:o}=r,l=zo(),c=j(),u=e.context.orgName,k=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",f;switch(e.display){case"policy_stop":{let m=e.failureReason??"";if(Wo.has(m))f=o("session.result.detailsMismatch",{org:u});else if(m==="device_velocity_exceeded")f=o("session.result.deviceVelocity",{org:u});else if(m==="capture_tampered")f=o("session.result.deviceStop");else if(m==="camera_unavailable")f=o("reasons.camera_unavailable",{org:u});else{let y=ze(m);f=y!==null?o(y,{org:u}):o("session.result.rejected.description")}break}case"cooldown":{let m=qe(r.locale,e.retryAfter);f=m!==null?o(m.key,{time:m.time}):o("reasons.device_cooldown");break}case"platform_unsupported":f=o("result.platform_unsupported");break;case"attempts_exhausted":f=o("common.noAttemptsLeft");break;default:f=u!==""?o(`native.result.${k}`,{org:u}):o(`session.result.${k}.description`)}return le("section",{className:`sekyro-result${s?` ${s}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[le("div",{className:"sekyro-result__body",children:[H(Go,{outcome:e.display==="cooldown"?"review":k}),le("div",{className:"sekyro-heading",children:[H("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:o(`session.result.${k}.title`)}),H("p",{className:"sekyro-text-muted",children:f})]}),H(Qo,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?H("div",{className:"sekyro-actions",children:H(b,{full:!0,onClick:a,children:u!==""?o("native.result.back",{org:u}):o("native.close")})}):null]})}i(Oe,"VerificationResultScreen");import{Fragment as Fe,jsx as p,jsxs as K}from"react/jsx-runtime";function Zo(e,t){let n=t?B.dark:B.light,s=t?B.roles.dark:B.roles.light,a=e.colors??{},r={},o=a.fg===n.fg&&a.surface===n.surface;return a.brand===n.brand&&a.surface===n.surface&&(r["--sekyro-color-brand-soft"]=s.brandSoft),o&&(r["--sekyro-color-line"]=s.line,r["--sekyro-color-line-subtle"]=s.lineSubtle,r["--sekyro-color-line-strong"]=s.lineStrong,r["--sekyro-color-sunken"]=s.sunken),a.fgMuted===n.fgMuted&&a.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=s.fgSubtle),e.fontFamily===B.font&&(r["--sekyro-font-display"]=B.fontDisplay),r}i(Zo,"flowRoles");function $e(e){let{verification:t,locale:n,strings:s,onStep:a,onResult:r}=e,{step:o,error:l}=Ce(t);Nt(()=>{o!==null&&a?.(o)},[o,a]),Nt(()=>r===void 0?void 0:t.on("result",r),[t,r]);let c=vt(e.colorScheme??"light"),u=bt(o?.context.branding,e.theme,c),[k,f]=ce(!1),m=`sekyro-verification${c?" sekyro-verification--dark":""}${k?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=He(e.onClose);y.current=e.onClose;let w=He(o);w.current=o;let D=pe(()=>{let T=w.current;y.current?.(T?.kind==="result"?{reason:"finished",result:T.result}:{reason:"cancelled"})},[]);return p(he,{theme:u,className:m,children:p(ae,{locale:n,...s!==void 0?{strings:s}:{},children:p("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Zo(u,c),children:p(Ze.Provider,{value:f,children:p(Se.Provider,{value:e.onClose!==void 0?D:void 0,children:p(en,{...e,step:o,error:l,immersive:k})})})})})})}i($e,"SekyroVerification");function jo({error:e,retry:t}){let{t:n}=v(),s=j();return K(fe,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:n(Ke(e.kind))}),e.retryable?p(b,{ref:s,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(jo,"CameraErrorNotice");function en(e){let{step:t,error:n,slots:s,immersive:a}=e,r=v(),{t:o}=r,[l,c]=ce(!1),[u,k]=ce(0),[f,m]=ce(null),y=t?.context.purpose??"identity",w=e.verification,D=y==="human"||t?.context.cameraUnavailableHandled===!0,T=w.reportCameraUnavailable!==void 0&&D?d=>w.reportCameraUnavailable?.(d)??Promise.resolve():void 0,R=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,_=e.handoffUrl,$=pe((d,x)=>T===void 0?void 0:p(E,{view:"NoCameraView",i18n:r,quiet:!0,cause:x,onRetry:d,...R?{onContinue:T}:{},..._!==void 0?{handoffUrl:_}:{}}),[r,w,D,R,_]),O=pe((d,x)=>p(rt,{start:d,context:x,human:y==="human",extra:x.canChooseFacing&&p(Ge,{value:x.facing,onChange:x.setFacing}),notice:x.permissionSettled&&x.permission==="denied"?$(d,"denied"):void 0}),[y,$]),S=pe((d,x)=>{let Z=Jo(d.kind);return(Z!==void 0?$(x,Z):void 0)??K(Fe,{children:[p(jo,{error:d,retry:x}),Z!==void 0&&_!==void 0?p(E,{view:"DesktopHandoffView",i18n:r,quiet:!0,url:_}):null]})},[$,_,r]),P=He(""),g=e.livenessProps?.slots?.stageOverlay,de=pe(d=>(d.guidance!==""&&!d.coached&&(P.current=d.guidance),p(st,{testId:"sekyro-capture-stage",video:p("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.guidance!==""?d.guidance:P.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:g?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>k(x=>x+1),"onClose")},end:d.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:d.switchCamera,"aria-label":o("capture.switchCamera"),children:p(We,{})})})),[o,g]),ue=Xo();if(n!==null)return p(fe,{tone:"danger",children:p("span",{children:o(ee(n,r.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o("common.loading")});let{context:F}=t,W=i(d=>{c(!0),d().finally(()=>c(!1))},"refresh"),X=s?.header??p(on,{context:F,headerId:ue,end:s?.headerEnd}),C,me=f===t.key&&t.context.switchable!==void 0;if(me)C=p(E,{view:"LaneChoiceView",i18n:r,step:t,onClose:()=>m(null)});else switch(t.kind){case"phone_otp":C=p(Ne,{step:t});break;case"email_otp":C=p(Pe,{step:t});break;case"method":C=p(Ie,{step:t});break;case"registry":C=p(Ve,{step:t});break;case"document":C=p(Re,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,x={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??O,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:S}:{}},...u>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:r.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};C=p(Ye.Provider,{value:de,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(E,{view:"LivePhotoLiveness",i18n:r,step:t,livenessProps:x,sekyroIntro:d===void 0},u):p(Je,{...x},u)});break}case"portrait":C=K(Fe,{children:[t.retakeOnly?p(E,{view:"PortraitRetakeNotice",i18n:r,quiet:!0}):null,p(Ae,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":C=p(E,{view:"ContactChoiceView",i18n:r,step:t});break;case"choice":C=p(E,{view:"GenericChoiceView",i18n:r,step:t});break;case"identity_summary":C=p(E,{view:"IdentitySummaryView",i18n:r,step:t});break;case"mobile_required":C=e.handoffUrl!==void 0?p(E,{view:"HandoffView",i18n:r,url:e.handoffUrl,refresh:t.refresh}):K(fe,{tone:"info",children:[p("strong",{children:o("handoff.title")}),p("span",{children:o("reasons.mobile_required")}),p(b,{kind:"ghost",disabled:l,onClick:()=>W(t.refresh),children:o("common.refresh")})]});break;case"processing":C=K("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:o("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:o("session.processing.description")}),t.stalled?p(b,{kind:"ghost",disabled:l,onClick:()=>W(t.refresh),children:o("common.refresh")}):null]});break;case"eid":C=p(_e,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";C=K("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:o(d?"needsApp.title":"unsupported.title")}),p("p",{children:d?F.orgName!==""?o("needsApp.description",{org:F.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:F.orgName})})]});break}case"result":C=s?.result?.(t)??p(tn,{step:t});break;default:{let d=t;C=null}}return K(Fe,{children:[a?null:X,!a&&t.kind!=="result"&&F.sections.length>1?p(nn,{context:F,current:t.section,i18n:r}):null,!a&&!F.consentRecorded&&t.kind!=="result"?p(kt,{i18n:r,purpose:F.purpose}):null,p(je,{pageKey:t.key,children:C}),!a&&!me&&t.kind!=="result"&&t.context.switchable!==void 0?p(E,{view:"LaneSwitch",i18n:r,step:t,onOpen:()=>m(t.key),quiet:!0},t.key):null,a?null:s?.footer!==void 0?s.footer:F.branding?.hideAttribution===!0?null:K("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(q,{name:"lock"}),o("shell.verifiedBy")]})]})}i(en,"Body");function tn({step:e}){return p(Se.Consumer,{children:t=>p(Oe,{step:e,...t!==void 0?{onClose:t}:{}})})}i(tn,"ResultPage");function on({context:e,headerId:t,end:n}){let{t:s}=v(),[a,r]=ce(!1),o=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:s(e.returning?"returning.title":"session.title");return K("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[K("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:o!==void 0?p("img",{className:"sekyro-org__logo",src:o,alt:"",onError:()=>r(!0)}):ht(e.orgName)}),K("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:l}),p("p",{className:"sekyro-org__sub",children:s(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?p("div",{className:"sekyro-org__end",children:n}):null,p(Se.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":s("native.close"),onClick:c,children:p(q,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:s("returning.description")}):null]})}i(on,"OrgHeader");function nn({context:e,current:t,i18n:n}){let s=t===null?-1:e.sections.indexOf(t),a=e.progress,r=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,l)=>({id:o,state:l<s?"done":l===s?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:r.map(({id:o,state:l})=>p("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(nn,"SectionProgress");import{useEffect as sn,useState as wt}from"react";var rn=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ue(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return rn.test(t)}i(Ue,"isInAppBrowser");import{jsx as ie}from"react/jsx-runtime";function an(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(an,"pageUrl");function ln({hostedUrl:e,inAppBrowser:t,...n}){let[s,a]=wt(t===!0);sn(()=>{t===void 0&&Ue()&&a(!0)},[t]);let[r,o]=wt(!1),l=n.handoffUrl??e??an();return s&&!r?ie(he,{theme:ke(ye(void 0),n.theme),...n.className!==void 0?{className:n.className}:{},children:ie(ae,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:ie("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-stack sekyro-stack--4",children:ie(pn,{url:l,onContinue:()=>o(!0)})})})}):ie($e,{...n,...l!==""?{handoffUrl:l}:{}})}i(ln,"SekyroFlow");function pn({url:e,onContinue:t}){let n=v();return ie(E,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(pn,"Prompt");export{Re as DocumentCapture,_e as EidStep,Pe as EmailOtpStep,Ie as MethodChoice,Ve as NniEntry,Ne as PhoneOtpStep,Ae as PortraitCapture,ln as SekyroFlow,$e as SekyroVerification,ae as StepI18nProvider,Oe as VerificationResultScreen,xt as arSteps,It as enSteps,Vt as formatTemplate,Et as frSteps,Ue as isInAppBrowser,Pt as loadSekyroLocale,Lt as resolveSekyroStrings,_t as retakeHintStringKey,v as useStepI18n,Ce as useVerificationStep};
|
package/dist/verification.css
CHANGED
|
@@ -142,6 +142,11 @@
|
|
|
142
142
|
font: var(--sekyro-type-flow-caption) var(--sekyro-font); color: var(--sekyro-color-fg-muted);
|
|
143
143
|
}
|
|
144
144
|
.sekyro-footer .sekyro-glyph { inline-size: 0.75rem; block-size: 0.75rem; }
|
|
145
|
+
/* D16: the attribution is a link to sekyro.ai: the muted caption (its contrast holds), underlined on hover, the
|
|
146
|
+
focus ring of every control. */
|
|
147
|
+
a.sekyro-footer { text-decoration: none; border-radius: 0.25rem; }
|
|
148
|
+
a.sekyro-footer:hover { text-decoration: underline; text-underline-offset: 0.2em; }
|
|
149
|
+
a.sekyro-footer:focus-visible { outline: 3px solid var(--sekyro-color-ring); outline-offset: 2px; }
|
|
145
150
|
.sekyro-glyph { inline-size: 1.25rem; block-size: 1.25rem; flex-shrink: 0; fill: none; }
|
|
146
151
|
|
|
147
152
|
/* ── Pages: one at a time, rising into place ───────────────────────────── */
|
|
@@ -485,8 +490,19 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
|
|
|
485
490
|
|
|
486
491
|
/* ── The face camera (face-camera.tsx): the oval cut from the ink, its ring of ticks and the running light ── */
|
|
487
492
|
.sekyro-fc-video { transform: scaleX(-1); }
|
|
493
|
+
/* The back camera (assisted capture) is not a selfie: no mirror. */
|
|
494
|
+
.sekyro-fc-video.is-rear { transform: none; }
|
|
488
495
|
.sekyro-fc-still { animation: sekyro-fade 250ms ease-out both; }
|
|
489
496
|
.sekyro-fc-scrim { fill: var(--sekyro-color-stage); fill-opacity: 0.82; }
|
|
497
|
+
/* Liveness v7 §4.4: while a screen-ramp pastel fills the viewport, the white instruction and note sit on a band of the
|
|
498
|
+
* scrim's ink at the scrim's opacity (white keeps at least 4.5:1 over the brightest pastel: screen-ramp-contrast.test). */
|
|
499
|
+
.sekyro-fc[data-ramp] .sekyro-lm-line,
|
|
500
|
+
.sekyro-fc[data-ramp] .sekyro-lm-note {
|
|
501
|
+
background: color-mix(in srgb, var(--sekyro-color-stage) 82%, transparent);
|
|
502
|
+
border-radius: 999px;
|
|
503
|
+
padding-block: 0.25rem;
|
|
504
|
+
padding-inline: 1rem;
|
|
505
|
+
}
|
|
490
506
|
.sekyro-fc-rim { fill: none; stroke: color-mix(in srgb, var(--sekyro-color-on-stage) 35%, transparent); stroke-width: 1.5; }
|
|
491
507
|
.sekyro-fc-ticks { fill: none; stroke: color-mix(in srgb, var(--sekyro-color-on-stage) 28%, transparent); stroke-width: 3; stroke-linecap: round; }
|
|
492
508
|
.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)); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/react",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.9",
|
|
4
4
|
"description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"strings:steps": "node scripts/gen-step-strings.mjs"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@sekyro/web": "^0.1.0-rc.
|
|
77
|
+
"@sekyro/web": "^0.1.0-rc.11 || ^0.2.0-rc.0",
|
|
78
78
|
"react": ">=18.2",
|
|
79
79
|
"react-dom": ">=18.2"
|
|
80
80
|
},
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "react",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/react@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.9",
|
|
101
|
+
"bom-ref": "@sekyro/react@0.1.0-rc.9",
|
|
102
102
|
"description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/react@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/react@0.1.0-rc.9?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-react",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"components": [],
|
|
148
148
|
"dependencies": [
|
|
149
149
|
{
|
|
150
|
-
"ref": "@sekyro/react@0.1.0-rc.
|
|
150
|
+
"ref": "@sekyro/react@0.1.0-rc.9"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|
package/dist/chunk-3MBJZSJL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as C}from"./chunk-Q232JYNO.js";import{e as S,f as I}from"./chunk-63NUMQST.js";import{a as m}from"./chunk-4RUZQW5T.js";import{useLayoutEffect as L,useRef as P,useState as z}from"react";import{jsx as s,jsxs as y}from"react/jsx-runtime";var x=72;function F(n,r){let t=n*.72,o=t*1.32;return{cx:n/2,cy:(r-o)/2.1+o/2,a:t/2,b:o/2}}m(F,"faceOval");function H({cx:n,cy:r,a:t,b:o}){return Array.from({length:x},(M,f)=>{let p=-Math.PI/2+f/x*2*Math.PI,c=Math.cos(p),d=Math.sin(p),h=n+t*c,k=r+o*d,v=Math.hypot(o*c,t*d),u=o*c/v,a=t*d/v,l=m(e=>Math.round(e*10)/10,"r");return`M${l(h+u*16)} ${l(k+a*16)}L${l(h+u*28)} ${l(k+a*28)}`})}m(H,"ticks");function E({video:n,instruction:r,note:t,busy:o,progress:M,still:f,overlay:p,onClose:c,closeLabel:d,live:h=!0,children:k,testId:v}){S(h);let u=P(null),[a,l]=z({w:0,h:0});L(()=>{let b=u.current;if(b===null)return;let R=m(()=>l({w:b.clientWidth,h:b.clientHeight}),"measure");if(R(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(R);return O.observe(b),()=>O.disconnect()},[]);let e=F(a.w,a.h),$=a.w>0?H(e):[],N=Math.round(Math.min(1,Math.max(0,M))*x),w=e.cy-e.b,i=Math.max(e.a,e.b)+40,g=70*Math.PI/180;return s("section",{className:"sekyro-lm sekyro-fc","aria-label":r,"data-testid":v,children:y("div",{ref:u,className:"sekyro-lm-stage",children:[n,f?s("img",{className:"sekyro-lm-video sekyro-fc-still",src:f,alt:""}):null,p,a.w>0?y("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${a.w} ${a.h}`,"aria-hidden":"true",focusable:"false",children:[y("defs",{children:[y("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-i*Math.sin(g),y1:e.cy,x2:e.cx,y2:e.cy,children:[s("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),s("stop",{offset:"1",className:"sekyro-fc-fade"})]}),s("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:a.w,height:a.h,children:s("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-i*Math.sin(g)} ${e.cy-i*Math.cos(g)}A${i} ${i} 0 0 1 ${e.cx} ${e.cy-i}Z`,fill:"url(#sekyro-fc-fade)"})})]}),s("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${a.w}V${a.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),s("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),s("path",{className:"sekyro-fc-ticks",d:$.join("")}),N>0?s("path",{className:"sekyro-fc-ticks is-done",d:$.slice(0,N).join("")}):null,N<x?s("path",{className:"sekyro-fc-ticks is-light",d:$.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,s("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:w-80},children:s("div",{role:"status","aria-live":"polite",children:s(I,{swapKey:r,className:"sekyro-lm-line",children:r})})}),t?y("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:w+2*e.b+48},children:[o?s("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,s("span",{children:t})]}):null,y("div",{className:"sekyro-lm-controls",children:[s("div",{className:"sekyro-lm-bar",children:c!==void 0?s("button",{type:"button",className:"sekyro-glass","aria-label":d,onClick:c,children:s(C,{name:"close"})}):null}),k]})]})})}m(E,"FaceCamera");export{E as a};
|