@inploi/plugin-chatbot 4.1.0 → 4.1.2

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,4 +1,4 @@
1
- import { g as Ue, i as Yt, k as Ne, a as er, b as le, A as Me, c as Ir, N as Ke, _ as V, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as Te, j as dt, y as pe, s as M, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as ke, w as Nr, x as rr, z as Lr, B as nr, C as Tr, D as Se, E as Q, G as Dr, V as Rr, H as sr, I as je, J as Le, K as Or, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as qr, S as Ur, T as Kr, U as Gr } from "./index-cdef556d.js";
1
+ import { g as Ue, i as Yt, k as Le, a as er, b as le, A as Fe, c as Ir, N as Ke, _ as V, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as De, j as dt, y as pe, s as M, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as ke, w as Nr, x as rr, z as Lr, B as nr, C as Tr, D as Se, E as Q, G as Dr, V as Rr, H as sr, I as je, J as Te, K as Or, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as qr, S as Ur, T as Kr, U as Gr } from "./index-c974e995.js";
2
2
  import "@inploi/sdk";
3
3
  const Ft = ({
4
4
  condition: e,
@@ -6,20 +6,20 @@ const Ft = ({
6
6
  submissions: r,
7
7
  ifBlock: n
8
8
  }) => {
9
- const [a, ...s] = e.compareKey.split(".");
10
- if (!a)
9
+ const [s, ...a] = e.compareKey.split(".");
10
+ if (!s)
11
11
  return !1;
12
12
  const i = ir({
13
13
  context: t,
14
- key: a,
15
- path: s,
14
+ key: s,
15
+ path: a,
16
16
  submissions: r
17
17
  });
18
18
  if (!i)
19
19
  return !1;
20
20
  switch (i.type) {
21
21
  case "address": {
22
- const u = Ue(i.value, s.join("."));
22
+ const u = Ue(i.value, a.join("."));
23
23
  switch (e.compare) {
24
24
  case "equals":
25
25
  return u === e.compareValue;
@@ -35,7 +35,7 @@ const Ft = ({
35
35
  case "integration": {
36
36
  if (typeof i.value != "object" || Array.isArray(i.value))
37
37
  return !1;
38
- const u = Ue(i.value, s.join(".")), d = {
38
+ const u = Ue(i.value, a.join(".")), d = {
39
39
  ...n,
40
40
  data: {
41
41
  ...n.data,
@@ -44,7 +44,7 @@ const Ft = ({
44
44
  };
45
45
  switch (typeof u) {
46
46
  case "boolean":
47
- return Fe(d, {
47
+ return Ne(d, {
48
48
  submissions: {
49
49
  _temp: {
50
50
  value: u,
@@ -54,7 +54,7 @@ const Ft = ({
54
54
  context: t
55
55
  });
56
56
  case "string":
57
- return Fe(d, {
57
+ return Ne(d, {
58
58
  submissions: {
59
59
  _temp: {
60
60
  value: u,
@@ -64,7 +64,7 @@ const Ft = ({
64
64
  context: t
65
65
  });
66
66
  case "number":
67
- return Fe(d, {
67
+ return Ne(d, {
68
68
  submissions: {
69
69
  _temp: {
70
70
  value: u,
@@ -74,7 +74,7 @@ const Ft = ({
74
74
  context: t
75
75
  });
76
76
  case "object":
77
- return Array.isArray(u) && u.every(Yt) ? Fe(d, {
77
+ return Array.isArray(u) && u.every(Yt) ? Ne(d, {
78
78
  submissions: {
79
79
  _temp: {
80
80
  value: u,
@@ -146,15 +146,15 @@ const Ft = ({
146
146
  }
147
147
  break;
148
148
  }
149
- }, Fe = (e, {
149
+ }, Ne = (e, {
150
150
  context: t,
151
151
  submissions: r
152
152
  }) => {
153
153
  const n = "combinator" in e.data ? e.data.conditions : [e.data];
154
154
  if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
155
- for (const s of n)
155
+ for (const a of n)
156
156
  if (Ft({
157
- condition: s,
157
+ condition: a,
158
158
  context: t,
159
159
  submissions: r,
160
160
  ifBlock: e
@@ -162,9 +162,9 @@ const Ft = ({
162
162
  return !0;
163
163
  return !1;
164
164
  } else {
165
- for (const s of n)
165
+ for (const a of n)
166
166
  if (!Ft({
167
- condition: s,
167
+ condition: a,
168
168
  context: t,
169
169
  submissions: r,
170
170
  ifBlock: e
@@ -175,48 +175,48 @@ const Ft = ({
175
175
  }, Hr = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ne = (e, {
176
176
  context: t,
177
177
  submissions: r
178
- }) => e.replace(Hr, (n, a, s = "") => {
179
- const [i, ...u] = a.trim().split("."), d = ir({
178
+ }) => e.replace(Hr, (n, s, a = "") => {
179
+ const [i, ...u] = s.trim().split("."), d = ir({
180
180
  key: i,
181
181
  path: u,
182
182
  submissions: r,
183
183
  context: t
184
184
  });
185
185
  if (!d)
186
- return s;
186
+ return a;
187
187
  switch (d.type) {
188
188
  case "boolean":
189
189
  return d.value === !0 ? "true" : "false";
190
190
  case "file":
191
- return d.value.map((p) => `${p.name} (${Ne(p.sizeKb)})`).join(", ");
191
+ return d.value.map((h) => `${h.name} (${Le(h.sizeKb)})`).join(", ");
192
192
  case "enum":
193
193
  return d.value.join(", ");
194
194
  case "address":
195
- return Object.values(d.value).filter((p) => p && p.trim().length > 0).join(", ");
195
+ return Object.values(d.value).filter((h) => h && h.trim().length > 0).join(", ");
196
196
  case "number":
197
197
  case "string":
198
- return d.value ? d.value.toString() : s;
198
+ return d.value ? d.value.toString() : a;
199
199
  case "phone":
200
200
  return Xe(d.value);
201
201
  case "integration": {
202
202
  if (typeof d.value != "object" || Array.isArray(d.value))
203
203
  break;
204
- const p = Ue(d.value, u.join("."));
205
- switch (typeof p) {
204
+ const h = Ue(d.value, u.join("."));
205
+ switch (typeof h) {
206
206
  case "boolean":
207
- return p === !0 ? "true" : "false";
207
+ return h === !0 ? "true" : "false";
208
208
  case "string":
209
- return p;
209
+ return h;
210
210
  case "number":
211
- return p.toString();
211
+ return h.toString();
212
212
  case "object":
213
- if (Array.isArray(p) && p.every(Yt))
214
- return p.join(", ");
213
+ if (Array.isArray(h) && h.every(Yt))
214
+ return h.join(", ");
215
215
  }
216
216
  break;
217
217
  }
218
218
  }
219
- return s;
219
+ return a;
220
220
  }), ar = ({
221
221
  node: e,
222
222
  nodes: t,
@@ -224,7 +224,7 @@ const Ft = ({
224
224
  }) => {
225
225
  if ((r == null ? void 0 : r(e)) === !0)
226
226
  return e;
227
- const n = e.nextId ? t.find((a) => a.id === e.nextId) : void 0;
227
+ const n = e.nextId ? t.find((s) => s.id === e.nextId) : void 0;
228
228
  if (n)
229
229
  return ar({
230
230
  node: n,
@@ -235,32 +235,32 @@ const Ft = ({
235
235
  childNode: e,
236
236
  nodes: t
237
237
  }) => {
238
- const n = t.filter((a) => a.type === "if-block").find((a) => {
239
- if (!a.branchId)
238
+ const n = t.filter((s) => s.type === "if-block").find((s) => {
239
+ if (!s.branchId)
240
240
  return !1;
241
- const s = t.find((u) => u.id === a.branchId);
242
- if (!s)
241
+ const a = t.find((u) => u.id === s.branchId);
242
+ if (!a)
243
243
  return !1;
244
244
  const i = ar({
245
- node: s,
245
+ node: a,
246
246
  nodes: t,
247
247
  stopWhen: (u) => u.id === e.id
248
248
  });
249
249
  return !(!i || i.id !== e.id);
250
250
  });
251
251
  if (n != null && n.nextId)
252
- return t.find((a) => a.id === n.nextId);
252
+ return t.find((s) => s.id === n.nextId);
253
253
  }, Jr = ({
254
254
  flow: e,
255
255
  analytics: t,
256
256
  logger: r,
257
257
  context: n,
258
- apiClient: a,
259
- getSubmissions: s,
258
+ apiClient: s,
259
+ getSubmissions: a,
260
260
  chatService: i,
261
261
  onFlowEnd: u,
262
262
  onInterpret: d,
263
- t: p
263
+ t: h
264
264
  }) => {
265
265
  let x = new AbortController();
266
266
  const v = {
@@ -272,19 +272,19 @@ const Ft = ({
272
272
  ...t.customProperties
273
273
  }
274
274
  })
275
- }, h = async (k, b) => {
276
- const A = s();
277
- d == null || d(k, b);
275
+ }, p = async (k, y) => {
276
+ const A = a();
277
+ d == null || d(k, y);
278
278
  try {
279
279
  await Zr({
280
280
  flow: e,
281
281
  analytics: v,
282
282
  logger: r,
283
- apiClient: a,
283
+ apiClient: s,
284
284
  context: n,
285
285
  node: k,
286
286
  submissions: A,
287
- t: p,
287
+ t: h,
288
288
  chat: {
289
289
  sendMessage: async (S) => i.send({
290
290
  groupId: k.id,
@@ -302,33 +302,33 @@ const Ft = ({
302
302
  childNode: k,
303
303
  nodes: e.nodes
304
304
  });
305
- return E ? h(E, k) : u == null ? void 0 : u(k);
305
+ return E ? p(E, k) : u == null ? void 0 : u(k);
306
306
  },
307
307
  end: () => u == null ? void 0 : u(k)
308
308
  });
309
309
  } catch (S) {
310
- if (S instanceof Me)
310
+ if (S instanceof Fe)
311
311
  return;
312
312
  throw S;
313
313
  }
314
314
  };
315
315
  return {
316
316
  interpret: async (k) => {
317
- const b = e.nodes.find((A) => A.id === k) ?? er(e.nodes);
318
- return h(b);
317
+ const y = e.nodes.find((A) => A.id === k) ?? er(e.nodes);
318
+ return p(y);
319
319
  },
320
320
  undo: (k) => {
321
- let b = 1;
321
+ let y = 1;
322
322
  const A = e.nodes.find((E) => E.id === k[k.length - 1]);
323
323
  for (let E = k.length - 2; E > 0; E--) {
324
324
  const g = k[E], N = e.nodes.find((P) => P.id === g);
325
- if (!N || (b++, N.type.startsWith("question-")))
325
+ if (!N || (y++, N.type.startsWith("question-")))
326
326
  break;
327
327
  }
328
328
  x.abort(), x = new AbortController();
329
- const S = e.nodes.find((E) => E.id === k[k.length - b]);
330
- return le(S, "Undo failed: new start node not found"), h(S, A), {
331
- removed: b
329
+ const S = e.nodes.find((E) => E.id === k[k.length - y]);
330
+ return le(S, "Undo failed: new start node not found"), p(S, A), {
331
+ removed: y
332
332
  };
333
333
  },
334
334
  abort: () => {
@@ -448,7 +448,7 @@ async function Qr({
448
448
  node: t,
449
449
  analytics: r,
450
450
  submissions: n,
451
- logger: a
451
+ logger: s
452
452
  }) {
453
453
  if (!n)
454
454
  return e(t.nextId);
@@ -462,16 +462,16 @@ async function Qr({
462
462
  email: t.data.email ? Ve(n, t.data.email).toString() : void 0,
463
463
  phone_number: t.data.phoneNumber ? Ve(n, t.data.phoneNumber).toString() : void 0,
464
464
  custom_traits: t.data.customTraits ? Object.fromEntries(t.data.customTraits.map(({
465
- key: s,
465
+ key: a,
466
466
  value: i
467
467
  }) => {
468
468
  var u;
469
- return [s, (u = n[i]) == null ? void 0 : u.value];
469
+ return [a, (u = n[i]) == null ? void 0 : u.value];
470
470
  })) : void 0
471
471
  }
472
472
  });
473
- } catch (s) {
474
- a.error(s);
473
+ } catch (a) {
474
+ s.error(a);
475
475
  } finally {
476
476
  e(t.nextId);
477
477
  }
@@ -487,7 +487,7 @@ async function en({
487
487
  node: t,
488
488
  logger: r,
489
489
  submissions: n,
490
- context: a
490
+ context: s
491
491
  }) {
492
492
  if (!n) {
493
493
  r.error("Submissions not found");
@@ -497,7 +497,7 @@ async function en({
497
497
  type: "string",
498
498
  value: ne(t.data.value, {
499
499
  submissions: n,
500
- context: a
500
+ context: s
501
501
  })
502
502
  }, e(t.nextId);
503
503
  }
@@ -506,13 +506,13 @@ async function tn({
506
506
  next: t,
507
507
  node: r,
508
508
  logger: n,
509
- apiClient: a,
510
- submissions: s,
509
+ apiClient: s,
510
+ submissions: a,
511
511
  analytics: i,
512
512
  flow: u,
513
513
  t: d
514
514
  }) {
515
- const p = async (x) => {
515
+ const h = async (x) => {
516
516
  x !== !0 && await e.userInput({
517
517
  type: "submit",
518
518
  key: void 0,
@@ -524,18 +524,18 @@ async function tn({
524
524
  });
525
525
  const {
526
526
  anonymous_id: v,
527
- session_id: h
528
- } = i.getSessionInfo(), k = await a.fetch("/flow/submit", {
527
+ session_id: p
528
+ } = i.getSessionInfo(), k = await s.fetch("/flow/submit", {
529
529
  method: "POST",
530
530
  body: JSON.stringify({
531
531
  log_submit: !1,
532
532
  integration_id: r.data.integrationId,
533
533
  anonymous_id: v,
534
- session_id: h,
534
+ session_id: p,
535
535
  job: u.job,
536
- submissions: Ir(s || {})
536
+ submissions: Ir(a || {})
537
537
  })
538
- }).catch((b) => b);
538
+ }).catch((y) => y);
539
539
  r.data.key && e.addToSubmissions(r.data.key, {
540
540
  type: "integration",
541
541
  value: k
@@ -552,7 +552,7 @@ async function tn({
552
552
  data: V.any
553
553
  }
554
554
  }))
555
- }, (b) => {
555
+ }, (y) => {
556
556
  i.log({
557
557
  event: "FLOW_SUBMIT",
558
558
  properties: {
@@ -560,10 +560,10 @@ async function tn({
560
560
  flow_version: u.version,
561
561
  flow_session_id: u.data.flowSessionId,
562
562
  flow_build: u.build,
563
- service: b.service ?? "INVALID_SERVICE",
563
+ service: y.service ?? "INVALID_SERVICE",
564
564
  response: {
565
- status: b.status,
566
- payload: "data" in b ? b.data : b.error.data ?? null
565
+ status: y.status,
566
+ payload: "data" in y ? y.data : y.error.data ?? null
567
567
  },
568
568
  job: u.job
569
569
  }
@@ -583,21 +583,21 @@ async function tn({
583
583
  button_text: V.optional(V.union(V.string, V.nullish))
584
584
  })
585
585
  }
586
- }), async (b) => {
587
- if (b.redirect !== void 0) {
586
+ }), async (y) => {
587
+ if (y.redirect !== void 0) {
588
588
  await e.sendMessage({
589
589
  type: "text",
590
590
  author: "bot",
591
- text: b.redirect.message ?? d("submission_redirect_message")
591
+ text: y.redirect.message ?? d("submission_redirect_message")
592
592
  });
593
593
  try {
594
- const A = new URL(b.redirect.redirect_url);
594
+ const A = new URL(y.redirect.redirect_url);
595
595
  v && !A.searchParams.has("anonymous_id") && A.searchParams.set("anonymous_id", v), await e.sendMessage({
596
596
  type: "link",
597
597
  href: A.toString(),
598
- text: b.redirect.button_text ?? d("complete_submission"),
598
+ text: y.redirect.button_text ?? d("complete_submission"),
599
599
  onClick: () => {
600
- if (!h) {
600
+ if (!p) {
601
601
  n.error("session_id not set, cannot log FLOW_REDIRECT event");
602
602
  return;
603
603
  }
@@ -606,7 +606,7 @@ async function tn({
606
606
  properties: {
607
607
  flow_build: u.build,
608
608
  flow_id: u.id,
609
- flow_session_id: h,
609
+ flow_session_id: p,
610
610
  flow_version: u.version,
611
611
  href: A.toString(),
612
612
  job: u.job
@@ -615,7 +615,7 @@ async function tn({
615
615
  }
616
616
  });
617
617
  } catch (A) {
618
- n.error(`Invalid redirect URL: ${b.redirect.redirect_url}`, A), e.sendMessage({
618
+ n.error(`Invalid redirect URL: ${y.redirect.redirect_url}`, A), e.sendMessage({
619
619
  type: "system",
620
620
  variant: "error",
621
621
  text: d("redirect_url_error")
@@ -642,39 +642,39 @@ async function tn({
642
642
  message: V.string
643
643
  })
644
644
  }
645
- }), async (b) => {
645
+ }), async (y) => {
646
646
  var A;
647
- n.error(b.error), await e.sendMessage({
647
+ n.error(y.error), await e.sendMessage({
648
648
  type: "system",
649
649
  variant: "error",
650
- text: ((A = b.error) == null ? void 0 : A.message) || d("submission_failed")
651
- }), await p(!1);
652
- }).otherwise(async (b) => {
653
- n.error(b), await e.sendMessage({
650
+ text: ((A = y.error) == null ? void 0 : A.message) || d("submission_failed")
651
+ }), await h(!1);
652
+ }).otherwise(async (y) => {
653
+ n.error(y), await e.sendMessage({
654
654
  type: "system",
655
655
  variant: "error",
656
656
  text: d("submission_failed")
657
- }), await p(!1);
657
+ }), await h(!1);
658
658
  });
659
659
  };
660
- await p(r.data.skipConfirmation);
660
+ await h(r.data.skipConfirmation);
661
661
  }
662
662
  async function rn({
663
663
  chat: e,
664
664
  next: t,
665
665
  node: r,
666
666
  submissions: n,
667
- context: a
667
+ context: s
668
668
  }) {
669
669
  await e.sendMessage({
670
670
  type: "link",
671
671
  href: ne(r.data.href, {
672
672
  submissions: n,
673
- context: a
673
+ context: s
674
674
  }),
675
675
  text: ne(r.data.cta, {
676
676
  submissions: n,
677
- context: a
677
+ context: s
678
678
  })
679
679
  }), t(r.nextId);
680
680
  }
@@ -684,7 +684,7 @@ async function nn({
684
684
  node: r,
685
685
  context: n
686
686
  }) {
687
- t(Fe(r, {
687
+ t(Ne(r, {
688
688
  submissions: e,
689
689
  context: n
690
690
  }) ? r.branchId : r.nextId);
@@ -694,14 +694,14 @@ async function sn({
694
694
  next: t,
695
695
  node: r,
696
696
  submissions: n,
697
- context: a
697
+ context: s
698
698
  }) {
699
699
  await e.sendMessage({
700
700
  author: "bot",
701
701
  type: "text",
702
702
  text: ne(r.data.text, {
703
703
  submissions: n,
704
- context: a
704
+ context: s
705
705
  })
706
706
  }), t(r.nextId);
707
707
  }
@@ -723,15 +723,15 @@ async function on({
723
723
  next: t,
724
724
  node: r,
725
725
  submissions: n,
726
- context: a,
727
- t: s
726
+ context: s,
727
+ t: a
728
728
  }) {
729
729
  await e.sendMessage({
730
730
  author: "bot",
731
731
  type: "text",
732
732
  text: ne(r.data.question, {
733
733
  submissions: n,
734
- context: a
734
+ context: s
735
735
  })
736
736
  });
737
737
  const i = r.data.format === "phone" ? await e.userInput({
@@ -758,7 +758,7 @@ async function on({
758
758
  i === null ? await e.sendMessage({
759
759
  type: "system",
760
760
  variant: "info",
761
- text: s("skipped")
761
+ text: a("skipped")
762
762
  }) : await e.sendMessage({
763
763
  author: "user",
764
764
  type: "text",
@@ -770,15 +770,15 @@ async function ln({
770
770
  next: t,
771
771
  node: r,
772
772
  submissions: n,
773
- context: a,
774
- t: s
773
+ context: s,
774
+ t: a
775
775
  }) {
776
776
  await e.sendMessage({
777
777
  author: "bot",
778
778
  type: "text",
779
779
  text: ne(r.data.question, {
780
780
  submissions: n,
781
- context: a
781
+ context: s
782
782
  })
783
783
  });
784
784
  const i = await e.userInput({
@@ -795,7 +795,7 @@ async function ln({
795
795
  i === null ? await e.sendMessage({
796
796
  type: "system",
797
797
  variant: "info",
798
- text: s("skipped")
798
+ text: a("skipped")
799
799
  }) : await e.sendMessage({
800
800
  author: "user",
801
801
  type: "text",
@@ -807,17 +807,17 @@ async function un({
807
807
  next: t,
808
808
  node: r,
809
809
  submissions: n,
810
- context: a
810
+ context: s
811
811
  }) {
812
812
  await e.sendMessage({
813
813
  author: "bot",
814
814
  type: "text",
815
815
  text: ne(r.data.question, {
816
816
  submissions: n,
817
- context: a
817
+ context: s
818
818
  })
819
819
  });
820
- const s = await e.userInput({
820
+ const a = await e.userInput({
821
821
  key: r.data.key,
822
822
  type: "phone",
823
823
  config: {
@@ -830,14 +830,14 @@ async function un({
830
830
  optional: r.data.optional
831
831
  }
832
832
  });
833
- s === null ? await e.sendMessage({
833
+ a === null ? await e.sendMessage({
834
834
  type: "system",
835
835
  variant: "info",
836
836
  text: "Skipped"
837
837
  }) : await e.sendMessage({
838
838
  author: "user",
839
839
  type: "text",
840
- text: s.type === "phone" ? Xe(s.value) : s.value
840
+ text: a.type === "phone" ? Xe(a.value) : a.value
841
841
  }), t(r.nextId);
842
842
  }
843
843
  async function cn({
@@ -845,15 +845,15 @@ async function cn({
845
845
  next: t,
846
846
  node: r,
847
847
  submissions: n,
848
- context: a,
849
- t: s
848
+ context: s,
849
+ t: a
850
850
  }) {
851
851
  await e.sendMessage({
852
852
  author: "bot",
853
853
  type: "text",
854
854
  text: ne(r.data.question, {
855
855
  submissions: n,
856
- context: a
856
+ context: s
857
857
  })
858
858
  });
859
859
  const i = await e.userInput({
@@ -864,7 +864,7 @@ async function cn({
864
864
  i.value.length === 0 ? await e.sendMessage({
865
865
  type: "system",
866
866
  variant: "info",
867
- text: s("skipped")
867
+ text: a("skipped")
868
868
  }) : await e.sendMessage({
869
869
  author: "user",
870
870
  type: "text",
@@ -876,15 +876,15 @@ async function dn({
876
876
  next: t,
877
877
  node: r,
878
878
  submissions: n,
879
- context: a,
880
- t: s
879
+ context: s,
880
+ t: a
881
881
  }) {
882
882
  await e.sendMessage({
883
883
  author: "bot",
884
884
  type: "text",
885
885
  text: ne(r.data.question, {
886
886
  submissions: n,
887
- context: a
887
+ context: s
888
888
  })
889
889
  });
890
890
  const i = await e.userInput({
@@ -901,7 +901,7 @@ async function dn({
901
901
  i === null ? await e.sendMessage({
902
902
  type: "system",
903
903
  variant: "info",
904
- text: s("skipped")
904
+ text: a("skipped")
905
905
  }) : await e.sendMessage({
906
906
  author: "user",
907
907
  type: "text",
@@ -919,7 +919,7 @@ async function fn({
919
919
  type: "text",
920
920
  text: r.data.question
921
921
  });
922
- const a = await e.userInput({
922
+ const s = await e.userInput({
923
923
  type: "address",
924
924
  key: r.data.key,
925
925
  config: {
@@ -928,18 +928,18 @@ async function fn({
928
928
  placeholder: r.data.placeholder
929
929
  }
930
930
  });
931
- if (a === null)
931
+ if (s === null)
932
932
  await e.sendMessage({
933
933
  type: "system",
934
934
  variant: "info",
935
935
  text: n("skipped")
936
936
  });
937
937
  else {
938
- const s = Object.values(a.value).filter((i) => i && i.trim().length > 0).join(", ");
938
+ const a = Object.values(s.value).filter((i) => i && i.trim().length > 0).join(", ");
939
939
  await e.sendMessage({
940
940
  author: "user",
941
941
  type: "text",
942
- text: s
942
+ text: a
943
943
  });
944
944
  }
945
945
  return t(r.nextId);
@@ -949,15 +949,15 @@ async function hn({
949
949
  chat: t,
950
950
  next: r,
951
951
  submissions: n,
952
- context: a,
953
- t: s
952
+ context: s,
953
+ t: a
954
954
  }) {
955
955
  await t.sendMessage({
956
956
  author: "bot",
957
957
  type: "text",
958
958
  text: ne(e.data.question, {
959
959
  submissions: n,
960
- context: a
960
+ context: s
961
961
  })
962
962
  });
963
963
  const i = await t.userInput({
@@ -975,7 +975,7 @@ async function hn({
975
975
  await t.sendMessage({
976
976
  type: "system",
977
977
  variant: "info",
978
- text: s("skipped")
978
+ text: a("skipped")
979
979
  });
980
980
  else
981
981
  for (const u of i.value)
@@ -1007,47 +1007,47 @@ const ir = ({
1007
1007
  if (e === "$context") {
1008
1008
  if (!t)
1009
1009
  return;
1010
- const a = Ue(n, t.join("."));
1011
- switch (typeof a) {
1010
+ const s = Ue(n, t.join("."));
1011
+ switch (typeof s) {
1012
1012
  case "string":
1013
1013
  return {
1014
1014
  type: "string",
1015
- value: a
1015
+ value: s
1016
1016
  };
1017
1017
  case "number":
1018
1018
  return {
1019
1019
  type: "number",
1020
- value: a
1020
+ value: s
1021
1021
  };
1022
1022
  case "boolean":
1023
1023
  return {
1024
1024
  type: "boolean",
1025
- value: a
1025
+ value: s
1026
1026
  };
1027
1027
  default:
1028
- console.warn(`Unexpected type for $context.${t.join(".")}`, a);
1028
+ console.warn(`Unexpected type for $context.${t.join(".")}`, s);
1029
1029
  return;
1030
1030
  }
1031
1031
  }
1032
1032
  return r == null ? void 0 : r[e];
1033
1033
  };
1034
1034
  function ft(e, t, r) {
1035
- var n, a, s, i, u;
1035
+ var n, s, a, i, u;
1036
1036
  t == null && (t = 100);
1037
1037
  function d() {
1038
1038
  var x = Date.now() - i;
1039
- x < t && x >= 0 ? n = setTimeout(d, t - x) : (n = null, r || (u = e.apply(s, a), s = a = null));
1039
+ x < t && x >= 0 ? n = setTimeout(d, t - x) : (n = null, r || (u = e.apply(a, s), a = s = null));
1040
1040
  }
1041
- var p = function() {
1042
- s = this, a = arguments, i = Date.now();
1041
+ var h = function() {
1042
+ a = this, s = arguments, i = Date.now();
1043
1043
  var x = r && !n;
1044
- return n || (n = setTimeout(d, t)), x && (u = e.apply(s, a), s = a = null), u;
1044
+ return n || (n = setTimeout(d, t)), x && (u = e.apply(a, s), a = s = null), u;
1045
1045
  };
1046
- return p.clear = function() {
1046
+ return h.clear = function() {
1047
1047
  n && (clearTimeout(n), n = null);
1048
- }, p.flush = function() {
1049
- n && (u = e.apply(s, a), s = a = null, clearTimeout(n), n = null);
1050
- }, p;
1048
+ }, h.flush = function() {
1049
+ n && (u = e.apply(a, s), a = s = null, clearTimeout(n), n = null);
1050
+ }, h;
1051
1051
  }
1052
1052
  ft.debounce = ft;
1053
1053
  var mn = ft;
@@ -1057,15 +1057,15 @@ function gn(e) {
1057
1057
  debounce: t,
1058
1058
  scroll: r,
1059
1059
  polyfill: n,
1060
- offsetSize: a
1060
+ offsetSize: s
1061
1061
  } = e === void 0 ? {
1062
1062
  debounce: 0,
1063
1063
  scroll: !1,
1064
1064
  offsetSize: !1
1065
1065
  } : e;
1066
- const s = n || (typeof window > "u" ? class {
1066
+ const a = n || (typeof window > "u" ? class {
1067
1067
  } : window.ResizeObserver);
1068
- if (!s)
1068
+ if (!a)
1069
1069
  throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
1070
1070
  const [i, u] = Y({
1071
1071
  left: 0,
@@ -1081,9 +1081,9 @@ function gn(e) {
1081
1081
  scrollContainers: null,
1082
1082
  resizeObserver: null,
1083
1083
  lastBounds: i
1084
- }), p = t ? typeof t == "number" ? t : t.scroll : null, x = t ? typeof t == "number" ? t : t.resize : null, v = re(!1);
1084
+ }), h = t ? typeof t == "number" ? t : t.scroll : null, x = t ? typeof t == "number" ? t : t.resize : null, v = re(!1);
1085
1085
  ue(() => (v.current = !0, () => void (v.current = !1)));
1086
- const [h, k, b] = pt(() => {
1086
+ const [p, k, y] = pt(() => {
1087
1087
  const g = () => {
1088
1088
  if (!d.current.element)
1089
1089
  return;
@@ -1106,15 +1106,15 @@ function gn(e) {
1106
1106
  x: H,
1107
1107
  y: se
1108
1108
  };
1109
- d.current.element instanceof HTMLElement && a && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), v.current && !xn(d.current.lastBounds, q) && u(d.current.lastBounds = q);
1109
+ d.current.element instanceof HTMLElement && s && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), v.current && !xn(d.current.lastBounds, q) && u(d.current.lastBounds = q);
1110
1110
  };
1111
- return [g, x ? Nt(g, x) : g, p ? Nt(g, p) : g];
1112
- }, [u, a, p, x]);
1111
+ return [g, x ? Nt(g, x) : g, h ? Nt(g, h) : g];
1112
+ }, [u, s, h, x]);
1113
1113
  function A() {
1114
- d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll", b, !0)), d.current.scrollContainers = null), d.current.resizeObserver && (d.current.resizeObserver.disconnect(), d.current.resizeObserver = null);
1114
+ d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll", y, !0)), d.current.scrollContainers = null), d.current.resizeObserver && (d.current.resizeObserver.disconnect(), d.current.resizeObserver = null);
1115
1115
  }
1116
1116
  function S() {
1117
- d.current.element && (d.current.resizeObserver = new s(b), d.current.resizeObserver.observe(d.current.element), r && d.current.scrollContainers && d.current.scrollContainers.forEach((g) => g.addEventListener("scroll", b, {
1117
+ d.current.element && (d.current.resizeObserver = new a(y), d.current.resizeObserver.observe(d.current.element), r && d.current.scrollContainers && d.current.scrollContainers.forEach((g) => g.addEventListener("scroll", y, {
1118
1118
  capture: !0,
1119
1119
  passive: !0
1120
1120
  })));
@@ -1122,17 +1122,17 @@ function gn(e) {
1122
1122
  const E = (g) => {
1123
1123
  !g || g === d.current.element || (A(), d.current.element = g, d.current.scrollContainers = or(g), S());
1124
1124
  };
1125
- return bn(b, !!r), yn(k), ue(() => {
1125
+ return yn(y, !!r), bn(k), ue(() => {
1126
1126
  A(), S();
1127
- }, [r, b, k]), ue(() => A, []), [E, i, h];
1127
+ }, [r, y, k]), ue(() => A, []), [E, i, p];
1128
1128
  }
1129
- function yn(e) {
1129
+ function bn(e) {
1130
1130
  ue(() => {
1131
1131
  const t = e;
1132
1132
  return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
1133
1133
  }, [e]);
1134
1134
  }
1135
- function bn(e, t) {
1135
+ function yn(e, t) {
1136
1136
  ue(() => {
1137
1137
  if (t) {
1138
1138
  const r = e;
@@ -1150,11 +1150,11 @@ function or(e) {
1150
1150
  const {
1151
1151
  overflow: r,
1152
1152
  overflowX: n,
1153
- overflowY: a
1153
+ overflowY: s
1154
1154
  } = window.getComputedStyle(e);
1155
- return [r, n, a].some((s) => s === "auto" || s === "scroll") && t.push(e), [...t, ...or(e.parentElement)];
1155
+ return [r, n, s].some((a) => a === "auto" || a === "scroll") && t.push(e), [...t, ...or(e.parentElement)];
1156
1156
  }
1157
- const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn = (e, t) => vn.every((r) => e[r] === t[r]), be = ({
1157
+ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn = (e, t) => vn.every((r) => e[r] === t[r]), ye = ({
1158
1158
  class: e,
1159
1159
  ...t
1160
1160
  }) => {
@@ -1162,7 +1162,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1162
1162
  t: r
1163
1163
  } = G();
1164
1164
  return l("button", {
1165
- class: Te("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
1165
+ class: De("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
1166
1166
  type: "submit",
1167
1167
  ...t,
1168
1168
  children: l("svg", {
@@ -1216,39 +1216,39 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1216
1216
  };
1217
1217
  }, [e]);
1218
1218
  const t = pt(() => ({
1219
- addToSubmissions: (n, a) => M.setSubmission(n, a),
1219
+ addToSubmissions: (n, s) => M.setSubmission(n, s),
1220
1220
  send: async ({
1221
1221
  message: n,
1222
- signal: a,
1223
- groupId: s
1222
+ signal: s,
1223
+ groupId: a
1224
1224
  }) => {
1225
1225
  if (await Ke(n).with({
1226
1226
  author: "bot",
1227
1227
  type: "text"
1228
1228
  }, async (i) => {
1229
- if (a != null && a.aborted)
1230
- throw new Me();
1229
+ if (s != null && s.aborted)
1230
+ throw new Fe();
1231
1231
  z.isBotTyping$.value = !0;
1232
1232
  const u = Math.min(Math.max(20, i.text.length), 100) * wn;
1233
1233
  await new Promise((d) => setTimeout(d, u, {
1234
- signal: a
1234
+ signal: s
1235
1235
  })), z.isBotTyping$.value = !1;
1236
1236
  }).otherwise(async () => {
1237
- }), a != null && a.aborted)
1238
- throw new Me();
1239
- M.addMessage(n, s);
1237
+ }), s != null && s.aborted)
1238
+ throw new Fe();
1239
+ M.addMessage(n, a);
1240
1240
  },
1241
1241
  input: ({
1242
1242
  input: n,
1243
- signal: a
1243
+ signal: s
1244
1244
  }) => {
1245
- if (a != null && a.aborted)
1246
- throw new Me();
1247
- return M.setInput(n), new Promise((s) => {
1245
+ if (s != null && s.aborted)
1246
+ throw new Fe();
1247
+ return M.setInput(n), new Promise((a) => {
1248
1248
  const i = (u) => {
1249
- if (a != null && a.aborted)
1250
- throw new Me();
1251
- M.setInput(void 0), n.key && M.setSubmission(n.key, u), s(u);
1249
+ if (s != null && s.aborted)
1250
+ throw new Fe();
1251
+ M.setInput(void 0), n.key && M.setSubmission(n.key, u), a(u);
1252
1252
  };
1253
1253
  z.onSubmitSuccessFn$.value = i;
1254
1254
  });
@@ -1300,7 +1300,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1300
1300
  } = G();
1301
1301
  return l("button", {
1302
1302
  type: "button",
1303
- class: Te("fr text-neutral-9 flex flex-shrink-0 items-center justify-center gap-1 rounded-full py-[6px] pl-2 pr-3 text-sm underline-offset-2 transition-all", e),
1303
+ class: De("fr text-neutral-9 flex flex-shrink-0 items-center justify-center gap-1 rounded-full py-[6px] pl-2 pr-3 text-sm underline-offset-2 transition-all", e),
1304
1304
  ...t,
1305
1305
  children: [l("svg", {
1306
1306
  "aria-hidden": !0,
@@ -1569,7 +1569,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1569
1569
  Zambia: "260",
1570
1570
  Zimbabwe: "263",
1571
1571
  "Åland Islands": "358"
1572
- }, De = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
1572
+ }, Re = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
1573
1573
  variants: {
1574
1574
  optional: {
1575
1575
  true: "pr-16 pl-3",
@@ -1607,10 +1607,10 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1607
1607
  const r = (n = M.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
1608
1608
  return r ? {
1609
1609
  enabled: !0,
1610
- getPredictions: async (a) => {
1611
- const s = new URL(kn);
1612
- s.searchParams.set("q", a), s.searchParams.set("session_token", r), s.searchParams.set("access_token", Cn(Sn));
1613
- const i = await fetch(s);
1610
+ getPredictions: async (s) => {
1611
+ const a = new URL(kn);
1612
+ a.searchParams.set("q", s), a.searchParams.set("session_token", r), a.searchParams.set("access_token", Cn(Sn));
1613
+ const i = await fetch(a);
1614
1614
  if (!i.ok)
1615
1615
  return e.error("Failed to get address details", i), {
1616
1616
  ok: !1,
@@ -1627,19 +1627,19 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1627
1627
  } = u.output;
1628
1628
  return {
1629
1629
  ok: !0,
1630
- data: d.map((p) => {
1631
- var x, v, h, k, b, A, S, E, g;
1630
+ data: d.map((h) => {
1631
+ var x, v, p, k, y, A, S, E, g;
1632
1632
  return {
1633
- label: p.full_address ?? p.place_formatted ?? p.name ?? p.mapbox_id,
1634
- id: p.mapbox_id,
1633
+ label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
1634
+ id: h.mapbox_id,
1635
1635
  address: {
1636
- line1: ((x = p.context.address) == null ? void 0 : x.name) ?? ((v = p.context.street) == null ? void 0 : v.name),
1636
+ line1: ((x = h.context.address) == null ? void 0 : x.name) ?? ((v = h.context.street) == null ? void 0 : v.name),
1637
1637
  line2: void 0,
1638
- line3: ((h = p.context.neighborhood) == null ? void 0 : h.name) ?? ((k = p.context.locality) == null ? void 0 : k.name),
1639
- city: ((b = p.context.place) == null ? void 0 : b.name) ?? ((A = p.context.district) == null ? void 0 : A.name),
1640
- state: (S = p.context.region) == null ? void 0 : S.name,
1641
- postcode: (E = p.context.postcode) == null ? void 0 : E.name,
1642
- country: (g = p.context.country) == null ? void 0 : g.name
1638
+ line3: ((p = h.context.neighborhood) == null ? void 0 : p.name) ?? ((k = h.context.locality) == null ? void 0 : k.name),
1639
+ city: ((y = h.context.place) == null ? void 0 : y.name) ?? ((A = h.context.district) == null ? void 0 : A.name),
1640
+ state: (S = h.context.region) == null ? void 0 : S.name,
1641
+ postcode: (E = h.context.postcode) == null ? void 0 : E.name,
1642
+ country: (g = h.context.country) == null ? void 0 : g.name
1643
1643
  }
1644
1644
  };
1645
1645
  })
@@ -1678,14 +1678,14 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1678
1678
  }) => {
1679
1679
  const {
1680
1680
  t: n
1681
- } = G(), [a, s] = Y(), [i, u] = Y([]), {
1681
+ } = G(), [s, a] = Y(), [i, u] = Y([]), {
1682
1682
  enabled: d,
1683
- getPredictions: p
1683
+ getPredictions: h
1684
1684
  } = An({
1685
1685
  logger: r,
1686
1686
  t: n
1687
- }), [x, v] = Y(d ? "query" : "manual"), [h, k] = Y(""), [b, A] = Y(), S = (E) => {
1688
- le(d, "Query state should not be enabled"), E = E.trim(), E !== (h == null ? void 0 : h.trim()) && (k(E), E === "" && u([]), A(void 0), p(E).then((g) => {
1687
+ }), [x, v] = Y(d ? "query" : "manual"), [p, k] = Y(""), [y, A] = Y(), S = (E) => {
1688
+ le(d, "Query state should not be enabled"), E = E.trim(), E !== (p == null ? void 0 : p.trim()) && (k(E), E === "" && u([]), A(void 0), h(E).then((g) => {
1689
1689
  if (g.ok === !1) {
1690
1690
  u([]), A(g.error);
1691
1691
  return;
@@ -1700,25 +1700,25 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1700
1700
  onSkip: () => t(null),
1701
1701
  onAddressSelect: (E) => {
1702
1702
  if (E === "") {
1703
- s(void 0), v("manual");
1703
+ a(void 0), v("manual");
1704
1704
  return;
1705
1705
  }
1706
1706
  const g = i.find((N) => N.id === E);
1707
- g && (s(g.address), v("details"));
1707
+ g && (a(g.address), v("details"));
1708
1708
  },
1709
1709
  onAddressSearch: (E) => {
1710
1710
  S(E);
1711
1711
  },
1712
1712
  suggestions: i,
1713
- query: h,
1714
- error: b
1713
+ query: p,
1714
+ error: y
1715
1715
  });
1716
1716
  case "details":
1717
- return le(a !== void 0), l(Dt, {
1717
+ return le(s !== void 0), l(Dt, {
1718
1718
  input: e,
1719
1719
  logger: r,
1720
1720
  onSubmitSuccess: t,
1721
- addressFields: a,
1721
+ addressFields: s,
1722
1722
  actions: l(Lt, {
1723
1723
  onClick: () => {
1724
1724
  v("query");
@@ -1743,8 +1743,8 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1743
1743
  onSkip: t,
1744
1744
  suggestions: r,
1745
1745
  onAddressSelect: n,
1746
- query: a,
1747
- onAddressSearch: s,
1746
+ query: s,
1747
+ onAddressSearch: a,
1748
1748
  error: i
1749
1749
  }) => {
1750
1750
  const {
@@ -1755,10 +1755,10 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1755
1755
  }, []), l(ke, {
1756
1756
  children: [l("form", {
1757
1757
  noValidate: !0,
1758
- onSubmit: (p) => {
1759
- p.preventDefault();
1760
- const v = new FormData(p.currentTarget).get("address");
1761
- typeof v == "string" && s(v);
1758
+ onSubmit: (h) => {
1759
+ h.preventDefault();
1760
+ const v = new FormData(h.currentTarget).get("address");
1761
+ typeof v == "string" && a(v);
1762
1762
  },
1763
1763
  class: "flex gap-1 p-2.5",
1764
1764
  children: [l("div", {
@@ -1770,8 +1770,8 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1770
1770
  autocomplete: "address-line1 country-name postal-code",
1771
1771
  autoFocus: !0,
1772
1772
  placeholder: e.config.placeholder || u("address_search"),
1773
- defaultValue: a,
1774
- class: De({
1773
+ defaultValue: s,
1774
+ class: Re({
1775
1775
  optional: !!e.config.optional,
1776
1776
  className: "w-full rounded-full"
1777
1777
  })
@@ -1812,15 +1812,15 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1812
1812
  message: i
1813
1813
  }
1814
1814
  }) : null, l("ul", {
1815
- children: [r.map((p) => l("li", {
1815
+ children: [r.map((h) => l("li", {
1816
1816
  children: l("button", {
1817
1817
  class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
1818
1818
  onClick: () => {
1819
- n(p.id);
1819
+ n(h.id);
1820
1820
  },
1821
1821
  children: [l("span", {
1822
1822
  class: "flex-grow",
1823
- children: p.label
1823
+ children: h.label
1824
1824
  }), l("svg", {
1825
1825
  class: "flex-none",
1826
1826
  width: "16",
@@ -1835,7 +1835,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1835
1835
  })
1836
1836
  })]
1837
1837
  })
1838
- }, p.id)), l("li", {
1838
+ }, h.id)), l("li", {
1839
1839
  children: l("button", {
1840
1840
  class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
1841
1841
  onClick: () => {
@@ -1855,33 +1855,33 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1855
1855
  actions: r,
1856
1856
  input: n
1857
1857
  }) => {
1858
- const a = re(null);
1858
+ const s = re(null);
1859
1859
  pe(() => {
1860
- if (a.current) {
1861
- const u = a.current.querySelector("input");
1860
+ if (s.current) {
1861
+ const u = s.current.querySelector("input");
1862
1862
  u && (u.focus(), u.select());
1863
1863
  }
1864
1864
  }, []);
1865
- const s = Object.keys(mt), {
1865
+ const a = Object.keys(mt), {
1866
1866
  t: i
1867
1867
  } = G();
1868
1868
  return l("form", {
1869
1869
  class: "bg-neutral-1/90 flex flex-col justify-end gap-2 p-2",
1870
1870
  onSubmit: (u) => {
1871
- const d = new FormData(u.currentTarget), p = Object.fromEntries(d.entries());
1871
+ const d = new FormData(u.currentTarget), h = Object.fromEntries(d.entries());
1872
1872
  t({
1873
1873
  type: "address",
1874
- value: p
1874
+ value: h
1875
1875
  });
1876
1876
  },
1877
1877
  children: [l("div", {
1878
1878
  class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
1879
- ref: a,
1879
+ ref: s,
1880
1880
  children: Tt.map((u, d) => {
1881
- const p = `isdk_${u}`, x = n.config.keys[u];
1881
+ const h = `isdk_${u}`, x = n.config.keys[u];
1882
1882
  return x ? l(ke, {
1883
1883
  children: [l("label", {
1884
- for: p,
1884
+ for: h,
1885
1885
  class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
1886
1886
  children: i(u)
1887
1887
  }), l("div", {
@@ -1891,16 +1891,16 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1891
1891
  children: [l("select", {
1892
1892
  class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
1893
1893
  name: x,
1894
- id: p,
1894
+ id: h,
1895
1895
  defaultValue: e[u],
1896
1896
  required: !0,
1897
- children: [e.country && !s.includes(e.country) ? l("option", {
1897
+ children: [e.country && !a.includes(e.country) ? l("option", {
1898
1898
  value: e[u],
1899
1899
  children: e[u]
1900
1900
  }) : l("option", {
1901
1901
  value: "",
1902
1902
  children: i("select_country")
1903
- }), s.map((v) => l("option", {
1903
+ }), a.map((v) => l("option", {
1904
1904
  value: v,
1905
1905
  children: v
1906
1906
  }, v))]
@@ -1923,7 +1923,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1923
1923
  autoFocus: d === 0 ? !0 : void 0,
1924
1924
  class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
1925
1925
  name: x,
1926
- id: p,
1926
+ id: h,
1927
1927
  defaultValue: e[u],
1928
1928
  required: !0
1929
1929
  }), d === Tt.length - 1 ? l("hr", {
@@ -1939,7 +1939,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1939
1939
  children: [l("div", {
1940
1940
  class: "flex-grow",
1941
1941
  children: r
1942
- }), l(be, {
1942
+ }), l(ye, {
1943
1943
  class: "flex items-center justify-center"
1944
1944
  })]
1945
1945
  })]
@@ -1971,18 +1971,18 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
1971
1971
  class: "",
1972
1972
  onSubmit: (n) => {
1973
1973
  n.preventDefault();
1974
- const a = Lr(n).value, s = nr(Mn, a);
1974
+ const s = Lr(n).value, a = nr(Mn, s);
1975
1975
  t({
1976
1976
  type: "boolean",
1977
- value: s === "true"
1977
+ value: a === "true"
1978
1978
  });
1979
1979
  },
1980
1980
  children: [l("ul", {
1981
1981
  class: ur,
1982
- children: lr.map((n, a) => l("li", {
1982
+ children: lr.map((n, s) => l("li", {
1983
1983
  class: "flex-1",
1984
1984
  children: l(cr, {
1985
- ref: a === 0 ? r : null,
1985
+ ref: s === 0 ? r : null,
1986
1986
  type: "submit",
1987
1987
  name: Fn,
1988
1988
  value: n,
@@ -2006,30 +2006,30 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2006
2006
  class: t,
2007
2007
  ...r
2008
2008
  }) => {
2009
- const n = e.name.split(".").pop(), a = e.name.replace(new RegExp(`.${n}$`), "");
2009
+ const n = e.name.split(".").pop(), s = e.name.replace(new RegExp(`.${n}$`), "");
2010
2010
  return l("div", {
2011
- class: Te("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", t),
2011
+ class: De("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", t),
2012
2012
  ...r,
2013
2013
  children: [l("p", {
2014
2014
  "aria-label": "File name",
2015
2015
  class: "text-accent-12 flex flex-grow overflow-hidden",
2016
2016
  children: [l("span", {
2017
2017
  class: "block truncate",
2018
- children: a
2018
+ children: s
2019
2019
  }), l("span", {
2020
2020
  children: [".", n]
2021
2021
  })]
2022
2022
  }), l("p", {
2023
2023
  "aria-label": "File size",
2024
2024
  class: "text-accent-11",
2025
- children: Ne(e.sizeKb)
2025
+ children: Le(e.sizeKb)
2026
2026
  })]
2027
2027
  });
2028
2028
  }, Ot = ({
2029
2029
  class: e,
2030
2030
  ...t
2031
2031
  }) => l("li", {
2032
- class: Te("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
2032
+ class: De("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
2033
2033
  ...t
2034
2034
  }), dr = (e) => {
2035
2035
  const t = e.split(".").pop();
@@ -2050,12 +2050,12 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2050
2050
  onSubmitSuccess: t
2051
2051
  }) => {
2052
2052
  var v;
2053
- const r = (v = M.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, a] = Y(Dn(r) ? r.value : []), [s, i] = Y(), u = n.length - Rt, d = Tn(n), p = gt(), {
2053
+ const r = (v = M.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, s] = Y(Dn(r) ? r.value : []), [a, i] = Y(), u = n.length - Rt, d = Tn(n), h = gt(), {
2054
2054
  t: x
2055
2055
  } = G();
2056
2056
  return l("form", {
2057
2057
  class: "flex flex-col gap-1 p-2.5",
2058
- onSubmit: (h) => (h.preventDefault(), i(void 0), n.length === 0 ? i({
2058
+ onSubmit: (p) => (p.preventDefault(), i(void 0), n.length === 0 ? i({
2059
2059
  type: "required",
2060
2060
  message: x("validation_file")
2061
2061
  }) : e.config.extensions.length > 0 && !On({
@@ -2068,7 +2068,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2068
2068
  })}`
2069
2069
  }) : e.config.fileSizeLimitKib && d > e.config.fileSizeLimitKib ? i({
2070
2070
  type: "max",
2071
- message: `File size exceeds limit of ${Ne(e.config.fileSizeLimitKib)}`
2071
+ message: `File size exceeds limit of ${Le(e.config.fileSizeLimitKib)}`
2072
2072
  }) : e.config.allowMultiple === !1 && n.length > 1 ? i({
2073
2073
  type: "invalid",
2074
2074
  message: x("validation_file_max", {
@@ -2081,19 +2081,19 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2081
2081
  children: [l("div", {
2082
2082
  class: "flex items-center gap-2",
2083
2083
  children: [l("label", {
2084
- ref: p,
2084
+ ref: h,
2085
2085
  for: "dropzone-file",
2086
2086
  class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
2087
2087
  children: [n.length > 0 ? l(ke, {
2088
2088
  children: [l("ul", {
2089
2089
  class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
2090
- children: [n.slice(0, Rt).map((h) => {
2091
- const k = h.name.split(".").pop(), b = h.name.replace(new RegExp(`.${k}$`), "");
2090
+ children: [n.slice(0, Rt).map((p) => {
2091
+ const k = p.name.split(".").pop(), y = p.name.replace(new RegExp(`.${k}$`), "");
2092
2092
  return l(Ot, {
2093
2093
  class: "flex overflow-hidden",
2094
2094
  children: [l("span", {
2095
2095
  class: "block truncate",
2096
- children: b
2096
+ children: y
2097
2097
  }), l("span", {
2098
2098
  children: [".", k]
2099
2099
  })]
@@ -2103,7 +2103,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2103
2103
  }) : null]
2104
2104
  }), l("p", {
2105
2105
  class: "text-neutral-11 text-xs",
2106
- children: [Ne(d), " ", n.length > 1 ? "total" : ""]
2106
+ children: [Le(d), " ", n.length > 1 ? "total" : ""]
2107
2107
  })]
2108
2108
  }) : l("div", {
2109
2109
  class: "flex flex-col justify-center gap-4 pb-6 pt-5",
@@ -2130,7 +2130,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2130
2130
  }), e.config.fileSizeLimitKib ? l("p", {
2131
2131
  class: "text-neutral-10 text-xs",
2132
2132
  children: ["(", x("file_max_size", {
2133
- size: Ne(e.config.fileSizeLimitKib)
2133
+ size: Le(e.config.fileSizeLimitKib)
2134
2134
  }), ")"]
2135
2135
  }) : null]
2136
2136
  }), l("aside", {
@@ -2142,17 +2142,17 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2142
2142
  }), l("ul", {
2143
2143
  "aria-describedby": "accepted-filetypes",
2144
2144
  class: "flex flex-wrap justify-center gap-2",
2145
- children: e.config.extensions.map((h) => l("li", {
2145
+ children: e.config.extensions.map((p) => l("li", {
2146
2146
  class: "ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",
2147
- children: h.replace(".", "")
2147
+ children: p.replace(".", "")
2148
2148
  }))
2149
2149
  })]
2150
2150
  })]
2151
2151
  }), l("input", {
2152
2152
  id: "dropzone-file",
2153
- onInput: async (h) => {
2154
- le(h.target instanceof HTMLInputElement);
2155
- const k = h.target.files ? Array.from(h.target.files) : [], b = await Promise.allSettled(k.map(async (S) => {
2153
+ onInput: async (p) => {
2154
+ le(p.target instanceof HTMLInputElement);
2155
+ const k = p.target.files ? Array.from(p.target.files) : [], y = await Promise.allSettled(k.map(async (S) => {
2156
2156
  const E = await Ln(S);
2157
2157
  return {
2158
2158
  name: Bn(S.name, 42),
@@ -2160,15 +2160,15 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2160
2160
  sizeKb: S.size / 1e3
2161
2161
  };
2162
2162
  }));
2163
- if (b.some(({
2163
+ if (y.some(({
2164
2164
  status: S
2165
2165
  }) => S === "rejected"))
2166
2166
  return i({
2167
2167
  type: "invalid",
2168
2168
  message: "Invalid file"
2169
2169
  });
2170
- const A = b.map((S) => S.status === "fulfilled" ? S.value : null).filter(Boolean);
2171
- a(A);
2170
+ const A = y.map((S) => S.status === "fulfilled" ? S.value : null).filter(Boolean);
2171
+ s(A);
2172
2172
  },
2173
2173
  multiple: e.config.allowMultiple,
2174
2174
  type: "file",
@@ -2176,23 +2176,23 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
2176
2176
  })]
2177
2177
  }), l("div", {
2178
2178
  class: "flex h-full flex-col items-center gap-2",
2179
- children: [l(be, {
2179
+ children: [l(ye, {
2180
2180
  disabled: n.length === 0
2181
2181
  }), e.config.optional && l(ve, {
2182
2182
  onClick: () => t(null)
2183
2183
  })]
2184
2184
  })]
2185
2185
  }), l(Ce, {
2186
- error: s
2186
+ error: a
2187
2187
  })]
2188
2188
  });
2189
2189
  };
2190
- var Re = (e) => e.type === "checkbox", _e = (e) => e instanceof Date, U = (e) => e == null;
2190
+ var Oe = (e) => e.type === "checkbox", _e = (e) => e instanceof Date, U = (e) => e == null;
2191
2191
  const fr = (e) => typeof e == "object";
2192
- var $ = (e) => !U(e) && !Array.isArray(e) && fr(e) && !_e(e), $n = (e) => $(e) && e.target ? Re(e.target) ? e.target.checked : e.target.value : e, jn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, zn = (e, t) => e.has(jn(t)), qn = (e) => {
2192
+ var $ = (e) => !U(e) && !Array.isArray(e) && fr(e) && !_e(e), $n = (e) => $(e) && e.target ? Oe(e.target) ? e.target.checked : e.target.value : e, jn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, zn = (e, t) => e.has(jn(t)), qn = (e) => {
2193
2193
  const t = e.constructor && e.constructor.prototype;
2194
2194
  return $(t) && t.hasOwnProperty("isPrototypeOf");
2195
- }, yt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2195
+ }, bt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2196
2196
  function oe(e) {
2197
2197
  let t;
2198
2198
  const r = Array.isArray(e);
@@ -2200,7 +2200,7 @@ function oe(e) {
2200
2200
  t = new Date(e);
2201
2201
  else if (e instanceof Set)
2202
2202
  t = new Set(e);
2203
- else if (!(yt && (e instanceof Blob || e instanceof FileList)) && (r || $(e)))
2203
+ else if (!(bt && (e instanceof Blob || e instanceof FileList)) && (r || $(e)))
2204
2204
  if (t = r ? [] : {}, !r && !qn(e))
2205
2205
  t = e;
2206
2206
  else
@@ -2210,10 +2210,10 @@ function oe(e) {
2210
2210
  return e;
2211
2211
  return t;
2212
2212
  }
2213
- var Oe = (e) => Array.isArray(e) ? e.filter(Boolean) : [], O = (e) => e === void 0, w = (e, t, r) => {
2213
+ var Be = (e) => Array.isArray(e) ? e.filter(Boolean) : [], O = (e) => e === void 0, w = (e, t, r) => {
2214
2214
  if (!t || !$(e))
2215
2215
  return r;
2216
- const n = Oe(t.split(/[,[\].]+?/)).reduce((a, s) => U(a) ? a : a[s], e);
2216
+ const n = Be(t.split(/[,[\].]+?/)).reduce((s, a) => U(s) ? s : s[a], e);
2217
2217
  return O(n) || n === e ? O(e[t]) ? r : e[t] : n;
2218
2218
  }, de = (e) => typeof e == "boolean";
2219
2219
  const Bt = {
@@ -2237,21 +2237,21 @@ const Bt = {
2237
2237
  };
2238
2238
  Q.createContext(null);
2239
2239
  var Un = (e, t, r, n = !0) => {
2240
- const a = {
2240
+ const s = {
2241
2241
  defaultValues: t._defaultValues
2242
2242
  };
2243
- for (const s in e)
2244
- Object.defineProperty(a, s, {
2243
+ for (const a in e)
2244
+ Object.defineProperty(s, a, {
2245
2245
  get: () => {
2246
- const i = s;
2246
+ const i = a;
2247
2247
  return t._proxyFormState[i] !== Z.all && (t._proxyFormState[i] = !n || Z.all), r && (r[i] = !0), e[i];
2248
2248
  }
2249
2249
  });
2250
- return a;
2250
+ return s;
2251
2251
  }, J = (e) => $(e) && !Object.keys(e).length, Kn = (e, t, r, n) => {
2252
2252
  r(e);
2253
- const { name: a, ...s } = e;
2254
- return J(s) || Object.keys(s).length >= Object.keys(t).length || Object.keys(s).find((i) => t[i] === (!n || Z.all));
2253
+ const { name: s, ...a } = e;
2254
+ return J(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((i) => t[i] === (!n || Z.all));
2255
2255
  }, it = (e) => Array.isArray(e) ? e : [e];
2256
2256
  function Gn(e) {
2257
2257
  const t = Q.useRef(e);
@@ -2264,26 +2264,26 @@ function Gn(e) {
2264
2264
  };
2265
2265
  }, [e.disabled]);
2266
2266
  }
2267
- var te = (e) => typeof e == "string", Hn = (e, t, r, n, a) => te(e) ? (n && t.watch.add(e), w(r, e, a)) : Array.isArray(e) ? e.map((s) => (n && t.watch.add(s), w(r, s))) : (n && (t.watchAll = !0), r), bt = (e) => /^\w*$/.test(e), hr = (e) => Oe(e.replace(/["|']|\]/g, "").split(/\.|\[/));
2267
+ var te = (e) => typeof e == "string", Hn = (e, t, r, n, s) => te(e) ? (n && t.watch.add(e), w(r, e, s)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), w(r, a))) : (n && (t.watchAll = !0), r), yt = (e) => /^\w*$/.test(e), hr = (e) => Be(e.replace(/["|']|\]/g, "").split(/\.|\[/));
2268
2268
  function L(e, t, r) {
2269
2269
  let n = -1;
2270
- const a = bt(t) ? [t] : hr(t), s = a.length, i = s - 1;
2271
- for (; ++n < s; ) {
2272
- const u = a[n];
2270
+ const s = yt(t) ? [t] : hr(t), a = s.length, i = a - 1;
2271
+ for (; ++n < a; ) {
2272
+ const u = s[n];
2273
2273
  let d = r;
2274
2274
  if (n !== i) {
2275
- const p = e[u];
2276
- d = $(p) || Array.isArray(p) ? p : isNaN(+a[n + 1]) ? {} : [];
2275
+ const h = e[u];
2276
+ d = $(h) || Array.isArray(h) ? h : isNaN(+s[n + 1]) ? {} : [];
2277
2277
  }
2278
2278
  e[u] = d, e = e[u];
2279
2279
  }
2280
2280
  return e;
2281
2281
  }
2282
- var pr = (e, t, r, n, a) => t ? {
2282
+ var pr = (e, t, r, n, s) => t ? {
2283
2283
  ...r[e],
2284
2284
  types: {
2285
2285
  ...r[e] && r[e].types ? r[e].types : {},
2286
- [n]: a || !0
2286
+ [n]: s || !0
2287
2287
  }
2288
2288
  } : {}, Pt = (e) => ({
2289
2289
  isOnSubmit: !e || e === Z.onSubmit,
@@ -2293,12 +2293,12 @@ var pr = (e, t, r, n, a) => t ? {
2293
2293
  isOnTouch: e === Z.onTouched
2294
2294
  }), $t = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
2295
2295
  const ze = (e, t, r, n) => {
2296
- for (const a of r || Object.keys(e)) {
2297
- const s = w(e, a);
2298
- if (s) {
2299
- const { _f: i, ...u } = s;
2296
+ for (const s of r || Object.keys(e)) {
2297
+ const a = w(e, s);
2298
+ if (a) {
2299
+ const { _f: i, ...u } = a;
2300
2300
  if (i) {
2301
- if (i.refs && i.refs[0] && t(i.refs[0], a) && !n)
2301
+ if (i.refs && i.refs[0] && t(i.refs[0], s) && !n)
2302
2302
  break;
2303
2303
  if (i.ref && t(i.ref, i.name) && !n)
2304
2304
  break;
@@ -2308,10 +2308,10 @@ const ze = (e, t, r, n) => {
2308
2308
  }
2309
2309
  };
2310
2310
  var Wn = (e, t, r) => {
2311
- const n = Oe(w(e, r));
2311
+ const n = Be(w(e, r));
2312
2312
  return L(n, "root", t[r]), L(e, r, n), e;
2313
2313
  }, vt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ge = (e) => {
2314
- if (!yt)
2314
+ if (!bt)
2315
2315
  return !1;
2316
2316
  const t = e ? e.ownerDocument : 0;
2317
2317
  return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
@@ -2352,24 +2352,24 @@ function Ut(e, t, r = "validate") {
2352
2352
  var we = (e) => $(e) && !He(e) ? e : {
2353
2353
  value: e,
2354
2354
  message: ""
2355
- }, Kt = async (e, t, r, n, a) => {
2356
- const { ref: s, refs: i, required: u, maxLength: d, minLength: p, min: x, max: v, pattern: h, validate: k, name: b, valueAsNumber: A, mount: S, disabled: E } = e._f, g = w(t, b);
2355
+ }, Kt = async (e, t, r, n, s) => {
2356
+ const { ref: a, refs: i, required: u, maxLength: d, minLength: h, min: x, max: v, pattern: p, validate: k, name: y, valueAsNumber: A, mount: S, disabled: E } = e._f, g = w(t, y);
2357
2357
  if (!S || E)
2358
2358
  return {};
2359
- const N = i ? i[0] : s, P = (F) => {
2359
+ const N = i ? i[0] : a, P = (F) => {
2360
2360
  n && N.reportValidity && (N.setCustomValidity(de(F) ? "" : F || ""), N.reportValidity());
2361
- }, D = {}, me = xt(s), ce = Re(s), Ee = me || ce, H = (A || vt(s)) && O(s.value) && O(g) || Ge(s) && s.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null, b, r, D), q = (F, I, R, K = ie.maxLength, W = ie.minLength) => {
2361
+ }, D = {}, me = xt(a), ce = Oe(a), Ee = me || ce, H = (A || vt(a)) && O(a.value) && O(g) || Ge(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null, y, r, D), q = (F, I, R, K = ie.maxLength, W = ie.minLength) => {
2362
2362
  const X = F ? I : R;
2363
- D[b] = {
2363
+ D[y] = {
2364
2364
  type: F ? K : W,
2365
2365
  message: X,
2366
- ref: s,
2366
+ ref: a,
2367
2367
  ...se(F ? K : W, X)
2368
2368
  };
2369
2369
  };
2370
- if (a ? !Array.isArray(g) || !g.length : u && (!Ee && (H || U(g)) || de(g) && !g || ce && !mr(i).isValid || me && !gr(i).isValid)) {
2370
+ if (s ? !Array.isArray(g) || !g.length : u && (!Ee && (H || U(g)) || de(g) && !g || ce && !mr(i).isValid || me && !gr(i).isValid)) {
2371
2371
  const { value: F, message: I } = qe(u) ? { value: !!u, message: u } : we(u);
2372
- if (F && (D[b] = {
2372
+ if (F && (D[y] = {
2373
2373
  type: ie.required,
2374
2374
  message: I,
2375
2375
  ref: N,
@@ -2381,26 +2381,26 @@ var we = (e) => $(e) && !He(e) ? e : {
2381
2381
  let F, I;
2382
2382
  const R = we(v), K = we(x);
2383
2383
  if (!U(g) && !isNaN(g)) {
2384
- const W = s.valueAsNumber || g && +g;
2384
+ const W = a.valueAsNumber || g && +g;
2385
2385
  U(R.value) || (F = W > R.value), U(K.value) || (I = W < K.value);
2386
2386
  } else {
2387
- const W = s.valueAsDate || new Date(g), X = (Be) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Be), ge = s.type == "time", Ae = s.type == "week";
2387
+ const W = a.valueAsDate || new Date(g), X = (Pe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Pe), ge = a.type == "time", Ae = a.type == "week";
2388
2388
  te(R.value) && g && (F = ge ? X(g) > X(R.value) : Ae ? g > R.value : W > new Date(R.value)), te(K.value) && g && (I = ge ? X(g) < X(K.value) : Ae ? g < K.value : W < new Date(K.value));
2389
2389
  }
2390
2390
  if ((F || I) && (q(!!F, R.message, K.message, ie.max, ie.min), !r))
2391
- return P(D[b].message), D;
2391
+ return P(D[y].message), D;
2392
2392
  }
2393
- if ((d || p) && !H && (te(g) || a && Array.isArray(g))) {
2394
- const F = we(d), I = we(p), R = !U(F.value) && g.length > +F.value, K = !U(I.value) && g.length < +I.value;
2393
+ if ((d || h) && !H && (te(g) || s && Array.isArray(g))) {
2394
+ const F = we(d), I = we(h), R = !U(F.value) && g.length > +F.value, K = !U(I.value) && g.length < +I.value;
2395
2395
  if ((R || K) && (q(R, F.message, I.message), !r))
2396
- return P(D[b].message), D;
2396
+ return P(D[y].message), D;
2397
2397
  }
2398
- if (h && !H && te(g)) {
2399
- const { value: F, message: I } = we(h);
2400
- if (He(F) && !g.match(F) && (D[b] = {
2398
+ if (p && !H && te(g)) {
2399
+ const { value: F, message: I } = we(p);
2400
+ if (He(F) && !g.match(F) && (D[y] = {
2401
2401
  type: ie.pattern,
2402
2402
  message: I,
2403
- ref: s,
2403
+ ref: a,
2404
2404
  ...se(ie.pattern, I)
2405
2405
  }, !r))
2406
2406
  return P(I), D;
@@ -2408,7 +2408,7 @@ var we = (e) => $(e) && !He(e) ? e : {
2408
2408
  if (k) {
2409
2409
  if (fe(k)) {
2410
2410
  const F = await k(g, t), I = Ut(F, N);
2411
- if (I && (D[b] = {
2411
+ if (I && (D[y] = {
2412
2412
  ...I,
2413
2413
  ...se(ie.validate, I.message)
2414
2414
  }, !r))
@@ -2422,9 +2422,9 @@ var we = (e) => $(e) && !He(e) ? e : {
2422
2422
  R && (F = {
2423
2423
  ...R,
2424
2424
  ...se(I, R.message)
2425
- }, P(R.message), r && (D[b] = F));
2425
+ }, P(R.message), r && (D[y] = F));
2426
2426
  }
2427
- if (!J(F) && (D[b] = {
2427
+ if (!J(F) && (D[y] = {
2428
2428
  ref: N,
2429
2429
  ...F
2430
2430
  }, !r))
@@ -2447,8 +2447,8 @@ function Zn(e) {
2447
2447
  return !0;
2448
2448
  }
2449
2449
  function j(e, t) {
2450
- const r = Array.isArray(t) ? t : bt(t) ? [t] : hr(t), n = r.length === 1 ? e : Jn(e, r), a = r.length - 1, s = r[a];
2451
- return n && delete n[s], a !== 0 && ($(n) && J(n) || Array.isArray(n) && Zn(n)) && j(e, r.slice(0, -1)), e;
2450
+ const r = Array.isArray(t) ? t : yt(t) ? [t] : hr(t), n = r.length === 1 ? e : Jn(e, r), s = r.length - 1, a = r[s];
2451
+ return n && delete n[a], s !== 0 && ($(n) && J(n) || Array.isArray(n) && Zn(n)) && j(e, r.slice(0, -1)), e;
2452
2452
  }
2453
2453
  function ot() {
2454
2454
  let e = [];
@@ -2456,13 +2456,13 @@ function ot() {
2456
2456
  get observers() {
2457
2457
  return e;
2458
2458
  },
2459
- next: (a) => {
2460
- for (const s of e)
2461
- s.next && s.next(a);
2459
+ next: (s) => {
2460
+ for (const a of e)
2461
+ a.next && a.next(s);
2462
2462
  },
2463
- subscribe: (a) => (e.push(a), {
2463
+ subscribe: (s) => (e.push(s), {
2464
2464
  unsubscribe: () => {
2465
- e = e.filter((s) => s !== a);
2465
+ e = e.filter((a) => a !== s);
2466
2466
  }
2467
2467
  }),
2468
2468
  unsubscribe: () => {
@@ -2471,7 +2471,7 @@ function ot() {
2471
2471
  };
2472
2472
  }
2473
2473
  var We = (e) => U(e) || !fr(e);
2474
- function ye(e, t) {
2474
+ function be(e, t) {
2475
2475
  if (We(e) || We(t))
2476
2476
  return e === t;
2477
2477
  if (_e(e) && _e(t))
@@ -2479,19 +2479,19 @@ function ye(e, t) {
2479
2479
  const r = Object.keys(e), n = Object.keys(t);
2480
2480
  if (r.length !== n.length)
2481
2481
  return !1;
2482
- for (const a of r) {
2483
- const s = e[a];
2484
- if (!n.includes(a))
2482
+ for (const s of r) {
2483
+ const a = e[s];
2484
+ if (!n.includes(s))
2485
2485
  return !1;
2486
- if (a !== "ref") {
2487
- const i = t[a];
2488
- if (_e(s) && _e(i) || $(s) && $(i) || Array.isArray(s) && Array.isArray(i) ? !ye(s, i) : s !== i)
2486
+ if (s !== "ref") {
2487
+ const i = t[s];
2488
+ if (_e(a) && _e(i) || $(a) && $(i) || Array.isArray(a) && Array.isArray(i) ? !be(a, i) : a !== i)
2489
2489
  return !1;
2490
2490
  }
2491
2491
  }
2492
2492
  return !0;
2493
2493
  }
2494
- var yr = (e) => e.type === "select-multiple", Xn = (e) => xt(e) || Re(e), lt = (e) => Ge(e) && e.isConnected, br = (e) => {
2494
+ var br = (e) => e.type === "select-multiple", Xn = (e) => xt(e) || Oe(e), lt = (e) => Ge(e) && e.isConnected, yr = (e) => {
2495
2495
  for (const t in e)
2496
2496
  if (fe(e[t]))
2497
2497
  return !0;
@@ -2501,59 +2501,59 @@ function Je(e, t = {}) {
2501
2501
  const r = Array.isArray(e);
2502
2502
  if ($(e) || r)
2503
2503
  for (const n in e)
2504
- Array.isArray(e[n]) || $(e[n]) && !br(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Je(e[n], t[n])) : U(e[n]) || (t[n] = !0);
2504
+ Array.isArray(e[n]) || $(e[n]) && !yr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Je(e[n], t[n])) : U(e[n]) || (t[n] = !0);
2505
2505
  return t;
2506
2506
  }
2507
2507
  function vr(e, t, r) {
2508
2508
  const n = Array.isArray(e);
2509
2509
  if ($(e) || n)
2510
- for (const a in e)
2511
- Array.isArray(e[a]) || $(e[a]) && !br(e[a]) ? O(t) || We(r[a]) ? r[a] = Array.isArray(e[a]) ? Je(e[a], []) : { ...Je(e[a]) } : vr(e[a], U(t) ? {} : t[a], r[a]) : r[a] = !ye(e[a], t[a]);
2510
+ for (const s in e)
2511
+ Array.isArray(e[s]) || $(e[s]) && !yr(e[s]) ? O(t) || We(r[s]) ? r[s] = Array.isArray(e[s]) ? Je(e[s], []) : { ...Je(e[s]) } : vr(e[s], U(t) ? {} : t[s], r[s]) : r[s] = !be(e[s], t[s]);
2512
2512
  return r;
2513
2513
  }
2514
2514
  var ut = (e, t) => vr(e, t, Je(t)), xr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => O(e) ? e : t ? e === "" ? NaN : e && +e : r && te(e) ? new Date(e) : n ? n(e) : e;
2515
2515
  function ct(e) {
2516
2516
  const t = e.ref;
2517
2517
  if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
2518
- return vt(t) ? t.files : xt(t) ? gr(e.refs).value : yr(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Re(t) ? mr(e.refs).value : xr(O(t.value) ? e.ref.value : t.value, e);
2518
+ return vt(t) ? t.files : xt(t) ? gr(e.refs).value : br(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Oe(t) ? mr(e.refs).value : xr(O(t.value) ? e.ref.value : t.value, e);
2519
2519
  }
2520
2520
  var Qn = (e, t, r, n) => {
2521
- const a = {};
2522
- for (const s of e) {
2523
- const i = w(t, s);
2524
- i && L(a, s, i._f);
2521
+ const s = {};
2522
+ for (const a of e) {
2523
+ const i = w(t, a);
2524
+ i && L(s, a, i._f);
2525
2525
  }
2526
2526
  return {
2527
2527
  criteriaMode: r,
2528
2528
  names: [...e],
2529
- fields: a,
2529
+ fields: s,
2530
2530
  shouldUseNativeValidation: n
2531
2531
  };
2532
2532
  }, Ie = (e) => O(e) ? e : He(e) ? e.source : $(e) ? He(e.value) ? e.value.source : e.value : e, Yn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
2533
2533
  function Gt(e, t, r) {
2534
2534
  const n = w(e, r);
2535
- if (n || bt(r))
2535
+ if (n || yt(r))
2536
2536
  return {
2537
2537
  error: n,
2538
2538
  name: r
2539
2539
  };
2540
- const a = r.split(".");
2541
- for (; a.length; ) {
2542
- const s = a.join("."), i = w(t, s), u = w(e, s);
2543
- if (i && !Array.isArray(i) && r !== s)
2540
+ const s = r.split(".");
2541
+ for (; s.length; ) {
2542
+ const a = s.join("."), i = w(t, a), u = w(e, a);
2543
+ if (i && !Array.isArray(i) && r !== a)
2544
2544
  return { name: r };
2545
2545
  if (u && u.type)
2546
2546
  return {
2547
- name: s,
2547
+ name: a,
2548
2548
  error: u
2549
2549
  };
2550
- a.pop();
2550
+ s.pop();
2551
2551
  }
2552
2552
  return {
2553
2553
  name: r
2554
2554
  };
2555
2555
  }
2556
- var es = (e, t, r, n, a) => a.isOnAll ? !1 : !r && a.isOnTouch ? !(t || e) : (r ? n.isOnBlur : a.isOnBlur) ? !e : (r ? n.isOnChange : a.isOnChange) ? e : !0, ts = (e, t) => !Oe(w(e, t)).length && j(e, t);
2556
+ var es = (e, t, r, n, s) => s.isOnAll ? !1 : !r && s.isOnTouch ? !(t || e) : (r ? n.isOnBlur : s.isOnBlur) ? !e : (r ? n.isOnChange : s.isOnChange) ? e : !0, ts = (e, t) => !Be(w(e, t)).length && j(e, t);
2557
2557
  const rs = {
2558
2558
  mode: Z.onSubmit,
2559
2559
  reValidateMode: Z.onChange,
@@ -2576,7 +2576,7 @@ function ns(e = {}, t) {
2576
2576
  dirtyFields: {},
2577
2577
  errors: {},
2578
2578
  disabled: !1
2579
- }, a = {}, s = $(r.defaultValues) || $(r.values) ? oe(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : oe(s), u = {
2579
+ }, s = {}, a = $(r.defaultValues) || $(r.values) ? oe(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : oe(a), u = {
2580
2580
  action: !1,
2581
2581
  mount: !1,
2582
2582
  watch: !1
@@ -2585,7 +2585,7 @@ function ns(e = {}, t) {
2585
2585
  unMount: /* @__PURE__ */ new Set(),
2586
2586
  array: /* @__PURE__ */ new Set(),
2587
2587
  watch: /* @__PURE__ */ new Set()
2588
- }, p, x = 0;
2588
+ }, h, x = 0;
2589
2589
  const v = {
2590
2590
  isDirty: !1,
2591
2591
  dirtyFields: !1,
@@ -2593,36 +2593,36 @@ function ns(e = {}, t) {
2593
2593
  isValidating: !1,
2594
2594
  isValid: !1,
2595
2595
  errors: !1
2596
- }, h = {
2596
+ }, p = {
2597
2597
  values: ot(),
2598
2598
  array: ot(),
2599
2599
  state: ot()
2600
- }, k = e.resetOptions && e.resetOptions.keepDirtyValues, b = Pt(r.mode), A = Pt(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
2600
+ }, k = e.resetOptions && e.resetOptions.keepDirtyValues, y = Pt(r.mode), A = Pt(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
2601
2601
  clearTimeout(x), x = setTimeout(o, c);
2602
2602
  }, g = async (o) => {
2603
2603
  if (v.isValid || o) {
2604
- const c = r.resolver ? J((await H()).errors) : await q(a, !0);
2605
- c !== n.isValid && h.state.next({
2604
+ const c = r.resolver ? J((await H()).errors) : await q(s, !0);
2605
+ c !== n.isValid && p.state.next({
2606
2606
  isValid: c
2607
2607
  });
2608
2608
  }
2609
- }, N = (o) => v.isValidating && h.state.next({
2609
+ }, N = (o) => v.isValidating && p.state.next({
2610
2610
  isValidating: o
2611
- }), P = (o, c = [], f, _, y = !0, m = !0) => {
2611
+ }), P = (o, c = [], f, _, b = !0, m = !0) => {
2612
2612
  if (_ && f) {
2613
- if (u.action = !0, m && Array.isArray(w(a, o))) {
2614
- const C = f(w(a, o), _.argA, _.argB);
2615
- y && L(a, o, C);
2613
+ if (u.action = !0, m && Array.isArray(w(s, o))) {
2614
+ const C = f(w(s, o), _.argA, _.argB);
2615
+ b && L(s, o, C);
2616
2616
  }
2617
2617
  if (m && Array.isArray(w(n.errors, o))) {
2618
2618
  const C = f(w(n.errors, o), _.argA, _.argB);
2619
- y && L(n.errors, o, C), ts(n.errors, o);
2619
+ b && L(n.errors, o, C), ts(n.errors, o);
2620
2620
  }
2621
2621
  if (v.touchedFields && m && Array.isArray(w(n.touchedFields, o))) {
2622
2622
  const C = f(w(n.touchedFields, o), _.argA, _.argB);
2623
- y && L(n.touchedFields, o, C);
2623
+ b && L(n.touchedFields, o, C);
2624
2624
  }
2625
- v.dirtyFields && (n.dirtyFields = ut(s, i)), h.state.next({
2625
+ v.dirtyFields && (n.dirtyFields = ut(a, i)), p.state.next({
2626
2626
  name: o,
2627
2627
  isDirty: I(o, c),
2628
2628
  dirtyFields: n.dirtyFields,
@@ -2632,33 +2632,33 @@ function ns(e = {}, t) {
2632
2632
  } else
2633
2633
  L(i, o, c);
2634
2634
  }, D = (o, c) => {
2635
- L(n.errors, o, c), h.state.next({
2635
+ L(n.errors, o, c), p.state.next({
2636
2636
  errors: n.errors
2637
2637
  });
2638
2638
  }, me = (o, c, f, _) => {
2639
- const y = w(a, o);
2640
- if (y) {
2641
- const m = w(i, o, O(f) ? w(s, o) : f);
2642
- O(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : ct(y._f)) : W(o, m), u.mount && g();
2639
+ const b = w(s, o);
2640
+ if (b) {
2641
+ const m = w(i, o, O(f) ? w(a, o) : f);
2642
+ O(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : ct(b._f)) : W(o, m), u.mount && g();
2643
2643
  }
2644
- }, ce = (o, c, f, _, y) => {
2644
+ }, ce = (o, c, f, _, b) => {
2645
2645
  let m = !1, C = !1;
2646
2646
  const T = {
2647
2647
  name: o
2648
2648
  };
2649
2649
  if (!f || _) {
2650
2650
  v.isDirty && (C = n.isDirty, n.isDirty = T.isDirty = I(), m = C !== T.isDirty);
2651
- const B = ye(w(s, o), c);
2651
+ const B = be(w(a, o), c);
2652
2652
  C = w(n.dirtyFields, o), B ? j(n.dirtyFields, o) : L(n.dirtyFields, o, !0), T.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !B;
2653
2653
  }
2654
2654
  if (f) {
2655
2655
  const B = w(n.touchedFields, o);
2656
2656
  B || (L(n.touchedFields, o, f), T.touchedFields = n.touchedFields, m = m || v.touchedFields && B !== f);
2657
2657
  }
2658
- return m && y && h.state.next(T), m ? T : {};
2658
+ return m && b && p.state.next(T), m ? T : {};
2659
2659
  }, Ee = (o, c, f, _) => {
2660
- const y = w(n.errors, o), m = v.isValid && de(c) && n.isValid !== c;
2661
- if (e.delayError && f ? (p = E(() => D(o, f)), p(e.delayError)) : (clearTimeout(x), p = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !ye(y, f) : y) || !J(_) || m) {
2660
+ const b = w(n.errors, o), m = v.isValid && de(c) && n.isValid !== c;
2661
+ if (e.delayError && f ? (h = E(() => D(o, f)), h(e.delayError)) : (clearTimeout(x), h = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !be(b, f) : b) || !J(_) || m) {
2662
2662
  const C = {
2663
2663
  ..._,
2664
2664
  ...m && de(c) ? { isValid: c } : {},
@@ -2668,10 +2668,10 @@ function ns(e = {}, t) {
2668
2668
  n = {
2669
2669
  ...n,
2670
2670
  ...C
2671
- }, h.state.next(C);
2671
+ }, p.state.next(C);
2672
2672
  }
2673
2673
  N(!1);
2674
- }, H = async (o) => r.resolver(i, r.context, Qn(o || d.mount, a, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
2674
+ }, H = async (o) => r.resolver(i, r.context, Qn(o || d.mount, s, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
2675
2675
  const { errors: c } = await H(o);
2676
2676
  if (o)
2677
2677
  for (const f of o) {
@@ -2685,11 +2685,11 @@ function ns(e = {}, t) {
2685
2685
  valid: !0
2686
2686
  }) => {
2687
2687
  for (const _ in o) {
2688
- const y = o[_];
2689
- if (y) {
2690
- const { _f: m, ...C } = y;
2688
+ const b = o[_];
2689
+ if (b) {
2690
+ const { _f: m, ...C } = b;
2691
2691
  if (m) {
2692
- const T = d.array.has(m.name), B = await Kt(y, i, S, r.shouldUseNativeValidation && !c, T);
2692
+ const T = d.array.has(m.name), B = await Kt(b, i, S, r.shouldUseNativeValidation && !c, T);
2693
2693
  if (B[m.name] && (f.valid = !1, c))
2694
2694
  break;
2695
2695
  !c && (w(B, m.name) ? T ? Wn(n.errors, B, m.name) : L(n.errors, m.name, B[m.name]) : j(n.errors, m.name));
@@ -2700,91 +2700,91 @@ function ns(e = {}, t) {
2700
2700
  return f.valid;
2701
2701
  }, F = () => {
2702
2702
  for (const o of d.unMount) {
2703
- const c = w(a, o);
2703
+ const c = w(s, o);
2704
2704
  c && (c._f.refs ? c._f.refs.every((f) => !lt(f)) : !lt(c._f.ref)) && tt(o);
2705
2705
  }
2706
2706
  d.unMount = /* @__PURE__ */ new Set();
2707
- }, I = (o, c) => (o && c && L(i, o, c), !ye(wt(), s)), R = (o, c, f) => Hn(o, d, {
2708
- ...u.mount ? i : O(c) ? s : te(o) ? { [o]: c } : c
2709
- }, f, c), K = (o) => Oe(w(u.mount ? i : s, o, e.shouldUnregister ? w(s, o, []) : [])), W = (o, c, f = {}) => {
2710
- const _ = w(a, o);
2711
- let y = c;
2707
+ }, I = (o, c) => (o && c && L(i, o, c), !be(wt(), a)), R = (o, c, f) => Hn(o, d, {
2708
+ ...u.mount ? i : O(c) ? a : te(o) ? { [o]: c } : c
2709
+ }, f, c), K = (o) => Be(w(u.mount ? i : a, o, e.shouldUnregister ? w(a, o, []) : [])), W = (o, c, f = {}) => {
2710
+ const _ = w(s, o);
2711
+ let b = c;
2712
2712
  if (_) {
2713
2713
  const m = _._f;
2714
- m && (!m.disabled && L(i, o, xr(c, m)), y = Ge(m.ref) && U(c) ? "" : c, yr(m.ref) ? [...m.ref.options].forEach((C) => C.selected = y.includes(C.value)) : m.refs ? Re(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(y) ? !!y.find((T) => T === C.value) : y === C.value)) : m.refs[0] && (m.refs[0].checked = !!y) : m.refs.forEach((C) => C.checked = C.value === y) : vt(m.ref) ? m.ref.value = "" : (m.ref.value = y, m.ref.type || h.values.next({
2714
+ m && (!m.disabled && L(i, o, xr(c, m)), b = Ge(m.ref) && U(c) ? "" : c, br(m.ref) ? [...m.ref.options].forEach((C) => C.selected = b.includes(C.value)) : m.refs ? Oe(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(b) ? !!b.find((T) => T === C.value) : b === C.value)) : m.refs[0] && (m.refs[0].checked = !!b) : m.refs.forEach((C) => C.checked = C.value === b) : vt(m.ref) ? m.ref.value = "" : (m.ref.value = b, m.ref.type || p.values.next({
2715
2715
  name: o,
2716
2716
  values: { ...i }
2717
2717
  })));
2718
2718
  }
2719
- (f.shouldDirty || f.shouldTouch) && ce(o, y, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && et(o);
2719
+ (f.shouldDirty || f.shouldTouch) && ce(o, b, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && et(o);
2720
2720
  }, X = (o, c, f) => {
2721
2721
  for (const _ in c) {
2722
- const y = c[_], m = `${o}.${_}`, C = w(a, m);
2723
- (d.array.has(o) || !We(y) || C && !C._f) && !_e(y) ? X(m, y, f) : W(m, y, f);
2722
+ const b = c[_], m = `${o}.${_}`, C = w(s, m);
2723
+ (d.array.has(o) || !We(b) || C && !C._f) && !_e(b) ? X(m, b, f) : W(m, b, f);
2724
2724
  }
2725
2725
  }, ge = (o, c, f = {}) => {
2726
- const _ = w(a, o), y = d.array.has(o), m = oe(c);
2727
- L(i, o, m), y ? (h.array.next({
2726
+ const _ = w(s, o), b = d.array.has(o), m = oe(c);
2727
+ L(i, o, m), b ? (p.array.next({
2728
2728
  name: o,
2729
2729
  values: { ...i }
2730
- }), (v.isDirty || v.dirtyFields) && f.shouldDirty && h.state.next({
2730
+ }), (v.isDirty || v.dirtyFields) && f.shouldDirty && p.state.next({
2731
2731
  name: o,
2732
- dirtyFields: ut(s, i),
2732
+ dirtyFields: ut(a, i),
2733
2733
  isDirty: I(o, m)
2734
- })) : _ && !_._f && !U(m) ? X(o, m, f) : W(o, m, f), $t(o, d) && h.state.next({ ...n }), h.values.next({
2734
+ })) : _ && !_._f && !U(m) ? X(o, m, f) : W(o, m, f), $t(o, d) && p.state.next({ ...n }), p.values.next({
2735
2735
  name: o,
2736
2736
  values: { ...i }
2737
2737
  }), !u.mount && t();
2738
2738
  }, Ae = async (o) => {
2739
2739
  const c = o.target;
2740
2740
  let f = c.name, _ = !0;
2741
- const y = w(a, f), m = () => c.type ? ct(y._f) : $n(o), C = (T) => {
2741
+ const b = w(s, f), m = () => c.type ? ct(b._f) : $n(o), C = (T) => {
2742
2742
  _ = Number.isNaN(T) || T === w(i, f, T);
2743
2743
  };
2744
- if (y) {
2744
+ if (b) {
2745
2745
  let T, B;
2746
- const Pe = m(), xe = o.type === Bt.BLUR || o.type === Bt.FOCUS_OUT, Er = !Yn(y._f) && !r.resolver && !w(n.errors, f) && !y._f.deps || es(xe, w(n.touchedFields, f), n.isSubmitted, A, b), nt = $t(f, d, xe);
2747
- L(i, f, Pe), xe ? (y._f.onBlur && y._f.onBlur(o), p && p(0)) : y._f.onChange && y._f.onChange(o);
2748
- const st = ce(f, Pe, xe, !1), Ar = !J(st) || nt;
2749
- if (!xe && h.values.next({
2746
+ const $e = m(), xe = o.type === Bt.BLUR || o.type === Bt.FOCUS_OUT, Er = !Yn(b._f) && !r.resolver && !w(n.errors, f) && !b._f.deps || es(xe, w(n.touchedFields, f), n.isSubmitted, A, y), nt = $t(f, d, xe);
2747
+ L(i, f, $e), xe ? (b._f.onBlur && b._f.onBlur(o), h && h(0)) : b._f.onChange && b._f.onChange(o);
2748
+ const st = ce(f, $e, xe, !1), Ar = !J(st) || nt;
2749
+ if (!xe && p.values.next({
2750
2750
  name: f,
2751
2751
  type: o.type,
2752
2752
  values: { ...i }
2753
2753
  }), Er)
2754
- return v.isValid && g(), Ar && h.state.next({ name: f, ...nt ? {} : st });
2755
- if (!xe && nt && h.state.next({ ...n }), N(!0), r.resolver) {
2754
+ return v.isValid && g(), Ar && p.state.next({ name: f, ...nt ? {} : st });
2755
+ if (!xe && nt && p.state.next({ ...n }), N(!0), r.resolver) {
2756
2756
  const { errors: It } = await H([f]);
2757
- if (C(Pe), _) {
2758
- const Vr = Gt(n.errors, a, f), Mt = Gt(It, a, Vr.name || f);
2757
+ if (C($e), _) {
2758
+ const Vr = Gt(n.errors, s, f), Mt = Gt(It, s, Vr.name || f);
2759
2759
  T = Mt.error, f = Mt.name, B = J(It);
2760
2760
  }
2761
2761
  } else
2762
- T = (await Kt(y, i, S, r.shouldUseNativeValidation))[f], C(Pe), _ && (T ? B = !1 : v.isValid && (B = await q(a, !0)));
2763
- _ && (y._f.deps && et(y._f.deps), Ee(f, B, T, st));
2762
+ T = (await Kt(b, i, S, r.shouldUseNativeValidation))[f], C($e), _ && (T ? B = !1 : v.isValid && (B = await q(s, !0)));
2763
+ _ && (b._f.deps && et(b._f.deps), Ee(f, B, T, st));
2764
2764
  }
2765
- }, Be = (o, c) => {
2765
+ }, Pe = (o, c) => {
2766
2766
  if (w(n.errors, c) && o.focus)
2767
2767
  return o.focus(), 1;
2768
2768
  }, et = async (o, c = {}) => {
2769
2769
  let f, _;
2770
- const y = it(o);
2770
+ const b = it(o);
2771
2771
  if (N(!0), r.resolver) {
2772
- const m = await se(O(o) ? o : y);
2773
- f = J(m), _ = o ? !y.some((C) => w(m, C)) : f;
2772
+ const m = await se(O(o) ? o : b);
2773
+ f = J(m), _ = o ? !b.some((C) => w(m, C)) : f;
2774
2774
  } else
2775
- o ? (_ = (await Promise.all(y.map(async (m) => {
2776
- const C = w(a, m);
2775
+ o ? (_ = (await Promise.all(b.map(async (m) => {
2776
+ const C = w(s, m);
2777
2777
  return await q(C && C._f ? { [m]: C } : C);
2778
- }))).every(Boolean), !(!_ && !n.isValid) && g()) : _ = f = await q(a);
2779
- return h.state.next({
2778
+ }))).every(Boolean), !(!_ && !n.isValid) && g()) : _ = f = await q(s);
2779
+ return p.state.next({
2780
2780
  ...!te(o) || v.isValid && f !== n.isValid ? {} : { name: o },
2781
2781
  ...r.resolver || !o ? { isValid: f } : {},
2782
2782
  errors: n.errors,
2783
2783
  isValidating: !1
2784
- }), c.shouldFocus && !_ && ze(a, Be, o ? y : d.mount), _;
2784
+ }), c.shouldFocus && !_ && ze(s, Pe, o ? b : d.mount), _;
2785
2785
  }, wt = (o) => {
2786
2786
  const c = {
2787
- ...s,
2787
+ ...a,
2788
2788
  ...u.mount ? i : {}
2789
2789
  };
2790
2790
  return O(o) ? c : te(o) ? w(c, o) : o.map((f) => w(c, f));
@@ -2794,39 +2794,39 @@ function ns(e = {}, t) {
2794
2794
  isTouched: !!w((c || n).touchedFields, o),
2795
2795
  error: w((c || n).errors, o)
2796
2796
  }), _r = (o) => {
2797
- o && it(o).forEach((c) => j(n.errors, c)), h.state.next({
2797
+ o && it(o).forEach((c) => j(n.errors, c)), p.state.next({
2798
2798
  errors: o ? n.errors : {}
2799
2799
  });
2800
2800
  }, kt = (o, c, f) => {
2801
- const _ = (w(a, o, { _f: {} })._f || {}).ref;
2801
+ const _ = (w(s, o, { _f: {} })._f || {}).ref;
2802
2802
  L(n.errors, o, {
2803
2803
  ...c,
2804
2804
  ref: _
2805
- }), h.state.next({
2805
+ }), p.state.next({
2806
2806
  name: o,
2807
2807
  errors: n.errors,
2808
2808
  isValid: !1
2809
2809
  }), f && f.shouldFocus && _ && _.focus && _.focus();
2810
- }, kr = (o, c) => fe(o) ? h.values.subscribe({
2810
+ }, kr = (o, c) => fe(o) ? p.values.subscribe({
2811
2811
  next: (f) => o(R(void 0, c), f)
2812
2812
  }) : R(o, c, !0), tt = (o, c = {}) => {
2813
2813
  for (const f of o ? it(o) : d.mount)
2814
- d.mount.delete(f), d.array.delete(f), c.keepValue || (j(a, f), j(i, f)), !c.keepError && j(n.errors, f), !c.keepDirty && j(n.dirtyFields, f), !c.keepTouched && j(n.touchedFields, f), !r.shouldUnregister && !c.keepDefaultValue && j(s, f);
2815
- h.values.next({
2814
+ d.mount.delete(f), d.array.delete(f), c.keepValue || (j(s, f), j(i, f)), !c.keepError && j(n.errors, f), !c.keepDirty && j(n.dirtyFields, f), !c.keepTouched && j(n.touchedFields, f), !r.shouldUnregister && !c.keepDefaultValue && j(a, f);
2815
+ p.values.next({
2816
2816
  values: { ...i }
2817
- }), h.state.next({
2817
+ }), p.state.next({
2818
2818
  ...n,
2819
2819
  ...c.keepDirty ? { isDirty: I() } : {}
2820
2820
  }), !c.keepIsValid && g();
2821
- }, St = ({ disabled: o, name: c, field: f, fields: _, value: y }) => {
2821
+ }, St = ({ disabled: o, name: c, field: f, fields: _, value: b }) => {
2822
2822
  if (de(o)) {
2823
- const m = o ? void 0 : O(y) ? ct(f ? f._f : w(_, c)._f) : y;
2823
+ const m = o ? void 0 : O(b) ? ct(f ? f._f : w(_, c)._f) : b;
2824
2824
  L(i, c, m), ce(c, m, !1, !1, !0);
2825
2825
  }
2826
2826
  }, rt = (o, c = {}) => {
2827
- let f = w(a, o);
2827
+ let f = w(s, o);
2828
2828
  const _ = de(c.disabled);
2829
- return L(a, o, {
2829
+ return L(s, o, {
2830
2830
  ...f || {},
2831
2831
  _f: {
2832
2832
  ...f && f._f ? f._f : { ref: { name: o } },
@@ -2851,46 +2851,46 @@ function ns(e = {}, t) {
2851
2851
  name: o,
2852
2852
  onChange: Ae,
2853
2853
  onBlur: Ae,
2854
- ref: (y) => {
2855
- if (y) {
2856
- rt(o, c), f = w(a, o);
2857
- const m = O(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, C = Xn(m), T = f._f.refs || [];
2854
+ ref: (b) => {
2855
+ if (b) {
2856
+ rt(o, c), f = w(s, o);
2857
+ const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C = Xn(m), T = f._f.refs || [];
2858
2858
  if (C ? T.find((B) => B === m) : m === f._f.ref)
2859
2859
  return;
2860
- L(a, o, {
2860
+ L(s, o, {
2861
2861
  _f: {
2862
2862
  ...f._f,
2863
2863
  ...C ? {
2864
2864
  refs: [
2865
2865
  ...T.filter(lt),
2866
2866
  m,
2867
- ...Array.isArray(w(s, o)) ? [{}] : []
2867
+ ...Array.isArray(w(a, o)) ? [{}] : []
2868
2868
  ],
2869
2869
  ref: { type: m.type, name: o }
2870
2870
  } : { ref: m }
2871
2871
  }
2872
2872
  }), me(o, !1, void 0, m);
2873
2873
  } else
2874
- f = w(a, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(zn(d.array, o) && u.action) && d.unMount.add(o);
2874
+ f = w(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(zn(d.array, o) && u.action) && d.unMount.add(o);
2875
2875
  }
2876
2876
  };
2877
- }, Ct = () => r.shouldFocusError && ze(a, Be, d.mount), Sr = (o) => {
2878
- de(o) && (h.state.next({ disabled: o }), ze(a, (c) => {
2877
+ }, Ct = () => r.shouldFocusError && ze(s, Pe, d.mount), Sr = (o) => {
2878
+ de(o) && (p.state.next({ disabled: o }), ze(s, (c) => {
2879
2879
  c.disabled = o;
2880
2880
  }, 0, !1));
2881
2881
  }, Et = (o, c) => async (f) => {
2882
2882
  f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
2883
2883
  let _ = oe(i);
2884
- if (h.state.next({
2884
+ if (p.state.next({
2885
2885
  isSubmitting: !0
2886
2886
  }), r.resolver) {
2887
- const { errors: y, values: m } = await H();
2888
- n.errors = y, _ = m;
2887
+ const { errors: b, values: m } = await H();
2888
+ n.errors = b, _ = m;
2889
2889
  } else
2890
- await q(a);
2891
- j(n.errors, "root"), J(n.errors) ? (h.state.next({
2890
+ await q(s);
2891
+ j(n.errors, "root"), J(n.errors) ? (p.state.next({
2892
2892
  errors: {}
2893
- }), await o(_, f)) : (c && await c({ ...n.errors }, f), Ct(), setTimeout(Ct)), h.state.next({
2893
+ }), await o(_, f)) : (c && await c({ ...n.errors }, f), Ct(), setTimeout(Ct)), p.state.next({
2894
2894
  isSubmitted: !0,
2895
2895
  isSubmitting: !1,
2896
2896
  isSubmitSuccessful: J(n.errors),
@@ -2898,17 +2898,17 @@ function ns(e = {}, t) {
2898
2898
  errors: n.errors
2899
2899
  });
2900
2900
  }, Cr = (o, c = {}) => {
2901
- w(a, o) && (O(c.defaultValue) ? ge(o, w(s, o)) : (ge(o, c.defaultValue), L(s, o, c.defaultValue)), c.keepTouched || j(n.touchedFields, o), c.keepDirty || (j(n.dirtyFields, o), n.isDirty = c.defaultValue ? I(o, w(s, o)) : I()), c.keepError || (j(n.errors, o), v.isValid && g()), h.state.next({ ...n }));
2901
+ w(s, o) && (O(c.defaultValue) ? ge(o, w(a, o)) : (ge(o, c.defaultValue), L(a, o, c.defaultValue)), c.keepTouched || j(n.touchedFields, o), c.keepDirty || (j(n.dirtyFields, o), n.isDirty = c.defaultValue ? I(o, w(a, o)) : I()), c.keepError || (j(n.errors, o), v.isValid && g()), p.state.next({ ...n }));
2902
2902
  }, At = (o, c = {}) => {
2903
- const f = o ? oe(o) : s, _ = oe(f), y = o && !J(o) ? _ : s;
2904
- if (c.keepDefaultValues || (s = f), !c.keepValues) {
2903
+ const f = o ? oe(o) : a, _ = oe(f), b = o && !J(o) ? _ : a;
2904
+ if (c.keepDefaultValues || (a = f), !c.keepValues) {
2905
2905
  if (c.keepDirtyValues || k)
2906
2906
  for (const m of d.mount)
2907
- w(n.dirtyFields, m) ? L(y, m, w(i, m)) : ge(m, w(y, m));
2907
+ w(n.dirtyFields, m) ? L(b, m, w(i, m)) : ge(m, w(b, m));
2908
2908
  else {
2909
- if (yt && O(o))
2909
+ if (bt && O(o))
2910
2910
  for (const m of d.mount) {
2911
- const C = w(a, m);
2911
+ const C = w(s, m);
2912
2912
  if (C && C._f) {
2913
2913
  const T = Array.isArray(C._f.refs) ? C._f.refs[0] : C._f.ref;
2914
2914
  if (Ge(T)) {
@@ -2920,12 +2920,12 @@ function ns(e = {}, t) {
2920
2920
  }
2921
2921
  }
2922
2922
  }
2923
- a = {};
2923
+ s = {};
2924
2924
  }
2925
- i = e.shouldUnregister ? c.keepDefaultValues ? oe(s) : {} : oe(y), h.array.next({
2926
- values: { ...y }
2927
- }), h.values.next({
2928
- values: { ...y }
2925
+ i = e.shouldUnregister ? c.keepDefaultValues ? oe(a) : {} : oe(b), p.array.next({
2926
+ values: { ...b }
2927
+ }), p.values.next({
2928
+ values: { ...b }
2929
2929
  });
2930
2930
  }
2931
2931
  d = {
@@ -2935,11 +2935,11 @@ function ns(e = {}, t) {
2935
2935
  watch: /* @__PURE__ */ new Set(),
2936
2936
  watchAll: !1,
2937
2937
  focus: ""
2938
- }, !u.mount && t(), u.mount = !v.isValid || !!c.keepIsValid, u.watch = !!e.shouldUnregister, h.state.next({
2938
+ }, !u.mount && t(), u.mount = !v.isValid || !!c.keepIsValid, u.watch = !!e.shouldUnregister, p.state.next({
2939
2939
  submitCount: c.keepSubmitCount ? n.submitCount : 0,
2940
- isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !ye(o, s)),
2940
+ isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !be(o, a)),
2941
2941
  isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
2942
- dirtyFields: c.keepDirtyValues ? n.dirtyFields : c.keepDefaultValues && o ? ut(s, o) : {},
2942
+ dirtyFields: c.keepDirtyValues ? n.dirtyFields : c.keepDefaultValues && o ? ut(a, o) : {},
2943
2943
  touchedFields: c.keepTouched ? n.touchedFields : {},
2944
2944
  errors: c.keepErrors ? n.errors : {},
2945
2945
  isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
@@ -2963,7 +2963,7 @@ function ns(e = {}, t) {
2963
2963
  _getFieldArray: K,
2964
2964
  _reset: At,
2965
2965
  _resetDefaultValues: () => fe(r.defaultValues) && r.defaultValues().then((o) => {
2966
- Vt(o, r.resetOptions), h.state.next({
2966
+ Vt(o, r.resetOptions), p.state.next({
2967
2967
  isLoading: !1
2968
2968
  });
2969
2969
  }),
@@ -2974,10 +2974,10 @@ function ns(e = {}, t) {
2974
2974
  };
2975
2975
  },
2976
2976
  _disableForm: Sr,
2977
- _subjects: h,
2977
+ _subjects: p,
2978
2978
  _proxyFormState: v,
2979
2979
  get _fields() {
2980
- return a;
2980
+ return s;
2981
2981
  },
2982
2982
  get _formValues() {
2983
2983
  return i;
@@ -2989,7 +2989,7 @@ function ns(e = {}, t) {
2989
2989
  u = o;
2990
2990
  },
2991
2991
  get _defaultValues() {
2992
- return s;
2992
+ return a;
2993
2993
  },
2994
2994
  get _names() {
2995
2995
  return d;
@@ -3025,17 +3025,17 @@ function ns(e = {}, t) {
3025
3025
  unregister: tt,
3026
3026
  setError: kt,
3027
3027
  setFocus: (o, c = {}) => {
3028
- const f = w(a, o), _ = f && f._f;
3028
+ const f = w(s, o), _ = f && f._f;
3029
3029
  if (_) {
3030
- const y = _.refs ? _.refs[0] : _.ref;
3031
- y.focus && (y.focus(), c.shouldSelect && y.select());
3030
+ const b = _.refs ? _.refs[0] : _.ref;
3031
+ b.focus && (b.focus(), c.shouldSelect && b.select());
3032
3032
  }
3033
3033
  },
3034
3034
  getFieldState: _t
3035
3035
  };
3036
3036
  }
3037
3037
  function Qe(e = {}) {
3038
- const t = Q.useRef(), r = Q.useRef(), [n, a] = Q.useState({
3038
+ const t = Q.useRef(), r = Q.useRef(), [n, s] = Q.useState({
3039
3039
  isDirty: !1,
3040
3040
  isValidating: !1,
3041
3041
  isLoading: fe(e.defaultValues),
@@ -3051,27 +3051,27 @@ function Qe(e = {}) {
3051
3051
  defaultValues: fe(e.defaultValues) ? void 0 : e.defaultValues
3052
3052
  });
3053
3053
  t.current || (t.current = {
3054
- ...ns(e, () => a((i) => ({ ...i }))),
3054
+ ...ns(e, () => s((i) => ({ ...i }))),
3055
3055
  formState: n
3056
3056
  });
3057
- const s = t.current.control;
3058
- return s._options = e, Gn({
3059
- subject: s._subjects.state,
3057
+ const a = t.current.control;
3058
+ return a._options = e, Gn({
3059
+ subject: a._subjects.state,
3060
3060
  next: (i) => {
3061
- Kn(i, s._proxyFormState, s._updateFormState, !0) && a({ ...s._formState });
3061
+ Kn(i, a._proxyFormState, a._updateFormState, !0) && s({ ...a._formState });
3062
3062
  }
3063
- }), Q.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), Q.useEffect(() => {
3064
- if (s._proxyFormState.isDirty) {
3065
- const i = s._getDirty();
3066
- i !== n.isDirty && s._subjects.state.next({
3063
+ }), Q.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Q.useEffect(() => {
3064
+ if (a._proxyFormState.isDirty) {
3065
+ const i = a._getDirty();
3066
+ i !== n.isDirty && a._subjects.state.next({
3067
3067
  isDirty: i
3068
3068
  });
3069
3069
  }
3070
- }, [s, n.isDirty]), Q.useEffect(() => {
3071
- e.values && !ye(e.values, r.current) ? (s._reset(e.values, s._options.resetOptions), r.current = e.values) : s._resetDefaultValues();
3072
- }, [e.values, s]), Q.useEffect(() => {
3073
- s._state.mount || (s._updateValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
3074
- }), t.current.formState = Un(n, s), t.current;
3070
+ }, [a, n.isDirty]), Q.useEffect(() => {
3071
+ e.values && !be(e.values, r.current) ? (a._reset(e.values, a._options.resetOptions), r.current = e.values) : a._resetDefaultValues();
3072
+ }, [e.values, a]), Q.useEffect(() => {
3073
+ a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
3074
+ }), t.current.formState = Un(n, a), t.current;
3075
3075
  }
3076
3076
  var Ht = function(e, t, r) {
3077
3077
  if (e && "reportValidity" in e) {
@@ -3079,10 +3079,10 @@ var Ht = function(e, t, r) {
3079
3079
  e.setCustomValidity(n && n.message || ""), e.reportValidity();
3080
3080
  }
3081
3081
  }, ss = function(e, t) {
3082
- var r = function(a) {
3083
- var s = t.fields[a];
3084
- s && s.ref && "reportValidity" in s.ref ? Ht(s.ref, a, e) : s.refs && s.refs.forEach(function(i) {
3085
- return Ht(i, a, e);
3082
+ var r = function(s) {
3083
+ var a = t.fields[s];
3084
+ a && a.ref && "reportValidity" in a.ref ? Ht(a.ref, s, e) : a.refs && a.refs.forEach(function(i) {
3085
+ return Ht(i, s, e);
3086
3086
  });
3087
3087
  };
3088
3088
  for (var n in t.fields)
@@ -3091,12 +3091,12 @@ var Ht = function(e, t, r) {
3091
3091
  t.shouldUseNativeValidation && ss(e, t);
3092
3092
  var r = {};
3093
3093
  for (var n in e) {
3094
- var a = w(t.fields, n), s = Object.assign(e[n] || {}, { ref: a && a.ref });
3094
+ var s = w(t.fields, n), a = Object.assign(e[n] || {}, { ref: s && s.ref });
3095
3095
  if (os(t.names || Object.keys(e), n)) {
3096
3096
  var i = Object.assign({}, is(w(r, n)));
3097
- L(i, "root", s), L(r, n, i);
3097
+ L(i, "root", a), L(r, n, i);
3098
3098
  } else
3099
- L(r, n, s);
3099
+ L(r, n, a);
3100
3100
  }
3101
3101
  return r;
3102
3102
  }, is = function(e) {
@@ -3109,36 +3109,36 @@ var Ht = function(e, t, r) {
3109
3109
  for (var r = {}; e.issues.length; ) {
3110
3110
  var n = e.issues[0];
3111
3111
  if (n.path) {
3112
- var a = n.path.map(function(u) {
3112
+ var s = n.path.map(function(u) {
3113
3113
  return u.key;
3114
3114
  }).join(".");
3115
- if (r[a] || (r[a] = { message: n.message, type: n.validation }), t) {
3116
- var s = r[a].types, i = s && s[n.validation];
3117
- r[a] = pr(a, t, r, n.validation, i ? [].concat(i, n.message) : n.message);
3115
+ if (r[s] || (r[s] = { message: n.message, type: n.validation }), t) {
3116
+ var a = r[s].types, i = a && a[n.validation];
3117
+ r[s] = pr(s, t, r, n.validation, i ? [].concat(i, n.message) : n.message);
3118
3118
  }
3119
3119
  e.issues.shift();
3120
3120
  }
3121
3121
  }
3122
3122
  return r;
3123
3123
  }, Ye = function(e, t, r) {
3124
- return r === void 0 && (r = {}), function(n, a, s) {
3124
+ return r === void 0 && (r = {}), function(n, s, a) {
3125
3125
  try {
3126
3126
  return Promise.resolve(function(i, u) {
3127
3127
  try {
3128
3128
  var d = function() {
3129
- function p(v) {
3129
+ function h(v) {
3130
3130
  return { values: r.raw ? n : v, errors: {} };
3131
3131
  }
3132
3132
  var x = Object.assign({}, { abortEarly: !1, abortPipeEarly: !1 }, t);
3133
- return r.mode === "sync" ? p(nr(e, n, x)) : Promise.resolve(Dr(e, n, x)).then(p);
3133
+ return r.mode === "sync" ? h(nr(e, n, x)) : Promise.resolve(Dr(e, n, x)).then(h);
3134
3134
  }();
3135
- } catch (p) {
3136
- return u(p);
3135
+ } catch (h) {
3136
+ return u(h);
3137
3137
  }
3138
3138
  return d && d.then ? d.then(void 0, u) : d;
3139
3139
  }(0, function(i) {
3140
3140
  if (i instanceof Rr)
3141
- return { values: {}, errors: as(ls(i, !s.shouldUseNativeValidation && s.criteriaMode === "all"), s) };
3141
+ return { values: {}, errors: as(ls(i, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a) };
3142
3142
  throw i;
3143
3143
  }));
3144
3144
  } catch (i) {
@@ -3152,9 +3152,9 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3152
3152
  max: e.maxSelected ?? e.options.length
3153
3153
  };
3154
3154
  return Ye(he({
3155
- checked: sr(Or(Br()), (n) => Object.entries(n).filter(([a, s]) => s).map(([a, s]) => a), [je(r.max, t("validation_multiple_choice_max", {
3155
+ checked: sr(Or(Br()), (n) => Object.entries(n).filter(([s, a]) => a).map(([s, a]) => s), [je(r.max, t("validation_multiple_choice_max", {
3156
3156
  count: r.max
3157
- })), Le(r.min, t("validation_multiple_choice_min", {
3157
+ })), Te(r.min, t("validation_multiple_choice_min", {
3158
3158
  count: r.min
3159
3159
  }))])
3160
3160
  }));
@@ -3186,8 +3186,8 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3186
3186
  onSubmitSuccess: t
3187
3187
  }) => {
3188
3188
  var x, v;
3189
- const r = e.key ? (x = M.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, a = n && e.config.options.length === 2, {
3190
- t: s
3189
+ const r = e.key ? (x = M.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
3190
+ t: a
3191
3191
  } = G(), {
3192
3192
  register: i,
3193
3193
  handleSubmit: u,
@@ -3196,41 +3196,41 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3196
3196
  }
3197
3197
  } = Qe({
3198
3198
  defaultValues: {
3199
- checked: n ? {} : us(r) ? Object.fromEntries(r.value.map((h) => [h, !0])) : {}
3199
+ checked: n ? {} : us(r) ? Object.fromEntries(r.value.map((p) => [p, !0])) : {}
3200
3200
  },
3201
- resolver: cs(e.config, s)
3202
- }), p = gt();
3203
- return a ? l("ul", {
3201
+ resolver: cs(e.config, a)
3202
+ }), h = gt();
3203
+ return s ? l("ul", {
3204
3204
  style: {
3205
3205
  maxHeight: 6.5 * Wt + 5 * Jt + 2 * Zt
3206
3206
  },
3207
3207
  class: Xt({
3208
3208
  variant: "booleanLike"
3209
3209
  }),
3210
- children: e.config.options.map((h, k) => l("li", {
3210
+ children: e.config.options.map((p, k) => l("li", {
3211
3211
  class: "flex-1",
3212
3212
  children: l(cr, {
3213
3213
  type: "submit",
3214
- ref: (b) => {
3215
- b && k === 0 && (p.current = b);
3214
+ ref: (y) => {
3215
+ y && k === 0 && (h.current = y);
3216
3216
  },
3217
- label: h.label,
3217
+ label: p.label,
3218
3218
  value: "true",
3219
3219
  onClick: () => t({
3220
3220
  type: "enum",
3221
- value: [h.value]
3221
+ value: [p.value]
3222
3222
  })
3223
3223
  })
3224
- }, h.value))
3224
+ }, p.value))
3225
3225
  }) : l("form", {
3226
3226
  noValidate: !0,
3227
- onSubmit: (h) => u((k) => {
3228
- const b = k.checked;
3227
+ onSubmit: (p) => u((k) => {
3228
+ const y = k.checked;
3229
3229
  t({
3230
3230
  type: "enum",
3231
- value: b
3231
+ value: y
3232
3232
  });
3233
- })(h),
3233
+ })(p),
3234
3234
  children: [l("div", {
3235
3235
  class: "flex items-center gap-1",
3236
3236
  children: [l("ul", {
@@ -3240,31 +3240,31 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3240
3240
  class: Xt({
3241
3241
  variant: e.config.options.length === 1 ? "singleOption" : void 0
3242
3242
  }),
3243
- children: e.config.options.map((h, k) => {
3244
- const b = `checked.${h.value}`, {
3243
+ children: e.config.options.map((p, k) => {
3244
+ const y = `checked.${p.value}`, {
3245
3245
  ref: A,
3246
3246
  ...S
3247
- } = i(b);
3247
+ } = i(y);
3248
3248
  return l("li", {
3249
3249
  class: "relative",
3250
3250
  children: l(ds, {
3251
- option: h,
3251
+ option: p,
3252
3252
  autoFocus: k === 0,
3253
3253
  ref: (E) => {
3254
- E && k === 0 && (p.current = E), A(E);
3254
+ E && k === 0 && (h.current = E), A(E);
3255
3255
  },
3256
- id: b,
3256
+ id: y,
3257
3257
  ...S,
3258
3258
  onClick: n ? () => t({
3259
3259
  type: "enum",
3260
- value: [h.value]
3260
+ value: [p.value]
3261
3261
  }) : void 0
3262
3262
  })
3263
- }, h.value);
3263
+ }, p.value);
3264
3264
  })
3265
3265
  }), l("div", {
3266
3266
  class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
3267
- children: [n ? null : l(be, {}), e.config.minSelected === 0 && l(ve, {
3267
+ children: [n ? null : l(ye, {}), e.config.minSelected === 0 && l(ve, {
3268
3268
  type: "button",
3269
3269
  onClick: () => t({
3270
3270
  type: "enum",
@@ -3280,14 +3280,14 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3280
3280
  })]
3281
3281
  });
3282
3282
  }, hs = Se("number"), ps = (e, t) => {
3283
- const r = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, a = e.decimalCases ?? 0;
3283
+ const r = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
3284
3284
  return Ye(he({
3285
3285
  number: Pr(t("validation_number"), [$r(r, t("validation_number_min", {
3286
3286
  min: r
3287
3287
  })), jr(n, t("validation_number_max", {
3288
3288
  max: n
3289
- })), zr((s) => s === Number(s.toFixed(a)), t("validation_number_decimal_cases", {
3290
- count: a
3289
+ })), zr((a) => a === Number(a.toFixed(s)), t("validation_number_decimal_cases", {
3290
+ count: s
3291
3291
  }))])
3292
3292
  }));
3293
3293
  }, ms = ({
@@ -3296,9 +3296,9 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3296
3296
  }) => {
3297
3297
  var v;
3298
3298
  const r = e.config.defaultValue, n = e.key ? (v = M.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, {
3299
- t: a
3299
+ t: s
3300
3300
  } = G(), {
3301
- register: s,
3301
+ register: a,
3302
3302
  handleSubmit: i,
3303
3303
  formState: {
3304
3304
  errors: u
@@ -3307,11 +3307,11 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3307
3307
  defaultValues: {
3308
3308
  number: r ? Number(r) : hs(n) ? n.value : void 0
3309
3309
  },
3310
- resolver: ps(e.config, a)
3310
+ resolver: ps(e.config, s)
3311
3311
  }), {
3312
3312
  ref: d,
3313
- ...p
3314
- } = s("number", {
3313
+ ...h
3314
+ } = a("number", {
3315
3315
  required: !e.config.optional,
3316
3316
  valueAsNumber: !0
3317
3317
  }), x = re();
@@ -3319,10 +3319,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3319
3319
  x.current && (x.current.focus(), x.current.select());
3320
3320
  }, []), l("form", {
3321
3321
  class: "flex flex-col gap-1 p-2.5",
3322
- onSubmit: i((h) => {
3323
- h.number !== void 0 && t({
3322
+ onSubmit: i((p) => {
3323
+ p.number !== void 0 && t({
3324
3324
  type: "number",
3325
- value: h.number
3325
+ value: p.number
3326
3326
  });
3327
3327
  }),
3328
3328
  children: [l("div", {
@@ -3330,19 +3330,19 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3330
3330
  children: [l("div", {
3331
3331
  class: "relative min-w-0 flex-grow",
3332
3332
  children: [l("input", {
3333
- ...p,
3333
+ ...h,
3334
3334
  id: "chat-input",
3335
3335
  autocomplete: "off",
3336
3336
  autoCapitalize: "off",
3337
3337
  autoCorrect: "off",
3338
3338
  autoFocus: !0,
3339
- ref: (h) => {
3340
- h && (x.current = h), d(h);
3339
+ ref: (p) => {
3340
+ p && (x.current = p), d(p);
3341
3341
  },
3342
3342
  type: "text",
3343
3343
  min: e.config.min,
3344
3344
  max: e.config.max,
3345
- class: De({
3345
+ class: Re({
3346
3346
  optional: e.config.optional,
3347
3347
  className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
3348
3348
  }),
@@ -3351,7 +3351,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3351
3351
  class: "absolute right-0 top-0",
3352
3352
  onClick: () => t(null)
3353
3353
  })]
3354
- }), l(be, {})]
3354
+ }), l(ye, {})]
3355
3355
  }), l(Ce, {
3356
3356
  error: u.number
3357
3357
  })]
@@ -3362,7 +3362,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3362
3362
  countryCode: "",
3363
3363
  phoneNumber: ""
3364
3364
  };
3365
- const t = Object.entries(mt).find((a) => e.startsWith(a[1])), r = t ? t[1] : "", n = e.replace(r, "");
3365
+ const t = Object.entries(mt).find((s) => e.startsWith(s[1])), r = t ? t[1] : "", n = e.replace(r, "");
3366
3366
  return /^\d+$/.test(n) ? {
3367
3367
  countryCode: r,
3368
3368
  phoneNumber: n
@@ -3370,8 +3370,8 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3370
3370
  countryCode: "",
3371
3371
  phoneNumber: ""
3372
3372
  };
3373
- }, ys = "44", bs = /^[0-9 ]+$/, vs = Se("string"), xs = Se("phone"), ws = (e) => {
3374
- const t = ee(e("validation_country_code"), [qr(bs, e("validation_country_code"))]), r = sr(ee(e("validation_phone"), [Le(1, e("validation_phone"))]), (n) => n.replace(/[^0-9]/g, ""), []);
3373
+ }, bs = "44", ys = /^[0-9 ]+$/, vs = Se("string"), xs = Se("phone"), ws = (e) => {
3374
+ const t = ee(e("validation_country_code"), [qr(ys, e("validation_country_code"))]), r = sr(ee(e("validation_phone"), [Te(1, e("validation_phone"))]), (n) => n.replace(/[^0-9]/g, ""), []);
3375
3375
  return Ye(he({
3376
3376
  countryCode: t,
3377
3377
  phoneNumber: r
@@ -3383,25 +3383,25 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3383
3383
  var A;
3384
3384
  const r = e.key ? (A = M.current$.value.flow) == null ? void 0 : A.data.submissions[e.key] : void 0, {
3385
3385
  t: n
3386
- } = G(), [a, s] = Y(), i = vs(r) ? gs(r.value) : xs(r) ? r.value : void 0, {
3386
+ } = G(), [s, a] = Y(), i = vs(r) ? gs(r.value) : xs(r) ? r.value : void 0, {
3387
3387
  register: u,
3388
3388
  handleSubmit: d,
3389
3389
  formState: {
3390
- errors: p
3390
+ errors: h
3391
3391
  },
3392
3392
  watch: x
3393
3393
  } = Qe({
3394
3394
  defaultValues: {
3395
- countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? ys,
3395
+ countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? bs,
3396
3396
  phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3397
3397
  },
3398
3398
  resolver: ws(n)
3399
3399
  }), {
3400
3400
  ref: v,
3401
- ...h
3401
+ ...p
3402
3402
  } = u("phoneNumber", {
3403
3403
  required: !e.config.optional
3404
- }), k = re(), b = x("countryCode");
3404
+ }), k = re(), y = x("countryCode");
3405
3405
  return pe(() => {
3406
3406
  k.current && (k.current.focus(), k.current.select());
3407
3407
  }, []), l("form", {
@@ -3409,10 +3409,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3409
3409
  class: "flex flex-col gap-1 p-2.5",
3410
3410
  onSubmit: d((S) => {
3411
3411
  const E = S.phoneNumber.replace(/[^0-9]/g, ""), g = S.countryCode.replace(/[^0-9]/g, "");
3412
- s(void 0);
3412
+ a(void 0);
3413
3413
  const N = e.config.minChars ?? 7;
3414
3414
  if (E.length + g.length < N)
3415
- return s(n("validation_phone_min_chars", {
3415
+ return a(n("validation_phone_min_chars", {
3416
3416
  count: N
3417
3417
  }));
3418
3418
  e.config.submissionFormat === "phone" ? t({
@@ -3423,7 +3423,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3423
3423
  }
3424
3424
  }) : t({
3425
3425
  type: "string",
3426
- value: b + S.phoneNumber
3426
+ value: y + S.phoneNumber
3427
3427
  });
3428
3428
  }),
3429
3429
  children: [l("div", {
@@ -3434,7 +3434,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3434
3434
  class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
3435
3435
  htmlFor: `isdk_phone_${e.key}`,
3436
3436
  children: [l("span", {
3437
- children: ["+", b]
3437
+ children: ["+", y]
3438
3438
  }), l("select", {
3439
3439
  ...u("countryCode", {}),
3440
3440
  id: `isdk_phone_${e.key}`,
@@ -3445,7 +3445,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3445
3445
  }, S))
3446
3446
  })]
3447
3447
  }), l("input", {
3448
- ...h,
3448
+ ...p,
3449
3449
  id: "chat-input",
3450
3450
  type: "tel",
3451
3451
  inputMode: "tel",
@@ -3456,19 +3456,19 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3456
3456
  ref: (S) => {
3457
3457
  S && (k.current = S), v(S);
3458
3458
  },
3459
- class: De({
3459
+ class: Re({
3460
3460
  optional: e.config.optional,
3461
- className: "flex-1 rounded-r-full"
3461
+ className: "min-w-0 flex-1 rounded-r-full"
3462
3462
  }),
3463
3463
  placeholder: e.config.placeholder
3464
3464
  }), e.config.optional && l(ve, {
3465
- class: "absolute right-0 top-0",
3465
+ class: "absolute bottom-0 right-0 top-0",
3466
3466
  onClick: () => t(null)
3467
3467
  })]
3468
- }), l(be, {})]
3468
+ }), l(ye, {})]
3469
3469
  }), l(Ce, {
3470
- error: p.countryCode || p.phoneNumber || {
3471
- message: a
3470
+ error: h.countryCode || h.phoneNumber || {
3471
+ message: s
3472
3472
  }
3473
3473
  })]
3474
3474
  });
@@ -3530,9 +3530,9 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3530
3530
  };
3531
3531
  return Ye(he({
3532
3532
  text: {
3533
- email: ee(t("validation_email"), [Ur(t("validation_email")), Le(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)]),
3534
- text: ee([Le(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)]),
3535
- url: ee([Kr(t("validation_url")), Le(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)])
3533
+ email: ee(t("validation_email"), [Ur(t("validation_email")), Te(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)]),
3534
+ text: ee([Te(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)]),
3535
+ url: ee([Kr(t("validation_url")), Te(e.minChars ?? 1, r.minLength), je(e.maxChars ?? 1 / 0, r.maxLength)])
3536
3536
  }[e.format]
3537
3537
  }));
3538
3538
  }, As = ({
@@ -3542,21 +3542,21 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3542
3542
  var v;
3543
3543
  const {
3544
3544
  t: r
3545
- } = G(), n = e.key ? (v = M.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, a = e.config.defaultValue, {
3546
- register: s,
3545
+ } = G(), n = e.key ? (v = M.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, s = e.config.defaultValue, {
3546
+ register: a,
3547
3547
  handleSubmit: i,
3548
3548
  formState: {
3549
3549
  errors: u
3550
3550
  }
3551
3551
  } = Qe({
3552
3552
  defaultValues: {
3553
- text: a || (Cs(n) ? n.value : "")
3553
+ text: s || (Cs(n) ? n.value : "")
3554
3554
  },
3555
3555
  resolver: Es(e.config, r)
3556
3556
  }), {
3557
3557
  ref: d,
3558
- ...p
3559
- } = s("text", {
3558
+ ...h
3559
+ } = a("text", {
3560
3560
  required: !e.config.optional
3561
3561
  }), x = re();
3562
3562
  return pe(() => {
@@ -3564,10 +3564,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3564
3564
  }, []), l("form", {
3565
3565
  noValidate: !0,
3566
3566
  class: "flex flex-col gap-1 p-2.5",
3567
- onSubmit: i((h) => {
3567
+ onSubmit: i((p) => {
3568
3568
  t({
3569
3569
  type: "string",
3570
- value: h.text
3570
+ value: p.text
3571
3571
  });
3572
3572
  }),
3573
3573
  children: [l("div", {
@@ -3576,17 +3576,17 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3576
3576
  class: "relative min-w-0 flex-1",
3577
3577
  children: [l("input", {
3578
3578
  id: "chat-input",
3579
- ...p,
3579
+ ...h,
3580
3580
  ...Ss[e.config.format],
3581
3581
  autocomplete: "off",
3582
3582
  autoCapitalize: "off",
3583
3583
  autoCorrect: "off",
3584
3584
  autoFocus: !0,
3585
- ref: (h) => {
3586
- h && (x.current = h), d(h);
3585
+ ref: (p) => {
3586
+ p && (x.current = p), d(p);
3587
3587
  },
3588
3588
  placeholder: e.config.placeholder,
3589
- class: De({
3589
+ class: Re({
3590
3590
  optional: !!e.config.optional,
3591
3591
  className: "w-full rounded-full"
3592
3592
  })
@@ -3594,7 +3594,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3594
3594
  class: "absolute right-0 top-0",
3595
3595
  onClick: () => t(null)
3596
3596
  })]
3597
- }), l(be, {})]
3597
+ }), l(ye, {})]
3598
3598
  }), l(Ce, {
3599
3599
  error: u.text
3600
3600
  })]
@@ -3611,16 +3611,16 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3611
3611
  }, Is = ({
3612
3612
  logger: e
3613
3613
  }) => {
3614
- var s;
3615
- const t = (s = M.current$.value.flow) == null ? void 0 : s.data.currentInput, [r, n] = gn(), a = re(null);
3614
+ var a;
3615
+ const t = (a = M.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] = gn(), s = re(null);
3616
3616
  return M.inputHeight$.value = n.height, ue(() => {
3617
- const i = a.current;
3617
+ const i = s.current;
3618
3618
  if (i)
3619
3619
  return i.addEventListener("transitionstart", z.scrollToEnd.smooth), i.addEventListener("transitioncancel", z.scrollToEnd.smooth), i.addEventListener("transitionend", z.scrollToEnd.smooth), () => {
3620
3620
  i.removeEventListener("transitionstart", z.scrollToEnd.smooth), i.removeEventListener("transitioncancel", z.scrollToEnd.smooth), i.removeEventListener("transitionend", z.scrollToEnd.smooth);
3621
3621
  };
3622
3622
  }, []), l("div", {
3623
- ref: a,
3623
+ ref: s,
3624
3624
  class: "ease-expo-out absolute bottom-0 w-full overflow-hidden rounded-b-3xl backdrop-blur-xl transition-all duration-700 will-change-[height]",
3625
3625
  style: {
3626
3626
  height: n.height
@@ -3640,12 +3640,12 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
3640
3640
  children: [l("input", {
3641
3641
  "aria-hidden": "true",
3642
3642
  id: "chat-input",
3643
- class: De({
3643
+ class: Re({
3644
3644
  optional: !1,
3645
3645
  className: "flex-grow rounded-full"
3646
3646
  }),
3647
3647
  disabled: !0
3648
- }), l(be, {
3648
+ }), l(ye, {
3649
3649
  disabled: !0,
3650
3650
  "aria-hidden": "true",
3651
3651
  tabIndex: -1
@@ -3668,48 +3668,48 @@ var Ms = function(e) {
3668
3668
  }), t;
3669
3669
  };
3670
3670
  function Ls(e, t, r) {
3671
- var n = 0, a = 0;
3671
+ var n = 0, s = 0;
3672
3672
  if (e === "")
3673
3673
  return e;
3674
3674
  if (!e || !wr(e))
3675
3675
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
3676
- var s = t;
3677
- Ms(s) || (s = new RegExp("(" + Fs(s) + ")", "gi"));
3678
- for (var i = e.split(s), u = 1, d = i.length; u < d; u += 2) {
3676
+ var a = t;
3677
+ Ms(a) || (a = new RegExp("(" + Fs(a) + ")", "gi"));
3678
+ for (var i = e.split(a), u = 1, d = i.length; u < d; u += 2) {
3679
3679
  if (i[u] === void 0 || i[u - 1] === void 0) {
3680
3680
  console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
3681
3681
  continue;
3682
3682
  }
3683
- a = i[u].length, n += i[u - 1].length, i[u] = r(i[u], u, n), n += a;
3683
+ s = i[u].length, n += i[u - 1].length, i[u] = r(i[u], u, n), n += s;
3684
3684
  }
3685
3685
  return i;
3686
3686
  }
3687
3687
  var Ts = function(t, r, n) {
3688
- return Array.isArray(t) || (t = [t]), Ns(t.map(function(a) {
3689
- return wr(a) ? Ls(a, r, n) : a;
3688
+ return Array.isArray(t) || (t = [t]), Ns(t.map(function(s) {
3689
+ return wr(s) ? Ls(s, r, n) : s;
3690
3690
  }));
3691
3691
  };
3692
- const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]+)\]\(([^)]+)\)/, Os = /(https?:\/\/[^\s]+)/g, Bs = /_(.*?)_/g, Ps = /\*\*(.*?)\*\*/g, Qt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", $s = (e) => {
3693
- const t = $e(e, Ds, (s, i) => {
3694
- const [, u, d] = s.match(Rs) ?? [];
3695
- return d ? l("a", {
3692
+ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]+)\]\(([^)]+)\)/, Os = /(https?:\/\/[^\s]+)/g, Bs = /_(.*?)_/g, Ps = /\*\*(.*?)\*\*/g, $s = /\\n|\n/g, Qt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", js = (e) => {
3693
+ const t = Me(e, Ds, (i, u) => {
3694
+ const [, d, h] = i.match(Rs) ?? [];
3695
+ return h ? l("a", {
3696
3696
  class: Qt,
3697
- href: d,
3698
- children: u ?? d
3699
- }, d + i) : l("span", {
3697
+ href: h,
3698
+ children: d ?? h
3699
+ }, h + u) : l("span", {
3700
3700
  children: "INVALID LINK"
3701
3701
  });
3702
- }), r = $e(t, Os, (s, i) => l("a", {
3702
+ }), r = Me(t, Os, (i, u) => l("a", {
3703
3703
  class: Qt,
3704
- href: s,
3705
- children: s
3706
- }, s + i)), n = $e(r, Bs, (s, i) => l("em", {
3707
- children: s
3708
- }, s + i));
3709
- return $e(n, Ps, (s, i) => l("strong", {
3710
- children: s
3711
- }, s + i));
3712
- }, js = Ze("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
3704
+ href: i,
3705
+ children: i
3706
+ }, i + u)), n = Me(r, Bs, (i, u) => l("em", {
3707
+ children: i
3708
+ }, i + u)), s = Me(n, Ps, (i, u) => l("strong", {
3709
+ children: i
3710
+ }, i + u));
3711
+ return Me(s, $s, (i, u) => l("br", {}, `br-${u}`));
3712
+ }, zs = Ze("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
3713
3713
  variants: {
3714
3714
  side: {
3715
3715
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -3723,24 +3723,24 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3723
3723
  defaultVariants: {
3724
3724
  side: "left"
3725
3725
  }
3726
- }), zs = ({
3726
+ }), qs = ({
3727
3727
  children: e,
3728
3728
  className: t,
3729
3729
  animate: r,
3730
3730
  side: n,
3731
- ...a
3731
+ ...s
3732
3732
  }) => l("p", {
3733
3733
  style: {
3734
3734
  transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
3735
3735
  },
3736
- class: js({
3736
+ class: zs({
3737
3737
  className: t,
3738
3738
  side: n,
3739
3739
  animate: r
3740
3740
  }),
3741
- ...a,
3741
+ ...s,
3742
3742
  children: e
3743
- }), qs = ({
3743
+ }), Us = ({
3744
3744
  message: e
3745
3745
  }) => l("div", {
3746
3746
  class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
@@ -3764,7 +3764,7 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3764
3764
  })
3765
3765
  })]
3766
3766
  })
3767
- }), Us = ({
3767
+ }), Ks = ({
3768
3768
  className: e,
3769
3769
  ...t
3770
3770
  }) => (ue(() => {
@@ -3773,7 +3773,7 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3773
3773
  "aria-hidden": !0,
3774
3774
  children: z.isBotTyping$.value === !0 ? l("div", {
3775
3775
  "aria-label": "Typing…",
3776
- class: Te("flex gap-1 p-4", e),
3776
+ class: De("flex gap-1 p-4", e),
3777
3777
  ...t,
3778
3778
  children: Array.from({
3779
3779
  length: 3
@@ -3784,10 +3784,10 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3784
3784
  }
3785
3785
  }))
3786
3786
  }) : void 0
3787
- })), Ks = {
3787
+ })), Gs = {
3788
3788
  bot: "left",
3789
3789
  user: "right"
3790
- }, Gs = Ze("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
3790
+ }, Hs = Ze("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
3791
3791
  variants: {
3792
3792
  variant: {
3793
3793
  info: "text-neutral-8",
@@ -3796,7 +3796,7 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3796
3796
  success: "text-[#4CAF50]"
3797
3797
  }
3798
3798
  }
3799
- }), Hs = ({
3799
+ }), Ws = ({
3800
3800
  lastSentMessageFooter: e
3801
3801
  }) => {
3802
3802
  var r;
@@ -3806,51 +3806,51 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3806
3806
  }, [t.length]), l("ol", {
3807
3807
  "aria-label": "Chat messages",
3808
3808
  class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
3809
- children: [t.map((n, a) => l(ke, {
3809
+ children: [t.map((n, s) => l(ke, {
3810
3810
  children: l("li", {
3811
3811
  class: "flex",
3812
3812
  children: Ke(n).with({
3813
3813
  type: "system"
3814
- }, (s) => l("p", {
3815
- class: Gs({
3816
- variant: s.variant
3814
+ }, (a) => l("p", {
3815
+ class: Hs({
3816
+ variant: a.variant
3817
3817
  }),
3818
- children: s.text
3818
+ children: a.text
3819
3819
  })).with({
3820
3820
  type: "text",
3821
3821
  author: V.union("bot", "user")
3822
- }, (s) => {
3823
- const i = s.author === "user" && !t.slice(a + 1).some((p) => p.type === "text" && p.author === "user"), u = a === t.length - 1, d = s.author === "bot" ? $s(s.text) : s.text;
3824
- return l(zs, {
3822
+ }, (a) => {
3823
+ const i = a.author === "user" && !t.slice(s + 1).some((h) => h.type === "text" && h.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? js(a.text) : a.text;
3824
+ return l(qs, {
3825
3825
  animate: u,
3826
- side: Ks[s.author],
3826
+ side: Gs[a.author],
3827
3827
  children: [d, i ? e : null]
3828
- }, a);
3828
+ }, s);
3829
3829
  }).with({
3830
3830
  type: "link"
3831
- }, (s) => l(qs, {
3832
- message: s
3831
+ }, (a) => l(Us, {
3832
+ message: a
3833
3833
  })).with({
3834
3834
  type: "image"
3835
- }, (s) => l("img", {
3835
+ }, (a) => l("img", {
3836
3836
  class: "shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",
3837
- src: s.url,
3837
+ src: a.url,
3838
3838
  style: {
3839
- aspectRatio: s.width / s.height
3839
+ aspectRatio: a.width / a.height
3840
3840
  }
3841
3841
  })).with({
3842
3842
  type: "file"
3843
- }, (s) => l(Rn, {
3844
- class: s.author === "bot" ? void 0 : "ml-auto",
3843
+ }, (a) => l(Rn, {
3844
+ class: a.author === "bot" ? void 0 : "ml-auto",
3845
3845
  file: {
3846
- name: s.fileName,
3847
- sizeKb: s.fileSizeKb
3846
+ name: a.fileName,
3847
+ sizeKb: a.fileSizeKb
3848
3848
  }
3849
3849
  })).with({
3850
3850
  type: "loading"
3851
- }, (s) => {
3851
+ }, (a) => {
3852
3852
  const i = t[t.length - 1];
3853
- return !(s === i) || z.isBotTyping$.value ? null : l("div", {
3853
+ return !(a === i) || z.isBotTyping$.value ? null : l("div", {
3854
3854
  class: "flex flex-grow flex-col items-center justify-center",
3855
3855
  children: l(Gr, {
3856
3856
  class: "text-neutral-6 h-8 w-8"
@@ -3858,9 +3858,9 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3858
3858
  });
3859
3859
  }).exhaustive()
3860
3860
  })
3861
- }, a)), l(Us, {}, "typing")]
3861
+ }, s)), l(Ks, {}, "typing")]
3862
3862
  });
3863
- }, ra = ({
3863
+ }, na = ({
3864
3864
  logger: e,
3865
3865
  apiClient: t,
3866
3866
  analytics: r
@@ -3869,15 +3869,15 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3869
3869
  flow: n
3870
3870
  } = M.current$.value;
3871
3871
  le(n, "Flow is required to exist to show chatbot body");
3872
- const a = M.viewState$.value, {
3873
- chatRef: s,
3872
+ const s = M.viewState$.value, {
3873
+ chatRef: a,
3874
3874
  chatService: i
3875
3875
  } = _n(), {
3876
3876
  t: u
3877
- } = G(), [d, p] = Y();
3877
+ } = G(), [d, h] = Y();
3878
3878
  return pe(() => {
3879
- a === "maximised" && z.scrollToEnd.instant();
3880
- }, [a]), pe(() => {
3879
+ s === "maximised" && z.scrollToEnd.instant();
3880
+ }, [s]), pe(() => {
3881
3881
  var S, E;
3882
3882
  const {
3883
3883
  state: x,
@@ -3885,10 +3885,10 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3885
3885
  } = M.current$.peek();
3886
3886
  if (x !== "loaded")
3887
3887
  throw new Error(u("invalid_state"));
3888
- let h = v.data.nodeHistory.at(-1);
3888
+ let p = v.data.nodeHistory.at(-1);
3889
3889
  if (z.scrollToEnd.instant(), M.setInput(void 0), v.data.isFinished)
3890
3890
  return;
3891
- h === void 0 ? (h = er(n.nodes).id, M.setCurrentNodeId(h), r.log({
3891
+ p === void 0 ? (p = er(n.nodes).id, M.setCurrentNodeId(p), r.log({
3892
3892
  event: "FLOW_START",
3893
3893
  properties: {
3894
3894
  flow_id: n.id,
@@ -3898,10 +3898,10 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3898
3898
  job: n.job
3899
3899
  },
3900
3900
  customProperties: (S = n.analytics) == null ? void 0 : S.customProperties
3901
- })) : M.removeMessagesSentByNodeIds([h]);
3901
+ })) : M.removeMessagesSentByNodeIds([p]);
3902
3902
  const {
3903
3903
  interpret: k,
3904
- abort: b,
3904
+ abort: y,
3905
3905
  undo: A
3906
3906
  } = Jr({
3907
3907
  context: n.context,
@@ -3954,17 +3954,17 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3954
3954
  });
3955
3955
  }
3956
3956
  });
3957
- return p(() => A), k(h), b;
3957
+ return h(() => A), k(p), y;
3958
3958
  }, [r, t, i, e, n, u]), l(ke, {
3959
3959
  children: [l("div", {
3960
- ref: s,
3960
+ ref: a,
3961
3961
  className: "hide-scrollbars relative flex w-full max-w-full flex-grow flex-col overflow-y-scroll",
3962
3962
  style: {
3963
3963
  WebkitOverflowScrolling: "touch",
3964
3964
  paddingBottom: M.inputHeight$.value
3965
3965
  },
3966
- children: l(Hs, {
3967
- lastSentMessageFooter: n.data.isFinished || !d ? null : l(Js, {
3966
+ children: l(Ws, {
3967
+ lastSentMessageFooter: n.data.isFinished || !d ? null : l(Zs, {
3968
3968
  undoFn: d
3969
3969
  })
3970
3970
  })
@@ -3972,7 +3972,7 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3972
3972
  logger: e
3973
3973
  })]
3974
3974
  });
3975
- }, Ws = (e) => "key" in e.data && e.data.key ? [e.data.key] : "keys" in e.data ? Object.values(e.data.keys).filter((t) => typeof t == "string") : [], Js = ({
3975
+ }, Js = (e) => "key" in e.data && e.data.key ? [e.data.key] : "keys" in e.data ? Object.values(e.data.keys).filter((t) => typeof t == "string") : [], Zs = ({
3976
3976
  undoFn: e
3977
3977
  }) => {
3978
3978
  const {
@@ -3989,8 +3989,8 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3989
3989
  le(r);
3990
3990
  const {
3991
3991
  removed: n
3992
- } = e(r.data.nodeHistory), a = r.data.nodeHistory.splice(-n);
3993
- a.length !== 0 && (M.removeMessagesSentByNodeIds(a), M.setInput(void 0), a.pop(), a.map((s) => r.nodes.find((i) => i.id === s)).filter(Boolean).flatMap(Ws).forEach((s) => delete r.data.submissions[s]), M.current$.value = {
3992
+ } = e(r.data.nodeHistory), s = r.data.nodeHistory.splice(-n);
3993
+ s.length !== 0 && (M.removeMessagesSentByNodeIds(s), M.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(Js).forEach((a) => delete r.data.submissions[a]), M.current$.value = {
3994
3994
  ...M.current$.value
3995
3995
  });
3996
3996
  },
@@ -3999,5 +3999,5 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
3999
3999
  });
4000
4000
  };
4001
4001
  export {
4002
- ra as ChatbotBody
4002
+ na as ChatbotBody
4003
4003
  };