@incodetech/web 0.0.0-dev-20260320-9f7f27a → 0.0.0-dev-20260320-2b71e13

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.
@@ -1,13 +1,13 @@
1
- import { b as v, u as o, I as J, a as Q, B as Z } from "./button-Yr39X4SE.js";
1
+ import { b as I, u as o, I as J, a as Q, B as Z } from "./button-Yr39X4SE.js";
2
2
  import { SUPPORTED_COUNTRIES as M, DEV_ONLY_COUNTRIES as x, computeEkybDisplayErrors as ee, createEkybManager as te } from "@incodetech/core/ekyb";
3
- import { T as q, y as V, A as D, d as oe, q as S, k as re } from "./vendor-preact--mDTxXnt.js";
3
+ import { T as q, y as V, A as D, d as oe, q as C, k as re } from "./vendor-preact--mDTxXnt.js";
4
4
  import "./uiConfig-CKJmKRCo.js";
5
5
  import "@incodetech/core";
6
6
  import { u as ne, A as se } from "./addressAutocomplete-D7g-naeA.js";
7
7
  import { P as K } from "./page-DO2rYslN.js";
8
8
  import { S as ae } from "./spinner-Djok6FY8.js";
9
- import { t as G, F as ce, V as P } from "./formField-6BHE59Av.js";
10
- import { r as le } from "./incodeModule-Bxzkb7nW.js";
9
+ import { t as G, F as le, V as P } from "./formField-6BHE59Av.js";
10
+ import { r as ce } from "./incodeModule-Bxzkb7nW.js";
11
11
  import { D as Y } from "./dropdownComposed-DLZ4R_VD.js";
12
12
  import { a as _ } from "./inputComposed-n2VIh213.js";
