@incodetech/web 0.0.0-dev-20260403-eccc51c → 0.0.0-dev-20260407-4580f1c

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-DPWqJvFu.js +2482 -0
  2. package/dist/addressAutocomplete-B3f6PGTT.js +108 -0
  3. package/dist/aligndevicelottie-C9xl1spu.js +12757 -0
  4. package/dist/antifraud/antifraud.es.js +17 -18
  5. package/dist/antifraud/styles.css +1 -1
  6. package/dist/authentication/authentication.es.js +28 -50
  7. package/dist/back-horizontal-hint-Be3dUGk6.js +137 -0
  8. package/dist/back-tutorial-BNTyW-1N.js +14584 -0
  9. package/dist/back-vertical-hint-Bz_rnhd-.js +128 -0
  10. package/dist/backdevicelottie-DBB1YCtW.js +16678 -0
  11. package/dist/base.css +327 -67
  12. package/dist/blurdevicelottie-9WvZCZ6C.js +15939 -0
  13. package/dist/browser-ponyfill-B4Qc6yfW.js +299 -0
  14. package/dist/button-DhL5eRT3.js +123 -0
  15. package/dist/checkbox-l8NxPf4o.js +85 -0
  16. package/dist/consent/consent.es.js +82 -89
  17. package/dist/consent/styles.css +1 -1
  18. package/dist/countries-y2ydYDhN.js +8323 -0
  19. package/dist/curp-validation/curp-validation.es.js +271 -313
  20. package/dist/curp-validation/styles.css +1 -1
  21. package/dist/dateInputComposed-B9WqdYx9.js +2 -0
  22. package/dist/dateInputComposed-ndsGHX1M.js +94 -0
  23. package/dist/defineProperty-brqHEHA_.js +39 -0
  24. package/dist/document-capture/styles.css +1 -1
  25. package/dist/documentCapture-wDgRLdon.js +784 -0
  26. package/dist/dropdownComposed-_Ey7wJNG.js +258 -0
  27. package/dist/ekyb/ekyb.es.js +2 -0
  28. package/dist/ekyb/styles.css +1 -1
  29. package/dist/ekybModule-BBOm1y49.js +2 -0
  30. package/dist/ekybModule-fz6i9ZRt.js +286 -0
  31. package/dist/ekyc/ekyc.es.js +2 -0
  32. package/dist/ekyc/styles.css +1 -1
  33. package/dist/ekycModule-SeTFG3AJ.js +233 -0
  34. package/dist/ekycModule-hxIcNX8n.js +2 -0
  35. package/dist/email/email.es.js +110 -154
  36. package/dist/email/styles.css +1 -1
  37. package/dist/extensibility-DJihqIzM.js +2248 -0
  38. package/dist/extensibility.es.js +22 -150
  39. package/dist/face-match/styles.css +147 -73
  40. package/dist/faceMatch-DH8sLx34.js +191 -0
  41. package/dist/flip-animation-DOJzdXB-.js +6983 -0
  42. package/dist/flow/flow.es.js +2273 -2613
  43. package/dist/flow/styles.css +432 -73
  44. package/dist/formField-BRTbY8w9.js +100 -0
  45. package/dist/front-horizontal-hint-aGAhadA2.js +380 -0
  46. package/dist/front-vertical-hint-DZz1VeNp.js +420 -0
  47. package/dist/frontdevicelottie-DadDp6be.js +17302 -0
  48. package/dist/geolocation/geolocation.es.js +852 -832
  49. package/dist/geolocation/styles.css +1 -1
  50. package/dist/glaredevicelottie-BfI84cPw.js +14466 -0
  51. package/dist/governmentValidation/governmentValidation.es.js +100 -106
  52. package/dist/governmentValidation/styles.css +1 -1
  53. package/dist/i18n-DZOHbK9q.js +1916 -0
  54. package/dist/icons-BHbofCgJ.js +245 -0
  55. package/dist/id/id.es.js +53 -59
  56. package/dist/id/styles.css +1 -1
  57. package/dist/id-laser-h-BWyU3VgL.js +467 -0
  58. package/dist/id-laser-v-JiWXUlv0.js +467 -0
  59. package/dist/id-tutorial-Cc9xg5_J.js +13152 -0
  60. package/dist/incodeModule-Bf6yJ8RB.js +18 -0
  61. package/dist/index.es.js +4 -25
  62. package/dist/inputComposed-BhbfD8Ru.js +77 -0
  63. package/dist/loadingIcon-CeQt7Zgb.js +146 -0
  64. package/dist/mandatoryConsent-LBS8E0rj.js +101 -0
  65. package/dist/numberedStep-CQVRixRP.js +11 -0
  66. package/dist/otpInput-CDIG9el7.js +143 -0
  67. package/dist/page-SvlJWUfz.js +61 -0
  68. package/dist/passport-horizontal-hint-CFsGs7Dp.js +293 -0
  69. package/dist/passport-tutorial-z0LN7Hsp.js +11688 -0
  70. package/dist/passport-vertical-hint-BnCpKWeN.js +267 -0
  71. package/dist/phone/phone.es.js +87 -121
  72. package/dist/phone/styles.css +1 -1
  73. package/dist/phoneInput-C9T_8FJt.js +138 -0
  74. package/dist/phoneInputComposed-B-0zieIW.js +407 -0
  75. package/dist/processing-B5zhNH6I.js +15 -0
  76. package/dist/redirect-to-mobile/styles.css +1 -1
  77. package/dist/richText-Db0PfpkE.js +1973 -0
  78. package/dist/rolldown-runtime-CjdbFOpI.js +13 -0
  79. package/dist/selfie/selfie.es.js +29 -50
  80. package/dist/selfie/styles.css +170 -66
  81. package/dist/selfieTutorial-B0MIyPrk.js +2676 -0
  82. package/dist/setup-Dq2bzNKH.js +15 -0
  83. package/dist/signature/signature.es.js +557 -707
  84. package/dist/signature/styles.css +1 -1
  85. package/dist/spacer-DCljE53A.js +59 -0
  86. package/dist/spinner-Bk0YuoLu.js +1 -0
  87. package/dist/spinner-snIGzmm8.js +41 -0
  88. package/dist/successIcon-AHrfmJvv.js +17 -0
  89. package/dist/tutorial-DNOd11tg.js +2780 -0
  90. package/dist/types/ekyb.d.ts +29 -0
  91. package/dist/types/ekyc.d.ts +29 -0
  92. package/dist/types/index.d.ts +0 -8
  93. package/dist/typography-BNbFNFek.js +1 -0
  94. package/dist/typography-DvHeVWfY.js +29 -0
  95. package/dist/uiConfig-CwpQ-IM6.js +20 -0
  96. package/dist/vendor-preact-D6SntenC.js +958 -0
  97. package/dist/warningIcon-Cvj-ayg1.js +17 -0
  98. package/package.json +8 -11
  99. package/dist/AsYouType-D1H_js4X.js +0 -2607
  100. package/dist/Trans-aTzdT_SA.js +0 -55
  101. package/dist/addressAutocomplete-C8-wL1j_.js +0 -153
  102. package/dist/aligndevicelottie-DlQCRPfM.js +0 -29
  103. package/dist/back-horizontal-hint-CSlf9KI1.js +0 -5
  104. package/dist/back-tutorial-An9AcMSe.js +0 -29
  105. package/dist/back-vertical-hint-CNieqiCr.js +0 -5
  106. package/dist/backdevicelottie-B4NgyWmX.js +0 -29
  107. package/dist/blurdevicelottie-_BZRug1c.js +0 -29
  108. package/dist/browser-ponyfill-B6W6hHVY.js +0 -344
  109. package/dist/button-CE9kRlem.js +0 -184
  110. package/dist/cameraView-C2X7klNb.js +0 -55
  111. package/dist/captureOverlay-tCb4R4WE.js +0 -592
  112. package/dist/checkbox-B5X-mfqq.js +0 -137
  113. package/dist/chevronDown-DSHaPKbi.js +0 -23
  114. package/dist/closeIcon-9Hc97omv.js +0 -28
  115. package/dist/countries-DfLkrF0x.js +0 -616
  116. package/dist/dateInputComposed-C7PCzh-U.js +0 -173
  117. package/dist/documentCapture-C0mO-RGE.js +0 -692
  118. package/dist/dropdownComposed-BpinYlrx.js +0 -367
  119. package/dist/ekybModule-Dr6LJUg-.js +0 -357
  120. package/dist/ekycModule-C3mswduI.js +0 -291
  121. package/dist/errorContent-Cb8nmQAE.js +0 -44
  122. package/dist/errorIcon-DEARBrGx.js +0 -26
  123. package/dist/faceMatch-DbDp7D3d.js +0 -237
  124. package/dist/fileIcon-CCSvS10T.js +0 -52
  125. package/dist/flip-animation-COR596wy.js +0 -29
  126. package/dist/flipAnimation-BqV462TA.js +0 -2059
  127. package/dist/formField-CP6wDdfA.js +0 -106
  128. package/dist/front-horizontal-hint-lRLKd7vY.js +0 -7
  129. package/dist/front-vertical-hint-qQoJXRE3.js +0 -7
  130. package/dist/frontdevicelottie-KhKxT5n9.js +0 -29
  131. package/dist/glaredevicelottie-DLuIStvb.js +0 -29
  132. package/dist/id-laser-h-BBV3r3rz.js +0 -29
  133. package/dist/id-laser-v-BTHJaSfx.js +0 -29
  134. package/dist/id-tutorial-B-F5Q28m.js +0 -29
  135. package/dist/incodeModule-C4XIllao.js +0 -96
  136. package/dist/inputComposed-fUbAGrDy.js +0 -103
  137. package/dist/instance-BWYzq8dk.js +0 -2163
  138. package/dist/loadingIcon-DmuPXh70.js +0 -195
  139. package/dist/mandatoryConsent-5xPI0cor.js +0 -94
  140. package/dist/manualCaptureButton-BvFmTyJe.js +0 -372
  141. package/dist/numberedStep-DwUB__mh.js +0 -5
  142. package/dist/otpInput-BFXhqFRT.js +0 -156
  143. package/dist/page-SrUl0qtN.js +0 -69
  144. package/dist/passport-horizontal-hint-BCtpMp1Y.js +0 -5
  145. package/dist/passport-tutorial-CaYBFTqt.js +0 -29
  146. package/dist/passport-vertical-hint-GaLnzqHP.js +0 -5
  147. package/dist/permissions-DT4Fz9MR.js +0 -709
  148. package/dist/phoneInput-CGr8TxOO.js +0 -158
  149. package/dist/phoneInputComposed-Cm9O2Jba.js +0 -206
  150. package/dist/processing-szVOCQwZ.js +0 -19
  151. package/dist/richText-cspvNz2a.js +0 -1807
  152. package/dist/selfieTutorial-Dm_p0ke9.js +0 -29
  153. package/dist/spinner-DygONskw.js +0 -60
  154. package/dist/successIcon-Bjsdc4lF.js +0 -26
  155. package/dist/tutorial-Cdz1025D.js +0 -473
  156. package/dist/types/ekyb/styles.d.ts +0 -1
  157. package/dist/types/ekyc/styles.d.ts +0 -1
  158. package/dist/typography-BDACYR5i.js +0 -14
  159. package/dist/uiConfig-Dnt-2YWB.js +0 -23
  160. package/dist/useMediaQuery-lJdQBmC2.js +0 -18
  161. package/dist/vendor-preact-BoMmvSgn.js +0 -694
  162. package/dist/warningIcon-DQq_MrOB.js +0 -26
