@inploi/plugin-chatbot 5.1.0 → 5.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.
Files changed (53) hide show
  1. package/cdn/index.js +3 -3
  2. package/cdn/style.css +1 -1
  3. package/dist/{chatbot-body-81bfa2bc.js → chatbot-body-4dab3467.js} +315 -332
  4. package/dist/{chatbot-body-f17e1b0d.cjs → chatbot-body-f463d29c.cjs} +1 -1
  5. package/dist/chatbot.api.d.ts +43 -42
  6. package/dist/chatbot.d.ts +28 -22
  7. package/dist/chatbot.idb.d.ts +2 -1
  8. package/dist/chatbot.state.d.ts +5 -4
  9. package/dist/chatbot.utils.d.ts +6 -17
  10. package/dist/components/chat-bubble.d.ts +5 -4
  11. package/dist/components/chat-input/chat-input.address.d.ts +2 -1
  12. package/dist/components/chat-input/chat-input.boolean.d.ts +3 -2
  13. package/dist/components/chat-input/chat-input.d.ts +1 -0
  14. package/dist/components/chat-input/chat-input.file.d.ts +3 -2
  15. package/dist/components/chat-input/chat-input.multiple-choice.d.ts +1 -0
  16. package/dist/components/chat-input/chat-input.number.d.ts +1 -0
  17. package/dist/components/chat-input/chat-input.phone-number.d.ts +2 -1
  18. package/dist/components/chat-input/chat-input.submit.d.ts +1 -0
  19. package/dist/components/chat-input/chat-input.text.d.ts +2 -1
  20. package/dist/components/chat-input/input-style.d.ts +1 -1
  21. package/dist/components/chatbot-body.d.ts +2 -1
  22. package/dist/components/chatbot.d.ts +2 -1
  23. package/dist/components/conversation.d.ts +1 -0
  24. package/dist/components/loading-indicator.d.ts +2 -1
  25. package/dist/components/message.link.d.ts +2 -1
  26. package/dist/components/send-button.d.ts +2 -1
  27. package/dist/components/skip-button.d.ts +2 -1
  28. package/dist/components/status-bar.d.ts +4 -3
  29. package/dist/components/typing-indicator.d.ts +2 -1
  30. package/dist/components/useChatService.d.ts +4 -3
  31. package/dist/components/useFocus.d.ts +1 -1
  32. package/dist/conditions.d.ts +1 -0
  33. package/dist/i18n.d.ts +6 -5
  34. package/dist/{index-4da34b43.js → index-06a5df34.js} +732 -721
  35. package/dist/index-97d91e46.cjs +5 -0
  36. package/dist/index.cdn.d.ts +1 -0
  37. package/dist/index.dev.d.ts +1 -0
  38. package/dist/interpolation.d.ts +1 -0
  39. package/dist/interpreter.d.ts +2 -1
  40. package/dist/mocks/browser.d.ts +1 -1
  41. package/dist/mocks/flows.mocks.d.ts +1 -0
  42. package/dist/mocks/handlers.d.ts +6 -6
  43. package/dist/mocks/mocks.utils.d.ts +3 -2
  44. package/dist/plugin-chatbot.cjs +1 -1
  45. package/dist/plugin-chatbot.js +1 -1
  46. package/dist/progress.d.ts +1 -0
  47. package/dist/rpc.d.ts +7 -7
  48. package/dist/style/theme.d.ts +2 -1
  49. package/dist/style/theme.utils.d.ts +1 -0
  50. package/dist/style/tokens.d.ts +17 -21
  51. package/dist/style.css +1 -1
  52. package/package.json +7 -7
  53. package/dist/index-610bb8d8.cjs +0 -5
@@ -1,4 +1,4 @@
1
- import { g as Ke, i as er, k as Te, a as tr, b as le, A as Le, c as Mr, N as Ge, _ as D, d as rr, h as ee, e as re, p as ue, F as mt, u as G, o as l, f as Re, j as ft, y as pe, s as I, l as Xe, m as ve, n as Fr, q as he, r as Lr, t as it, v as X, w as Nr, x as nr, z as Tr, B as sr, C as Dr, D as Ce, E as Y, G as Rr, V as Or, H as be, I as De, J as ze, K as ar, 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, W as Hr, X as Wr } from "./index-4da34b43.js";
1
+ import { g as Ke, i as er, k as Te, a as tr, b as fe, A as Le, c as Mr, N as Ge, _ as T, d as rr, h as ee, e as re, p as le, F as mt, u as G, o as l, f as Re, j as ft, y as pe, s as I, l as Xe, m as ve, n as Fr, q as he, r as Lr, t as it, v as X, w as Nr, x as nr, z as Tr, B as sr, C as Dr, D as Ce, E as Y, G as Rr, V as Or, H as be, I as De, J as ze, K as ar, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as Ur, S as qr, T as Kr, U as Gr, W as Hr, X as Wr } from "./index-06a5df34.js";
2
2
  import "@inploi/sdk";
