@sekyro/react 0.1.0-rc.5 → 0.1.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/LICENSE +25 -16
  3. package/README.md +64 -20
  4. package/dist/chunk-3MBJZSJL.js +2 -0
  5. package/dist/chunk-4INDRENU.js +2 -0
  6. package/dist/chunk-4RUZQW5T.js +2 -0
  7. package/dist/chunk-5SVCGLYS.js +2 -0
  8. package/dist/chunk-63NUMQST.js +2 -0
  9. package/dist/chunk-65JA6YKG.js +2 -0
  10. package/dist/chunk-ADMDZLPM.js +2 -0
  11. package/dist/chunk-AMOZXMUP.js +2 -0
  12. package/dist/chunk-B43EDVOK.js +2 -0
  13. package/dist/chunk-BENNJ4GV.js +2 -0
  14. package/dist/chunk-P2LX7BBE.js +2 -0
  15. package/dist/chunk-Q232JYNO.js +2 -0
  16. package/dist/chunk-QZAPVO6F.js +2 -0
  17. package/dist/chunk-YUNPD6ZB.js +2 -0
  18. package/dist/document-capture-view-PT732PJ2.js +2 -0
  19. package/dist/eid-view-RFSXIECL.js +2 -0
  20. package/dist/email-otp-view-3WZH74UT.js +2 -0
  21. package/dist/flow-views-N6KYXL4N.js +2 -0
  22. package/dist/fonts/Cairo-OFL.txt +93 -0
  23. package/dist/fonts/Geist-OFL.txt +93 -0
  24. package/dist/fonts/Inter-OFL.txt +93 -0
  25. package/dist/fonts/SekyroCairo-Bold.woff2 +0 -0
  26. package/dist/fonts/SekyroCairo-Regular.woff2 +0 -0
  27. package/dist/fonts/SekyroCairo-SemiBold.woff2 +0 -0
  28. package/dist/fonts/SekyroGeist-Bold.woff2 +0 -0
  29. package/dist/fonts/SekyroGeist-SemiBold.woff2 +0 -0
  30. package/dist/fonts/SekyroInter-Medium.woff2 +0 -0
  31. package/dist/fonts/SekyroInter-Regular.woff2 +0 -0
  32. package/dist/fonts/SekyroInter-SemiBold.woff2 +0 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.cts +5 -437
  35. package/dist/index.d.ts +5 -437
  36. package/dist/index.js +1 -1
  37. package/dist/portrait-capture-view-HYOEOAF4.js +2 -0
  38. package/dist/theme-BpOuzcWh.d.cts +456 -0
  39. package/dist/theme-BpOuzcWh.d.ts +456 -0
  40. package/dist/verification/index.cjs +2 -0
  41. package/dist/verification/index.d.cts +528 -0
  42. package/dist/verification/index.d.ts +528 -0
  43. package/dist/verification/index.js +2 -0
  44. package/dist/verification.css +561 -0
  45. package/package.json +20 -6
  46. package/sbom.cdx.json +5 -5