@@ -1,2638 +1,2298 @@
1
- import { u as l, c as _t, b as F, S as X, I as wt, a as It } from "../loadingIcon-DmuPXh70.js";
2
- import { createOrchestratedFlowManager as Ot, getRequiredWasmPipelines as Et } from "@incodetech/core/flow";
3
- import { Q as qt, d as _, k as ne, b as Vt, y as L, z as zt, P as Ht, q as x, A as Le } from "../vendor-preact-BoMmvSgn.js";
4
- import { api as yt, resolveWasmConfig as Kt, warmupWasm as Gt } from "@incodetech/core";
5
- import "../instance-BWYzq8dk.js";
6
- import { r as Tt } from "../incodeModule-C4XIllao.js";
7
- import { S as J } from "../spinner-DygONskw.js";
8
- import { createRedirectToMobileManager as Yt } from "@incodetech/core/redirect-to-mobile";
9
- import { B as Z, V as jt, u as xt, i as Jt } from "../button-CE9kRlem.js";
10
- import { S as Mt } from "../successIcon-Bjsdc4lF.js";
11
- import { a as Qt } from "../countries-DfLkrF0x.js";
12
- import { T as Wt } from "../Trans-aTzdT_SA.js";
13
- import { ekybMachine as Xt } from "@incodetech/core/ekyb";
14
- import { ekycMachine as Zt } from "@incodetech/core/ekyc";
15
- import { emailMachine as $t } from "@incodetech/core/email";
16
- import { faceMatchMachine as en } from "@incodetech/core/face-match";
17
- import { geolocationMachine as tn } from "@incodetech/core/geolocation";
18
- import { documentCaptureMachine as Ve } from "@incodetech/core/document-capture";
19
- import { idCaptureMachine as ae } from "@incodetech/core/id";
20
- import { phoneMachine as nn } from "@incodetech/core/phone";
21
- import { selfieMachine as rn } from "@incodetech/core/selfie";
22
- import { authenticationMachine as on } from "@incodetech/core/authentication";
23
- import { curpValidationMachine as sn } from "@incodetech/core/curp-validation";
24
- import { governmentValidationMachine as an } from "@incodetech/core/government-validation";
25
- import { consentMachine as cn } from "@incodetech/core/consent";
26
- import { mandatoryConsentMachine as ln } from "@incodetech/core/mandatory-consent";
27
- import { setup as un } from "../index.es.js";
28
- import { s as te } from "../uiConfig-Dnt-2YWB.js";
29
- import { signatureMachine as dn } from "@incodetech/core/signature";
30
- import { antifraudMachine as fn } from "@incodetech/core/antifraud";
31
- const Rt = qt(null), Fe = () => {
32
- const e = Vt(Rt);
33
- if (!e)
34
- throw new Error("Tabs compound components must be used within <Tabs>");
35
- return e;
36
- }, hn = ({
37
- defaultValue: e,
38
- listClassName: t,
39
- triggerClassName: i,
40
- activeTriggerClassName: r,
41
- children: n
42
- }) => {
43
- const [o, a] = _(e);
44
- return /* @__PURE__ */ l(
45
- Rt.Provider,
46
- {
47
- value: {
48
- activeValue: o,
49
- setActiveValue: a,
50
- listClassName: t,
51
- triggerClassName: i,
52
- activeTriggerClassName: r
53
- },
54
- children: n
55
- }
56
- );
57
- }, gn = ({ children: e }) => {
58
- const { listClassName: t } = Fe();
59
- return /* @__PURE__ */ l("div", { class: t, children: e });
60
- }, mn = ({ value: e, children: t }) => {
61
- const {
62
- activeValue: i,
63
- setActiveValue: r,
64
- triggerClassName: n,
65
- activeTriggerClassName: o
66
- } = Fe();
67
- return /* @__PURE__ */ l(
68
- "button",
69
- {
70
- type: "button",
71
- class: _t(
72
- n,
73
- i === e && o
74
- ),
75
- onClick: () => r(e),
76
- children: t
77
- }
78
- );
79
- }, pn = ({ value: e, children: t }) => {
80
- const { activeValue: i } = Fe();
81
- return i !== e ? null : /* @__PURE__ */ l(ne, { children: t });
82
- }, G = Object.assign(hn, {
83
- List: gn,
84
- Trigger: mn,
85
- Content: pn
86
- }), Cn = ({ logoSrc: e }) => {
87
- const { t } = F();
88
- return /* @__PURE__ */ l("header", { class: "IncodeRedirectHeader", children: [
89
- /* @__PURE__ */ l("div", { class: "IncodeRedirectLogoWrapper", children: /* @__PURE__ */ l("img", { src: e, alt: "Logo", class: "IncodeRedirectLogo" }) }),
90
- /* @__PURE__ */ l(X, { size: 24 }),
91
- /* @__PURE__ */ l("h1", { class: "IncodeRedirectTitle", children: t("v2.redirectToMobile.title") }),
92
- /* @__PURE__ */ l(X, { size: 12 }),
93
- /* @__PURE__ */ l("p", { class: "IncodeRedirectSubtitle", children: t("v2.redirectToMobile.subtitle") })
94
- ] });
95
- }, wn = ({
96
- addContinueToDesktop: e,
97
- onContinueOnDesktop: t
98
- }) => {
99
- const { t: i } = F();
100
- return /* @__PURE__ */ l("footer", { class: "IncodeRedirectBottomNav", children: [
101
- e ? /* @__PURE__ */ l(Z, { variant: "link", onClick: t, children: i("redirect.continueOnDesktop") }) : null,
102
- /* @__PURE__ */ l(jt, {})
103
- ] });
104
- }, In = ({ visible: e }) => {
105
- const { t } = F();
106
- return e ? /* @__PURE__ */ l("div", { class: "IncodeRedirectToast", children: [
107
- /* @__PURE__ */ l(Mt, { size: 24 }),
108
- /* @__PURE__ */ l("span", { class: "IncodeRedirectToastText", children: t("redirect.linkResent") })
109
- ] }) : null;
110
- };
111
- var Y = {}, ce, ze;
112
- function En() {
113
- return ze || (ze = 1, ce = function() {
114
- return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
115
- }), ce;
116
- }
117
- var le = {}, q = {}, He;
118
- function z() {
119
- if (He) return q;
120
- He = 1;
121
- let e;
122
- const t = [
123
- 0,
124
- // Not used
125
- 26,
126
- 44,
127
- 70,
128
- 100,
129
- 134,
130
- 172,
131
- 196,
132
- 242,
133
- 292,
134
- 346,
135
- 404,
136
- 466,
137
- 532,
138
- 581,
139
- 655,
140
- 733,
141
- 815,
142
- 901,
143
- 991,
144
- 1085,
145
- 1156,
146
- 1258,
147
- 1364,
148
- 1474,
149
- 1588,
150
- 1706,
151
- 1828,
152
- 1921,
153
- 2051,
154
- 2185,
155
- 2323,
156
- 2465,
157
- 2611,
158
- 2761,
159
- 2876,
160
- 3034,
161
- 3196,
162
- 3362,
163
- 3532,
164
- 3706
165
- ];
166
- return q.getSymbolSize = function(r) {
167
- if (!r) throw new Error('"version" cannot be null or undefined');
168
- if (r < 1 || r > 40) throw new Error('"version" should be in range from 1 to 40');
169
- return r * 4 + 17;
170
- }, q.getSymbolTotalCodewords = function(r) {
171
- return t[r];
172
- }, q.getBCHDigit = function(i) {
173
- let r = 0;
174
- for (; i !== 0; )
175
- r++, i >>>= 1;
176
- return r;
177
- }, q.setToSJISFunction = function(r) {
178
- if (typeof r != "function")
179
- throw new Error('"toSJISFunc" is not a valid function.');
180
- e = r;
181
- }, q.isKanjiModeEnabled = function() {
182
- return typeof e < "u";
183
- }, q.toSJIS = function(r) {
184
- return e(r);
185
- }, q;
186
- }
187
- var ue = {}, Ke;
188
- function Ue() {
189
- return Ke || (Ke = 1, (function(e) {
190
- e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
191
- function t(i) {
192
- if (typeof i != "string")
193
- throw new Error("Param is not a string");
194
- switch (i.toLowerCase()) {
195
- case "l":
196
- case "low":
197
- return e.L;
198
- case "m":
199
- case "medium":
200
- return e.M;
201
- case "q":
202
- case "quartile":
203
- return e.Q;
204
- case "h":
205
- case "high":
206
- return e.H;
207
- default:
208
- throw new Error("Unknown EC Level: " + i);
209
- }
210
- }
211
- e.isValid = function(r) {
212
- return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
213
- }, e.from = function(r, n) {
214
- if (e.isValid(r))
215
- return r;
216
- try {
217
- return t(r);
218
- } catch {
219
- return n;
220
- }
221
- };
222
- })(ue)), ue;
223
- }
224
- var de, Ge;
225
- function yn() {
226
- if (Ge) return de;
227
- Ge = 1;
228
- function e() {
229
- this.buffer = [], this.length = 0;
230
- }
231
- return e.prototype = {
232
- get: function(t) {
233
- const i = Math.floor(t / 8);
234
- return (this.buffer[i] >>> 7 - t % 8 & 1) === 1;
235
- },
236
- put: function(t, i) {
237
- for (let r = 0; r < i; r++)
238
- this.putBit((t >>> i - r - 1 & 1) === 1);
239
- },
240
- getLengthInBits: function() {
241
- return this.length;
242
- },
243
- putBit: function(t) {
244
- const i = Math.floor(this.length / 8);
245
- this.buffer.length <= i && this.buffer.push(0), t && (this.buffer[i] |= 128 >>> this.length % 8), this.length++;
246
- }
247
- }, de = e, de;
248
- }
249
- var fe, Ye;
250
- function Tn() {
251
- if (Ye) return fe;
252
- Ye = 1;
253
- function e(t) {
254
- if (!t || t < 1)
255
- throw new Error("BitMatrix size must be defined and greater than 0");
256
- this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
257
- }
258
- return e.prototype.set = function(t, i, r, n) {
259
- const o = t * this.size + i;
260
- this.data[o] = r, n && (this.reservedBit[o] = !0);
261
- }, e.prototype.get = function(t, i) {
262
- return this.data[t * this.size + i];
263
- }, e.prototype.xor = function(t, i, r) {
264
- this.data[t * this.size + i] ^= r;
265
- }, e.prototype.isReserved = function(t, i) {
266
- return this.reservedBit[t * this.size + i];
267
- }, fe = e, fe;
268
- }
269
- var he = {}, je;
270
- function Mn() {
271
- return je || (je = 1, (function(e) {
272
- const t = z().getSymbolSize;
273
- e.getRowColCoords = function(r) {
274
- if (r === 1) return [];
275
- const n = Math.floor(r / 7) + 2, o = t(r), a = o === 145 ? 26 : Math.ceil((o - 13) / (2 * n - 2)) * 2, c = [o - 7];
276
- for (let s = 1; s < n - 1; s++)
277
- c[s] = c[s - 1] - a;
278
- return c.push(6), c.reverse();
279
- }, e.getPositions = function(r) {
280
- const n = [], o = e.getRowColCoords(r), a = o.length;
281
- for (let c = 0; c < a; c++)
282
- for (let s = 0; s < a; s++)
283
- c === 0 && s === 0 || // top-left
284
- c === 0 && s === a - 1 || // bottom-left
285
- c === a - 1 && s === 0 || n.push([o[c], o[s]]);
286
- return n;
287
- };
288
- })(he)), he;
289
- }
290
- var ge = {}, xe;
291
- function Rn() {
292
- if (xe) return ge;
293
- xe = 1;
294
- const e = z().getSymbolSize, t = 7;
295
- return ge.getPositions = function(r) {
296
- const n = e(r);
297
- return [
298
- // top-left
299
- [0, 0],
300
- // top-right
301
- [n - t, 0],
302
- // bottom-left
303
- [0, n - t]
304
- ];
305
- }, ge;
306
- }
307
- var me = {}, Je;
308
- function Sn() {
309
- return Je || (Je = 1, (function(e) {
310
- e.Patterns = {
311
- PATTERN000: 0,
312
- PATTERN001: 1,
313
- PATTERN010: 2,
314
- PATTERN011: 3,
315
- PATTERN100: 4,
316
- PATTERN101: 5,
317
- PATTERN110: 6,
318
- PATTERN111: 7
319
- };
320
- const t = {
321
- N1: 3,
322
- N2: 3,
323
- N3: 40,
324
- N4: 10
325
- };
326
- e.isValid = function(n) {
327
- return n != null && n !== "" && !isNaN(n) && n >= 0 && n <= 7;
328
- }, e.from = function(n) {
329
- return e.isValid(n) ? parseInt(n, 10) : void 0;
330
- }, e.getPenaltyN1 = function(n) {
331
- const o = n.size;
332
- let a = 0, c = 0, s = 0, u = null, h = null;
333
- for (let g = 0; g < o; g++) {
334
- c = s = 0, u = h = null;
335
- for (let d = 0; d < o; d++) {
336
- let f = n.get(g, d);
337
- f === u ? c++ : (c >= 5 && (a += t.N1 + (c - 5)), u = f, c = 1), f = n.get(d, g), f === h ? s++ : (s >= 5 && (a += t.N1 + (s - 5)), h = f, s = 1);
338
- }
339
- c >= 5 && (a += t.N1 + (c - 5)), s >= 5 && (a += t.N1 + (s - 5));
340
- }
341
- return a;
342
- }, e.getPenaltyN2 = function(n) {
343
- const o = n.size;
344
- let a = 0;
345
- for (let c = 0; c < o - 1; c++)
346
- for (let s = 0; s < o - 1; s++) {
347
- const u = n.get(c, s) + n.get(c, s + 1) + n.get(c + 1, s) + n.get(c + 1, s + 1);
348
- (u === 4 || u === 0) && a++;
349
- }
350
- return a * t.N2;
351
- }, e.getPenaltyN3 = function(n) {
352
- const o = n.size;
353
- let a = 0, c = 0, s = 0;
354
- for (let u = 0; u < o; u++) {
355
- c = s = 0;
356
- for (let h = 0; h < o; h++)
357
- c = c << 1 & 2047 | n.get(u, h), h >= 10 && (c === 1488 || c === 93) && a++, s = s << 1 & 2047 | n.get(h, u), h >= 10 && (s === 1488 || s === 93) && a++;
358
- }
359
- return a * t.N3;
360
- }, e.getPenaltyN4 = function(n) {
361
- let o = 0;
362
- const a = n.data.length;
363
- for (let s = 0; s < a; s++) o += n.data[s];
364
- return Math.abs(Math.ceil(o * 100 / a / 5) - 10) * t.N4;
365
- };
366
- function i(r, n, o) {
367
- switch (r) {
368
- case e.Patterns.PATTERN000:
369
- return (n + o) % 2 === 0;
370
- case e.Patterns.PATTERN001:
371
- return n % 2 === 0;
372
- case e.Patterns.PATTERN010:
373
- return o % 3 === 0;
374
- case e.Patterns.PATTERN011:
375
- return (n + o) % 3 === 0;
376
- case e.Patterns.PATTERN100:
377
- return (Math.floor(n / 2) + Math.floor(o / 3)) % 2 === 0;
378
- case e.Patterns.PATTERN101:
379
- return n * o % 2 + n * o % 3 === 0;
380
- case e.Patterns.PATTERN110:
381
- return (n * o % 2 + n * o % 3) % 2 === 0;
382
- case e.Patterns.PATTERN111:
383
- return (n * o % 3 + (n + o) % 2) % 2 === 0;
384
- default:
385
- throw new Error("bad maskPattern:" + r);
386
- }
387
- }
388
- e.applyMask = function(n, o) {
389
- const a = o.size;
390
- for (let c = 0; c < a; c++)
391
- for (let s = 0; s < a; s++)
392
- o.isReserved(s, c) || o.xor(s, c, i(n, s, c));
393
- }, e.getBestMask = function(n, o) {
394
- const a = Object.keys(e.Patterns).length;
395
- let c = 0, s = 1 / 0;
396
- for (let u = 0; u < a; u++) {
397
- o(u), e.applyMask(u, n);
398
- const h = e.getPenaltyN1(n) + e.getPenaltyN2(n) + e.getPenaltyN3(n) + e.getPenaltyN4(n);
399
- e.applyMask(u, n), h < s && (s = h, c = u);
400
- }
401
- return c;
402
- };
403
- })(me)), me;
404
- }
405
- var ee = {}, Qe;
406
- function St() {
407
- if (Qe) return ee;
408
- Qe = 1;
409
- const e = Ue(), t = [
410
- // L M Q H
411
- 1,
412
- 1,
413
- 1,
414
- 1,
415
- 1,
416
- 1,
417
- 1,
418
- 1,
419
- 1,
420
- 1,
421
- 2,
422
- 2,
423
- 1,
424
- 2,
425
- 2,
426
- 4,
427
- 1,
428
- 2,
429
- 4,
430
- 4,
431
- 2,
432
- 4,
433
- 4,
434
- 4,
435
- 2,
436
- 4,
437
- 6,
438
- 5,
439
- 2,
440
- 4,
441
- 6,
442
- 6,
443
- 2,
444
- 5,
445
- 8,
446
- 8,
447
- 4,
448
- 5,
449
- 8,
450
- 8,
451
- 4,
452
- 5,
453
- 8,
454
- 11,
455
- 4,
456
- 8,
457
- 10,
458
- 11,
459
- 4,
460
- 9,
461
- 12,
462
- 16,
463
- 4,
464
- 9,
465
- 16,
466
- 16,
467
- 6,
468
- 10,
469
- 12,
470
- 18,
471
- 6,
472
- 10,
473
- 17,
474
- 16,
475
- 6,
476
- 11,
477
- 16,
478
- 19,
479
- 6,
480
- 13,
481
- 18,
482
- 21,
483
- 7,
484
- 14,
485
- 21,
486
- 25,
487
- 8,
488
- 16,
489
- 20,
490
- 25,
491
- 8,
492
- 17,
493
- 23,
494
- 25,
495
- 9,
496
- 17,
497
- 23,
498
- 34,
499
- 9,
500
- 18,
501
- 25,
502
- 30,
503
- 10,
504
- 20,
505
- 27,
506
- 32,
507
- 12,
508
- 21,
509
- 29,
510
- 35,
511
- 12,
512
- 23,
513
- 34,
514
- 37,
515
- 12,
516
- 25,
517
- 34,
518
- 40,
519
- 13,
520
- 26,
521
- 35,
522
- 42,
523
- 14,
524
- 28,
525
- 38,
526
- 45,
527
- 15,
528
- 29,
529
- 40,
530
- 48,
531
- 16,
532
- 31,
533
- 43,
534
- 51,
535
- 17,
536
- 33,
537
- 45,
538
- 54,
539
- 18,
540
- 35,
541
- 48,
542
- 57,
543
- 19,
544
- 37,
545
- 51,
546
- 60,
547
- 19,
548
- 38,
549
- 53,
550
- 63,
551
- 20,
552
- 40,
553
- 56,
554
- 66,
555
- 21,
556
- 43,
557
- 59,
558
- 70,
559
- 22,
560
- 45,
561
- 62,
562
- 74,
563
- 24,
564
- 47,
565
- 65,
566
- 77,
567
- 25,
568
- 49,
569
- 68,
570
- 81
571
- ], i = [
572
- // L M Q H
573
- 7,
574
- 10,
575
- 13,
576
- 17,
577
- 10,
578
- 16,
579
- 22,
580
- 28,
581
- 15,
582
- 26,
583
- 36,
584
- 44,
585
- 20,
586
- 36,
587
- 52,
588
- 64,
589
- 26,
590
- 48,
591
- 72,
592
- 88,
593
- 36,
594
- 64,
595
- 96,
596
- 112,
597
- 40,
598
- 72,
599
- 108,
600
- 130,
601
- 48,
602
- 88,
603
- 132,
604
- 156,
605
- 60,
606
- 110,
607
- 160,
608
- 192,
609
- 72,
610
- 130,
611
- 192,
612
- 224,
613
- 80,
614
- 150,
615
- 224,
616
- 264,
617
- 96,
618
- 176,
619
- 260,
620
- 308,
621
- 104,
622
- 198,
623
- 288,
624
- 352,
625
- 120,
626
- 216,
627
- 320,
628
- 384,
629
- 132,
630
- 240,
631
- 360,
632
- 432,
633
- 144,
634
- 280,
635
- 408,
636
- 480,
637
- 168,
638
- 308,
639
- 448,
640
- 532,
641
- 180,
642
- 338,
643
- 504,
644
- 588,
645
- 196,
646
- 364,
647
- 546,
648
- 650,
649
- 224,
650
- 416,
651
- 600,
652
- 700,
653
- 224,
654
- 442,
655
- 644,
656
- 750,
657
- 252,
658
- 476,
659
- 690,
660
- 816,
661
- 270,
662
- 504,
663
- 750,
664
- 900,
665
- 300,
666
- 560,
667
- 810,
668
- 960,
669
- 312,
670
- 588,
671
- 870,
672
- 1050,
673
- 336,
674
- 644,
675
- 952,
676
- 1110,
677
- 360,
678
- 700,
679
- 1020,
680
- 1200,
681
- 390,
682
- 728,
683
- 1050,
684
- 1260,
685
- 420,
686
- 784,
687
- 1140,
688
- 1350,
689
- 450,
690
- 812,
691
- 1200,
692
- 1440,
693
- 480,
694
- 868,
695
- 1290,
696
- 1530,
697
- 510,
698
- 924,
699
- 1350,
700
- 1620,
701
- 540,
702
- 980,
703
- 1440,
704
- 1710,
705
- 570,
706
- 1036,
707
- 1530,
708
- 1800,
709
- 570,
710
- 1064,
711
- 1590,
712
- 1890,
713
- 600,
714
- 1120,
715
- 1680,
716
- 1980,
717
- 630,
718
- 1204,
719
- 1770,
720
- 2100,
721
- 660,
722
- 1260,
723
- 1860,
724
- 2220,
725
- 720,
726
- 1316,
727
- 1950,
728
- 2310,
729
- 750,
730
- 1372,
731
- 2040,
732
- 2430
733
- ];
734
- return ee.getBlocksCount = function(n, o) {
735
- switch (o) {
736
- case e.L:
737
- return t[(n - 1) * 4 + 0];
738
- case e.M:
739
- return t[(n - 1) * 4 + 1];
740
- case e.Q:
741
- return t[(n - 1) * 4 + 2];
742
- case e.H:
743
- return t[(n - 1) * 4 + 3];
744
- default:
745
- return;
746
- }
747
- }, ee.getTotalCodewordsCount = function(n, o) {
748
- switch (o) {
749
- case e.L:
750
- return i[(n - 1) * 4 + 0];
751
- case e.M:
752
- return i[(n - 1) * 4 + 1];
753
- case e.Q:
754
- return i[(n - 1) * 4 + 2];
755
- case e.H:
756
- return i[(n - 1) * 4 + 3];
757
- default:
758
- return;
759
- }
760
- }, ee;
761
- }
762
- var pe = {}, W = {}, We;
763
- function bn() {
764
- if (We) return W;
765
- We = 1;
766
- const e = new Uint8Array(512), t = new Uint8Array(256);
767
- return (function() {
768
- let r = 1;
769
- for (let n = 0; n < 255; n++)
770
- e[n] = r, t[r] = n, r <<= 1, r & 256 && (r ^= 285);
771
- for (let n = 255; n < 512; n++)
772
- e[n] = e[n - 255];
773
- })(), W.log = function(r) {
774
- if (r < 1) throw new Error("log(" + r + ")");
775
- return t[r];
776
- }, W.exp = function(r) {
777
- return e[r];
778
- }, W.mul = function(r, n) {
779
- return r === 0 || n === 0 ? 0 : e[t[r] + t[n]];
780
- }, W;
781
- }
782
- var Xe;
783
- function An() {
784
- return Xe || (Xe = 1, (function(e) {
785
- const t = bn();
786
- e.mul = function(r, n) {
787
- const o = new Uint8Array(r.length + n.length - 1);
788
- for (let a = 0; a < r.length; a++)
789
- for (let c = 0; c < n.length; c++)
790
- o[a + c] ^= t.mul(r[a], n[c]);
791
- return o;
792
- }, e.mod = function(r, n) {
793
- let o = new Uint8Array(r);
794
- for (; o.length - n.length >= 0; ) {
795
- const a = o[0];
796
- for (let s = 0; s < n.length; s++)
797
- o[s] ^= t.mul(n[s], a);
798
- let c = 0;
799
- for (; c < o.length && o[c] === 0; ) c++;
800
- o = o.slice(c);
801
- }
802
- return o;
803
- }, e.generateECPolynomial = function(r) {
804
- let n = new Uint8Array([1]);
805
- for (let o = 0; o < r; o++)
806
- n = e.mul(n, new Uint8Array([1, t.exp(o)]));
807
- return n;
808
- };
809
- })(pe)), pe;
810
- }
811
- var Ce, Ze;
812
- function Nn() {
813
- if (Ze) return Ce;
814
- Ze = 1;
815
- const e = An();
816
- function t(i) {
817
- this.genPoly = void 0, this.degree = i, this.degree && this.initialize(this.degree);
818
- }
819
- return t.prototype.initialize = function(r) {
820
- this.degree = r, this.genPoly = e.generateECPolynomial(this.degree);
821
- }, t.prototype.encode = function(r) {
822
- if (!this.genPoly)
823
- throw new Error("Encoder not initialized");
824
- const n = new Uint8Array(r.length + this.degree);
825
- n.set(r);
826
- const o = e.mod(n, this.genPoly), a = this.degree - o.length;
827
- if (a > 0) {
828
- const c = new Uint8Array(this.degree);
829
- return c.set(o, a), c;
830
- }
831
- return o;
832
- }, Ce = t, Ce;
833
- }
834
- var we = {}, Ie = {}, Ee = {}, $e;
835
- function bt() {
836
- return $e || ($e = 1, Ee.isValid = function(t) {
837
- return !isNaN(t) && t >= 1 && t <= 40;
838
- }), Ee;
1
+ import { t as e } from "../rolldown-runtime-CjdbFOpI.js";
2
+ import { n as t, t as n } from "../i18n-DZOHbK9q.js";
3
+ import { S as r, _ as i, c as a, g as o, h as s, l as c, o as l, p as u, v as d, x as f } from "../vendor-preact-D6SntenC.js";
4
+ import { t as p } from "../uiConfig-CwpQ-IM6.js";
5
+ import { t as m } from "../setup-Dq2bzNKH.js";
6
+ import { c as h, n as g, r as _ } from "../loadingIcon-CeQt7Zgb.js";
7
+ import { t as v } from "../spacer-DCljE53A.js";
8
+ import { i as y, n as b, r as x, t as S } from "../button-DhL5eRT3.js";
9
+ import { t as C } from "../spinner-snIGzmm8.js";
10
+ import "../spinner-Bk0YuoLu.js";
11
+ import "../icons-BHbofCgJ.js";
12
+ import { t as w } from "../successIcon-AHrfmJvv.js";
13
+ import { n as ee } from "../countries-y2ydYDhN.js";
14
+ import { t as T } from "../incodeModule-Bf6yJ8RB.js";
15
+ import { api as E, resolveWasmConfig as te, warmupWasm as ne } from "@incodetech/core";
16
+ import { antifraudMachine as re } from "@incodetech/core/antifraud";
17
+ import { authenticationMachine as ie } from "@incodetech/core/authentication";
18
+ import { consentMachine as ae } from "@incodetech/core/consent";
19
+ import { curpValidationMachine as oe } from "@incodetech/core/curp-validation";
20
+ import { ekybMachine as se } from "@incodetech/core/ekyb";
21
+ import { ekycMachine as ce } from "@incodetech/core/ekyc";
22
+ import { emailMachine as le } from "@incodetech/core/email";
23
+ import { createOrchestratedFlowManager as ue, getRequiredWasmPipelines as D } from "@incodetech/core/flow";
24
+ import { createRedirectToMobileManager as de } from "@incodetech/core/redirect-to-mobile";
25
+ import { faceMatchMachine as fe } from "@incodetech/core/face-match";
26
+ import { geolocationMachine as pe } from "@incodetech/core/geolocation";
27
+ import { documentCaptureMachine as O } from "@incodetech/core/document-capture";
28
+ import { idCaptureMachine as k } from "@incodetech/core/id";
29
+ import { phoneMachine as me } from "@incodetech/core/phone";
30
+ import { selfieMachine as he } from "@incodetech/core/selfie";
31
+ import { governmentValidationMachine as ge } from "@incodetech/core/government-validation";
32
+ import { mandatoryConsentMachine as _e } from "@incodetech/core/mandatory-consent";
33
+ import { signatureMachine as ve } from "@incodetech/core/signature";
34
+ //#region src/shared/tabs/tabs.tsx
35
+ var A = f(null), j = () => {
36
+ let e = o(A);
37
+ if (!e) throw Error("Tabs compound components must be used within <Tabs>");
38
+ return e;
39
+ }, M = Object.assign(({ defaultValue: e, listClassName: t, triggerClassName: n, activeTriggerClassName: r, children: i }) => {
40
+ let [a, o] = u(e);
41
+ return /* @__PURE__ */ d(A.Provider, {
42
+ value: {
43
+ activeValue: a,
44
+ setActiveValue: o,
45
+ listClassName: t,
46
+ triggerClassName: n,
47
+ activeTriggerClassName: r
48
+ },
49
+ children: i
50
+ });
51
+ }, {
52
+ List: ({ children: e }) => {
53
+ let { listClassName: t } = j();
54
+ return /* @__PURE__ */ d("div", {
55
+ class: t,
56
+ children: e
57
+ });
58
+ },
59
+ Trigger: ({ value: e, children: t }) => {
60
+ let { activeValue: n, setActiveValue: r, triggerClassName: i, activeTriggerClassName: a } = j();
61
+ return /* @__PURE__ */ d("button", {
62
+ type: "button",
63
+ class: g(i, n === e && a),
64
+ onClick: () => r(e),
65
+ children: t
66
+ });
67
+ },
68
+ Content: ({ value: e, children: t }) => {
69
+ let { activeValue: n } = j();
70
+ return n === e ? /* @__PURE__ */ d(r, { children: t }) : null;
71
+ }
72
+ }), ye = ({ logoSrc: e }) => {
73
+ let { t: n } = t();
74
+ return /* @__PURE__ */ d("header", {
75
+ class: "IncodeRedirectHeader",
76
+ children: [
77
+ /* @__PURE__ */ d("div", {
78
+ class: "IncodeRedirectLogoWrapper",
79
+ children: /* @__PURE__ */ d("img", {
80
+ src: e,
81
+ alt: "Logo",
82
+ class: "IncodeRedirectLogo"
83
+ })
84
+ }),
85
+ /* @__PURE__ */ d(v, { size: 24 }),
86
+ /* @__PURE__ */ d("h1", {
87
+ class: "IncodeRedirectTitle",
88
+ children: n("v2.redirectToMobile.title")
89
+ }),
90
+ /* @__PURE__ */ d(v, { size: 12 }),
91
+ /* @__PURE__ */ d("p", {
92
+ class: "IncodeRedirectSubtitle",
93
+ children: n("v2.redirectToMobile.subtitle")
94
+ })
95
+ ]
96
+ });
97
+ }, be = ({ addContinueToDesktop: e, onContinueOnDesktop: n }) => {
98
+ let { t: r } = t();
99
+ return /* @__PURE__ */ d("footer", {
100
+ class: "IncodeRedirectBottomNav",
101
+ children: [e ? /* @__PURE__ */ d(S, {
102
+ variant: "link",
103
+ onClick: n,
104
+ children: r("redirect.continueOnDesktop")
105
+ }) : null, /* @__PURE__ */ d(b, {})]
106
+ });
107
+ }, xe = ({ visible: e }) => {
108
+ let { t: n } = t();
109
+ return e ? /* @__PURE__ */ d("div", {
110
+ class: "IncodeRedirectToast",
111
+ children: [/* @__PURE__ */ d(w, { size: 24 }), /* @__PURE__ */ d("span", {
112
+ class: "IncodeRedirectToastText",
113
+ children: n("redirect.linkResent")
114
+ })]
115
+ }) : null;
116
+ }, Se = /* @__PURE__ */ e(((e, t) => {
117
+ t.exports = function() {
118
+ return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
119
+ };
120
+ })), N = /* @__PURE__ */ e(((e) => {
121
+ var t, n = [
122
+ 0,
123
+ 26,
124
+ 44,
125
+ 70,
126
+ 100,
127
+ 134,
128
+ 172,
129
+ 196,
130
+ 242,
131
+ 292,
132
+ 346,
133
+ 404,
134
+ 466,
135
+ 532,
136
+ 581,
137
+ 655,
138
+ 733,
139
+ 815,
140
+ 901,
141
+ 991,
142
+ 1085,
143
+ 1156,
144
+ 1258,
145
+ 1364,
146
+ 1474,
147
+ 1588,
148
+ 1706,
149
+ 1828,
150
+ 1921,
151
+ 2051,
152
+ 2185,
153
+ 2323,
154
+ 2465,
155
+ 2611,
156
+ 2761,
157
+ 2876,
158
+ 3034,
159
+ 3196,
160
+ 3362,
161
+ 3532,
162
+ 3706
163
+ ];
164
+ e.getSymbolSize = function(e) {
165
+ if (!e) throw Error("\"version\" cannot be null or undefined");
166
+ if (e < 1 || e > 40) throw Error("\"version\" should be in range from 1 to 40");
167
+ return e * 4 + 17;
168
+ }, e.getSymbolTotalCodewords = function(e) {
169
+ return n[e];
170
+ }, e.getBCHDigit = function(e) {
171
+ let t = 0;
172
+ for (; e !== 0;) t++, e >>>= 1;
173
+ return t;
174
+ }, e.setToSJISFunction = function(e) {
175
+ if (typeof e != "function") throw Error("\"toSJISFunc\" is not a valid function.");
176
+ t = e;
177
+ }, e.isKanjiModeEnabled = function() {
178
+ return t !== void 0;
179
+ }, e.toSJIS = function(e) {
180
+ return t(e);
181
+ };
182
+ })), P = /* @__PURE__ */ e(((e) => {
183
+ e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
184
+ function t(t) {
185
+ if (typeof t != "string") throw Error("Param is not a string");
186
+ switch (t.toLowerCase()) {
187
+ case "l":
188
+ case "low": return e.L;
189
+ case "m":
190
+ case "medium": return e.M;
191
+ case "q":
192
+ case "quartile": return e.Q;
193
+ case "h":
194
+ case "high": return e.H;
195
+ default: throw Error("Unknown EC Level: " + t);
196
+ }
197
+ }
198
+ e.isValid = function(e) {
199
+ return e && e.bit !== void 0 && e.bit >= 0 && e.bit < 4;
200
+ }, e.from = function(n, r) {
201
+ if (e.isValid(n)) return n;
202
+ try {
203
+ return t(n);
204
+ } catch {
205
+ return r;
206
+ }
207
+ };
208
+ })), Ce = /* @__PURE__ */ e(((e, t) => {
209
+ function n() {
210
+ this.buffer = [], this.length = 0;
211
+ }
212
+ n.prototype = {
213
+ get: function(e) {
214
+ let t = Math.floor(e / 8);
215
+ return (this.buffer[t] >>> 7 - e % 8 & 1) == 1;
216
+ },
217
+ put: function(e, t) {
218
+ for (let n = 0; n < t; n++) this.putBit((e >>> t - n - 1 & 1) == 1);
219
+ },
220
+ getLengthInBits: function() {
221
+ return this.length;
222
+ },
223
+ putBit: function(e) {
224
+ let t = Math.floor(this.length / 8);
225
+ this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
226
+ }
227
+ }, t.exports = n;
228
+ })), we = /* @__PURE__ */ e(((e, t) => {
229
+ function n(e) {
230
+ if (!e || e < 1) throw Error("BitMatrix size must be defined and greater than 0");
231
+ this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e);
232
+ }
233
+ n.prototype.set = function(e, t, n, r) {
234
+ let i = e * this.size + t;
235
+ this.data[i] = n, r && (this.reservedBit[i] = !0);
236
+ }, n.prototype.get = function(e, t) {
237
+ return this.data[e * this.size + t];
238
+ }, n.prototype.xor = function(e, t, n) {
239
+ this.data[e * this.size + t] ^= n;
240
+ }, n.prototype.isReserved = function(e, t) {
241
+ return this.reservedBit[e * this.size + t];
242
+ }, t.exports = n;
243
+ })), Te = /* @__PURE__ */ e(((e) => {
244
+ var t = N().getSymbolSize;
245
+ e.getRowColCoords = function(e) {
246
+ if (e === 1) return [];
247
+ let n = Math.floor(e / 7) + 2, r = t(e), i = r === 145 ? 26 : Math.ceil((r - 13) / (2 * n - 2)) * 2, a = [r - 7];
248
+ for (let e = 1; e < n - 1; e++) a[e] = a[e - 1] - i;
249
+ return a.push(6), a.reverse();
250
+ }, e.getPositions = function(t) {
251
+ let n = [], r = e.getRowColCoords(t), i = r.length;
252
+ for (let e = 0; e < i; e++) for (let t = 0; t < i; t++) e === 0 && t === 0 || e === 0 && t === i - 1 || e === i - 1 && t === 0 || n.push([r[e], r[t]]);
253
+ return n;
254
+ };
255
+ })), Ee = /* @__PURE__ */ e(((e) => {
256
+ var t = N().getSymbolSize, n = 7;
257
+ e.getPositions = function(e) {
258
+ let r = t(e);
259
+ return [
260
+ [0, 0],
261
+ [r - n, 0],
262
+ [0, r - n]
263
+ ];
264
+ };
265
+ })), De = /* @__PURE__ */ e(((e) => {
266
+ e.Patterns = {
267
+ PATTERN000: 0,
268
+ PATTERN001: 1,
269
+ PATTERN010: 2,
270
+ PATTERN011: 3,
271
+ PATTERN100: 4,
272
+ PATTERN101: 5,
273
+ PATTERN110: 6,
274
+ PATTERN111: 7
275
+ };
276
+ var t = {
277
+ N1: 3,
278
+ N2: 3,
279
+ N3: 40,
280
+ N4: 10
281
+ };
282
+ e.isValid = function(e) {
283
+ return e != null && e !== "" && !isNaN(e) && e >= 0 && e <= 7;
284
+ }, e.from = function(t) {
285
+ return e.isValid(t) ? parseInt(t, 10) : void 0;
286
+ }, e.getPenaltyN1 = function(e) {
287
+ let n = e.size, r = 0, i = 0, a = 0, o = null, s = null;
288
+ for (let c = 0; c < n; c++) {
289
+ i = a = 0, o = s = null;
290
+ for (let l = 0; l < n; l++) {
291
+ let n = e.get(c, l);
292
+ n === o ? i++ : (i >= 5 && (r += t.N1 + (i - 5)), o = n, i = 1), n = e.get(l, c), n === s ? a++ : (a >= 5 && (r += t.N1 + (a - 5)), s = n, a = 1);
293
+ }
294
+ i >= 5 && (r += t.N1 + (i - 5)), a >= 5 && (r += t.N1 + (a - 5));
295
+ }
296
+ return r;
297
+ }, e.getPenaltyN2 = function(e) {
298
+ let n = e.size, r = 0;
299
+ for (let t = 0; t < n - 1; t++) for (let i = 0; i < n - 1; i++) {
300
+ let n = e.get(t, i) + e.get(t, i + 1) + e.get(t + 1, i) + e.get(t + 1, i + 1);
301
+ (n === 4 || n === 0) && r++;
302
+ }
303
+ return r * t.N2;
304
+ }, e.getPenaltyN3 = function(e) {
305
+ let n = e.size, r = 0, i = 0, a = 0;
306
+ for (let t = 0; t < n; t++) {
307
+ i = a = 0;
308
+ for (let o = 0; o < n; o++) i = i << 1 & 2047 | e.get(t, o), o >= 10 && (i === 1488 || i === 93) && r++, a = a << 1 & 2047 | e.get(o, t), o >= 10 && (a === 1488 || a === 93) && r++;
309
+ }
310
+ return r * t.N3;
311
+ }, e.getPenaltyN4 = function(e) {
312
+ let n = 0, r = e.data.length;
313
+ for (let t = 0; t < r; t++) n += e.data[t];
314
+ return Math.abs(Math.ceil(n * 100 / r / 5) - 10) * t.N4;
315
+ };
316
+ function n(t, n, r) {
317
+ switch (t) {
318
+ case e.Patterns.PATTERN000: return (n + r) % 2 == 0;
319
+ case e.Patterns.PATTERN001: return n % 2 == 0;
320
+ case e.Patterns.PATTERN010: return r % 3 == 0;
321
+ case e.Patterns.PATTERN011: return (n + r) % 3 == 0;
322
+ case e.Patterns.PATTERN100: return (Math.floor(n / 2) + Math.floor(r / 3)) % 2 == 0;
323
+ case e.Patterns.PATTERN101: return n * r % 2 + n * r % 3 == 0;
324
+ case e.Patterns.PATTERN110: return (n * r % 2 + n * r % 3) % 2 == 0;
325
+ case e.Patterns.PATTERN111: return (n * r % 3 + (n + r) % 2) % 2 == 0;
326
+ default: throw Error("bad maskPattern:" + t);
327
+ }
328
+ }
329
+ e.applyMask = function(e, t) {
330
+ let r = t.size;
331
+ for (let i = 0; i < r; i++) for (let a = 0; a < r; a++) t.isReserved(a, i) || t.xor(a, i, n(e, a, i));
332
+ }, e.getBestMask = function(t, n) {
333
+ let r = Object.keys(e.Patterns).length, i = 0, a = Infinity;
334
+ for (let o = 0; o < r; o++) {
335
+ n(o), e.applyMask(o, t);
336
+ let r = e.getPenaltyN1(t) + e.getPenaltyN2(t) + e.getPenaltyN3(t) + e.getPenaltyN4(t);
337
+ e.applyMask(o, t), r < a && (a = r, i = o);
338
+ }
339
+ return i;
340
+ };
341
+ })), F = /* @__PURE__ */ e(((e) => {
342
+ var t = P(), n = [
343
+ 1,
344
+ 1,
345
+ 1,
346
+ 1,
347
+ 1,
348
+ 1,
349
+ 1,
350
+ 1,
351
+ 1,
352
+ 1,
353
+ 2,
354
+ 2,
355
+ 1,
356
+ 2,
357
+ 2,
358
+ 4,
359
+ 1,
360
+ 2,
361
+ 4,
362
+ 4,
363
+ 2,
364
+ 4,
365
+ 4,
366
+ 4,
367
+ 2,
368
+ 4,
369
+ 6,
370
+ 5,
371
+ 2,
372
+ 4,
373
+ 6,
374
+ 6,
375
+ 2,
376
+ 5,
377
+ 8,
378
+ 8,
379
+ 4,
380
+ 5,
381
+ 8,
382
+ 8,
383
+ 4,
384
+ 5,
385
+ 8,
386
+ 11,
387
+ 4,
388
+ 8,
389
+ 10,
390
+ 11,
391
+ 4,
392
+ 9,
393
+ 12,
394
+ 16,
395
+ 4,
396
+ 9,
397
+ 16,
398
+ 16,
399
+ 6,
400
+ 10,
401
+ 12,
402
+ 18,
403
+ 6,
404
+ 10,
405
+ 17,
406
+ 16,
407
+ 6,
408
+ 11,
409
+ 16,
410
+ 19,
411
+ 6,
412
+ 13,
413
+ 18,
414
+ 21,
415
+ 7,
416
+ 14,
417
+ 21,
418
+ 25,
419
+ 8,
420
+ 16,
421
+ 20,
422
+ 25,
423
+ 8,
424
+ 17,
425
+ 23,
426
+ 25,
427
+ 9,
428
+ 17,
429
+ 23,
430
+ 34,
431
+ 9,
432
+ 18,
433
+ 25,
434
+ 30,
435
+ 10,
436
+ 20,
437
+ 27,
438
+ 32,
439
+ 12,
440
+ 21,
441
+ 29,
442
+ 35,
443
+ 12,
444
+ 23,
445
+ 34,
446
+ 37,
447
+ 12,
448
+ 25,
449
+ 34,
450
+ 40,
451
+ 13,
452
+ 26,
453
+ 35,
454
+ 42,
455
+ 14,
456
+ 28,
457
+ 38,
458
+ 45,
459
+ 15,
460
+ 29,
461
+ 40,
462
+ 48,
463
+ 16,
464
+ 31,
465
+ 43,
466
+ 51,
467
+ 17,
468
+ 33,
469
+ 45,
470
+ 54,
471
+ 18,
472
+ 35,
473
+ 48,
474
+ 57,
475
+ 19,
476
+ 37,
477
+ 51,
478
+ 60,
479
+ 19,
480
+ 38,
481
+ 53,
482
+ 63,
483
+ 20,
484
+ 40,
485
+ 56,
486
+ 66,
487
+ 21,
488
+ 43,
489
+ 59,
490
+ 70,
491
+ 22,
492
+ 45,
493
+ 62,
494
+ 74,
495
+ 24,
496
+ 47,
497
+ 65,
498
+ 77,
499
+ 25,
500
+ 49,
501
+ 68,
502
+ 81
503
+ ], r = [
504
+ 7,
505
+ 10,
506
+ 13,
507
+ 17,
508
+ 10,
509
+ 16,
510
+ 22,
511
+ 28,
512
+ 15,
513
+ 26,
514
+ 36,
515
+ 44,
516
+ 20,
517
+ 36,
518
+ 52,
519
+ 64,
520
+ 26,
521
+ 48,
522
+ 72,
523
+ 88,
524
+ 36,
525
+ 64,
526
+ 96,
527
+ 112,
528
+ 40,
529
+ 72,
530
+ 108,
531
+ 130,
532
+ 48,
533
+ 88,
534
+ 132,
535
+ 156,
536
+ 60,
537
+ 110,
538
+ 160,
539
+ 192,
540
+ 72,
541
+ 130,
542
+ 192,
543
+ 224,
544
+ 80,
545
+ 150,
546
+ 224,
547
+ 264,
548
+ 96,
549
+ 176,
550
+ 260,
551
+ 308,
552
+ 104,
553
+ 198,
554
+ 288,
555
+ 352,
556
+ 120,
557
+ 216,
558
+ 320,
559
+ 384,
560
+ 132,
561
+ 240,
562
+ 360,
563
+ 432,
564
+ 144,
565
+ 280,
566
+ 408,
567
+ 480,
568
+ 168,
569
+ 308,
570
+ 448,
571
+ 532,
572
+ 180,
573
+ 338,
574
+ 504,
575
+ 588,
576
+ 196,
577
+ 364,
578
+ 546,
579
+ 650,
580
+ 224,
581
+ 416,
582
+ 600,
583
+ 700,
584
+ 224,
585
+ 442,
586
+ 644,
587
+ 750,
588
+ 252,
589
+ 476,
590
+ 690,
591
+ 816,
592
+ 270,
593
+ 504,
594
+ 750,
595
+ 900,
596
+ 300,
597
+ 560,
598
+ 810,
599
+ 960,
600
+ 312,
601
+ 588,
602
+ 870,
603
+ 1050,
604
+ 336,
605
+ 644,
606
+ 952,
607
+ 1110,
608
+ 360,
609
+ 700,
610
+ 1020,
611
+ 1200,
612
+ 390,
613
+ 728,
614
+ 1050,
615
+ 1260,
616
+ 420,
617
+ 784,
618
+ 1140,
619
+ 1350,
620
+ 450,
621
+ 812,
622
+ 1200,
623
+ 1440,
624
+ 480,
625
+ 868,
626
+ 1290,
627
+ 1530,
628
+ 510,
629
+ 924,
630
+ 1350,
631
+ 1620,
632
+ 540,
633
+ 980,
634
+ 1440,
635
+ 1710,
636
+ 570,
637
+ 1036,
638
+ 1530,
639
+ 1800,
640
+ 570,
641
+ 1064,
642
+ 1590,
643
+ 1890,
644
+ 600,
645
+ 1120,
646
+ 1680,
647
+ 1980,
648
+ 630,
649
+ 1204,
650
+ 1770,
651
+ 2100,
652
+ 660,
653
+ 1260,
654
+ 1860,
655
+ 2220,
656
+ 720,
657
+ 1316,
658
+ 1950,
659
+ 2310,
660
+ 750,
661
+ 1372,
662
+ 2040,
663
+ 2430
664
+ ];
665
+ e.getBlocksCount = function(e, r) {
666
+ switch (r) {
667
+ case t.L: return n[(e - 1) * 4 + 0];
668
+ case t.M: return n[(e - 1) * 4 + 1];
669
+ case t.Q: return n[(e - 1) * 4 + 2];
670
+ case t.H: return n[(e - 1) * 4 + 3];
671
+ default: return;
672
+ }
673
+ }, e.getTotalCodewordsCount = function(e, n) {
674
+ switch (n) {
675
+ case t.L: return r[(e - 1) * 4 + 0];
676
+ case t.M: return r[(e - 1) * 4 + 1];
677
+ case t.Q: return r[(e - 1) * 4 + 2];
678
+ case t.H: return r[(e - 1) * 4 + 3];
679
+ default: return;
680
+ }
681
+ };
682
+ })), Oe = /* @__PURE__ */ e(((e) => {
683
+ var t = new Uint8Array(512), n = new Uint8Array(256);
684
+ (function() {
685
+ let e = 1;
686
+ for (let r = 0; r < 255; r++) t[r] = e, n[e] = r, e <<= 1, e & 256 && (e ^= 285);
687
+ for (let e = 255; e < 512; e++) t[e] = t[e - 255];
688
+ })(), e.log = function(e) {
689
+ if (e < 1) throw Error("log(" + e + ")");
690
+ return n[e];
691
+ }, e.exp = function(e) {
692
+ return t[e];
693
+ }, e.mul = function(e, r) {
694
+ return e === 0 || r === 0 ? 0 : t[n[e] + n[r]];
695
+ };
696
+ })), ke = /* @__PURE__ */ e(((e) => {
697
+ var t = Oe();
698
+ e.mul = function(e, n) {
699
+ let r = new Uint8Array(e.length + n.length - 1);
700
+ for (let i = 0; i < e.length; i++) for (let a = 0; a < n.length; a++) r[i + a] ^= t.mul(e[i], n[a]);
701
+ return r;
702
+ }, e.mod = function(e, n) {
703
+ let r = new Uint8Array(e);
704
+ for (; r.length - n.length >= 0;) {
705
+ let e = r[0];
706
+ for (let i = 0; i < n.length; i++) r[i] ^= t.mul(n[i], e);
707
+ let i = 0;
708
+ for (; i < r.length && r[i] === 0;) i++;
709
+ r = r.slice(i);
710
+ }
711
+ return r;
712
+ }, e.generateECPolynomial = function(n) {
713
+ let r = new Uint8Array([1]);
714
+ for (let i = 0; i < n; i++) r = e.mul(r, new Uint8Array([1, t.exp(i)]));
715
+ return r;
716
+ };
717
+ })), Ae = /* @__PURE__ */ e(((e, t) => {
718
+ var n = ke();
719
+ function r(e) {
720
+ this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
721
+ }
722
+ r.prototype.initialize = function(e) {
723
+ this.degree = e, this.genPoly = n.generateECPolynomial(this.degree);
724
+ }, r.prototype.encode = function(e) {
725
+ if (!this.genPoly) throw Error("Encoder not initialized");
726
+ let t = new Uint8Array(e.length + this.degree);
727
+ t.set(e);
728
+ let r = n.mod(t, this.genPoly), i = this.degree - r.length;
729
+ if (i > 0) {
730
+ let e = new Uint8Array(this.degree);
731
+ return e.set(r, i), e;
732
+ }
733
+ return r;
734
+ }, t.exports = r;
735
+ })), I = /* @__PURE__ */ e(((e) => {
736
+ e.isValid = function(e) {
737
+ return !isNaN(e) && e >= 1 && e <= 40;
738
+ };
739
+ })), L = /* @__PURE__ */ e(((e) => {
740
+ var t = "[0-9]+", n = "[A-Z $%*+\\-./:]+", r = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
741
+ r = r.replace(/u/g, "\\u");
742
+ var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + r + ")(?:.|[\r\n]))+";
743
+ e.KANJI = new RegExp(r, "g"), e.BYTE_KANJI = /* @__PURE__ */ RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), e.BYTE = new RegExp(i, "g"), e.NUMERIC = new RegExp(t, "g"), e.ALPHANUMERIC = new RegExp(n, "g");
744
+ var a = RegExp("^" + r + "$"), o = RegExp("^" + t + "$"), s = /* @__PURE__ */ RegExp("^[A-Z0-9 $%*+\\-./:]+$");
745
+ e.testKanji = function(e) {
746
+ return a.test(e);
747
+ }, e.testNumeric = function(e) {
748
+ return o.test(e);
749
+ }, e.testAlphanumeric = function(e) {
750
+ return s.test(e);
751
+ };
752
+ })), R = /* @__PURE__ */ e(((e) => {
753
+ var t = I(), n = L();
754
+ e.NUMERIC = {
755
+ id: "Numeric",
756
+ bit: 1,
757
+ ccBits: [
758
+ 10,
759
+ 12,
760
+ 14
761
+ ]
762
+ }, e.ALPHANUMERIC = {
763
+ id: "Alphanumeric",
764
+ bit: 2,
765
+ ccBits: [
766
+ 9,
767
+ 11,
768
+ 13
769
+ ]
770
+ }, e.BYTE = {
771
+ id: "Byte",
772
+ bit: 4,
773
+ ccBits: [
774
+ 8,
775
+ 16,
776
+ 16
777
+ ]
778
+ }, e.KANJI = {
779
+ id: "Kanji",
780
+ bit: 8,
781
+ ccBits: [
782
+ 8,
783
+ 10,
784
+ 12
785
+ ]
786
+ }, e.MIXED = { bit: -1 }, e.getCharCountIndicator = function(e, n) {
787
+ if (!e.ccBits) throw Error("Invalid mode: " + e);
788
+ if (!t.isValid(n)) throw Error("Invalid version: " + n);
789
+ return n >= 1 && n < 10 ? e.ccBits[0] : n < 27 ? e.ccBits[1] : e.ccBits[2];
790
+ }, e.getBestModeForData = function(t) {
791
+ return n.testNumeric(t) ? e.NUMERIC : n.testAlphanumeric(t) ? e.ALPHANUMERIC : n.testKanji(t) ? e.KANJI : e.BYTE;
792
+ }, e.toString = function(e) {
793
+ if (e && e.id) return e.id;
794
+ throw Error("Invalid mode");
795
+ }, e.isValid = function(e) {
796
+ return e && e.bit && e.ccBits;
797
+ };
798
+ function r(t) {
799
+ if (typeof t != "string") throw Error("Param is not a string");
800
+ switch (t.toLowerCase()) {
801
+ case "numeric": return e.NUMERIC;
802
+ case "alphanumeric": return e.ALPHANUMERIC;
803
+ case "kanji": return e.KANJI;
804
+ case "byte": return e.BYTE;
805
+ default: throw Error("Unknown mode: " + t);
806
+ }
807
+ }
808
+ e.from = function(t, n) {
809
+ if (e.isValid(t)) return t;
810
+ try {
811
+ return r(t);
812
+ } catch {
813
+ return n;
814
+ }
815
+ };
816
+ })), je = /* @__PURE__ */ e(((e) => {
817
+ var t = N(), n = F(), r = P(), i = R(), a = I(), o = 7973, s = t.getBCHDigit(o);
818
+ function c(t, n, r) {
819
+ for (let i = 1; i <= 40; i++) if (n <= e.getCapacity(i, r, t)) return i;
820
+ }
821
+ function l(e, t) {
822
+ return i.getCharCountIndicator(e, t) + 4;
823
+ }
824
+ function u(e, t) {
825
+ let n = 0;
826
+ return e.forEach(function(e) {
827
+ let r = l(e.mode, t);
828
+ n += r + e.getBitsLength();
829
+ }), n;
830
+ }
831
+ function d(t, n) {
832
+ for (let r = 1; r <= 40; r++) if (u(t, r) <= e.getCapacity(r, n, i.MIXED)) return r;
833
+ }
834
+ e.from = function(e, t) {
835
+ return a.isValid(e) ? parseInt(e, 10) : t;
836
+ }, e.getCapacity = function(e, r, o) {
837
+ if (!a.isValid(e)) throw Error("Invalid QR Code version");
838
+ o === void 0 && (o = i.BYTE);
839
+ let s = (t.getSymbolTotalCodewords(e) - n.getTotalCodewordsCount(e, r)) * 8;
840
+ if (o === i.MIXED) return s;
841
+ let c = s - l(o, e);
842
+ switch (o) {
843
+ case i.NUMERIC: return Math.floor(c / 10 * 3);
844
+ case i.ALPHANUMERIC: return Math.floor(c / 11 * 2);
845
+ case i.KANJI: return Math.floor(c / 13);
846
+ case i.BYTE:
847
+ default: return Math.floor(c / 8);
848
+ }
849
+ }, e.getBestVersionForData = function(e, t) {
850
+ let n, i = r.from(t, r.M);
851
+ if (Array.isArray(e)) {
852
+ if (e.length > 1) return d(e, i);
853
+ if (e.length === 0) return 1;
854
+ n = e[0];
855
+ } else n = e;
856
+ return c(n.mode, n.getLength(), i);
857
+ }, e.getEncodedBits = function(e) {
858
+ if (!a.isValid(e) || e < 7) throw Error("Invalid QR Code version");
859
+ let n = e << 12;
860
+ for (; t.getBCHDigit(n) - s >= 0;) n ^= o << t.getBCHDigit(n) - s;
861
+ return e << 12 | n;
862
+ };
863
+ })), Me = /* @__PURE__ */ e(((e) => {
864
+ var t = N(), n = 1335, r = 21522, i = t.getBCHDigit(n);
865
+ e.getEncodedBits = function(e, a) {
866
+ let o = e.bit << 3 | a, s = o << 10;
867
+ for (; t.getBCHDigit(s) - i >= 0;) s ^= n << t.getBCHDigit(s) - i;
868
+ return (o << 10 | s) ^ r;
869
+ };
870
+ })), Ne = /* @__PURE__ */ e(((e, t) => {
871
+ var n = R();
872
+ function r(e) {
873
+ this.mode = n.NUMERIC, this.data = e.toString();
874
+ }
875
+ r.getBitsLength = function(e) {
876
+ return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
877
+ }, r.prototype.getLength = function() {
878
+ return this.data.length;
879
+ }, r.prototype.getBitsLength = function() {
880
+ return r.getBitsLength(this.data.length);
881
+ }, r.prototype.write = function(e) {
882
+ let t, n, r;
883
+ for (t = 0; t + 3 <= this.data.length; t += 3) n = this.data.substr(t, 3), r = parseInt(n, 10), e.put(r, 10);
884
+ let i = this.data.length - t;
885
+ i > 0 && (n = this.data.substr(t), r = parseInt(n, 10), e.put(r, i * 3 + 1));
886
+ }, t.exports = r;
887
+ })), Pe = /* @__PURE__ */ e(((e, t) => {
888
+ var n = R(), r = /* @__PURE__ */ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
889
+ function i(e) {
890
+ this.mode = n.ALPHANUMERIC, this.data = e;
891
+ }
892
+ i.getBitsLength = function(e) {
893
+ return 11 * Math.floor(e / 2) + e % 2 * 6;
894
+ }, i.prototype.getLength = function() {
895
+ return this.data.length;
896
+ }, i.prototype.getBitsLength = function() {
897
+ return i.getBitsLength(this.data.length);
898
+ }, i.prototype.write = function(e) {
899
+ let t;
900
+ for (t = 0; t + 2 <= this.data.length; t += 2) {
901
+ let n = r.indexOf(this.data[t]) * 45;
902
+ n += r.indexOf(this.data[t + 1]), e.put(n, 11);
903
+ }
904
+ this.data.length % 2 && e.put(r.indexOf(this.data[t]), 6);
905
+ }, t.exports = i;
906
+ })), Fe = /* @__PURE__ */ e(((e, t) => {
907
+ var n = R();
908
+ function r(e) {
909
+ this.mode = n.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
910
+ }
911
+ r.getBitsLength = function(e) {
912
+ return e * 8;
913
+ }, r.prototype.getLength = function() {
914
+ return this.data.length;
915
+ }, r.prototype.getBitsLength = function() {
916
+ return r.getBitsLength(this.data.length);
917
+ }, r.prototype.write = function(e) {
918
+ for (let t = 0, n = this.data.length; t < n; t++) e.put(this.data[t], 8);
919
+ }, t.exports = r;
920
+ })), Ie = /* @__PURE__ */ e(((e, t) => {
921
+ var n = R(), r = N();
922
+ function i(e) {
923
+ this.mode = n.KANJI, this.data = e;
924
+ }
925
+ i.getBitsLength = function(e) {
926
+ return e * 13;
927
+ }, i.prototype.getLength = function() {
928
+ return this.data.length;
929
+ }, i.prototype.getBitsLength = function() {
930
+ return i.getBitsLength(this.data.length);
931
+ }, i.prototype.write = function(e) {
932
+ let t;
933
+ for (t = 0; t < this.data.length; t++) {
934
+ let n = r.toSJIS(this.data[t]);
935
+ if (n >= 33088 && n <= 40956) n -= 33088;
936
+ else if (n >= 57408 && n <= 60351) n -= 49472;
937
+ else throw Error("Invalid SJIS character: " + this.data[t] + "\nMake sure your charset is UTF-8");
938
+ n = (n >>> 8 & 255) * 192 + (n & 255), e.put(n, 13);
939
+ }
940
+ }, t.exports = i;
941
+ })), Le = /* @__PURE__ */ e(((e, t) => {
942
+ var n = {
943
+ single_source_shortest_paths: function(e, t, r) {
944
+ var i = {}, a = {};
945
+ a[t] = 0;
946
+ var o = n.PriorityQueue.make();
947
+ o.push(t, 0);
948
+ for (var s, c, l, u, d, f, p, m, h; !o.empty();) for (l in s = o.pop(), c = s.value, u = s.cost, d = e[c] || {}, d) d.hasOwnProperty(l) && (f = d[l], p = u + f, m = a[l], h = a[l] === void 0, (h || m > p) && (a[l] = p, o.push(l, p), i[l] = c));
949
+ if (r !== void 0 && a[r] === void 0) {
950
+ var g = [
951
+ "Could not find a path from ",
952
+ t,
953
+ " to ",
954
+ r,
955
+ "."
956
+ ].join("");
957
+ throw Error(g);
958
+ }
959
+ return i;
960
+ },
961
+ extract_shortest_path_from_predecessor_list: function(e, t) {
962
+ for (var n = [], r = t; r;) n.push(r), e[r], r = e[r];
963
+ return n.reverse(), n;
964
+ },
965
+ find_path: function(e, t, r) {
966
+ var i = n.single_source_shortest_paths(e, t, r);
967
+ return n.extract_shortest_path_from_predecessor_list(i, r);
968
+ },
969
+ PriorityQueue: {
970
+ make: function(e) {
971
+ var t = n.PriorityQueue, r = {}, i;
972
+ for (i in e ||= {}, t) t.hasOwnProperty(i) && (r[i] = t[i]);
973
+ return r.queue = [], r.sorter = e.sorter || t.default_sorter, r;
974
+ },
975
+ default_sorter: function(e, t) {
976
+ return e.cost - t.cost;
977
+ },
978
+ push: function(e, t) {
979
+ var n = {
980
+ value: e,
981
+ cost: t
982
+ };
983
+ this.queue.push(n), this.queue.sort(this.sorter);
984
+ },
985
+ pop: function() {
986
+ return this.queue.shift();
987
+ },
988
+ empty: function() {
989
+ return this.queue.length === 0;
990
+ }
991
+ }
992
+ };
993
+ t !== void 0 && (t.exports = n);
994
+ })), Re = /* @__PURE__ */ e(((e) => {
995
+ var t = R(), n = Ne(), r = Pe(), i = Fe(), a = Ie(), o = L(), s = N(), c = Le();
996
+ function l(e) {
997
+ return unescape(encodeURIComponent(e)).length;
998
+ }
999
+ function u(e, t, n) {
1000
+ let r = [], i;
1001
+ for (; (i = e.exec(n)) !== null;) r.push({
1002
+ data: i[0],
1003
+ index: i.index,
1004
+ mode: t,
1005
+ length: i[0].length
1006
+ });
1007
+ return r;
1008
+ }
1009
+ function d(e) {
1010
+ let n = u(o.NUMERIC, t.NUMERIC, e), r = u(o.ALPHANUMERIC, t.ALPHANUMERIC, e), i, a;
1011
+ return s.isKanjiModeEnabled() ? (i = u(o.BYTE, t.BYTE, e), a = u(o.KANJI, t.KANJI, e)) : (i = u(o.BYTE_KANJI, t.BYTE, e), a = []), n.concat(r, i, a).sort(function(e, t) {
1012
+ return e.index - t.index;
1013
+ }).map(function(e) {
1014
+ return {
1015
+ data: e.data,
1016
+ mode: e.mode,
1017
+ length: e.length
1018
+ };
1019
+ });
1020
+ }
1021
+ function f(e, o) {
1022
+ switch (o) {
1023
+ case t.NUMERIC: return n.getBitsLength(e);
1024
+ case t.ALPHANUMERIC: return r.getBitsLength(e);
1025
+ case t.KANJI: return a.getBitsLength(e);
1026
+ case t.BYTE: return i.getBitsLength(e);
1027
+ }
1028
+ }
1029
+ function p(e) {
1030
+ return e.reduce(function(e, t) {
1031
+ let n = e.length - 1 >= 0 ? e[e.length - 1] : null;
1032
+ return n && n.mode === t.mode ? (e[e.length - 1].data += t.data, e) : (e.push(t), e);
1033
+ }, []);
1034
+ }
1035
+ function m(e) {
1036
+ let n = [];
1037
+ for (let r = 0; r < e.length; r++) {
1038
+ let i = e[r];
1039
+ switch (i.mode) {
1040
+ case t.NUMERIC:
1041
+ n.push([
1042
+ i,
1043
+ {
1044
+ data: i.data,
1045
+ mode: t.ALPHANUMERIC,
1046
+ length: i.length
1047
+ },
1048
+ {
1049
+ data: i.data,
1050
+ mode: t.BYTE,
1051
+ length: i.length
1052
+ }
1053
+ ]);
1054
+ break;
1055
+ case t.ALPHANUMERIC:
1056
+ n.push([i, {
1057
+ data: i.data,
1058
+ mode: t.BYTE,
1059
+ length: i.length
1060
+ }]);
1061
+ break;
1062
+ case t.KANJI:
1063
+ n.push([i, {
1064
+ data: i.data,
1065
+ mode: t.BYTE,
1066
+ length: l(i.data)
1067
+ }]);
1068
+ break;
1069
+ case t.BYTE: n.push([{
1070
+ data: i.data,
1071
+ mode: t.BYTE,
1072
+ length: l(i.data)
1073
+ }]);
1074
+ }
1075
+ }
1076
+ return n;
1077
+ }
1078
+ function h(e, n) {
1079
+ let r = {}, i = { start: {} }, a = ["start"];
1080
+ for (let o = 0; o < e.length; o++) {
1081
+ let s = e[o], c = [];
1082
+ for (let e = 0; e < s.length; e++) {
1083
+ let l = s[e], u = "" + o + e;
1084
+ c.push(u), r[u] = {
1085
+ node: l,
1086
+ lastCount: 0
1087
+ }, i[u] = {};
1088
+ for (let e = 0; e < a.length; e++) {
1089
+ let o = a[e];
1090
+ r[o] && r[o].node.mode === l.mode ? (i[o][u] = f(r[o].lastCount + l.length, l.mode) - f(r[o].lastCount, l.mode), r[o].lastCount += l.length) : (r[o] && (r[o].lastCount = l.length), i[o][u] = f(l.length, l.mode) + 4 + t.getCharCountIndicator(l.mode, n));
1091
+ }
1092
+ }
1093
+ a = c;
1094
+ }
1095
+ for (let e = 0; e < a.length; e++) i[a[e]].end = 0;
1096
+ return {
1097
+ map: i,
1098
+ table: r
1099
+ };
1100
+ }
1101
+ function g(e, o) {
1102
+ let c, l = t.getBestModeForData(e);
1103
+ if (c = t.from(o, l), c !== t.BYTE && c.bit < l.bit) throw Error("\"" + e + "\" cannot be encoded with mode " + t.toString(c) + ".\n Suggested mode is: " + t.toString(l));
1104
+ switch (c === t.KANJI && !s.isKanjiModeEnabled() && (c = t.BYTE), c) {
1105
+ case t.NUMERIC: return new n(e);
1106
+ case t.ALPHANUMERIC: return new r(e);
1107
+ case t.KANJI: return new a(e);
1108
+ case t.BYTE: return new i(e);
1109
+ }
1110
+ }
1111
+ e.fromArray = function(e) {
1112
+ return e.reduce(function(e, t) {
1113
+ return typeof t == "string" ? e.push(g(t, null)) : t.data && e.push(g(t.data, t.mode)), e;
1114
+ }, []);
1115
+ }, e.fromString = function(t, n) {
1116
+ let r = h(m(d(t, s.isKanjiModeEnabled())), n), i = c.find_path(r.map, "start", "end"), a = [];
1117
+ for (let e = 1; e < i.length - 1; e++) a.push(r.table[i[e]].node);
1118
+ return e.fromArray(p(a));
1119
+ }, e.rawSplit = function(t) {
1120
+ return e.fromArray(d(t, s.isKanjiModeEnabled()));
1121
+ };
1122
+ })), ze = /* @__PURE__ */ e(((e) => {
1123
+ var t = N(), n = P(), r = Ce(), i = we(), a = Te(), o = Ee(), s = De(), c = F(), l = Ae(), u = je(), d = Me(), f = R(), p = Re();
1124
+ function m(e, t) {
1125
+ let n = e.size, r = o.getPositions(t);
1126
+ for (let t = 0; t < r.length; t++) {
1127
+ let i = r[t][0], a = r[t][1];
1128
+ for (let t = -1; t <= 7; t++) if (!(i + t <= -1 || n <= i + t)) for (let r = -1; r <= 7; r++) a + r <= -1 || n <= a + r || (t >= 0 && t <= 6 && (r === 0 || r === 6) || r >= 0 && r <= 6 && (t === 0 || t === 6) || t >= 2 && t <= 4 && r >= 2 && r <= 4 ? e.set(i + t, a + r, !0, !0) : e.set(i + t, a + r, !1, !0));
1129
+ }
1130
+ }
1131
+ function h(e) {
1132
+ let t = e.size;
1133
+ for (let n = 8; n < t - 8; n++) {
1134
+ let t = n % 2 == 0;
1135
+ e.set(n, 6, t, !0), e.set(6, n, t, !0);
1136
+ }
1137
+ }
1138
+ function g(e, t) {
1139
+ let n = a.getPositions(t);
1140
+ for (let t = 0; t < n.length; t++) {
1141
+ let r = n[t][0], i = n[t][1];
1142
+ for (let t = -2; t <= 2; t++) for (let n = -2; n <= 2; n++) t === -2 || t === 2 || n === -2 || n === 2 || t === 0 && n === 0 ? e.set(r + t, i + n, !0, !0) : e.set(r + t, i + n, !1, !0);
1143
+ }
1144
+ }
1145
+ function _(e, t) {
1146
+ let n = e.size, r = u.getEncodedBits(t), i, a, o;
1147
+ for (let t = 0; t < 18; t++) i = Math.floor(t / 3), a = t % 3 + n - 8 - 3, o = (r >> t & 1) == 1, e.set(i, a, o, !0), e.set(a, i, o, !0);
1148
+ }
1149
+ function v(e, t, n) {
1150
+ let r = e.size, i = d.getEncodedBits(t, n), a, o;
1151
+ for (a = 0; a < 15; a++) o = (i >> a & 1) == 1, a < 6 ? e.set(a, 8, o, !0) : a < 8 ? e.set(a + 1, 8, o, !0) : e.set(r - 15 + a, 8, o, !0), a < 8 ? e.set(8, r - a - 1, o, !0) : a < 9 ? e.set(8, 15 - a - 1 + 1, o, !0) : e.set(8, 15 - a - 1, o, !0);
1152
+ e.set(r - 8, 8, 1, !0);
1153
+ }
1154
+ function y(e, t) {
1155
+ let n = e.size, r = -1, i = n - 1, a = 7, o = 0;
1156
+ for (let s = n - 1; s > 0; s -= 2) for (s === 6 && s--;;) {
1157
+ for (let n = 0; n < 2; n++) if (!e.isReserved(i, s - n)) {
1158
+ let r = !1;
1159
+ o < t.length && (r = (t[o] >>> a & 1) == 1), e.set(i, s - n, r), a--, a === -1 && (o++, a = 7);
1160
+ }
1161
+ if (i += r, i < 0 || n <= i) {
1162
+ i -= r, r = -r;
1163
+ break;
1164
+ }
1165
+ }
1166
+ }
1167
+ function b(e, n, i) {
1168
+ let a = new r();
1169
+ i.forEach(function(t) {
1170
+ a.put(t.mode.bit, 4), a.put(t.getLength(), f.getCharCountIndicator(t.mode, e)), t.write(a);
1171
+ });
1172
+ let o = (t.getSymbolTotalCodewords(e) - c.getTotalCodewordsCount(e, n)) * 8;
1173
+ for (a.getLengthInBits() + 4 <= o && a.put(0, 4); a.getLengthInBits() % 8 != 0;) a.putBit(0);
1174
+ let s = (o - a.getLengthInBits()) / 8;
1175
+ for (let e = 0; e < s; e++) a.put(e % 2 ? 17 : 236, 8);
1176
+ return x(a, e, n);
1177
+ }
1178
+ function x(e, n, r) {
1179
+ let i = t.getSymbolTotalCodewords(n), a = i - c.getTotalCodewordsCount(n, r), o = c.getBlocksCount(n, r), s = o - i % o, u = Math.floor(i / o), d = Math.floor(a / o), f = d + 1, p = u - d, m = new l(p), h = 0, g = Array(o), _ = Array(o), v = 0, y = new Uint8Array(e.buffer);
1180
+ for (let e = 0; e < o; e++) {
1181
+ let t = e < s ? d : f;
1182
+ g[e] = y.slice(h, h + t), _[e] = m.encode(g[e]), h += t, v = Math.max(v, t);
1183
+ }
1184
+ let b = new Uint8Array(i), x = 0, S, C;
1185
+ for (S = 0; S < v; S++) for (C = 0; C < o; C++) S < g[C].length && (b[x++] = g[C][S]);
1186
+ for (S = 0; S < p; S++) for (C = 0; C < o; C++) b[x++] = _[C][S];
1187
+ return b;
1188
+ }
1189
+ function S(e, n, r, a) {
1190
+ let o;
1191
+ if (Array.isArray(e)) o = p.fromArray(e);
1192
+ else if (typeof e == "string") {
1193
+ let t = n;
1194
+ if (!t) {
1195
+ let n = p.rawSplit(e);
1196
+ t = u.getBestVersionForData(n, r);
1197
+ }
1198
+ o = p.fromString(e, t || 40);
1199
+ } else throw Error("Invalid data");
1200
+ let c = u.getBestVersionForData(o, r);
1201
+ if (!c) throw Error("The amount of data is too big to be stored in a QR Code");
1202
+ if (!n) n = c;
1203
+ else if (n < c) throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + c + ".\n");
1204
+ let l = b(n, r, o), d = new i(t.getSymbolSize(n));
1205
+ return m(d, n), h(d), g(d, n), v(d, r, 0), n >= 7 && _(d, n), y(d, l), isNaN(a) && (a = s.getBestMask(d, v.bind(null, d, r))), s.applyMask(a, d), v(d, r, a), {
1206
+ modules: d,
1207
+ version: n,
1208
+ errorCorrectionLevel: r,
1209
+ maskPattern: a,
1210
+ segments: o
1211
+ };
1212
+ }
1213
+ e.create = function(e, r) {
1214
+ if (e === void 0 || e === "") throw Error("No input text");
1215
+ let i = n.M, a, o;
1216
+ return r !== void 0 && (i = n.from(r.errorCorrectionLevel, n.M), a = u.from(r.version), o = s.from(r.maskPattern), r.toSJISFunc && t.setToSJISFunction(r.toSJISFunc)), S(e, a, i, o);
1217
+ };
1218
+ })), z = /* @__PURE__ */ e(((e) => {
1219
+ function t(e) {
1220
+ if (typeof e == "number" && (e = e.toString()), typeof e != "string") throw Error("Color should be defined as hex string");
1221
+ let t = e.slice().replace("#", "").split("");
1222
+ if (t.length < 3 || t.length === 5 || t.length > 8) throw Error("Invalid hex color: " + e);
1223
+ (t.length === 3 || t.length === 4) && (t = Array.prototype.concat.apply([], t.map(function(e) {
1224
+ return [e, e];
1225
+ }))), t.length === 6 && t.push("F", "F");
1226
+ let n = parseInt(t.join(""), 16);
1227
+ return {
1228
+ r: n >> 24 & 255,
1229
+ g: n >> 16 & 255,
1230
+ b: n >> 8 & 255,
1231
+ a: n & 255,
1232
+ hex: "#" + t.slice(0, 6).join("")
1233
+ };
1234
+ }
1235
+ e.getOptions = function(e) {
1236
+ e ||= {}, e.color ||= {};
1237
+ let n = e.margin === void 0 || e.margin === null || e.margin < 0 ? 4 : e.margin, r = e.width && e.width >= 21 ? e.width : void 0, i = e.scale || 4;
1238
+ return {
1239
+ width: r,
1240
+ scale: r ? 4 : i,
1241
+ margin: n,
1242
+ color: {
1243
+ dark: t(e.color.dark || "#000000ff"),
1244
+ light: t(e.color.light || "#ffffffff")
1245
+ },
1246
+ type: e.type,
1247
+ rendererOpts: e.rendererOpts || {}
1248
+ };
1249
+ }, e.getScale = function(e, t) {
1250
+ return t.width && t.width >= e + t.margin * 2 ? t.width / (e + t.margin * 2) : t.scale;
1251
+ }, e.getImageWidth = function(t, n) {
1252
+ let r = e.getScale(t, n);
1253
+ return Math.floor((t + n.margin * 2) * r);
1254
+ }, e.qrToImageData = function(t, n, r) {
1255
+ let i = n.modules.size, a = n.modules.data, o = e.getScale(i, r), s = Math.floor((i + r.margin * 2) * o), c = r.margin * o, l = [r.color.light, r.color.dark];
1256
+ for (let e = 0; e < s; e++) for (let n = 0; n < s; n++) {
1257
+ let u = (e * s + n) * 4, d = r.color.light;
1258
+ if (e >= c && n >= c && e < s - c && n < s - c) {
1259
+ let t = Math.floor((e - c) / o), r = Math.floor((n - c) / o);
1260
+ d = l[a[t * i + r] ? 1 : 0];
1261
+ }
1262
+ t[u++] = d.r, t[u++] = d.g, t[u++] = d.b, t[u] = d.a;
1263
+ }
1264
+ };
1265
+ })), Be = /* @__PURE__ */ e(((e) => {
1266
+ var t = z();
1267
+ function n(e, t, n) {
1268
+ e.clearRect(0, 0, t.width, t.height), t.style ||= {}, t.height = n, t.width = n, t.style.height = n + "px", t.style.width = n + "px";
1269
+ }
1270
+ function r() {
1271
+ try {
1272
+ return document.createElement("canvas");
1273
+ } catch {
1274
+ throw Error("You need to specify a canvas element");
1275
+ }
1276
+ }
1277
+ e.render = function(e, i, a) {
1278
+ let o = a, s = i;
1279
+ o === void 0 && (!i || !i.getContext) && (o = i, i = void 0), i || (s = r()), o = t.getOptions(o);
1280
+ let c = t.getImageWidth(e.modules.size, o), l = s.getContext("2d"), u = l.createImageData(c, c);
1281
+ return t.qrToImageData(u.data, e, o), n(l, s, c), l.putImageData(u, 0, 0), s;
1282
+ }, e.renderToDataURL = function(t, n, r) {
1283
+ let i = r;
1284
+ i === void 0 && (!n || !n.getContext) && (i = n, n = void 0), i ||= {};
1285
+ let a = e.render(t, n, i), o = i.type || "image/png", s = i.rendererOpts || {};
1286
+ return a.toDataURL(o, s.quality);
1287
+ };
1288
+ })), Ve = /* @__PURE__ */ e(((e) => {
1289
+ var t = z();
1290
+ function n(e, t) {
1291
+ let n = e.a / 255, r = t + "=\"" + e.hex + "\"";
1292
+ return n < 1 ? r + " " + t + "-opacity=\"" + n.toFixed(2).slice(1) + "\"" : r;
1293
+ }
1294
+ function r(e, t, n) {
1295
+ let r = e + t;
1296
+ return n !== void 0 && (r += " " + n), r;
1297
+ }
1298
+ function i(e, t, n) {
1299
+ let i = "", a = 0, o = !1, s = 0;
1300
+ for (let c = 0; c < e.length; c++) {
1301
+ let l = Math.floor(c % t), u = Math.floor(c / t);
1302
+ !l && !o && (o = !0), e[c] ? (s++, c > 0 && l > 0 && e[c - 1] || (i += o ? r("M", l + n, .5 + u + n) : r("m", a, 0), a = 0, o = !1), l + 1 < t && e[c + 1] || (i += r("h", s), s = 0)) : a++;
1303
+ }
1304
+ return i;
1305
+ }
1306
+ e.render = function(e, r, a) {
1307
+ let o = t.getOptions(r), s = e.modules.size, c = e.modules.data, l = s + o.margin * 2, u = o.color.light.a ? "<path " + n(o.color.light, "fill") + " d=\"M0 0h" + l + "v" + l + "H0z\"/>" : "", d = "<path " + n(o.color.dark, "stroke") + " d=\"" + i(c, s, o.margin) + "\"/>", f = "viewBox=\"0 0 " + l + " " + l + "\"", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" " + (o.width ? "width=\"" + o.width + "\" height=\"" + o.width + "\" " : "") + f + " shape-rendering=\"crispEdges\">" + u + d + "</svg>\n";
1308
+ return typeof a == "function" && a(null, p), p;
1309
+ };
1310
+ })), He = (/* @__PURE__ */ e(((e) => {
1311
+ var t = Se(), n = ze(), r = Be(), i = Ve();
1312
+ function a(e, r, i, a, o) {
1313
+ let s = [].slice.call(arguments, 1), c = s.length, l = typeof s[c - 1] == "function";
1314
+ if (!l && !t()) throw Error("Callback required as last argument");
1315
+ if (l) {
1316
+ if (c < 2) throw Error("Too few arguments provided");
1317
+ c === 2 ? (o = i, i = r, r = a = void 0) : c === 3 && (r.getContext && o === void 0 ? (o = a, a = void 0) : (o = a, a = i, i = r, r = void 0));
1318
+ } else {
1319
+ if (c < 1) throw Error("Too few arguments provided");
1320
+ return c === 1 ? (i = r, r = a = void 0) : c === 2 && !r.getContext && (a = i, i = r, r = void 0), new Promise(function(t, o) {
1321
+ try {
1322
+ t(e(n.create(i, a), r, a));
1323
+ } catch (e) {
1324
+ o(e);
1325
+ }
1326
+ });
1327
+ }
1328
+ try {
1329
+ let t = n.create(i, a);
1330
+ o(null, e(t, r, a));
1331
+ } catch (e) {
1332
+ o(e);
1333
+ }
1334
+ }
1335
+ e.create = n.create, e.toCanvas = a.bind(null, r.render), e.toDataURL = a.bind(null, r.renderToDataURL), e.toString = a.bind(null, function(e, t, n) {
1336
+ return i.render(e, n);
1337
+ });
1338
+ })))(), Ue = ({ value: e, size: t = 150, bgColor: n = "#ffffff", fgColor: r = "#000000" }) => {
1339
+ let [a, o] = u("");
1340
+ return i(() => {
1341
+ e && (0, He.toString)(e, {
1342
+ type: "svg",
1343
+ width: t,
1344
+ margin: 0,
1345
+ color: {
1346
+ dark: r,
1347
+ light: n
1348
+ }
1349
+ }).then(o).catch(() => o(""));
1350
+ }, [
1351
+ e,
1352
+ t,
1353
+ n,
1354
+ r
1355
+ ]), a ? /* @__PURE__ */ d("div", {
1356
+ class: "IncodeRedirectQrCode",
1357
+ dangerouslySetInnerHTML: { __html: a }
1358
+ }) : null;
1359
+ }, We = ({ redirectUrl: e }) => {
1360
+ let { t: n } = t();
1361
+ return /* @__PURE__ */ d(r, { children: [/* @__PURE__ */ d("p", {
1362
+ class: "IncodeRedirectTabDescription",
1363
+ children: n("v2.redirectToMobile.qr.description")
1364
+ }), /* @__PURE__ */ d("div", {
1365
+ class: "IncodeRedirectQrWrapper",
1366
+ children: /* @__PURE__ */ d(Ue, {
1367
+ value: e,
1368
+ size: 186
1369
+ })
1370
+ })] });
1371
+ }, Ge = ({ formattedPhone: e, onResend: r, onChangePhone: i }) => {
1372
+ let { t: a } = t();
1373
+ return /* @__PURE__ */ d("div", {
1374
+ class: "IncodeRedirectLinkSent",
1375
+ children: [
1376
+ /* @__PURE__ */ d(w, { size: 32 }),
1377
+ /* @__PURE__ */ d(v, { size: 16 }),
1378
+ /* @__PURE__ */ d("h2", {
1379
+ class: "IncodeRedirectLinkSentTitle",
1380
+ children: a("redirect.linkSent")
1381
+ }),
1382
+ /* @__PURE__ */ d(v, { size: 12 }),
1383
+ /* @__PURE__ */ d("p", {
1384
+ class: "IncodeRedirectLinkSentPhone",
1385
+ children: a("redirect.linkSentTo", { phone: e })
1386
+ }),
1387
+ /* @__PURE__ */ d(v, { size: 32 }),
1388
+ /* @__PURE__ */ d("div", {
1389
+ class: "IncodeRedirectLinkSentActions",
1390
+ children: /* @__PURE__ */ d(n, {
1391
+ i18nKey: "redirect.didntReceiveLinkActions",
1392
+ defaultValue: "Didn't receive the link? <resend>Resend</resend> or <changePhone>Change phone number</changePhone>",
1393
+ components: {
1394
+ resend: /* @__PURE__ */ d(S, {
1395
+ variant: "link",
1396
+ onClick: r
1397
+ }),
1398
+ changePhone: /* @__PURE__ */ d(S, {
1399
+ variant: "link",
1400
+ onClick: i
1401
+ })
1402
+ }
1403
+ })
1404
+ })
1405
+ ]
1406
+ });
1407
+ }, Ke = a(() => import("../phoneInput-C9T_8FJt.js").then((e) => ({ default: e.PhoneInput }))), qe = ({ countryCode: e, phonePrefix: n, error: i, isSending: a, isPhoneValid: o, onPhoneChange: s, onSendSms: c }) => {
1408
+ let { t: u } = t();
1409
+ return /* @__PURE__ */ d(r, { children: [/* @__PURE__ */ d(l, {
1410
+ fallback: /* @__PURE__ */ d(C, {}),
1411
+ children: /* @__PURE__ */ d(Ke, {
1412
+ countryCode: e,
1413
+ phonePrefix: n,
1414
+ phoneError: i,
1415
+ disabled: a,
1416
+ autoFocus: !0,
1417
+ onPhoneChange: s
1418
+ })
1419
+ }), /* @__PURE__ */ d(S, {
1420
+ onClick: c,
1421
+ disabled: !o || a,
1422
+ isLoading: a,
1423
+ class: "IncodeRedirectSmsSendButton",
1424
+ children: u("redirect.sendLinkViaSms")
1425
+ })] });
1426
+ }, Je = (e, t) => e.startsWith(t) ? `${t} ${e.slice(t.length).replace(/(\d{3})(?=\d)/g, "$1 ")}` : e, Ye = ({ phonePrefix: e, smsSent: n, error: i, manager: a, onResend: o }) => {
1427
+ let { t: c } = t(), [l, f] = u(e), [p, m] = u(!1), [h, g] = u(!1), _ = ee(e)?.code ?? "", v = Je(l, e), y = s((e, t) => {
1428
+ f(e), m(t);
1429
+ }, []), b = s(() => {
1430
+ g(!0), a.sendSms(l), g(!1);
1431
+ }, [a, l]), x = s(() => {
1432
+ b(), o();
1433
+ }, [b, o]), S = s(() => {
1434
+ f(e), m(!1), a.resetSms();
1435
+ }, [a, e]);
1436
+ return /* @__PURE__ */ d(r, { children: [/* @__PURE__ */ d("p", {
1437
+ class: "IncodeRedirectTabDescription",
1438
+ children: c("v2.redirectToMobile.sms.description")
1439
+ }), n ? /* @__PURE__ */ d(Ge, {
1440
+ formattedPhone: v,
1441
+ onResend: x,
1442
+ onChangePhone: S
1443
+ }) : /* @__PURE__ */ d(qe, {
1444
+ countryCode: _,
1445
+ phonePrefix: e,
1446
+ error: i,
1447
+ isSending: h,
1448
+ isPhoneValid: p,
1449
+ onPhoneChange: y,
1450
+ onSendSms: b
1451
+ })] });
1452
+ }, Xe = ({ redirectUrl: e, phonePrefix: n, smsSent: r, disableSmsOption: i, addContinueToDesktop: a, error: o, manager: c, logoSrc: l }) => {
1453
+ let { t: f } = t(), [p, m] = u(!1), h = s(() => {
1454
+ m(!0), setTimeout(() => m(!1), 3e3);
1455
+ }, []), g = s(() => {
1456
+ c.continueOnDesktop();
1457
+ }, [c]);
1458
+ return /* @__PURE__ */ d("div", {
1459
+ class: "IncodeRedirectContainer",
1460
+ children: [/* @__PURE__ */ d(xe, { visible: p }), /* @__PURE__ */ d("div", {
1461
+ class: "IncodeRedirectCard",
1462
+ children: [
1463
+ /* @__PURE__ */ d(ye, { logoSrc: l }),
1464
+ /* @__PURE__ */ d("div", {
1465
+ class: "IncodeRedirectOptions",
1466
+ children: /* @__PURE__ */ d(M, {
1467
+ defaultValue: "qr",
1468
+ listClassName: "IncodeRedirectTabs",
1469
+ triggerClassName: "IncodeRedirectTab",
1470
+ activeTriggerClassName: "IncodeRedirectTabActive",
1471
+ children: [
1472
+ /* @__PURE__ */ d(M.List, { children: [/* @__PURE__ */ d(M.Trigger, {
1473
+ value: "qr",
1474
+ children: f("v2.redirectToMobile.tabs.0")
1475
+ }), i ? null : /* @__PURE__ */ d(M.Trigger, {
1476
+ value: "sms",
1477
+ children: f("v2.redirectToMobile.tabs.1")
1478
+ })] }),
1479
+ /* @__PURE__ */ d(M.Content, {
1480
+ value: "qr",
1481
+ children: /* @__PURE__ */ d(We, { redirectUrl: e })
1482
+ }),
1483
+ i ? null : /* @__PURE__ */ d(M.Content, {
1484
+ value: "sms",
1485
+ children: /* @__PURE__ */ d(Ye, {
1486
+ phonePrefix: n,
1487
+ smsSent: r,
1488
+ error: o,
1489
+ manager: c,
1490
+ onResend: h
1491
+ })
1492
+ })
1493
+ ]
1494
+ })
1495
+ }),
1496
+ /* @__PURE__ */ d(be, {
1497
+ addContinueToDesktop: a,
1498
+ onContinueOnDesktop: g
1499
+ })
1500
+ ]
1501
+ })]
1502
+ });
1503
+ }, Ze = ({ title: e, subtitle: n, logoSrc: r }) => {
1504
+ let { t: i } = t(), a = e ?? i("verificationComplete.title"), o = n ?? i("verificationComplete.message");
1505
+ return /* @__PURE__ */ d("div", {
1506
+ class: "IncodeRedirectFinishedContainer",
1507
+ children: [
1508
+ /* @__PURE__ */ d("img", {
1509
+ src: r,
1510
+ alt: "Logo",
1511
+ class: "IncodeRedirectLogo"
1512
+ }),
1513
+ a ? /* @__PURE__ */ d("h1", {
1514
+ class: "IncodeRedirectFinishedTitle",
1515
+ children: a
1516
+ }) : null,
1517
+ o ? /* @__PURE__ */ d("p", {
1518
+ class: "IncodeRedirectFinishedSubtitle",
1519
+ children: o
1520
+ }) : null
1521
+ ]
1522
+ });
1523
+ }, Qe = ({ config: e, onFinish: t, onContinue: n, onError: r }) => {
1524
+ let [a, o] = h(() => de({ config: e })), { logoSrc: s, logoHeightPx: c } = x({
1525
+ hideHeader: void 0,
1526
+ hideFooterBranding: void 0,
1527
+ logo: void 0,
1528
+ defaultLogoSrc: y
1529
+ });
1530
+ i(() => {
1531
+ a.status === "finished" && t?.();
1532
+ }, [a.status, t]), i(() => {
1533
+ a.status === "closed" && n?.();
1534
+ }, [a.status, n]), i(() => {
1535
+ a.status === "error" && r?.(a.error);
1536
+ }, [
1537
+ a.status,
1538
+ r,
1539
+ a
1540
+ ]);
1541
+ let l = a.status === "idle" || a.status === "loading" ? /* @__PURE__ */ d(C, { fullScreen: !0 }) : a.status === "redirecting" ? /* @__PURE__ */ d(Xe, {
1542
+ redirectUrl: a.redirectUrl,
1543
+ phonePrefix: a.phonePrefix,
1544
+ smsSent: a.smsSent,
1545
+ disableSmsOption: e.disableSmsOption ?? !1,
1546
+ addContinueToDesktop: e.addContinueToDesktop ?? !1,
1547
+ error: a.error,
1548
+ manager: o,
1549
+ logoSrc: s
1550
+ }) : a.status === "finished" ? /* @__PURE__ */ d(Ze, { logoSrc: s }) : null;
1551
+ return /* @__PURE__ */ d("div", {
1552
+ class: "IncodeRedirectRoot",
1553
+ style: { "--logo-height": `${c}px` },
1554
+ children: l
1555
+ });
1556
+ }, B = ({ config: e, onFinish: t, onContinue: n, onError: r }) => /* @__PURE__ */ d(_, { children: e ? /* @__PURE__ */ d(Qe, {
1557
+ config: e,
1558
+ onFinish: t,
1559
+ onContinue: n,
1560
+ onError: r
1561
+ }) : null });
1562
+ T(B, "incode-redirect-to-mobile");
1563
+ //#endregion
1564
+ //#region src/styles/generatePalette.ts
1565
+ function $e(e) {
1566
+ let t = e.replace("#", "");
1567
+ t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
1568
+ let n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
1569
+ if (!n) return null;
1570
+ let r = Number.parseInt(n[1], 16) / 255, i = Number.parseInt(n[2], 16) / 255, a = Number.parseInt(n[3], 16) / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = 0, l = 0, u = (o + s) / 2;
1571
+ if (o !== s) {
1572
+ let e = o - s;
1573
+ switch (l = u > .5 ? e / (2 - o - s) : e / (o + s), o) {
1574
+ case r:
1575
+ c = ((i - a) / e + (i < a ? 6 : 0)) / 6;
1576
+ break;
1577
+ case i:
1578
+ c = ((a - r) / e + 2) / 6;
1579
+ break;
1580
+ case a:
1581
+ c = ((r - i) / e + 4) / 6;
1582
+ break;
1583
+ }
1584
+ }
1585
+ return {
1586
+ h: c * 360,
1587
+ s: l * 100,
1588
+ l: u * 100
1589
+ };
839
1590
  }