3
3
  const Lt = ({
4
4
  condition: e,
@@ -265,16 +265,16 @@ const Lt = ({
265
265
  let w = new AbortController();
266
266
  const v = {
267
267
  ...t.service,
268
- log: (k) => t.service.log({
269
- ...k,
268
+ log: (_) => t.service.log({
269
+ ..._,
270
270
  customProperties: {
271
- ...k.customProperties,
271
+ ..._.customProperties,
272
272
  ...t.customProperties
273
273
  }
274
274
  })
275
- }, h = async (k, b) => {
275
+ }, h = async (_, b) => {
276
276
  const A = a();
277
- d == null || d(k, b);
277
+ d == null || d(_, b);
278
278
  try {
279
279
  await Qr({
280
280
  flow: e,
@@ -282,12 +282,12 @@ const Lt = ({
282
282
  logger: r,
283
283
  apiClient: s,
284
284
  context: n,
285
- node: k,
285
+ node: _,
286
286
  submissions: A,
287
287
  t: p,
288
288
  chat: {
289
289
  sendMessage: async (S) => i.send({
290
- groupId: k.id,
290
+ groupId: _.id,
291
291
  message: S,
292
292
  signal: w.signal
293
293
  }),
@@ -299,12 +299,12 @@ const Lt = ({
299
299
  },
300
300
  next: (S) => {
301
301
  const E = S ? e.nodes.find((g) => g.id === S) : Zr({
302
- childNode: k,
302
+ childNode: _,
303
303
  nodes: e.nodes
304
304
  });
305
- return E ? h(E, k) : u == null ? void 0 : u(k);
305
+ return E ? h(E, _) : u == null ? void 0 : u(_);
306
306
  },
307
- end: () => u == null ? void 0 : u(k)
307
+ end: () => u == null ? void 0 : u(_)
308
308
  });
309
309
  } catch (S) {
310
310
  if (S instanceof Le)
@@ -313,21 +313,21 @@ const Lt = ({
313
313
  }
314
314
  };
315
315
  return {
316
- interpret: async (k) => {
317
- const b = e.nodes.find((A) => A.id === k) ?? tr(e.nodes);
316
+ interpret: async (_) => {
317
+ const b = e.nodes.find((A) => A.id === _) ?? tr(e.nodes);
318
318
  return h(b);
319
319
  },
320
- undo: (k) => {
320
+ undo: (_) => {
321
321
  let b = 1;
322
- const A = e.nodes.find((E) => E.id === k[k.length - 1]);
323
- for (let E = k.length - 2; E > 0; E--) {
324
- const g = k[E], M = e.nodes.find((R) => R.id === g);
325
- if (!M || (b++, M.type.startsWith("question-")))
322
+ const A = e.nodes.find((E) => E.id === _[_.length - 1]);
323
+ for (let E = _.length - 2; E > 0; E--) {
324
+ const g = _[E], F = e.nodes.find((j) => j.id === g);
325
+ if (!F || (b++, F.type.startsWith("question-")))
326
326
  break;
327
327
  }
328
328
  w.abort(), w = 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), {
329
+ const S = e.nodes.find((E) => E.id === _[_.length - b]);
330
+ return fe(S, "Undo failed: new start node not found"), h(S, A), {
331
331
  removed: b
332
332
  };
333
333
  },
@@ -525,7 +525,7 @@ async function nn({
525
525
  const {
526
526
  anonymous_id: v,
527
527
  session_id: h
528
- } = i.getSessionInfo(), k = await s.fetch("/flow/submit", {
528
+ } = i.getSessionInfo(), _ = await s.fetch("/flow/submit", {
529
529
  method: "POST",
530
530
  body: JSON.stringify({
531
531
  log_submit: !1,
@@ -538,18 +538,18 @@ async function nn({
538
538
  }).catch((b) => b);
539
539
  r.data.key && e.addToSubmissions(r.data.key, {
540
540
  type: "integration",
541
- value: k
542
- }), Ge(k).with({
543
- integration_response: D.select(D.union({
544
- service: D.optional(D.string),
545
- status: D.number,
546
- data: D.any
541
+ value: _
542
+ }), Ge(_).with({
543
+ integration_response: T.select(T.union({
544
+ service: T.optional(T.string),
545
+ status: T.number,
546
+ data: T.any
547
547
  }, {
548
- service: D.optional(D.string),
549
- status: D.number,
548
+ service: T.optional(T.string),
549
+ status: T.number,
550
550
  error: {
551
- message: D.string,
552
- data: D.any
551
+ message: T.string,
552
+ data: T.any
553
553
  }
554
554
  }))
555
555
  }, (b) => {
@@ -569,12 +569,12 @@ async function nn({
569
569
  }
570
570
  });
571
571
  }).otherwise(() => {
572
- }), await Ge(k).with({
572
+ }), await Ge(_).with({
573
573
  integration_response: {
574
- data: D.select("redirect", {
575
- redirect_url: D.string,
576
- message: D.optional(D.union(D.string, D.nullish)),
577
- button_text: D.optional(D.union(D.string, D.nullish))
574
+ data: T.select("redirect", {
575
+ redirect_url: T.string,
576
+ message: T.optional(T.union(T.string, T.nullish)),
577
+ button_text: T.optional(T.union(T.string, T.nullish))
578
578
  })
579
579
  }
580
580
  }, async (b) => {
@@ -625,8 +625,8 @@ async function nn({
625
625
  }), t(r.nextId);
626
626
  }).with({
627
627
  integration_response: {
628
- error: D.select("error", {
629
- message: D.string
628
+ error: T.select("error", {
629
+ message: T.string
630
630
  })
631
631
  }
632
632
  }, async (b) => {
@@ -1068,31 +1068,31 @@ function bn(e) {
1068
1068
  resizeObserver: null,
1069
1069
  lastBounds: i
1070
1070
  }), p = t ? typeof t == "number" ? t : t.scroll : null, w = t ? typeof t == "number" ? t : t.resize : null, v = re(!1);
1071
- ue(() => (v.current = !0, () => void (v.current = !1)));
1072
- const [h, k, b] = mt(() => {
1071
+ le(() => (v.current = !0, () => void (v.current = !1)));
1072
+ const [h, _, b] = mt(() => {
1073
1073
  const g = () => {
1074
1074
  if (!d.current.element)
1075
1075
  return;
1076
1076
  const {
1077
- left: M,
1078
- top: R,
1079
- width: N,
1077
+ left: F,
1078
+ top: j,
1079
+ width: D,
1080
1080
  height: me,
1081
- bottom: ce,
1081
+ bottom: ue,
1082
1082
  right: Ae,
1083
1083
  x: H,
1084
1084
  y: se
1085
- } = d.current.element.getBoundingClientRect(), q = {
1086
- left: M,
1087
- top: R,
1088
- width: N,
1085
+ } = d.current.element.getBoundingClientRect(), U = {
1086
+ left: F,
1087
+ top: j,
1088
+ width: D,
1089
1089
  height: me,
1090
- bottom: ce,
1090
+ bottom: ue,
1091
1091
  right: Ae,
1092
1092
  x: H,
1093
1093
  y: se
1094
1094
  };
1095
- d.current.element instanceof HTMLElement && s && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), v.current && !_n(d.current.lastBounds, q) && u(d.current.lastBounds = q);
1095
+ d.current.element instanceof HTMLElement && s && (U.height = d.current.element.offsetHeight, U.width = d.current.element.offsetWidth), Object.freeze(U), v.current && !kn(d.current.lastBounds, U) && u(d.current.lastBounds = U);
1096
1096
  };
1097
1097
  return [g, w ? Nt(g, w) : g, p ? Nt(g, p) : g];
1098
1098
  }, [u, s, p, w]);
@@ -1108,18 +1108,18 @@ function bn(e) {
1108
1108
  const E = (g) => {
1109
1109
  !g || g === d.current.element || (A(), d.current.element = g, d.current.scrollContainers = lr(g), S());
1110
1110
  };
1111
- return xn(b, !!r), vn(k), ue(() => {
1111
+ return xn(b, !!r), vn(_), le(() => {
1112
1112
  A(), S();
1113
- }, [r, b, k]), ue(() => A, []), [E, i, h];
1113
+ }, [r, b, _]), le(() => A, []), [E, i, h];
1114
1114
  }
1115
1115
  function vn(e) {
1116
- ue(() => {
1116
+ le(() => {
1117
1117
  const t = e;
1118
1118
  return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
1119
1119
  }, [e]);
1120
1120
  }
1121
1121
  function xn(e, t) {
1122
- ue(() => {
1122
+ le(() => {
1123
1123
  if (t) {
1124
1124
  const r = e;
1125
1125
  return window.addEventListener("scroll", r, {
@@ -1140,7 +1140,7 @@ function lr(e) {
1140
1140
  } = window.getComputedStyle(e);
1141
1141
  return [r, n, s].some((a) => a === "auto" || a === "scroll") && t.push(e), [...t, ...lr(e.parentElement)];
1142
1142
  }
1143
- const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n = (e, t) => wn.every((r) => e[r] === t[r]), xe = ({
1143
+ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn = (e, t) => wn.every((r) => e[r] === t[r]), xe = ({
1144
1144
  class: e,
1145
1145
  ...t
1146
1146
  }) => {
@@ -1169,7 +1169,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1169
1169
  })]
1170
1170
  })
1171
1171
  });
1172
- }, kn = 25, pt = ft({
1172
+ }, _n = 25, pt = ft({
1173
1173
  instant: () => {
1174
1174
  },
1175
1175
  smooth: () => {
@@ -1215,7 +1215,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1215
1215
  if (s != null && s.aborted)
1216
1216
  throw new Le();
1217
1217
  z.isBotTyping$.value = !0;
1218
- const u = Math.min(Math.max(20, i.text.length), 100) * kn;
1218
+ const u = Math.min(Math.max(20, i.text.length), 100) * _n;
1219
1219
  await new Promise((d) => setTimeout(d, u, {
1220
1220
  signal: s
1221
1221
  })), z.isBotTyping$.value = !1;
@@ -1617,18 +1617,18 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1617
1617
  return {
1618
1618
  ok: !0,
1619
1619
  data: w.map((h) => {
1620
- var k, b, A, S, E, g, M, R, N;
1620
+ var _, b, A, S, E, g, F, j, D;
1621
1621
  return {
1622
1622
  label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
1623
1623
  id: h.mapbox_id,
1624
1624
  address: {
1625
- line1: ((k = h.context.address) == null ? void 0 : k.name) ?? ((b = h.context.street) == null ? void 0 : b.name),
1625
+ line1: ((_ = h.context.address) == null ? void 0 : _.name) ?? ((b = h.context.street) == null ? void 0 : b.name),
1626
1626
  line2: void 0,
1627
1627
  line3: ((A = h.context.neighborhood) == null ? void 0 : A.name) ?? ((S = h.context.locality) == null ? void 0 : S.name),
1628
1628
  city: ((E = h.context.place) == null ? void 0 : E.name) ?? ((g = h.context.district) == null ? void 0 : g.name),
1629
- state: (M = h.context.region) == null ? void 0 : M.name,
1630
- postcode: (R = h.context.postcode) == null ? void 0 : R.name,
1631
- country: (N = h.context.country) == null ? void 0 : N.name
1629
+ state: (F = h.context.region) == null ? void 0 : F.name,
1630
+ postcode: (j = h.context.postcode) == null ? void 0 : j.name,
1631
+ country: (D = h.context.country) == null ? void 0 : D.name
1632
1632
  }
1633
1633
  };
1634
1634
  })
@@ -1673,8 +1673,8 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1673
1673
  } = In({
1674
1674
  logger: r,
1675
1675
  t: n
1676
- }), [w, v] = ee(d ? "query" : "manual"), [h, k] = ee(""), [b, A] = ee(), S = (E) => {
1677
- 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) => {
1676
+ }), [w, v] = ee(d ? "query" : "manual"), [h, _] = ee(""), [b, A] = ee(), S = (E) => {
1677
+ fe(d, "Query state should not be enabled"), E = E.trim(), E !== (h == null ? void 0 : h.trim()) && (_(E), E === "" && u([]), A(void 0), p(E).then((g) => {
1678
1678
  if (g.ok === !1) {
1679
1679
  u([]), A(g.error);
1680
1680
  return;
@@ -1684,7 +1684,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1684
1684
  };
1685
1685
  switch (w) {
1686
1686
  case "query":
1687
- return le(d, "Query state should not be enabled"), l(Fn, {
1687
+ return fe(d, "Query state should not be enabled"), l(Fn, {
1688
1688
  input: e,
1689
1689
  onSkip: () => t(null),
1690
1690
  onAddressSelect: (E) => {
@@ -1692,7 +1692,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1692
1692
  a(void 0), v("manual");
1693
1693
  return;
1694
1694
  }
1695
- const g = i.find((M) => M.id === E);
1695
+ const g = i.find((F) => F.id === E);
1696
1696
  g && (a(g.address), v("details"));
1697
1697
  },
1698
1698
  onAddressSearch: (E) => {
@@ -1703,7 +1703,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1703
1703
  error: b
1704
1704
  });
1705
1705
  case "details":
1706
- return le(s !== void 0), l(Rt, {
1706
+ return fe(s !== void 0), l(Rt, {
1707
1707
  input: e,
1708
1708
  logger: r,
1709
1709
  onSubmitSuccess: t,
@@ -1935,7 +1935,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
1935
1935
  });
1936
1936
  }, yt = () => {
1937
1937
  const e = re(null);
1938
- return ue(() => {
1938
+ return le(() => {
1939
1939
  var t;
1940
1940
  (t = e.current) == null || t.focus();
1941
1941
  }, []), e;
@@ -2077,14 +2077,14 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
2077
2077
  children: [l("ul", {
2078
2078
  class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
2079
2079
  children: [n.slice(0, Ot).map((h) => {
2080
- const k = h.name.split(".").pop(), b = h.name.replace(new RegExp(`.${k}$`), "");
2080
+ const _ = h.name.split(".").pop(), b = h.name.replace(new RegExp(`.${_}$`), "");
2081
2081
  return l(Bt, {
2082
2082
  class: "flex overflow-hidden",
2083
2083
  children: [l("span", {
2084
2084
  class: "block truncate",
2085
2085
  children: b
2086
2086
  }), l("span", {
2087
- children: [".", k]
2087
+ children: [".", _]
2088
2088
  })]
2089
2089
  });
2090
2090
  }), u > 0 ? l(Bt, {
@@ -2140,8 +2140,8 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
2140
2140
  }), l("input", {
2141
2141
  id: "dropzone-file",
2142
2142
  onInput: async (h) => {
2143
- le(h.target instanceof HTMLInputElement);
2144
- const k = h.target.files ? Array.from(h.target.files) : [], b = await Promise.allSettled(k.map(async (S) => {
2143
+ fe(h.target instanceof HTMLInputElement);
2144
+ const _ = h.target.files ? Array.from(h.target.files) : [], b = await Promise.allSettled(_.map(async (S) => {
2145
2145
  const E = await Dn(S);
2146
2146
  return {
2147
2147
  name: $n(S.name, 42),
@@ -2176,11 +2176,11 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n =
2176
2176
  })]
2177
2177
  });
2178
2178
  };
2179
- var Be = (e) => e.type === "checkbox", Se = (e) => e instanceof Date, U = (e) => e == null;
2179
+ var Be = (e) => e.type === "checkbox", Se = (e) => e instanceof Date, q = (e) => e == null;
2180
2180
  const hr = (e) => typeof e == "object";
2181
- var $ = (e) => !U(e) && !Array.isArray(e) && hr(e) && !Se(e), zn = (e) => $(e) && e.target ? Be(e.target) ? e.target.checked : e.target.value : e, qn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Un = (e, t) => e.has(qn(t)), Kn = (e) => {
2181
+ var P = (e) => !q(e) && !Array.isArray(e) && hr(e) && !Se(e), zn = (e) => P(e) && e.target ? Be(e.target) ? e.target.checked : e.target.value : e, Un = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, qn = (e, t) => e.has(Un(t)), Kn = (e) => {
2182
2182
  const t = e.constructor && e.constructor.prototype;
2183
- return $(t) && t.hasOwnProperty("isPrototypeOf");
2183
+ return P(t) && t.hasOwnProperty("isPrototypeOf");
2184
2184
  }, bt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2185
2185
  function oe(e) {
2186
2186
  let t;
@@ -2189,7 +2189,7 @@ function oe(e) {
2189
2189
  t = new Date(e);
2190
2190
  else if (e instanceof Set)
2191
2191
  t = new Set(e);
2192
- else if (!(bt && (e instanceof Blob || e instanceof FileList)) && (r || $(e)))
2192
+ else if (!(bt && (e instanceof Blob || e instanceof FileList)) && (r || P(e)))
2193
2193
  if (t = r ? [] : {}, !r && !Kn(e))
2194
2194
  t = e;
2195
2195
  else
@@ -2199,12 +2199,12 @@ function oe(e) {
2199
2199
  return e;
2200
2200
  return t;
2201
2201
  }
2202
- var Pe = (e) => Array.isArray(e) ? e.filter(Boolean) : [], B = (e) => e === void 0, x = (e, t, r) => {
2203
- if (!t || !$(e))
2202
+ var Pe = (e) => Array.isArray(e) ? e.filter(Boolean) : [], O = (e) => e === void 0, x = (e, t, r) => {
2203
+ if (!t || !P(e))
2204
2204
  return r;
2205
- const n = Pe(t.split(/[,[\].]+?/)).reduce((s, a) => U(s) ? s : s[a], e);
2206
- return B(n) || n === e ? B(e[t]) ? r : e[t] : n;
2207
- }, de = (e) => typeof e == "boolean";
2205
+ const n = Pe(t.split(/[,[\].]+?/)).reduce((s, a) => q(s) ? s : s[a], e);
2206
+ return O(n) || n === e ? O(e[t]) ? r : e[t] : n;
2207
+ }, ce = (e) => typeof e == "boolean";
2208
2208
  const Pt = {
2209
2209
  BLUR: "blur",
2210
2210
  FOCUS_OUT: "focusout",
@@ -2237,7 +2237,7 @@ var Gn = (e, t, r, n = !0) => {
2237
2237
  }
2238
2238
  });
2239
2239
  return s;
2240
- }, J = (e) => $(e) && !Object.keys(e).length, Hn = (e, t, r, n) => {
2240
+ }, J = (e) => P(e) && !Object.keys(e).length, Hn = (e, t, r, n) => {
2241
2241
  r(e);
2242
2242
  const { name: s, ...a } = e;
2243
2243
  return J(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((i) => t[i] === (!n || Z.all));
@@ -2262,7 +2262,7 @@ function L(e, t, r) {
2262
2262
  let d = r;
2263
2263
  if (n !== i) {
2264
2264
  const p = e[u];
2265
- d = $(p) || Array.isArray(p) ? p : isNaN(+s[n + 1]) ? {} : [];
2265
+ d = P(p) || Array.isArray(p) ? p : isNaN(+s[n + 1]) ? {} : [];
2266
2266
  }
2267
2267
  e[u] = d, e = e[u];
2268
2268
  }
@@ -2281,7 +2281,7 @@ var mr = (e, t, r, n, s) => t ? {
2281
2281
  isOnAll: e === Z.all,
2282
2282
  isOnTouch: e === Z.onTouched
2283
2283
  }), jt = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
2284
- const qe = (e, t, r, n) => {
2284
+ const Ue = (e, t, r, n) => {
2285
2285
  for (const s of r || Object.keys(e)) {
2286
2286
  const a = x(e, s);
2287
2287
  if (a) {
@@ -2292,23 +2292,23 @@ const qe = (e, t, r, n) => {
2292
2292
  if (i.ref && t(i.ref, i.name) && !n)
2293
2293
  break;
2294
2294
  } else
2295
- $(u) && qe(u, t);
2295
+ P(u) && Ue(u, t);
2296
2296
  }
2297
2297
  }
2298
2298
  };
2299
2299
  var Zn = (e, t, r) => {
2300
2300
  const n = Pe(x(e, r));
2301
2301
  return L(n, "root", t[r]), L(e, r, n), e;
2302
- }, xt = (e) => e.type === "file", fe = (e) => typeof e == "function", He = (e) => {
2302
+ }, xt = (e) => e.type === "file", de = (e) => typeof e == "function", He = (e) => {
2303
2303
  if (!bt)
2304
2304
  return !1;
2305
2305
  const t = e ? e.ownerDocument : 0;
2306
2306
  return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
2307
- }, Ue = (e) => te(e), wt = (e) => e.type === "radio", We = (e) => e instanceof RegExp;
2307
+ }, qe = (e) => te(e), wt = (e) => e.type === "radio", We = (e) => e instanceof RegExp;
2308
2308
  const zt = {
2309
2309
  value: !1,
2310
2310
  isValid: !1
2311
- }, qt = { value: !0, isValid: !0 };
2311
+ }, Ut = { value: !0, isValid: !0 };
2312
2312
  var gr = (e) => {
2313
2313
  if (Array.isArray(e)) {
2314
2314
  if (e.length > 1) {
@@ -2317,127 +2317,127 @@ var gr = (e) => {
2317
2317
  }
2318
2318
  return e[0].checked && !e[0].disabled ? (
2319
2319
  // @ts-expect-error expected to work in the browser
2320
- e[0].attributes && !B(e[0].attributes.value) ? B(e[0].value) || e[0].value === "" ? qt : { value: e[0].value, isValid: !0 } : qt
2320
+ e[0].attributes && !O(e[0].attributes.value) ? O(e[0].value) || e[0].value === "" ? Ut : { value: e[0].value, isValid: !0 } : Ut
2321
2321
  ) : zt;
2322
2322
  }
2323
2323
  return zt;
2324
2324
  };
2325
- const Ut = {
2325
+ const qt = {
2326
2326
  isValid: !1,
2327
2327
  value: null
2328
2328
  };
2329
2329
  var yr = (e) => Array.isArray(e) ? e.reduce((t, r) => r && r.checked && !r.disabled ? {
2330
2330
  isValid: !0,
2331
2331
  value: r.value
2332
- } : t, Ut) : Ut;
2332
+ } : t, qt) : qt;
2333
2333
  function Kt(e, t, r = "validate") {
2334
- if (Ue(e) || Array.isArray(e) && e.every(Ue) || de(e) && !e)
2334
+ if (qe(e) || Array.isArray(e) && e.every(qe) || ce(e) && !e)
2335
2335
  return {
2336
2336
  type: r,
2337
- message: Ue(e) ? e : "",
2337
+ message: qe(e) ? e : "",
2338
2338
  ref: t
2339
2339
  };
2340
2340
  }
2341
- var ke = (e) => $(e) && !We(e) ? e : {
2341
+ var _e = (e) => P(e) && !We(e) ? e : {
2342
2342
  value: e,
2343
2343
  message: ""
2344
2344
  }, Gt = async (e, t, r, n, s) => {
2345
- const { ref: a, refs: i, required: u, maxLength: d, minLength: p, min: w, max: v, pattern: h, validate: k, name: b, valueAsNumber: A, mount: S, disabled: E } = e._f, g = x(t, b);
2345
+ const { ref: a, refs: i, required: u, maxLength: d, minLength: p, min: w, max: v, pattern: h, validate: _, name: b, valueAsNumber: A, mount: S, disabled: E } = e._f, g = x(t, b);
2346
2346
  if (!S || E)
2347
2347
  return {};
2348
- const M = i ? i[0] : a, R = (F) => {
2349
- n && M.reportValidity && (M.setCustomValidity(de(F) ? "" : F || ""), M.reportValidity());
2350
- }, N = {}, me = wt(a), ce = Be(a), Ae = me || ce, H = (A || xt(a)) && B(a.value) && B(g) || He(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = mr.bind(null, b, r, N), q = (F, V, O, K = ie.maxLength, W = ie.minLength) => {
2351
- const Q = F ? V : O;
2352
- N[b] = {
2353
- type: F ? K : W,
2348
+ const F = i ? i[0] : a, j = (M) => {
2349
+ n && F.reportValidity && (F.setCustomValidity(ce(M) ? "" : M || ""), F.reportValidity());
2350
+ }, D = {}, me = wt(a), ue = Be(a), Ae = me || ue, H = (A || xt(a)) && O(a.value) && O(g) || He(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = mr.bind(null, b, r, D), U = (M, V, R, K = ie.maxLength, W = ie.minLength) => {
2351
+ const Q = M ? V : R;
2352
+ D[b] = {
2353
+ type: M ? K : W,
2354
2354
  message: Q,
2355
2355
  ref: a,
2356
- ...se(F ? K : W, Q)
2356
+ ...se(M ? K : W, Q)
2357
2357
  };
2358
2358
  };
2359
- if (s ? !Array.isArray(g) || !g.length : u && (!Ae && (H || U(g)) || de(g) && !g || ce && !gr(i).isValid || me && !yr(i).isValid)) {
2360
- const { value: F, message: V } = Ue(u) ? { value: !!u, message: u } : ke(u);
2361
- if (F && (N[b] = {
2359
+ if (s ? !Array.isArray(g) || !g.length : u && (!Ae && (H || q(g)) || ce(g) && !g || ue && !gr(i).isValid || me && !yr(i).isValid)) {
2360
+ const { value: M, message: V } = qe(u) ? { value: !!u, message: u } : _e(u);
2361
+ if (M && (D[b] = {
2362
2362
  type: ie.required,
2363
2363
  message: V,
2364
- ref: M,
2364
+ ref: F,
2365
2365
  ...se(ie.required, V)
2366
2366
  }, !r))
2367
- return R(V), N;
2367
+ return j(V), D;
2368
2368
  }
2369
- if (!H && (!U(w) || !U(v))) {
2370
- let F, V;
2371
- const O = ke(v), K = ke(w);
2372
- if (!U(g) && !isNaN(g)) {
2369
+ if (!H && (!q(w) || !q(v))) {
2370
+ let M, V;
2371
+ const R = _e(v), K = _e(w);
2372
+ if (!q(g) && !isNaN(g)) {
2373
2373
  const W = a.valueAsNumber || g && +g;
2374
- U(O.value) || (F = W > O.value), U(K.value) || (V = W < K.value);
2374
+ q(R.value) || (M = W > R.value), q(K.value) || (V = W < K.value);
2375
2375
  } else {
2376
2376
  const W = a.valueAsDate || new Date(g), Q = ($e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + $e), ge = a.type == "time", Ve = a.type == "week";
2377
- te(O.value) && g && (F = ge ? Q(g) > Q(O.value) : Ve ? g > O.value : W > new Date(O.value)), te(K.value) && g && (V = ge ? Q(g) < Q(K.value) : Ve ? g < K.value : W < new Date(K.value));
2377
+ te(R.value) && g && (M = ge ? Q(g) > Q(R.value) : Ve ? g > R.value : W > new Date(R.value)), te(K.value) && g && (V = ge ? Q(g) < Q(K.value) : Ve ? g < K.value : W < new Date(K.value));
2378
2378
  }
2379
- if ((F || V) && (q(!!F, O.message, K.message, ie.max, ie.min), !r))
2380
- return R(N[b].message), N;
2379
+ if ((M || V) && (U(!!M, R.message, K.message, ie.max, ie.min), !r))
2380
+ return j(D[b].message), D;
2381
2381
  }
2382
2382
  if ((d || p) && !H && (te(g) || s && Array.isArray(g))) {
2383
- const F = ke(d), V = ke(p), O = !U(F.value) && g.length > +F.value, K = !U(V.value) && g.length < +V.value;
2384
- if ((O || K) && (q(O, F.message, V.message), !r))
2385
- return R(N[b].message), N;
2383
+ const M = _e(d), V = _e(p), R = !q(M.value) && g.length > +M.value, K = !q(V.value) && g.length < +V.value;
2384
+ if ((R || K) && (U(R, M.message, V.message), !r))
2385
+ return j(D[b].message), D;
2386
2386
  }
2387
2387
  if (h && !H && te(g)) {
2388
- const { value: F, message: V } = ke(h);
2389
- if (We(F) && !g.match(F) && (N[b] = {
2388
+ const { value: M, message: V } = _e(h);
2389
+ if (We(M) && !g.match(M) && (D[b] = {
2390
2390
  type: ie.pattern,
2391
2391
  message: V,
2392
2392
  ref: a,
2393
2393
  ...se(ie.pattern, V)
2394
2394
  }, !r))
2395
- return R(V), N;
2395
+ return j(V), D;
2396
2396
  }
2397
- if (k) {
2398
- if (fe(k)) {
2399
- const F = await k(g, t), V = Kt(F, M);
2400
- if (V && (N[b] = {
2397
+ if (_) {
2398
+ if (de(_)) {
2399
+ const M = await _(g, t), V = Kt(M, F);
2400
+ if (V && (D[b] = {
2401
2401
  ...V,
2402
2402
  ...se(ie.validate, V.message)
2403
2403
  }, !r))
2404
- return R(V.message), N;
2405
- } else if ($(k)) {
2406
- let F = {};
2407
- for (const V in k) {
2408
- if (!J(F) && !r)
2404
+ return j(V.message), D;
2405
+ } else if (P(_)) {
2406
+ let M = {};
2407
+ for (const V in _) {
2408
+ if (!J(M) && !r)
2409
2409
  break;
2410
- const O = Kt(await k[V](g, t), M, V);
2411
- O && (F = {
2412
- ...O,
2413
- ...se(V, O.message)
2414
- }, R(O.message), r && (N[b] = F));
2410
+ const R = Kt(await _[V](g, t), F, V);
2411
+ R && (M = {
2412
+ ...R,
2413
+ ...se(V, R.message)
2414
+ }, j(R.message), r && (D[b] = M));
2415
2415
  }
2416
- if (!J(F) && (N[b] = {
2417
- ref: M,
2418
- ...F
2416
+ if (!J(M) && (D[b] = {
2417
+ ref: F,
2418
+ ...M
2419
2419
  }, !r))
2420
- return N;
2420
+ return D;
2421
2421
  }
2422
2422
  }
2423
- return R(!0), N;
2423
+ return j(!0), D;
2424
2424
  };
2425
2425
  function Xn(e, t) {
2426
2426
  const r = t.slice(0, -1).length;
2427
2427
  let n = 0;
2428
2428
  for (; n < r; )
2429
- e = B(e) ? n++ : e[t[n++]];
2429
+ e = O(e) ? n++ : e[t[n++]];
2430
2430
  return e;
2431
2431
  }
2432
2432
  function Qn(e) {
2433
2433
  for (const t in e)
2434
- if (e.hasOwnProperty(t) && !B(e[t]))
2434
+ if (e.hasOwnProperty(t) && !O(e[t]))
2435
2435
  return !1;
2436
2436
  return !0;
2437
2437
  }
2438
- function j(e, t) {
2438
+ function $(e, t) {
2439
2439
  const r = Array.isArray(t) ? t : vt(t) ? [t] : pr(t), n = r.length === 1 ? e : Xn(e, r), s = r.length - 1, a = r[s];
2440
- return n && delete n[a], s !== 0 && ($(n) && J(n) || Array.isArray(n) && Qn(n)) && j(e, r.slice(0, -1)), e;
2440
+ return n && delete n[a], s !== 0 && (P(n) && J(n) || Array.isArray(n) && Qn(n)) && $(e, r.slice(0, -1)), e;
2441
2441
  }
2442
2442
  function lt() {
2443
2443
  let e = [];
@@ -2459,7 +2459,7 @@ function lt() {
2459
2459
  }
2460
2460
  };
2461
2461
  }
2462
- var Je = (e) => U(e) || !hr(e);
2462
+ var Je = (e) => q(e) || !hr(e);
2463
2463
  function ye(e, t) {
2464
2464
  if (Je(e) || Je(t))
2465
2465
  return e === t;
@@ -2474,7 +2474,7 @@ function ye(e, t) {
2474
2474
  return !1;
2475
2475
  if (s !== "ref") {
2476
2476
  const i = t[s];
2477
- if (Se(a) && Se(i) || $(a) && $(i) || Array.isArray(a) && Array.isArray(i) ? !ye(a, i) : a !== i)
2477
+ if (Se(a) && Se(i) || P(a) && P(i) || Array.isArray(a) && Array.isArray(i) ? !ye(a, i) : a !== i)
2478
2478
  return !1;
2479
2479
  }
2480
2480
  }
@@ -2482,29 +2482,29 @@ function ye(e, t) {
2482
2482
  }
2483
2483
  var br = (e) => e.type === "select-multiple", Yn = (e) => wt(e) || Be(e), ut = (e) => He(e) && e.isConnected, vr = (e) => {
2484
2484
  for (const t in e)
2485
- if (fe(e[t]))
2485
+ if (de(e[t]))
2486
2486
  return !0;
2487
2487
  return !1;
2488
2488
  };
2489
2489
  function Ze(e, t = {}) {
2490
2490
  const r = Array.isArray(e);
2491
- if ($(e) || r)
2491
+ if (P(e) || r)
2492
2492
  for (const n in e)
2493
- Array.isArray(e[n]) || $(e[n]) && !vr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Ze(e[n], t[n])) : U(e[n]) || (t[n] = !0);
2493
+ Array.isArray(e[n]) || P(e[n]) && !vr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Ze(e[n], t[n])) : q(e[n]) || (t[n] = !0);
2494
2494
  return t;
2495
2495
  }
2496
2496
  function xr(e, t, r) {
2497
2497
  const n = Array.isArray(e);
2498
- if ($(e) || n)
2498
+ if (P(e) || n)
2499
2499
  for (const s in e)
2500
- Array.isArray(e[s]) || $(e[s]) && !vr(e[s]) ? B(t) || Je(r[s]) ? r[s] = Array.isArray(e[s]) ? Ze(e[s], []) : { ...Ze(e[s]) } : xr(e[s], U(t) ? {} : t[s], r[s]) : r[s] = !ye(e[s], t[s]);
2500
+ Array.isArray(e[s]) || P(e[s]) && !vr(e[s]) ? O(t) || Je(r[s]) ? r[s] = Array.isArray(e[s]) ? Ze(e[s], []) : { ...Ze(e[s]) } : xr(e[s], q(t) ? {} : t[s], r[s]) : r[s] = !ye(e[s], t[s]);
2501
2501
  return r;
2502
2502
  }
2503
- var ct = (e, t) => xr(e, t, Ze(t)), wr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => B(e) ? e : t ? e === "" ? NaN : e && +e : r && te(e) ? new Date(e) : n ? n(e) : e;
2503
+ var ct = (e, t) => xr(e, t, Ze(t)), wr = (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;
2504
2504
  function dt(e) {
2505
2505
  const t = e.ref;
2506
2506
  if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
2507
- return xt(t) ? t.files : wt(t) ? yr(e.refs).value : br(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Be(t) ? gr(e.refs).value : wr(B(t.value) ? e.ref.value : t.value, e);
2507
+ return xt(t) ? t.files : wt(t) ? yr(e.refs).value : br(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Be(t) ? gr(e.refs).value : wr(O(t.value) ? e.ref.value : t.value, e);
2508
2508
  }
2509
2509
  var es = (e, t, r, n) => {
2510
2510
  const s = {};
@@ -2518,7 +2518,7 @@ var es = (e, t, r, n) => {
2518
2518
  fields: s,
2519
2519
  shouldUseNativeValidation: n
2520
2520
  };
2521
- }, Me = (e) => B(e) ? e : We(e) ? e.source : $(e) ? We(e.value) ? e.value.source : e.value : e, ts = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
2521
+ }, Me = (e) => O(e) ? e : We(e) ? e.source : P(e) ? We(e.value) ? e.value.source : e.value : e, ts = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
2522
2522
  function Ht(e, t, r) {
2523
2523
  const n = x(e, r);
2524
2524
  if (n || vt(r))
@@ -2542,7 +2542,7 @@ function Ht(e, t, r) {
2542
2542
  name: r
2543
2543
  };
2544
2544
  }
2545
- var rs = (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, ns = (e, t) => !Pe(x(e, t)).length && j(e, t);
2545
+ var rs = (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, ns = (e, t) => !Pe(x(e, t)).length && $(e, t);
2546
2546
  const ss = {
2547
2547
  mode: Z.onSubmit,
2548
2548
  reValidateMode: Z.onChange,
@@ -2555,7 +2555,7 @@ function as(e = {}, t) {
2555
2555
  }, n = {
2556
2556
  submitCount: 0,
2557
2557
  isDirty: !1,
2558
- isLoading: fe(r.defaultValues),
2558
+ isLoading: de(r.defaultValues),
2559
2559
  isValidating: !1,
2560
2560
  isSubmitted: !1,
2561
2561
  isSubmitting: !1,
@@ -2565,7 +2565,7 @@ function as(e = {}, t) {
2565
2565
  dirtyFields: {},
2566
2566
  errors: {},
2567
2567
  disabled: !1
2568
- }, s = {}, a = $(r.defaultValues) || $(r.values) ? oe(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : oe(a), u = {
2568
+ }, s = {}, a = P(r.defaultValues) || P(r.values) ? oe(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : oe(a), u = {
2569
2569
  action: !1,
2570
2570
  mount: !1,
2571
2571
  watch: !1
@@ -2586,29 +2586,29 @@ function as(e = {}, t) {
2586
2586
  values: lt(),
2587
2587
  array: lt(),
2588
2588
  state: lt()
2589
- }, k = e.resetOptions && e.resetOptions.keepDirtyValues, b = $t(r.mode), A = $t(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
2589
+ }, _ = e.resetOptions && e.resetOptions.keepDirtyValues, b = $t(r.mode), A = $t(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
2590
2590
  clearTimeout(w), w = setTimeout(o, c);
2591
2591
  }, g = async (o) => {
2592
2592
  if (v.isValid || o) {
2593
- const c = r.resolver ? J((await H()).errors) : await q(s, !0);
2593
+ const c = r.resolver ? J((await H()).errors) : await U(s, !0);
2594
2594
  c !== n.isValid && h.state.next({
2595
2595
  isValid: c
2596
2596
  });
2597
2597
  }
2598
- }, M = (o) => v.isValidating && h.state.next({
2598
+ }, F = (o) => v.isValidating && h.state.next({
2599
2599
  isValidating: o
2600
- }), R = (o, c = [], f, _, y = !0, m = !0) => {
2601
- if (_ && f) {
2600
+ }), j = (o, c = [], f, k, y = !0, m = !0) => {
2601
+ if (k && f) {
2602
2602
  if (u.action = !0, m && Array.isArray(x(s, o))) {
2603
- const C = f(x(s, o), _.argA, _.argB);
2603
+ const C = f(x(s, o), k.argA, k.argB);
2604
2604
  y && L(s, o, C);
2605
2605
  }
2606
2606
  if (m && Array.isArray(x(n.errors, o))) {
2607
- const C = f(x(n.errors, o), _.argA, _.argB);
2607
+ const C = f(x(n.errors, o), k.argA, k.argB);
2608
2608
  y && L(n.errors, o, C), ns(n.errors, o);
2609
2609
  }
2610
2610
  if (v.touchedFields && m && Array.isArray(x(n.touchedFields, o))) {
2611
- const C = f(x(n.touchedFields, o), _.argA, _.argB);
2611
+ const C = f(x(n.touchedFields, o), k.argA, k.argB);
2612
2612
  y && L(n.touchedFields, o, C);
2613
2613
  }
2614
2614
  v.dirtyFields && (n.dirtyFields = ct(a, i)), h.state.next({
@@ -2620,37 +2620,37 @@ function as(e = {}, t) {
2620
2620
  });
2621
2621
  } else
2622
2622
  L(i, o, c);
2623
- }, N = (o, c) => {
2623
+ }, D = (o, c) => {
2624
2624
  L(n.errors, o, c), h.state.next({
2625
2625
  errors: n.errors
2626
2626
  });
2627
- }, me = (o, c, f, _) => {
2627
+ }, me = (o, c, f, k) => {
2628
2628
  const y = x(s, o);
2629
2629
  if (y) {
2630
- const m = x(i, o, B(f) ? x(a, o) : f);
2631
- B(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : dt(y._f)) : W(o, m), u.mount && g();
2630
+ const m = x(i, o, O(f) ? x(a, o) : f);
2631
+ O(m) || k && k.defaultChecked || c ? L(i, o, c ? m : dt(y._f)) : W(o, m), u.mount && g();
2632
2632
  }
2633
- }, ce = (o, c, f, _, y) => {
2633
+ }, ue = (o, c, f, k, y) => {
2634
2634
  let m = !1, C = !1;
2635
- const T = {
2635
+ const N = {
2636
2636
  name: o
2637
2637
  };
2638
- if (!f || _) {
2639
- v.isDirty && (C = n.isDirty, n.isDirty = T.isDirty = V(), m = C !== T.isDirty);
2640
- const P = ye(x(a, o), c);
2641
- C = x(n.dirtyFields, o), P ? j(n.dirtyFields, o) : L(n.dirtyFields, o, !0), T.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !P;
2638
+ if (!f || k) {
2639
+ v.isDirty && (C = n.isDirty, n.isDirty = N.isDirty = V(), m = C !== N.isDirty);
2640
+ const B = ye(x(a, o), c);
2641
+ C = x(n.dirtyFields, o), B ? $(n.dirtyFields, o) : L(n.dirtyFields, o, !0), N.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !B;
2642
2642
  }
2643
2643
  if (f) {
2644
- const P = x(n.touchedFields, o);
2645
- P || (L(n.touchedFields, o, f), T.touchedFields = n.touchedFields, m = m || v.touchedFields && P !== f);
2644
+ const B = x(n.touchedFields, o);
2645
+ B || (L(n.touchedFields, o, f), N.touchedFields = n.touchedFields, m = m || v.touchedFields && B !== f);
2646
2646
  }
2647
- return m && y && h.state.next(T), m ? T : {};
2648
- }, Ae = (o, c, f, _) => {
2649
- const y = x(n.errors, o), m = v.isValid && de(c) && n.isValid !== c;
2650
- if (e.delayError && f ? (p = E(() => N(o, f)), p(e.delayError)) : (clearTimeout(w), p = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !ye(y, f) : y) || !J(_) || m) {
2647
+ return m && y && h.state.next(N), m ? N : {};
2648
+ }, Ae = (o, c, f, k) => {
2649
+ const y = x(n.errors, o), m = v.isValid && ce(c) && n.isValid !== c;
2650
+ if (e.delayError && f ? (p = E(() => D(o, f)), p(e.delayError)) : (clearTimeout(w), p = null, f ? L(n.errors, o, f) : $(n.errors, o)), (f ? !ye(y, f) : y) || !J(k) || m) {
2651
2651
  const C = {
2652
- ..._,
2653
- ...m && de(c) ? { isValid: c } : {},
2652
+ ...k,
2653
+ ...m && ce(c) ? { isValid: c } : {},
2654
2654
  errors: n.errors,
2655
2655
  name: o
2656
2656
  };
@@ -2659,60 +2659,60 @@ function as(e = {}, t) {
2659
2659
  ...C
2660
2660
  }, h.state.next(C);
2661
2661
  }
2662
- M(!1);
2662
+ F(!1);
2663
2663
  }, H = async (o) => r.resolver(i, r.context, es(o || d.mount, s, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
2664
2664
  const { errors: c } = await H(o);
2665
2665
  if (o)
2666
2666
  for (const f of o) {
2667
- const _ = x(c, f);
2668
- _ ? L(n.errors, f, _) : j(n.errors, f);
2667
+ const k = x(c, f);
2668
+ k ? L(n.errors, f, k) : $(n.errors, f);
2669
2669
  }
2670
2670
  else
2671
2671
  n.errors = c;
2672
2672
  return c;
2673
- }, q = async (o, c, f = {
2673
+ }, U = async (o, c, f = {
2674
2674
  valid: !0
2675
2675
  }) => {
2676
- for (const _ in o) {
2677
- const y = o[_];
2676
+ for (const k in o) {
2677
+ const y = o[k];
2678
2678
  if (y) {
2679
2679
  const { _f: m, ...C } = y;
2680
2680
  if (m) {
2681
- const T = d.array.has(m.name), P = await Gt(y, i, S, r.shouldUseNativeValidation && !c, T);
2682
- if (P[m.name] && (f.valid = !1, c))
2681
+ const N = d.array.has(m.name), B = await Gt(y, i, S, r.shouldUseNativeValidation && !c, N);
2682
+ if (B[m.name] && (f.valid = !1, c))
2683
2683
  break;
2684
- !c && (x(P, m.name) ? T ? Zn(n.errors, P, m.name) : L(n.errors, m.name, P[m.name]) : j(n.errors, m.name));
2684
+ !c && (x(B, m.name) ? N ? Zn(n.errors, B, m.name) : L(n.errors, m.name, B[m.name]) : $(n.errors, m.name));
2685
2685
  }
2686
- C && await q(C, c, f);
2686
+ C && await U(C, c, f);
2687
2687
  }
2688
2688
  }
2689
2689
  return f.valid;
2690
- }, F = () => {
2690
+ }, M = () => {
2691
2691
  for (const o of d.unMount) {
2692
2692
  const c = x(s, o);
2693
2693
  c && (c._f.refs ? c._f.refs.every((f) => !ut(f)) : !ut(c._f.ref)) && rt(o);
2694
2694
  }
2695
2695
  d.unMount = /* @__PURE__ */ new Set();
2696
- }, V = (o, c) => (o && c && L(i, o, c), !ye(_t(), a)), O = (o, c, f) => Jn(o, d, {
2697
- ...u.mount ? i : B(c) ? a : te(o) ? { [o]: c } : c
2696
+ }, V = (o, c) => (o && c && L(i, o, c), !ye(kt(), a)), R = (o, c, f) => Jn(o, d, {
2697
+ ...u.mount ? i : O(c) ? a : te(o) ? { [o]: c } : c
2698
2698
  }, f, c), K = (o) => Pe(x(u.mount ? i : a, o, e.shouldUnregister ? x(a, o, []) : [])), W = (o, c, f = {}) => {
2699
- const _ = x(s, o);
2699
+ const k = x(s, o);
2700
2700
  let y = c;
2701
- if (_) {
2702
- const m = _._f;
2703
- m && (!m.disabled && L(i, o, wr(c, m)), y = He(m.ref) && U(c) ? "" : c, br(m.ref) ? [...m.ref.options].forEach((C) => C.selected = y.includes(C.value)) : m.refs ? Be(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) : xt(m.ref) ? m.ref.value = "" : (m.ref.value = y, m.ref.type || h.values.next({
2701
+ if (k) {
2702
+ const m = k._f;
2703
+ m && (!m.disabled && L(i, o, wr(c, m)), y = He(m.ref) && q(c) ? "" : c, br(m.ref) ? [...m.ref.options].forEach((C) => C.selected = y.includes(C.value)) : m.refs ? Be(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(y) ? !!y.find((N) => N === C.value) : y === C.value)) : m.refs[0] && (m.refs[0].checked = !!y) : m.refs.forEach((C) => C.checked = C.value === y) : xt(m.ref) ? m.ref.value = "" : (m.ref.value = y, m.ref.type || h.values.next({
2704
2704
  name: o,
2705
2705
  values: { ...i }
2706
2706
  })));
2707
2707
  }
2708
- (f.shouldDirty || f.shouldTouch) && ce(o, y, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && tt(o);
2708
+ (f.shouldDirty || f.shouldTouch) && ue(o, y, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && tt(o);
2709
2709
  }, Q = (o, c, f) => {
2710
- for (const _ in c) {
2711
- const y = c[_], m = `${o}.${_}`, C = x(s, m);
2710
+ for (const k in c) {
2711
+ const y = c[k], m = `${o}.${k}`, C = x(s, m);
2712
2712
  (d.array.has(o) || !Je(y) || C && !C._f) && !Se(y) ? Q(m, y, f) : W(m, y, f);
2713
2713
  }
2714
2714
  }, ge = (o, c, f = {}) => {
2715
- const _ = x(s, o), y = d.array.has(o), m = oe(c);
2715
+ const k = x(s, o), y = d.array.has(o), m = oe(c);
2716
2716
  L(i, o, m), y ? (h.array.next({
2717
2717
  name: o,
2718
2718
  values: { ...i }
@@ -2720,101 +2720,101 @@ function as(e = {}, t) {
2720
2720
  name: o,
2721
2721
  dirtyFields: ct(a, i),
2722
2722
  isDirty: V(o, m)
2723
- })) : _ && !_._f && !U(m) ? Q(o, m, f) : W(o, m, f), jt(o, d) && h.state.next({ ...n }), h.values.next({
2723
+ })) : k && !k._f && !q(m) ? Q(o, m, f) : W(o, m, f), jt(o, d) && h.state.next({ ...n }), h.values.next({
2724
2724
  name: o,
2725
2725
  values: { ...i }
2726
2726
  }), !u.mount && t();
2727
2727
  }, Ve = async (o) => {
2728
2728
  const c = o.target;
2729
- let f = c.name, _ = !0;
2730
- const y = x(s, f), m = () => c.type ? dt(y._f) : zn(o), C = (T) => {
2731
- _ = Number.isNaN(T) || T === x(i, f, T);
2729
+ let f = c.name, k = !0;
2730
+ const y = x(s, f), m = () => c.type ? dt(y._f) : zn(o), C = (N) => {
2731
+ k = Number.isNaN(N) || N === x(i, f, N);
2732
2732
  };
2733
2733
  if (y) {
2734
- let T, P;
2735
- const je = m(), _e = o.type === Pt.BLUR || o.type === Pt.FOCUS_OUT, Ar = !ts(y._f) && !r.resolver && !x(n.errors, f) && !y._f.deps || rs(_e, x(n.touchedFields, f), n.isSubmitted, A, b), st = jt(f, d, _e);
2736
- L(i, f, je), _e ? (y._f.onBlur && y._f.onBlur(o), p && p(0)) : y._f.onChange && y._f.onChange(o);
2737
- const at = ce(f, je, _e, !1), Vr = !J(at) || st;
2738
- if (!_e && h.values.next({
2734
+ let N, B;
2735
+ const je = m(), ke = o.type === Pt.BLUR || o.type === Pt.FOCUS_OUT, Ar = !ts(y._f) && !r.resolver && !x(n.errors, f) && !y._f.deps || rs(ke, x(n.touchedFields, f), n.isSubmitted, A, b), st = jt(f, d, ke);
2736
+ L(i, f, je), ke ? (y._f.onBlur && y._f.onBlur(o), p && p(0)) : y._f.onChange && y._f.onChange(o);
2737
+ const at = ue(f, je, ke, !1), Vr = !J(at) || st;
2738
+ if (!ke && h.values.next({
2739
2739
  name: f,
2740
2740
  type: o.type,
2741
2741
  values: { ...i }
2742
2742
  }), Ar)
2743
2743
  return v.isValid && g(), Vr && h.state.next({ name: f, ...st ? {} : at });
2744
- if (!_e && st && h.state.next({ ...n }), M(!0), r.resolver) {
2744
+ if (!ke && st && h.state.next({ ...n }), F(!0), r.resolver) {
2745
2745
  const { errors: Mt } = await H([f]);
2746
- if (C(je), _) {
2746
+ if (C(je), k) {
2747
2747
  const Ir = Ht(n.errors, s, f), Ft = Ht(Mt, s, Ir.name || f);
2748
- T = Ft.error, f = Ft.name, P = J(Mt);
2748
+ N = Ft.error, f = Ft.name, B = J(Mt);
2749
2749
  }
2750
2750
  } else
2751
- T = (await Gt(y, i, S, r.shouldUseNativeValidation))[f], C(je), _ && (T ? P = !1 : v.isValid && (P = await q(s, !0)));
2752
- _ && (y._f.deps && tt(y._f.deps), Ae(f, P, T, at));
2751
+ N = (await Gt(y, i, S, r.shouldUseNativeValidation))[f], C(je), k && (N ? B = !1 : v.isValid && (B = await U(s, !0)));
2752
+ k && (y._f.deps && tt(y._f.deps), Ae(f, B, N, at));
2753
2753
  }
2754
2754
  }, $e = (o, c) => {
2755
2755
  if (x(n.errors, c) && o.focus)
2756
2756
  return o.focus(), 1;
2757
2757
  }, tt = async (o, c = {}) => {
2758
- let f, _;
2758
+ let f, k;
2759
2759
  const y = ot(o);
2760
- if (M(!0), r.resolver) {
2761
- const m = await se(B(o) ? o : y);
2762
- f = J(m), _ = o ? !y.some((C) => x(m, C)) : f;
2760
+ if (F(!0), r.resolver) {
2761
+ const m = await se(O(o) ? o : y);
2762
+ f = J(m), k = o ? !y.some((C) => x(m, C)) : f;
2763
2763
  } else
2764
- o ? (_ = (await Promise.all(y.map(async (m) => {
2764
+ o ? (k = (await Promise.all(y.map(async (m) => {
2765
2765
  const C = x(s, m);
2766
- return await q(C && C._f ? { [m]: C } : C);
2767
- }))).every(Boolean), !(!_ && !n.isValid) && g()) : _ = f = await q(s);
2766
+ return await U(C && C._f ? { [m]: C } : C);
2767
+ }))).every(Boolean), !(!k && !n.isValid) && g()) : k = f = await U(s);
2768
2768
  return h.state.next({
2769
2769
  ...!te(o) || v.isValid && f !== n.isValid ? {} : { name: o },
2770
2770
  ...r.resolver || !o ? { isValid: f } : {},
2771
2771
  errors: n.errors,
2772
2772
  isValidating: !1
2773
- }), c.shouldFocus && !_ && qe(s, $e, o ? y : d.mount), _;
2774
- }, _t = (o) => {
2773
+ }), c.shouldFocus && !k && Ue(s, $e, o ? y : d.mount), k;
2774
+ }, kt = (o) => {
2775
2775
  const c = {
2776
2776
  ...a,
2777
2777
  ...u.mount ? i : {}
2778
2778
  };
2779
- return B(o) ? c : te(o) ? x(c, o) : o.map((f) => x(c, f));
2780
- }, kt = (o, c) => ({
2779
+ return O(o) ? c : te(o) ? x(c, o) : o.map((f) => x(c, f));
2780
+ }, _t = (o, c) => ({
2781
2781
  invalid: !!x((c || n).errors, o),
2782
2782
  isDirty: !!x((c || n).dirtyFields, o),
2783
2783
  isTouched: !!x((c || n).touchedFields, o),
2784
2784
  error: x((c || n).errors, o)
2785
- }), kr = (o) => {
2786
- o && ot(o).forEach((c) => j(n.errors, c)), h.state.next({
2785
+ }), _r = (o) => {
2786
+ o && ot(o).forEach((c) => $(n.errors, c)), h.state.next({
2787
2787
  errors: o ? n.errors : {}
2788
2788
  });
2789
2789
  }, St = (o, c, f) => {
2790
- const _ = (x(s, o, { _f: {} })._f || {}).ref;
2790
+ const k = (x(s, o, { _f: {} })._f || {}).ref;
2791
2791
  L(n.errors, o, {
2792
2792
  ...c,
2793
- ref: _
2793
+ ref: k
2794
2794
  }), h.state.next({
2795
2795
  name: o,
2796
2796
  errors: n.errors,
2797
2797
  isValid: !1
2798
- }), f && f.shouldFocus && _ && _.focus && _.focus();
2799
- }, Sr = (o, c) => fe(o) ? h.values.subscribe({
2800
- next: (f) => o(O(void 0, c), f)
2801
- }) : O(o, c, !0), rt = (o, c = {}) => {
2798
+ }), f && f.shouldFocus && k && k.focus && k.focus();
2799
+ }, Sr = (o, c) => de(o) ? h.values.subscribe({
2800
+ next: (f) => o(R(void 0, c), f)
2801
+ }) : R(o, c, !0), rt = (o, c = {}) => {
2802
2802
  for (const f of o ? ot(o) : d.mount)
2803
- 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);
2803
+ d.mount.delete(f), d.array.delete(f), c.keepValue || ($(s, f), $(i, f)), !c.keepError && $(n.errors, f), !c.keepDirty && $(n.dirtyFields, f), !c.keepTouched && $(n.touchedFields, f), !r.shouldUnregister && !c.keepDefaultValue && $(a, f);
2804
2804
  h.values.next({
2805
2805
  values: { ...i }
2806
2806
  }), h.state.next({
2807
2807
  ...n,
2808
2808
  ...c.keepDirty ? { isDirty: V() } : {}
2809
2809
  }), !c.keepIsValid && g();
2810
- }, Ct = ({ disabled: o, name: c, field: f, fields: _, value: y }) => {
2811
- if (de(o)) {
2812
- const m = o ? void 0 : B(y) ? dt(f ? f._f : x(_, c)._f) : y;
2813
- L(i, c, m), ce(c, m, !1, !1, !0);
2810
+ }, Ct = ({ disabled: o, name: c, field: f, fields: k, value: y }) => {
2811
+ if (ce(o)) {
2812
+ const m = o ? void 0 : O(y) ? dt(f ? f._f : x(k, c)._f) : y;
2813
+ L(i, c, m), ue(c, m, !1, !1, !0);
2814
2814
  }
2815
2815
  }, nt = (o, c = {}) => {
2816
2816
  let f = x(s, o);
2817
- const _ = de(c.disabled);
2817
+ const k = ce(c.disabled);
2818
2818
  return L(s, o, {
2819
2819
  ...f || {},
2820
2820
  _f: {
@@ -2828,7 +2828,7 @@ function as(e = {}, t) {
2828
2828
  disabled: c.disabled,
2829
2829
  name: o
2830
2830
  }) : me(o, !0, c.value), {
2831
- ..._ ? { disabled: c.disabled } : {},
2831
+ ...k ? { disabled: c.disabled } : {},
2832
2832
  ...r.progressive ? {
2833
2833
  required: !!c.required,
2834
2834
  min: Me(c.min),
@@ -2843,15 +2843,15 @@ function as(e = {}, t) {
2843
2843
  ref: (y) => {
2844
2844
  if (y) {
2845
2845
  nt(o, c), f = x(s, o);
2846
- const m = B(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, C = Yn(m), T = f._f.refs || [];
2847
- if (C ? T.find((P) => P === m) : m === f._f.ref)
2846
+ const m = O(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, C = Yn(m), N = f._f.refs || [];
2847
+ if (C ? N.find((B) => B === m) : m === f._f.ref)
2848
2848
  return;
2849
2849
  L(s, o, {
2850
2850
  _f: {
2851
2851
  ...f._f,
2852
2852
  ...C ? {
2853
2853
  refs: [
2854
- ...T.filter(ut),
2854
+ ...N.filter(ut),
2855
2855
  m,
2856
2856
  ...Array.isArray(x(a, o)) ? [{}] : []
2857
2857
  ],
@@ -2860,26 +2860,26 @@ function as(e = {}, t) {
2860
2860
  }
2861
2861
  }), me(o, !1, void 0, m);
2862
2862
  } else
2863
- f = x(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(Un(d.array, o) && u.action) && d.unMount.add(o);
2863
+ f = x(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(qn(d.array, o) && u.action) && d.unMount.add(o);
2864
2864
  }
2865
2865
  };
2866
- }, Et = () => r.shouldFocusError && qe(s, $e, d.mount), Cr = (o) => {
2867
- de(o) && (h.state.next({ disabled: o }), qe(s, (c) => {
2866
+ }, Et = () => r.shouldFocusError && Ue(s, $e, d.mount), Cr = (o) => {
2867
+ ce(o) && (h.state.next({ disabled: o }), Ue(s, (c) => {
2868
2868
  c.disabled = o;
2869
2869
  }, 0, !1));
2870
2870
  }, At = (o, c) => async (f) => {
2871
2871
  f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
2872
- let _ = oe(i);
2872
+ let k = oe(i);
2873
2873
  if (h.state.next({
2874
2874
  isSubmitting: !0
2875
2875
  }), r.resolver) {
2876
2876
  const { errors: y, values: m } = await H();
2877
- n.errors = y, _ = m;
2877
+ n.errors = y, k = m;
2878
2878
  } else
2879
- await q(s);
2880
- j(n.errors, "root"), J(n.errors) ? (h.state.next({
2879
+ await U(s);
2880
+ $(n.errors, "root"), J(n.errors) ? (h.state.next({
2881
2881
  errors: {}
2882
- }), await o(_, f)) : (c && await c({ ...n.errors }, f), Et(), setTimeout(Et)), h.state.next({
2882
+ }), await o(k, f)) : (c && await c({ ...n.errors }, f), Et(), setTimeout(Et)), h.state.next({
2883
2883
  isSubmitted: !0,
2884
2884
  isSubmitting: !1,
2885
2885
  isSubmitSuccessful: J(n.errors),
@@ -2887,23 +2887,23 @@ function as(e = {}, t) {
2887
2887
  errors: n.errors
2888
2888
  });
2889
2889
  }, Er = (o, c = {}) => {
2890
- x(s, o) && (B(c.defaultValue) ? ge(o, x(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 ? V(o, x(a, o)) : V()), c.keepError || (j(n.errors, o), v.isValid && g()), h.state.next({ ...n }));
2890
+ x(s, o) && (O(c.defaultValue) ? ge(o, x(a, o)) : (ge(o, c.defaultValue), L(a, o, c.defaultValue)), c.keepTouched || $(n.touchedFields, o), c.keepDirty || ($(n.dirtyFields, o), n.isDirty = c.defaultValue ? V(o, x(a, o)) : V()), c.keepError || ($(n.errors, o), v.isValid && g()), h.state.next({ ...n }));
2891
2891
  }, Vt = (o, c = {}) => {
2892
- const f = o ? oe(o) : a, _ = oe(f), y = o && !J(o) ? _ : a;
2892
+ const f = o ? oe(o) : a, k = oe(f), y = o && !J(o) ? k : a;
2893
2893
  if (c.keepDefaultValues || (a = f), !c.keepValues) {
2894
- if (c.keepDirtyValues || k)
2894
+ if (c.keepDirtyValues || _)
2895
2895
  for (const m of d.mount)
2896
2896
  x(n.dirtyFields, m) ? L(y, m, x(i, m)) : ge(m, x(y, m));
2897
2897
  else {
2898
- if (bt && B(o))
2898
+ if (bt && O(o))
2899
2899
  for (const m of d.mount) {
2900
2900
  const C = x(s, m);
2901
2901
  if (C && C._f) {
2902
- const T = Array.isArray(C._f.refs) ? C._f.refs[0] : C._f.ref;
2903
- if (He(T)) {
2904
- const P = T.closest("form");
2905
- if (P) {
2906
- P.reset();
2902
+ const N = Array.isArray(C._f.refs) ? C._f.refs[0] : C._f.ref;
2903
+ if (He(N)) {
2904
+ const B = N.closest("form");
2905
+ if (B) {
2906
+ B.reset();
2907
2907
  break;
2908
2908
  }
2909
2909
  }
@@ -2934,24 +2934,24 @@ function as(e = {}, t) {
2934
2934
  isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
2935
2935
  isSubmitting: !1
2936
2936
  });
2937
- }, It = (o, c) => Vt(fe(o) ? o(i) : o, c);
2937
+ }, It = (o, c) => Vt(de(o) ? o(i) : o, c);
2938
2938
  return {
2939
2939
  control: {
2940
2940
  register: nt,
2941
2941
  unregister: rt,
2942
- getFieldState: kt,
2942
+ getFieldState: _t,
2943
2943
  handleSubmit: At,
2944
2944
  setError: St,
2945
2945
  _executeSchema: H,
2946
- _getWatch: O,
2946
+ _getWatch: R,
2947
2947
  _getDirty: V,
2948
2948
  _updateValid: g,
2949
- _removeUnmounted: F,
2950
- _updateFieldArray: R,
2949
+ _removeUnmounted: M,
2950
+ _updateFieldArray: j,
2951
2951
  _updateDisabledField: Ct,
2952
2952
  _getFieldArray: K,
2953
2953
  _reset: Vt,
2954
- _resetDefaultValues: () => fe(r.defaultValues) && r.defaultValues().then((o) => {
2954
+ _resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((o) => {
2955
2955
  It(o, r.resetOptions), h.state.next({
2956
2956
  isLoading: !1
2957
2957
  });
@@ -3007,27 +3007,27 @@ function as(e = {}, t) {
3007
3007
  handleSubmit: At,
3008
3008
  watch: Sr,
3009
3009
  setValue: ge,
3010
- getValues: _t,
3010
+ getValues: kt,
3011
3011
  reset: It,
3012
3012
  resetField: Er,
3013
- clearErrors: kr,
3013
+ clearErrors: _r,
3014
3014
  unregister: rt,
3015
3015
  setError: St,
3016
3016
  setFocus: (o, c = {}) => {
3017
- const f = x(s, o), _ = f && f._f;
3018
- if (_) {
3019
- const y = _.refs ? _.refs[0] : _.ref;
3017
+ const f = x(s, o), k = f && f._f;
3018
+ if (k) {
3019
+ const y = k.refs ? k.refs[0] : k.ref;
3020
3020
  y.focus && (y.focus(), c.shouldSelect && y.select());
3021
3021
  }
3022
3022
  },
3023
- getFieldState: kt
3023
+ getFieldState: _t
3024
3024
  };
3025
3025
  }
3026
3026
  function Ye(e = {}) {
3027
3027
  const t = Y.useRef(), r = Y.useRef(), [n, s] = Y.useState({
3028
3028
  isDirty: !1,
3029
3029
  isValidating: !1,
3030
- isLoading: fe(e.defaultValues),
3030
+ isLoading: de(e.defaultValues),
3031
3031
  isSubmitted: !1,
3032
3032
  isSubmitting: !1,
3033
3033
  isSubmitSuccessful: !1,
@@ -3037,7 +3037,7 @@ function Ye(e = {}) {
3037
3037
  touchedFields: {},
3038
3038
  errors: {},
3039
3039
  disabled: !1,
3040
- defaultValues: fe(e.defaultValues) ? void 0 : e.defaultValues
3040
+ defaultValues: de(e.defaultValues) ? void 0 : e.defaultValues
3041
3041
  });
3042
3042
  t.current || (t.current = {
3043
3043
  ...as(e, () => s((i) => ({ ...i }))),
@@ -3196,12 +3196,12 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3196
3196
  class: Qt({
3197
3197
  variant: "booleanLike"
3198
3198
  }),
3199
- children: e.config.options.map((h, k) => l("li", {
3199
+ children: e.config.options.map((h, _) => l("li", {
3200
3200
  class: "flex-1",
3201
3201
  children: l(dr, {
3202
3202
  type: "submit",
3203
3203
  ref: (b) => {
3204
- b && k === 0 && (p.current = b);
3204
+ b && _ === 0 && (p.current = b);
3205
3205
  },
3206
3206
  label: h.label,
3207
3207
  value: "true",
@@ -3213,8 +3213,8 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3213
3213
  }, h.value))
3214
3214
  }) : l("form", {
3215
3215
  noValidate: !0,
3216
- onSubmit: (h) => u((k) => {
3217
- const b = k.checked;
3216
+ onSubmit: (h) => u((_) => {
3217
+ const b = _.checked;
3218
3218
  t({
3219
3219
  type: "enum",
3220
3220
  value: b
@@ -3229,7 +3229,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3229
3229
  class: Qt({
3230
3230
  variant: e.config.options.length === 1 ? "singleOption" : void 0
3231
3231
  }),
3232
- children: e.config.options.map((h, k) => {
3232
+ children: e.config.options.map((h, _) => {
3233
3233
  const b = `checked.${h.value}`, {
3234
3234
  ref: A,
3235
3235
  ...S
@@ -3238,9 +3238,9 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3238
3238
  class: "relative",
3239
3239
  children: l(hs, {
3240
3240
  option: h,
3241
- autoFocus: k === 0,
3241
+ autoFocus: _ === 0,
3242
3242
  ref: (E) => {
3243
- E && k === 0 && (p.current = E), A(E);
3243
+ E && _ === 0 && (p.current = E), A(E);
3244
3244
  },
3245
3245
  id: b,
3246
3246
  ...S,
@@ -3271,7 +3271,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3271
3271
  }, ms = Ce("number"), gs = (e, t) => {
3272
3272
  const r = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
3273
3273
  return et(he({
3274
- number: be(qr(t("validation_number")), zr(r, t("validation_number_min", {
3274
+ number: be(Ur(t("validation_number")), zr(r, t("validation_number_min", {
3275
3275
  min: r
3276
3276
  })), jr(n, t("validation_number_max", {
3277
3277
  max: n
@@ -3359,8 +3359,8 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3359
3359
  countryCode: "",
3360
3360
  phoneNumber: ""
3361
3361
  };
3362
- }, vs = "44", xs = /^[0-9 ]+$/, ws = Ce("string"), _s = Ce("phone"), ks = (e) => {
3363
- const t = be(X(e("validation_country_code")), Ur(xs, e("validation_country_code"))), r = be(X(e("validation_phone")), De(1, e("validation_phone")), ar((n) => n.replace(/[^0-9]/g, "")));
3362
+ }, vs = "44", xs = /^[0-9 ]+$/, ws = Ce("string"), ks = Ce("phone"), _s = (e) => {
3363
+ const t = be(X(e("validation_country_code")), qr(xs, e("validation_country_code"))), r = be(X(e("validation_phone")), De(1, e("validation_phone")), ar((n) => n.replace(/[^0-9]/g, "")));
3364
3364
  return et(he({
3365
3365
  countryCode: t,
3366
3366
  phoneNumber: r
@@ -3372,7 +3372,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3372
3372
  var A;
3373
3373
  const r = e.key ? (A = I.current$.value.flow) == null ? void 0 : A.data.submissions[e.key] : void 0, {
3374
3374
  t: n
3375
- } = G(), [s, a] = ee(), i = ws(r) ? bs(r.value) : _s(r) ? r.value : void 0, {
3375
+ } = G(), [s, a] = ee(), i = ws(r) ? bs(r.value) : ks(r) ? r.value : void 0, {
3376
3376
  register: u,
3377
3377
  handleSubmit: d,
3378
3378
  formState: {
@@ -3384,25 +3384,25 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3384
3384
  countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? vs,
3385
3385
  phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3386
3386
  },
3387
- resolver: ks(n)
3387
+ resolver: _s(n)
3388
3388
  }), {
3389
3389
  ref: v,
3390
3390
  ...h
3391
3391
  } = u("phoneNumber", {
3392
3392
  required: !e.config.optional
3393
- }), k = re(), b = w("countryCode");
3393
+ }), _ = re(), b = w("countryCode");
3394
3394
  return pe(() => {
3395
- k.current && (k.current.focus(), k.current.select());
3395
+ _.current && (_.current.focus(), _.current.select());
3396
3396
  }, []), l("form", {
3397
3397
  noValidate: !0,
3398
3398
  class: "flex flex-col gap-1 p-2.5",
3399
3399
  onSubmit: d((S) => {
3400
3400
  const E = S.phoneNumber.replace(/[^0-9]/g, ""), g = S.countryCode.replace(/[^0-9]/g, "");
3401
3401
  a(void 0);
3402
- const M = e.config.minChars ?? 7;
3403
- if (E.length + g.length < M)
3402
+ const F = e.config.minChars ?? 7;
3403
+ if (E.length + g.length < F)
3404
3404
  return a(n("validation_phone_min_chars", {
3405
- count: M
3405
+ count: F
3406
3406
  }));
3407
3407
  e.config.submissionFormat === "phone" ? t({
3408
3408
  type: "phone",
@@ -3443,7 +3443,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3443
3443
  autoCorrect: "off",
3444
3444
  autoFocus: !0,
3445
3445
  ref: (S) => {
3446
- S && (k.current = S), v(S);
3446
+ S && (_.current = S), v(S);
3447
3447
  },
3448
3448
  class: Oe({
3449
3449
  optional: e.config.optional,
@@ -3602,7 +3602,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
3602
3602
  }) => {
3603
3603
  var a;
3604
3604
  const t = (a = I.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] = bn(), s = re(null);
3605
- return I.inputHeight$.value = n.height, ue(() => {
3605
+ return I.inputHeight$.value = n.height, le(() => {
3606
3606
  const i = s.current;
3607
3607
  if (i)
3608
3608
  return i.addEventListener("transitionstart", z.scrollToEnd.smooth), i.addEventListener("transitioncancel", z.scrollToEnd.smooth), i.addEventListener("transitionend", z.scrollToEnd.smooth), () => {
@@ -3648,7 +3648,7 @@ var Ls = function(e) {
3648
3648
  }, Ns = function(t) {
3649
3649
  var r = /[\\^$.*+?()[\]{}|]/g, n = RegExp(r.source);
3650
3650
  return t && n.test(t) ? t.replace(r, "\\$&") : t;
3651
- }, _r = function(e) {
3651
+ }, kr = function(e) {
3652
3652
  return typeof e == "string";
3653
3653
  }, Ts = function(e) {
3654
3654
  var t = [];
@@ -3660,7 +3660,7 @@ function Ds(e, t, r) {
3660
3660
  var n = 0, s = 0;
3661
3661
  if (e === "")
3662
3662
  return e;
3663
- if (!e || !_r(e))
3663
+ if (!e || !kr(e))
3664
3664
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
3665
3665
  var a = t;
3666
3666
  Ls(a) || (a = new RegExp("(" + Ns(a) + ")", "gi"));
@@ -3675,10 +3675,10 @@ function Ds(e, t, r) {
3675
3675
  }
3676
3676
  var Rs = function(t, r, n) {
3677
3677
  return Array.isArray(t) || (t = [t]), Ts(t.map(function(s) {
3678
- return _r(s) ? Ds(s, r, n) : s;
3678
+ return kr(s) ? Ds(s, r, n) : s;
3679
3679
  }));
3680
3680
  };
3681
- const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]+)\]\(([^)]+)\)/, Ps = /(https?:\/\/[^\s]+)/g, $s = /_(.*?)_/g, js = /\*\*(.*?)\*\*/g, zs = /\\n|\n/g, Yt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", qs = (e) => {
3681
+ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]+)\]\(([^)]+)\)/, Ps = /(https?:\/\/[^\s]+)/g, $s = /_(.*?)_/g, js = /\*\*(.*?)\*\*/g, zs = /\\n|\n/g, Yt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Us = (e) => {
3682
3682
  const t = Fe(e, Os, (i, u) => {
3683
3683
  const [, d, p] = i.match(Bs) ?? [];
3684
3684
  return p ? l("a", {
@@ -3698,7 +3698,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3698
3698
  children: i
3699
3699
  }, i + u));
3700
3700
  return Fe(s, zs, (i, u) => l("br", {}, `br-${u}`));
3701
- }, Us = Xe("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", {
3701
+ }, qs = Xe("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", {
3702
3702
  variants: {
3703
3703
  side: {
3704
3704
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -3722,7 +3722,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3722
3722
  style: {
3723
3723
  transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
3724
3724
  },
3725
- class: Us({
3725
+ class: qs({
3726
3726
  className: t,
3727
3727
  side: n,
3728
3728
  animate: r
@@ -3756,7 +3756,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3756
3756
  }), Hs = ({
3757
3757
  className: e,
3758
3758
  ...t
3759
- }) => (ue(() => {
3759
+ }) => (le(() => {
3760
3760
  z.scrollToEnd.smooth();
3761
3761
  }), l("div", {
3762
3762
  "aria-hidden": !0,
@@ -3790,7 +3790,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3790
3790
  }) => {
3791
3791
  var r;
3792
3792
  const t = ((r = I.current$.value.flow) == null ? void 0 : r.data.messages) ?? [];
3793
- return ue(() => {
3793
+ return le(() => {
3794
3794
  z.scrollToEnd.smooth();
3795
3795
  }, [t.length]), l("ol", {
3796
3796
  "aria-label": "Chat messages",
@@ -3807,9 +3807,9 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3807
3807
  children: a.text
3808
3808
  })).with({
3809
3809
  type: "text",
3810
- author: D.union("bot", "user")
3810
+ author: T.union("bot", "user")
3811
3811
  }, (a) => {
3812
- const i = a.author === "user" && !t.slice(s + 1).some((p) => p.type === "text" && p.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? qs(a.text) : a.text;
3812
+ const i = a.author === "user" && !t.slice(s + 1).some((p) => p.type === "text" && p.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? Us(a.text) : a.text;
3813
3813
  return l(ve, {
3814
3814
  children: [i ? e : null, l(Ks, {
3815
3815
  animate: u,
@@ -3859,7 +3859,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3859
3859
  const {
3860
3860
  flow: n
3861
3861
  } = I.current$.value;
3862
- le(n, "Flow is required to exist to show chatbot body");
3862
+ fe(n, "Flow is required to exist to show chatbot body");
3863
3863
  const s = I.viewState$.value, {
3864
3864
  chatRef: a,
3865
3865
  chatService: i
@@ -3891,7 +3891,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3891
3891
  customProperties: (S = n.analytics) == null ? void 0 : S.customProperties
3892
3892
  })) : I.removeMessagesSentByNodeIds([h]);
3893
3893
  const {
3894
- interpret: k,
3894
+ interpret: _,
3895
3895
  abort: b,
3896
3896
  undo: A
3897
3897
  } = Xr({
@@ -3910,29 +3910,12 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3910
3910
  var g;
3911
3911
  return (g = I.current$.peek().flow) == null ? void 0 : g.data.submissions;
3912
3912
  },
3913
- onInterpret: (g, M) => {
3914
- var N;
3915
- const R = I.current$.peek().flow;
3916
- le(R), M && (R.data.sequence = R.data.sequence + 1, r.log({
3917
- event: "FLOW_NODE",
3918
- properties: {
3919
- flow_id: n.id,
3920
- flow_version: n.version,
3921
- from_node_id: M.id,
3922
- flow_build: n.build,
3923
- to_node_id: g.id,
3924
- sequence: R.data.sequence,
3925
- flow_session_id: R.data.flowSessionId,
3926
- job: n.job
3927
- },
3928
- customProperties: (N = n.analytics) == null ? void 0 : N.customProperties
3929
- })), I.setCurrentNodeId(g.id);
3930
- },
3913
+ onInterpret: (g) => I.setCurrentNodeId(g.id),
3931
3914
  onFlowEnd: async () => {
3932
- var M;
3915
+ var F;
3933
3916
  I.markAsFinished();
3934
3917
  const g = I.current$.peek().flow;
3935
- le(g), r.log({
3918
+ fe(g), r.log({
3936
3919
  event: "FLOW_END",
3937
3920
  properties: {
3938
3921
  flow_id: n.id,
@@ -3941,11 +3924,11 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3941
3924
  flow_build: n.build,
3942
3925
  job: n.job
3943
3926
  },
3944
- customProperties: (M = n.analytics) == null ? void 0 : M.customProperties
3927
+ customProperties: (F = n.analytics) == null ? void 0 : F.customProperties
3945
3928
  });
3946
3929
  }
3947
3930
  });
3948
- return p(() => A), k(h), b;
3931
+ return p(() => A), _(h), b;
3949
3932
  }, [r, t, i, e, n, u]), l(ve, {
3950
3933
  children: [l("div", {
3951
3934
  ref: a,
@@ -3974,7 +3957,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
3974
3957
  const {
3975
3958
  flow: r
3976
3959
  } = I.current$.peek();
3977
- le(r);
3960
+ fe(r);
3978
3961
  const {
3979
3962
  removed: n
3980
3963
  } = e(r.data.nodeHistory), s = r.data.nodeHistory.splice(-n);