@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260609-11ba3e8a

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 (211) hide show
  1. package/dist/ae-signature/ae-signature.es.js +15 -13
  2. package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
  3. package/dist/antifraud/antifraud.es.js +22 -19
  4. package/dist/authentication/authentication.es.js +42 -33
  5. package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
  6. package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
  7. package/dist/back-tutorial-vb1MxlrT.js +14597 -0
  8. package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
  9. package/dist/backdevicelottie-HypPqBz7.js +16690 -0
  10. package/dist/base.css +5 -0
  11. package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
  12. package/dist/bottomSheet-BuzqNQtG.js +39 -0
  13. package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
  14. package/dist/button-B-qlr4iI.js +35 -0
  15. package/dist/checkbox-CTPETqo5.js +96 -0
  16. package/dist/consent/consent.es.js +75 -64
  17. package/dist/countrySelector-CzyuaDIs.js +60 -0
  18. package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
  19. package/dist/cpfOcr-DQVs3r8N.js +92 -0
  20. package/dist/cpfOcr-WNklFuxT.js +2 -0
  21. package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
  22. package/dist/curp-validation/curp-validation.es.js +246 -211
  23. package/dist/customFields-B4MqqDI6.js +140 -0
  24. package/dist/customWatchlist-Dfqw1DQP.js +36 -0
  25. package/dist/dateInputComposed-BsPQHG5o.js +1 -0
  26. package/dist/dateInputComposed-DY97tQVK.js +69 -0
  27. package/dist/defineProperty-mefzVtTv.js +39 -0
  28. package/dist/document-capture/document-capture.es.js +2 -2
  29. package/dist/documentCapture-BE78MIlR.js +876 -0
  30. package/dist/documentCapture-BVfNZL29.js +2 -0
  31. package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
  32. package/dist/dropdownComposed-mvHuRFHn.js +1 -0
  33. package/dist/dynamicForms-BYGGAQoc.js +352 -0
  34. package/dist/ekyb/ekyb.es.js +2 -2
  35. package/dist/ekybModule-BUPX0QhW.js +2 -0
  36. package/dist/ekybModule-CkTXu-4u.js +279 -0
  37. package/dist/ekyc/ekyc.es.js +2 -2
  38. package/dist/ekycModule-BWsVX39d.js +257 -0
  39. package/dist/ekycModule-DNDPqvUc.js +2 -0
  40. package/dist/electronic-signature/electronic-signature.es.js +2 -2
  41. package/dist/electronic-signature-BJSyzex9.js +426 -0
  42. package/dist/email/email.es.js +198 -78
  43. package/dist/emailInput-BHp4Apt4.js +39 -0
  44. package/dist/errorIcon-B0rmz3rw.js +26 -0
  45. package/dist/expiredId-C105HVKv.js +85 -0
  46. package/dist/extensibility-DJwVxojG.js +3070 -0
  47. package/dist/extensibility.es.js +26 -26
  48. package/dist/face-match/face-match.es.js +2 -2
  49. package/dist/faceMatch-BOFGxzzx.js +343 -0
  50. package/dist/faceMatch-CDMcFQwR.js +2 -0
  51. package/dist/field-comparison/field-comparison.es.js +2 -2
  52. package/dist/fieldComparison-BMDmQ8eA.js +88 -0
  53. package/dist/fieldComparison-Z1NleSxD.js +2 -0
  54. package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
  55. package/dist/flow/flow.es.js +597 -493
  56. package/dist/flow/styles.css +0 -8
  57. package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
  58. package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
  59. package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
  60. package/dist/geolocation/geolocation.es.js +485 -395
  61. package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
  62. package/dist/governmentValidation/governmentValidation.es.js +145 -64
  63. package/dist/governmentValidation/styles.css +0 -36
  64. package/dist/homeScreen-BsEYyiDB.js +264 -0
  65. package/dist/hooks-BtgmGvba.js +149 -0
  66. package/dist/i18n-gTHArCl9.js +2971 -0
  67. package/dist/icons-DKY3xDkf.js +360 -0
  68. package/dist/id/id.es.js +565 -413
  69. package/dist/id-laser-h-DX8UbVNH.js +467 -0
  70. package/dist/id-laser-v-DhnHdjlB.js +490 -0
  71. package/dist/id-tutorial-lj4iKtYT.js +13165 -0
  72. package/dist/id-verification/id-verification.es.js +21 -18
  73. package/dist/idOcr-BS77o1VC.js +123 -0
  74. package/dist/identity-reuse/identity-reuse.es.js +168 -130
  75. package/dist/incode-logo-57XFniXU.js +4 -0
  76. package/dist/incodeComponent-CDJxFZvS.js +63 -0
  77. package/dist/incodeModule-DkA_yd0X.js +13 -0
  78. package/dist/index.es.js +16 -14
  79. package/dist/inputComposed-5V2nLTqH.js +99 -0
  80. package/dist/inputComposed-BPOYwUBl.js +1 -0
  81. package/dist/loadingIcon-DN62ugKs.js +148 -0
  82. package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
  83. package/dist/mandatoryConsent-DP189TUn.js +107 -0
  84. package/dist/modal-B5QeulDu.js +153 -0
  85. package/dist/modal.hooks-C7K9k_pY.js +202 -0
  86. package/dist/numberedStep-DVAyTPv1.js +13 -0
  87. package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
  88. package/dist/otpInput-2IQ-JCK8.js +195 -0
  89. package/dist/page-BZ-0eNWq.js +71 -0
  90. package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
  91. package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
  92. package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
  93. package/dist/pdf-BZA70WbM.js +22398 -0
  94. package/dist/pdfViewer-Dr63sJ51.js +114 -0
  95. package/dist/phone/phone.es.js +214 -87
  96. package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
  97. package/dist/processing-B_u8wUB7.js +8 -0
  98. package/dist/qe-signature/qe-signature.es.js +15 -13
  99. package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
  100. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
  101. package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
  102. package/dist/requiredLabelHint-DEadtiwx.js +17 -0
  103. package/dist/richText-C7GUm0WL.js +3153 -0
  104. package/dist/rolldown-runtime--E5BIlTp.js +33 -0
  105. package/dist/selfie/selfie.es.js +54 -42
  106. package/dist/selfieTutorial-CtruLyO2.js +2689 -0
  107. package/dist/signature/signature.es.js +765 -406
  108. package/dist/snackbar-Dz9crm39.js +16 -0
  109. package/dist/spinner-BfBIZkDQ.js +42 -0
  110. package/dist/spinner-DEDtE7Pz.js +1 -0
  111. package/dist/statusPage-CVCoieyd.js +28 -0
  112. package/dist/successIcon-rmzr-pxu.js +30 -0
  113. package/dist/tabs--UMd6eEB.js +103 -0
  114. package/dist/transitionSpinner-CWhGcr7c.js +26 -0
  115. package/dist/{tutorial-QzQ536BL.js → tutorial-Jv0noW4z.js} +832 -578
  116. package/dist/types/extensibility.d.ts +3 -1
  117. package/dist/types/index.d.ts +13 -4
  118. package/dist/typography-BK4AmfKX.js +45 -0
  119. package/dist/uiConfig-sgEkFuuA.js +25 -0
  120. package/dist/useModuleLoader-CuhHtmgr.js +670 -0
  121. package/dist/vendor-preact-BH7vOa2r.js +957 -0
  122. package/dist/verificationResult-CJ0JyV6A.js +64 -0
  123. package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
  124. package/dist/watchlist/watchlist.es.js +31 -26
  125. package/dist/watchlistForBusiness-RZcnjVDb.js +80 -0
  126. package/dist/workflow/styles.css +0 -8
  127. package/dist/workflow/workflow.es.js +251 -209
  128. package/package.json +4 -2
  129. package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
  130. package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
  131. package/dist/back-tutorial-DhSE2FJo.js +0 -14585
  132. package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
  133. package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
  134. package/dist/bottomSheet-QrpyatOD.js +0 -31
  135. package/dist/browser-ponyfill-Crda_c5R.js +0 -299
  136. package/dist/button-DcCUEn2n.js +0 -24
  137. package/dist/checkbox-DCCzBAuF.js +0 -86
  138. package/dist/countrySelector-CJ8egQ4C.js +0 -58
  139. package/dist/cpfOcr-Db06i-Lm.js +0 -2
  140. package/dist/cpfOcr-FixhUeMQ.js +0 -79
  141. package/dist/customFields-C1G9xHNX.js +0 -125
  142. package/dist/customWatchlist-IKEblz7u.js +0 -31
  143. package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
  144. package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
  145. package/dist/defineProperty-xczUyn-m.js +0 -39
  146. package/dist/documentCapture-D9I7FjGe.js +0 -2
  147. package/dist/documentCapture-b61wlala.js +0 -765
  148. package/dist/dropdownComposed-B4U0AIak.js +0 -1
  149. package/dist/dropdownComposed-CS2pyn-g.js +0 -293
  150. package/dist/dynamicForms-tYQog0kw.js +0 -298
  151. package/dist/ekybModule-C33C4JES.js +0 -237
  152. package/dist/ekybModule-LON6G2Bz.js +0 -2
  153. package/dist/ekycModule-BJOgtTAh.js +0 -225
  154. package/dist/ekycModule-BSf_DIG7.js +0 -2
  155. package/dist/electronic-signature-OdgTyso4.js +0 -406
  156. package/dist/emailInput-CU7mLB21.js +0 -37
  157. package/dist/errorIcon-DpHzAoAo.js +0 -24
  158. package/dist/expiredId-nfVAZgTL.js +0 -70
  159. package/dist/extensibility-BbNy3mVG.js +0 -2602
  160. package/dist/faceMatch-BIila4kf.js +0 -2
  161. package/dist/faceMatch-DJ7Mqujx.js +0 -206
  162. package/dist/fieldComparison-D2RSFYl-.js +0 -84
  163. package/dist/fieldComparison-DbUyouFd.js +0 -2
  164. package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
  165. package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
  166. package/dist/homeScreen-CyPddxWl.js +0 -227
  167. package/dist/hooks-MxHtZWTS.js +0 -112
  168. package/dist/i18n-Kzzvkz94.js +0 -2019
  169. package/dist/icons-9I5g9-_1.js +0 -292
  170. package/dist/id-laser-h-iCPbFixz.js +0 -467
  171. package/dist/id-laser-v-CNzwliP2.js +0 -483
  172. package/dist/id-tutorial-CF4nO4oX.js +0 -13153
  173. package/dist/idOcr-DlMLMDqa.js +0 -97
  174. package/dist/incode-logo-DX016usY.js +0 -4
  175. package/dist/incodeComponent-BoFhgK7G.js +0 -50
  176. package/dist/incodeModule-BiCoAJ5k.js +0 -13
  177. package/dist/inputComposed-DAEey9xm.js +0 -94
  178. package/dist/inputComposed-eS4B0Mkh.js +0 -1
  179. package/dist/loadingIcon-BN5YRQUb.js +0 -104
  180. package/dist/lottie_light-DLqSnziX.js +0 -4419
  181. package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
  182. package/dist/modal-ZqAhwiRF.js +0 -135
  183. package/dist/modal.hooks-LdusROLW.js +0 -126
  184. package/dist/numberedStep-CdLWASwL.js +0 -11
  185. package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
  186. package/dist/otpInput-C4pk4BJU.js +0 -157
  187. package/dist/page-DA3R7q0J.js +0 -69
  188. package/dist/pdf-51QeiFSx.js +0 -14967
  189. package/dist/pdfViewer-rKzTHket.js +0 -64
  190. package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
  191. package/dist/processing-DPktVde2.js +0 -6
  192. package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
  193. package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
  194. package/dist/requiredLabelHint-B6FN3v88.js +0 -13
  195. package/dist/richText-6pIbydcz.js +0 -1973
  196. package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
  197. package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
  198. package/dist/snackbar-CQiiWO4p.js +0 -14
  199. package/dist/spinner-B4dcie2T.js +0 -1
  200. package/dist/spinner-CKnjVHxw.js +0 -39
  201. package/dist/statusPage-B8b3Jg6N.js +0 -28
  202. package/dist/successIcon-SlKgTSty.js +0 -28
  203. package/dist/tabs-D7lGst3Q.js +0 -78
  204. package/dist/transitionSpinner-Di3bOyOu.js +0 -17
  205. package/dist/typography-CxjaknHN.js +0 -28
  206. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  207. package/dist/useModuleLoader-Bqs7fglI.js +0 -517
  208. package/dist/vendor-preact-D6SntenC.js +0 -958
  209. package/dist/verificationResult-DhT3hH1b.js +0 -90
  210. package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
  211. package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