840
- var D = {}, et;
841
- function At() {
842
- if (et) return D;
843
- et = 1;
844
- const e = "[0-9]+", t = "[A-Z $%*+\\-./:]+";
845
- let i = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
846
- i = i.replace(/u/g, "\\u");
847
- const r = "(?:(?![A-Z0-9 $%*+\\-./:]|" + i + `)(?:.|[\r
848
- ]))+`;
849
- D.KANJI = new RegExp(i, "g"), D.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), D.BYTE = new RegExp(r, "g"), D.NUMERIC = new RegExp(e, "g"), D.ALPHANUMERIC = new RegExp(t, "g");
850
- const n = new RegExp("^" + i + "$"), o = new RegExp("^" + e + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
851
- return D.testKanji = function(s) {
852
- return n.test(s);
853
- }, D.testNumeric = function(s) {
854
- return o.test(s);
855
- }, D.testAlphanumeric = function(s) {
856
- return a.test(s);
857
- }, D;
1591
+ function V(e, t, n) {
1592
+ let r = e / 360, i = t / 100, a = n / 100, o, s, c;
1593
+ if (i === 0) o = s = c = a;
1594
+ else {
1595
+ let e = (e, t, n) => (n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), t = a < .5 ? a * (1 + i) : a + i - a * i, n = 2 * a - t;
1596
+ o = e(n, t, r + 1 / 3), s = e(n, t, r), c = e(n, t, r - 1 / 3);
1597
+ }
1598
+ let l = (e) => {
1599
+ let t = Math.round(e * 255).toString(16);
1600
+ return t.length === 1 ? `0${t}` : t;
1601
+ };
1602
+ return `#${l(o)}${l(s)}${l(c)}`;
858
1603
  }
859
- var tt;
860
- function H() {
861
- return tt || (tt = 1, (function(e) {
862
- const t = bt(), i = At();
863
- e.NUMERIC = {
864
- id: "Numeric",
865
- bit: 1,
866
- ccBits: [10, 12, 14]
867
- }, e.ALPHANUMERIC = {
868
- id: "Alphanumeric",
869
- bit: 2,
870
- ccBits: [9, 11, 13]
871
- }, e.BYTE = {
872
- id: "Byte",
873
- bit: 4,
874
- ccBits: [8, 16, 16]
875
- }, e.KANJI = {
876
- id: "Kanji",
877
- bit: 8,
878
- ccBits: [8, 10, 12]
879
- }, e.MIXED = {
880
- bit: -1
881
- }, e.getCharCountIndicator = function(o, a) {
882
- if (!o.ccBits) throw new Error("Invalid mode: " + o);
883
- if (!t.isValid(a))
884
- throw new Error("Invalid version: " + a);
885
- return a >= 1 && a < 10 ? o.ccBits[0] : a < 27 ? o.ccBits[1] : o.ccBits[2];
886
- }, e.getBestModeForData = function(o) {
887
- return i.testNumeric(o) ? e.NUMERIC : i.testAlphanumeric(o) ? e.ALPHANUMERIC : i.testKanji(o) ? e.KANJI : e.BYTE;
888
- }, e.toString = function(o) {
889
- if (o && o.id) return o.id;
890
- throw new Error("Invalid mode");
891
- }, e.isValid = function(o) {
892
- return o && o.bit && o.ccBits;
893
- };
894
- function r(n) {
895
- if (typeof n != "string")
896
- throw new Error("Param is not a string");
897
- switch (n.toLowerCase()) {
898
- case "numeric":
899
- return e.NUMERIC;
900
- case "alphanumeric":
901
- return e.ALPHANUMERIC;
902
- case "kanji":
903
- return e.KANJI;
904
- case "byte":
905
- return e.BYTE;
906
- default:
907
- throw new Error("Unknown mode: " + n);
908
- }
909
- }
910
- e.from = function(o, a) {
911
- if (e.isValid(o))
912
- return o;
913
- try {
914
- return r(o);
915
- } catch {
916
- return a;
917
- }
918
- };
919
- })(Ie)), Ie;
920
- }
921
- var nt;
922
- function vn() {
923
- return nt || (nt = 1, (function(e) {
924
- const t = z(), i = St(), r = Ue(), n = H(), o = bt(), a = 7973, c = t.getBCHDigit(a);
925
- function s(d, f, M) {
926
- for (let E = 1; E <= 40; E++)
927
- if (f <= e.getCapacity(E, M, d))
928
- return E;
929
- }
930
- function u(d, f) {
931
- return n.getCharCountIndicator(d, f) + 4;
932
- }
933
- function h(d, f) {
934
- let M = 0;
935
- return d.forEach(function(E) {
936
- const P = u(E.mode, f);
937
- M += P + E.getBitsLength();
938
- }), M;
939
- }
940
- function g(d, f) {
941
- for (let M = 1; M <= 40; M++)
942
- if (h(d, M) <= e.getCapacity(M, f, n.MIXED))
943
- return M;
944
- }
945
- e.from = function(f, M) {
946
- return o.isValid(f) ? parseInt(f, 10) : M;
947
- }, e.getCapacity = function(f, M, E) {
948
- if (!o.isValid(f))
949
- throw new Error("Invalid QR Code version");
950
- typeof E > "u" && (E = n.BYTE);
951
- const P = t.getSymbolTotalCodewords(f), A = i.getTotalCodewordsCount(f, M), I = (P - A) * 8;
952
- if (E === n.MIXED) return I;
953
- const m = I - u(E, f);
954
- switch (E) {
955
- case n.NUMERIC:
956
- return Math.floor(m / 10 * 3);
957
- case n.ALPHANUMERIC:
958
- return Math.floor(m / 11 * 2);
959
- case n.KANJI:
960
- return Math.floor(m / 13);
961
- case n.BYTE:
962
- default:
963
- return Math.floor(m / 8);
964
- }
965
- }, e.getBestVersionForData = function(f, M) {
966
- let E;
967
- const P = r.from(M, r.M);
968
- if (Array.isArray(f)) {
969
- if (f.length > 1)
970
- return g(f, P);
971
- if (f.length === 0)
972
- return 1;
973
- E = f[0];
974
- } else
975
- E = f;
976
- return s(E.mode, E.getLength(), P);
977
- }, e.getEncodedBits = function(f) {
978
- if (!o.isValid(f) || f < 7)
979
- throw new Error("Invalid QR Code version");
980
- let M = f << 12;
981
- for (; t.getBCHDigit(M) - c >= 0; )
982
- M ^= a << t.getBCHDigit(M) - c;
983
- return f << 12 | M;
984
- };
985
- })(we)), we;
986
- }
987
- var ye = {}, rt;
988
- function Bn() {
989
- if (rt) return ye;
990
- rt = 1;
991
- const e = z(), t = 1335, i = 21522, r = e.getBCHDigit(t);
992
- return ye.getEncodedBits = function(o, a) {
993
- const c = o.bit << 3 | a;
994
- let s = c << 10;
995
- for (; e.getBCHDigit(s) - r >= 0; )
996
- s ^= t << e.getBCHDigit(s) - r;
997
- return (c << 10 | s) ^ i;
998
- }, ye;
999
- }
1000
- var Te = {}, Me, ot;
1001
- function Pn() {
1002
- if (ot) return Me;
1003
- ot = 1;
1004
- const e = H();
1005
- function t(i) {
1006
- this.mode = e.NUMERIC, this.data = i.toString();
1007
- }
1008
- return t.getBitsLength = function(r) {
1009
- return 10 * Math.floor(r / 3) + (r % 3 ? r % 3 * 3 + 1 : 0);
1010
- }, t.prototype.getLength = function() {
1011
- return this.data.length;
1012
- }, t.prototype.getBitsLength = function() {
1013
- return t.getBitsLength(this.data.length);
1014
- }, t.prototype.write = function(r) {
1015
- let n, o, a;
1016
- for (n = 0; n + 3 <= this.data.length; n += 3)
1017
- o = this.data.substr(n, 3), a = parseInt(o, 10), r.put(a, 10);
1018
- const c = this.data.length - n;
1019
- c > 0 && (o = this.data.substr(n), a = parseInt(o, 10), r.put(a, c * 3 + 1));
1020
- }, Me = t, Me;
1021
- }
1022
- var Re, it;
1023
- function Ln() {
1024
- if (it) return Re;
1025
- it = 1;
1026
- const e = H(), t = [
1027
- "0",
1028
- "1",
1029
- "2",
1030
- "3",
1031
- "4",
1032
- "5",
1033
- "6",
1034
- "7",
1035
- "8",
1036
- "9",
1037
- "A",
1038
- "B",
1039
- "C",
1040
- "D",
1041
- "E",
1042
- "F",
1043
- "G",
1044
- "H",
1045
- "I",
1046
- "J",
1047
- "K",
1048
- "L",
1049
- "M",
1050
- "N",
1051
- "O",
1052
- "P",
1053
- "Q",
1054
- "R",
1055
- "S",
1056
- "T",
1057
- "U",
1058
- "V",
1059
- "W",
1060
- "X",
1061
- "Y",
1062
- "Z",
1063
- " ",
1064
- "$",
1065
- "%",
1066
- "*",
1067
- "+",
1068
- "-",
1069
- ".",
1070
- "/",
1071
- ":"
1072
- ];
1073
- function i(r) {
1074
- this.mode = e.ALPHANUMERIC, this.data = r;
1075
- }
1076
- return i.getBitsLength = function(n) {
1077
- return 11 * Math.floor(n / 2) + 6 * (n % 2);
1078
- }, i.prototype.getLength = function() {
1079
- return this.data.length;
1080
- }, i.prototype.getBitsLength = function() {
1081
- return i.getBitsLength(this.data.length);
1082
- }, i.prototype.write = function(n) {
1083
- let o;
1084
- for (o = 0; o + 2 <= this.data.length; o += 2) {
1085
- let a = t.indexOf(this.data[o]) * 45;
1086
- a += t.indexOf(this.data[o + 1]), n.put(a, 11);
1087
- }
1088
- this.data.length % 2 && n.put(t.indexOf(this.data[o]), 6);
1089
- }, Re = i, Re;
1090
- }
1091
- var Se, st;
1092
- function Dn() {
1093
- if (st) return Se;
1094
- st = 1;
1095
- const e = H();
1096
- function t(i) {
1097
- this.mode = e.BYTE, typeof i == "string" ? this.data = new TextEncoder().encode(i) : this.data = new Uint8Array(i);
1098
- }
1099
- return t.getBitsLength = function(r) {
1100
- return r * 8;
1101
- }, t.prototype.getLength = function() {
1102
- return this.data.length;
1103
- }, t.prototype.getBitsLength = function() {
1104
- return t.getBitsLength(this.data.length);
1105
- }, t.prototype.write = function(i) {
1106
- for (let r = 0, n = this.data.length; r < n; r++)
1107
- i.put(this.data[r], 8);
1108
- }, Se = t, Se;
1604
+ function et(e) {
1605
+ let t = $e(e);
1606
+ if (!t) throw Error(`Invalid color format: ${e}`);
1607
+ return {
1608
+ 50: V(t.h, t.s, 95),
1609
+ 200: V(t.h, t.s, 80),
1610
+ 300: V(t.h, t.s, 65),
1611
+ 400: V(t.h, t.s, Math.min(100, t.l + 10)),
1612
+ 500: e,
1613
+ 600: V(t.h, t.s, Math.max(0, t.l - 10)),
1614
+ 900: V(t.h, t.s, 20)
1615
+ };
1109
1616
  }
1110
- var be, at;
1111
- function Fn() {
1112
- if (at) return be;
1113
- at = 1;
1114
- const e = H(), t = z();
1115
- function i(r) {
1116
- this.mode = e.KANJI, this.data = r;
1117
- }
1118
- return i.getBitsLength = function(n) {
1119
- return n * 13;
1120
- }, i.prototype.getLength = function() {
1121
- return this.data.length;
1122
- }, i.prototype.getBitsLength = function() {
1123
- return i.getBitsLength(this.data.length);
1124
- }, i.prototype.write = function(r) {
1125
- let n;
1126
- for (n = 0; n < this.data.length; n++) {
1127
- let o = t.toSJIS(this.data[n]);
1128
- if (o >= 33088 && o <= 40956)
1129
- o -= 33088;
1130
- else if (o >= 57408 && o <= 60351)
1131
- o -= 49472;
1132
- else
1133
- throw new Error(
1134
- "Invalid SJIS character: " + this.data[n] + `
1135
- Make sure your charset is UTF-8`
1136
- );
1137
- o = (o >>> 8 & 255) * 192 + (o & 255), r.put(o, 13);
1138
- }
1139
- }, be = i, be;
1140
- }
1141
- var Ae = { exports: {} }, ct;
1142
- function Un() {
1143
- return ct || (ct = 1, (function(e) {
1144
- var t = {
1145
- single_source_shortest_paths: function(i, r, n) {
1146
- var o = {}, a = {};
1147
- a[r] = 0;
1148
- var c = t.PriorityQueue.make();
1149
- c.push(r, 0);
1150
- for (var s, u, h, g, d, f, M, E, P; !c.empty(); ) {
1151
- s = c.pop(), u = s.value, g = s.cost, d = i[u] || {};
1152
- for (h in d)
1153
- d.hasOwnProperty(h) && (f = d[h], M = g + f, E = a[h], P = typeof a[h] > "u", (P || E > M) && (a[h] = M, c.push(h, M), o[h] = u));
1154
- }
1155
- if (typeof n < "u" && typeof a[n] > "u") {
1156
- var A = ["Could not find a path from ", r, " to ", n, "."].join("");
1157
- throw new Error(A);
1158
- }
1159
- return o;
1160
- },
1161
- extract_shortest_path_from_predecessor_list: function(i, r) {
1162
- for (var n = [], o = r; o; )
1163
- n.push(o), i[o], o = i[o];
1164
- return n.reverse(), n;
1165
- },
1166
- find_path: function(i, r, n) {
1167
- var o = t.single_source_shortest_paths(i, r, n);
1168
- return t.extract_shortest_path_from_predecessor_list(
1169
- o,
1170
- n
1171
- );
1172
- },
1173
- /**
1174
- * A very naive priority queue implementation.
1175
- */
1176
- PriorityQueue: {
1177
- make: function(i) {
1178
- var r = t.PriorityQueue, n = {}, o;
1179
- i = i || {};
1180
- for (o in r)
1181
- r.hasOwnProperty(o) && (n[o] = r[o]);
1182
- return n.queue = [], n.sorter = i.sorter || r.default_sorter, n;
1183
- },
1184
- default_sorter: function(i, r) {
1185
- return i.cost - r.cost;
1186
- },
1187
- /**
1188
- * Add a new item to the queue and ensure the highest priority element
1189
- * is at the front of the queue.
1190
- */
1191
- push: function(i, r) {
1192
- var n = { value: i, cost: r };
1193
- this.queue.push(n), this.queue.sort(this.sorter);
1194
- },
1195
- /**
1196
- * Return the highest priority element in the queue.
1197
- */
1198
- pop: function() {
1199
- return this.queue.shift();
1200
- },
1201
- empty: function() {
1202
- return this.queue.length === 0;
1203
- }
1204
- }
1205
- };
1206
- e.exports = t;
1207
- })(Ae)), Ae.exports;
1208
- }
1209
- var lt;
1210
- function kn() {
1211
- return lt || (lt = 1, (function(e) {
1212
- const t = H(), i = Pn(), r = Ln(), n = Dn(), o = Fn(), a = At(), c = z(), s = Un();
1213
- function u(A) {
1214
- return unescape(encodeURIComponent(A)).length;
1215
- }
1216
- function h(A, I, m) {
1217
- const p = [];
1218
- let B;
1219
- for (; (B = A.exec(m)) !== null; )
1220
- p.push({
1221
- data: B[0],
1222
- index: B.index,
1223
- mode: I,
1224
- length: B[0].length
1225
- });
1226
- return p;
1227
- }
1228
- function g(A) {
1229
- const I = h(a.NUMERIC, t.NUMERIC, A), m = h(a.ALPHANUMERIC, t.ALPHANUMERIC, A);
1230
- let p, B;
1231
- return c.isKanjiModeEnabled() ? (p = h(a.BYTE, t.BYTE, A), B = h(a.KANJI, t.KANJI, A)) : (p = h(a.BYTE_KANJI, t.BYTE, A), B = []), I.concat(m, p, B).sort(function(S, R) {
1232
- return S.index - R.index;
1233
- }).map(function(S) {
1234
- return {
1235
- data: S.data,
1236
- mode: S.mode,
1237
- length: S.length
1238
- };
1239
- });
1240
- }
1241
- function d(A, I) {
1242
- switch (I) {
1243
- case t.NUMERIC:
1244
- return i.getBitsLength(A);
1245
- case t.ALPHANUMERIC:
1246
- return r.getBitsLength(A);
1247
- case t.KANJI:
1248
- return o.getBitsLength(A);
1249
- case t.BYTE:
1250
- return n.getBitsLength(A);
1251
- }
1252
- }
1253
- function f(A) {
1254
- return A.reduce(function(I, m) {
1255
- const p = I.length - 1 >= 0 ? I[I.length - 1] : null;
1256
- return p && p.mode === m.mode ? (I[I.length - 1].data += m.data, I) : (I.push(m), I);
1257
- }, []);
1258
- }
1259
- function M(A) {
1260
- const I = [];
1261
- for (let m = 0; m < A.length; m++) {
1262
- const p = A[m];
1263
- switch (p.mode) {
1264
- case t.NUMERIC:
1265
- I.push([
1266
- p,
1267
- { data: p.data, mode: t.ALPHANUMERIC, length: p.length },
1268
- { data: p.data, mode: t.BYTE, length: p.length }
1269
- ]);
1270
- break;
1271
- case t.ALPHANUMERIC:
1272
- I.push([
1273
- p,
1274
- { data: p.data, mode: t.BYTE, length: p.length }
1275
- ]);
1276
- break;
1277
- case t.KANJI:
1278
- I.push([
1279
- p,
1280
- { data: p.data, mode: t.BYTE, length: u(p.data) }
1281
- ]);
1282
- break;
1283
- case t.BYTE:
1284
- I.push([
1285
- { data: p.data, mode: t.BYTE, length: u(p.data) }
1286
- ]);
1287
- }
1288
- }
1289
- return I;
1290
- }
1291
- function E(A, I) {
1292
- const m = {}, p = { start: {} };
1293
- let B = ["start"];
1294
- for (let C = 0; C < A.length; C++) {
1295
- const S = A[C], R = [];
1296
- for (let w = 0; w < S.length; w++) {
1297
- const N = S[w], y = "" + C + w;
1298
- R.push(y), m[y] = { node: N, lastCount: 0 }, p[y] = {};
1299
- for (let b = 0; b < B.length; b++) {
1300
- const T = B[b];
1301
- m[T] && m[T].node.mode === N.mode ? (p[T][y] = d(m[T].lastCount + N.length, N.mode) - d(m[T].lastCount, N.mode), m[T].lastCount += N.length) : (m[T] && (m[T].lastCount = N.length), p[T][y] = d(N.length, N.mode) + 4 + t.getCharCountIndicator(N.mode, I));
1302
- }
1303
- }
1304
- B = R;
1305
- }
1306
- for (let C = 0; C < B.length; C++)
1307
- p[B[C]].end = 0;
1308
- return { map: p, table: m };
1309
- }
1310
- function P(A, I) {
1311
- let m;
1312
- const p = t.getBestModeForData(A);
1313
- if (m = t.from(I, p), m !== t.BYTE && m.bit < p.bit)
1314
- throw new Error('"' + A + '" cannot be encoded with mode ' + t.toString(m) + `.
1315
- Suggested mode is: ` + t.toString(p));
1316
- switch (m === t.KANJI && !c.isKanjiModeEnabled() && (m = t.BYTE), m) {
1317
- case t.NUMERIC:
1318
- return new i(A);
1319
- case t.ALPHANUMERIC:
1320
- return new r(A);
1321
- case t.KANJI:
1322
- return new o(A);
1323
- case t.BYTE:
1324
- return new n(A);
1325
- }
1326
- }
1327
- e.fromArray = function(I) {
1328
- return I.reduce(function(m, p) {
1329
- return typeof p == "string" ? m.push(P(p, null)) : p.data && m.push(P(p.data, p.mode)), m;
1330
- }, []);
1331
- }, e.fromString = function(I, m) {
1332
- const p = g(I, c.isKanjiModeEnabled()), B = M(p), C = E(B, m), S = s.find_path(C.map, "start", "end"), R = [];
1333
- for (let w = 1; w < S.length - 1; w++)
1334
- R.push(C.table[S[w]].node);
1335
- return e.fromArray(f(R));
1336
- }, e.rawSplit = function(I) {
1337
- return e.fromArray(
1338
- g(I, c.isKanjiModeEnabled())
1339
- );
1340
- };
1341
- })(Te)), Te;
1342
- }
1343
- var ut;
1344
- function _n() {
1345
- if (ut) return le;
1346
- ut = 1;
1347
- const e = z(), t = Ue(), i = yn(), r = Tn(), n = Mn(), o = Rn(), a = Sn(), c = St(), s = Nn(), u = vn(), h = Bn(), g = H(), d = kn();
1348
- function f(C, S) {
1349
- const R = C.size, w = o.getPositions(S);
1350
- for (let N = 0; N < w.length; N++) {
1351
- const y = w[N][0], b = w[N][1];
1352
- for (let T = -1; T <= 7; T++)
1353
- if (!(y + T <= -1 || R <= y + T))
1354
- for (let v = -1; v <= 7; v++)
1355
- b + v <= -1 || R <= b + v || (T >= 0 && T <= 6 && (v === 0 || v === 6) || v >= 0 && v <= 6 && (T === 0 || T === 6) || T >= 2 && T <= 4 && v >= 2 && v <= 4 ? C.set(y + T, b + v, !0, !0) : C.set(y + T, b + v, !1, !0));
1356
- }
1357
- }
1358
- function M(C) {
1359
- const S = C.size;
1360
- for (let R = 8; R < S - 8; R++) {
1361
- const w = R % 2 === 0;
1362
- C.set(R, 6, w, !0), C.set(6, R, w, !0);
1363
- }
1364
- }
1365
- function E(C, S) {
1366
- const R = n.getPositions(S);
1367
- for (let w = 0; w < R.length; w++) {
1368
- const N = R[w][0], y = R[w][1];
1369
- for (let b = -2; b <= 2; b++)
1370
- for (let T = -2; T <= 2; T++)
1371
- b === -2 || b === 2 || T === -2 || T === 2 || b === 0 && T === 0 ? C.set(N + b, y + T, !0, !0) : C.set(N + b, y + T, !1, !0);
1372
- }
1373
- }
1374
- function P(C, S) {
1375
- const R = C.size, w = u.getEncodedBits(S);
1376
- let N, y, b;
1377
- for (let T = 0; T < 18; T++)
1378
- N = Math.floor(T / 3), y = T % 3 + R - 8 - 3, b = (w >> T & 1) === 1, C.set(N, y, b, !0), C.set(y, N, b, !0);
1379
- }
1380
- function A(C, S, R) {
1381
- const w = C.size, N = h.getEncodedBits(S, R);
1382
- let y, b;
1383
- for (y = 0; y < 15; y++)
1384
- b = (N >> y & 1) === 1, y < 6 ? C.set(y, 8, b, !0) : y < 8 ? C.set(y + 1, 8, b, !0) : C.set(w - 15 + y, 8, b, !0), y < 8 ? C.set(8, w - y - 1, b, !0) : y < 9 ? C.set(8, 15 - y - 1 + 1, b, !0) : C.set(8, 15 - y - 1, b, !0);
1385
- C.set(w - 8, 8, 1, !0);
1386
- }
1387
- function I(C, S) {
1388
- const R = C.size;
1389
- let w = -1, N = R - 1, y = 7, b = 0;
1390
- for (let T = R - 1; T > 0; T -= 2)
1391
- for (T === 6 && T--; ; ) {
1392
- for (let v = 0; v < 2; v++)
1393
- if (!C.isReserved(N, T - v)) {
1394
- let O = !1;
1395
- b < S.length && (O = (S[b] >>> y & 1) === 1), C.set(N, T - v, O), y--, y === -1 && (b++, y = 7);
1396
- }
1397
- if (N += w, N < 0 || R <= N) {
1398
- N -= w, w = -w;
1399
- break;
1400
- }
1401
- }
1402
- }
1403
- function m(C, S, R) {
1404
- const w = new i();
1405
- R.forEach(function(v) {
1406
- w.put(v.mode.bit, 4), w.put(v.getLength(), g.getCharCountIndicator(v.mode, C)), v.write(w);
1407
- });
1408
- const N = e.getSymbolTotalCodewords(C), y = c.getTotalCodewordsCount(C, S), b = (N - y) * 8;
1409
- for (w.getLengthInBits() + 4 <= b && w.put(0, 4); w.getLengthInBits() % 8 !== 0; )
1410
- w.putBit(0);
1411
- const T = (b - w.getLengthInBits()) / 8;
1412
- for (let v = 0; v < T; v++)
1413
- w.put(v % 2 ? 17 : 236, 8);
1414
- return p(w, C, S);
1415
- }
1416
- function p(C, S, R) {
1417
- const w = e.getSymbolTotalCodewords(S), N = c.getTotalCodewordsCount(S, R), y = w - N, b = c.getBlocksCount(S, R), T = w % b, v = b - T, O = Math.floor(w / b), Q = Math.floor(y / b), Ft = Q + 1, _e = O - Q, Ut = new s(_e);
1418
- let re = 0;
1419
- const $ = new Array(b), Oe = new Array(b);
1420
- let oe = 0;
1421
- const kt = new Uint8Array(C.buffer);
1422
- for (let K = 0; K < b; K++) {
1423
- const se = K < v ? Q : Ft;
1424
- $[K] = kt.slice(re, re + se), Oe[K] = Ut.encode($[K]), re += se, oe = Math.max(oe, se);
1425
- }
1426
- const ie = new Uint8Array(w);
1427
- let qe = 0, U, k;
1428
- for (U = 0; U < oe; U++)
1429
- for (k = 0; k < b; k++)
1430
- U < $[k].length && (ie[qe++] = $[k][U]);
1431
- for (U = 0; U < _e; U++)
1432
- for (k = 0; k < b; k++)
1433
- ie[qe++] = Oe[k][U];
1434
- return ie;
1435
- }
1436
- function B(C, S, R, w) {
1437
- let N;
1438
- if (Array.isArray(C))
1439
- N = d.fromArray(C);
1440
- else if (typeof C == "string") {
1441
- let O = S;
1442
- if (!O) {
1443
- const Q = d.rawSplit(C);
1444
- O = u.getBestVersionForData(Q, R);
1445
- }
1446
- N = d.fromString(C, O || 40);
1447
- } else
1448
- throw new Error("Invalid data");
1449
- const y = u.getBestVersionForData(N, R);
1450
- if (!y)
1451
- throw new Error("The amount of data is too big to be stored in a QR Code");
1452
- if (!S)
1453
- S = y;
1454
- else if (S < y)
1455
- throw new Error(
1456
- `
1457
- The chosen QR Code version cannot contain this amount of data.
1458
- Minimum version required to store current data is: ` + y + `.
1459
- `
1460
- );
1461
- const b = m(S, R, N), T = e.getSymbolSize(S), v = new r(T);
1462
- return f(v, S), M(v), E(v, S), A(v, R, 0), S >= 7 && P(v, S), I(v, b), isNaN(w) && (w = a.getBestMask(
1463
- v,
1464
- A.bind(null, v, R)
1465
- )), a.applyMask(w, v), A(v, R, w), {
1466
- modules: v,
1467
- version: S,
1468
- errorCorrectionLevel: R,
1469
- maskPattern: w,
1470
- segments: N
1471
- };
1472
- }
1473
- return le.create = function(S, R) {
1474
- if (typeof S > "u" || S === "")
1475
- throw new Error("No input text");
1476
- let w = t.M, N, y;
1477
- return typeof R < "u" && (w = t.from(R.errorCorrectionLevel, t.M), N = u.from(R.version), y = a.from(R.maskPattern), R.toSJISFunc && e.setToSJISFunction(R.toSJISFunc)), B(S, N, w, y);
1478
- }, le;
1479
- }
1480
- var Ne = {}, ve = {}, dt;
1481
- function Nt() {
1482
- return dt || (dt = 1, (function(e) {
1483
- function t(i) {
1484
- if (typeof i == "number" && (i = i.toString()), typeof i != "string")
1485
- throw new Error("Color should be defined as hex string");
1486
- let r = i.slice().replace("#", "").split("");
1487
- if (r.length < 3 || r.length === 5 || r.length > 8)
1488
- throw new Error("Invalid hex color: " + i);
1489
- (r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(o) {
1490
- return [o, o];
1491
- }))), r.length === 6 && r.push("F", "F");
1492
- const n = parseInt(r.join(""), 16);
1493
- return {
1494
- r: n >> 24 & 255,
1495
- g: n >> 16 & 255,
1496
- b: n >> 8 & 255,
1497
- a: n & 255,
1498
- hex: "#" + r.slice(0, 6).join("")
1499
- };
1500
- }
1501
- e.getOptions = function(r) {
1502
- r || (r = {}), r.color || (r.color = {});
1503
- const n = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, o = r.width && r.width >= 21 ? r.width : void 0, a = r.scale || 4;
1504
- return {
1505
- width: o,
1506
- scale: o ? 4 : a,
1507
- margin: n,
1508
- color: {
1509
- dark: t(r.color.dark || "#000000ff"),
1510
- light: t(r.color.light || "#ffffffff")
1511
- },
1512
- type: r.type,
1513
- rendererOpts: r.rendererOpts || {}
1514
- };
1515
- }, e.getScale = function(r, n) {
1516
- return n.width && n.width >= r + n.margin * 2 ? n.width / (r + n.margin * 2) : n.scale;
1517
- }, e.getImageWidth = function(r, n) {
1518
- const o = e.getScale(r, n);
1519
- return Math.floor((r + n.margin * 2) * o);
1520
- }, e.qrToImageData = function(r, n, o) {
1521
- const a = n.modules.size, c = n.modules.data, s = e.getScale(a, o), u = Math.floor((a + o.margin * 2) * s), h = o.margin * s, g = [o.color.light, o.color.dark];
1522
- for (let d = 0; d < u; d++)
1523
- for (let f = 0; f < u; f++) {
1524
- let M = (d * u + f) * 4, E = o.color.light;
1525
- if (d >= h && f >= h && d < u - h && f < u - h) {
1526
- const P = Math.floor((d - h) / s), A = Math.floor((f - h) / s);
1527
- E = g[c[P * a + A] ? 1 : 0];
1528
- }
1529
- r[M++] = E.r, r[M++] = E.g, r[M++] = E.b, r[M] = E.a;
1530
- }
1531
- };
1532
- })(ve)), ve;
1533
- }
1534
- var ft;
1535
- function On() {
1536
- return ft || (ft = 1, (function(e) {
1537
- const t = Nt();
1538
- function i(n, o, a) {
1539
- n.clearRect(0, 0, o.width, o.height), o.style || (o.style = {}), o.height = a, o.width = a, o.style.height = a + "px", o.style.width = a + "px";
1540
- }
1541
- function r() {
1542
- try {
1543
- return document.createElement("canvas");
1544
- } catch {
1545
- throw new Error("You need to specify a canvas element");
1546
- }
1547
- }
1548
- e.render = function(o, a, c) {
1549
- let s = c, u = a;
1550
- typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), a || (u = r()), s = t.getOptions(s);
1551
- const h = t.getImageWidth(o.modules.size, s), g = u.getContext("2d"), d = g.createImageData(h, h);
1552
- return t.qrToImageData(d.data, o, s), i(g, u, h), g.putImageData(d, 0, 0), u;
1553
- }, e.renderToDataURL = function(o, a, c) {
1554
- let s = c;
1555
- typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), s || (s = {});
1556
- const u = e.render(o, a, s), h = s.type || "image/png", g = s.rendererOpts || {};
1557
- return u.toDataURL(h, g.quality);
1558
- };
1559
- })(Ne)), Ne;
1560
- }
1561
- var Be = {}, ht;
1562
- function qn() {
1563
- if (ht) return Be;
1564
- ht = 1;
1565
- const e = Nt();
1566
- function t(n, o) {
1567
- const a = n.a / 255, c = o + '="' + n.hex + '"';
1568
- return a < 1 ? c + " " + o + '-opacity="' + a.toFixed(2).slice(1) + '"' : c;
1569
- }
1570
- function i(n, o, a) {
1571
- let c = n + o;
1572
- return typeof a < "u" && (c += " " + a), c;
1573
- }
1574
- function r(n, o, a) {
1575
- let c = "", s = 0, u = !1, h = 0;
1576
- for (let g = 0; g < n.length; g++) {
1577
- const d = Math.floor(g % o), f = Math.floor(g / o);
1578
- !d && !u && (u = !0), n[g] ? (h++, g > 0 && d > 0 && n[g - 1] || (c += u ? i("M", d + a, 0.5 + f + a) : i("m", s, 0), s = 0, u = !1), d + 1 < o && n[g + 1] || (c += i("h", h), h = 0)) : s++;
1579
- }
1580
- return c;
1581
- }
1582
- return Be.render = function(o, a, c) {
1583
- const s = e.getOptions(a), u = o.modules.size, h = o.modules.data, g = u + s.margin * 2, d = s.color.light.a ? "<path " + t(s.color.light, "fill") + ' d="M0 0h' + g + "v" + g + 'H0z"/>' : "", f = "<path " + t(s.color.dark, "stroke") + ' d="' + r(h, u, s.margin) + '"/>', M = 'viewBox="0 0 ' + g + " " + g + '"', P = '<svg xmlns="http://www.w3.org/2000/svg" ' + (s.width ? 'width="' + s.width + '" height="' + s.width + '" ' : "") + M + ' shape-rendering="crispEdges">' + d + f + `</svg>
1584
- `;
1585
- return typeof c == "function" && c(null, P), P;
1586
- }, Be;
1587
- }
1588
- var gt;
1589
- function Vn() {
1590
- if (gt) return Y;
1591
- gt = 1;
1592
- const e = En(), t = _n(), i = On(), r = qn();
1593
- function n(o, a, c, s, u) {
1594
- const h = [].slice.call(arguments, 1), g = h.length, d = typeof h[g - 1] == "function";
1595
- if (!d && !e())
1596
- throw new Error("Callback required as last argument");
1597
- if (d) {
1598
- if (g < 2)
1599
- throw new Error("Too few arguments provided");
1600
- g === 2 ? (u = c, c = a, a = s = void 0) : g === 3 && (a.getContext && typeof u > "u" ? (u = s, s = void 0) : (u = s, s = c, c = a, a = void 0));
1601
- } else {
1602
- if (g < 1)
1603
- throw new Error("Too few arguments provided");
1604
- return g === 1 ? (c = a, a = s = void 0) : g === 2 && !a.getContext && (s = c, c = a, a = void 0), new Promise(function(f, M) {
1605
- try {
1606
- const E = t.create(c, s);
1607
- f(o(E, a, s));
1608
- } catch (E) {
1609
- M(E);
1610
- }
1611
- });
1612
- }
1613
- try {
1614
- const f = t.create(c, s);
1615
- u(null, o(f, a, s));
1616
- } catch (f) {
1617
- u(f);
1618
- }
1619
- }
1620
- return Y.create = t.create, Y.toCanvas = n.bind(null, i.render), Y.toDataURL = n.bind(null, i.renderToDataURL), Y.toString = n.bind(null, function(o, a, c) {
1621
- return r.render(o, c);
1622
- }), Y;
1623
- }
1624
- var zn = Vn();
1625
- const Hn = ({
1626
- value: e,
1627
- size: t = 150,
1628
- bgColor: i = "#ffffff",
1629
- fgColor: r = "#000000"
1630
- }) => {
1631
- const [n, o] = _("");
1632
- return L(() => {
1633
- e && zn.toString(e, {
1634
- type: "svg",
1635
- width: t,
1636
- margin: 0,
1637
- color: {
1638
- dark: r,
1639
- light: i
1640
- }
1641
- }).then(o).catch(() => o(""));
1642
- }, [e, t, i, r]), n ? /* @__PURE__ */ l(
1643
- "div",
1644
- {
1645
- class: "IncodeRedirectQrCode",
1646
- dangerouslySetInnerHTML: { __html: n }
1647
- }
1648
- ) : null;
1649
- }, Kn = ({ redirectUrl: e }) => {
1650
- const { t } = F();
1651
- return /* @__PURE__ */ l(ne, { children: [
1652
- /* @__PURE__ */ l("p", { class: "IncodeRedirectTabDescription", children: t("v2.redirectToMobile.qr.description") }),
1653
- /* @__PURE__ */ l("div", { class: "IncodeRedirectQrWrapper", children: /* @__PURE__ */ l(Hn, { value: e, size: 186 }) })
1654
- ] });
1655
- }, Gn = ({
1656
- formattedPhone: e,
1657
- onResend: t,
1658
- onChangePhone: i
1659
- }) => {
1660
- const { t: r } = F();
1661
- return /* @__PURE__ */ l("div", { class: "IncodeRedirectLinkSent", children: [
1662
- /* @__PURE__ */ l(Mt, { size: 32 }),
1663
- /* @__PURE__ */ l(X, { size: 16 }),
1664
- /* @__PURE__ */ l("h2", { class: "IncodeRedirectLinkSentTitle", children: r("redirect.linkSent") }),
1665
- /* @__PURE__ */ l(X, { size: 12 }),
1666
- /* @__PURE__ */ l("p", { class: "IncodeRedirectLinkSentPhone", children: r("redirect.linkSentTo", { phone: e }) }),
1667
- /* @__PURE__ */ l(X, { size: 32 }),
1668
- /* @__PURE__ */ l("div", { class: "IncodeRedirectLinkSentActions", children: /* @__PURE__ */ l(
1669
- Wt,
1670
- {
1671
- i18nKey: "redirect.didntReceiveLinkActions",
1672
- defaultValue: "Didn't receive the link? <resend>Resend</resend> or <changePhone>Change phone number</changePhone>",
1673
- components: {
1674
- resend: /* @__PURE__ */ l(Z, { variant: "link", onClick: t }),
1675
- changePhone: /* @__PURE__ */ l(Z, { variant: "link", onClick: i })
1676
- }
1677
- }
1678
- ) })
1679
- ] });
1680
- }, Yn = zt(
1681
- () => import("../phoneInput-CGr8TxOO.js").then((e) => ({ default: e.PhoneInput }))
1682
- ), jn = ({
1683
- countryCode: e,
1684
- phonePrefix: t,
1685
- error: i,
1686
- isSending: r,
1687
- isPhoneValid: n,
1688
- onPhoneChange: o,
1689
- onSendSms: a
1690
- }) => {
1691
- const { t: c } = F();
1692
- return /* @__PURE__ */ l(ne, { children: [
1693
- /* @__PURE__ */ l(Ht, { fallback: /* @__PURE__ */ l(J, {}), children: /* @__PURE__ */ l(
1694
- Yn,
1695
- {
1696
- countryCode: e,
1697
- phonePrefix: t,
1698
- phoneError: i,
1699
- disabled: r,
1700
- autoFocus: !0,
1701
- onPhoneChange: o
1702
- }
1703
- ) }),
1704
- /* @__PURE__ */ l(
1705
- Z,
1706
- {
1707
- onClick: a,
1708
- disabled: !n || r,
1709
- isLoading: r,
1710
- class: "IncodeRedirectSmsSendButton",
1711
- children: c("redirect.sendLinkViaSms")
1712
- }
1713
- )
1714
- ] });
1715
- }, xn = (e, t) => {
1716
- if (!e.startsWith(t)) return e;
1717
- const i = e.slice(t.length);
1718
- return `${t} ${i.replace(/(\d{3})(?=\d)/g, "$1 ")}`;
1719
- }, Jn = ({
1720
- phonePrefix: e,
1721
- smsSent: t,
1722
- error: i,
1723
- manager: r,
1724
- onResend: n
1725
- }) => {
1726
- const { t: o } = F(), [a, c] = _(e), [s, u] = _(!1), [h, g] = _(!1), d = Qt(e)?.code ?? "", f = xn(a, e), M = x((I, m) => {
1727
- c(I), u(m);
1728
- }, []), E = x(() => {
1729
- g(!0), r.sendSms(a), g(!1);
1730
- }, [r, a]), P = x(() => {
1731
- E(), n();
1732
- }, [E, n]), A = x(() => {
1733
- c(e), u(!1), r.resetSms();
1734
- }, [r, e]);
1735
- return /* @__PURE__ */ l(ne, { children: [
1736
- /* @__PURE__ */ l("p", { class: "IncodeRedirectTabDescription", children: o("v2.redirectToMobile.sms.description") }),
1737
- t ? /* @__PURE__ */ l(
1738
- Gn,
1739
- {
1740
- formattedPhone: f,
1741
- onResend: P,
1742
- onChangePhone: A
1743
- }
1744
- ) : /* @__PURE__ */ l(
1745
- jn,
1746
- {
1747
- countryCode: d,
1748
- phonePrefix: e,
1749
- error: i,
1750
- isSending: h,
1751
- isPhoneValid: s,
1752
- onPhoneChange: M,
1753
- onSendSms: E
1754
- }
1755
- )
1756
- ] });
1757
- }, Qn = ({
1758
- redirectUrl: e,
1759
- phonePrefix: t,
1760
- smsSent: i,
1761
- disableSmsOption: r,
1762
- addContinueToDesktop: n,
1763
- error: o,
1764
- manager: a,
1765
- logoSrc: c
1766
- }) => {
1767
- const { t: s } = F(), [u, h] = _(!1), g = x(() => {
1768
- h(!0), setTimeout(() => h(!1), 3e3);
1769
- }, []), d = x(() => {
1770
- a.continueOnDesktop();
1771
- }, [a]);
1772
- return /* @__PURE__ */ l("div", { class: "IncodeRedirectContainer", children: [
1773
- /* @__PURE__ */ l(In, { visible: u }),
1774
- /* @__PURE__ */ l("div", { class: "IncodeRedirectCard", children: [
1775
- /* @__PURE__ */ l(Cn, { logoSrc: c }),
1776
- /* @__PURE__ */ l("div", { class: "IncodeRedirectOptions", children: /* @__PURE__ */ l(
1777
- G,
1778
- {
1779
- defaultValue: "qr",
1780
- listClassName: "IncodeRedirectTabs",
1781
- triggerClassName: "IncodeRedirectTab",
1782
- activeTriggerClassName: "IncodeRedirectTabActive",
1783
- children: [
1784
- /* @__PURE__ */ l(G.List, { children: [
1785
- /* @__PURE__ */ l(G.Trigger, { value: "qr", children: s("v2.redirectToMobile.tabs.0") }),
1786
- r ? null : /* @__PURE__ */ l(G.Trigger, { value: "sms", children: s("v2.redirectToMobile.tabs.1") })
1787
- ] }),
1788
- /* @__PURE__ */ l(G.Content, { value: "qr", children: /* @__PURE__ */ l(Kn, { redirectUrl: e }) }),
1789
- r ? null : /* @__PURE__ */ l(G.Content, { value: "sms", children: /* @__PURE__ */ l(
1790
- Jn,
1791
- {
1792
- phonePrefix: t,
1793
- smsSent: i,
1794
- error: o,
1795
- manager: a,
1796
- onResend: g
1797
- }
1798
- ) })
1799
- ]
1800
- }
1801
- ) }),
1802
- /* @__PURE__ */ l(
1803
- wn,
1804
- {
1805
- addContinueToDesktop: n,
1806
- onContinueOnDesktop: d
1807
- }
1808
- )
1809
- ] })
1810
- ] });
1811
- }, Wn = ({
1812
- title: e,
1813
- subtitle: t,
1814
- logoSrc: i
1815
- }) => {
1816
- const { t: r } = F(), n = e ?? r("verificationComplete.title"), o = t ?? r("verificationComplete.message");
1817
- return /* @__PURE__ */ l("div", { class: "IncodeRedirectFinishedContainer", children: [
1818
- /* @__PURE__ */ l("img", { src: i, alt: "Logo", class: "IncodeRedirectLogo" }),
1819
- n ? /* @__PURE__ */ l("h1", { class: "IncodeRedirectFinishedTitle", children: n }) : null,
1820
- o ? /* @__PURE__ */ l("p", { class: "IncodeRedirectFinishedSubtitle", children: o }) : null
1821
- ] });
1822
- }, Xn = ({
1823
- config: e,
1824
- onFinish: t,
1825
- onContinue: i,
1826
- onError: r
1827
- }) => {
1828
- const [n, o] = It(
1829
- () => Yt({ config: e })
1830
- ), { logoSrc: a, logoHeightPx: c } = xt({
1831
- hideHeader: void 0,
1832
- hideFooterBranding: void 0,
1833
- logo: void 0,
1834
- defaultLogoSrc: Jt
1835
- });
1836
- L(() => {
1837
- n.status === "finished" && t?.();
1838
- }, [n.status, t]), L(() => {
1839
- n.status === "closed" && i?.();
1840
- }, [n.status, i]), L(() => {
1841
- n.status === "error" && r?.(n.error);
1842
- }, [n.status, r, n]);
1843
- const s = n.status === "idle" || n.status === "loading" ? /* @__PURE__ */ l(J, { fullScreen: !0 }) : n.status === "redirecting" ? /* @__PURE__ */ l(
1844
- Qn,
1845
- {
1846
- redirectUrl: n.redirectUrl,
1847
- phonePrefix: n.phonePrefix,
1848
- smsSent: n.smsSent,
1849
- disableSmsOption: e.disableSmsOption ?? !1,
1850
- addContinueToDesktop: e.addContinueToDesktop ?? !1,
1851
- error: n.error,
1852
- manager: o,
1853
- logoSrc: a
1854
- }
1855
- ) : n.status === "finished" ? /* @__PURE__ */ l(Wn, { logoSrc: a }) : null;
1856
- return /* @__PURE__ */ l(
1857
- "div",
1858
- {
1859
- class: "IncodeRedirectRoot",
1860
- style: { "--logo-height": `${c}px` },
1861
- children: s
1862
- }
1863
- );
1864
- }, vt = ({
1865
- config: e,
1866
- onFinish: t,
1867
- onContinue: i,
1868
- onError: r
1869
- }) => /* @__PURE__ */ l(wt, { children: e ? /* @__PURE__ */ l(
1870
- Xn,
1871
- {
1872
- config: e,
1873
- onFinish: t,
1874
- onContinue: i,
1875
- onError: r
1876
- }
1877
- ) : null });
1878
- Tt(vt, "incode-redirect-to-mobile");
1879
- function Zn(e) {
1880
- let t = e.replace("#", "");
1881
- t.length === 3 && (t = t.split("").map((g) => g + g).join(""));
1882
- const i = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
1883
- if (!i) return null;
1884
- const r = Number.parseInt(i[1], 16) / 255, n = Number.parseInt(i[2], 16) / 255, o = Number.parseInt(i[3], 16) / 255, a = Math.max(r, n, o), c = Math.min(r, n, o);
1885
- let s = 0, u = 0;
1886
- const h = (a + c) / 2;
1887
- if (a !== c) {
1888
- const g = a - c;
1889
- switch (u = h > 0.5 ? g / (2 - a - c) : g / (a + c), a) {
1890
- case r:
1891
- s = ((n - o) / g + (n < o ? 6 : 0)) / 6;
1892
- break;
1893
- case n:
1894
- s = ((o - r) / g + 2) / 6;
1895
- break;
1896
- case o:
1897
- s = ((r - n) / g + 4) / 6;
1898
- break;
1899
- }
1900
- }
1901
- return { h: s * 360, s: u * 100, l: h * 100 };
1902
- }
1903
- function j(e, t, i) {
1904
- const r = e / 360, n = t / 100, o = i / 100;
1905
- let a, c, s;
1906
- if (n === 0)
1907
- a = c = s = o;
1908
- else {
1909
- const h = (f, M, E) => (E < 0 && (E += 1), E > 1 && (E -= 1), E < 0.16666666666666666 ? f + (M - f) * 6 * E : E < 0.5 ? M : E < 0.6666666666666666 ? f + (M - f) * (0.6666666666666666 - E) * 6 : f), g = o < 0.5 ? o * (1 + n) : o + n - o * n, d = 2 * o - g;
1910
- a = h(d, g, r + 1 / 3), c = h(d, g, r), s = h(d, g, r - 1 / 3);
1911
- }
1912
- const u = (h) => {
1913
- const g = Math.round(h * 255).toString(16);
1914
- return g.length === 1 ? `0${g}` : g;
1915
- };
1916
- return `#${u(a)}${u(c)}${u(s)}`;
1917
- }
1918
- function $n(e) {
1919
- const t = Zn(e);
1920
- if (!t)
1921
- throw new Error(`Invalid color format: ${e}`);
1922
- return {
1923
- 50: j(t.h, t.s, 95),
1924
- 200: j(t.h, t.s, 80),
1925
- 300: j(t.h, t.s, 65),
1926
- 400: j(t.h, t.s, Math.min(100, t.l + 10)),
1927
- 500: e,
1928
- 600: j(t.h, t.s, Math.max(0, t.l - 10)),
1929
- 900: j(t.h, t.s, 20)
1930
- };
1931
- }
1932
- function er(e, t) {
1933
- if (typeof document > "u")
1934
- return;
1935
- const i = $n(e);
1936
- let r = document.getElementById(
1937
- "incode-theme"
1938
- );
1939
- r || (r = document.createElement("style"), r.id = "incode-theme", document.head.appendChild(r));
1940
- const n = t || "#ffffff", o = `
1617
+ //#endregion
1618
+ //#region src/styles/applyTheme.ts
1619
+ function tt(e, t) {
1620
+ if (typeof document > "u") return;
1621
+ let n = et(e), r = document.getElementById("incode-theme");
1622
+ r || (r = document.createElement("style"), r.id = "incode-theme", document.head.appendChild(r));
1623
+ let i = t || "#ffffff", a = `
1941
1624
  :root,
1942
1625
  :host {
1943
- --primitive-color-brand-50: ${i[50]};
1944
- --primitive-color-brand-200: ${i[200]};
1945
- --primitive-color-brand-300: ${i[300]};
1946
- --primitive-color-brand-400: ${i[400]};
1947
- --primitive-color-brand-500: ${i[500]};
1948
- --primitive-color-brand-600: ${i[600]};
1949
- --primitive-color-brand-900: ${i[900]};
1950
- --button-primary-text-default: ${n};
1626
+ --primitive-color-brand-50: ${n[50]};
1627
+ --primitive-color-brand-200: ${n[200]};
1628
+ --primitive-color-brand-300: ${n[300]};
1629
+ --primitive-color-brand-400: ${n[400]};
1630
+ --primitive-color-brand-500: ${n[500]};
1631
+ --primitive-color-brand-600: ${n[600]};
1632
+ --primitive-color-brand-900: ${n[900]};
1633
+ --button-primary-text-default: ${i};
1951
1634
  }
1952
1635
  `;
1953
- r.textContent = o;
1636
+ r.textContent = a;
1954
1637
  }
1955
- async function tr() {
1956
- return (await yt.get("/omni/asset/fetch-all")).data;
1638
+ //#endregion
1639
+ //#region src/styles/fetchTheme.ts
1640
+ async function nt() {
1641
+ return (await E.get("/omni/asset/fetch-all")).data;
1957
1642
  }
1958
- const mt = /* @__PURE__ */ new Map();
1959
- async function nr(e) {
1960
- if (e.startsWith("data:"))
1961
- return e;
1962
- const t = mt.get(e);
1963
- if (t)
1964
- return t;
1965
- const r = await (await fetch(e)).blob(), n = await new Promise((o, a) => {
1966
- const c = new FileReader();
1967
- c.onloadend = () => o(c.result), c.onerror = a, c.readAsDataURL(r);
1968
- });
1969
- return mt.set(e, n), n;
1643
+ var H = /* @__PURE__ */ new Map();
1644
+ async function rt(e) {
1645
+ if (e.startsWith("data:")) return e;
1646
+ let t = H.get(e);
1647
+ if (t) return t;
1648
+ let n = await (await fetch(e)).blob(), r = await new Promise((e, t) => {
1649
+ let r = new FileReader();
1650
+ r.onloadend = () => e(r.result), r.onerror = t, r.readAsDataURL(n);
1651
+ });
1652
+ return H.set(e, r), r;
1970
1653
  }
1971
- async function rr() {
1972
- const e = await tr();
1973
- if (!e.theme)
1974
- throw new Error("Theme URL not found in assets response");
1975
- const t = e.theme, i = t.startsWith("http://") || t.startsWith("https://");
1976
- let r;
1977
- if (i) {
1978
- const a = await fetch(t);
1979
- if (!a.ok)
1980
- throw new Error(`Failed to fetch theme: ${a.statusText}`);
1981
- r = await a.json();
1982
- } else
1983
- r = (await yt.get(t)).data;
1984
- const n = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || r.logo;
1985
- let o = n;
1986
- return n && (o = await nr(n)), {
1987
- ...r,
1988
- logo: o
1989
- };
1654
+ async function it() {
1655
+ let e = await nt();
1656
+ if (!e.theme) throw Error("Theme URL not found in assets response");
1657
+ let t = e.theme, n = t.startsWith("http://") || t.startsWith("https://"), r;
1658
+ if (n) {
1659
+ let e = await fetch(t);
1660
+ if (!e.ok) throw Error(`Failed to fetch theme: ${e.statusText}`);
1661
+ r = await e.json();
1662
+ } else r = (await E.get(t)).data;
1663
+ let i = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || r.logo, a = i;
1664
+ return i && (a = await rt(i)), {
1665
+ ...r,
1666
+ logo: a
1667
+ };
1990
1668
  }
1991
- async function or() {
1992
- const e = await rr();
1993
- return e.main && er(e.main, e.buttonColor), e;
1669
+ async function at() {
1670
+ let e = await it();
1671
+ return e.main && tt(e.main, e.buttonColor), e;
1994
1672
  }
1995
- const Pe = () => import("../id/id.es.js").then((e) => e.Id), ke = {
1996
- PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
1997
- EMAIL: () => import("../email/email.es.js").then((e) => e.Email),
1998
- SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie),
1999
- AUTHENTICATION: () => import("../authentication/authentication.es.js").then((e) => e.Authentication),
2000
- ID: Pe,
2001
- TUTORIAL_ID: Pe,
2002
- SECOND_ID: Pe,
2003
- FACE_MATCH: () => import("../faceMatch-DbDp7D3d.js").then((e) => e.FaceMatch),
2004
- CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
2005
- GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then(
2006
- (e) => e.GovernmentValidation
2007
- ),
2008
- GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
2009
- EXTERNAL_VERIFICATION: () => import("../ekycModule-C3mswduI.js").then((e) => e.EkycModule),
2010
- EKYB: () => import("../ekybModule-Dr6LJUg-.js").then((e) => e.EkybModule),
2011
- DOCUMENT_CAPTURE: () => import("../documentCapture-C0mO-RGE.js").then(
2012
- (e) => e.DocumentCapture
2013
- ),
2014
- ADDRESS: () => import("../documentCapture-C0mO-RGE.js").then(
2015
- (e) => e.DocumentCapture
2016
- ),
2017
- COMBINED_CONSENT: () => import("../consent/consent.es.js").then((e) => e.Consent),
2018
- MANDATORY_CONSENT: () => import("../mandatoryConsent-5xPI0cor.js").then(
2019
- (e) => e.MandatoryConsent
2020
- ),
2021
- SIGNATURE: () => import("../signature/signature.es.js").then((e) => e.Signature),
2022
- ANTIFRAUD: () => import("../antifraud/antifraud.es.js").then((e) => e.Antifraud)
1673
+ //#endregion
1674
+ //#region src/modules/flow/flowInit.ts
1675
+ var U = () => import("../id/id.es.js").then((e) => e.Id), W = {
1676
+ PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
1677
+ EMAIL: () => import("../email/email.es.js").then((e) => e.Email),
1678
+ SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie),
1679
+ AUTHENTICATION: () => import("../authentication/authentication.es.js").then((e) => e.Authentication),
1680
+ ID: U,
1681
+ TUTORIAL_ID: U,
1682
+ SECOND_ID: U,
1683
+ FACE_MATCH: () => import("../faceMatch-DH8sLx34.js").then((e) => e.FaceMatch),
1684
+ CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
1685
+ GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then((e) => e.GovernmentValidation),
1686
+ GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
1687
+ EXTERNAL_VERIFICATION: () => import("../ekycModule-hxIcNX8n.js").then((e) => e.EkycModule),
1688
+ EKYB: () => import("../ekybModule-BBOm1y49.js").then((e) => e.EkybModule),
1689
+ DOCUMENT_CAPTURE: () => import("../documentCapture-wDgRLdon.js").then((e) => e.DocumentCapture),
1690
+ ADDRESS: () => import("../documentCapture-wDgRLdon.js").then((e) => e.DocumentCapture),
1691
+ COMBINED_CONSENT: () => import("../consent/consent.es.js").then((e) => e.Consent),
1692
+ MANDATORY_CONSENT: () => import("../mandatoryConsent-LBS8E0rj.js").then((e) => e.MandatoryConsent),
1693
+ SIGNATURE: () => import("../signature/signature.es.js").then((e) => e.Signature),
1694
+ ANTIFRAUD: () => import("../antifraud/antifraud.es.js").then((e) => e.Antifraud)
2023
1695
  };
2024
- function Bt() {
2025
- return Ot({
2026
- modules: {
2027
- PHONE: nn,
2028
- EMAIL: $t,
2029
- SELFIE: rn,
2030
- AUTHENTICATION: on,
2031
- ID: ae,
2032
- TUTORIAL_ID: ae,
2033
- SECOND_ID: ae,
2034
- FACE_MATCH: en,
2035
- CURP_VALIDATION: sn,
2036
- GOVT_VALIDATION_PROVISIONING: an,
2037
- GEOLOCATION: tn,
2038
- EXTERNAL_VERIFICATION: Zt,
2039
- EKYB: Xt,
2040
- DOCUMENT_CAPTURE: Ve,
2041
- ADDRESS: Ve,
2042
- COMBINED_CONSENT: cn,
2043
- MANDATORY_CONSENT: ln,
2044
- SIGNATURE: dn,
2045
- ANTIFRAUD: fn
2046
- }
2047
- });
1696
+ function G() {
1697
+ return ue({ modules: {
1698
+ PHONE: me,
1699
+ EMAIL: le,
1700
+ SELFIE: he,
1701
+ AUTHENTICATION: ie,
1702
+ ID: k,
1703
+ TUTORIAL_ID: k,
1704
+ SECOND_ID: k,
1705
+ FACE_MATCH: fe,
1706
+ CURP_VALIDATION: oe,
1707
+ GOVT_VALIDATION_PROVISIONING: ge,
1708
+ GEOLOCATION: pe,
1709
+ EXTERNAL_VERIFICATION: ce,
1710
+ EKYB: se,
1711
+ DOCUMENT_CAPTURE: O,
1712
+ ADDRESS: O,
1713
+ COMBINED_CONSENT: ae,
1714
+ MANDATORY_CONSENT: _e,
1715
+ SIGNATURE: ve,
1716
+ ANTIFRAUD: re
1717
+ } });
2048
1718
  }
2049
- async function Pt(e) {
2050
- await un({
2051
- apiURL: e.apiURL,
2052
- token: e.token,
2053
- wasm: !1,
2054
- i18n: { lang: e.lang ?? "en" }
2055
- });
1719
+ async function K(e) {
1720
+ await m({
1721
+ apiURL: e.apiURL,
1722
+ token: e.token,
1723
+ wasm: !1,
1724
+ i18n: { lang: e.lang ?? "en" }
1725
+ });
2056
1726
  }
2057
- async function Lt() {
2058
- try {
2059
- const e = await or(), t = {
2060
- logoSrc: e.logo,
2061
- hideFooterBranding: e.hideFooterBranding
2062
- };
2063
- return te(t), { theme: e, uiConfig: t };
2064
- } catch {
2065
- return {};
2066
- }
1727
+ async function q() {
1728
+ try {
1729
+ let e = await at(), t = {
1730
+ logoSrc: e.logo,
1731
+ hideFooterBranding: e.hideFooterBranding
1732
+ };
1733
+ return p(t), {
1734
+ theme: e,
1735
+ uiConfig: t
1736
+ };
1737
+ } catch {
1738
+ return {};
1739
+ }
2067
1740
  }
2068
- function Dt(e, t) {
2069
- const i = Et(e.flow);
2070
- if (i.length > 0) {
2071
- const r = Kt({
2072
- ...t,
2073
- pipelines: i
2074
- });
2075
- Gt(r).catch((n) => {
2076
- console.error("WASM warmup failed:", n);
2077
- });
2078
- }
1741
+ function J(e, t) {
1742
+ let n = D(e.flow);
1743
+ n.length > 0 && ne(te({
1744
+ ...t,
1745
+ pipelines: n
1746
+ })).catch((e) => {
1747
+ console.error("WASM warmup failed:", e);
1748
+ });
2079
1749
  }
2080
- function ir(e) {
2081
- const t = e.currentStep;
2082
- if (t) {
2083
- const i = ke[t];
2084
- i && i().catch(() => {
2085
- });
2086
- }
1750
+ function ot(e) {
1751
+ let t = e.currentStep;
1752
+ if (t) {
1753
+ let e = W[t];
1754
+ e && e().catch(() => {});
1755
+ }
2087
1756
  }
2088
- const sr = ({
2089
- moduleKey: e,
2090
- onNext: t
2091
- }) => /* @__PURE__ */ l("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ l("div", { class: "IncodeUnsupportedModuleContent", children: [
2092
- /* @__PURE__ */ l("h2", { class: "IncodeUnsupportedModuleTitle", children: "Module not available" }),
2093
- /* @__PURE__ */ l("p", { class: "IncodeUnsupportedModuleMessage", children: [
2094
- 'The "',
2095
- e,
2096
- '" module is not yet supported in this version.'
2097
- ] }),
2098
- /* @__PURE__ */ l(
2099
- Z,
2100
- {
2101
- onClick: t,
2102
- class: "IncodeUnsupportedModuleButton",
2103
- "data-testid": "unsupported-module-next-button",
2104
- children: "Next"
2105
- }
2106
- )
2107
- ] }) }), V = /* @__PURE__ */ new Map();
2108
- function pt(e) {
2109
- const t = V.get(e);
2110
- if (!t)
2111
- throw new Error("Preload state not found");
2112
- return {
2113
- get isReady() {
2114
- return t.status === "ready";
2115
- },
2116
- get error() {
2117
- return t.status === "error" ? t.error ?? null : null;
2118
- },
2119
- async waitUntilReady() {
2120
- if (t.status !== "ready") {
2121
- if (t.status === "error")
2122
- throw new Error(t.error ?? "Preload failed");
2123
- return t.readyPromise;
2124
- }
2125
- },
2126
- cancel() {
2127
- t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(new Error("Preload cancelled")), V.delete(e));
2128
- }
2129
- };
1757
+ //#endregion
1758
+ //#region src/modules/flow/unsupportedModule.tsx
1759
+ var st = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ d("section", {
1760
+ class: "IncodeUnsupportedModule",
1761
+ "aria-live": "polite",
1762
+ children: /* @__PURE__ */ d("div", {
1763
+ class: "IncodeUnsupportedModuleContent",
1764
+ children: [
1765
+ /* @__PURE__ */ d("h2", {
1766
+ class: "IncodeUnsupportedModuleTitle",
1767
+ children: "Module not available"
1768
+ }),
1769
+ /* @__PURE__ */ d("p", {
1770
+ class: "IncodeUnsupportedModuleMessage",
1771
+ children: [
1772
+ "The \"",
1773
+ e,
1774
+ "\" module is not yet supported in this version."
1775
+ ]
1776
+ }),
1777
+ /* @__PURE__ */ d(S, {
1778
+ onClick: t,
1779
+ class: "IncodeUnsupportedModuleButton",
1780
+ "data-testid": "unsupported-module-next-button",
1781
+ children: "Next"
1782
+ })
1783
+ ]
1784
+ })
1785
+ }), Y = /* @__PURE__ */ new Map();
1786
+ function X(e) {
1787
+ let t = Y.get(e);
1788
+ if (!t) throw Error("Preload state not found");
1789
+ return {
1790
+ get isReady() {
1791
+ return t.status === "ready";
1792
+ },
1793
+ get error() {
1794
+ return t.status === "error" ? t.error ?? null : null;
1795
+ },
1796
+ async waitUntilReady() {
1797
+ if (t.status !== "ready") {
1798
+ if (t.status === "error") throw Error(t.error ?? "Preload failed");
1799
+ return t.readyPromise;
1800
+ }
1801
+ },
1802
+ cancel() {
1803
+ t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")), Y.delete(e));
1804
+ }
1805
+ };
2130
1806
  }
2131
- function Hr(e) {
2132
- const { token: t } = e;
2133
- if (V.has(t))
2134
- return pt(t);
2135
- let i, r;
2136
- const n = new Promise((s, u) => {
2137
- i = s, r = u;
2138
- }), o = Bt(), a = {
2139
- status: "loading",
2140
- flowManager: o,
2141
- config: e,
2142
- readyPromise: n,
2143
- readyResolve: i,
2144
- readyReject: r
2145
- };
2146
- return V.set(t, a), (async () => {
2147
- try {
2148
- await Pt({
2149
- apiURL: e.apiURL,
2150
- token: e.token,
2151
- lang: e.lang
2152
- });
2153
- const s = e.disableDashboardTheme ? Promise.resolve({}) : Lt().then((h) => {
2154
- a.theme = h.theme, a.uiConfig = h.uiConfig;
2155
- }), u = o.subscribe((h) => {
2156
- if (h.status === "ready") {
2157
- const g = h;
2158
- e.wasmConfig && Dt(g, e.wasmConfig), ir(g), a.unsubscribe?.(), a.unsubscribe = void 0, a.status = "ready", a.readyResolve();
2159
- } else h.status === "error" && (a.unsubscribe?.(), a.unsubscribe = void 0, a.status = "error", a.error = h.error, a.readyReject(new Error(h.error)));
2160
- });
2161
- a.unsubscribe = u, o.load(), await s;
2162
- } catch (s) {
2163
- a.status = "error", a.error = s instanceof Error ? s.message : "Failed to preload", a.readyReject(
2164
- s instanceof Error ? s : new Error("Failed to preload")
2165
- ), V.delete(t);
2166
- }
2167
- })(), pt(t);
1807
+ function ct(e) {
1808
+ let { token: t } = e;
1809
+ if (Y.has(t)) return X(t);
1810
+ let n, r, i = new Promise((e, t) => {
1811
+ n = e, r = t;
1812
+ }), a = G(), o = {
1813
+ status: "loading",
1814
+ flowManager: a,
1815
+ config: e,
1816
+ readyPromise: i,
1817
+ readyResolve: n,
1818
+ readyReject: r
1819
+ };
1820
+ return Y.set(t, o), (async () => {
1821
+ try {
1822
+ await K({
1823
+ apiURL: e.apiURL,
1824
+ token: e.token,
1825
+ lang: e.lang
1826
+ });
1827
+ let t = e.disableDashboardTheme ? Promise.resolve({}) : q().then((e) => {
1828
+ o.theme = e.theme, o.uiConfig = e.uiConfig;
1829
+ });
1830
+ o.unsubscribe = a.subscribe((t) => {
1831
+ if (t.status === "ready") {
1832
+ let n = t;
1833
+ e.wasmConfig && J(n, e.wasmConfig), ot(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
1834
+ } else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
1835
+ }), a.load(), await t;
1836
+ } catch (e) {
1837
+ o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), Y.delete(t);
1838
+ }
1839
+ })(), X(t);
2168
1840
  }
2169
- function De(e) {
2170
- return V.get(e) ?? null;
1841
+ function Z(e) {
1842
+ return Y.get(e) ?? null;
2171
1843
  }
2172
- function Ct(e) {
2173
- const t = De(e);
2174
- return t && V.delete(e), t;
1844
+ function Q(e) {
1845
+ let t = Z(e);
1846
+ return t && Y.delete(e), t;
2175
1847
  }
2176
- function ar(e) {
2177
- const { apiURL: t, token: i, lang: r, disableDashboardTheme: n, onError: o } = e, a = Le(null), [c, s] = _(() => {
2178
- const h = De(i);
2179
- if (h?.status === "ready") {
2180
- const d = Ct(i);
2181
- if (d)
2182
- return a.current = d.flowManager, d.uiConfig && te(d.uiConfig), { status: "ready", flowManager: d.flowManager };
2183
- }
2184
- const g = Bt();
2185
- return a.current = g, h?.status === "error" ? {
2186
- status: "error",
2187
- error: h.error ?? "Preload failed",
2188
- flowManager: g
2189
- } : { status: "initializing", flowManager: g };
2190
- }), u = Le(!1);
2191
- return L(() => {
2192
- if (c.status !== "initializing")
2193
- return;
2194
- const h = De(i);
2195
- if (h?.status === "loading") {
2196
- h.readyPromise.then(() => {
2197
- const d = Ct(i);
2198
- d && (a.current = d.flowManager, d.uiConfig && te(d.uiConfig), s({ status: "ready", flowManager: d.flowManager }));
2199
- }).catch((d) => {
2200
- const f = d instanceof Error ? d.message : "Preload failed";
2201
- s({
2202
- status: "error",
2203
- error: f,
2204
- flowManager: c.flowManager
2205
- }), o?.(f);
2206
- });
2207
- return;
2208
- }
2209
- if (u.current)
2210
- return;
2211
- u.current = !0, (async () => {
2212
- try {
2213
- await Pt({ apiURL: t, token: i, lang: r });
2214
- const d = n ? Promise.resolve() : Lt().then((f) => {
2215
- f.uiConfig && te(f.uiConfig);
2216
- });
2217
- c.flowManager.load(), await d, s({ status: "ready", flowManager: c.flowManager });
2218
- } catch (d) {
2219
- const f = d instanceof Error ? d.message : "Failed to initialize SDK";
2220
- s({
2221
- status: "error",
2222
- error: f,
2223
- flowManager: c.flowManager
2224
- }), o?.(f);
2225
- }
2226
- })();
2227
- }, [t, i, r, n, o, c]), c;
1848
+ //#endregion
1849
+ //#region src/modules/flow/useFlowInitialization.ts
1850
+ function lt(e) {
1851
+ let { apiURL: t, token: n, lang: r, disableDashboardTheme: a, onError: o } = e, s = c(null), [l, d] = u(() => {
1852
+ let e = Z(n);
1853
+ if (e?.status === "ready") {
1854
+ let e = Q(n);
1855
+ if (e) return s.current = e.flowManager, e.uiConfig && p(e.uiConfig), {
1856
+ status: "ready",
1857
+ flowManager: e.flowManager
1858
+ };
1859
+ }
1860
+ let t = G();
1861
+ return s.current = t, e?.status === "error" ? {
1862
+ status: "error",
1863
+ error: e.error ?? "Preload failed",
1864
+ flowManager: t
1865
+ } : {
1866
+ status: "initializing",
1867
+ flowManager: t
1868
+ };
1869
+ }), f = c(!1);
1870
+ return i(() => {
1871
+ if (l.status !== "initializing") return;
1872
+ let e = Z(n);
1873
+ if (e?.status === "loading") {
1874
+ e.readyPromise.then(() => {
1875
+ let e = Q(n);
1876
+ e && (s.current = e.flowManager, e.uiConfig && p(e.uiConfig), d({
1877
+ status: "ready",
1878
+ flowManager: e.flowManager
1879
+ }));
1880
+ }).catch((e) => {
1881
+ let t = e instanceof Error ? e.message : "Preload failed";
1882
+ d({
1883
+ status: "error",
1884
+ error: t,
1885
+ flowManager: l.flowManager
1886
+ }), o?.(t);
1887
+ });
1888
+ return;
1889
+ }
1890
+ f.current || (f.current = !0, (async () => {
1891
+ try {
1892
+ await K({
1893
+ apiURL: t,
1894
+ token: n,
1895
+ lang: r
1896
+ });
1897
+ let e = a ? Promise.resolve() : q().then((e) => {
1898
+ e.uiConfig && p(e.uiConfig);
1899
+ });
1900
+ l.flowManager.load(), await e, d({
1901
+ status: "ready",
1902
+ flowManager: l.flowManager
1903
+ });
1904
+ } catch (e) {
1905
+ let t = e instanceof Error ? e.message : "Failed to initialize SDK";
1906
+ d({
1907
+ status: "error",
1908
+ error: t,
1909
+ flowManager: l.flowManager
1910
+ }), o?.(t);
1911
+ }
1912
+ })());
1913
+ }, [
1914
+ t,
1915
+ n,
1916
+ r,
1917
+ a,
1918
+ o,
1919
+ l
1920
+ ]), l;
2228
1921
  }
2229
- function cr(e) {
2230
- const { moduleKey: t, onModuleLoading: i, onModuleLoaded: r, onError: n } = e, [o, a] = _({ status: "idle" });
2231
- return L(() => {
2232
- if (!t) {
2233
- a({ status: "idle" });
2234
- return;
2235
- }
2236
- const c = ke[t];
2237
- if (!c) {
2238
- a({ status: "unsupported", moduleKey: t });
2239
- return;
2240
- }
2241
- a({ status: "loading", moduleKey: t }), i?.(t);
2242
- let s = !1;
2243
- return c().then((u) => {
2244
- s || (a({ status: "loaded", moduleKey: t, Component: u }), r?.(t));
2245
- }).catch((u) => {
2246
- if (!s) {
2247
- const h = u instanceof Error ? u.message : "Failed to load module";
2248
- a({ status: "error", moduleKey: t, error: h }), n?.(`Failed to load ${t}: ${h}`);
2249
- }
2250
- }), () => {
2251
- s = !0;
2252
- };
2253
- }, [t, i, r, n]), o;
1922
+ //#endregion
1923
+ //#region src/modules/flow/useModuleLoader.ts
1924
+ function ut(e) {
1925
+ let { moduleKey: t, onModuleLoading: n, onModuleLoaded: r, onError: a } = e, [o, s] = u({ status: "idle" });
1926
+ return i(() => {
1927
+ if (!t) {
1928
+ s({ status: "idle" });
1929
+ return;
1930
+ }
1931
+ let e = W[t];
1932
+ if (!e) {
1933
+ s({
1934
+ status: "unsupported",
1935
+ moduleKey: t
1936
+ });
1937
+ return;
1938
+ }
1939
+ s({
1940
+ status: "loading",
1941
+ moduleKey: t
1942
+ }), n?.(t);
1943
+ let i = !1;
1944
+ return e().then((e) => {
1945
+ i || (s({
1946
+ status: "loaded",
1947
+ moduleKey: t,
1948
+ Component: e
1949
+ }), r?.(t));
1950
+ }).catch((e) => {
1951
+ if (!i) {
1952
+ let n = e instanceof Error ? e.message : "Failed to load module";
1953
+ s({
1954
+ status: "error",
1955
+ moduleKey: t,
1956
+ error: n
1957
+ }), a?.(`Failed to load ${t}: ${n}`);
1958
+ }
1959
+ }), () => {
1960
+ i = !0;
1961
+ };
1962
+ }, [
1963
+ t,
1964
+ n,
1965
+ r,
1966
+ a
1967
+ ]), o;
2254
1968
  }
2255
- function lr(e, t) {
2256
- const i = Le(/* @__PURE__ */ new Set());
2257
- L(() => {
2258
- if (t < e.length - 1) {
2259
- const r = e[t + 1];
2260
- if (r && !i.current.has(r)) {
2261
- i.current.add(r);
2262
- const n = ke[r];
2263
- n && n().catch(() => {
2264
- i.current.delete(r);
2265
- });
2266
- }
2267
- }
2268
- }, [e, t]);
1969
+ function dt(e, t) {
1970
+ let n = c(/* @__PURE__ */ new Set());
1971
+ i(() => {
1972
+ if (t < e.length - 1) {
1973
+ let r = e[t + 1];
1974
+ if (r && !n.current.has(r)) {
1975
+ n.current.add(r);
1976
+ let e = W[r];
1977
+ e && e().catch(() => {
1978
+ n.current.delete(r);
1979
+ });
1980
+ }
1981
+ }
1982
+ }, [e, t]);
2269
1983
  }
2270
- const ur = ({
2271
- config: e,
2272
- onFinish: t,
2273
- onError: i
2274
- }) => {
2275
- const { t: r, i18n: n } = F(), [o, a] = _(!1), c = ar({
2276
- apiURL: e.apiURL,
2277
- token: e.token,
2278
- lang: e.lang,
2279
- disableDashboardTheme: e.disableDashboardTheme,
2280
- onError: i
2281
- }), [s, u] = It(() => c.flowManager, {
2282
- autoLoad: !1
2283
- }), h = s?.status === "ready" && s.flow.redirectDesktopToMobile && !o, g = cr({
2284
- moduleKey: s?.status === "ready" && !h ? s.currentStep : void 0,
2285
- onModuleLoading: e.onModuleLoading,
2286
- onModuleLoaded: e.onModuleLoaded,
2287
- onError: i
2288
- });
2289
- if (lr(
2290
- s?.status === "ready" ? s.steps : [],
2291
- s?.status === "ready" ? s.currentStepIndex : -1
2292
- ), L(() => {
2293
- e.lang && n.language !== e.lang && n.changeLanguage(e.lang);
2294
- }, [e.lang, n]), L(() => {
2295
- if (s?.status === "ready" && e.wasmConfig) {
2296
- const d = s, f = Et(d.flow);
2297
- f.length > 0 && (e.onWasmWarmup?.(f), Dt(d, e.wasmConfig));
2298
- }
2299
- }, [s, e]), L(() => {
2300
- s?.status === "finished" && t(s.finishStatus);
2301
- }, [s?.status, t, s]), L(() => {
2302
- s?.status === "error" && i && i(s.error);
2303
- }, [s?.status, i, s]), L(() => {
2304
- s?.status === "ready" && s.currentStep === "ID" && s.steps.includes("TUTORIAL_ID") && u.completeModule();
2305
- }, [s, u]), c.status === "error")
2306
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
2307
- "Error: ",
2308
- c.error
2309
- ] }) });
2310
- if (c.status === "initializing")
2311
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2312
- J,
2313
- {
2314
- title: e.spinnerConfig?.title,
2315
- subtitle: e.spinnerConfig?.subtitle,
2316
- size: e.spinnerConfig?.size,
2317
- fullScreen: !0
2318
- }
2319
- ) });
2320
- if (!s || s.status === "idle" || s.status === "loading")
2321
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2322
- J,
2323
- {
2324
- title: e.spinnerConfig?.title,
2325
- subtitle: e.spinnerConfig?.subtitle,
2326
- size: e.spinnerConfig?.size,
2327
- fullScreen: !0
2328
- }
2329
- ) });
2330
- if (s.status === "error")
2331
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
2332
- "Error: ",
2333
- s.error
2334
- ] }) });
2335
- if (s.status === "finished")
2336
- return null;
2337
- if (s.status === "ready") {
2338
- const {
2339
- currentStep: d,
2340
- config: f,
2341
- flow: {
2342
- flowId: M,
2343
- disableSmsOption: E,
2344
- addContinueToDesktop: P,
2345
- qrPhishingResistance: A
2346
- }
2347
- } = s;
2348
- if (h)
2349
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2350
- vt,
2351
- {
2352
- config: {
2353
- flowId: M,
2354
- disableSmsOption: E,
2355
- addContinueToDesktop: P,
2356
- qrPhishingResistance: A,
2357
- authHint: e.authHint,
2358
- lang: e.lang
2359
- },
2360
- onFinish: () => u.completeFlow(),
2361
- onContinue: () => a(!0),
2362
- onError: i
2363
- }
2364
- ) });
2365
- if (!d || !f)
2366
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2367
- J,
2368
- {
2369
- title: e.spinnerConfig?.title ?? r("loadingCircle.hangOn"),
2370
- subtitle: e.spinnerConfig?.subtitle ?? r("loadingCircle.validating"),
2371
- size: e.spinnerConfig?.size,
2372
- fullScreen: !0
2373
- }
2374
- ) });
2375
- if (g.status === "unsupported")
2376
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2377
- sr,
2378
- {
2379
- moduleKey: d,
2380
- onNext: () => u.completeModule()
2381
- }
2382
- ) });
2383
- if (g.status === "idle" || g.status === "loading" || g.status === "error")
2384
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2385
- J,
2386
- {
2387
- title: e.spinnerConfig?.title ?? r("loadingCircle.hangOn"),
2388
- subtitle: e.spinnerConfig?.subtitle ?? r("loadingCircle.validating"),
2389
- size: e.spinnerConfig?.size,
2390
- fullScreen: !0
2391
- }
2392
- ) });
2393
- const { Component: I } = g;
2394
- if (d === "SELFIE")
2395
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2396
- I,
2397
- {
2398
- config: f,
2399
- onFinish: () => u.completeModule(),
2400
- onError: (p) => {
2401
- i?.(p ?? "Selfie verification error");
2402
- }
2403
- },
2404
- `selfie-${s.currentStepIndex}`
2405
- ) });
2406
- if (d === "AUTHENTICATION")
2407
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2408
- I,
2409
- {
2410
- config: { ...f, authHint: e.authHint },
2411
- onFinish: () => u.completeModule(),
2412
- onError: (p) => {
2413
- i?.(p ?? "Authentication error");
2414
- }
2415
- },
2416
- `authentication-${s.currentStepIndex}`
2417
- ) });
2418
- if (d === "PHONE")
2419
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2420
- I,
2421
- {
2422
- config: f,
2423
- onFinish: () => u.completeModule(),
2424
- onError: (p) => {
2425
- i?.(p ?? "Phone verification error");
2426
- }
2427
- },
2428
- `phone-${s.currentStepIndex}`
2429
- ) });
2430
- if (d === "EMAIL") {
2431
- const m = f;
2432
- return !m || typeof m.otpVerification != "boolean" || typeof m.otpExpirationInMinutes != "number" ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2433
- I,
2434
- {
2435
- config: {
2436
- ...m,
2437
- prefill: m.prefill ?? !1
2438
- },
2439
- onFinish: () => u.completeModule(),
2440
- onError: (p) => {
2441
- i?.(p ?? "Email verification error");
2442
- }
2443
- },
2444
- `email-${s.currentStepIndex}`
2445
- ) });
2446
- }
2447
- if (d === "TUTORIAL_ID" || d === "SECOND_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
2448
- d === "ID" && !s.steps.includes("TUTORIAL_ID")) {
2449
- const m = f, B = d === "SECOND_ID" ? { ...m, isSecondId: !0 } : m;
2450
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2451
- I,
2452
- {
2453
- config: B,
2454
- onFinish: () => u.completeModule(),
2455
- onError: (C) => {
2456
- i?.(C ?? "ID capture error");
2457
- }
2458
- },
2459
- `id-${s.currentStepIndex}`
2460
- ) });
2461
- }
2462
- if (d === "FACE_MATCH") {
2463
- const m = f, p = {
2464
- variant: m.matchingType,
2465
- disableFaceMatchAnimation: m.disableFaceMatchAnimation ?? !1
2466
- };
2467
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2468
- I,
2469
- {
2470
- config: p,
2471
- onFinish: () => u.completeModule(),
2472
- onError: (B) => {
2473
- i?.(B ?? "Face match error");
2474
- }
2475
- },
2476
- `face-match-${s.currentStepIndex}`
2477
- ) });
2478
- }
2479
- if (d === "CURP_VALIDATION")
2480
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2481
- I,
2482
- {
2483
- config: f,
2484
- onFinish: () => u.completeModule(),
2485
- onError: (p) => {
2486
- i?.(p ?? "CURP validation error");
2487
- }
2488
- },
2489
- `curp-validation-${s.currentStepIndex}`
2490
- ) });
2491
- if (d === "GOVT_VALIDATION_PROVISIONING")
2492
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2493
- I,
2494
- {
2495
- config: f,
2496
- onFinish: () => u.completeModule(),
2497
- onError: (p) => {
2498
- i?.(p ?? "Government validation error");
2499
- }
2500
- },
2501
- `govt-validation-${s.currentStepIndex}`
2502
- ) });
2503
- if (d === "GEOLOCATION")
2504
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2505
- I,
2506
- {
2507
- config: { allowSkip: f.allowUserToSkipGeolocation },
2508
- onFinish: () => u.completeModule(),
2509
- onError: (p) => {
2510
- i?.(p ?? "Geolocation error");
2511
- }
2512
- },
2513
- `geolocation-${s.currentStepIndex}`
2514
- ) });
2515
- if (d === "EXTERNAL_VERIFICATION")
2516
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2517
- I,
2518
- {
2519
- config: { flowId: s.flow.flowId },
2520
- onFinish: () => u.completeModule(),
2521
- onError: (m) => {
2522
- i?.(m ?? "External verification error");
2523
- }
2524
- },
2525
- `ekyc-${s.currentStepIndex}`
2526
- ) });
2527
- if (d === "DOCUMENT_CAPTURE")
2528
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2529
- I,
2530
- {
2531
- config: f,
2532
- onFinish: () => u.completeModule(),
2533
- onError: (m) => {
2534
- i?.(m ?? "Document capture error");
2535
- }
2536
- },
2537
- `document-capture-${s.currentStepIndex}`
2538
- ) });
2539
- if (d === "ADDRESS") {
2540
- const m = f, p = {
2541
- processingType: "addressStatement",
2542
- allowSkipDocumentCapture: !m.disableSkipPoa,
2543
- title: m.title,
2544
- text: m.text
2545
- };
2546
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2547
- I,
2548
- {
2549
- config: p,
2550
- onFinish: () => u.completeModule(),
2551
- onError: (B) => {
2552
- i?.(B ?? "Address capture error");
2553
- }
2554
- },
2555
- `address-${s.currentStepIndex}`
2556
- ) });
2557
- }
2558
- if (d === "SIGNATURE") {
2559
- const m = f;
2560
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2561
- I,
2562
- {
2563
- config: {
2564
- title: m.title || void 0,
2565
- subtitle: m.subTitle || void 0
2566
- },
2567
- onFinish: () => u.completeModule(),
2568
- onError: (p) => {
2569
- i?.(p ?? "Signature capture error");
2570
- }
2571
- },
2572
- `signature-${s.currentStepIndex}`
2573
- ) });
2574
- }
2575
- if (d === "EKYB") {
2576
- const m = f, p = {
2577
- flowId: M,
2578
- checkBusinessName: m.checkBusinessName,
2579
- checkAddress: m.checkAddress,
2580
- checkTaxId: m.checkTaxId,
2581
- checkUniqueBeneficialOwner: m.checkUniqueBeneficialOwner
2582
- };
2583
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2584
- I,
2585
- {
2586
- config: p,
2587
- onFinish: () => u.completeModule(),
2588
- onError: (B) => {
2589
- i?.(B ?? "eKYB verification error");
2590
- }
2591
- },
2592
- `ekyb-${s.currentStepIndex}`
2593
- ) });
2594
- }
2595
- if (d === "COMBINED_CONSENT")
2596
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2597
- I,
2598
- {
2599
- config: f,
2600
- onFinish: () => u.completeModule(),
2601
- onError: (p) => {
2602
- i?.(p ?? "Combined consent error");
2603
- }
2604
- },
2605
- `combined-consent-${s.currentStepIndex}`
2606
- ) });
2607
- if (d === "MANDATORY_CONSENT")
2608
- return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
2609
- I,
2610
- {
2611
- config: f,
2612
- onFinish: () => u.completeModule(),
2613
- onError: (p) => {
2614
- i?.(p ?? "Mandatory consent error");
2615
- }
2616
- },
2617
- `mandatory-consent-${s.currentStepIndex}`
2618
- ) });
2619
- }
2620
- return null;
2621
- }, dr = ({
2622
- config: e,
2623
- onFinish: t = () => {
2624
- },
2625
- onError: i
2626
- }) => /* @__PURE__ */ l(wt, { children: e ? /* @__PURE__ */ l(
2627
- ur,
2628
- {
2629
- config: e,
2630
- onFinish: t,
2631
- onError: i
2632
- }
2633
- ) : null });
2634
- Tt(dr, "incode-flow");
2635
- export {
2636
- dr as IncodeFlow,
2637
- Hr as preloadIncodeFlow
2638
- };
1984
+ //#endregion
1985
+ //#region src/modules/flow/flow.tsx
1986
+ var ft = ({ config: e, onFinish: n, onError: r }) => {
1987
+ let { t: a, i18n: o } = t(), [s, c] = u(!1), l = lt({
1988
+ apiURL: e.apiURL,
1989
+ token: e.token,
1990
+ lang: e.lang,
1991
+ disableDashboardTheme: e.disableDashboardTheme,
1992
+ onError: r
1993
+ }), [f, p] = h(() => l.flowManager, { autoLoad: !1 }), m = f?.status === "ready" && f.flow.redirectDesktopToMobile && !s, g = ut({
1994
+ moduleKey: f?.status === "ready" && !m ? f.currentStep : void 0,
1995
+ onModuleLoading: e.onModuleLoading,
1996
+ onModuleLoaded: e.onModuleLoaded,
1997
+ onError: r
1998
+ });
1999
+ if (dt(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1), i(() => {
2000
+ e.lang && o.language !== e.lang && o.changeLanguage(e.lang);
2001
+ }, [e.lang, o]), i(() => {
2002
+ if (f?.status === "ready" && e.wasmConfig) {
2003
+ let t = f, n = D(t.flow);
2004
+ n.length > 0 && (e.onWasmWarmup?.(n), J(t, e.wasmConfig));
2005
+ }
2006
+ }, [f, e]), i(() => {
2007
+ f?.status === "finished" && n(f.finishStatus);
2008
+ }, [
2009
+ f?.status,
2010
+ n,
2011
+ f
2012
+ ]), i(() => {
2013
+ f?.status === "error" && r && r(f.error);
2014
+ }, [
2015
+ f?.status,
2016
+ r,
2017
+ f
2018
+ ]), i(() => {
2019
+ f?.status === "ready" && f.currentStep === "ID" && f.steps.includes("TUTORIAL_ID") && p.completeModule();
2020
+ }, [f, p]), l.status === "error") return /* @__PURE__ */ d("div", {
2021
+ class: "IncodeFlow",
2022
+ children: /* @__PURE__ */ d("div", { children: ["Error: ", l.error] })
2023
+ });
2024
+ if (l.status === "initializing" || !f || f.status === "idle" || f.status === "loading") return /* @__PURE__ */ d("div", {
2025
+ class: "IncodeFlow",
2026
+ children: /* @__PURE__ */ d(C, {
2027
+ title: e.spinnerConfig?.title,
2028
+ subtitle: e.spinnerConfig?.subtitle,
2029
+ size: e.spinnerConfig?.size,
2030
+ fullScreen: !0
2031
+ })
2032
+ });
2033
+ if (f.status === "error") return /* @__PURE__ */ d("div", {
2034
+ class: "IncodeFlow",
2035
+ children: /* @__PURE__ */ d("div", { children: ["Error: ", f.error] })
2036
+ });
2037
+ if (f.status === "finished") return null;
2038
+ if (f.status === "ready") {
2039
+ let { currentStep: t, config: n, flow: { flowId: i, disableSmsOption: o, addContinueToDesktop: s, qrPhishingResistance: l } } = f;
2040
+ if (m) return /* @__PURE__ */ d("div", {
2041
+ class: "IncodeFlow",
2042
+ children: /* @__PURE__ */ d(B, {
2043
+ config: {
2044
+ flowId: i,
2045
+ disableSmsOption: o,
2046
+ addContinueToDesktop: s,
2047
+ qrPhishingResistance: l,
2048
+ authHint: e.authHint,
2049
+ lang: e.lang
2050
+ },
2051
+ onFinish: () => p.completeFlow(),
2052
+ onContinue: () => c(!0),
2053
+ onError: r
2054
+ })
2055
+ });
2056
+ if (!t || !n) return /* @__PURE__ */ d("div", {
2057
+ class: "IncodeFlow",
2058
+ children: /* @__PURE__ */ d(C, {
2059
+ title: e.spinnerConfig?.title ?? a("loadingCircle.hangOn"),
2060
+ subtitle: e.spinnerConfig?.subtitle ?? a("loadingCircle.validating"),
2061
+ size: e.spinnerConfig?.size,
2062
+ fullScreen: !0
2063
+ })
2064
+ });
2065
+ if (g.status === "unsupported") return /* @__PURE__ */ d("div", {
2066
+ class: "IncodeFlow",
2067
+ children: /* @__PURE__ */ d(st, {
2068
+ moduleKey: t,
2069
+ onNext: () => p.completeModule()
2070
+ })
2071
+ });
2072
+ if (g.status === "idle" || g.status === "loading" || g.status === "error") return /* @__PURE__ */ d("div", {
2073
+ class: "IncodeFlow",
2074
+ children: /* @__PURE__ */ d(C, {
2075
+ title: e.spinnerConfig?.title ?? a("loadingCircle.hangOn"),
2076
+ subtitle: e.spinnerConfig?.subtitle ?? a("loadingCircle.validating"),
2077
+ size: e.spinnerConfig?.size,
2078
+ fullScreen: !0
2079
+ })
2080
+ });
2081
+ let { Component: u } = g;
2082
+ if (t === "SELFIE") return /* @__PURE__ */ d("div", {
2083
+ class: "IncodeFlow",
2084
+ children: /* @__PURE__ */ d(u, {
2085
+ config: n,
2086
+ onFinish: () => p.completeModule(),
2087
+ onError: (e) => {
2088
+ r?.(e ?? "Selfie verification error");
2089
+ }
2090
+ }, `selfie-${f.currentStepIndex}`)
2091
+ });
2092
+ if (t === "AUTHENTICATION") return /* @__PURE__ */ d("div", {
2093
+ class: "IncodeFlow",
2094
+ children: /* @__PURE__ */ d(u, {
2095
+ config: {
2096
+ ...n,
2097
+ authHint: e.authHint
2098
+ },
2099
+ onFinish: () => p.completeModule(),
2100
+ onError: (e) => {
2101
+ r?.(e ?? "Authentication error");
2102
+ }
2103
+ }, `authentication-${f.currentStepIndex}`)
2104
+ });
2105
+ if (t === "PHONE") return /* @__PURE__ */ d("div", {
2106
+ class: "IncodeFlow",
2107
+ children: /* @__PURE__ */ d(u, {
2108
+ config: n,
2109
+ onFinish: () => p.completeModule(),
2110
+ onError: (e) => {
2111
+ r?.(e ?? "Phone verification error");
2112
+ }
2113
+ }, `phone-${f.currentStepIndex}`)
2114
+ });
2115
+ if (t === "EMAIL") {
2116
+ let e = n;
2117
+ return !e || typeof e.otpVerification != "boolean" || typeof e.otpExpirationInMinutes != "number" ? /* @__PURE__ */ d("div", {
2118
+ class: "IncodeFlow",
2119
+ children: /* @__PURE__ */ d("div", { children: "Error: Invalid email configuration" })
2120
+ }) : /* @__PURE__ */ d("div", {
2121
+ class: "IncodeFlow",
2122
+ children: /* @__PURE__ */ d(u, {
2123
+ config: {
2124
+ ...e,
2125
+ prefill: e.prefill ?? !1
2126
+ },
2127
+ onFinish: () => p.completeModule(),
2128
+ onError: (e) => {
2129
+ r?.(e ?? "Email verification error");
2130
+ }
2131
+ }, `email-${f.currentStepIndex}`)
2132
+ });
2133
+ }
2134
+ if (t === "TUTORIAL_ID" || t === "SECOND_ID" || t === "ID" && !f.steps.includes("TUTORIAL_ID")) {
2135
+ let e = n;
2136
+ return /* @__PURE__ */ d("div", {
2137
+ class: "IncodeFlow",
2138
+ children: /* @__PURE__ */ d(u, {
2139
+ config: t === "SECOND_ID" ? {
2140
+ ...e,
2141
+ isSecondId: !0
2142
+ } : e,
2143
+ onFinish: () => p.completeModule(),
2144
+ onError: (e) => {
2145
+ r?.(e ?? "ID capture error");
2146
+ }
2147
+ }, `id-${f.currentStepIndex}`)
2148
+ });
2149
+ }
2150
+ if (t === "FACE_MATCH") {
2151
+ let e = n;
2152
+ return /* @__PURE__ */ d("div", {
2153
+ class: "IncodeFlow",
2154
+ children: /* @__PURE__ */ d(u, {
2155
+ config: {
2156
+ variant: e.matchingType,
2157
+ disableFaceMatchAnimation: e.disableFaceMatchAnimation ?? !1
2158
+ },
2159
+ onFinish: () => p.completeModule(),
2160
+ onError: (e) => {
2161
+ r?.(e ?? "Face match error");
2162
+ }
2163
+ }, `face-match-${f.currentStepIndex}`)
2164
+ });
2165
+ }
2166
+ if (t === "CURP_VALIDATION") return /* @__PURE__ */ d("div", {
2167
+ class: "IncodeFlow",
2168
+ children: /* @__PURE__ */ d(u, {
2169
+ config: n,
2170
+ onFinish: () => p.completeModule(),
2171
+ onError: (e) => {
2172
+ r?.(e ?? "CURP validation error");
2173
+ }
2174
+ }, `curp-validation-${f.currentStepIndex}`)
2175
+ });
2176
+ if (t === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ d("div", {
2177
+ class: "IncodeFlow",
2178
+ children: /* @__PURE__ */ d(u, {
2179
+ config: n,
2180
+ onFinish: () => p.completeModule(),
2181
+ onError: (e) => {
2182
+ r?.(e ?? "Government validation error");
2183
+ }
2184
+ }, `govt-validation-${f.currentStepIndex}`)
2185
+ });
2186
+ if (t === "GEOLOCATION") return /* @__PURE__ */ d("div", {
2187
+ class: "IncodeFlow",
2188
+ children: /* @__PURE__ */ d(u, {
2189
+ config: { allowSkip: n.allowUserToSkipGeolocation },
2190
+ onFinish: () => p.completeModule(),
2191
+ onError: (e) => {
2192
+ r?.(e ?? "Geolocation error");
2193
+ }
2194
+ }, `geolocation-${f.currentStepIndex}`)
2195
+ });
2196
+ if (t === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ d("div", {
2197
+ class: "IncodeFlow",
2198
+ children: /* @__PURE__ */ d(u, {
2199
+ config: { flowId: f.flow.flowId },
2200
+ onFinish: () => p.completeModule(),
2201
+ onError: (e) => {
2202
+ r?.(e ?? "External verification error");
2203
+ }
2204
+ }, `ekyc-${f.currentStepIndex}`)
2205
+ });
2206
+ if (t === "DOCUMENT_CAPTURE") return /* @__PURE__ */ d("div", {
2207
+ class: "IncodeFlow",
2208
+ children: /* @__PURE__ */ d(u, {
2209
+ config: n,
2210
+ onFinish: () => p.completeModule(),
2211
+ onError: (e) => {
2212
+ r?.(e ?? "Document capture error");
2213
+ }
2214
+ }, `document-capture-${f.currentStepIndex}`)
2215
+ });
2216
+ if (t === "ADDRESS") {
2217
+ let e = n;
2218
+ return /* @__PURE__ */ d("div", {
2219
+ class: "IncodeFlow",
2220
+ children: /* @__PURE__ */ d(u, {
2221
+ config: {
2222
+ processingType: "addressStatement",
2223
+ allowSkipDocumentCapture: !e.disableSkipPoa,
2224
+ title: e.title,
2225
+ text: e.text
2226
+ },
2227
+ onFinish: () => p.completeModule(),
2228
+ onError: (e) => {
2229
+ r?.(e ?? "Address capture error");
2230
+ }
2231
+ }, `address-${f.currentStepIndex}`)
2232
+ });
2233
+ }
2234
+ if (t === "SIGNATURE") {
2235
+ let e = n;
2236
+ return /* @__PURE__ */ d("div", {
2237
+ class: "IncodeFlow",
2238
+ children: /* @__PURE__ */ d(u, {
2239
+ config: {
2240
+ title: e.title || void 0,
2241
+ subtitle: e.subTitle || void 0
2242
+ },
2243
+ onFinish: () => p.completeModule(),
2244
+ onError: (e) => {
2245
+ r?.(e ?? "Signature capture error");
2246
+ }
2247
+ }, `signature-${f.currentStepIndex}`)
2248
+ });
2249
+ }
2250
+ if (t === "EKYB") {
2251
+ let e = n;
2252
+ return /* @__PURE__ */ d("div", {
2253
+ class: "IncodeFlow",
2254
+ children: /* @__PURE__ */ d(u, {
2255
+ config: {
2256
+ flowId: i,
2257
+ checkBusinessName: e.checkBusinessName,
2258
+ checkAddress: e.checkAddress,
2259
+ checkTaxId: e.checkTaxId,
2260
+ checkUniqueBeneficialOwner: e.checkUniqueBeneficialOwner
2261
+ },
2262
+ onFinish: () => p.completeModule(),
2263
+ onError: (e) => {
2264
+ r?.(e ?? "eKYB verification error");
2265
+ }
2266
+ }, `ekyb-${f.currentStepIndex}`)
2267
+ });
2268
+ }
2269
+ if (t === "COMBINED_CONSENT") return /* @__PURE__ */ d("div", {
2270
+ class: "IncodeFlow",
2271
+ children: /* @__PURE__ */ d(u, {
2272
+ config: n,
2273
+ onFinish: () => p.completeModule(),
2274
+ onError: (e) => {
2275
+ r?.(e ?? "Combined consent error");
2276
+ }
2277
+ }, `combined-consent-${f.currentStepIndex}`)
2278
+ });
2279
+ if (t === "MANDATORY_CONSENT") return /* @__PURE__ */ d("div", {
2280
+ class: "IncodeFlow",
2281
+ children: /* @__PURE__ */ d(u, {
2282
+ config: n,
2283
+ onFinish: () => p.completeModule(),
2284
+ onError: (e) => {
2285
+ r?.(e ?? "Mandatory consent error");
2286
+ }
2287
+ }, `mandatory-consent-${f.currentStepIndex}`)
2288
+ });
2289
+ }
2290
+ return null;
2291
+ }, $ = ({ config: e, onFinish: t = () => {}, onError: n }) => /* @__PURE__ */ d(_, { children: e ? /* @__PURE__ */ d(ft, {
2292
+ config: e,
2293
+ onFinish: t,
2294
+ onError: n
2295
+ }) : null });
2296
+ T($, "incode-flow");
2297
+ //#endregion
2298
+ export { $ as IncodeFlow, ct as preloadIncodeFlow };