@incodetech/web 0.0.0-dev-20260407-4580f1c → 0.0.0-dev-20260407-2c382da

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 (162) hide show
  1. package/dist/AsYouType-D1H_js4X.js +2607 -0
  2. package/dist/Trans-aTzdT_SA.js +55 -0
  3. package/dist/addressAutocomplete-C8-wL1j_.js +153 -0
  4. package/dist/aligndevicelottie-DlQCRPfM.js +29 -0
  5. package/dist/antifraud/antifraud.es.js +18 -17
  6. package/dist/antifraud/styles.css +1 -1
  7. package/dist/authentication/authentication.es.js +50 -28
  8. package/dist/back-horizontal-hint-CSlf9KI1.js +5 -0
  9. package/dist/back-tutorial-An9AcMSe.js +29 -0
  10. package/dist/back-vertical-hint-CNieqiCr.js +5 -0
  11. package/dist/backdevicelottie-B4NgyWmX.js +29 -0
  12. package/dist/base.css +67 -327
  13. package/dist/blurdevicelottie-_BZRug1c.js +29 -0
  14. package/dist/browser-ponyfill-B6W6hHVY.js +344 -0
  15. package/dist/button-CE9kRlem.js +184 -0
  16. package/dist/cameraView-C2X7klNb.js +55 -0
  17. package/dist/captureOverlay-tCb4R4WE.js +592 -0
  18. package/dist/checkbox-B5X-mfqq.js +137 -0
  19. package/dist/chevronDown-DSHaPKbi.js +23 -0
  20. package/dist/closeIcon-9Hc97omv.js +28 -0
  21. package/dist/consent/consent.es.js +89 -82
  22. package/dist/consent/styles.css +1 -1
  23. package/dist/countries-DfLkrF0x.js +616 -0
  24. package/dist/curp-validation/curp-validation.es.js +313 -271
  25. package/dist/curp-validation/styles.css +1 -1
  26. package/dist/dateInputComposed-C7PCzh-U.js +173 -0
  27. package/dist/document-capture/styles.css +1 -1
  28. package/dist/documentCapture-C0mO-RGE.js +692 -0
  29. package/dist/dropdownComposed-BpinYlrx.js +367 -0
  30. package/dist/ekyb/styles.css +1 -1
  31. package/dist/ekybModule-Dr6LJUg-.js +357 -0
  32. package/dist/ekyc/styles.css +1 -1
  33. package/dist/ekycModule-C3mswduI.js +291 -0
  34. package/dist/email/email.es.js +154 -110
  35. package/dist/email/styles.css +1 -1
  36. package/dist/errorContent-Cb8nmQAE.js +44 -0
  37. package/dist/errorIcon-DEARBrGx.js +26 -0
  38. package/dist/extensibility.es.js +150 -22
  39. package/dist/face-match/styles.css +73 -147
  40. package/dist/faceMatch-DbDp7D3d.js +237 -0
  41. package/dist/fileIcon-CCSvS10T.js +52 -0
  42. package/dist/flip-animation-COR596wy.js +29 -0
  43. package/dist/flipAnimation-BqV462TA.js +2059 -0
  44. package/dist/flow/flow.es.js +2613 -2273
  45. package/dist/flow/styles.css +73 -432
  46. package/dist/formField-CP6wDdfA.js +106 -0
  47. package/dist/front-horizontal-hint-lRLKd7vY.js +7 -0
  48. package/dist/front-vertical-hint-qQoJXRE3.js +7 -0
  49. package/dist/frontdevicelottie-KhKxT5n9.js +29 -0
  50. package/dist/geolocation/geolocation.es.js +832 -852
  51. package/dist/geolocation/styles.css +1 -1
  52. package/dist/glaredevicelottie-DLuIStvb.js +29 -0
  53. package/dist/governmentValidation/governmentValidation.es.js +106 -100
  54. package/dist/governmentValidation/styles.css +1 -1
  55. package/dist/id/id.es.js +59 -53
  56. package/dist/id/styles.css +1 -1
  57. package/dist/id-laser-h-BBV3r3rz.js +29 -0
  58. package/dist/id-laser-v-BTHJaSfx.js +29 -0
  59. package/dist/id-tutorial-B-F5Q28m.js +29 -0
  60. package/dist/incodeModule-C4XIllao.js +96 -0
  61. package/dist/index.es.js +25 -4
  62. package/dist/inputComposed-fUbAGrDy.js +103 -0
  63. package/dist/instance-BWYzq8dk.js +2163 -0
  64. package/dist/loadingIcon-DmuPXh70.js +195 -0
  65. package/dist/mandatoryConsent-5xPI0cor.js +94 -0
  66. package/dist/manualCaptureButton-BvFmTyJe.js +372 -0
  67. package/dist/numberedStep-DwUB__mh.js +5 -0
  68. package/dist/otpInput-BFXhqFRT.js +156 -0
  69. package/dist/page-SrUl0qtN.js +69 -0
  70. package/dist/passport-horizontal-hint-BCtpMp1Y.js +5 -0
  71. package/dist/passport-tutorial-CaYBFTqt.js +29 -0
  72. package/dist/passport-vertical-hint-GaLnzqHP.js +5 -0
  73. package/dist/permissions-DT4Fz9MR.js +709 -0
  74. package/dist/phone/phone.es.js +121 -87
  75. package/dist/phone/styles.css +1 -1
  76. package/dist/phoneInput-CGr8TxOO.js +158 -0
  77. package/dist/phoneInputComposed-Cm9O2Jba.js +206 -0
  78. package/dist/processing-szVOCQwZ.js +19 -0
  79. package/dist/redirect-to-mobile/styles.css +1 -1
  80. package/dist/richText-cspvNz2a.js +1807 -0
  81. package/dist/selfie/selfie.es.js +50 -29
  82. package/dist/selfie/styles.css +66 -170
  83. package/dist/selfieTutorial-Dm_p0ke9.js +29 -0
  84. package/dist/signature/signature.es.js +707 -557
  85. package/dist/signature/styles.css +1 -1
  86. package/dist/spinner-DygONskw.js +60 -0
  87. package/dist/successIcon-Bjsdc4lF.js +26 -0
  88. package/dist/tutorial-Cdz1025D.js +473 -0
  89. package/dist/types/ekyb/styles.d.ts +1 -0
  90. package/dist/types/ekyc/styles.d.ts +1 -0
  91. package/dist/types/index.d.ts +8 -0
  92. package/dist/typography-BDACYR5i.js +14 -0
  93. package/dist/uiConfig-Dnt-2YWB.js +23 -0
  94. package/dist/useMediaQuery-lJdQBmC2.js +18 -0
  95. package/dist/vendor-preact-BoMmvSgn.js +694 -0
  96. package/dist/warningIcon-DQq_MrOB.js +26 -0
  97. package/package.json +11 -8
  98. package/dist/AsYouType-DPWqJvFu.js +0 -2482
  99. package/dist/addressAutocomplete-B3f6PGTT.js +0 -108
  100. package/dist/aligndevicelottie-C9xl1spu.js +0 -12757
  101. package/dist/back-horizontal-hint-Be3dUGk6.js +0 -137
  102. package/dist/back-tutorial-BNTyW-1N.js +0 -14584
  103. package/dist/back-vertical-hint-Bz_rnhd-.js +0 -128
  104. package/dist/backdevicelottie-DBB1YCtW.js +0 -16678
  105. package/dist/blurdevicelottie-9WvZCZ6C.js +0 -15939
  106. package/dist/browser-ponyfill-B4Qc6yfW.js +0 -299
  107. package/dist/button-DhL5eRT3.js +0 -123
  108. package/dist/checkbox-l8NxPf4o.js +0 -85
  109. package/dist/countries-y2ydYDhN.js +0 -8323
  110. package/dist/dateInputComposed-B9WqdYx9.js +0 -2
  111. package/dist/dateInputComposed-ndsGHX1M.js +0 -94
  112. package/dist/defineProperty-brqHEHA_.js +0 -39
  113. package/dist/documentCapture-wDgRLdon.js +0 -784
  114. package/dist/dropdownComposed-_Ey7wJNG.js +0 -258
  115. package/dist/ekyb/ekyb.es.js +0 -2
  116. package/dist/ekybModule-BBOm1y49.js +0 -2
  117. package/dist/ekybModule-fz6i9ZRt.js +0 -286
  118. package/dist/ekyc/ekyc.es.js +0 -2
  119. package/dist/ekycModule-SeTFG3AJ.js +0 -233
  120. package/dist/ekycModule-hxIcNX8n.js +0 -2
  121. package/dist/extensibility-DJihqIzM.js +0 -2248
  122. package/dist/faceMatch-DH8sLx34.js +0 -191
  123. package/dist/flip-animation-DOJzdXB-.js +0 -6983
  124. package/dist/formField-BRTbY8w9.js +0 -100
  125. package/dist/front-horizontal-hint-aGAhadA2.js +0 -380
  126. package/dist/front-vertical-hint-DZz1VeNp.js +0 -420
  127. package/dist/frontdevicelottie-DadDp6be.js +0 -17302
  128. package/dist/glaredevicelottie-BfI84cPw.js +0 -14466
  129. package/dist/i18n-DZOHbK9q.js +0 -1916
  130. package/dist/icons-BHbofCgJ.js +0 -245
  131. package/dist/id-laser-h-BWyU3VgL.js +0 -467
  132. package/dist/id-laser-v-JiWXUlv0.js +0 -467
  133. package/dist/id-tutorial-Cc9xg5_J.js +0 -13152
  134. package/dist/incodeModule-Bf6yJ8RB.js +0 -18
  135. package/dist/inputComposed-BhbfD8Ru.js +0 -77
  136. package/dist/loadingIcon-CeQt7Zgb.js +0 -146
  137. package/dist/mandatoryConsent-LBS8E0rj.js +0 -101
  138. package/dist/numberedStep-CQVRixRP.js +0 -11
  139. package/dist/otpInput-CDIG9el7.js +0 -143
  140. package/dist/page-SvlJWUfz.js +0 -61
  141. package/dist/passport-horizontal-hint-CFsGs7Dp.js +0 -293
  142. package/dist/passport-tutorial-z0LN7Hsp.js +0 -11688
  143. package/dist/passport-vertical-hint-BnCpKWeN.js +0 -267
  144. package/dist/phoneInput-C9T_8FJt.js +0 -138
  145. package/dist/phoneInputComposed-B-0zieIW.js +0 -407
  146. package/dist/processing-B5zhNH6I.js +0 -15
  147. package/dist/richText-Db0PfpkE.js +0 -1973
  148. package/dist/rolldown-runtime-CjdbFOpI.js +0 -13
  149. package/dist/selfieTutorial-B0MIyPrk.js +0 -2676
  150. package/dist/setup-Dq2bzNKH.js +0 -15
  151. package/dist/spacer-DCljE53A.js +0 -59
  152. package/dist/spinner-Bk0YuoLu.js +0 -1
  153. package/dist/spinner-snIGzmm8.js +0 -41
  154. package/dist/successIcon-AHrfmJvv.js +0 -17
  155. package/dist/tutorial-DNOd11tg.js +0 -2780
  156. package/dist/types/ekyb.d.ts +0 -29
  157. package/dist/types/ekyc.d.ts +0 -29
  158. package/dist/typography-BNbFNFek.js +0 -1
  159. package/dist/typography-DvHeVWfY.js +0 -29
  160. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  161. package/dist/vendor-preact-D6SntenC.js +0 -958
  162. package/dist/warningIcon-Cvj-ayg1.js +0 -17