13
13
  function ue(t) {
@@ -41,14 +41,14 @@ const be = ({
41
41
  value: t,
42
42
  onChange: r
43
43
  }) => {
44
- const { t: c } = v(), n = q(() => (de() ? [...M, ...x] : [...M]).map(me).sort((l, d) => l.label.localeCompare(d.label)), []);
44
+ const { t: l } = I(), s = q(() => (de() ? [...M, ...x] : [...M]).map(me).sort((c, d) => c.label.localeCompare(d.label)), []);
45
45
  return /* @__PURE__ */ o("div", { className: "IncodeEkybCountrySelector", children: /* @__PURE__ */ o(
46
46
  Y,
47
47
  {
48
48
  id: "ekyb-country",
49
- label: c("ekyb.country"),
49
+ label: l("ekyb.country"),
50
50
  value: t,
51
- options: n,
51
+ options: s,
52
52
  onChange: r,
53
53
  "data-testid": "ekyb-country-selector"
54
54
  }
@@ -56,105 +56,105 @@ const be = ({
56
56
  }, B = ({
57
57
  field: t,
58
58
  value: r,
59
- error: c,
60
- errorParams: n,
59
+ error: l,
60
+ errorParams: s,
61
61
  country: i,
62
- onChange: l,
62
+ onChange: c,
63
63
  onBlur: d
64
64
  }) => {
65
- const { t: b } = v(), u = !t.required, h = b(t.label);
65
+ const { t: b } = I(), u = !t.required, y = b(t.label);
66
66
  if (t.type === "dropdown") {
67
- const m = u ? `${h} (${b("common.optional")})` : h, s = t.name === "state" ? b("ekyb.selectState") : void 0;
67
+ const m = u ? `${y} (${b("common.optional")})` : y;
68
68
  return /* @__PURE__ */ o(
69
69
  Y,
70
70
  {
71
71
  id: `ekyb-${t.name}`,
72
72
  label: m,
73
- placeholder: s,
73
+ placeholder: t.placeholder ? b(t.placeholder) : void 0,
74
74
  value: r,
75
- options: (t.options ?? []).map((p) => ({
76
- ...p,
77
- label: b(p.label)
75
+ options: (t.options ?? []).map((n) => ({
76
+ ...n,
77
+ label: b(n.label)
78
78
  })),
79
- error: G(b, c, n),
79
+ error: G(b, l, s),
80
80
  searchable: !0,
81
- onChange: (p) => l(t.name, p),
81
+ onChange: (n) => c(t.name, n),
82
82
  onBlur: d ? () => d(t.name) : void 0,
83
83
  "data-testid": `ekyb-field-${t.name}`
84
84
  }
85
85
  );
86
86
  }
87
87
  return /* @__PURE__ */ o(
88
- ce,
88
+ le,
89
89
  {
90
90
  name: t.name,
91
91
  label: t.label,
92
92
  value: r,
93
- error: c,
94
- errorParams: n,
93
+ error: l,
94
+ errorParams: s,
95
95
  required: t.required,
96
96
  optional: u,
97
- onChange: l,
97
+ onChange: c,
98
98
  onBlur: d
99
99
  }
100
100
  );
101
101
  }, pe = ({
102
102
  ubos: t,
103
103
  errors: r,
104
- errorParams: c,
105
- canAddUbo: n,
104
+ errorParams: l,
105
+ canAddUbo: s,
106
106
  onSetField: i,
107
- onBlur: l,
107
+ onBlur: c,
108
108
  onAdd: d,
109
109
  onRemove: b
110
110
  }) => {
111
- const { t: u } = v(), h = (m) => G(u, r[m], c[m]);
111
+ const { t: u } = I(), y = (m) => G(u, r[m], l[m]);
112
112
  return t.length === 0 ? null : /* @__PURE__ */ o("div", { className: "IncodeEkybUbos", children: [
113
- t.map((m, s) => {
114
- const p = s === 0 ? u("ekyb.uboName") : u("ekyb.uboNameWithNumber", { number: s + 1 }), f = s === 0 ? u("ekyb.uboSurname") : u("ekyb.uboSurnameWithNumber", { number: s + 1 }), N = s === 0;
113
+ t.map((m, n) => {
114
+ const v = n === 0 ? u("ekyb.uboName") : u("ekyb.uboNameWithNumber", { number: n + 1 }), f = n === 0 ? u("ekyb.uboSurname") : u("ekyb.uboSurnameWithNumber", { number: n + 1 }), N = n === 0;
115
115
  return /* @__PURE__ */ o("div", { className: "IncodeEkybUboEntry", children: [
116
116
  /* @__PURE__ */ o(
117
117
  _,
118
118
  {
119
- id: `ubo-${s}-name`,
120
- label: p,
121
- name: `ubo-${s}-name`,
119
+ id: `ubo-${n}-name`,
120
+ label: v,
121
+ name: `ubo-${n}-name`,
122
122
  value: m.name,
123
- error: h(`ubo-${s}-name`),
124
- onInput: (I) => i(s, "name", I.target.value),
125
- onBlur: l ? () => l(`ubo-${s}-name`) : void 0,
126
- "data-testid": `ekyb-ubo-${s}-name`
123
+ error: y(`ubo-${n}-name`),
124
+ onInput: (S) => i(n, "name", S.target.value),
125
+ onBlur: c ? () => c(`ubo-${n}-name`) : void 0,
126
+ "data-testid": `ekyb-ubo-${n}-name`
127
127
  }
128
128
  ),
129
129
  /* @__PURE__ */ o(
130
130
  _,
131
131
  {
132
- id: `ubo-${s}-surname`,
132
+ id: `ubo-${n}-surname`,
133
133
  label: f,
134
- name: `ubo-${s}-surname`,
134
+ name: `ubo-${n}-surname`,
135
135
  value: m.surname,
136
- error: h(`ubo-${s}-surname`),
137
- onInput: (I) => i(
138
- s,
136
+ error: y(`ubo-${n}-surname`),
137
+ onInput: (S) => i(
138
+ n,
139
139
  "surname",
140
- I.target.value
140
+ S.target.value
141
141
  ),
142
- onBlur: l ? () => l(`ubo-${s}-surname`) : void 0,
143
- "data-testid": `ekyb-ubo-${s}-surname`
142
+ onBlur: c ? () => c(`ubo-${n}-surname`) : void 0,
143
+ "data-testid": `ekyb-ubo-${n}-surname`
144
144
  }
145
145
  ),
146
146
  !N && /* @__PURE__ */ o(
147
147
  "button",
148
148
  {
149
149
  className: "IncodeEkybRemoveUbo",
150
- onClick: () => b(s),
150
+ onClick: () => b(n),
151
151
  type: "button",
152
152
  children: u("common.remove")
153
153
  }
154
154
  )
155
155
  ] }, m.id);
156
156
  }),
157
- n && /* @__PURE__ */ o(
157
+ s && /* @__PURE__ */ o(
158
158
  "button",
159
159
  {
160
160
  className: "IncodeEkybAddUbo",
@@ -166,23 +166,23 @@ const be = ({
166
166
  )
167
167
  ] });
168
168
  }, ye = ({ config: t, onFinish: r }) => {
169
- const { t: c } = v(), [n, i] = Q(() => te({ config: t }));
169
+ const { t: l } = I(), [s, i] = Q(() => te({ config: t }));
170
170
  return V(() => {
171
- (n.status === "finished" || n.status === "closed") && r?.();
172
- }, [n.status, r]), n.status === "finished" || n.status === "closed" ? null : n.status === "loading" ? /* @__PURE__ */ o(
171
+ (s.status === "finished" || s.status === "closed") && r?.();
172
+ }, [s.status, r]), s.status === "finished" || s.status === "closed" ? null : s.status === "loading" ? /* @__PURE__ */ o(
173
173
  P,
174
174
  {
175
175
  status: "submitting",
176
- submittingTitle: c("common.loading")
176
+ submittingTitle: l("common.loading")
177
177
  }
178
- ) : n.status === "submitting" ? /* @__PURE__ */ o(K, { children: /* @__PURE__ */ o(
178
+ ) : s.status === "submitting" ? /* @__PURE__ */ o(K, { children: /* @__PURE__ */ o(
179
179
  ae,
180
180
  {
181
181
  fullScreen: !1,
182
- title: c("common.processing"),
182
+ title: l("common.processing"),
183
183
  className: "IncodeEkybSpinner"
184
184
  }
185
- ) }) : n.status === "success" ? /* @__PURE__ */ o(P, { status: "success" }) : n.status === "error" ? /* @__PURE__ */ o(P, { status: "failure", onRetry: () => i.retry() }) : n.status === "form" ? /* @__PURE__ */ o(ke, { state: n, manager: i }) : null;
185
+ ) }) : s.status === "success" ? /* @__PURE__ */ o(P, { status: "success" }) : s.status === "error" ? /* @__PURE__ */ o(P, { status: "failure", onRetry: () => i.retry() }) : s.status === "form" ? /* @__PURE__ */ o(Ee, { state: s, manager: i }) : null;
186
186
  }, O = /* @__PURE__ */ new Set([
187
187
  "street",
188
188
  "houseNo",
@@ -190,63 +190,63 @@ const be = ({
190
190
  "city",
191
191
  "state",
192
192
  "postalCode"
193
- ]), he = ["street", "city", "state", "postalCode", "houseNo"], ke = ({ state: t, manager: r }) => {
193
+ ]), he = ["street", "city", "state", "postalCode", "houseNo"], Ee = ({ state: t, manager: r }) => {
194
194
  const {
195
- country: c,
196
- fields: n,
195
+ country: l,
196
+ fields: s,
197
197
  values: i,
198
- errors: l,
198
+ errors: c,
199
199
  isValid: d,
200
200
  ubos: b,
201
201
  canAddUbo: u,
202
- addressSuggestions: h,
202
+ addressSuggestions: y,
203
203
  submitAttempted: m
204
- } = t, { t: s } = v(), p = D(null), f = D(null), N = D(void 0), I = ne(p, n.length), [w, T] = oe({}), y = S((e) => {
204
+ } = t, { t: n } = I(), v = D(null), f = D(null), N = D(void 0), S = ne(v, s.length), [w, T] = oe({}), p = C((e) => {
205
205
  T((a) => a[e] ? a : { ...a, [e]: !0 });
206
206
  }, []), { displayErrors: E, errorParams: F } = q(
207
207
  () => ee(
208
- l,
208
+ c,
209
209
  w,
210
210
  m,
211
- c,
212
- n
211
+ l,
212
+ s
213
213
  ),
214
- [l, w, m, c, n]
215
- ), $ = S(
216
- (e) => y(e),
217
- [y]
218
- ), A = S(
214
+ [c, w, m, l, s]
215
+ ), $ = C(
216
+ (e) => p(e),
217
+ [p]
218
+ ), A = C(
219
219
  (e, a) => {
220
- y(e), r.setField(e, a);
220
+ p(e), r.setField(e, a);
221
221
  },
222
- [r, y]
223
- ), j = S(
224
- (e, a, k) => {
225
- y(`ubo-${e}-${a}`), r.setUboField(e, a, k);
222
+ [r, p]
223
+ ), j = C(
224
+ (e, a, h) => {
225
+ p(`ubo-${e}-${a}`), r.setUboField(e, a, h);
226
226
  },
227
- [r, y]
228
- ), W = S(
227
+ [r, p]
228
+ ), W = C(
229
229
  (e) => {
230
- for (const a of he) y(a);
230
+ for (const a of he) p(a);
231
231
  r.selectAddress(e);
232
232
  },
233
- [r, y]
234
- ), z = S(
233
+ [r, p]
234
+ ), z = C(
235
235
  (e) => {
236
236
  r.removeUbo(e), T((a) => {
237
- const k = {};
238
- for (const [C, U] of Object.entries(a)) {
239
- const R = C.match(/^ubo-(\d+)-(name|surname)$/);
237
+ const h = {};
238
+ for (const [k, U] of Object.entries(a)) {
239
+ const R = k.match(/^ubo-(\d+)-(name|surname)$/);
240
240
  if (!R) {
241
- k[C] = U;
241
+ h[k] = U;
242
242
  continue;
243
243
  }
244
244
  const g = Number(R[1]);
245
245
  if (g === e) continue;
246
246
  const X = g > e ? g - 1 : g;
247
- k[`ubo-${X}-${R[2]}`] = U;
247
+ h[`ubo-${X}-${R[2]}`] = U;
248
248
  }
249
- return k;
249
+ return h;
250
250
  });
251
251
  },
252
252
  [r]
@@ -255,23 +255,23 @@ const be = ({
255
255
  const e = E.postalCode, a = N.current;
256
256
  if (N.current = e, !e || a === e)
257
257
  return;
258
- const k = requestAnimationFrame(() => {
259
- const C = f.current;
260
- if (!C) return;
261
- (C.querySelector("#postalCode-error") ?? C).scrollIntoView({
258
+ const h = requestAnimationFrame(() => {
259
+ const k = f.current;
260
+ if (!k) return;
261
+ (k.querySelector("#postalCode-error") ?? k).scrollIntoView({
262
262
  behavior: "smooth",
263
263
  block: "nearest"
264
264
  });
265
265
  });
266
- return () => cancelAnimationFrame(k);
266
+ return () => cancelAnimationFrame(h);
267
267
  }, [E.postalCode]);
268
- const H = n.filter((e) => !O.has(e.name)), L = n.filter((e) => O.has(e.name));
269
- return /* @__PURE__ */ o(K, { className: `IncodeEkybPage${I ? " IncodeEkybPageScrollable" : ""}`, title: s("ekyb.title"), children: [
270
- /* @__PURE__ */ o("div", { ref: p, className: "IncodeEkybForm", children: [
268
+ const H = s.filter((e) => !O.has(e.name)), L = s.filter((e) => O.has(e.name));
269
+ return /* @__PURE__ */ o(K, { className: `IncodeEkybPage${S ? " IncodeEkybPageScrollable" : ""}`, title: n("ekyb.title"), children: [
270
+ /* @__PURE__ */ o("div", { ref: v, className: "IncodeEkybForm", children: [
271
271
  /* @__PURE__ */ o(
272
272
  be,
273
273
  {
274
- value: c,
274
+ value: l,
275
275
  onChange: (e) => r.setCountry(e)
276
276
  }
277
277
  ),
@@ -282,7 +282,7 @@ const be = ({
282
282
  value: i[e.name] ?? "",
283
283
  error: E[e.name],
284
284
  errorParams: F[e.name],
285
- country: c,
285
+ country: l,
286
286
  onChange: A,
287
287
  onBlur: $
288
288
  },
@@ -302,7 +302,7 @@ const be = ({
302
302
  }
303
303
  ),
304
304
  L.length > 0 && /* @__PURE__ */ o(re, { children: [
305
- /* @__PURE__ */ o("h3", { className: "IncodeEkybSectionHeader", children: s("ekyb.addressDetails") }),
305
+ /* @__PURE__ */ o("h3", { className: "IncodeEkybSectionHeader", children: n("ekyb.addressDetails") }),
306
306
  L.map((e) => e.name === "street" ? /* @__PURE__ */ o(
307
307
  se,
308
308
  {
@@ -310,7 +310,7 @@ const be = ({
310
310
  value: i.street ?? "",
311
311
  error: E.street,
312
312
  errorParams: F.street,
313
- suggestions: h,
313
+ suggestions: y,
314
314
  optional: !e.required,
315
315
  onChange: (a) => A("street", a),
316
316
  onSearch: (a) => r.searchAddress(a),
@@ -329,7 +329,7 @@ const be = ({
329
329
  value: i[e.name] ?? "",
330
330
  error: E[e.name],
331
331
  errorParams: F[e.name],
332
- country: c,
332
+ country: l,
333
333
  onChange: A,
334
334
  onBlur: $
335
335
  }
@@ -345,12 +345,12 @@ const be = ({
345
345
  onClick: () => r.submit(),
346
346
  disabled: !d,
347
347
  "data-testid": "ekyb-submit",
348
- children: s("ekyb.continue")
348
+ children: n("ekyb.continue")
349
349
  }
350
350
  ) })
351
351
  ] });
352
- }, Ee = ({ config: t, onFinish: r }) => /* @__PURE__ */ o(J, { children: t ? /* @__PURE__ */ o(ye, { config: t, onFinish: r }) : null });
353
- le(Ee, "incode-ekyb");
352
+ }, ke = ({ config: t, onFinish: r }) => /* @__PURE__ */ o(J, { children: t ? /* @__PURE__ */ o(ye, { config: t, onFinish: r }) : null });
353
+ ce(ke, "incode-ekyb");
354
354
  export {
355
- Ee as EkybModule
355
+ ke as EkybModule
356
356
  };