@sekyro/web 0.1.0-rc.27 → 0.1.0-rc.29
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 +30 -0
- package/README.md +4 -1
- package/dist/barcode-detect-C5IOXMKI.js +1 -0
- package/dist/{capture-session-doc-FRBI7OKF.js → capture-session-doc-YC4CT2EQ.js} +1 -1
- package/dist/{capture-session-v3-DZmmTeDY.d.cts → capture-session-v3-CTQL6eFd.d.cts} +1 -1
- package/dist/{capture-session-v3-CjaciYJQ.d.ts → capture-session-v3-DHlOE6cS.d.ts} +1 -1
- package/dist/{challenge-frame-NUGPTWFP.js → challenge-frame-5GG4NDF5.js} +1 -1
- package/dist/{chunk-Y5ZLVLCU.js → chunk-34IITQFB.js} +1 -1
- package/dist/chunk-6AH7FXVC.js +1 -0
- package/dist/chunk-AL6LIOLW.js +1 -0
- package/dist/chunk-BF7CLNFA.js +1 -0
- package/dist/chunk-CKHBGAUA.js +1 -0
- package/dist/chunk-EVIGRYOX.js +3 -0
- package/dist/chunk-FVWFAO45.js +1 -0
- package/dist/{chunk-U3JUGEIW.js → chunk-IA5M34P7.js} +1 -1
- package/dist/chunk-JLVZ35QK.js +2 -0
- package/dist/{chunk-4DEPREJ3.js → chunk-KXFHVAYQ.js} +1 -1
- package/dist/chunk-VVUQ4PFU.js +1 -0
- package/dist/{chunk-HLV2XYHX.js → chunk-WOVWAJD4.js} +1 -1
- package/dist/chunk-XIKMTHHH.js +1 -0
- package/dist/chunk-ZKF2XMNX.js +1 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -1
- package/dist/core/ocr/worker.js +1 -1
- package/dist/create-document-capture-O64FR2DA.js +1 -0
- package/dist/{create-verification-ClZ9Nvop.d.ts → create-verification-BvldYuLZ.d.ts} +131 -16
- package/dist/{create-verification-CnsFqT2E.d.cts → create-verification-DzPluhA3.d.cts} +131 -16
- package/dist/{detector-scanic-23DAYT3H.js → detector-scanic-SE3CL55N.js} +1 -1
- package/dist/{icao-gate-DWexlqVW.d.ts → icao-gate-DveU9Cr8.d.ts} +1 -1
- package/dist/{icao-gate-Dfpj4nT4.d.cts → icao-gate-xyWB7dz2.d.cts} +1 -1
- package/dist/{icao-policy-eLrX6Twc.d.ts → icao-policy-BWu1JLgi.d.cts} +12 -3
- package/dist/{icao-policy-BnXH_-WM.d.cts → icao-policy-OOEQDG9_.d.ts} +12 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +40 -8
- package/dist/index.d.ts +40 -8
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +2 -2
- package/dist/internal/index.d.cts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +1 -1
- package/dist/plan-runner-WGMNUBWJ.js +1 -0
- package/dist/{types-BGUwaKjk.d.ts → types-CezFEXzl.d.cts} +169 -8
- package/dist/{types-BGUwaKjk.d.cts → types-CezFEXzl.d.ts} +169 -8
- package/package.json +6 -3
- package/sbom.cdx.json +125 -10
- package/dist/chunk-3XVIDHFY.js +0 -3
- package/dist/chunk-A3FUGHAH.js +0 -2
- package/dist/chunk-C5FD3ADY.js +0 -1
- package/dist/chunk-HVW2AB35.js +0 -1
- package/dist/chunk-NFHLJOHW.js +0 -1
- package/dist/chunk-SDDM5ZTK.js +0 -1
- package/dist/chunk-VXHK5YC6.js +0 -1
- package/dist/chunk-ZCOWTM46.js +0 -1
- package/dist/chunk-ZCZ2E2YN.js +0 -1
- package/dist/create-document-capture-2YBCDEUB.js +0 -1
- package/dist/plan-runner-KQM7I4MR.js +0 -1
|
@@ -293,12 +293,14 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
|
|
|
293
293
|
* `eid_auth` (SDK spec §3.2) is the national eID sign-in (Houwiyeti in MR).
|
|
294
294
|
*/
|
|
295
295
|
type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth"
|
|
296
|
+
/** Spec 2026-11-14 §14: the Form step (the person's declared answers and the client's consents). */
|
|
297
|
+
| "form"
|
|
296
298
|
/** Spec 2026-11-10 §5: the proof of address step (a bill or statement, images or one PDF). */
|
|
297
299
|
| "poa";
|
|
298
300
|
type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "capture_back_camera" | "capture_not_upright" | "capture_front_camera" | "multiple_faces" | "camera_unavailable";
|
|
299
301
|
type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
|
|
300
302
|
type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved";
|
|
301
|
-
type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
|
|
303
|
+
type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_type_not_supported" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch" | "document_sides_mismatch" | "document_photo_mismatch";
|
|
302
304
|
/**
|
|
303
305
|
* Profile v2 step 3 matching reasons: a field the partner sent at session
|
|
304
306
|
* create (`subject`) differs from the reference identity (document or
|
|
@@ -334,7 +336,7 @@ type EmailOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_
|
|
|
334
336
|
* never does — on web the step arrives `skipped` (`platform_unsupported`) or
|
|
335
337
|
* the session shows `reasonCode: 'platform_unsupported'`.
|
|
336
338
|
*/
|
|
337
|
-
type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "platform_unsupported";
|
|
339
|
+
type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "platform_unsupported" | "document_photo_mismatch";
|
|
338
340
|
/**
|
|
339
341
|
* eid_auth reasons (SDK spec §3.2, generic national eID; Houwiyeti in MR).
|
|
340
342
|
* Retryable: `eid_identifier_invalid` (re-enter the number), `eid_code_invalid`
|
|
@@ -432,9 +434,20 @@ interface CaptureIssueReport {
|
|
|
432
434
|
phase?: "preflight" | "acquiring" | "models" | "recording" | "keyframes" | "upload";
|
|
433
435
|
/** The engine kind before the public collapse, or the `unavailable` reason code (lower case, at most 32 characters). */
|
|
434
436
|
engineKind?: string;
|
|
435
|
-
/**
|
|
437
|
+
/**
|
|
438
|
+
* Which capture attempt of the page failed (0 = the first); for `attestation`, which failed challenge of the page. The
|
|
439
|
+
* client reports one issue per attempt and cause.
|
|
440
|
+
*/
|
|
436
441
|
attempt?: number;
|
|
437
442
|
formFactor?: "phone" | "tablet" | "desktop";
|
|
443
|
+
/** `attestation`: Cloudflare's numeric error code, when the challenge reported one (incident 2026-11-13). */
|
|
444
|
+
detail?: string;
|
|
445
|
+
/** `attestation`: milliseconds from the challenge request to its failure (the frame client's own retry included). */
|
|
446
|
+
challengeMs?: number;
|
|
447
|
+
/** `attestation`: milliseconds from inserting the challenge frame to its `ready`; absent when it never answered. */
|
|
448
|
+
readyMs?: number;
|
|
449
|
+
/** `attestation`: the page runs in an app's WebView (a user-agent heuristic, as the device header's `inApp`). */
|
|
450
|
+
inApp?: boolean;
|
|
438
451
|
}
|
|
439
452
|
/**
|
|
440
453
|
* How the person proves their identity when the app makes the document
|
|
@@ -470,7 +483,7 @@ type EidAfterPass = "end" | "continue";
|
|
|
470
483
|
* of address (spec 2026-11-10). Open: a value this SDK does not know is kept as
|
|
471
484
|
* is, so a client still places the step.
|
|
472
485
|
*/
|
|
473
|
-
type StepSection = "contact" | "identity" | "live_photo" | "screening" | "documents" | (string & {});
|
|
486
|
+
type StepSection = "contact" | "identity" | "live_photo" | "screening" | "documents" | "form" | (string & {});
|
|
474
487
|
/** A contact channel of a contact choice (`phone_otp` → `phone`, `email_otp` → `email`). */
|
|
475
488
|
type ContactChannel = "phone" | "email";
|
|
476
489
|
/**
|
|
@@ -864,6 +877,11 @@ interface HostedStepView {
|
|
|
864
877
|
* camera capture from a desktop answers `409 mobile_required`. Absent on `upload` steps and steps without a camera.
|
|
865
878
|
*/
|
|
866
879
|
requiresMobile?: boolean;
|
|
880
|
+
/**
|
|
881
|
+
* Native-only capture (spec 2026-11-15): this camera step runs in a native app only (the partner's app or the
|
|
882
|
+
* Sekyro AI app). A browser shows the way there; a submission from it answers `409 native_app_required`.
|
|
883
|
+
*/
|
|
884
|
+
requiresNativeApp?: boolean;
|
|
867
885
|
/** nfc_chip only (M-nfc). */
|
|
868
886
|
nfc?: NfcStepView;
|
|
869
887
|
/** portrait_icao only (SDK spec §4.9): the last attempt's per-criterion report. */
|
|
@@ -884,7 +902,104 @@ interface HostedStepView {
|
|
|
884
902
|
docCapture?: {
|
|
885
903
|
mode: "mrz_for_chip" | (string & {});
|
|
886
904
|
};
|
|
905
|
+
/**
|
|
906
|
+
* form only (spec 2026-11-14 §14): the questions of the open Form step in the language chosen for the person
|
|
907
|
+
* (§8), and the prefill (§10). Absent before the session token is presented and once the step is submitted.
|
|
908
|
+
*/
|
|
909
|
+
form?: HostedFormView;
|
|
910
|
+
}
|
|
911
|
+
/** A hosted language of a Form step's own text (spec 2026-11-14 §8). */
|
|
912
|
+
type FormLocale = "ar" | "fr" | "en" | "es" | "pt" | "de";
|
|
913
|
+
/** A ready-made Form field (spec 2026-11-14 §5): label, input, help and errors are Sekyro's, in the person's language. */
|
|
914
|
+
type FormFieldName = "full_name" | "birth_date" | "email" | "phone" | "address" | "country" | "occupation";
|
|
915
|
+
/** A custom Form question type (spec 2026-11-14 §5). */
|
|
916
|
+
type FormQuestionType = "short_text" | "long_text" | "single_choice" | "multiple_choice" | "yes_no" | "date" | "number";
|
|
917
|
+
/**
|
|
918
|
+
* The open Form step (`plan.steps[].form`, spec 2026-11-14 §14): one screen, questions in the client's order, then
|
|
919
|
+
* the consents. Every client text is already in `locale`; render it with that `lang` (and its direction), whatever the
|
|
920
|
+
* page language. Sekyro's own text (ready-made labels, buttons, errors) stays in the page language.
|
|
921
|
+
*/
|
|
922
|
+
interface HostedFormView {
|
|
923
|
+
/** The language of the client's text (§8: the person's language when complete, else the default, else the source). */
|
|
924
|
+
locale: FormLocale | (string & {});
|
|
925
|
+
title?: string;
|
|
926
|
+
intro?: string;
|
|
927
|
+
questions: FormQuestionView[];
|
|
928
|
+
consents: FormConsentView[];
|
|
929
|
+
/** Prefilled answers by question id (§10); the person can change every one. Consents are never prefilled. */
|
|
930
|
+
prefill?: Record<string, FormAnswerValue>;
|
|
931
|
+
}
|
|
932
|
+
/** A question of the Form step: a ready-made field or a custom question. */
|
|
933
|
+
type FormQuestionView = FormFieldQuestionView | FormCustomQuestionView;
|
|
934
|
+
/** A ready-made field (`id` is the field name). */
|
|
935
|
+
interface FormFieldQuestionView {
|
|
936
|
+
kind: "field";
|
|
937
|
+
id: FormFieldName | (string & {});
|
|
938
|
+
field: FormFieldName | (string & {});
|
|
939
|
+
required: boolean;
|
|
940
|
+
}
|
|
941
|
+
/** A custom question, its text in the view's `locale`. */
|
|
942
|
+
interface FormCustomQuestionView {
|
|
943
|
+
kind: "custom";
|
|
944
|
+
id: string;
|
|
945
|
+
type: FormQuestionType | (string & {});
|
|
946
|
+
required: boolean;
|
|
947
|
+
label: string;
|
|
948
|
+
help?: string;
|
|
949
|
+
/** single_choice and multiple_choice: 2 to 12 choices, in order. */
|
|
950
|
+
choices?: FormChoiceView[];
|
|
951
|
+
/** date: `min` / `max` (`YYYY-MM-DD`) or `period`; number: `min` / `max` / `integer`. */
|
|
952
|
+
options?: FormQuestionOptions;
|
|
953
|
+
}
|
|
954
|
+
interface FormChoiceView {
|
|
955
|
+
value: string;
|
|
956
|
+
label: string;
|
|
957
|
+
}
|
|
958
|
+
/** The bounds of a date or number question. */
|
|
959
|
+
interface FormQuestionOptions {
|
|
960
|
+
min?: string | number;
|
|
961
|
+
max?: string | number;
|
|
962
|
+
period?: "past" | "future";
|
|
963
|
+
integer?: boolean;
|
|
964
|
+
}
|
|
965
|
+
/** A consent checkbox of the client's (spec 2026-11-14 §5); `required` ones must be ticked to continue. */
|
|
966
|
+
interface FormConsentView {
|
|
967
|
+
id: string;
|
|
968
|
+
required: boolean;
|
|
969
|
+
text: string;
|
|
970
|
+
link?: {
|
|
971
|
+
url: string;
|
|
972
|
+
label: string;
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
/** The address answer (the shape of the person address: country, city, 1 to 4 lines, postcode). */
|
|
976
|
+
interface FormAddressValue {
|
|
977
|
+
/** ISO 3166-1 alpha-2. */
|
|
978
|
+
country: string;
|
|
979
|
+
city: string;
|
|
980
|
+
lines: string[];
|
|
981
|
+
postcode?: string;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* One answer: text, a choice value, a list of choice values, a boolean (yes / no), `YYYY-MM-DD`, a number, E.164 (phone),
|
|
985
|
+
* ISO alpha-2 (country) or an address.
|
|
986
|
+
*/
|
|
987
|
+
type FormAnswerValue = string | string[] | boolean | number | FormAddressValue;
|
|
988
|
+
/**
|
|
989
|
+
* `form` executor input (spec 2026-11-14 §14): answers by question id (an optional question left empty is left out)
|
|
990
|
+
* and every consent by id (`true` = ticked). A refused submit answers 422 `form_answers_invalid` with one
|
|
991
|
+
* `details.errors[]` entry per question id (`{ id, code }`, the server's code; the verification maps it to a
|
|
992
|
+
* {@link FormIssueCode}); it does not use an attempt.
|
|
993
|
+
*/
|
|
994
|
+
interface FormInput {
|
|
995
|
+
answers: Record<string, FormAnswerValue>;
|
|
996
|
+
consents: Record<string, boolean>;
|
|
887
997
|
}
|
|
998
|
+
/**
|
|
999
|
+
* Why an answer was refused (the `code` of a `form_answers_invalid` issue). The client checks the same rules before
|
|
1000
|
+
* sending; `card_number` comes only from the server (a Luhn-valid card number typed into a text answer, §17).
|
|
1001
|
+
*/
|
|
1002
|
+
type FormIssueCode = "required" | "too_long" | "too_short" | "email_invalid" | "phone_invalid" | "date_invalid" | "date_not_past" | "date_not_future" | "date_too_early" | "date_too_late" | "number_invalid" | "number_not_integer" | "number_decimals" | "number_too_small" | "number_too_large" | "choice_invalid" | "address_invalid" | "card_number" | "consent_required";
|
|
888
1003
|
/** A locale the Sekyro AI-hosted voice clips are recorded in. */
|
|
889
1004
|
type HostedVoiceLocale = "ar" | "fr" | "en";
|
|
890
1005
|
/**
|
|
@@ -1185,6 +1300,12 @@ interface HostedSessionView {
|
|
|
1185
1300
|
expiresAt: string;
|
|
1186
1301
|
consentRecorded: boolean;
|
|
1187
1302
|
orgName: string;
|
|
1303
|
+
/**
|
|
1304
|
+
* Website demo spec 2026-11-13 §4.5: present (`true`) on a website demo session whose `orgName`
|
|
1305
|
+
* is the visitor's own name. The hosted page shows "Demo by Sekyro AI" under it; SDK surfaces
|
|
1306
|
+
* ignore it.
|
|
1307
|
+
*/
|
|
1308
|
+
demo?: true;
|
|
1188
1309
|
/**
|
|
1189
1310
|
* The FIRST allowlisted web-SDK origin of the owning org (Task 12), or null
|
|
1190
1311
|
* when none is registered. The hosted page posts the SDK popup postMessage
|
|
@@ -1285,6 +1406,12 @@ interface HostedSessionView {
|
|
|
1285
1406
|
capture?: HostedCaptureTuning;
|
|
1286
1407
|
/** Native device attestation parameters; absent for web-only apps and on older APIs. */
|
|
1287
1408
|
integrity?: HostedIntegrity;
|
|
1409
|
+
/**
|
|
1410
|
+
* Native-only capture (spec 2026-11-15): present when the session's flow takes its photos in a native app only.
|
|
1411
|
+
* Its camera steps carry `requiresNativeApp`; a browser shows the way to the partner's app (and the Sekyro AI app
|
|
1412
|
+
* when `sekyroApp`) instead of opening the camera. Absent on flows that take photos on any device.
|
|
1413
|
+
*/
|
|
1414
|
+
nativeApp?: HostedNativeAppView;
|
|
1288
1415
|
/**
|
|
1289
1416
|
* SDK spec §3.5: present when the session runs the ICAO portrait step — the
|
|
1290
1417
|
* client runs the ICAO gate (read it with `icaoPolicyOf`). `icao` is absent on
|
|
@@ -1400,6 +1527,15 @@ interface HostedSessionView {
|
|
|
1400
1527
|
hosts: string[];
|
|
1401
1528
|
};
|
|
1402
1529
|
}
|
|
1530
|
+
/** {@link HostedSessionView.nativeApp}: where a browser sends the person when the flow takes photos in an app only. */
|
|
1531
|
+
interface HostedNativeAppView {
|
|
1532
|
+
/** The session's app allows verification in the Sekyro AI app. */
|
|
1533
|
+
sekyroApp: boolean;
|
|
1534
|
+
/** This session's link (`https://…/<code>`): on a phone with the Sekyro AI app it opens the app. */
|
|
1535
|
+
link?: string;
|
|
1536
|
+
/** `sekyro://verify/<code>`: opens this session in the Sekyro AI app. Only with `sekyroApp`. */
|
|
1537
|
+
sekyroAppLink?: string;
|
|
1538
|
+
}
|
|
1403
1539
|
/** `POST /hosted/consent` result — 201 on first record, 200 `{alreadyRecorded: true}` on replay. */
|
|
1404
1540
|
/**
|
|
1405
1541
|
* `POST /hosted/consent` answer (Sekyro flows §8.2): the hosted view with
|
|
@@ -1635,12 +1771,33 @@ interface TesterGateInput {
|
|
|
1635
1771
|
type TesterGateResponse = HostedSessionView & {
|
|
1636
1772
|
bound: boolean;
|
|
1637
1773
|
};
|
|
1774
|
+
/**
|
|
1775
|
+
* Why a Sandbox session ran on simulated test data instead of real checks:
|
|
1776
|
+
* - `no_testers`: the organization has no active Sandbox tester;
|
|
1777
|
+
* - `tester_gate_not_used`: testers exist, and nobody ran the tester check at the start of the session;
|
|
1778
|
+
* - `tester_gate_missed`: the tester check ran and recognized nobody.
|
|
1779
|
+
*/
|
|
1780
|
+
type SandboxSimulatedReason = "no_testers" | "tester_gate_not_used" | "tester_gate_missed";
|
|
1781
|
+
/**
|
|
1782
|
+
* A Sandbox session that ran on simulated test data, and why: the `sandbox` object of `GET /sessions/{id}` and of the
|
|
1783
|
+
* session webhooks. Never present in Live, nor on a session an enrolled tester ran.
|
|
1784
|
+
*/
|
|
1785
|
+
interface SandboxSimulation {
|
|
1786
|
+
/** Always `true`. */
|
|
1787
|
+
simulated: true;
|
|
1788
|
+
reason: SandboxSimulatedReason;
|
|
1789
|
+
}
|
|
1638
1790
|
/** The hosted view's `simulation` block (Sandbox DX spec 2026-11-06 §8): what a simulated session tells the flow. */
|
|
1639
1791
|
interface HostedSimulationView {
|
|
1640
1792
|
/** The code that passes the phone, email and national eID code screens: render it, nothing is delivered. */
|
|
1641
1793
|
otpCode: string;
|
|
1642
1794
|
/** The server takes {@link SimulatedCaptureInput} on the document, chip, liveness and portrait steps. */
|
|
1643
1795
|
skipCapture: boolean;
|
|
1796
|
+
/**
|
|
1797
|
+
* Why no enrolled Sandbox tester ran the session; the result screen says it. Absent on an older API and on a session
|
|
1798
|
+
* a tester had bound before being removed.
|
|
1799
|
+
*/
|
|
1800
|
+
reason?: SandboxSimulatedReason;
|
|
1644
1801
|
}
|
|
1645
1802
|
/**
|
|
1646
1803
|
* The input of a camera step skipped in a simulated session (`doc_ocr`, `nfc_chip`, `liveness`, `face_match`,
|
|
@@ -1762,10 +1919,12 @@ interface DocOcrInput {
|
|
|
1762
1919
|
*/
|
|
1763
1920
|
source?: PhotoSourcePick;
|
|
1764
1921
|
/**
|
|
1765
|
-
*
|
|
1766
|
-
*
|
|
1922
|
+
* The document type the person picked (spec 2026-11-11 D11 rule 1). The server refuses a document that is not the
|
|
1923
|
+
* one picked; `drivers_license` also routes both faces to its document reader (spec 2026-11-10 §6.2).
|
|
1767
1924
|
*/
|
|
1768
|
-
documentType?:
|
|
1925
|
+
documentType?: AcceptedDocumentType;
|
|
1926
|
+
/** The issuing country the person picked, ISO 3166-1 alpha-2. Sent with `documentType`. */
|
|
1927
|
+
documentCountry?: string;
|
|
1769
1928
|
}
|
|
1770
1929
|
/** The `doc_ocr` device-read hint (identity-backend DeviceReadSchema; strict, text-free). */
|
|
1771
1930
|
interface DocDeviceRead {
|
|
@@ -1924,6 +2083,8 @@ interface CheckInputByType {
|
|
|
1924
2083
|
eid_auth: EidAuthInput;
|
|
1925
2084
|
/** Spec 2026-11-10 §5: the proof of address pages or PDF. */
|
|
1926
2085
|
poa: PoaInput;
|
|
2086
|
+
/** Spec 2026-11-14 §14: the Form step's answers and consents. */
|
|
2087
|
+
form: FormInput;
|
|
1927
2088
|
}
|
|
1928
2089
|
/**
|
|
1929
2090
|
* Body of `POST /sessions/:id/checks/:checkType` (SubmitCheckSchema).
|
|
@@ -1939,4 +2100,4 @@ interface SubmitCheckBody {
|
|
|
1939
2100
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
1940
2101
|
}
|
|
1941
2102
|
|
|
1942
|
-
export { type
|
|
2103
|
+
export { type HostedNativeAppView as $, type AcceptedDocumentType as A, type FormFieldName as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type FormFieldQuestionView as G, type FormInput as H, type FormIssueCode as I, type FormLocale as J, type FormQuestionOptions as K, type FormQuestionType as L, type FormQuestionView as M, type HostedAcceptedDocuments as N, type HostedCaptureTuning as O, type HostedChallengeView as P, type HostedConsentView as Q, type HostedDocumentCaptureTuning as R, type HostedDocumentScanTuning as S, type HostedDocumentsView as T, type HostedEidView as U, type HostedEmailOtpView as V, type HostedFlowRef as W, type HostedFormView as X, type HostedIcaoPolicy as Y, type HostedIntegrity as Z, type HostedLivePhotoTuning as _, type AttestationInput as a, type SandboxSimulation as a$, type HostedNativeCaptureTuning as a0, type HostedOcrTuning as a1, type HostedOtpView as a2, type HostedPlanView as a3, type HostedPoaRuleKindView as a4, type HostedPoaRuleView as a5, type HostedPortraitPendingFix as a6, type HostedPortraitView as a7, type HostedProofOfAddressView as a8, type HostedSessionView as a9, type PhotoSourcePick as aA, type PlanAttempts as aB, type PlanChoiceKind as aC, type PlanChoiceOption as aD, type PlanChoiceView as aE, type PlanSectionView as aF, type PlanStepView as aG, type PoaImagesInput as aH, type PoaInput as aI, type PoaKind as aJ, type PoaLicenceInput as aK, type PoaNameMatchMode as aL, type PoaPdfInput as aM, type PoaReason as aN, type PoaRuleSource as aO, type PopulationInput as aP, type PopulationReason as aQ, type PortraitFix as aR, type PortraitFixReviewInput as aS, type PortraitIcaoInput as aT, type PortraitIcaoReason as aU, type PortraitOutputFormat as aV, type PresignRequest as aW, type PresignUploadResult as aX, type RecordConsentResult as aY, type ResolvedCaptureMode as aZ, type SandboxSimulatedReason as a_, type HostedSimulationView as aa, type HostedStepView as ab, type HostedTesterGateView as ac, type HostedVoiceLocale as ad, type HostedVoiceView as ae, type IcaoCriterion as af, type IcaoReportEntry as ag, type IdentityConfirmDecision as ah, type IdentityMethod as ai, type IdentitySummarySource as aj, type IdentitySummaryView as ak, type LivenessCaptureInput as al, type LivenessInput as am, type LivenessReason as an, type MatchReason as ao, type MediaKind as ap, type MethodChoiceView as aq, type NationalEidOption as ar, type NfcChipReason as as, type NfcStepView as at, type OtpChoiceView as au, type PhoneCountryRule as av, type PhoneFormat as aw, type PhoneOtpInput as ax, type PhoneOtpReason as ay, type PhotoSource as az, type CaptureMode as b, type SessionDecidingStep as b0, type SessionFailureReason as b1, type SessionReason as b2, type SessionStatus as b3, type SessionStepView as b4, type SessionView as b5, type SimulatedCaptureInput as b6, type StepResult as b7, type StepSection as b8, type SubmitCheckBody as b9, type TesterGateInput as ba, type TesterGateResponse as bb, type VerificationAssurance as bc, type VerificationLevel as bd, type ScreenRampColour as be, type AgeEstimationReason as bf, type CameraUnavailableCause as bg, type CaptureIssueReport as bh, type CaptureProvenance as bi, type HostedBranding as bj, type HostedBrandingColorKey as bk, type HostedLivenessCaptureTuning as bl, type IcaoCaptureTuning as bm, type RetakeHint as bn, type ScreenRampChallenge as bo, type ScreenRampPaint as bp, type ScreenRampRendered as bq, type ScreenRampReport as br, ICAO_FALLBACK as bs, type IcaoProfile as bt, type ResolvedIcaoTuning as bu, resolveIcaoTuning as bv, type PersonMask as bw, type BackgroundUniformity as bx, type CaptureNoncesResult as c, type CaptureProof as d, type CheckInputByType as e, type CheckReason as f, type CheckState as g, type CheckType as h, type ClosedBy as i, type CompleteMediaResult as j, type ConsentLocale as k, type ContactChannel as l, type DocDeviceRead as m, type DocOcrInput as n, type DocReason as o, type DocSide as p, type EidAuthInput as q, type EidReason as r, type EmailOtpInput as s, type EmailOtpReason as t, type FaceMatchReason as u, type FormAddressValue as v, type FormAnswerValue as w, type FormChoiceView as x, type FormConsentView as y, type FormCustomQuestionView as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/web",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.29",
|
|
4
4
|
"description": "Sekyro AI web SDK \u2014 browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -117,11 +117,14 @@
|
|
|
117
117
|
"check:lazy-portrait": "node scripts/check-lazy-portrait.mjs",
|
|
118
118
|
"size": "node scripts/check-size.mjs",
|
|
119
119
|
"gen:ocr-assets": "node scripts/gen-ocr-assets.mjs",
|
|
120
|
-
"check:ocr-assets": "node scripts/gen-ocr-assets.mjs --check && node scripts/check-ocr-assets.mjs"
|
|
120
|
+
"check:ocr-assets": "node scripts/gen-ocr-assets.mjs --check && node scripts/check-ocr-assets.mjs",
|
|
121
|
+
"gen:barcode-asset": "node scripts/gen-barcode-asset.mjs",
|
|
122
|
+
"check:barcode-asset": "node scripts/gen-barcode-asset.mjs --check"
|
|
121
123
|
},
|
|
122
124
|
"dependencies": {
|
|
123
125
|
"@mediapipe/tasks-vision": "0.10.35",
|
|
124
|
-
"@thumbmarkjs/thumbmarkjs": "1.12.0"
|
|
126
|
+
"@thumbmarkjs/thumbmarkjs": "1.12.0",
|
|
127
|
+
"zxing-wasm": "2.1.0"
|
|
125
128
|
},
|
|
126
129
|
"devDependencies": {
|
|
127
130
|
"@microsoft/api-extractor": "^7.59.4",
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "web",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.29",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.29",
|
|
102
102
|
"description": "Sekyro AI web SDK — browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.29?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"name": "tasks-vision",
|
|
151
151
|
"group": "@mediapipe",
|
|
152
152
|
"version": "0.10.35",
|
|
153
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
153
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.29|@mediapipe/tasks-vision@0.10.35",
|
|
154
154
|
"licenses": [
|
|
155
155
|
{
|
|
156
156
|
"license": {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"name": "thumbmarkjs",
|
|
186
186
|
"group": "@thumbmarkjs",
|
|
187
187
|
"version": "1.12.0",
|
|
188
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
188
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.29|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
189
189
|
"licenses": [
|
|
190
190
|
{
|
|
191
191
|
"license": {
|
|
@@ -214,21 +214,136 @@
|
|
|
214
214
|
"value": "node_modules/@thumbmarkjs/thumbmarkjs"
|
|
215
215
|
}
|
|
216
216
|
]
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"type": "library",
|
|
220
|
+
"name": "emscripten",
|
|
221
|
+
"group": "@types",
|
|
222
|
+
"version": "1.41.6",
|
|
223
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.29|@types/emscripten@1.41.6",
|
|
224
|
+
"licenses": [
|
|
225
|
+
{
|
|
226
|
+
"license": {
|
|
227
|
+
"id": "MIT",
|
|
228
|
+
"acknowledgement": "declared"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"purl": "pkg:npm/%40types/emscripten@1.41.6",
|
|
233
|
+
"externalReferences": [
|
|
234
|
+
{
|
|
235
|
+
"url": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.41.6.tgz",
|
|
236
|
+
"type": "distribution",
|
|
237
|
+
"hashes": [
|
|
238
|
+
{
|
|
239
|
+
"alg": "SHA-512",
|
|
240
|
+
"content": "b8dfbd8bc6c54f90947197f2204603ad2b9e0021322866d4b39902ffbd831a5659a229e1f38b097d55748bc50e243d5ab1dce4bcb3c146b2ace35919f0c7445e"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"comment": "as detected from npm-ls property \"resolved\" and property \"integrity\""
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"properties": [
|
|
247
|
+
{
|
|
248
|
+
"name": "cdx:npm:package:path",
|
|
249
|
+
"value": "node_modules/@types/emscripten"
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"type": "library",
|
|
255
|
+
"name": "type-fest",
|
|
256
|
+
"version": "4.41.0",
|
|
257
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.29|type-fest@4.41.0",
|
|
258
|
+
"licenses": [
|
|
259
|
+
{
|
|
260
|
+
"expression": "(MIT OR CC0-1.0)",
|
|
261
|
+
"acknowledgement": "declared"
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"purl": "pkg:npm/type-fest@4.41.0",
|
|
265
|
+
"externalReferences": [
|
|
266
|
+
{
|
|
267
|
+
"url": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",
|
|
268
|
+
"type": "distribution",
|
|
269
|
+
"hashes": [
|
|
270
|
+
{
|
|
271
|
+
"alg": "SHA-512",
|
|
272
|
+
"content": "4de4d243a1f9607be9a95c0145c9cb0c20670ce1d662eec8bc66c74fa37c00eca672bf4f2468dcd464ed896653620d0d0a0630be761612454285002bf5b8dfc0"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"comment": "as detected from npm-ls property \"resolved\" and property \"integrity\""
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"properties": [
|
|
279
|
+
{
|
|
280
|
+
"name": "cdx:npm:package:path",
|
|
281
|
+
"value": "node_modules/type-fest"
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"type": "library",
|
|
287
|
+
"name": "zxing-wasm",
|
|
288
|
+
"version": "2.1.0",
|
|
289
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.29|zxing-wasm@2.1.0",
|
|
290
|
+
"licenses": [
|
|
291
|
+
{
|
|
292
|
+
"license": {
|
|
293
|
+
"id": "MIT",
|
|
294
|
+
"acknowledgement": "declared"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"purl": "pkg:npm/zxing-wasm@2.1.0",
|
|
299
|
+
"externalReferences": [
|
|
300
|
+
{
|
|
301
|
+
"url": "https://registry.npmjs.org/zxing-wasm/-/zxing-wasm-2.1.0.tgz",
|
|
302
|
+
"type": "distribution",
|
|
303
|
+
"hashes": [
|
|
304
|
+
{
|
|
305
|
+
"alg": "SHA-512",
|
|
306
|
+
"content": "0afbb00d91d11f083a3de08045a083229ddd6ae0f87229f499b1eb41066d303aebe666e53f30a29808ddc3f5cc843fc0bb5d2afdfe7e480ba9bd8a98bd43a0d5"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"comment": "as detected from npm-ls property \"resolved\" and property \"integrity\""
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"properties": [
|
|
313
|
+
{
|
|
314
|
+
"name": "cdx:npm:package:path",
|
|
315
|
+
"value": "node_modules/zxing-wasm"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
217
318
|
}
|
|
218
319
|
],
|
|
219
320
|
"dependencies": [
|
|
220
321
|
{
|
|
221
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
322
|
+
"ref": "@sekyro/web@0.1.0-rc.29",
|
|
222
323
|
"dependsOn": [
|
|
223
|
-
"@sekyro/web@0.1.0-rc.
|
|
224
|
-
"@sekyro/web@0.1.0-rc.
|
|
324
|
+
"@sekyro/web@0.1.0-rc.29|@mediapipe/tasks-vision@0.10.35",
|
|
325
|
+
"@sekyro/web@0.1.0-rc.29|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
326
|
+
"@sekyro/web@0.1.0-rc.29|zxing-wasm@2.1.0"
|
|
225
327
|
]
|
|
226
328
|
},
|
|
227
329
|
{
|
|
228
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
330
|
+
"ref": "@sekyro/web@0.1.0-rc.29|@mediapipe/tasks-vision@0.10.35"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"ref": "@sekyro/web@0.1.0-rc.29|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"ref": "@sekyro/web@0.1.0-rc.29|@types/emscripten@1.41.6"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"ref": "@sekyro/web@0.1.0-rc.29|type-fest@4.41.0"
|
|
229
340
|
},
|
|
230
341
|
{
|
|
231
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
342
|
+
"ref": "@sekyro/web@0.1.0-rc.29|zxing-wasm@2.1.0",
|
|
343
|
+
"dependsOn": [
|
|
344
|
+
"@sekyro/web@0.1.0-rc.29|@types/emscripten@1.41.6",
|
|
345
|
+
"@sekyro/web@0.1.0-rc.29|type-fest@4.41.0"
|
|
346
|
+
]
|
|
232
347
|
}
|
|
233
348
|
]
|
|
234
349
|
}
|
package/dist/chunk-3XVIDHFY.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{A as Qe,B as Xe,C as ze,a as Ge,b as Ke,c as qe,d as q,e as Q,f as X,g as Ye,h as L,i as We,j as A,k as U,l as I,m as H,n as D,o as Y,p as W,q as z,r as je,s as $e,t as Ze,u as Je}from"./chunk-ZCZ2E2YN.js";import{n as Ue}from"./chunk-Y5ZLVLCU.js";import{a as Le}from"./chunk-7QZWBDI5.js";import{c as de,e as Fe,g as Be,h as ee}from"./chunk-C5FD3ADY.js";import{c as Ne,d as ue}from"./chunk-TSA6GHUG.js";function te(e){return e.idNumberBound??e.nniBound}function j(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function et(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var Rt="https://api.sekyro.ai",At=5e3,Ot=24e4,wt=3e4,It=1500,Mt=10;function tt(e){return e instanceof Error&&e.name==="ChallengeError"&&e.code||"challenge_failed"}function vt(e){return new Promise(t=>setTimeout(t,e))}function Et(){let e=globalThis.crypto;if(e!==void 0&&typeof e.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(e!==void 0&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<16;r+=1)t[r]=Math.floor(Math.random()*256);t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;let o=[...t].map(r=>r.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}function wn(e){return Tt(e,{})}function Tt(e,t){let o=e.apiOrigin??Rt,r=e.autoRetry??!0,i=e.rearm??"auto",s=t.client??new Be({apiOrigin:o,sessionToken:e.clientToken,fetch:e.fetch}),u=t.sleep??vt,c=t.uuid??Et,p=t.getChallengeToken??((n,a)=>import("./challenge-frame-NUGPTWFP.js").then(d=>d.executeChallenge({frameUrl:n.url,siteKey:n.siteKey,action:"liveness",subject:a.subject,signal:a.signal}))),S=Le(),g=null,x=null,l=!1,C=new AbortController,f=null,V=null,$=null,Z=()=>$??je(f),ge=()=>$e(z(f),Z()),O=n=>{f=n,S.emit("view",n),g?.onView(n)},_=()=>f!==null?Promise.resolve(f):(V??(V=s.getSession().then(n=>(O(n),n)).finally(()=>{V=null})),V),w=async()=>{let n=await s.getSession();return O(n),n},ne=async(n,a)=>{n.plan!==void 0?O(n):await w()},oe=null,Ce=async n=>{let a=await _();if(n||!a.consentRecorded){let d=await s.recordConsent(e.locale);d.plan!==void 0?O(d):f!==null&&O({...f,consentRecorded:!0})}ve(a)},v=n=>n?.force===!0?Ce(!0):(oe??(oe=Ce(!1).finally(()=>{oe=null})),oe),ie={client:s,ensureConsent:n=>v(n),sleep:u,uuid:c,...t.random!==void 0?{random:t.random}:{},onBusy:n=>{l||S.emit("busy",n)}},_e=!1,ke=null,re=n=>{if(n.status==="verified"||n.status==="not_verified"||n.status==="review"){if(_e)return;_e=!0}ke=JSON.stringify(n),S.emit("result",n)},pt=n=>{ke!==JSON.stringify(n)&&re(n)},Pe=async n=>{let a=f;n&&(a=await w().catch(()=>f));let d=a===null?null:L(a);return d!==null&&!l&&S.emit("method",d),d!==null},be=null,xe=!1,Re=!1,Ae=()=>Qe(ie,(n,a)=>n.submitCheck("population_registry",{},{idempotencyKey:a})),Oe=n=>te(n)===!0||j(I(n,"population_registry"))===!0,ft=async()=>{try{let n=await _();if(A(n)||L(n)!==null||U(n)?.checkType!=="population_registry")return;if(!Oe(n)&&j(I(n,"population_registry"))===void 0&&(n=await w()),!Oe(n)){Re=!0;return}await v(),await ne(await Ae(),"population_registry");let a=f===null?void 0:I(f,"population_registry");if(a?.state==="input_required"&&a.reason==="registry_unavailable"&&X(a)>0){if(await u(At),l)return;await ne(await Ae(),"population_registry")}}catch(n){if(n instanceof de&&(n.code==="check_not_active"||n.code==="step_not_on_path")){await w().catch(()=>{});return}xe=!0;return}f!==null&&A(f)&&re(Y(f,{autoRetry:r}))},we=()=>(be??(be=ft()),be),se=t.now??Date.now,N=null,B,ae,Ie=(n,a)=>`${n.url}
|
|
2
|
-
${n.siteKey}
|
|
3
|
-
${a}`,ce=(n,a)=>{let d=p(n,{signal:C.signal,subject:a});return d.then(()=>{ae=void 0},m=>{let h=tt(m);l||h==="aborted"||(ae=h,G({check:"attestation",kind:"unavailable",engineKind:h}))}),d},Me=(n,a)=>n!==null&&n.key===a&&se()-n.at<Ot,ve=n=>{let a=n?.challenge??null;if(n===null||a===null||l)return;let d=Ie(a,H(n.sessionId));if(Me(N,d))return;let m=ce(a,H(n.sessionId));m.catch(()=>{}),N={key:d,at:se(),token:m}},mt=async(n,a)=>{let d=Ie(n,a),m=N;N=null;let h=Me(m,d),b=h?m.at:se(),E=h?m.token.catch(()=>ce(n,a)):ce(n,a);E.catch(()=>{});let P,y=new Promise(R=>{P=setTimeout(()=>R("late"),wt)});try{let R=await Promise.race([E.then(T=>({token:T}),T=>({error:tt(T)})),y]);return R==="late"&&!l&&N===null&&(N={key:d,at:b,token:E}),R}finally{clearTimeout(P)}},Ee=async()=>{B=void 0;let n=await _(),a=n.challenge;if(a==null)return{};let d=await mt(a,H(n.sessionId));return d!=="late"&&"token"in d?{channel:"hosted_web",turnstileToken:d.token}:(B=d!=="late"?d.error:ae,{channel:"hosted_web"})},ht=()=>B,G=n=>{if(l)return;let a=s.reportCaptureIssue;if(a===void 0)return;let d=n.formFactor;try{d??(d=Ne())}catch{}try{Promise.resolve(a.call(s,{...n,...d!==void 0?{formFactor:d}:{}})).catch(()=>{})}catch{}},k=null,Te=Promise.resolve(),K=0,St=async()=>{let n=await _();for(let a=0;a<Mt&&!l&&!A(n)&&U(n)===void 0&&Q(n).some(d=>d.state==="processing")&&(await u(It),!l);a+=1)n=await w();return n},yt=async(n,a,d)=>{let{capture:m}=n,h=()=>l,b=()=>n.alive&&n.attempt===d,E=y=>{b()&&m.setFlowState(y)},P=y=>{if(!h()&&(y.status==="unavailable"&&y.reasonCode!==void 0&&!Ge(y.reasonCode)&&G({check:"liveness",kind:"unavailable",phase:"upload",engineKind:y.reasonCode,attempt:Math.max(0,n.issues.value)}),re(y),!!b())){if(y.status==="retry"&&i==="auto"){m.handle.retry();return}m.setFlowState("done")}};if(a.degraded==="NO_RECORDER"){let y=f?.sessionId??(await _().catch(()=>null))?.sessionId??"";P(D(y,"no_recorder"));return}E("uploading");try{if(await we(),h())return;let y=await _(),R;if(!A(y)&&L(y)!==null){await Pe(!1),P(D(y.sessionId,"method_required"));return}if(!A(y)){if(U(y)?.checkType==="population_registry"){P(D(y.sessionId,Re?"nni_unbound":xe?"network":"registry_unavailable"));return}if(await v(),h())return;R=f??y;let T=await Xe({...ie,artifacts:a,getAttestation:Ee,attestationError:ht,getView:()=>f??y,refreshView:w,applySubmit:ne,onPhase:E,isCancelled:h,onKeyframePromoted:J=>{x=J}});if(h())return;if(T.kind==="unavailable"){let J=D(y.sessionId,T.reason),De=T.reason==="attestation"?B:void 0;P(De!==void 0?{...J,attestationError:De}:J);return}if(T.kind==="resync"&&await w(),f!==null&&L(f)!==null){await Pe(!1),P(D(y.sessionId,"method_required"));return}y=await St()}P(Y(y,{autoRetry:r,previous:R}))}catch{if(h())return;P(D(f?.sessionId??"","network"))}},gt=(n,a)=>{let d=n.attempt;K>0&&n.alive&&n.capture.setFlowState("uploading"),K+=1,Te=Te.then(()=>yt(n,a,d)).finally(()=>{K-=1,K===0&&g?.onChainIdle()}).catch(()=>{})},Ve=n=>{k?.capture.handle.destroy(),k!==null&&(k.alive=!1);let a=Ue(n,g?.captureInternals?.(n)??t.capture,()=>f?.capture?.liveness?.keyframe?.rank===!0,ge,()=>f?.capture?.liveness?.screenRamp,{session:()=>z(f),onModeChange:h=>{$=h}}),d={capture:a,alive:!0,attempt:0,issues:qe()};k=d,a.handle.on("error",h=>{G(Ke("liveness",h,d.issues.value))}),a.handle.on("state",h=>{if(d.issues.note(h),h==="starting"){d.attempt+=1,ve(f);let b=f===null?void 0:U(f)?.checkType;(b==="liveness"||b==="face_match")&&v().catch(()=>{})}}),a.handle.on("captured",h=>{Promise.resolve().then(()=>gt(d,h))});let m=a.handle;return{get state(){return m.state},get captureMode(){return m.captureMode},get facingMode(){return m.facingMode},on:(h,b)=>m.on(h,b),start:async h=>{if(f===null&&await _().catch(()=>{}),!!d.alive)return m.start(h)},retry:()=>m.retry(),switchCamera:()=>m.switchCamera(),canSwitchCaptureMode:()=>m.canSwitchCaptureMode(),setCaptureMode:h=>m.setCaptureMode(h),destroy:()=>{d.alive=!1,k===d&&(k=null),m.destroy()}}},Ct=async()=>{if(l)return null;try{let n=await _();return l?null:L(n)}catch{return null}},_t=async()=>{if(l)return"self";try{let n=await _();if(l)return"self";let a=z(n);return a==="choice"?Z()??a:a}catch{return"self"}},kt=async()=>{if(l)return!1;try{let n=await _();return l||A(n)||ue()?!1:W(n,U(n))==="phone"||W(n,I(n,"liveness"))==="phone"}catch{return!1}},Pt=async()=>{if(l)return!1;try{let n=await _();return!l&&n.returning===!0}catch{return!1}},bt=async n=>{let a=(await _()).plan?.choice,d=a?.options.find(h=>q[h.service]===n);if(!d)throw new RangeError(`method ${String(n)} is not offered`);let m=await s.choose(a.nodeId,d.id);l||O(m)},He=null,xt=()=>(He??(He=import("./plan-runner-KQM7I4MR.js").then(n=>{let a=n.createPlanRunner({runtime:ie,currentView:()=>f,cameraMode:ge,captureModeSwitch:{pick:Z,choose:d=>{$=d}},ensureView:_,refreshView:w,ensureConsent:()=>v(),liveness:Ve,stopLiveness:()=>{k!==null&&(k.alive=!1,k.capture.handle.destroy(),k=null)},chainBusy:()=>K>0,destroyed:()=>l,sleep:u,isMobile:ue,now:t.now??Date.now,keptFaceKey:()=>x,setView:O,baseCapture:t.capture,emitStep:d=>{l||S.emit("step",d)},emitResult:pt,reportCaptureIssue:G,documentInternals:t.document,portraitInternals:t.portrait,livePhotoInternals:t.livePhoto,uploadInternals:t.upload,pageCameraInternals:t.pageCamera});return g=a,a})),He);return{consent:()=>v(),startRegistry:we,methodChoice:Ct,selectMethod:bt,reportCameraUnavailable:async n=>{await v();let a=s.reportCameraUnavailable;if(a===void 0)throw new TypeError("this client cannot report a missing camera");let d=await a.call(s,n).catch(m=>{if(m instanceof de&&m.code==="check_out_of_order")return s.getSession();throw m});l||O(d)},reportCaptureIssue:G,testerGate:async n=>{let a=s.testerGate;if(a===void 0)throw new TypeError("this client cannot run the tester gate");let d=n.clip,m=Fe(n.clipMime??"");if(d===void 0||!Je.includes(m))throw new TypeError("the capture has no clip");await v();let h=await Ze(s,"clip",m,d.size,{engine:n.engine,durationMs:n.clipMs});await s.uploadToSpaces(h.uploadUrl,d,m);let{key:b}=await s.completeMedia(h.key),E=await Ee(),P=await a.call(s,{clipKey:b,attestation:E,captureChannel:n.captureChannel,capture:{...ze(n),attestationError:B}}),{bound:y,...R}=P;return l||(R.plan!==void 0?O(R):await w()),{bound:y===!0}},mobileRequired:kt,captureMode:_t,chooseCaptureMode:n=>{$=n},get captureChoice(){return Z()},returning:Pt,liveness:Ve,run:async()=>{if(l)throw new Error("verification destroyed");return(await xt()).run()},currentStep:()=>g?.current()??null,voiceClips:async()=>{if(l)return null;try{let n=await _();return l?null:n.voice??null}catch{return null}},on:(n,a)=>S.on(n,a),destroy:()=>{l=!0,C.abort(),g?.destroy(),k!==null&&(k.alive=!1,k.capture.handle.destroy(),k=null),S.clear()}}}var nt=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"];var Vt=["carte_identite","passport","residence_permit","drivers_license"],Ht=["carte_identite","passport","residence_permit"];function Dt(e,t){let o=e.byIssuer?.[t]??e.default;return Vt.filter(r=>o==="*"?Ht.includes(r):o.includes(r))}function En(e,t=nt){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(r=>Dt(e,r).length>0).sort()}function ot(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}function Tn(e){return/^[A-Z]{2}$/.test(e)?String.fromCodePoint(...[...e].map(t=>127462+t.charCodeAt(0)-65)):""}var it=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),Nt=new Map(Object.entries(it)),Hn=new Map(Object.entries(it).map(([e,t])=>[t,e]));function rt(e){return Nt.get(e)??e}var Kn=["national_number","document_photo","national_eid"],Lt=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","portrait","face_match","aml_screening","face_dedup","age_estimation","proof_of_address"]),Ut=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),pe=["document","population_registry","national_eid"],fe=["phone_otp","email_otp"],ct={identity_method:pe,contact:fe},Ft=["population_registry","document"],me="platform_unsupported",Bt=new Set(["prefilled","user_entered","prefilled_or_entered"]),Gt={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo",poa:"documents"};function M(e){return e.section??Gt[e.checkType]??null}function Kt(e,t){let o=e.plan?.choice;if(o===void 0||o.locked)return;let r=o.options.find(i=>i.id!==o.selected&&i.available!==!1&&t.includes(i.service));return r===void 0?void 0:{nodeId:o.nodeId,option:r}}function he(e){let t=e.plan,o=t?.choice;if(t===void 0||o===void 0||o.locked||t.current===null||t.current===o.nodeId||A(e))return null;let r=ct[o.kind]??[...pe,...fe],i=o.options.flatMap(c=>c.available===!1||!r.includes(c.service)?[]:[c.nationalEid!=null?{id:c.id,service:c.service,nationalEid:c.nationalEid}:{id:c.id,service:c.service}]),s=t.steps.find(c=>c.id===t.current)?.service,u=o.selected??i.find(c=>c.service===s)?.id??null;return i.some(c=>c.id!==u)?{nodeId:o.nodeId,kind:o.kind,current:u,options:i}:null}function ut(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function qt(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:o,skipCapture:r}=t;return typeof o=="string"&&o!==""&&typeof r=="boolean"?{otpCode:o,skipCapture:r}:void 0}function Yt(e){let t=(e.plan?.sections??[]).map(u=>({id:u.id,state:u.state})),o={sessionId:H(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(u=>u.id),progress:t,purpose:e.purpose??"identity"};e.branding!==void 0&&(o.branding=e.branding),e.cameraUnavailableHandled===!0&&(o.cameraUnavailableHandled=!0);let r=qt(e);r!==void 0&&(o.simulation=r);let i=e.testerGate;i?.offered===!0&&typeof i.attemptsLeft=="number"&&i.attemptsLeft>0&&(o.testerGate={attemptsLeft:i.attemptsLeft});let s=he(e);return s!==null&&(o.switchable=s),o}function Wt(e){let t={attemptsRemaining:X(e),attemptsExhausted:e.attempts.used>=e.attempts.max};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}var dt={phone_otp:"phone",email_otp:"email"};function jt(e,t){let o=Kt(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return o===void 0?void 0:dt[o.option.service]}function $t(e,t,o,r){let i=t.checkType==="email_otp",s=(i?t.emailOtp:t.otp)??{},u=i?t.emailOtp?.emailSource:t.otp?.numberSource,c=u!==void 0&&Bt.has(u)?u:i?"prefilled_or_entered":"user_entered",p=typeof s.sentToMasked=="string"&&s.sentToMasked.length>0,S=s.prefilled===!0,g=jt(e,i?"email_otp":"phone_otp"),x={key:t.checkType,context:o,section:M(t),phase:p?"verify":"send",canSwitch:g!==void 0,...r},l=i?{kind:"email_otp",...x,emailSource:c,needsEmail:c!=="prefilled"&&!S}:{kind:"phone_otp",...x,numberSource:c,needsPhone:c!=="prefilled"&&!S,channels:(t.otp?.channels??[]).filter(C=>C==="whatsapp"||C==="sms")};if(g!==void 0&&(l.switchChannel=g),S&&(l.prefilled=!0),p&&(l.sentToMasked=s.sentToMasked),!i&&t.otp?.channel!==void 0&&(l.channel=t.otp.channel),!i&&Array.isArray(t.phoneCountries)&&(l.phoneCountries=t.phoneCountries.filter(C=>typeof C=="string"&&/^[A-Z]{2}$/.test(C))),!i&&Array.isArray(t.phoneRules)){let C=l.phoneCountries??[];l.phoneRules=t.phoneRules.flatMap(f=>{let V=Qt(f);return V!==void 0&&C.includes(V.code)?[V]:[]})}return!i&&t.phoneInternational===!0&&(l.phoneInternational=!0),s.expiresAt!==void 0&&(l.codeExpiresAt=s.expiresAt),s.resendAvailableAt!==void 0&&(l.resendAvailableAt=s.resendAvailableAt),l}var Zt=/^[\d[\]\-|()?:^]{1,64}$/;function Jt(e){try{return typeof e=="string"&&Zt.test(e)&&new RegExp(e)!==null}catch{return!1}}var st=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function Qt(e){let{code:t,dial:o,trunk:r,lengths:i,formats:s}=e??{};if(typeof t!="string"||typeof o!="string"||!/^\d{1,3}$/.test(o)||r!==void 0&&(typeof r!="string"||!/^\d{1,3}$/.test(r))||!Array.isArray(i)||i.length===0||!i.every(st))return;let u={code:t,dial:o,lengths:[...i].sort((c,p)=>c-p)};if(r!==void 0&&(u.trunk=r),s!==void 0){if(!(Array.isArray(s)&&s.length<=8&&s.every(p=>Jt(p?.leading)&&Array.isArray(p.groups)&&p.groups.every(st)&&i.includes(p.groups.reduce((S,g)=>S+g,0)))))return;u.formats=s.map(p=>({leading:p.leading,groups:[...p.groups]}))}return u}function Xt(e,t,o,r){let i=te(e)===!0?"bound":j(t)===!0?"document":"typed",s=i==="typed"&&t.state==="input_required"&&t.reason!==void 0&&rt(t.reason)==="id_number_recheck",u=ut(he(e)),c=!r.attemptsExhausted&&u.length===1&&u[0]?.service==="document";return{kind:"registry",key:"registry",context:o,section:M(t),state:t.state==="input_required"?"input_required":"pending",source:i,recheck:s,canUseDocument:c,...r}}function zt(e,t,o,r,i){let s=[...t.acceptedSides??[]],u={kind:"document",key:"document",context:o,section:M(t),side:s.includes("recto")?"verso":"recto",acceptedSides:s,documents:ot(e),photo:ye(Se(e.documents),i),...r};return e.detectedCountry!==void 0&&(u.detectedCountry=e.detectedCountry),nn(e)&&(u.ageStepUp=!0),u}function Se(e,t=!0){let o=e?.source==="upload"||e?.source==="choice"?e.source:"camera",r=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:o,pick:r,uploadOffered:t&&e?.uploadOffered===!0}}function ye(e,t){return t?{...e,cameraOnPhone:!0}:e}var en=10*1024*1024;function tn(e,t,o,r,i){let s=e.proofOfAddress,u=s?.pdf?.maxBytes,c=s?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:o,section:M(t),phase:c,rule:s?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:s?.nameMatch??"exact_person",photo:ye(Se(s),i),maxPages:3,pdf:{maxBytes:typeof u=="number"&&u>0?u:en,maxPages:3},licenceAddressAccepted:c==="document"&&s?.licenceAddressAccepted===!0,...r}}function nn(e){let t=Q(e).find(r=>r.checkType==="age_estimation"),o=t?.reason;return t?.state==="failed"&&(o==="age_uncertain"||o==="age_unavailable")}function on(e){let t=I(e,"liveness");return t?.state==="passed"||t?.state==="review"}function at(e,t,o,r,i,s=!1){let u=t.icao?.report,c=e.portrait,p=i==="capture"?c?.pendingFix??null:null;p!==null&&(i="review");let S=lt(e);return{kind:"portrait",key:`portrait:${i}`,context:o,section:M(t),phase:i,report:Array.isArray(u)?u:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:ee(e),retakeOnly:i==="capture"&&t.state==="input_required"&&S===void 0&&e.capture?.livePhoto?.oneCapture===!0&&on(e),photo:ye(Se(c,i==="capture"),s&&i==="capture"),pendingFix:p,...S!==void 0?{captureMode:S}:{},...c?.reuse?.pending===!0?{reuse:!0}:{},...r}}function lt(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}var le={minLongSidePx:1280,jpegQuality:.95};function rn(e,t){let o=e.capture?.livePhoto;if(o?.oneCapture!==!0)return null;let r=I(e,"portrait_icao"),i=o.still??le;return{icao:t==="liveness"&&ee(e)!==null&<(e)===void 0&&r!==void 0&&r.state==="pending"&&r.reason===void 0,still:{minLongSidePx:i.minLongSidePx??le.minLongSidePx,jpegQuality:i.jpegQuality??le.jpegQuality}}}function sn(e,t,o,r){let i=t.eid,s=M(t);if(i===void 0||i.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:o,section:s,checkType:"eid_auth",reason:"update_required"};let u=ut(he(e)),c=u.length===1&&Ft.includes(u[0]?.service??"")?u[0]:void 0,p=c===void 0?void 0:q[c.service],S=p!==void 0,g={kind:"eid",key:"eid",context:o,section:s,provider:i.provider,providerName:i.providerName,country:i.country,challenge:"app_code",phase:i.awaiting==="code"?"code":"identifier",identifierBound:i.identifierBound===!0,canUseCamera:S,afterPass:i.afterPass==="continue"?"continue":"end",...r};return S&&(g.cameraMethod=p),i.expiresAt!==void 0&&(g.codeExpiresAt=i.expiresAt),i.resendAvailableAt!==void 0&&(g.resendAvailableAt=i.resendAvailableAt),i.resendsRemaining!==void 0&&(g.resendsRemaining=i.resendsRemaining),i.codeAttemptsRemaining!==void 0&&(g.codeAttemptsRemaining=i.codeAttemptsRemaining),g}function an(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let o=I(e,"portrait_icao");return o!==void 0&&(o.state==="passed"||o.state==="review")?o:null}var cn={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function un(e){return e.reasonCode===me?"platform_unsupported":e.status==="review_pending"?"review":e.status==="verified"?"verified":e.reasonCode==="device_cooldown"?"cooldown":e.reasonCode==="starter_credit_claimed"?"policy":(e.status==="not_verified"&&e.reason!==void 0?cn[e.reason]:void 0)??"rejected"}function dn(e,t){let o=un(e),r=o==="platform_unsupported"?{sessionId:H(e.sessionId),status:"unavailable",reasonCode:me}:Y(e,{autoRetry:!1}),i={kind:"result",key:"result",context:t,section:null,display:o,result:r};return e.status==="not_verified"&&e.reason!==void 0&&(i.reason=e.reason),e.reasonCode!==void 0&&(i.reasonCode=e.reasonCode),e.status==="not_verified"&&e.step!==void 0&&(i.step=e.step),e.retryAfter!==void 0&&(i.retryAfter=e.retryAfter),i}function ln(e,t,o){let r=e.identitySummary;if(r==null)return null;let i={kind:"identity_summary",key:"identity_summary",context:t,section:o??"identity",summaryKind:r.kind==="partial"?"partial":r.kind??"full",source:r.source,portraitAvailable:r.portrait?.available===!0,retakeAvailable:r.retakeAvailable===!0};for(let u of pn){let c=r[u];typeof c=="string"&&c!==""&&(i[u]=c)}let s=et(r);return s!==void 0&&(i.idNumberMasked=s,i.nniMasked=s),i}var pn=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function F(e,t,o,r){return{kind:"unsupported",key:`unsupported:${o}`,context:e,section:t,checkType:o,reason:r}}function fn(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function mn(e,t){let o=ct[e.kind]??[...pe,...fe],r=fn(e),i=e.options.flatMap(u=>{if(u.available===!1||!o.includes(u.service))return[];let c={id:u.id,service:u.service};u.nationalEid!=null&&(c.nationalEid=u.nationalEid);let p=(u.channels??[]).filter(S=>S==="whatsapp"||S==="sms");return u.service==="phone_otp"&&p.length>0&&(c.channels=p),[c]});if(i.length===0){let u=e.options.length>0&&e.options.every(c=>c.service==="nfc");return F(t,r,"choice",u?"platform_unsupported":"update_required")}let s={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:i};if(e.kind==="identity_method"){let u={kind:"method",key:"method",context:t,section:r,options:i.map(p=>q[p.service]),choice:s},c=i.find(p=>p.nationalEid!==void 0)?.nationalEid;return c!==void 0&&(u.nationalEid=c),u}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:r,options:i.map(u=>dt[u.service]),selected:null,locked:!1,choice:s}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:r,choice:s}}function qn(e,t={}){let o=Yt(e);if(A(e)||e.reasonCode===me)return dn(e,o);let r=e.plan;if(r===void 0||!Array.isArray(r.sections))return F(o,null,"plan","update_required");let i=Ye(e);if(i!==null)return mn(i,o);let s=r.current===null?void 0:r.steps.find(l=>l.id===r.current),u=l=>{let C={kind:"processing",key:"processing",context:o,section:l!==void 0?M(l):r.sections.find(f=>f.state==="current")?.id??null,stalled:!1};return typeof l?.service=="string"&&l.service!==""&&(C.service=l.service),C};if(r.current===null)return u(r.steps.find(l=>l.state==="processing"));if(s===void 0)return F(o,null,"step","update_required");if(!Lt.has(s.service))return s.interaction==="server"?u(s):F(o,M(s),s.service,"update_required");if(Ut.has(s.service)||!We(s))return u(s);let c=s,p=Wt(c),S=c.checkType,g=M(c),x=t.isMobile===!1?W(e,c):null;if(x==="phone")return{kind:"mobile_required",key:"mobile_required",context:o,section:g,checkType:S};switch(S){case"phone_otp":case"email_otp":return $t(e,c,o,p);case"population_registry":return Xt(e,c,o,p);case"eid_auth":return sn(e,c,o,p);case"doc_ocr":return zt(e,c,o,p,x==="upload_or_phone");case"identity_confirm":return ln(e,o,g)??u(c);case"portrait_icao":return at(e,c,o,p,"capture",x==="upload_or_phone");case"liveness":case"face_match":{let l=an(e,c);if(l!==null)return at(e,l,o,p,"match");let C=c.requiresMobile===!0,f=ee(e);return{kind:"liveness",key:"biometric",context:o,section:g,mode:S==="face_match"?"selfie":"liveness",requiresMobile:C,instructions:f===null?"standard":"icao",icao:f,livePhoto:rn(e,S),...p}}case"poa":return tn(e,c,o,p,x==="upload_or_phone");case"nfc_chip":return F(o,g,S,"platform_unsupported");default:return F(o,g,S,"update_required")}}export{Rt as a,At as b,It as c,Mt as d,Et as e,wn as f,Tt as g,nt as h,Vt as i,Dt as j,En as k,ot as l,Tn as m,Kn as n,me as o,M as p,he as q,ut as r,an as s,qn as t};
|
package/dist/chunk-A3FUGHAH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-DFTCAWMP.js";var A="sekyro-mrz-1";function w(e){return Array.from(new Uint8Array(e),t=>t.toString(16).padStart(2,"0")).join("")}async function m(e){return w(await crypto.subtle.digest("SHA-256",e))}function x(e,t){return m(new TextEncoder().encode(`${A}\0${e}\0${t.join(`
|
|
2
|
-
`)}`))}var i=class extends Error{constructor(t){super(t),this.name="AssetFailure",this.reason=t}},B=Object.keys(o.files).filter(e=>o.files[e].tier==="live"),N=Object.keys(o.files).filter(e=>o.files[e].tier==="lazy");function g(e,t){return`${e.replace(/\/+$/,"")}/${o.fp12}/${t}`}async function b(e,t,d,p=fetch,n=()=>performance.now()){let c=o.files[t],y=n(),f=async s=>{try{let r=await p(g(e,t),{cache:s,signal:d,credentials:"omit"});if(!r.ok)throw new i("download");return await r.arrayBuffer()}catch(r){throw r instanceof i?r:new i("download")}},l=async s=>s.byteLength===c.bytes&&await m(s)===c.sha256,a=await f("force-cache");if(!await l(a)&&(a=await f("reload"),!await l(a)))throw new i("integrity");return{bytes:a,ms:n()-y}}async function T(e,t,d,p=fetch,n=()=>performance.now()){let c=new AbortController,y=new Map,f=t.reduce((r,u)=>r+o.files[u].bytes,0),l=n(),a=!0,s=0;for(let r of t){let u=await b(e,r,c.signal,p,n);y.set(r,u.bytes),u.ms>=50&&(a=!1),s+=u.bytes.byteLength;let h=n()-l;if(s<f&&h>0&&h*f/s>d)throw c.abort(),new i("download")}return{files:y,downloadMs:Math.round(n()-l),cached:a}}function _(e,t){return e==="hosted"?"/models-ocr":t==="live"?"https://assets.sekyro.ai/sdk/web/ocr":"https://assets-staging.sekyro.ai/sdk/web/ocr"}export{x as a,i as b,B as c,T as d,_ as e};
|
package/dist/chunk-C5FD3ADY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-TSA6GHUG.js";import{a as h,c as y}from"./chunk-U3JUGEIW.js";var w=["session_token_invalid","session_token_required","session_token_session_mismatch","session_not_found","rate_limit_exceeded","consent_required","session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_type_unsupported","force_outcome_forbidden","attestation_invalid","platform_unregistered","app_attest_invalid","too_many_challenges","inference_unavailable","mobile_required","nni_locked","document_nni_mismatch","media_content_type_not_allowed","media_too_large","media_key_invalid","media_key_forbidden","media_not_found","media_unreadable","media_session_invalid","idempotency_key_collision","idempotency_in_progress","idempotency_key_required","validation_error","internal_error","unknown_error","upload_failed","network_error","timeout","nfc_outcome_not_accepted","identity_confirm_required","identity_confirm_locked","choice_not_found","choice_locked","choice_option_unavailable","step_not_on_path","check_not_active","sekyro_app_not_allowed","sekyro_app_unverified","id_number_locked","document_id_number_mismatch","simulated_capture_forbidden"];function D(s){return w.includes(s)}var c=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}};function _(s,e,n=Math.random){let t=(s??e)*1e3,o=Math.min(Math.max(t,500),2e4),i=Math.round(o*(1+(n()*2-1)*.25));return Math.min(Math.max(i,500),2e4)}var k=6e4,b=4,R=3e4,I=9e5,P=200,E=5,M=400,C=new Set(["server_busy","request_timeout"]),A=2;function l(s){return(s.split(";")[0]??"").trim()}var O={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},v=`@sekyro/web/${h}`,N=v,g=class{constructor(e){this.sessionId=null;this.bootstrap=null;this.captureNonces=[];this.captureFetch=null;this.reportedIssues=new Map;this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let n=e.fetch;this.fetchImpl=(t,o)=>(n??globalThis.fetch).call(globalThis,t,o),this.requestTimeoutMs=e.requestTimeoutMs??R,this.retryAttempts=e.inProgressRetry?.attempts??E,this.retryDelayMs=e.inProgressRetry?.delayMs??M,this.random=e.random??Math.random}async getSession(){let e=await this.api("GET","/hosted/session");return this.sessionId=e.sessionId,e}async recordConsent(e){return this.api("POST","/hosted/consent",{body:{locale:e},busyRetry:!0})}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async testerGate(e){return this.api("POST","/hosted/tester-gate",{body:{input:e}})}async reportCaptureIssue(e){let n=typeof e.name=="string"?e.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",t=typeof e.engineKind=="string"&&/^[a-z_]{1,32}$/.test(e.engineKind)?e.engineKind:void 0,o=typeof e.attempt=="number"&&Number.isInteger(e.attempt)&&e.attempt>=0&&e.attempt<=1e3?e.attempt:void 0,i=[e.check,o??"",e.kind,n,e.phase??""].join("|"),a=this.reportedIssues.get(i);if(a!==void 0)return a;let d={check:e.check,kind:e.kind,...n!==""?{name:n}:{},...e.phase!==void 0?{phase:e.phase}:{},...t!==void 0?{engineKind:t}:{},...o!==void 0?{attempt:o}:{},...e.formFactor!==void 0?{formFactor:e.formFactor}:{}},r=this.api("POST","/hosted/capture-issue",{body:d,empty:!0}).catch(()=>{this.reportedIssues.delete(i)});return this.reportedIssues.set(i,r),r}async choose(e,n){let t=await this.api("POST","/hosted/choice",{body:{nodeId:e,option:n},busyRetry:!0});return this.sessionId=t.sessionId,t}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,n,t,o={}){let i=await this.ensureSessionId(),a={kind:e,contentType:l(n),contentLength:t,...o.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${i}/media`,{body:a})}armCapture(e=2){this.fillCaptureNonces(e)}async presignCapture(e,n,t,o={}){let i=await this.ensureSessionId(),a=await this.takeCaptureNonce(),d=a===void 0?void 0:{nonce:a,...o.engine!==void 0?{engine:o.engine.slice(0,32)}:{},...o.durationMs!==void 0&&Number.isFinite(o.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(o.durationMs)))}:{}},r={kind:e,contentType:l(n),contentLength:t,capture:d};return this.api("POST",`/sessions/${i}/media`,{body:r})}async takeCaptureNonce(){let e=()=>{let n=Date.now();return this.captureNonces=this.captureNonces.filter(t=>t.expiresAt-k>n),this.captureNonces.shift()?.nonce};for(let n=0;n<2;n++){let t=e();if(t!==void 0)return t;await this.fillCaptureNonces(1)}return e()}fillCaptureNonces(e){return this.captureFetch??(this.captureFetch=(async()=>{try{let n=await this.ensureSessionId(),t=await this.api("POST",`/sessions/${n}/media/capture-nonces`,{body:{count:Math.min(b,Math.max(1,e))}}),o=Date.now()+Math.max(0,t.expiresIn)*1e3;for(let i of Array.isArray(t.nonces)?t.nonces:[])typeof i=="string"&&i.length>0&&this.captureNonces.push({nonce:i,expiresAt:o});this.captureNonces=this.captureNonces.slice(-b)}catch{}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,n,t){let o;try{o=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":l(t)},body:n,signal:AbortSignal.timeout(I)})}catch(i){throw m(i)}if(!o.ok){let i=(await o.text().catch(()=>"")).slice(0,P);throw new c({status:o.status,code:"upload_failed",message:`media upload failed (HTTP ${o.status})${i?`: ${i}`:""}`})}}async completeMedia(e){let n=await this.ensureSessionId();return this.api("POST",`/sessions/${n}/media/complete`,{body:{key:e}})}async submitCheck(e,n,t={}){let o=await this.ensureSessionId(),i={input:n,forceOutcome:t.forceOutcome};return this.api("POST",`/sessions/${o}/checks/${e}`,{body:i,idempotencyKey:t.idempotencyKey,busyRetry:t.idempotencyKey!==void 0})}async uploadAndSubmit(e,n,t,o={}){let i=l(n.contentType),a=await this.presign(n.kind,i,n.blob.size);await this.uploadToSpaces(a.uploadUrl,n.blob,i);let d=await this.completeMedia(a.key),r={...t,[O[e]]:d.key};return this.submitCheck(e,r,o)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,n,t={}){let o=e==="GET"||t.busyRetry===!0,i=`${this.apiOrigin}/api/v2${n}`,a={"x-session-token":this.sessionToken,"x-sekyro-sdk":N};t.body!==void 0&&(a["content-type"]="application/json"),t.idempotencyKey!==void 0&&(a["x-idempotency-key"]=t.idempotencyKey);try{let d=y.timezone();d!==void 0&&(a["sekyro-client-timezone"]=d)}catch{}a["sekyro-client-form-factor"]=f();try{let d=await y.deviceHeader();d!==void 0&&(a["sekyro-client-device"]=d)}catch{}for(let d=0;;d++){let r;try{r=await this.fetchImpl(i,{method:e,headers:a,...t.body!==void 0?{body:JSON.stringify(t.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(p){throw m(p)}if(r.ok){if(t.empty===!0)return;if(t.blob===!0)try{return await r.blob()}catch(S){throw m(S)}let p;try{p=await r.json()}catch{throw new c({status:r.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${r.status})`})}return H(p)}let u=await x(r);if(u.code==="idempotency_in_progress"&&d<this.retryAttempts){this.retryDelayMs>0&&await T(this.retryDelayMs);continue}if(o&&u.status===503&&C.has(u.code)){o=!1,await T(_(u.retryAfterSeconds,A,this.random));continue}throw u}}};function m(s){if((typeof s=="object"&&s!==null?s.name:void 0)==="TimeoutError")return new c({status:0,code:"timeout",message:"request timed out"});let n=s instanceof Error?s.message:String(s);return new c({status:0,code:"network_error",message:`network request failed: ${n}`})}function H(s){return s!==null&&typeof s=="object"&&"success"in s&&"data"in s?s.data:s}async function x(s){let e="unknown_error",n=`request failed (HTTP ${s.status})`,t=Number.NaN,o;try{let d=await s.json();if(d!==null&&typeof d=="object"){let r=d;typeof r.code=="string"&&r.code.length>0&&(e=r.code),typeof r.message=="string"&&r.message.length>0&&(n=r.message),typeof r.retryAfterSeconds=="number"&&(t=r.retryAfterSeconds),Array.isArray(r.details?.issues)&&(o=r.details)}}catch{}let i=s.headers.get("retry-after"),a=i===null?Math.floor(t):Number.parseInt(i,10);return new c({status:s.status,code:e,message:n,...Number.isFinite(a)&&a>=0?{retryAfterSeconds:a}:{},details:o})}function T(s){return new Promise(e=>setTimeout(e,s))}function L(s){let e=s?.portrait,n=e?.icao,t=e?.purpose==="id_document";return n==null?t?{policy:"reject",profile:"id_document"}:null:{policy:n.policy==="alert"?"alert":"reject",profile:t||n.profile==="id_document"?"id_document":"selfie"}}function j(s){return{...s.baselineEyeOpenness!==void 0?{baselineEyeOpenness:s.baselineEyeOpenness}:{},...s.baselineEyeOpennessLeft!==void 0&&s.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:s.baselineEyeOpennessLeft,baselineEyeOpennessRight:s.baselineEyeOpennessRight}:{},criteria:s.verdict??{},...s.backgroundCheck!==void 0?{backgroundCheck:s.backgroundCheck}:{}}}export{w as a,D as b,c,_ as d,l as e,v as f,g,L as h,j as i};
|
package/dist/chunk-HVW2AB35.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var b=new Set(["challenge_frame_blocked","challenge_script_blocked","site_key_rejected","challenge_failed","timeout","embedder_opaque"]),i=class extends Error{constructor(n,r){super(`Sekyro challenge failed: ${n}${r!==void 0?` (${r})`:""}`),this.name="ChallengeError",this.code=n,r!==void 0&&(this.detail=r)}},p=1e4,E=3e4,_="sekyro.challenge.",v="position:fixed;width:1px;height:1px;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none;border:0",c=null,g=Promise.resolve();function A(){u(),g=Promise.resolve(),m=!1}function d(){return new i("aborted")}function k(){let e=globalThis.crypto;return e!==void 0&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function y(e){return new URL(e,document.baseURI).origin}function u(){let e=c;if(e!==null){c=null,window.removeEventListener("message",e.listener),e.iframe.remove();for(let n of e.waiters.values())n.reject(new i("challenge_frame_blocked"));e.waiters.clear()}}function C(e,n){if(n.source!==e.iframe.contentWindow||n.origin!==e.origin)return;let r=n.data;if(typeof r!="object"||r===null)return;let t=r;if(typeof t.type!="string"||!t.type.startsWith(_)||t.v!==1)return;if(t.type==="sekyro.challenge.ready"){e.isReady=!0,e.onReady?.();return}if(typeof t.id!="string")return;let a=e.waiters.get(t.id);if(a!==void 0){if(t.type==="sekyro.challenge.token"&&typeof t.token=="string"&&t.token!=="")e.waiters.delete(t.id),a.resolve(t.token);else if(t.type==="sekyro.challenge.error"){e.waiters.delete(t.id);let o=typeof t.code=="string"&&b.has(t.code)?t.code:"challenge_failed",s=typeof t.detail=="string"||typeof t.detail=="number"?String(t.detail).slice(0,32):void 0;a.reject(new i(o,s))}}}function M(e){if(c!==null&&c.url===e)return c;u();let n=document.createElement("iframe");n.setAttribute("title","Security check"),n.setAttribute("aria-hidden","true"),n.setAttribute("tabindex","-1"),n.setAttribute("referrerpolicy","no-referrer"),n.setAttribute("style",v);let r={url:e,origin:y(e),iframe:n,isReady:!1,onReady:null,waiters:new Map,listener:t=>C(r,t)};return window.addEventListener("message",r.listener),n.src=e,document.body.appendChild(n),c=r,r}function x(e,n,r){return e.isReady?Promise.resolve():new Promise((t,a)=>{let o=()=>{clearTimeout(l),r?.removeEventListener("abort",s),e.onReady=null},s=()=>{o(),a(d())},l=setTimeout(()=>{o(),a(new i("challenge_frame_blocked"))},n);r?.addEventListener("abort",s,{once:!0}),e.onReady=()=>{o(),t()}})}async function h(e){let n=e.signal;if(n?.aborted)throw d();let r=M(e.frameUrl);await x(r,e.readyTimeoutMs??p,n);let t=r.iframe.contentWindow;if(t===null)throw new i("challenge_frame_blocked");let a=e.timeoutMs??E,o=k(),s,l;try{return await new Promise((w,f)=>{r.waiters.set(o,{resolve:w,reject:f}),s=setTimeout(()=>f(new i("timeout")),a),n!==void 0&&(l=()=>f(d()),n.addEventListener("abort",l,{once:!0})),t.postMessage({type:"sekyro.challenge.request",v:1,id:o,siteKey:e.siteKey,action:e.action,subject:e.subject},r.origin)})}finally{clearTimeout(s),n!==void 0&&l!==void 0&&n.removeEventListener("abort",l),r.waiters.delete(o)}}var m=!1;function R(e,n){if(m)return;let r;if(n==="challenge_frame_blocked"){let t=e;try{t=y(e)}catch{}r=`Sekyro: the security check frame could not load. Allow \`frame-src ${t}\` in your Content-Security-Policy.`}else if(n==="embedder_opaque")r="Sekyro: the security check needs a page with an origin. Do not run the SDK in a sandboxed or data: document.";else return;m=!0,console.warn(r)}async function S(e){if(globalThis.origin==="null")throw new i("embedder_opaque");if(e.signal?.aborted)throw d();try{return await h(e)}catch(n){if(u(),e.signal?.aborted||n instanceof i&&n.code==="aborted")throw d();try{return await h(e)}catch(r){throw u(),e.signal?.aborted?d():r instanceof i?r:new i("challenge_failed")}}}function T(e){let n=()=>S(e).catch(t=>{throw t instanceof i&&R(e.frameUrl,t.code),t}),r=g.then(n,n);return g=r.catch(()=>{}),r}export{i as a,p as b,E as c,A as d,T as e};
|
package/dist/chunk-NFHLJOHW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o={"ID-1":{center:1.586,tolerance:.15},"ID-2":{center:1.419,tolerance:.12},"ID-3":{center:1.42,tolerance:.2}},c={"ID-1":["ID-1"],"ID-2":["ID-2"],"ID-3":["ID-3"],card:["ID-1","ID-2"]};function i(e){return o[e==="card"?"ID-1":e]}function d(e,r){return c[e].some(t=>Math.abs(r-o[t].center)<=o[t].tolerance)}var a=[{docType:"carte_identite",format:"ID-1",sides:["recto","verso"],mrz:"td1",portraitSide:"recto",aspectRatio:1.586,identifierSource:"mrz"},{docType:"passport",format:"ID-3",sides:["single"],mrz:"td3",portraitSide:"single",aspectRatio:1.42,identifierSource:"mrz"}],n=[...a,{docType:"residence_permit",format:"ID-1",sides:["recto","verso"],mrz:"td1",portraitSide:"recto",aspectRatio:1.586,identifierSource:"mrz"},{docType:"drivers_license",format:"ID-1",sides:["recto","verso"],mrz:"none",portraitSide:"recto",aspectRatio:1.586}];function s(e){let r=n.find(t=>t.docType===e);return r===void 0||r.format==="ID-1"?"card":r.format}export{o as a,i as b,d as c,a as d,n as e,s as f};
|