@@ -0,0 +1,528 @@
1
+ import { S as Strings, a as SekyroLocale, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-BpOuzcWh.js';
2
+ import * as react from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
5
+
6
+ /** Copy of the `@sekyro/react/verification` steps (hosted catalog paths; the optional keys load with their step). */
7
+ interface StepStrings {
8
+ "session.title": string;
9
+ "session.requestedBy": string;
10
+ "returning.requestedBy": string;
11
+ "consent.notice": string;
12
+ "consent.details": string;
13
+ "consent.terms.intro": string;
14
+ "consent.terms.data": string;
15
+ "consent.terms.processing": string;
16
+ "consent.terms.sharing": string;
17
+ "consent.terms.retention": string;
18
+ "otp.sendTitle": string;
19
+ "otp.sendDescription": string;
20
+ "otp.prefilledNotice": string;
21
+ "otp.phoneLabel": string;
22
+ "otp.phoneHelper": string;
23
+ "otp.phonePlaceholder": string;
24
+ "otp.send": string;
25
+ "otp.channelSms": string;
26
+ "otp.channelWhatsapp": string;
27
+ "otp.verifyTitle": string;
28
+ "otp.verifyDescription": string;
29
+ "otp.sentTo": string;
30
+ "otp.codeLabel": string;
31
+ "otp.codeHelper": string;
32
+ "otp.verify": string;
33
+ "otp.resend": string;
34
+ "otp.resendIn": string;
35
+ "otp.expiresIn": string;
36
+ "otp.expired": string;
37
+ "otp.reason_otp_mismatch": string;
38
+ "otp.reason_otp_expired": string;
39
+ "otp.reason_otp_send_failed": string;
40
+ "otp.chooseChannel": string;
41
+ "otp.sendBy": string;
42
+ "otp.resendBy": string;
43
+ "otp.reason_otp_channel_unavailable": string;
44
+ "otp.reason_otp_destination_not_allowed": string;
45
+ "otp.reason_otp_destination_unknown": string;
46
+ "otp.reason_otp_rate_limited": string;
47
+ "session.steps.population.title": string;
48
+ "session.steps.population.description": string;
49
+ "population.label": string;
50
+ "population.helper": string;
51
+ "population.placeholder": string;
52
+ "population.submit": string;
53
+ "population.invalid": string;
54
+ "population.reason_registry_unavailable": string;
55
+ "population.reason_nni_not_found": string;
56
+ "population.reason_nni_invalid": string;
57
+ "population.bound.description": string;
58
+ "population.bound.confirm": string;
59
+ "population.reason_nni_not_found_or_document": string;
60
+ "population.useDocument": string;
61
+ "population.fromDocument.title": string;
62
+ "population.fromDocument.description": string;
63
+ "population.fromDocument.continue": string;
64
+ "session.steps.doc.titleRecto": string;
65
+ "session.steps.doc.titleVerso": string;
66
+ "session.steps.doc.description": string;
67
+ "doc.pickTitle": string;
68
+ "doc.pickDescription": string;
69
+ "doc.pickLabel": string;
70
+ "doc.startScan": string;
71
+ "doc.titlePassport": string;
72
+ "doc.reason_side_missing": string;
73
+ "doc.reason_unreadable": string;
74
+ "doc.process_failed": string;
75
+ "doc.uploading": string;
76
+ "doc.cameraBlocked": string;
77
+ "doc.cameraBlockedHint": string;
78
+ "doc.retryCamera": string;
79
+ "doc.holdUpright": string;
80
+ "dcv2.sensing": string;
81
+ "dcv2.too_far": string;
82
+ "dcv2.too_close": string;
83
+ "dcv2.edge_clipped": string;
84
+ "dcv2.wrong_shape": string;
85
+ "dcv2.tilted": string;
86
+ "dcv2.too_dark": string;
87
+ "dcv2.too_bright": string;
88
+ "dcv2.blurry": string;
89
+ "dcv2.focus_far": string;
90
+ "dcv2.glare": string;
91
+ "dcv2.hold_still": string;
92
+ "dcv2.processing": string;
93
+ "dcv2.side_captured": string;
94
+ "dcv2.captured": string;
95
+ "session.processing.title": string;
96
+ "session.processing.description": string;
97
+ "handoff.title": string;
98
+ "session.result.approved.title": string;
99
+ "session.result.approved.description": string;
100
+ "session.result.review.title": string;
101
+ "session.result.review.description": string;
102
+ "session.result.rejected.title": string;
103
+ "session.result.rejected.description": string;
104
+ "session.result.expired.title": string;
105
+ "session.result.expired.description": string;
106
+ "session.result.detailsMismatch": string;
107
+ "session.result.deviceVelocity": string;
108
+ "result.referenceLabel": string;
109
+ "common.loading": string;
110
+ "common.refresh": string;
111
+ "common.noAttemptsLeft": string;
112
+ "session.steps.portrait.title": string;
113
+ "session.steps.portrait.description": string;
114
+ "portrait.coach.no_face": string;
115
+ "portrait.coach.multiple_faces": string;
116
+ "portrait.coach.center": string;
117
+ "portrait.coach.too_close": string;
118
+ "portrait.coach.pose": string;
119
+ "portrait.coach.eyes": string;
120
+ "portrait.coach.mouth": string;
121
+ "portrait.coach.glare": string;
122
+ "portrait.coach.lighting": string;
123
+ "portrait.coach.lighting_side": string;
124
+ "portrait.coach.background": string;
125
+ "portrait.coach.resolution": string;
126
+ "portrait.coach.hold_still": string;
127
+ "portrait.coach.hold": string;
128
+ "portrait.criteria.face": string;
129
+ "portrait.criteria.framing": string;
130
+ "portrait.criteria.pose": string;
131
+ "portrait.criteria.eyes": string;
132
+ "portrait.criteria.mouth": string;
133
+ "portrait.criteria.glare": string;
134
+ "portrait.criteria.lighting": string;
135
+ "portrait.criteria.background": string;
136
+ "portrait.criteria.resolution": string;
137
+ "portrait.criteria.sharpness": string;
138
+ "portrait.report.pose": string;
139
+ "portrait.report.eyes": string;
140
+ "portrait.report.mouth": string;
141
+ "portrait.report.occlusion": string;
142
+ "portrait.report.glare": string;
143
+ "portrait.report.lighting": string;
144
+ "portrait.report.background": string;
145
+ "portrait.report.resolution": string;
146
+ "portrait.checksLabel": string;
147
+ "portrait.met": string;
148
+ "portrait.notMet": string;
149
+ "portrait.starting": string;
150
+ "portrait.taken": string;
151
+ "portrait.uploading": string;
152
+ "portrait.checking": string;
153
+ "portrait.retryTitle": string;
154
+ "portrait.reportTitle": string;
155
+ "portrait.retake": string;
156
+ "portrait.uploadFailed": string;
157
+ "portrait.sendAgain": string;
158
+ "portrait.matching": string;
159
+ "portrait.reviewTitle": string;
160
+ "portrait.reviewDescription": string;
161
+ "portrait.cameraBlocked": string;
162
+ "portrait.cameraBlockedHint": string;
163
+ "portrait.retryCamera": string;
164
+ "reasons.icao_pose": string;
165
+ "reasons.icao_eyes": string;
166
+ "reasons.icao_mouth": string;
167
+ "reasons.icao_occlusion": string;
168
+ "reasons.icao_lighting": string;
169
+ "reasons.icao_background": string;
170
+ "reasons.icao_resolution": string;
171
+ "reasons.portrait_not_from_liveness": string;
172
+ "method.national_eid": string;
173
+ "method.national_eidGeneric": string;
174
+ "consent.short": string;
175
+ "consent.termsLink": string;
176
+ "session.progressLabel": string;
177
+ "section.contact": string;
178
+ "section.identity": string;
179
+ "section.live_photo": string;
180
+ "section.screening": string;
181
+ "handoff.copied": string;
182
+ "needsApp.title": string;
183
+ "needsApp.description": string;
184
+ "needsApp.descriptionNoOrg": string;
185
+ "population.recheck.title": string;
186
+ "population.recheck.description": string;
187
+ "otp.phoneInvalid": string;
188
+ "otp.codeInvalid": string;
189
+ "doc.countryTitle": string;
190
+ "doc.countryLabel": string;
191
+ "doc.countrySearch": string;
192
+ "doc.noCountryMatch": string;
193
+ "doc.type.carte_identite": string;
194
+ "doc.type.residence_permit": string;
195
+ "doc.type.passport": string;
196
+ "doc.showSide": string;
197
+ "doc.showPage": string;
198
+ "doc.flip": string;
199
+ "doc.sameFace": string;
200
+ "doc.reaskRecto": string;
201
+ "doc.reread": string;
202
+ "doc.photoTaken": string;
203
+ "doc.frontCaptured": string;
204
+ "doc.backCaptured": string;
205
+ "doc.pageCaptured": string;
206
+ "doc.progressFront": string;
207
+ "doc.progressBack": string;
208
+ "doc.progressPage": string;
209
+ "doc.shutter": string;
210
+ "doc.torchOn": string;
211
+ "doc.torchOff": string;
212
+ "result.platform_unsupported": string;
213
+ "unsupported.title": string;
214
+ "unsupported.description": string;
215
+ "shell.subtitle": string;
216
+ "shell.verifiedBy": string;
217
+ "doc.sub.carte_identite": string;
218
+ "doc.sub.residence_permit": string;
219
+ "doc.sub.passport": string;
220
+ "native.close": string;
221
+ "native.face.introTitle": string;
222
+ "native.face.introLead": string;
223
+ "native.doc.holdIt": string;
224
+ "native.doc.changeCountry": string;
225
+ "native.result.approved": string;
226
+ "native.result.review": string;
227
+ "native.result.rejected": string;
228
+ "native.result.expired": string;
229
+ "native.result.copied": string;
230
+ "native.result.back": string;
231
+ "emailOtp.sendTitle"?: string;
232
+ "emailOtp.sendDescription"?: string;
233
+ "emailOtp.prefilledNotice"?: string;
234
+ "emailOtp.emailLabel"?: string;
235
+ "emailOtp.emailHelper"?: string;
236
+ "emailOtp.emailPlaceholder"?: string;
237
+ "emailOtp.emailInvalid"?: string;
238
+ "emailOtp.send"?: string;
239
+ "emailOtp.verifyTitle"?: string;
240
+ "emailOtp.verifyDescription"?: string;
241
+ "emailOtp.sentTo"?: string;
242
+ "emailOtp.codeLabel"?: string;
243
+ "emailOtp.codeHelper"?: string;
244
+ "emailOtp.verify"?: string;
245
+ "emailOtp.resend"?: string;
246
+ "emailOtp.resendIn"?: string;
247
+ "emailOtp.expiresIn"?: string;
248
+ "emailOtp.expired"?: string;
249
+ "emailOtp.reason_otp_mismatch"?: string;
250
+ "emailOtp.reason_otp_expired"?: string;
251
+ "emailOtp.reason_otp_send_failed"?: string;
252
+ "emailOtp.reason_otp_rate_limited"?: string;
253
+ "emailOtp.reason_email_invalid"?: string;
254
+ "emailOtp.reason_email_disposable"?: string;
255
+ "eid.identifierTitle"?: string;
256
+ "eid.identifierTitleGeneric"?: string;
257
+ "eid.identifierDescription"?: string;
258
+ "eid.identifierDescriptionGeneric"?: string;
259
+ "eid.boundDescription"?: string;
260
+ "eid.boundDescriptionGeneric"?: string;
261
+ "eid.start"?: string;
262
+ "eid.codeTitle"?: string;
263
+ "eid.codeTitleGeneric"?: string;
264
+ "eid.codeHelp"?: string;
265
+ "eid.codeHelpGeneric"?: string;
266
+ "eid.codeLabel"?: string;
267
+ "eid.verify"?: string;
268
+ "eid.resend"?: string;
269
+ "eid.resendIn"?: string;
270
+ "eid.noResendsLeft"?: string;
271
+ "eid.expiresIn"?: string;
272
+ "eid.expired"?: string;
273
+ "eid.useCamera"?: string;
274
+ "reasons.eid_identifier_invalid"?: string;
275
+ "reasons.eid_code_invalid"?: string;
276
+ "reasons.eid_code_expired"?: string;
277
+ "reasons.eid_locked"?: string;
278
+ "reasons.eid_not_enrolled"?: string;
279
+ "reasons.eid_unavailable"?: string;
280
+ "reasons.eid_resend_too_soon"?: string;
281
+ "reasons.eid_resend_limit"?: string;
282
+ "eid.continueHint"?: string;
283
+ "eid.continueHintGeneric"?: string;
284
+ "eid.resendsRemaining.zero"?: string;
285
+ "eid.resendsRemaining.one"?: string;
286
+ "eid.resendsRemaining.two"?: string;
287
+ "eid.resendsRemaining.few"?: string;
288
+ "eid.resendsRemaining.many"?: string;
289
+ "eid.resendsRemaining.other"?: string;
290
+ "eid.codeAttemptsRemaining.zero"?: string;
291
+ "eid.codeAttemptsRemaining.one"?: string;
292
+ "eid.codeAttemptsRemaining.two"?: string;
293
+ "eid.codeAttemptsRemaining.few"?: string;
294
+ "eid.codeAttemptsRemaining.many"?: string;
295
+ "eid.codeAttemptsRemaining.other"?: string;
296
+ "dcv3.mrz.searching"?: string;
297
+ "dcv3.mrz.showMrzSide"?: string;
298
+ "dcv3.mrz.reading"?: string;
299
+ "dcv3.mrz.moveCloser"?: string;
300
+ "dcv3.mrz.turnSideways"?: string;
301
+ "dcv3.mrz.glare"?: string;
302
+ "dcv3.mrz.holdStill"?: string;
303
+ "dcv3.mrz.valid"?: string;
304
+ "dcv3.mrz.looksLikePassport"?: string;
305
+ "dcv3.mrz.looksLikeCard"?: string;
306
+ "native.doc.introTitle"?: string;
307
+ "native.doc.introLead"?: string;
308
+ "native.doc.tip.flat"?: string;
309
+ "native.doc.tip.glare"?: string;
310
+ "native.doc.tip.frame"?: string;
311
+ "native.doc.openCamera"?: string;
312
+ "native.doc.changeDocument"?: string;
313
+ "native.scan.closer"?: string;
314
+ "native.scan.farther"?: string;
315
+ "native.scan.glare"?: string;
316
+ "native.scan.dark"?: string;
317
+ "native.scan.blurry"?: string;
318
+ "native.scan.holdStill"?: string;
319
+ "native.scan.reading"?: string;
320
+ "native.scan.putDown"?: string;
321
+ "native.scan.retry"?: string;
322
+ "choice.title"?: string;
323
+ "choice.description"?: string;
324
+ "choice.switch"?: string;
325
+ "contact.title"?: string;
326
+ "contact.description"?: string;
327
+ "contact.phone"?: string;
328
+ "contact.email"?: string;
329
+ "contact.switch"?: string;
330
+ "summary.title"?: string;
331
+ "summary.description"?: string;
332
+ "summary.fullName"?: string;
333
+ "summary.birthDate"?: string;
334
+ "summary.nationality"?: string;
335
+ "summary.documentType"?: string;
336
+ "summary.documentNumber"?: string;
337
+ "summary.nni"?: string;
338
+ "summary.expiryDate"?: string;
339
+ "summary.portraitAlt"?: string;
340
+ "summary.source.registry"?: string;
341
+ "summary.source.document"?: string;
342
+ "summary.source.chip"?: string;
343
+ "summary.name"?: string;
344
+ "summary.birthYear"?: string;
345
+ "summary.confirm"?: string;
346
+ "summary.retakeDocument"?: string;
347
+ "summary.retakeNationalNumber"?: string;
348
+ "summary.noRetake"?: string;
349
+ "capture.tipsIcao.title"?: string;
350
+ "capture.tipsIcao.glasses"?: string;
351
+ "capture.tipsIcao.headwear"?: string;
352
+ "capture.tipsIcao.expression"?: string;
353
+ "capture.tipsIcao.faceCamera"?: string;
354
+ "capture.tipsIcao.background"?: string;
355
+ "capture.tipsIcao.lighting"?: string;
356
+ "capture.tipsIcao.hair"?: string;
357
+ "capture.tipsIcao.summary"?: string;
358
+ "portrait.retakeOnly"?: string;
359
+ "portrait.keepCamera"?: string;
360
+ "handoff.description"?: string;
361
+ "handoff.qrAlt"?: string;
362
+ "handoff.copyLink"?: string;
363
+ "handoff.copyFailed"?: string;
364
+ "handoff.waiting"?: string;
365
+ "inApp.title"?: string;
366
+ "inApp.description"?: string;
367
+ "inApp.copyLink"?: string;
368
+ "inApp.copied"?: string;
369
+ "inApp.copyFailed"?: string;
370
+ "inApp.continueAnyway"?: string;
371
+ }
372
+
373
+ declare const arSteps: StepStrings;
374
+
375
+ declare const enSteps: StepStrings;
376
+
377
+ declare const frSteps: StepStrings;
378
+
379
+ type SekyroStrings = Strings & StepStrings;
380
+ type SekyroStringKey = keyof SekyroStrings;
381
+ type StepTranslate = (key: SekyroStringKey, vars?: Record<string, string | number>) => string;
382
+ declare function formatTemplate(template: string, vars?: Record<string, string | number>): string;
383
+ declare function resolveSekyroStrings(locale: SekyroLocale, overrides?: Partial<SekyroStrings>): SekyroStrings;
384
+ interface StepI18n {
385
+ locale: SekyroLocale;
386
+ strings: SekyroStrings;
387
+ t: StepTranslate;
388
+ }
389
+ declare function StepI18nProvider({ locale, strings, children }: {
390
+ locale: SekyroLocale;
391
+ strings?: Partial<SekyroStrings>;
392
+ children: ReactNode;
393
+ }): react.JSX.Element;
394
+ /** Props win over the surrounding provider; default English. */
395
+ declare function useStepI18n(locale?: SekyroLocale, strings?: Partial<SekyroStrings>): StepI18n;
396
+
397
+ /** Runs the verification's plan runner and returns the current step. */
398
+ declare function useVerificationStep(verification: Verification | undefined): {
399
+ step: VerificationStep | null;
400
+ error: unknown;
401
+ };
402
+
403
+ /** Props shared by every step component. */
404
+ interface StepComponentProps {
405
+ /** Default: the surrounding <SekyroVerification>'s locale, else `en`. */
406
+ locale?: SekyroLocale;
407
+ strings?: Partial<SekyroStrings>;
408
+ className?: string;
409
+ /** Every failed action (local validation and API errors) — for host telemetry. */
410
+ onError?: (error: unknown) => void;
411
+ }
412
+
413
+ interface PhoneOtpStepProps extends StepComponentProps {
414
+ step: PhoneOtpStepHandle;
415
+ /** Initial value of the number field (default `+222`). */
416
+ defaultPhone?: string;
417
+ }
418
+ declare function PhoneOtpStep({ step, locale, strings, className, defaultPhone, onError }: PhoneOtpStepProps): react.JSX.Element;
419
+
420
+ interface EmailOtpStepProps extends StepComponentProps {
421
+ step: EmailOtpStepHandle;
422
+ /** Initial value of the address field (default empty). */
423
+ defaultEmail?: string;
424
+ }
425
+ declare function EmailOtpStep({ locale, strings, ...props }: EmailOtpStepProps): react.JSX.Element;
426
+
427
+ interface EidStepProps extends StepComponentProps {
428
+ step: EidStepHandle;
429
+ }
430
+ declare function EidStep({ locale, strings, ...props }: EidStepProps): react.JSX.Element;
431
+
432
+ declare function MethodChoice({ step, locale, strings, className, onError }: StepComponentProps & {
433
+ step: MethodStepHandle;
434
+ }): react.JSX.Element;
435
+
436
+ declare function NniEntry({ step, locale, strings, className, onError }: StepComponentProps & {
437
+ step: RegistryStepHandle;
438
+ }): react.JSX.Element;
439
+
440
+ declare function DocumentCapture({ step, locale, strings, className, liveMrz, }: StepComponentProps & {
441
+ step: DocumentStepHandle;
442
+ /** Web live MRZ (on-device MRZ read on MRZ faces; obeys the session's server tuning). */
443
+ liveMrz?: DocumentLiveMrzOptions;
444
+ }): react.JSX.Element;
445
+
446
+ declare function PortraitCapture({ step, locale, strings, className, assetBaseUrl, }: StepComponentProps & {
447
+ step: PortraitStepHandle;
448
+ /** Self-hosted MediaPipe assets (wasm fileset + `face_landmarker.task`); default `/models-v3`. */
449
+ assetBaseUrl?: string;
450
+ }): react.JSX.Element;
451
+
452
+ /** `system` follows the device (prefers-color-scheme). */
453
+ type SekyroColorScheme = "light" | "dark" | "system";
454
+
455
+ /** What {@link SekyroVerificationProps.onClose} reports. */
456
+ interface SekyroCloseEvent {
457
+ /**
458
+ * `finished`: the person is done (the result's "Back to <partner>" button, or the close button on the result page);
459
+ * `cancelled`: they closed the flow before its result.
460
+ */
461
+ reason: "finished" | "cancelled";
462
+ /** The verdict shown on the result page (`finished` only). Display only: read the real outcome on your server. */
463
+ result?: VerificationResult;
464
+ }
465
+ interface SekyroVerificationProps {
466
+ verification: Verification;
467
+ locale: SekyroLocale;
468
+ dir?: "ltr" | "rtl";
469
+ strings?: Partial<SekyroStrings>;
470
+ /** Runtime theme — wins over the session's branding (SDK spec §6.4). */
471
+ theme?: SekyroTheme;
472
+ /** Light (default: the component sits in your page), dark, or the device's setting. */
473
+ colorScheme?: SekyroColorScheme;
474
+ assetBaseUrl?: string;
475
+ /**
476
+ * Web live MRZ for the document step: `workerUrl` (where your bundler serves `@sekyro/web/core/ocr/worker`),
477
+ * `assetBaseUrl` (self-hosted OCR assets) or `mode: "off"`. The session's server tuning decides when it runs.
478
+ */
479
+ documentLiveMrz?: DocumentLiveMrzOptions;
480
+ voice?: false | VoiceOptions;
481
+ livenessProps?: Omit<LivenessCaptureProps, "verification" | "locale" | "dir" | "strings" | "assetBaseUrl" | "voice" | "onCaptured" | "onResult">;
482
+ /**
483
+ * `header` and `footer` replace the partner header and the "Verified by Sekyro AI" line (`footer: null` hides it);
484
+ * `headerEnd` sits at the inline end of the partner header (a language menu), before the close button.
485
+ */
486
+ slots?: {
487
+ header?: ReactNode;
488
+ headerEnd?: ReactNode;
489
+ footer?: ReactNode;
490
+ result?: (step: ResultStepHandle) => ReactNode;
491
+ };
492
+ onStep?: (step: VerificationStep) => void;
493
+ onResult?: (result: VerificationResult) => void;
494
+ /**
495
+ * The person closes the flow: the header's close button, or the result's "Back to <partner>" button (as on the native
496
+ * SDKs). Take them back to your page. Without it, neither button is shown.
497
+ */
498
+ onClose?: (event: SekyroCloseEvent) => void;
499
+ /** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
500
+ onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
501
+ /**
502
+ * The link a desktop shows as a QR code when the live photo needs a phone
503
+ * (the session's `hosted_url`); absent = a "continue on your phone" notice.
504
+ * `<SekyroFlow>` defaults it to this page's address.
505
+ */
506
+ handoffUrl?: string;
507
+ className?: string;
508
+ }
509
+ declare function SekyroVerification(props: SekyroVerificationProps): react.JSX.Element;
510
+
511
+ interface SekyroFlowProps extends SekyroVerificationProps {
512
+ /** The session's `hosted_url` (create result): the QR code and the "open in your browser" link. Default: this page's address. */
513
+ hostedUrl?: string;
514
+ /** Override the in-app browser detection (tests / hosts that know better). */
515
+ inAppBrowser?: boolean;
516
+ }
517
+ declare function SekyroFlow({ hostedUrl, inAppBrowser, ...props }: SekyroFlowProps): react.JSX.Element;
518
+
519
+ /** The page runs inside an app's WebView (WhatsApp, Instagram, Facebook, TikTok, Snapchat, LINE, LinkedIn, WeChat, an Android WebView…). */
520
+ declare function isInAppBrowser(userAgent?: string): boolean;
521
+
522
+ declare function VerificationResultScreen({ step, locale, strings, className, onClose, }: StepComponentProps & {
523
+ step: ResultStepHandle;
524
+ /** Shows the primary action, "Back to <partner>" ("Close" without a partner name), as on the native SDKs. */
525
+ onClose?: () => void;
526
+ }): react.JSX.Element;
527
+
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 };
@@ -0,0 +1,2 @@
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};