@@ -1,258 +0,0 @@
1
- import { _ as e, l as t, p as n, v as r } from "./vendor-preact-D6SntenC.js";
2
- import { n as i } from "./loadingIcon-CeQt7Zgb.js";
3
- import { c as a, n as o, p as s } from "./icons-BHbofCgJ.js";
4
- import { t as ee } from "./successIcon-AHrfmJvv.js";
5
- //#region src/shared/dropdownComposed/dropdownComposed.tsx
6
- var c = ({ id: c, label: l, placeholder: u = "Choose an option", value: d, options: f, onChange: p, error: m, helper: h, showErrorIcon: te, showHelperIcon: g, suppressMessages: _ = !1, disabled: v = !1, required: y, searchable: b = !1, searchPlaceholder: x = "Search...", noResultsText: S = "No results found", name: C, tabIndex: w, onKeyDown: T, onBlur: E, renderSelectedLabel: D, siblingElement: O, enterKeyHint: ne, class: k, "aria-label": A, "data-testid": j }) => {
7
- let [M, N] = n(!1), [re, P] = n(!1), [F, I] = n(-1), [L, R] = n(""), z = t(null), B = t(null), V = t(null), H = t([]), U = t(null), W = t(""), G = t(), K = f.find((e) => e.value === d), q = K ? D ? D(K) : K.label : u, J = b && L ? f.filter((e) => e.label.toLowerCase().includes(L.toLowerCase())) : f, Y = `${c}-label`, X = `${c}-listbox`, Z = `${c}-helper`, Q = `${c}-error`, ie = _ ? "" : [h ? Z : null, m ? Q : null].filter(Boolean).join(" ");
8
- e(() => {
9
- if (!M) return;
10
- let e = requestAnimationFrame(() => {
11
- b && U.current && U.current.focus(), requestAnimationFrame(() => {
12
- V.current?.scrollIntoView({
13
- behavior: "smooth",
14
- block: "nearest",
15
- inline: "nearest"
16
- });
17
- });
18
- });
19
- return () => cancelAnimationFrame(e);
20
- }, [M, b]), e(() => {
21
- M || (I(-1), R(""));
22
- }, [M]), e(() => {
23
- F >= 0 && H.current[F] && H.current[F]?.scrollIntoView({
24
- block: "nearest",
25
- inline: "nearest"
26
- });
27
- }, [F]), e(() => () => {
28
- G.current && clearTimeout(G.current);
29
- }, []);
30
- let ae = () => {
31
- v || N((e) => !e);
32
- }, $ = (e) => {
33
- p(e), N(!1), I(-1), B.current?.focus();
34
- }, oe = () => {
35
- P(!0);
36
- }, se = (e) => {
37
- P(!1), z.current?.contains(e.relatedTarget) || (N(!1), E?.());
38
- }, ce = (e) => {
39
- if (v) return;
40
- T?.(e);
41
- let { key: t } = e;
42
- if (t.length === 1 && /^[a-zA-Z0-9]$/.test(t)) {
43
- e.preventDefault(), G.current && clearTimeout(G.current), W.current += t.toLowerCase();
44
- let n = J.findIndex((e) => e.label.toLowerCase().startsWith(W.current));
45
- n !== -1 && (M || N(!0), I(n)), G.current = setTimeout(() => {
46
- W.current = "";
47
- }, 500);
48
- return;
49
- }
50
- switch (t) {
51
- case "ArrowDown":
52
- e.preventDefault(), M ? I((e) => e < J.length - 1 ? e + 1 : e) : (N(!0), I(0));
53
- break;
54
- case "ArrowUp":
55
- e.preventDefault(), M ? I((e) => e > 0 ? e - 1 : e) : (N(!0), I(J.length - 1));
56
- break;
57
- case "Home":
58
- e.preventDefault(), M && I(0);
59
- break;
60
- case "End":
61
- e.preventDefault(), M && I(J.length - 1);
62
- break;
63
- case "Enter":
64
- e.preventDefault(), M && F >= 0 && J[F] ? $(J[F].value) : M || N(!0);
65
- break;
66
- case " ":
67
- e.preventDefault(), M && F >= 0 && J[F] ? $(J[F].value) : M || (N(!0), I(0));
68
- break;
69
- case "Escape":
70
- e.preventDefault(), M && (N(!1), I(-1), B.current?.focus());
71
- break;
72
- case "Tab":
73
- M && (N(!1), I(-1));
74
- break;
75
- default: break;
76
- }
77
- }, le = (e) => {
78
- let { key: t } = e;
79
- switch (t) {
80
- case "ArrowDown":
81
- e.preventDefault(), I((e) => e < J.length - 1 ? e + 1 : e);
82
- break;
83
- case "ArrowUp":
84
- e.preventDefault(), I((e) => e > 0 ? e - 1 : e);
85
- break;
86
- case "Home":
87
- e.preventDefault(), I(0);
88
- break;
89
- case "End":
90
- e.preventDefault(), I(J.length - 1);
91
- break;
92
- case "Enter":
93
- e.preventDefault(), F >= 0 && J[F] && $(J[F].value);
94
- break;
95
- case "Escape":
96
- e.preventDefault(), N(!1), I(-1), B.current?.focus();
97
- break;
98
- case "Tab":
99
- N(!1), I(-1);
100
- break;
101
- default: break;
102
- }
103
- };
104
- return /* @__PURE__ */ r("div", {
105
- class: i("IncodeDropdownComposed", k),
106
- ref: z,
107
- onBlur: se,
108
- children: [
109
- C && /* @__PURE__ */ r("input", {
110
- type: "hidden",
111
- name: C,
112
- value: d || "",
113
- disabled: v,
114
- required: y
115
- }),
116
- l && /* @__PURE__ */ r("label", {
117
- class: "IncodeDropdownComposedLabel",
118
- id: Y,
119
- htmlFor: c,
120
- "data-testid": `${c}-label`,
121
- children: [l, y && /* @__PURE__ */ r("span", {
122
- class: "IncodeDropdownComposedRequired",
123
- children: " *"
124
- })]
125
- }),
126
- /* @__PURE__ */ r("div", {
127
- class: "IncodeDropdownComposedWrapper",
128
- children: [/* @__PURE__ */ r("div", {
129
- class: i("IncodeDropdownComposedTriggerRow", { IncodeDropdownComposedTriggerRowWithSibling: !!O }),
130
- children: [/* @__PURE__ */ r("button", {
131
- ref: B,
132
- type: "button",
133
- id: c,
134
- class: "IncodeDropdownComposedTrigger",
135
- onClick: ae,
136
- onFocus: oe,
137
- onKeyDown: ce,
138
- tabIndex: v ? -1 : w ?? 0,
139
- disabled: v,
140
- "aria-haspopup": "listbox",
141
- "aria-expanded": M ? "true" : "false",
142
- "aria-disabled": v ? "true" : void 0,
143
- "aria-labelledby": l ? Y : void 0,
144
- "aria-label": l ? void 0 : A,
145
- "aria-controls": M ? X : void 0,
146
- "aria-activedescendant": M && F >= 0 ? `${c}-option-${F}` : void 0,
147
- "aria-invalid": m ? "true" : void 0,
148
- "aria-required": y ? "true" : void 0,
149
- "aria-describedby": ie || void 0,
150
- "data-error": m ? "true" : void 0,
151
- "data-focused": re || M ? "true" : void 0,
152
- "data-testid": j,
153
- children: [/* @__PURE__ */ r("span", {
154
- class: K ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
155
- children: q
156
- }), /* @__PURE__ */ r("span", {
157
- class: "IncodeDropdownComposedTriggerIcon",
158
- "aria-hidden": "true",
159
- "data-open": M,
160
- children: /* @__PURE__ */ r(a, {})
161
- })]
162
- }), O && /* @__PURE__ */ r("div", {
163
- class: "IncodeDropdownComposedSibling",
164
- children: O
165
- })]
166
- }), M && /* @__PURE__ */ r("div", {
167
- ref: V,
168
- class: "IncodeDropdownComposedList",
169
- "data-error": m ? "true" : void 0,
170
- children: [b && /* @__PURE__ */ r("div", {
171
- class: "IncodeDropdownComposedSearchWrapper",
172
- children: /* @__PURE__ */ r("div", {
173
- class: "IncodeDropdownComposedSearchInner",
174
- children: [/* @__PURE__ */ r("input", {
175
- ref: U,
176
- type: "text",
177
- class: "IncodeDropdownComposedSearchInput",
178
- value: L,
179
- onInput: (e) => {
180
- R(e.target.value), I(0);
181
- },
182
- onKeyDown: le,
183
- placeholder: x,
184
- role: "combobox",
185
- "aria-autocomplete": "list",
186
- "aria-expanded": "true",
187
- "aria-controls": X,
188
- "aria-activedescendant": F >= 0 ? `${c}-option-${F}` : void 0,
189
- "aria-label": x,
190
- autocomplete: "off"
191
- }), /* @__PURE__ */ r("span", {
192
- class: "IncodeDropdownComposedSearchIcon",
193
- "aria-hidden": "true",
194
- children: /* @__PURE__ */ r(o, { size: 20 })
195
- })]
196
- })
197
- }), /* @__PURE__ */ r("div", {
198
- id: X,
199
- role: "listbox",
200
- "aria-labelledby": l ? Y : void 0,
201
- "aria-label": l ? void 0 : A ?? u,
202
- class: "IncodeDropdownComposedOptionsScroll",
203
- children: J.length === 0 ? /* @__PURE__ */ r("div", {
204
- class: "IncodeDropdownComposedNoResults",
205
- children: S
206
- }) : J.map((e, t) => /* @__PURE__ */ r("div", {
207
- id: `${c}-option-${t}`,
208
- role: "option",
209
- "aria-selected": d === e.value ? "true" : "false",
210
- class: "IncodeDropdownComposedOption",
211
- "data-highlighted": F === t,
212
- ref: (e) => {
213
- H.current[t] = e;
214
- },
215
- onClick: () => $(e.value),
216
- onMouseDown: (e) => e.preventDefault(),
217
- onMouseEnter: () => I(t),
218
- children: e.label
219
- }, e.value))
220
- })]
221
- })]
222
- }),
223
- b && /* @__PURE__ */ r("div", {
224
- class: "IncodeDropdownComposedLiveRegion",
225
- role: "status",
226
- "aria-live": "polite",
227
- "aria-atomic": "true",
228
- children: M && L ? J.length === 0 ? S : `${J.length} result${J.length === 1 ? "" : "s"} available` : ""
229
- }),
230
- !_ && m && /* @__PURE__ */ r("div", {
231
- class: "IncodeDropdownComposedErrorWrapper",
232
- "data-testid": `${c}-error-wrapper`,
233
- children: [te && /* @__PURE__ */ r("div", {
234
- class: "IncodeDropdownComposedIconWrapper",
235
- children: /* @__PURE__ */ r(s, { size: 17 })
236
- }), /* @__PURE__ */ r("p", {
237
- id: Q,
238
- class: "IncodeDropdownComposedError",
239
- children: m
240
- })]
241
- }),
242
- !_ && h && !m && /* @__PURE__ */ r("div", {
243
- class: "IncodeDropdownComposedHelperWrapper",
244
- "data-testid": `${c}-helper-wrapper`,
245
- children: [g && /* @__PURE__ */ r("div", {
246
- class: "IncodeDropdownComposedIconWrapper",
247
- children: /* @__PURE__ */ r(ee, { size: 17 })
248
- }), /* @__PURE__ */ r("p", {
249
- id: Z,
250
- class: "IncodeDropdownComposedHelper",
251
- children: h
252
- })]
253
- })
254
- ]
255
- });
256
- };
257
- //#endregion
258
- export { c as t };
@@ -1,2 +0,0 @@
1
- import { t as e } from "../ekybModule-fz6i9ZRt.js";
2
- export { e as EkybModule };
@@ -1,2 +0,0 @@
1
- import { t as e } from "./ekybModule-fz6i9ZRt.js";
2
- export { e as EkybModule };
@@ -1,286 +0,0 @@
1
- import { n as e } from "./i18n-DZOHbK9q.js";
2
- import { S as t, _ as n, d as r, h as i, l as a, p as o, v as s } from "./vendor-preact-D6SntenC.js";
3
- import { c, o as l, r as u } from "./loadingIcon-CeQt7Zgb.js";
4
- import { t as d } from "./button-DhL5eRT3.js";
5
- import { t as f } from "./page-SvlJWUfz.js";
6
- import { t as p } from "./spinner-snIGzmm8.js";
7
- import { n as m, r as h, t as g } from "./formField-BRTbY8w9.js";
8
- import { t as _ } from "./inputComposed-BhbfD8Ru.js";
9
- import { t as v } from "./dropdownComposed-_Ey7wJNG.js";
10
- import { t as y } from "./incodeModule-Bf6yJ8RB.js";
11
- import { t as b } from "./addressAutocomplete-B3f6PGTT.js";
12
- import { DEV_ONLY_COUNTRIES as x, SUPPORTED_COUNTRIES as S, computeEkybDisplayErrors as C, createEkybManager as w } from "@incodetech/core/ekyb";
13
- //#region src/modules/ekyb/countrySelector.tsx
14
- function T(e) {
15
- return [...e.toUpperCase()].map((e) => String.fromCodePoint(127462 + e.charCodeAt(0) - 65)).join("");
16
- }
17
- var E = {
18
- BR: "Brazil",
19
- CM: "Cameroon",
20
- CN: "China",
21
- FR: "France",
22
- DE: "Germany",
23
- IL: "Israel",
24
- IT: "Italy",
25
- KE: "Kenya",
26
- MX: "Mexico",
27
- NG: "Nigeria",
28
- ES: "Spain",
29
- GB: "United Kingdom",
30
- US: "USA"
31
- };
32
- function D(e) {
33
- let t = E[e] ?? e;
34
- return {
35
- value: e,
36
- label: `${T(e)} ${t}`
37
- };
38
- }
39
- function O() {
40
- if (typeof window > "u") return !1;
41
- let { hostname: e } = window.location;
42
- return e === "localhost" || e.includes("stage") || e.includes("demo");
43
- }
44
- var k = ({ value: t, onChange: n }) => {
45
- let { t: i } = e(), a = r(() => (O() ? [...S, ...x] : [...S]).map(D).sort((e, t) => e.label.localeCompare(t.label)), []);
46
- return /* @__PURE__ */ s("div", {
47
- className: "IncodeEkybCountrySelector",
48
- children: /* @__PURE__ */ s(v, {
49
- id: "ekyb-country",
50
- label: i("ekyb.country"),
51
- value: t,
52
- options: a,
53
- onChange: n,
54
- "data-testid": "ekyb-country-selector"
55
- })
56
- });
57
- }, A = ({ field: t, value: n, error: r, errorParams: i, country: a, onChange: o, onBlur: c }) => {
58
- let { t: l } = e(), u = !t.required, d = l(t.label);
59
- if (t.type === "dropdown") {
60
- let e = u ? `${d} (${l("common.optional")})` : d;
61
- return /* @__PURE__ */ s(v, {
62
- id: `ekyb-${t.name}`,
63
- label: e,
64
- placeholder: t.placeholder ? l(t.placeholder) : void 0,
65
- value: n,
66
- options: (t.options ?? []).map((e) => ({
67
- ...e,
68
- label: l(e.label)
69
- })),
70
- error: m(l, r, i),
71
- searchable: !0,
72
- onChange: (e) => o(t.name, e),
73
- onBlur: c ? () => c(t.name) : void 0,
74
- "data-testid": `ekyb-field-${t.name}`
75
- });
76
- }
77
- return /* @__PURE__ */ s(g, {
78
- name: t.name,
79
- label: t.label,
80
- value: n,
81
- error: r,
82
- errorParams: i,
83
- required: t.required,
84
- optional: u,
85
- onChange: o,
86
- onBlur: c
87
- });
88
- }, j = ({ ubos: t, errors: n, errorParams: r, canAddUbo: i, onSetField: a, onBlur: o, onAdd: c, onRemove: l }) => {
89
- let { t: u } = e(), d = (e) => m(u, n[e], r[e]);
90
- return t.length === 0 ? null : /* @__PURE__ */ s("div", {
91
- className: "IncodeEkybUbos",
92
- children: [t.map((e, t) => {
93
- let n = t === 0 ? u("ekyb.uboName") : u("ekyb.uboNameWithNumber", { number: t + 1 }), r = t === 0 ? u("ekyb.uboSurname") : u("ekyb.uboSurnameWithNumber", { number: t + 1 }), i = t === 0;
94
- return /* @__PURE__ */ s("div", {
95
- className: "IncodeEkybUboEntry",
96
- children: [
97
- /* @__PURE__ */ s(_, {
98
- id: `ubo-${t}-name`,
99
- label: n,
100
- name: `ubo-${t}-name`,
101
- value: e.name,
102
- error: d(`ubo-${t}-name`),
103
- onInput: (e) => a(t, "name", e.target.value),
104
- onBlur: o ? () => o(`ubo-${t}-name`) : void 0,
105
- "data-testid": `ekyb-ubo-${t}-name`
106
- }),
107
- /* @__PURE__ */ s(_, {
108
- id: `ubo-${t}-surname`,
109
- label: r,
110
- name: `ubo-${t}-surname`,
111
- value: e.surname,
112
- error: d(`ubo-${t}-surname`),
113
- onInput: (e) => a(t, "surname", e.target.value),
114
- onBlur: o ? () => o(`ubo-${t}-surname`) : void 0,
115
- "data-testid": `ekyb-ubo-${t}-surname`
116
- }),
117
- !i && /* @__PURE__ */ s("button", {
118
- className: "IncodeEkybRemoveUbo",
119
- onClick: () => l(t),
120
- type: "button",
121
- children: u("common.remove")
122
- })
123
- ]
124
- }, e.id);
125
- }), i && /* @__PURE__ */ s("button", {
126
- className: "IncodeEkybAddUbo",
127
- onClick: c,
128
- type: "button",
129
- "data-testid": "ekyb-add-ubo",
130
- children: u("ekyb.addAnotherUbo")
131
- })]
132
- });
133
- }, M = ({ config: t, onFinish: r }) => {
134
- let { t: i } = e(), [a, o] = c(() => w({ config: t }));
135
- return n(() => {
136
- (a.status === "finished" || a.status === "closed") && r?.();
137
- }, [a.status, r]), a.status === "finished" || a.status === "closed" ? null : a.status === "loading" ? /* @__PURE__ */ s(h, {
138
- status: "submitting",
139
- submittingTitle: i("common.loading")
140
- }) : a.status === "submitting" ? /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(p, {
141
- fullScreen: !1,
142
- title: i("common.processing"),
143
- className: "IncodeEkybSpinner"
144
- }) }) : a.status === "success" ? /* @__PURE__ */ s(h, { status: "success" }) : a.status === "error" ? /* @__PURE__ */ s(h, {
145
- status: "failure",
146
- onRetry: () => o.retry()
147
- }) : a.status === "form" ? /* @__PURE__ */ s(F, {
148
- state: a,
149
- manager: o
150
- }) : null;
151
- }, N = new Set([
152
- "street",
153
- "houseNo",
154
- "addressLine2",
155
- "city",
156
- "state",
157
- "postalCode"
158
- ]), P = [
159
- "street",
160
- "city",
161
- "state",
162
- "postalCode",
163
- "houseNo"
164
- ], F = ({ state: c, manager: u }) => {
165
- let { country: p, fields: m, values: h, errors: g, isValid: _, ubos: v, canAddUbo: y, addressSuggestions: x, submitAttempted: S } = c, { t: w } = e(), T = a(null), E = a(null), D = a(void 0), O = l(T, m.length), [M, F] = o({}), I = i((e) => {
166
- F((t) => t[e] ? t : {
167
- ...t,
168
- [e]: !0
169
- });
170
- }, []), { displayErrors: L, errorParams: R } = r(() => C(g, M, S, p, m), [
171
- g,
172
- M,
173
- S,
174
- p,
175
- m
176
- ]), z = i((e) => I(e), [I]), B = i((e, t) => {
177
- I(e), u.setField(e, t);
178
- }, [u, I]), V = i((e, t, n) => {
179
- I(`ubo-${e}-${t}`), u.setUboField(e, t, n);
180
- }, [u, I]), H = i((e) => {
181
- for (let e of P) I(e);
182
- u.selectAddress(e);
183
- }, [u, I]), U = i((e) => {
184
- u.removeUbo(e), F((t) => {
185
- let n = {};
186
- for (let [r, i] of Object.entries(t)) {
187
- let t = r.match(/^ubo-(\d+)-(name|surname)$/);
188
- if (!t) {
189
- n[r] = i;
190
- continue;
191
- }
192
- let a = Number(t[1]);
193
- if (a === e) continue;
194
- let o = a > e ? a - 1 : a;
195
- n[`ubo-${o}-${t[2]}`] = i;
196
- }
197
- return n;
198
- });
199
- }, [u]);
200
- n(() => {
201
- let e = L.postalCode, t = D.current;
202
- if (D.current = e, !e || t === e) return;
203
- let n = requestAnimationFrame(() => {
204
- let e = E.current;
205
- e && (e.querySelector("#postalCode-error") ?? e).scrollIntoView({
206
- behavior: "smooth",
207
- block: "nearest"
208
- });
209
- });
210
- return () => cancelAnimationFrame(n);
211
- }, [L.postalCode]);
212
- let W = m.filter((e) => !N.has(e.name)), G = m.filter((e) => N.has(e.name));
213
- return /* @__PURE__ */ s(f, {
214
- className: `IncodeEkybPage${O ? " IncodeEkybPageScrollable" : ""}`,
215
- title: w("ekyb.title"),
216
- children: [/* @__PURE__ */ s("div", {
217
- ref: T,
218
- className: "IncodeEkybForm",
219
- children: [
220
- /* @__PURE__ */ s(k, {
221
- value: p,
222
- onChange: (e) => u.setCountry(e)
223
- }),
224
- W.map((e) => /* @__PURE__ */ s(A, {
225
- field: e,
226
- value: h[e.name] ?? "",
227
- error: L[e.name],
228
- errorParams: R[e.name],
229
- country: p,
230
- onChange: B,
231
- onBlur: z
232
- }, e.name)),
233
- /* @__PURE__ */ s(j, {
234
- ubos: v,
235
- errors: L,
236
- errorParams: R,
237
- canAddUbo: y,
238
- onSetField: V,
239
- onBlur: z,
240
- onAdd: () => u.addUbo(),
241
- onRemove: U
242
- }),
243
- G.length > 0 && /* @__PURE__ */ s(t, { children: [/* @__PURE__ */ s("h3", {
244
- className: "IncodeEkybSectionHeader",
245
- children: w("ekyb.addressDetails")
246
- }), G.map((e) => e.name === "street" ? /* @__PURE__ */ s(b, {
247
- label: e.label,
248
- value: h.street ?? "",
249
- error: L.street,
250
- errorParams: R.street,
251
- suggestions: x,
252
- optional: !e.required,
253
- onChange: (e) => B("street", e),
254
- onSearch: (e) => u.searchAddress(e),
255
- onSelect: H,
256
- onBlur: () => z("street")
257
- }, e.name) : /* @__PURE__ */ s("div", {
258
- ref: e.name === "postalCode" ? E : void 0,
259
- children: /* @__PURE__ */ s(A, {
260
- field: e,
261
- value: h[e.name] ?? "",
262
- error: L[e.name],
263
- errorParams: R[e.name],
264
- country: p,
265
- onChange: B,
266
- onBlur: z
267
- })
268
- }, e.name))] })
269
- ]
270
- }), /* @__PURE__ */ s("div", {
271
- className: "IncodeEkybFooter",
272
- children: /* @__PURE__ */ s(d, {
273
- onClick: () => u.submit(),
274
- disabled: !_,
275
- "data-testid": "ekyb-submit",
276
- children: w("ekyb.continue")
277
- })
278
- })]
279
- });
280
- }, I = ({ config: e, onFinish: t }) => /* @__PURE__ */ s(u, { children: e ? /* @__PURE__ */ s(M, {
281
- config: e,
282
- onFinish: t
283
- }) : null });
284
- y(I, "incode-ekyb");
285
- //#endregion
286
- export { I as t };
@@ -1,2 +0,0 @@
1
- import { t as e } from "../ekycModule-SeTFG3AJ.js";
2
- export { e as EkycModule };