@@ -0,0 +1,107 @@
1
+ import { n as useTranslation } from "./i18n-gTHArCl9.js";
2
+ import { _ as y, l as A, v as u } from "./vendor-preact-BH7vOa2r.js";
3
+ import { a as isTerminalModuleState, c as useManager, o as useModuleTerminalCallbacks } from "./hooks-BtgmGvba.js";
4
+ import { t as IncodeComponent } from "./incodeComponent-CDJxFZvS.js";
5
+ import { t as Page } from "./page-BZ-0eNWq.js";
6
+ import { t as TransitionSpinner } from "./transitionSpinner-CWhGcr7c.js";
7
+ import { t as Button } from "./button-B-qlr4iI.js";
8
+ import { t as Checkbox } from "./checkbox-CTPETqo5.js";
9
+ import { t as registerIncodeModuleElement } from "./incodeModule-DkA_yd0X.js";
10
+ import { t as RichText } from "./richText-C7GUm0WL.js";
11
+ import { createMandatoryConsentManager } from "@incodetech/core/mandatory-consent";
12
+ //#region src/modules/mandatory-consent/mandatoryConsent.tsx
13
+ var stopLinkPropagation = (event) => {
14
+ if (event.target.closest("a")) event.stopPropagation();
15
+ };
16
+ var MandatoryConsentContent = ({ config, manager: externalManager, onFinish, onError }) => {
17
+ const { t, i18n } = useTranslation();
18
+ const titleRef = A(null);
19
+ const [state, manager] = useManager(() => {
20
+ if (externalManager) return externalManager;
21
+ if (!config) throw new Error("MandatoryConsent config is required when no manager is provided");
22
+ return createMandatoryConsentManager({ config: {
23
+ ...config,
24
+ language: i18n.language
25
+ } });
26
+ }, { manageLifecycle: !externalManager });
27
+ y(() => {
28
+ if (state.status === "display") titleRef.current?.focus();
29
+ }, [state.status]);
30
+ useModuleTerminalCallbacks({
31
+ status: state.status,
32
+ onFinish,
33
+ onError,
34
+ error: state.status === "error" ? state.error : void 0
35
+ });
36
+ if (isTerminalModuleState(state)) return null;
37
+ if (state.status === "idle" || state.status === "loading") return /* @__PURE__ */ u(TransitionSpinner, { hideText: true });
38
+ const consentBody = state.text.split("\n").filter((line) => line.trim().length > 0).join(" ");
39
+ const isMandatoryConsent = (config?.type ?? "MANDATORY") === "MANDATORY";
40
+ return /* @__PURE__ */ u(Page, {
41
+ className: "IncodeConsentPage",
42
+ title: state.title,
43
+ children: /* @__PURE__ */ u("div", {
44
+ class: "IncodeConsentContent",
45
+ children: [
46
+ /* @__PURE__ */ u("div", {
47
+ class: "IncodeConsentBody",
48
+ children: [/* @__PURE__ */ u("p", {
49
+ class: "IncodeConsentSubtitle",
50
+ children: t("biometricConsent.subtitle")
51
+ }), /* @__PURE__ */ u("div", {
52
+ class: "IncodeConsentCheckboxList",
53
+ children: /* @__PURE__ */ u(Checkbox, {
54
+ id: "mandatory-consent-checkbox",
55
+ class: "IncodeConsentCheckbox",
56
+ checked: state.isSigned,
57
+ required: true,
58
+ onChange: () => manager.toggle(),
59
+ label: /* @__PURE__ */ u("span", {
60
+ class: "IncodeConsentCheckboxLabel",
61
+ role: "presentation",
62
+ onClick: stopLinkPropagation,
63
+ onKeyDown: stopLinkPropagation,
64
+ children: /* @__PURE__ */ u(RichText, {
65
+ content: consentBody,
66
+ class: "IncodeRichText"
67
+ })
68
+ })
69
+ })
70
+ })]
71
+ }),
72
+ state.status === "display" && state.error ? /* @__PURE__ */ u("p", {
73
+ class: "IncodeConsentSubmitError",
74
+ "data-testid": "mandatory-consent-submit-error",
75
+ role: "alert",
76
+ children: state.error
77
+ }) : null,
78
+ /* @__PURE__ */ u("div", {
79
+ class: "IncodeConsentActions",
80
+ children: [/* @__PURE__ */ u(Button, {
81
+ "data-testid": "mandatory-consent-submit",
82
+ class: !isMandatoryConsent ? "IncodeConsentButton" : void 0,
83
+ onClick: () => manager.submit(),
84
+ disabled: !state.canSubmit,
85
+ isLoading: state.status === "submitting",
86
+ children: t("biometricConsent.button.continue")
87
+ }), isMandatoryConsent && /* @__PURE__ */ u(Button, {
88
+ variant: "link",
89
+ onClick: () => manager.cancel(),
90
+ children: t("biometricConsent.button.cancel")
91
+ })]
92
+ })
93
+ ]
94
+ })
95
+ }, "ready");
96
+ };
97
+ var MandatoryConsent = ({ config, manager, onFinish, onError }) => {
98
+ return /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(MandatoryConsentContent, {
99
+ config,
100
+ manager,
101
+ onFinish,
102
+ onError
103
+ }) : null });
104
+ };
105
+ registerIncodeModuleElement(MandatoryConsent, "incode-mandatory-consent");
106
+ //#endregion
107
+ export { MandatoryConsent };
@@ -0,0 +1,153 @@
1
+ import { C as t, b as K, d as T, f as _, g as x, h as q, l as A, p as d, r as $, v as u, x as Q, y as H } from "./vendor-preact-BH7vOa2r.js";
2
+ import { n as cn } from "./loadingIcon-DN62ugKs.js";
3
+ import { o as CloseIcon } from "./icons-DKY3xDkf.js";
4
+ import { a as useModalPortalTarget, i as useModalFocusCapture, n as useModalBodyScrollLock, o as useModalTabCycle, r as useModalEscapeDismiss, t as MODAL_INITIAL_FOCUS_ATTR } from "./modal.hooks-C7K9k_pY.js";
5
+ //#region src/shared/modal/modal.tsx
6
+ var ModalContext = Q(null);
7
+ function useModalContext() {
8
+ const ctx = x(ModalContext);
9
+ if (!ctx) throw new Error("Modal compound components must be used within Modal.Root");
10
+ return ctx;
11
+ }
12
+ function ModalRoot({ open, children, onOpenChange, dismissible = true, portalContainer, class: className, hasBackdrop = true, manageInitialFocus = true, returnFocusRef }) {
13
+ const portalTarget = useModalPortalTarget(open, portalContainer ?? void 0);
14
+ const [hasDescription, setHasDescription] = d(false);
15
+ const dialogRef = A(null);
16
+ const requestClose = q(() => {
17
+ if (!dismissible) return;
18
+ onOpenChange?.(false);
19
+ }, [dismissible, onOpenChange]);
20
+ const contextValue = T(() => ({
21
+ setHasDescription,
22
+ dismissible,
23
+ requestClose
24
+ }), [dismissible, requestClose]);
25
+ const dialogActive = open && Boolean(portalTarget);
26
+ useModalBodyScrollLock(open);
27
+ useModalEscapeDismiss(open, dismissible, requestClose);
28
+ useModalFocusCapture(dialogActive, dialogRef, manageInitialFocus, returnFocusRef);
29
+ useModalTabCycle(dialogActive, dialogRef);
30
+ if (!portalTarget || !open) return null;
31
+ return $(/* @__PURE__ */ u(ModalContext.Provider, {
32
+ value: contextValue,
33
+ children: /* @__PURE__ */ u("div", {
34
+ class: cn("IncodeModalRoot", className),
35
+ "data-incode-modal": "",
36
+ children: [hasBackdrop && /* @__PURE__ */ u("div", {
37
+ class: "IncodeModalBackdrop",
38
+ "aria-hidden": "true",
39
+ onMouseDown: () => {
40
+ requestClose();
41
+ }
42
+ }), /* @__PURE__ */ u("div", {
43
+ ref: dialogRef,
44
+ class: "IncodeModalDialog",
45
+ role: "dialog",
46
+ "aria-modal": "true",
47
+ "aria-labelledby": "incode-modal-title",
48
+ "aria-describedby": hasDescription ? "incode-modal-description" : void 0,
49
+ tabIndex: -1,
50
+ onMouseDown: (event) => {
51
+ event.stopPropagation();
52
+ },
53
+ children
54
+ })]
55
+ })
56
+ }), portalTarget);
57
+ }
58
+ function ModalContent({ children, class: className }) {
59
+ return /* @__PURE__ */ u("div", {
60
+ class: cn("IncodeModalContent", className),
61
+ children
62
+ });
63
+ }
64
+ function ModalClose({ "aria-label": ariaLabel = "Close", title: titleAttr = "Close", class: className, onClick }) {
65
+ const { dismissible, requestClose } = useModalContext();
66
+ if (!dismissible) return null;
67
+ const handleClose = async () => {
68
+ if (onClick) await onClick();
69
+ requestClose();
70
+ };
71
+ return /* @__PURE__ */ u("button", {
72
+ type: "button",
73
+ class: cn("IncodeModalClose", className),
74
+ "aria-label": ariaLabel,
75
+ title: titleAttr,
76
+ onClick: handleClose,
77
+ children: /* @__PURE__ */ u(CloseIcon, {
78
+ height: 32,
79
+ width: 32,
80
+ fillColor: "var(--icon-neutral-300)"
81
+ })
82
+ });
83
+ }
84
+ function ModalIcon({ children, class: className }) {
85
+ return /* @__PURE__ */ u("div", {
86
+ class: cn("IncodeModalIcon", className),
87
+ children
88
+ });
89
+ }
90
+ function ModalTitleSection({ children, align = "center" }) {
91
+ const className = {
92
+ center: "IncodeModalTitleSectionCenter",
93
+ left: "IncodeModalTitleSectionLeft"
94
+ }[align];
95
+ return /* @__PURE__ */ u("div", {
96
+ class: className,
97
+ children
98
+ });
99
+ }
100
+ function ModalTitle({ children, ref, class: className }) {
101
+ return /* @__PURE__ */ u("h2", {
102
+ id: "incode-modal-title",
103
+ ref,
104
+ className: cn("IncodeModalTitle", className),
105
+ children
106
+ });
107
+ }
108
+ function ModalSubtitle({ children, class: className }) {
109
+ const { setHasDescription } = useModalContext();
110
+ _(() => {
111
+ setHasDescription(true);
112
+ return () => setHasDescription(false);
113
+ }, [setHasDescription]);
114
+ return /* @__PURE__ */ u("p", {
115
+ id: "incode-modal-description",
116
+ className: cn("IncodeModalSubtitle", className),
117
+ children
118
+ });
119
+ }
120
+ function childHasAutoFocusProp(child) {
121
+ return t(child) && child.props != null && typeof child.props === "object" && "autoFocus" in child.props;
122
+ }
123
+ function ModalActions({ children, class: className, orientation = "vertical" }) {
124
+ const baseClassName = orientation === "vertical" ? "IncodeModalActionsVertical" : "IncodeModalActionsHorizontal";
125
+ const childArray = H(children);
126
+ const adjustedChildren = [];
127
+ for (let i = 0; i < childArray.length; i++) {
128
+ const child = childArray[i];
129
+ if (childHasAutoFocusProp(child)) return /* @__PURE__ */ u("div", {
130
+ class: cn(baseClassName, className),
131
+ role: "group",
132
+ children
133
+ });
134
+ adjustedChildren.push(t(child) && i === 0 ? K(child, { [MODAL_INITIAL_FOCUS_ATTR]: "" }) : child);
135
+ }
136
+ return /* @__PURE__ */ u("div", {
137
+ class: cn(baseClassName, className),
138
+ role: "group",
139
+ children: adjustedChildren
140
+ });
141
+ }
142
+ var Modal = {
143
+ Root: ModalRoot,
144
+ Content: ModalContent,
145
+ Close: ModalClose,
146
+ Icon: ModalIcon,
147
+ TitleSection: ModalTitleSection,
148
+ Title: ModalTitle,
149
+ Subtitle: ModalSubtitle,
150
+ Actions: ModalActions
151
+ };
152
+ //#endregion
153
+ export { Modal as t };
@@ -0,0 +1,202 @@
1
+ import { _ as y, p as d } from "./vendor-preact-BH7vOa2r.js";
2
+ //#region src/shared/modal/modal.hooks.ts
3
+ var MODAL_SCROLL_LOCK_CLASS = "IncodeModalScrollLock";
4
+ /**
5
+ * Marks the desktop-actions region for initial focus (see `resolveModalInitialFocusTarget`).
6
+ * `ModalActions` clones this onto the first child when no `autoFocus` child is present.
7
+ */
8
+ var MODAL_INITIAL_FOCUS_ATTR = "data-incode-modal-initial-focus";
9
+ /**
10
+ * Selector for focusable elements that participate in Tab cycling inside the dialog.
11
+ */
12
+ var TAB_FOCUSABLE_SELECTOR = [
13
+ "button:not([disabled])",
14
+ "[href]",
15
+ "input:not([disabled])",
16
+ "select:not([disabled])",
17
+ "textarea:not([disabled])",
18
+ "[tabindex]:not([tabindex=\"-1\"])"
19
+ ].join(", ");
20
+ function getTabFocusableElements(container) {
21
+ return Array.from(container.querySelectorAll(TAB_FOCUSABLE_SELECTOR));
22
+ }
23
+ function isTabFocusableElement(element) {
24
+ try {
25
+ return element.matches(TAB_FOCUSABLE_SELECTOR);
26
+ } catch {
27
+ return false;
28
+ }
29
+ }
30
+ /**
31
+ * Picks the dialog's initial focus: marked region / first tabbable inside it,
32
+ * else first tabbable in the dialog, else the dialog root.
33
+ */
34
+ function resolveModalInitialFocusTarget(dialog) {
35
+ const autofocusEl = dialog.querySelector("[autofocus]");
36
+ if (autofocusEl && isTabFocusableElement(autofocusEl)) return autofocusEl;
37
+ const region = dialog.querySelector(`[${MODAL_INITIAL_FOCUS_ATTR}]`);
38
+ if (region) {
39
+ if (isTabFocusableElement(region)) return region;
40
+ const nested = region.querySelector(TAB_FOCUSABLE_SELECTOR);
41
+ if (nested) return nested;
42
+ }
43
+ return getTabFocusableElements(dialog)[0] ?? dialog;
44
+ }
45
+ /**
46
+ * Renders the modal into `.IncodeComponent` by default, falling back to `document.body`.
47
+ * Pass `portalContainer` to mount into a host you control.
48
+ * The ephemeral portal host is only created while `open` is true.
49
+ */
50
+ function useModalPortalTarget(open, portalContainer) {
51
+ const [node, setNode] = d(null);
52
+ y(() => {
53
+ if (!open) {
54
+ setNode(null);
55
+ return;
56
+ }
57
+ if (portalContainer) {
58
+ setNode(portalContainer);
59
+ return () => {
60
+ setNode(null);
61
+ };
62
+ }
63
+ const el = document.createElement("div");
64
+ el.setAttribute("data-incode-modal-portal", "");
65
+ (document.querySelector(".IncodeComponent") ?? document.body).appendChild(el);
66
+ setNode(el);
67
+ return () => {
68
+ el.remove();
69
+ setNode(null);
70
+ };
71
+ }, [open, portalContainer]);
72
+ return node;
73
+ }
74
+ /**
75
+ * Locks scroll while the modal is open by adding a CSS class to `.IncodeComponent`
76
+ * when present, otherwise `document.body`.
77
+ */
78
+ function useModalBodyScrollLock(open) {
79
+ y(() => {
80
+ if (!open) return;
81
+ const incodeComponent = document.querySelector(".IncodeComponent");
82
+ (incodeComponent ?? document.body).classList.add(MODAL_SCROLL_LOCK_CLASS);
83
+ return () => {
84
+ (incodeComponent ?? document.body).classList.remove(MODAL_SCROLL_LOCK_CLASS);
85
+ };
86
+ }, [open]);
87
+ }
88
+ /**
89
+ * Invokes `onRequestClose` when Escape is pressed while `open && dismissible`.
90
+ */
91
+ function useModalEscapeDismiss(open, dismissible, onRequestClose) {
92
+ y(() => {
93
+ if (!open || !dismissible) return;
94
+ const onKeyDown = (event) => {
95
+ if (event.key === "Escape") {
96
+ event.preventDefault();
97
+ onRequestClose();
98
+ }
99
+ };
100
+ document.addEventListener("keydown", onKeyDown);
101
+ return () => document.removeEventListener("keydown", onKeyDown);
102
+ }, [
103
+ open,
104
+ dismissible,
105
+ onRequestClose
106
+ ]);
107
+ }
108
+ /**
109
+ * When `active` becomes true, moves focus to the first tabbable inside the dialog,
110
+ * or the dialog surface. Otherwise restores focus on cleanup — to the element in
111
+ * `returnFocusRef` if provided, otherwise to the previously focused element.
112
+ *
113
+ * An explicit `returnFocusRef` is strongly recommended for dialogs opened via
114
+ * touch on iOS/VoiceOver, where `document.activeElement` is frequently `<body>`
115
+ * at open time, which would otherwise cause focus to be restored to nothing and
116
+ * VoiceOver to land on a nearby empty container.
117
+ *
118
+ * `active` should include portal mount readiness (e.g. `open && portalTarget != null`)
119
+ * so focus runs after the dialog node exists.
120
+ */
121
+ function useModalFocusCapture(active, dialogRef, manageInitialFocus = true, returnFocusRef) {
122
+ y(() => {
123
+ if (!active) return;
124
+ const previous = document.activeElement;
125
+ const explicitReturnTarget = returnFocusRef?.current ?? null;
126
+ if (manageInitialFocus) {
127
+ const dialog = dialogRef.current;
128
+ if (dialog) resolveModalInitialFocusTarget(dialog).focus();
129
+ }
130
+ return () => {
131
+ if (explicitReturnTarget && typeof explicitReturnTarget.focus === "function") {
132
+ explicitReturnTarget.focus();
133
+ return;
134
+ }
135
+ if (previous && typeof previous.focus === "function") previous.focus();
136
+ };
137
+ }, [
138
+ active,
139
+ dialogRef,
140
+ manageInitialFocus,
141
+ returnFocusRef
142
+ ]);
143
+ }
144
+ /**
145
+ * Tracks the visual viewport (shrinks when a mobile virtual keyboard opens) and
146
+ * publishes its size + offset as CSS custom properties on the target element:
147
+ */
148
+ function useModalVisualViewportBounds(active, targetRef) {
149
+ y(() => {
150
+ if (!active) return;
151
+ if (typeof window === "undefined") return;
152
+ const viewport = window.visualViewport;
153
+ if (!viewport) return;
154
+ const update = () => {
155
+ const el = targetRef.current;
156
+ if (!el) return;
157
+ el.style.setProperty("--incode-visual-viewport-height", `${viewport.height}px`);
158
+ el.style.setProperty("--incode-visual-viewport-offset-top", `${viewport.offsetTop}px`);
159
+ };
160
+ update();
161
+ viewport.addEventListener("resize", update);
162
+ viewport.addEventListener("scroll", update);
163
+ return () => {
164
+ viewport.removeEventListener("resize", update);
165
+ viewport.removeEventListener("scroll", update);
166
+ };
167
+ }, [active, targetRef]);
168
+ }
169
+ /**
170
+ * Keeps Tab / Shift+Tab cycling within the dialog while `active` is true.
171
+ */
172
+ function useModalTabCycle(active, dialogRef) {
173
+ y(() => {
174
+ if (!active) return;
175
+ const onKeyDown = (event) => {
176
+ if (event.key !== "Tab") return;
177
+ const dialog = dialogRef.current;
178
+ if (!dialog) return;
179
+ const focusables = getTabFocusableElements(dialog);
180
+ if (focusables.length === 0 && document.activeElement === dialog) {
181
+ event.preventDefault();
182
+ return;
183
+ }
184
+ if (focusables.length === 0) return;
185
+ const first = focusables[0];
186
+ const last = focusables[focusables.length - 1];
187
+ if (event.shiftKey) {
188
+ if (document.activeElement === first) {
189
+ event.preventDefault();
190
+ last.focus();
191
+ }
192
+ } else if (document.activeElement === last) {
193
+ event.preventDefault();
194
+ first.focus();
195
+ }
196
+ };
197
+ document.addEventListener("keydown", onKeyDown);
198
+ return () => document.removeEventListener("keydown", onKeyDown);
199
+ }, [active, dialogRef]);
200
+ }
201
+ //#endregion
202
+ export { useModalPortalTarget as a, useModalFocusCapture as i, useModalBodyScrollLock as n, useModalTabCycle as o, useModalEscapeDismiss as r, useModalVisualViewportBounds as s, MODAL_INITIAL_FOCUS_ATTR as t };
@@ -0,0 +1,13 @@
1
+ import { v as u } from "./vendor-preact-BH7vOa2r.js";
2
+ //#region src/shared/permissions/camera/numberedStep.tsx
3
+ var NumberedStep = ({ number }) => {
4
+ return /* @__PURE__ */ u("div", {
5
+ class: "IncodeNumberedStep",
6
+ children: /* @__PURE__ */ u("span", {
7
+ class: "IncodeNumberedStepText",
8
+ children: number
9
+ })
10
+ });
11
+ };
12
+ //#endregion
13
+ export { NumberedStep as t };
@@ -0,0 +1,202 @@
1
+ import { n as useTranslation } from "./i18n-gTHArCl9.js";
2
+ import { _ as y, h as q, l as A, p as d, v as u } from "./vendor-preact-BH7vOa2r.js";
3
+ import { r as useIsMobileDeviceWidth } from "./hooks-BtgmGvba.js";
4
+ import { t as InputComposed } from "./inputComposed-5V2nLTqH.js";
5
+ import { i as translateError } from "./radioGroupComposed-DwYW-Ld-.js";
6
+ import { t as BottomSheet } from "./bottomSheet-BuzqNQtG.js";
7
+ //#region src/shared/addressAutocomplete/addressAutocomplete.tsx
8
+ var AddressAutocomplete = ({ label, value, error, errorParams, suggestions, readonly, required, labelHint, onChange, onSearch, onSelect, onBlur }) => {
9
+ const { t } = useTranslation();
10
+ const [showSuggestions, setShowSuggestions] = d(false);
11
+ const [isModalOpen, setIsModalOpen] = d(false);
12
+ const [modalQuery, setModalQuery] = d("");
13
+ const [activeIndex, setActiveIndex] = d(-1);
14
+ const [mobileActiveIndex, setMobileActiveIndex] = d(-1);
15
+ const containerRef = A(null);
16
+ const listboxRef = A(null);
17
+ const mobileListboxRef = A(null);
18
+ const listboxId = "ekyc-address-listbox";
19
+ const mobileListboxId = "ekyc-address-mobile-listbox";
20
+ const mobileTitleId = "ekyc-address-modal-title";
21
+ const isMobile = useIsMobileDeviceWidth();
22
+ const translatedLabel = t(label);
23
+ y(() => {
24
+ function handleClickOutside(e) {
25
+ if (containerRef.current && !containerRef.current.contains(e.target)) setShowSuggestions(false);
26
+ }
27
+ document.addEventListener("mousedown", handleClickOutside);
28
+ return () => document.removeEventListener("mousedown", handleClickOutside);
29
+ }, []);
30
+ y(() => {
31
+ setActiveIndex(-1);
32
+ setMobileActiveIndex(-1);
33
+ }, [suggestions]);
34
+ y(() => {
35
+ const ref = isMobile ? mobileListboxRef : listboxRef;
36
+ const idx = isMobile ? mobileActiveIndex : activeIndex;
37
+ if (idx < 0) return;
38
+ ref.current?.children[idx]?.scrollIntoView({ block: "nearest" });
39
+ }, [
40
+ activeIndex,
41
+ mobileActiveIndex,
42
+ isMobile
43
+ ]);
44
+ const handleSelect = q((suggestion) => {
45
+ onSelect(suggestion);
46
+ setShowSuggestions(false);
47
+ setIsModalOpen(false);
48
+ setActiveIndex(-1);
49
+ setMobileActiveIndex(-1);
50
+ }, [onSelect]);
51
+ const closeModal = q(() => {
52
+ setIsModalOpen(false);
53
+ setMobileActiveIndex(-1);
54
+ }, []);
55
+ const handleInput = (val) => {
56
+ onChange(val);
57
+ if (val.length >= 3) if (isMobile) {
58
+ setIsModalOpen(true);
59
+ setModalQuery(val);
60
+ onSearch(val);
61
+ } else {
62
+ onSearch(val);
63
+ setShowSuggestions(true);
64
+ }
65
+ else setShowSuggestions(false);
66
+ };
67
+ const createListboxKeyHandler = (getIndex, setIndex, onEscape) => {
68
+ return (e) => {
69
+ if (suggestions.length === 0) return;
70
+ if (e.key === "ArrowDown") {
71
+ e.preventDefault();
72
+ setIndex((i) => i < suggestions.length - 1 ? i + 1 : 0);
73
+ } else if (e.key === "ArrowUp") {
74
+ e.preventDefault();
75
+ setIndex((i) => i > 0 ? i - 1 : suggestions.length - 1);
76
+ } else if (e.key === "Enter" && getIndex() >= 0) {
77
+ e.preventDefault();
78
+ handleSelect(suggestions[getIndex()]);
79
+ } else if (e.key === "Escape" && onEscape) onEscape();
80
+ };
81
+ };
82
+ const handleKeyDown = createListboxKeyHandler(() => activeIndex, setActiveIndex, () => {
83
+ setShowSuggestions(false);
84
+ setActiveIndex(-1);
85
+ });
86
+ const handleMobileKeyDown = createListboxKeyHandler(() => mobileActiveIndex, setMobileActiveIndex);
87
+ const isExpanded = !isMobile && showSuggestions && suggestions.length > 0;
88
+ const activeDescendant = isExpanded && activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0;
89
+ return /* @__PURE__ */ u("div", {
90
+ className: "IncodeAddressAutocomplete",
91
+ ref: containerRef,
92
+ children: [
93
+ /* @__PURE__ */ u(InputComposed, {
94
+ id: "ekyc-street",
95
+ label: translatedLabel,
96
+ labelHint,
97
+ name: "street",
98
+ value,
99
+ readOnly: readonly,
100
+ required,
101
+ error: translateError(t, error, errorParams),
102
+ onInput: (e) => handleInput(e.target.value),
103
+ onKeyDown: handleKeyDown,
104
+ onBlur,
105
+ role: "combobox",
106
+ "aria-expanded": isExpanded,
107
+ "aria-controls": listboxId,
108
+ "aria-activedescendant": activeDescendant,
109
+ "aria-autocomplete": "list",
110
+ "data-testid": "ekyc-address-input"
111
+ }),
112
+ isExpanded && /* @__PURE__ */ u("ul", {
113
+ ref: listboxRef,
114
+ id: listboxId,
115
+ role: "listbox",
116
+ className: "IncodeAddressAutocompleteSuggestions",
117
+ children: suggestions.map((s, i) => /* @__PURE__ */ u("li", {
118
+ id: `${listboxId}-option-${i}`,
119
+ role: "option",
120
+ "aria-selected": i === activeIndex,
121
+ className: `IncodeAddressAutocompleteSuggestion ${i === activeIndex ? "IncodeAddressAutocompleteSuggestionActive" : ""}`,
122
+ onClick: () => handleSelect(s),
123
+ children: s.label
124
+ }, s.id))
125
+ }),
126
+ isMobile && /* @__PURE__ */ u(BottomSheet, {
127
+ isOpen: isModalOpen,
128
+ onClose: closeModal,
129
+ labelledById: mobileTitleId,
130
+ children: [/* @__PURE__ */ u("div", {
131
+ className: "IncodeAddressAutocompleteModalHeader",
132
+ children: [/* @__PURE__ */ u("h3", {
133
+ id: mobileTitleId,
134
+ children: t("verification.addressSearch")
135
+ }), /* @__PURE__ */ u("button", {
136
+ className: "IncodeAddressAutocompleteModalClose",
137
+ onClick: closeModal,
138
+ type: "button",
139
+ "aria-label": t("common.close"),
140
+ children: "×"
141
+ })]
142
+ }), /* @__PURE__ */ u("div", {
143
+ className: "IncodeAddressAutocompleteModalBody",
144
+ children: [
145
+ /* @__PURE__ */ u("input", {
146
+ className: "IncodeAddressAutocompleteModalInput",
147
+ type: "text",
148
+ value: modalQuery,
149
+ placeholder: t("verification.addressPlaceholder"),
150
+ "aria-label": t("verification.addressSearch"),
151
+ role: "combobox",
152
+ "aria-expanded": suggestions.length > 0,
153
+ "aria-controls": mobileListboxId,
154
+ "aria-activedescendant": mobileActiveIndex >= 0 ? `${mobileListboxId}-option-${mobileActiveIndex}` : void 0,
155
+ "aria-autocomplete": "list",
156
+ onInput: (e) => {
157
+ const val = e.target.value;
158
+ setModalQuery(val);
159
+ if (val.length >= 3) onSearch(val);
160
+ },
161
+ onKeyDown: handleMobileKeyDown,
162
+ autoFocus: true
163
+ }),
164
+ suggestions.length > 0 && /* @__PURE__ */ u("ul", {
165
+ ref: mobileListboxRef,
166
+ id: mobileListboxId,
167
+ role: "listbox",
168
+ className: "IncodeAddressAutocompleteModalSuggestions",
169
+ children: suggestions.map((s, i) => /* @__PURE__ */ u("li", {
170
+ id: `${mobileListboxId}-option-${i}`,
171
+ role: "option",
172
+ "aria-selected": i === mobileActiveIndex,
173
+ className: `IncodeAddressAutocompleteModalSuggestion ${i === mobileActiveIndex ? "IncodeAddressAutocompleteModalSuggestionActive" : ""}`,
174
+ onClick: () => handleSelect(s),
175
+ children: s.label
176
+ }, s.id))
177
+ }),
178
+ /* @__PURE__ */ u("button", {
179
+ className: "IncodeAddressAutocompleteEnterManually",
180
+ onClick: closeModal,
181
+ type: "button",
182
+ children: t("verification.enterManually")
183
+ })
184
+ ]
185
+ })]
186
+ })
187
+ ]
188
+ });
189
+ };
190
+ //#endregion
191
+ //#region src/shared/utils/optionAccessibleLabel/optionAccessibleLabel.ts
192
+ /**
193
+ * Strips a single leading flag or pictograph (plus following whitespace) from
194
+ * labels so accessible names can mirror visible text without screen readers
195
+ * announcing decorative emoji.
196
+ */
197
+ var LEADING_DECORATIVE_EMOJI = /^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\p{Extended_Pictographic})\s*/u;
198
+ function getAccessibleOptionLabel(label) {
199
+ return label.replace(LEADING_DECORATIVE_EMOJI, "").trimStart();
200
+ }
201
+ //#endregion
202
+ export { AddressAutocomplete as n, getAccessibleOptionLabel as t };