@inploi/plugin-chatbot 14.4.0 → 14.6.0

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,5 +1,5 @@
1
- import { G as yr, Q as rt, _ as xt, J as ze, Y as mr, g as gr, a as kt, A as ss, z as ns, j as as, F as br, I as is, K as os, Z as ls, W as $t, u as se, o as u, c as Oe, b as st, h as me, d as ce, i as Ae, y as Ie, k as be, L as Ct, e as us, s as $, p as vr, f as xr, l as cs, m as Re, H as qt, C as ee, n as ie, M as ds, q as fs, r as hs, S as wr, t as ps } from "./index-d67c1a3c.js";
2
- import { isApiErrorWithData as ys, ApiError as ms } from "@inploi/sdk";
1
+ import { W as yr, Z as st, P as xt, Y as We, t as mr, g as gr, a as kt, A as ss, Q as ns, I as is, j as br, _ as as, J as os, n as ls, C as $t, V as us, u as se, o as u, c as Oe, b as nt, h as be, d as fe, i as Me, y as Ie, k as xe, L as Ct, F as cs, s as $, p as vr, e as xr, f as ds, l as Re, X as qt, m as Q, q as ae, M as fs, z as hs, r as ps, S as wr, v as ys } from "./index-aa94ec24.js";
2
+ import { isApiErrorWithData as ms, ApiError as gs } from "@inploi/sdk";
3
3
  const Ut = (e, r, t) => {
4
4
  var s;
5
5
  return e.log({
@@ -16,15 +16,15 @@ const Ut = (e, r, t) => {
16
16
  });
17
17
  };
18
18
  var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
19
- let [a, ...i] = e.compareKey.split(".");
20
- if (!a)
19
+ let [i, ...a] = e.compareKey.split(".");
20
+ if (!i)
21
21
  return !1;
22
- let n = yr({ context: r, key: a, path: i, submissions: t });
22
+ let n = yr({ context: r, key: i, path: a, submissions: t });
23
23
  if (!n)
24
24
  return !1;
25
25
  switch (n.type) {
26
26
  case "address": {
27
- let o = xt(n.value, i);
27
+ let o = xt(n.value, a);
28
28
  switch (e.compare) {
29
29
  case "equals":
30
30
  return o === e.compareValue;
@@ -40,16 +40,16 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
40
40
  case "integration": {
41
41
  if (typeof n.value != "object" || Array.isArray(n.value))
42
42
  return !1;
43
- let o = xt(n.value, i), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
43
+ let o = xt(n.value, a), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
44
44
  switch (typeof o) {
45
45
  case "boolean":
46
- return Ue(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
46
+ return ze(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
47
47
  case "string":
48
- return Ue(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
48
+ return ze(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
49
49
  case "number":
50
- return Ue(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
50
+ return ze(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
51
51
  case "object":
52
- return Array.isArray(o) && o.every((h) => typeof h == "string") ? Ue(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
52
+ return Array.isArray(o) && o.every((h) => typeof h == "string") ? ze(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
53
53
  }
54
54
  break;
55
55
  }
@@ -65,7 +65,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
65
65
  }
66
66
  case "phone":
67
67
  case "string": {
68
- let o = n.type === "phone" ? rt(n.value) : n.value;
68
+ let o = n.type === "phone" ? st(n.value) : n.value;
69
69
  switch (e.compare) {
70
70
  case "equals":
71
71
  return o === e.compareValue;
@@ -113,37 +113,37 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
113
113
  }
114
114
  break;
115
115
  }
116
- }, Ue = (e, { context: r, submissions: t }) => {
116
+ }, ze = (e, { context: r, submissions: t }) => {
117
117
  let s = "combinator" in e.data ? e.data.conditions : [e.data];
118
118
  if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
119
- for (let a of s)
120
- if (zt({ condition: a, context: r, submissions: t, ifBlock: e }))
119
+ for (let i of s)
120
+ if (zt({ condition: i, context: r, submissions: t, ifBlock: e }))
121
121
  return !0;
122
122
  return !1;
123
123
  } else {
124
- for (let a of s)
125
- if (!zt({ condition: a, context: r, submissions: t, ifBlock: e }))
124
+ for (let i of s)
125
+ if (!zt({ condition: i, context: r, submissions: t, ifBlock: e }))
126
126
  return !1;
127
127
  return !0;
128
128
  }
129
- }, gs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, bs = (e, { context: r, submissions: t }) => e.replace(gs, (s, a, i = "") => {
130
- let [n, ...o] = a.trim().split("."), c = yr({ key: n, path: o, submissions: t, context: r });
129
+ }, bs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, vs = (e, { context: r, submissions: t }) => e.replace(bs, (s, i, a = "") => {
130
+ let [n, ...o] = i.trim().split("."), c = yr({ key: n, path: o, submissions: t, context: r });
131
131
  if (!c)
132
- return i;
132
+ return a;
133
133
  switch (c.type) {
134
134
  case "boolean":
135
135
  return c.value === !0 ? "true" : "false";
136
136
  case "file":
137
- return c.value.map((h) => `${h.name} (${ze(h.sizeKb)})`).join(", ");
137
+ return c.value.map((h) => `${h.name} (${We(h.sizeKb)})`).join(", ");
138
138
  case "enum":
139
139
  return c.value.join(", ");
140
140
  case "address":
141
141
  return Object.values(c.value).filter((h) => h && h.trim().length > 0).join(", ");
142
142
  case "number":
143
143
  case "string":
144
- return c.value ? c.value.toString() : i;
144
+ return c.value ? c.value.toString() : a;
145
145
  case "phone":
146
- return rt(c.value);
146
+ return st(c.value);
147
147
  case "integration": {
148
148
  if (typeof c.value != "object" || Array.isArray(c.value))
149
149
  break;
@@ -162,7 +162,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
162
162
  break;
163
163
  }
164
164
  }
165
- return i;
165
+ return a;
166
166
  });
167
167
  const _r = ({
168
168
  context: e,
@@ -170,46 +170,46 @@ const _r = ({
170
170
  }) => ({
171
171
  context: e,
172
172
  submissions: r ?? {}
173
- }), de = (e, r) => bs(e, _r(r)), vs = (e, r) => Ue(e, _r(r)), kr = ({
173
+ }), he = (e, r) => vs(e, _r(r)), xs = (e, r) => ze(e, _r(r)), kr = ({
174
174
  node: e,
175
175
  nodes: r,
176
176
  stopWhen: t
177
177
  }) => {
178
178
  if ((t == null ? void 0 : t(e)) === !0)
179
179
  return e;
180
- const s = e.nextId ? r.find((a) => a.id === e.nextId) : void 0;
180
+ const s = e.nextId ? r.find((i) => i.id === e.nextId) : void 0;
181
181
  if (s)
182
182
  return kr({
183
183
  node: s,
184
184
  nodes: r,
185
185
  stopWhen: t
186
186
  });
187
- }, xs = ({
187
+ }, ws = ({
188
188
  childNode: e,
189
189
  nodes: r
190
190
  }) => {
191
- const s = r.filter((a) => a.type === "if-block").find((a) => {
192
- if (!a.branchId)
191
+ const s = r.filter((i) => i.type === "if-block").find((i) => {
192
+ if (!i.branchId)
193
193
  return !1;
194
- const i = r.find((o) => o.id === a.branchId);
195
- if (!i)
194
+ const a = r.find((o) => o.id === i.branchId);
195
+ if (!a)
196
196
  return !1;
197
197
  const n = kr({
198
- node: i,
198
+ node: a,
199
199
  nodes: r,
200
200
  stopWhen: (o) => o.id === e.id
201
201
  });
202
202
  return !(!n || n.id !== e.id);
203
203
  });
204
204
  if (s != null && s.nextId)
205
- return r.find((a) => a.id === s.nextId);
206
- }, ws = ({
205
+ return r.find((i) => i.id === s.nextId);
206
+ }, _s = ({
207
207
  flow: e,
208
208
  analytics: r,
209
209
  logger: t,
210
210
  talentBankClient: s,
211
- context: a,
212
- apiClient: i,
211
+ context: i,
212
+ apiClient: a,
213
213
  getSubmissions: n,
214
214
  getApplicationRecovery: o,
215
215
  setApplicationRecovery: c,
@@ -222,11 +222,11 @@ const _r = ({
222
222
  var I;
223
223
  let C = new AbortController();
224
224
  (I = e.data).startedWriteNodeIds ?? (I.startedWriteNodeIds = e.nodes.flatMap((y) => {
225
- var M, D;
225
+ var M, O;
226
226
  if (y.type !== "integration-application-submit" || !e.data.nodeHistory.includes(y.id))
227
227
  return [];
228
228
  const _ = y.data.key ? (M = n()) == null ? void 0 : M[y.data.key] : void 0;
229
- return (_ == null ? void 0 : _.type) === "integration" && ((D = mr(_.value)) == null ? void 0 : D.verdict) === "not_submitted" ? [] : [y.id];
229
+ return (_ == null ? void 0 : _.type) === "integration" && ((O = mr(_.value)) == null ? void 0 : O.verdict) === "not_submitted" ? [] : [y.id];
230
230
  }));
231
231
  const E = {
232
232
  ...r.service,
@@ -241,33 +241,33 @@ const _r = ({
241
241
  const V = C.signal;
242
242
  if (V.aborted)
243
243
  return;
244
- const M = n(), D = o(), G = (D == null ? void 0 : D.submitNodeId) === y.id ? e.nodes.find((N) => {
245
- var q;
246
- return N.id === D.fileQuestionNodeId && N.type === "question-file" && ((q = M == null ? void 0 : M[N.data.key]) == null ? void 0 : q.type) !== "file";
244
+ const M = n(), O = o(), G = (O == null ? void 0 : O.submitNodeId) === y.id ? e.nodes.find((N) => {
245
+ var U;
246
+ return N.id === O.fileQuestionNodeId && N.type === "question-file" && ((U = M == null ? void 0 : M[N.data.key]) == null ? void 0 : U.type) !== "file";
247
247
  }) : void 0;
248
248
  if (G)
249
249
  return A(G, _);
250
250
  p == null || p(y, _);
251
251
  try {
252
- await _s({
252
+ await ks({
253
253
  flow: e,
254
254
  analytics: E,
255
255
  logger: t,
256
256
  talentBankClient: s,
257
- apiClient: i,
258
- context: a,
257
+ apiClient: a,
258
+ context: i,
259
259
  node: y,
260
260
  submissions: M,
261
- applicationRecovery: D,
261
+ applicationRecovery: O,
262
262
  setApplicationRecovery: async (N) => {
263
263
  if (!V.aborted)
264
264
  try {
265
265
  await c(N);
266
- } catch (q) {
267
- t.error("Failed to persist application recovery", q);
266
+ } catch (U) {
267
+ t.error("Failed to persist application recovery", U);
268
268
  }
269
269
  },
270
- forceSubmitConfirmation: (D == null ? void 0 : D.submitNodeId) === y.id,
270
+ forceSubmitConfirmation: (O == null ? void 0 : O.submitNodeId) === y.id,
271
271
  persistWriteBarrier: b,
272
272
  signal: V,
273
273
  t: m,
@@ -281,14 +281,14 @@ const _r = ({
281
281
  input: N,
282
282
  signal: V
283
283
  }),
284
- setSubmission: (N, q) => {
285
- V.aborted || h.setSubmission(N, q);
284
+ setSubmission: (N, U) => {
285
+ V.aborted || h.setSubmission(N, U);
286
286
  }
287
287
  },
288
288
  next: (N) => {
289
289
  if (V.aborted)
290
290
  return;
291
- const q = (D == null ? void 0 : D.fileQuestionNodeId) === y.id ? D.submitNodeId : N, L = q ? e.nodes.find((O) => O.id === q) : xs({
291
+ const U = (O == null ? void 0 : O.fileQuestionNodeId) === y.id ? O.submitNodeId : N, L = U ? e.nodes.find((D) => D.id === U) : ws({
292
292
  childNode: y,
293
293
  nodes: e.nodes
294
294
  });
@@ -310,8 +310,8 @@ const _r = ({
310
310
  return A(_);
311
311
  },
312
312
  undo: (y) => {
313
- var q;
314
- if ((q = e.data.startedWriteNodeIds) != null && q.length || e.data.isFinished)
313
+ var U;
314
+ if ((U = e.data.startedWriteNodeIds) != null && U.length || e.data.isFinished)
315
315
  return {
316
316
  removed: 0
317
317
  };
@@ -320,18 +320,18 @@ const _r = ({
320
320
  return {
321
321
  removed: 0
322
322
  };
323
- const D = e.nodes.find((L) => L.id === y[y.length - 1]);
323
+ const O = e.nodes.find((L) => L.id === y[y.length - 1]);
324
324
  C.abort();
325
325
  const G = y.splice(V);
326
326
  e.data.messages = e.data.messages.filter((L) => !L.groupId || !G.includes(L.groupId)), e.data.currentInput = null;
327
327
  const N = n();
328
328
  for (const L of G.slice(1)) {
329
- const O = e.nodes.find((w) => w.id === L);
330
- if (!(!O || !N || O.id === _) && ("key" in O.data && O.data.key && delete N[O.data.key], "keys" in O.data))
331
- for (const w of Object.values(O.data.keys))
329
+ const D = e.nodes.find((w) => w.id === L);
330
+ if (!(!D || !N || D.id === _) && ("key" in D.data && D.data.key && delete N[D.data.key], "keys" in D.data))
331
+ for (const w of Object.values(D.data.keys))
332
332
  typeof w == "string" && delete N[w];
333
333
  }
334
- return C = new AbortController(), A(M, D), {
334
+ return C = new AbortController(), A(M, O), {
335
335
  removed: G.length
336
336
  };
337
337
  },
@@ -340,7 +340,7 @@ const _r = ({
340
340
  }
341
341
  };
342
342
  };
343
- async function _s(e) {
343
+ async function ks(e) {
344
344
  const r = e.node;
345
345
  switch (r.type) {
346
346
  case "flow-section":
@@ -350,32 +350,32 @@ async function _s(e) {
350
350
  text: r.data.title
351
351
  }), e.next(r.nextId);
352
352
  case "pre-apply-result":
353
- return zs({
353
+ return Ws({
354
354
  ...e,
355
355
  node: r
356
356
  });
357
357
  case "text":
358
- return Ts({
358
+ return Ds({
359
359
  ...e,
360
360
  node: r
361
361
  });
362
362
  case "image":
363
- return Ds({
363
+ return Os({
364
364
  ...e,
365
365
  node: r
366
366
  });
367
367
  case "question-text":
368
- return Os({
368
+ return Rs({
369
369
  ...e,
370
370
  node: r
371
371
  });
372
372
  case "question-enum":
373
- return Ps({
373
+ return js({
374
374
  ...e,
375
375
  node: r
376
376
  });
377
377
  case "question-number":
378
- return Rs({
378
+ return Ps({
379
379
  ...e,
380
380
  node: r
381
381
  });
@@ -385,59 +385,59 @@ async function _s(e) {
385
385
  node: r
386
386
  });
387
387
  case "question-boolean":
388
- return js({
388
+ return $s({
389
389
  ...e,
390
390
  node: r
391
391
  });
392
392
  case "question-file":
393
- return qs({
393
+ return Us({
394
394
  ...e,
395
395
  node: r
396
396
  });
397
397
  case "question-address":
398
- return $s({
398
+ return qs({
399
399
  ...e,
400
400
  node: r
401
401
  });
402
402
  case "end-flow":
403
- return Us({
403
+ return zs({
404
404
  ...e,
405
405
  node: r
406
406
  });
407
407
  case "if-block":
408
- return Ls({
408
+ return Ts({
409
409
  ...e,
410
410
  node: r
411
411
  });
412
412
  case "jump":
413
- return Ss({
413
+ return Is({
414
414
  ...e,
415
415
  node: r
416
416
  });
417
417
  case "link":
418
- return Ns({
418
+ return Ls({
419
419
  ...e,
420
420
  node: r
421
421
  });
422
422
  case "integration-application-submit":
423
- return Es({
423
+ return Ns({
424
424
  ...e,
425
425
  node: r
426
426
  });
427
427
  case "add-submission":
428
- return Is({
428
+ return Fs({
429
429
  ...e,
430
430
  node: r
431
431
  });
432
432
  case "integration-workflow-get":
433
433
  throw Error("Workflow should be unreachable");
434
434
  case "check-duplicate":
435
- return Cs({
435
+ return Ss({
436
436
  ...e,
437
437
  node: r
438
438
  });
439
439
  case "feedback":
440
- return ks({
440
+ return Cs({
441
441
  ...e,
442
442
  node: r
443
443
  });
@@ -445,19 +445,19 @@ async function _s(e) {
445
445
  throw new Error(`Unknown node: ${JSON.stringify(r)}`);
446
446
  }
447
447
  }
448
- async function ks({
448
+ async function Cs({
449
449
  next: e,
450
450
  node: r
451
451
  }) {
452
452
  e(r.nextId);
453
453
  }
454
- async function Cs({
454
+ async function Ss({
455
455
  next: e,
456
456
  node: r,
457
457
  talentBankClient: t,
458
458
  submissions: s,
459
- flow: a,
460
- logger: i,
459
+ flow: i,
460
+ logger: a,
461
461
  chat: n
462
462
  }) {
463
463
  var c;
@@ -465,7 +465,7 @@ async function Cs({
465
465
  isDuplicate: !1
466
466
  };
467
467
  if (s && t) {
468
- const h = r.data.scope === "job" ? (c = a.job) == null ? void 0 : c.id : void 0;
468
+ const h = r.data.scope === "job" ? (c = i.job) == null ? void 0 : c.id : void 0;
469
469
  if (r.data.scope === "company" || h != null)
470
470
  try {
471
471
  o = await t.checkDuplicate({
@@ -477,7 +477,7 @@ async function Cs({
477
477
  scope: r.data.scope
478
478
  });
479
479
  } catch (b) {
480
- i.error("[check-duplicate]", b);
480
+ a.error("[check-duplicate]", b);
481
481
  }
482
482
  }
483
483
  n.setSubmission(r.data.key, {
@@ -485,18 +485,18 @@ async function Cs({
485
485
  value: o
486
486
  }), e(r.nextId);
487
487
  }
488
- async function Ss({
488
+ async function Is({
489
489
  next: e,
490
490
  node: r
491
491
  }) {
492
492
  e(r.data.targetId);
493
493
  }
494
- async function Is({
494
+ async function Fs({
495
495
  next: e,
496
496
  node: r,
497
497
  logger: t,
498
498
  submissions: s,
499
- context: a
499
+ context: i
500
500
  }) {
501
501
  if (!s) {
502
502
  t.error("Submissions not found");
@@ -504,32 +504,32 @@ async function Is({
504
504
  }
505
505
  s[r.data.key] = {
506
506
  type: "string",
507
- value: de(r.data.value, {
507
+ value: he(r.data.value, {
508
508
  submissions: s,
509
- context: a
509
+ context: i
510
510
  })
511
511
  }, e(r.nextId);
512
512
  }
513
- const Fs = 5e3, Cr = 3e4, Vs = 2e4, As = 6e4, Sr = 12e4, Ms = (e, r, t) => {
514
- if ((t == null ? void 0 : t.providerStatus) !== 429 || t.retryable !== !0)
513
+ const Vs = 5e3, Cr = 3e4, As = 2e4, Ms = 6e4, Sr = 12e4, Es = (e, r, t) => {
514
+ if (!((t == null ? void 0 : t.retryable) === !0 && (t.providerStatus === 429 || t.providerStatus !== void 0 && t.providerStatus >= 500 || t.phase === "workflow" && t.verdict === "not_submitted")))
515
515
  return {
516
516
  key: e,
517
517
  until: Date.now() + Cr
518
518
  };
519
- const s = ((r == null ? void 0 : r.throttles) ?? 0) + 1, a = Math.min(s * Vs, As), i = (t.retryAfterSeconds ?? 0) * 1e3;
519
+ const i = ((r == null ? void 0 : r.throttles) ?? 0) + 1, a = Math.min(i * As, Ms), n = (t.retryAfterSeconds ?? 0) * 1e3;
520
520
  return {
521
521
  key: e,
522
- until: Date.now() + Math.min(Math.max(a, i), Sr),
523
- throttles: s
522
+ until: Date.now() + Math.min(Math.max(a, n), Sr),
523
+ throttles: i
524
524
  };
525
525
  };
526
- async function Es({
526
+ async function Ns({
527
527
  chat: e,
528
528
  next: r,
529
529
  end: t,
530
530
  node: s,
531
- logger: a,
532
- apiClient: i,
531
+ logger: i,
532
+ apiClient: a,
533
533
  submissions: n,
534
534
  analytics: o,
535
535
  flow: c,
@@ -548,8 +548,8 @@ async function Es({
548
548
  text: C("submission_unknown")
549
549
  }), t();
550
550
  const E = c.job ? `${s.id}@${c.job.id_type}:${c.job.id}` : s.id, A = async (y) => {
551
- var ve, xe, we, Pe, je, Xe;
552
- const _ = ((ve = c.data.submitCooldown) == null ? void 0 : ve.key) === E ? c.data.submitCooldown : void 0;
551
+ var we, _e, Be, je, Ye, $e;
552
+ const _ = ((we = c.data.submitCooldown) == null ? void 0 : we.key) === E ? c.data.submitCooldown : void 0;
553
553
  _ && (_.until = Math.min(_.until, Date.now() + (_.throttles ? Sr : Cr)));
554
554
  const V = _ == null ? void 0 : _.until;
555
555
  (y !== !0 || V !== void 0 && V > Date.now()) && await e.userInput({
@@ -567,15 +567,15 @@ async function Es({
567
567
  });
568
568
  const {
569
569
  anonymous_id: M,
570
- session_id: D
570
+ session_id: O
571
571
  } = o.getSessionInfo();
572
572
  if (m.aborted)
573
573
  return;
574
- const G = ((xe = c.data.startedWriteNodeIds) == null ? void 0 : xe.includes(s.id)) === !0;
575
- if ((h == null ? void 0 : h.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await p().catch((P) => a.error("Failed to persist application write barrier", P)), m.aborted)
574
+ const G = ((_e = c.data.startedWriteNodeIds) == null ? void 0 : _e.includes(s.id)) === !0;
575
+ if ((h == null ? void 0 : h.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await p().catch((j) => i.error("Failed to persist application write barrier", j)), m.aborted)
576
576
  return;
577
577
  let N;
578
- const q = setTimeout(() => {
578
+ const U = setTimeout(() => {
579
579
  N = (async () => {
580
580
  await e.sendMessage({
581
581
  type: "text",
@@ -585,65 +585,68 @@ async function Es({
585
585
  type: "loading",
586
586
  text: C("submitting")
587
587
  });
588
- })().catch((P) => a.error("Failed to send submission progress message", P));
589
- }, Fs);
588
+ })().catch((j) => i.error("Failed to send submission progress message", j));
589
+ }, Vs);
590
590
  let L;
591
- const O = await i.fetch("/flow/submit", {
591
+ const D = await a.fetch("/flow/submit", {
592
592
  method: "POST",
593
593
  body: JSON.stringify({
594
594
  log_submit: !1,
595
595
  integration_id: s.data.integrationId,
596
596
  anonymous_id: M,
597
- session_id: D,
597
+ session_id: O,
598
598
  job: c.job,
599
599
  flow_build: c.build,
600
- submissions: is(c.nodes, os(n || {}, s.data.submitKeys)),
600
+ submissions: as(c.nodes, os(n || {}, s.data.submitKeys)),
601
601
  pre_apply: br(c.nodes, n || {}, c.data.flowSessionId)
602
602
  })
603
- }).catch((P) => (L = P, ys(P) ? P.data : P));
604
- if (clearTimeout(q), await N, m.aborted)
603
+ }).catch((j) => (L = j, ms(j) ? j.data : j));
604
+ if (clearTimeout(U), await N, m.aborted)
605
605
  return;
606
606
  s.data.key && e.setSubmission(s.data.key, {
607
607
  type: "integration",
608
- value: O
608
+ value: D
609
609
  });
610
- const w = mr(O, L instanceof ms ? L.status : void 0), T = ((we = c.data.unconfirmedAttemptKeys) == null ? void 0 : we.includes(E)) === !0, U = ls(O);
611
- if (U && o.log({
610
+ const w = mr(D, L instanceof gs ? L.status : void 0), T = ((Be = c.data.unconfirmedAttemptKeys) == null ? void 0 : Be.includes(E)) === !0, q = ls(D);
611
+ if (q && o.log({
612
612
  event: "FLOW_SUBMIT",
613
613
  properties: {
614
614
  flow_id: c.id,
615
615
  flow_version: c.version,
616
616
  flow_session_id: c.data.flowSessionId,
617
617
  flow_build: c.build,
618
- service: U.service,
619
- response: U.response,
618
+ service: q.service,
619
+ response: q.response,
620
620
  flow_type: "CHATBOT_DRAWER",
621
621
  job: c.job,
622
622
  // Measures how many duplicates follow the candidate's own unconfirmed attempt.
623
623
  ...(w == null ? void 0 : w.outcome) === "duplicate" && {
624
624
  outcome: T ? "duplicate_after_own_attempt" : "duplicate"
625
+ },
626
+ ...q.outcome && {
627
+ outcome: q.outcome
625
628
  }
626
629
  }
627
- }), ($t(O) || (O == null ? void 0 : O.success) === !0) && ((Pe = c.data.submitCooldown) == null ? void 0 : Pe.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await p().catch((P) => a.error("Failed to persist submit cooldown reset", P))), $t(O)) {
630
+ }), ($t(D) || (D == null ? void 0 : D.success) === !0) && ((je = c.data.submitCooldown) == null ? void 0 : je.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await p().catch((j) => i.error("Failed to persist submit cooldown reset", j))), $t(D)) {
628
631
  const {
629
- redirect_url: P,
630
- message: ut,
631
- button_text: Ye
632
- } = O.integration_response.data;
632
+ redirect_url: j,
633
+ message: Qe,
634
+ button_text: ct
635
+ } = D.integration_response.data;
633
636
  await e.sendMessage({
634
637
  type: "text",
635
638
  author: "bot",
636
- text: ut ?? C("submission_redirect_message")
639
+ text: Qe ?? C("submission_redirect_message")
637
640
  });
638
641
  try {
639
- const _e = new URL(P);
640
- M && !_e.searchParams.has("anonymous_id") && _e.searchParams.set("anonymous_id", M), await e.sendMessage({
642
+ const ce = new URL(j);
643
+ M && !ce.searchParams.has("anonymous_id") && ce.searchParams.set("anonymous_id", M), await e.sendMessage({
641
644
  type: "link",
642
- href: _e.toString(),
643
- text: Ye ?? C("complete_submission"),
645
+ href: ce.toString(),
646
+ text: ct ?? C("complete_submission"),
644
647
  onClick: () => {
645
- if (!D) {
646
- a.error("session_id not set, cannot log FLOW_REDIRECT event");
648
+ if (!O) {
649
+ i.error("session_id not set, cannot log FLOW_REDIRECT event");
647
650
  return;
648
651
  }
649
652
  o.log({
@@ -651,16 +654,16 @@ async function Es({
651
654
  properties: {
652
655
  flow_build: c.build,
653
656
  flow_id: c.id,
654
- flow_session_id: D,
657
+ flow_session_id: O,
655
658
  flow_version: c.version,
656
- href: _e.toString(),
659
+ href: ce.toString(),
657
660
  job: c.job
658
661
  }
659
662
  });
660
663
  }
661
664
  });
662
- } catch (_e) {
663
- a.error(`Invalid redirect URL: ${P}`, _e), e.sendMessage({
665
+ } catch (ce) {
666
+ i.error(`Invalid redirect URL: ${j}`, ce), e.sendMessage({
664
667
  type: "system",
665
668
  variant: "error",
666
669
  text: C("redirect_url_error")
@@ -668,21 +671,28 @@ async function Es({
668
671
  }
669
672
  return r(s.nextId);
670
673
  }
671
- if ((O == null ? void 0 : O.success) === !0)
674
+ const te = us(D);
675
+ if (te)
676
+ return await e.sendMessage({
677
+ type: "system",
678
+ variant: "success",
679
+ text: te.message ?? C("submission_pending")
680
+ }), r(s.nextId);
681
+ if ((D == null ? void 0 : D.success) === !0)
672
682
  return s.data.skipConfirmation !== !0 && await e.sendMessage({
673
683
  type: "system",
674
684
  variant: "success",
675
685
  text: C("submission_completed")
676
686
  }), r(s.nextId);
677
- const X = (w == null ? void 0 : w.phase) === "submit" && w.verdict === "confirmed" && w.code === "unreadable_document" && typeof w.field == "string" && w.status !== void 0 && w.status >= 400 && w.status < 500 && ((je = n == null ? void 0 : n[w.field]) == null ? void 0 : je.type) === "file" ? w.field : void 0, J = X === void 0 ? void 0 : c.nodes.find((P) => P.type === "question-file" && P.data.key === X);
678
- return J || (c.data.submitCooldown = Ms(E, _, w)), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = (Xe = c.data.startedWriteNodeIds) == null ? void 0 : Xe.filter((P) => P !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await b(h), await p().catch((P) => a.error("Failed to persist application write barrier release", P))) : (w == null ? void 0 : w.verdict) !== "confirmed" && !T ? (c.data.unconfirmedAttemptKeys = [...c.data.unconfirmedAttemptKeys ?? [], E], await p().catch((P) => a.error("Failed to persist unconfirmed attempt", P))) : await p().catch((P) => a.error("Failed to persist submit cooldown", P)), w ? (a.error(L ?? w.message), J && X !== void 0 ? (e.setSubmission(X, null), await b({
679
- fileQuestionNodeId: J.id,
687
+ const J = (w == null ? void 0 : w.phase) === "submit" && w.verdict === "confirmed" && w.code === "unreadable_document" && typeof w.field == "string" && w.status !== void 0 && w.status >= 400 && w.status < 500 && ((Ye = n == null ? void 0 : n[w.field]) == null ? void 0 : Ye.type) === "file" ? w.field : void 0, ue = J === void 0 ? void 0 : c.nodes.find((j) => j.type === "question-file" && j.data.key === J);
688
+ return ue || (c.data.submitCooldown = Es(E, _, w)), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = ($e = c.data.startedWriteNodeIds) == null ? void 0 : $e.filter((j) => j !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await b(h), await p().catch((j) => i.error("Failed to persist application write barrier release", j))) : (w == null ? void 0 : w.verdict) !== "confirmed" && !T ? (c.data.unconfirmedAttemptKeys = [...c.data.unconfirmedAttemptKeys ?? [], E], await p().catch((j) => i.error("Failed to persist unconfirmed attempt", j))) : await p().catch((j) => i.error("Failed to persist submit cooldown", j)), w ? (i.error(L ?? w.message), ue && J !== void 0 ? (e.setSubmission(J, null), await b({
689
+ fileQuestionNodeId: ue.id,
680
690
  submitNodeId: s.id
681
691
  }), await e.sendMessage({
682
692
  type: "system",
683
693
  variant: "error",
684
694
  text: C("submission_unreadable_document")
685
- }), r(J.id)) : w.outcome === "duplicate" ? (await e.sendMessage({
695
+ }), r(ue.id)) : w.outcome === "duplicate" ? (await e.sendMessage({
686
696
  type: "system",
687
697
  variant: "info",
688
698
  text: C(T ? "submission_duplicate_earlier_attempt" : "submission_duplicate")
@@ -702,7 +712,7 @@ async function Es({
702
712
  type: "system",
703
713
  variant: "error",
704
714
  text: C("submission_failed")
705
- }), t())) : (a.error(L ?? O), await e.sendMessage({
715
+ }), t())) : (i.error(L ?? D), await e.sendMessage({
706
716
  type: "system",
707
717
  variant: "error",
708
718
  text: C("submission_failed")
@@ -710,53 +720,53 @@ async function Es({
710
720
  };
711
721
  await A(x === !0 ? !1 : s.data.skipConfirmation);
712
722
  }
713
- async function Ns({
723
+ async function Ls({
714
724
  chat: e,
715
725
  next: r,
716
726
  node: t,
717
727
  submissions: s,
718
- context: a
728
+ context: i
719
729
  }) {
720
730
  await e.sendMessage({
721
731
  type: "link",
722
- href: de(t.data.href, {
732
+ href: he(t.data.href, {
723
733
  submissions: s,
724
- context: a
734
+ context: i
725
735
  }),
726
- text: de(t.data.cta, {
736
+ text: he(t.data.cta, {
727
737
  submissions: s,
728
- context: a
738
+ context: i
729
739
  })
730
740
  }), r(t.nextId);
731
741
  }
732
- async function Ls({
742
+ async function Ts({
733
743
  submissions: e,
734
744
  next: r,
735
745
  node: t,
736
746
  context: s
737
747
  }) {
738
- r(vs(t, {
748
+ r(xs(t, {
739
749
  submissions: e,
740
750
  context: s
741
751
  }) ? t.branchId : t.nextId);
742
752
  }
743
- async function Ts({
753
+ async function Ds({
744
754
  chat: e,
745
755
  next: r,
746
756
  node: t,
747
757
  submissions: s,
748
- context: a
758
+ context: i
749
759
  }) {
750
760
  await e.sendMessage({
751
761
  author: "bot",
752
762
  type: "text",
753
- text: de(t.data.text, {
763
+ text: he(t.data.text, {
754
764
  submissions: s,
755
- context: a
765
+ context: i
756
766
  })
757
767
  }), r(t.nextId);
758
768
  }
759
- async function Ds({
769
+ async function Os({
760
770
  chat: e,
761
771
  next: r,
762
772
  node: t
@@ -769,20 +779,20 @@ async function Ds({
769
779
  width: t.data.width
770
780
  }), r(t.nextId);
771
781
  }
772
- async function Os({
782
+ async function Rs({
773
783
  chat: e,
774
784
  next: r,
775
785
  node: t,
776
786
  submissions: s,
777
- context: a,
778
- t: i
787
+ context: i,
788
+ t: a
779
789
  }) {
780
790
  await e.sendMessage({
781
791
  author: "bot",
782
792
  type: "text",
783
- text: de(t.data.question, {
793
+ text: he(t.data.question, {
784
794
  submissions: s,
785
- context: a
795
+ context: i
786
796
  })
787
797
  });
788
798
  const n = t.data.format === "phone" ? await e.userInput({
@@ -810,27 +820,27 @@ async function Os({
810
820
  n === null ? await e.sendMessage({
811
821
  type: "system",
812
822
  variant: "info",
813
- text: i("skipped")
823
+ text: a("skipped")
814
824
  }) : await e.sendMessage({
815
825
  author: "user",
816
826
  type: "text",
817
- text: n.type === "phone" ? rt(n.value) : n.value
827
+ text: n.type === "phone" ? st(n.value) : n.value
818
828
  }), r(t.nextId);
819
829
  }
820
- async function Rs({
830
+ async function Ps({
821
831
  chat: e,
822
832
  next: r,
823
833
  node: t,
824
834
  submissions: s,
825
- context: a,
826
- t: i
835
+ context: i,
836
+ t: a
827
837
  }) {
828
838
  await e.sendMessage({
829
839
  author: "bot",
830
840
  type: "text",
831
- text: de(t.data.question, {
841
+ text: he(t.data.question, {
832
842
  submissions: s,
833
- context: a
843
+ context: i
834
844
  })
835
845
  });
836
846
  const n = await e.userInput({
@@ -847,7 +857,7 @@ async function Rs({
847
857
  n === null ? await e.sendMessage({
848
858
  type: "system",
849
859
  variant: "info",
850
- text: i("skipped")
860
+ text: a("skipped")
851
861
  }) : await e.sendMessage({
852
862
  author: "user",
853
863
  type: "text",
@@ -859,15 +869,15 @@ async function Bs({
859
869
  next: r,
860
870
  node: t,
861
871
  submissions: s,
862
- context: a,
863
- t: i
872
+ context: i,
873
+ t: a
864
874
  }) {
865
875
  await e.sendMessage({
866
876
  author: "bot",
867
877
  type: "text",
868
- text: de(t.data.question, {
878
+ text: he(t.data.question, {
869
879
  submissions: s,
870
- context: a
880
+ context: i
871
881
  })
872
882
  });
873
883
  const n = await e.userInput({
@@ -886,27 +896,27 @@ async function Bs({
886
896
  n === null ? await e.sendMessage({
887
897
  type: "system",
888
898
  variant: "info",
889
- text: i("skipped")
899
+ text: a("skipped")
890
900
  }) : await e.sendMessage({
891
901
  author: "user",
892
902
  type: "text",
893
- text: n.type === "phone" ? rt(n.value) : n.value
903
+ text: n.type === "phone" ? st(n.value) : n.value
894
904
  }), r(t.nextId);
895
905
  }
896
- async function Ps({
906
+ async function js({
897
907
  chat: e,
898
908
  next: r,
899
909
  node: t,
900
910
  submissions: s,
901
- context: a,
902
- t: i
911
+ context: i,
912
+ t: a
903
913
  }) {
904
914
  await e.sendMessage({
905
915
  author: "bot",
906
916
  type: "text",
907
- text: de(t.data.question, {
917
+ text: he(t.data.question, {
908
918
  submissions: s,
909
- context: a
919
+ context: i
910
920
  })
911
921
  });
912
922
  const n = await e.userInput({
@@ -917,27 +927,27 @@ async function Ps({
917
927
  n.value.length === 0 ? await e.sendMessage({
918
928
  type: "system",
919
929
  variant: "info",
920
- text: i("skipped")
930
+ text: a("skipped")
921
931
  }) : await e.sendMessage({
922
932
  author: "user",
923
933
  type: "text",
924
934
  text: t.data.options.filter((o) => n.value.includes(o.value)).map((o) => o.label).join(", ")
925
935
  }), r(t.nextId);
926
936
  }
927
- async function js({
937
+ async function $s({
928
938
  chat: e,
929
939
  next: r,
930
940
  node: t,
931
941
  submissions: s,
932
- context: a,
933
- t: i
942
+ context: i,
943
+ t: a
934
944
  }) {
935
945
  await e.sendMessage({
936
946
  author: "bot",
937
947
  type: "text",
938
- text: de(t.data.question, {
948
+ text: he(t.data.question, {
939
949
  submissions: s,
940
- context: a
950
+ context: i
941
951
  })
942
952
  });
943
953
  const n = await e.userInput({
@@ -954,14 +964,14 @@ async function js({
954
964
  n === null ? await e.sendMessage({
955
965
  type: "system",
956
966
  variant: "info",
957
- text: i("skipped")
967
+ text: a("skipped")
958
968
  }) : await e.sendMessage({
959
969
  author: "user",
960
970
  type: "text",
961
971
  text: n.value === !0 ? t.data.trueLabel : t.data.falseLabel
962
972
  }), r(t.nextId);
963
973
  }
964
- async function $s({
974
+ async function qs({
965
975
  chat: e,
966
976
  next: r,
967
977
  node: t,
@@ -972,45 +982,46 @@ async function $s({
972
982
  type: "text",
973
983
  text: t.data.question
974
984
  });
975
- const a = await e.userInput({
985
+ const i = await e.userInput({
976
986
  type: "address",
977
987
  key: t.data.key,
978
988
  config: {
979
989
  optional: t.data.optional,
980
990
  keys: t.data.keys,
991
+ line2Required: t.data.line2Required,
981
992
  placeholder: t.data.placeholder
982
993
  }
983
994
  });
984
- if (a === null)
995
+ if (i === null)
985
996
  await e.sendMessage({
986
997
  type: "system",
987
998
  variant: "info",
988
999
  text: s("skipped")
989
1000
  });
990
1001
  else {
991
- const i = Object.values(a.value).filter((n) => n && n.trim().length > 0).join(", ");
1002
+ const a = Object.values(i.value).filter((n) => n && n.trim().length > 0).join(", ");
992
1003
  await e.sendMessage({
993
1004
  author: "user",
994
1005
  type: "text",
995
- text: i
1006
+ text: a
996
1007
  });
997
1008
  }
998
1009
  return r(t.nextId);
999
1010
  }
1000
- async function qs({
1011
+ async function Us({
1001
1012
  node: e,
1002
1013
  chat: r,
1003
1014
  next: t,
1004
1015
  submissions: s,
1005
- context: a,
1006
- t: i
1016
+ context: i,
1017
+ t: a
1007
1018
  }) {
1008
1019
  await r.sendMessage({
1009
1020
  author: "bot",
1010
1021
  type: "text",
1011
- text: de(e.data.question, {
1022
+ text: he(e.data.question, {
1012
1023
  submissions: s,
1013
- context: a
1024
+ context: i
1014
1025
  })
1015
1026
  });
1016
1027
  const n = await r.userInput({
@@ -1028,7 +1039,7 @@ async function qs({
1028
1039
  await r.sendMessage({
1029
1040
  type: "system",
1030
1041
  variant: "info",
1031
- text: i("skipped")
1042
+ text: a("skipped")
1032
1043
  });
1033
1044
  else
1034
1045
  for (const o of n.value)
@@ -1040,7 +1051,7 @@ async function qs({
1040
1051
  });
1041
1052
  return t(e.nextId);
1042
1053
  }
1043
- async function Us({
1054
+ async function zs({
1044
1055
  chat: e,
1045
1056
  end: r,
1046
1057
  node: t
@@ -1051,16 +1062,16 @@ async function Us({
1051
1062
  text: t.data.systemMessage
1052
1063
  }), r();
1053
1064
  }
1054
- async function zs({
1065
+ async function Ws({
1055
1066
  node: e,
1056
1067
  flow: r,
1057
1068
  submissions: t,
1058
1069
  chat: s,
1059
- next: a,
1060
- apiClient: i,
1070
+ next: i,
1071
+ apiClient: a,
1061
1072
  analytics: n
1062
1073
  }) {
1063
- const o = as(r.nodes, t || {}), {
1074
+ const o = is(r.nodes, t || {}), {
1064
1075
  answers: c,
1065
1076
  ...h
1066
1077
  } = o;
@@ -1069,7 +1080,7 @@ async function zs({
1069
1080
  value: h
1070
1081
  });
1071
1082
  const b = new AbortController(), x = setTimeout(() => b.abort(), 5e3);
1072
- if (i.fetch("/flow/pre-apply", {
1083
+ if (a.fetch("/flow/pre-apply", {
1073
1084
  method: "POST",
1074
1085
  signal: b.signal,
1075
1086
  body: JSON.stringify({
@@ -1105,9 +1116,9 @@ async function zs({
1105
1116
  }
1106
1117
  });
1107
1118
  }
1108
- return a(e.nextId);
1119
+ return i(e.nextId);
1109
1120
  }
1110
- const Me = ({
1121
+ const Ee = ({
1111
1122
  class: e,
1112
1123
  ...r
1113
1124
  }) => {
@@ -1137,14 +1148,14 @@ const Me = ({
1137
1148
  })
1138
1149
  });
1139
1150
  };
1140
- var he;
1151
+ var ye;
1141
1152
  // @__NO_SIDE_EFFECTS__
1142
- function nt(e) {
1153
+ function it(e) {
1143
1154
  return {
1144
- lang: (e == null ? void 0 : e.lang) ?? (he == null ? void 0 : he.lang),
1155
+ lang: (e == null ? void 0 : e.lang) ?? (ye == null ? void 0 : ye.lang),
1145
1156
  message: e == null ? void 0 : e.message,
1146
- abortEarly: (e == null ? void 0 : e.abortEarly) ?? (he == null ? void 0 : he.abortEarly),
1147
- abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (he == null ? void 0 : he.abortPipeEarly)
1157
+ abortEarly: (e == null ? void 0 : e.abortEarly) ?? (ye == null ? void 0 : ye.abortEarly),
1158
+ abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ye == null ? void 0 : ye.abortPipeEarly)
1148
1159
  };
1149
1160
  }
1150
1161
  var yt;
@@ -1154,12 +1165,12 @@ function Ks(e) {
1154
1165
  }
1155
1166
  var mt;
1156
1167
  // @__NO_SIDE_EFFECTS__
1157
- function Ws(e) {
1168
+ function Gs(e) {
1158
1169
  return mt == null ? void 0 : mt.get(e);
1159
1170
  }
1160
1171
  var gt;
1161
1172
  // @__NO_SIDE_EFFECTS__
1162
- function Gs(e, r) {
1173
+ function Hs(e, r) {
1163
1174
  var t;
1164
1175
  return (t = gt == null ? void 0 : gt.get(e)) == null ? void 0 : t.get(r);
1165
1176
  }
@@ -1169,42 +1180,42 @@ function De(e) {
1169
1180
  const r = typeof e;
1170
1181
  return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((s = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : s.name)) ?? "null" : r;
1171
1182
  }
1172
- function Y(e, r, t, s, a) {
1173
- const i = a && "input" in a ? a.input : t.value, n = (a == null ? void 0 : a.expected) ?? e.expects ?? null, o = (a == null ? void 0 : a.received) ?? /* @__PURE__ */ De(i), c = {
1183
+ function Z(e, r, t, s, i) {
1184
+ const a = i && "input" in i ? i.input : t.value, n = (i == null ? void 0 : i.expected) ?? e.expects ?? null, o = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ De(a), c = {
1174
1185
  kind: e.kind,
1175
1186
  type: e.type,
1176
- input: i,
1187
+ input: a,
1177
1188
  expected: n,
1178
1189
  received: o,
1179
1190
  message: `Invalid ${r}: ${n ? `Expected ${n} but r` : "R"}eceived ${o}`,
1180
1191
  requirement: e.requirement,
1181
- path: a == null ? void 0 : a.path,
1182
- issues: a == null ? void 0 : a.issues,
1192
+ path: i == null ? void 0 : i.path,
1193
+ issues: i == null ? void 0 : i.issues,
1183
1194
  lang: s.lang,
1184
1195
  abortEarly: s.abortEarly,
1185
1196
  abortPipeEarly: s.abortPipeEarly
1186
- }, h = e.kind === "schema", b = (a == null ? void 0 : a.message) ?? e.message ?? /* @__PURE__ */ Gs(e.reference, c.lang) ?? (h ? /* @__PURE__ */ Ws(c.lang) : null) ?? s.message ?? /* @__PURE__ */ Ks(c.lang);
1197
+ }, h = e.kind === "schema", b = (i == null ? void 0 : i.message) ?? e.message ?? /* @__PURE__ */ Hs(e.reference, c.lang) ?? (h ? /* @__PURE__ */ Gs(c.lang) : null) ?? s.message ?? /* @__PURE__ */ Ks(c.lang);
1187
1198
  b !== void 0 && (c.message = typeof b == "function" ? (
1188
1199
  // @ts-expect-error
1189
1200
  b(c)
1190
1201
  ) : b), h && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
1191
1202
  }
1192
1203
  // @__NO_SIDE_EFFECTS__
1193
- function fe(e) {
1204
+ function pe(e) {
1194
1205
  return {
1195
1206
  version: 1,
1196
1207
  vendor: "valibot",
1197
1208
  validate(r) {
1198
- return e["~run"]({ value: r }, /* @__PURE__ */ nt());
1209
+ return e["~run"]({ value: r }, /* @__PURE__ */ it());
1199
1210
  }
1200
1211
  };
1201
1212
  }
1202
1213
  // @__NO_SIDE_EFFECTS__
1203
- function Hs(e, r) {
1214
+ function Js(e, r) {
1204
1215
  return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
1205
1216
  }
1206
1217
  // @__NO_SIDE_EFFECTS__
1207
- function Js(e, r) {
1218
+ function Xs(e, r) {
1208
1219
  const t = [...new Set(e)];
1209
1220
  return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
1210
1221
  }
@@ -1221,7 +1232,7 @@ function Zs(e) {
1221
1232
  }
1222
1233
  return null;
1223
1234
  }
1224
- var Xs = class extends Error {
1235
+ var Ys = class extends Error {
1225
1236
  /**
1226
1237
  * Creates a Valibot error with useful information.
1227
1238
  *
@@ -1230,7 +1241,7 @@ var Xs = class extends Error {
1230
1241
  constructor(e) {
1231
1242
  super(e[0].message), this.name = "ValiError", this.issues = e;
1232
1243
  }
1233
- }, Ys = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
1244
+ }, Qs = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
1234
1245
  // @__NO_SIDE_EFFECTS__
1235
1246
  function Ir(e, r) {
1236
1247
  return {
@@ -1242,7 +1253,7 @@ function Ir(e, r) {
1242
1253
  requirement: e,
1243
1254
  message: r,
1244
1255
  "~run"(t, s) {
1245
- return t.typed && !this.requirement(t.value) && Y(this, "input", t, s), t;
1256
+ return t.typed && !this.requirement(t.value) && Z(this, "input", t, s), t;
1246
1257
  }
1247
1258
  };
1248
1259
  }
@@ -1254,10 +1265,10 @@ function Fr(e) {
1254
1265
  reference: Fr,
1255
1266
  expects: null,
1256
1267
  async: !1,
1257
- requirement: Ys,
1268
+ requirement: Qs,
1258
1269
  message: e,
1259
1270
  "~run"(r, t) {
1260
- return r.typed && !this.requirement.test(r.value) && Y(this, "email", r, t), r;
1271
+ return r.typed && !this.requirement.test(r.value) && Z(this, "email", r, t), r;
1261
1272
  }
1262
1273
  };
1263
1274
  }
@@ -1272,7 +1283,7 @@ function Ke(e, r) {
1272
1283
  requirement: e,
1273
1284
  message: r,
1274
1285
  "~run"(t, s) {
1275
- return t.typed && t.value.length > this.requirement && Y(this, "length", t, s, {
1286
+ return t.typed && t.value.length > this.requirement && Z(this, "length", t, s, {
1276
1287
  received: `${t.value.length}`
1277
1288
  }), t;
1278
1289
  }
@@ -1289,7 +1300,7 @@ function Vr(e, r) {
1289
1300
  requirement: e,
1290
1301
  message: r,
1291
1302
  "~run"(t, s) {
1292
- return t.typed && !(t.value <= this.requirement) && Y(this, "value", t, s, {
1303
+ return t.typed && !(t.value <= this.requirement) && Z(this, "value", t, s, {
1293
1304
  received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ De(t.value)
1294
1305
  }), t;
1295
1306
  }
@@ -1306,7 +1317,7 @@ function Te(e, r) {
1306
1317
  requirement: e,
1307
1318
  message: r,
1308
1319
  "~run"(t, s) {
1309
- return t.typed && t.value.length < this.requirement && Y(this, "length", t, s, {
1320
+ return t.typed && t.value.length < this.requirement && Z(this, "length", t, s, {
1310
1321
  received: `${t.value.length}`
1311
1322
  }), t;
1312
1323
  }
@@ -1323,7 +1334,7 @@ function Ar(e, r) {
1323
1334
  requirement: e,
1324
1335
  message: r,
1325
1336
  "~run"(t, s) {
1326
- return t.typed && !(t.value >= this.requirement) && Y(this, "value", t, s, {
1337
+ return t.typed && !(t.value >= this.requirement) && Z(this, "value", t, s, {
1327
1338
  received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ De(t.value)
1328
1339
  }), t;
1329
1340
  }
@@ -1340,7 +1351,7 @@ function St(e, r) {
1340
1351
  requirement: e,
1341
1352
  message: r,
1342
1353
  "~run"(t, s) {
1343
- return t.typed && !this.requirement.test(t.value) && Y(this, "format", t, s), t;
1354
+ return t.typed && !this.requirement.test(t.value) && Z(this, "format", t, s), t;
1344
1355
  }
1345
1356
  };
1346
1357
  }
@@ -1374,12 +1385,12 @@ function Mr(e) {
1374
1385
  },
1375
1386
  message: e,
1376
1387
  "~run"(r, t) {
1377
- return r.typed && !this.requirement(r.value) && Y(this, "URL", r, t), r;
1388
+ return r.typed && !this.requirement(r.value) && Z(this, "URL", r, t), r;
1378
1389
  }
1379
1390
  };
1380
1391
  }
1381
1392
  // @__NO_SIDE_EFFECTS__
1382
- function Qs(e, r, t) {
1393
+ function en(e, r, t) {
1383
1394
  return typeof e.fallback == "function" ? (
1384
1395
  // @ts-expect-error
1385
1396
  e.fallback(r, t)
@@ -1409,25 +1420,25 @@ function Nr(e, r) {
1409
1420
  item: e,
1410
1421
  message: r,
1411
1422
  get "~standard"() {
1412
- return /* @__PURE__ */ fe(this);
1423
+ return /* @__PURE__ */ pe(this);
1413
1424
  },
1414
1425
  "~run"(t, s) {
1415
- var i;
1416
- const a = t.value;
1417
- if (Array.isArray(a)) {
1426
+ var a;
1427
+ const i = t.value;
1428
+ if (Array.isArray(i)) {
1418
1429
  t.typed = !0, t.value = [];
1419
- for (let n = 0; n < a.length; n++) {
1420
- const o = a[n], c = this.item["~run"]({ value: o }, s);
1430
+ for (let n = 0; n < i.length; n++) {
1431
+ const o = i[n], c = this.item["~run"]({ value: o }, s);
1421
1432
  if (c.issues) {
1422
1433
  const h = {
1423
1434
  type: "array",
1424
1435
  origin: "value",
1425
- input: a,
1436
+ input: i,
1426
1437
  key: n,
1427
1438
  value: o
1428
1439
  };
1429
1440
  for (const b of c.issues)
1430
- b.path ? b.path.unshift(h) : b.path = [h], (i = t.issues) == null || i.push(b);
1441
+ b.path ? b.path.unshift(h) : b.path = [h], (a = t.issues) == null || a.push(b);
1431
1442
  if (t.issues || (t.issues = c.issues), s.abortEarly) {
1432
1443
  t.typed = !1;
1433
1444
  break;
@@ -1436,7 +1447,7 @@ function Nr(e, r) {
1436
1447
  c.typed || (t.typed = !1), t.value.push(c.value);
1437
1448
  }
1438
1449
  } else
1439
- Y(this, "type", t, s);
1450
+ Z(this, "type", t, s);
1440
1451
  return t;
1441
1452
  }
1442
1453
  };
@@ -1451,10 +1462,10 @@ function Lr(e) {
1451
1462
  async: !1,
1452
1463
  message: e,
1453
1464
  get "~standard"() {
1454
- return /* @__PURE__ */ fe(this);
1465
+ return /* @__PURE__ */ pe(this);
1455
1466
  },
1456
1467
  "~run"(r, t) {
1457
- return typeof r.value == "boolean" ? r.typed = !0 : Y(this, "type", r, t), r;
1468
+ return typeof r.value == "boolean" ? r.typed = !0 : Z(this, "type", r, t), r;
1458
1469
  }
1459
1470
  };
1460
1471
  }
@@ -1468,49 +1479,49 @@ function Tr(e) {
1468
1479
  async: !1,
1469
1480
  message: e,
1470
1481
  get "~standard"() {
1471
- return /* @__PURE__ */ fe(this);
1482
+ return /* @__PURE__ */ pe(this);
1472
1483
  },
1473
1484
  "~run"(r, t) {
1474
- return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Y(this, "type", r, t), r;
1485
+ return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Z(this, "type", r, t), r;
1475
1486
  }
1476
1487
  };
1477
1488
  }
1478
1489
  // @__NO_SIDE_EFFECTS__
1479
- function ge(e, r) {
1490
+ function ve(e, r) {
1480
1491
  return {
1481
1492
  kind: "schema",
1482
1493
  type: "object",
1483
- reference: ge,
1494
+ reference: ve,
1484
1495
  expects: "Object",
1485
1496
  async: !1,
1486
1497
  entries: e,
1487
1498
  message: r,
1488
1499
  get "~standard"() {
1489
- return /* @__PURE__ */ fe(this);
1500
+ return /* @__PURE__ */ pe(this);
1490
1501
  },
1491
1502
  "~run"(t, s) {
1492
- var i;
1493
- const a = t.value;
1494
- if (a && typeof a == "object") {
1503
+ var a;
1504
+ const i = t.value;
1505
+ if (i && typeof i == "object") {
1495
1506
  t.typed = !0, t.value = {};
1496
1507
  for (const n in this.entries) {
1497
1508
  const o = this.entries[n];
1498
- if (n in a || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
1509
+ if (n in i || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
1499
1510
  o.default !== void 0) {
1500
- const c = n in a ? (
1511
+ const c = n in i ? (
1501
1512
  // @ts-expect-error
1502
- a[n]
1513
+ i[n]
1503
1514
  ) : /* @__PURE__ */ Er(o), h = o["~run"]({ value: c }, s);
1504
1515
  if (h.issues) {
1505
1516
  const b = {
1506
1517
  type: "object",
1507
1518
  origin: "value",
1508
- input: a,
1519
+ input: i,
1509
1520
  key: n,
1510
1521
  value: c
1511
1522
  };
1512
1523
  for (const x of h.issues)
1513
- x.path ? x.path.unshift(b) : x.path = [b], (i = t.issues) == null || i.push(x);
1524
+ x.path ? x.path.unshift(b) : x.path = [b], (a = t.issues) == null || a.push(x);
1514
1525
  if (t.issues || (t.issues = h.issues), s.abortEarly) {
1515
1526
  t.typed = !1;
1516
1527
  break;
@@ -1518,41 +1529,41 @@ function ge(e, r) {
1518
1529
  }
1519
1530
  h.typed || (t.typed = !1), t.value[n] = h.value;
1520
1531
  } else if (o.fallback !== void 0)
1521
- t.value[n] = /* @__PURE__ */ Qs(o);
1522
- else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Y(this, "key", t, s, {
1532
+ t.value[n] = /* @__PURE__ */ en(o);
1533
+ else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Z(this, "key", t, s, {
1523
1534
  input: void 0,
1524
1535
  expected: `"${n}"`,
1525
1536
  path: [
1526
1537
  {
1527
1538
  type: "object",
1528
1539
  origin: "key",
1529
- input: a,
1540
+ input: i,
1530
1541
  key: n,
1531
1542
  // @ts-expect-error
1532
- value: a[n]
1543
+ value: i[n]
1533
1544
  }
1534
1545
  ]
1535
1546
  }), s.abortEarly))
1536
1547
  break;
1537
1548
  }
1538
1549
  } else
1539
- Y(this, "type", t, s);
1550
+ Z(this, "type", t, s);
1540
1551
  return t;
1541
1552
  }
1542
1553
  };
1543
1554
  }
1544
1555
  // @__NO_SIDE_EFFECTS__
1545
- function We(e, r) {
1556
+ function Ge(e, r) {
1546
1557
  return {
1547
1558
  kind: "schema",
1548
1559
  type: "optional",
1549
- reference: We,
1560
+ reference: Ge,
1550
1561
  expects: `(${e.expects} | undefined)`,
1551
1562
  async: !1,
1552
1563
  wrapped: e,
1553
1564
  default: r,
1554
1565
  get "~standard"() {
1555
- return /* @__PURE__ */ fe(this);
1566
+ return /* @__PURE__ */ pe(this);
1556
1567
  },
1557
1568
  "~run"(t, s) {
1558
1569
  return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ Er(this, t, s)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, s);
@@ -1565,15 +1576,15 @@ function Dr(e, r) {
1565
1576
  kind: "schema",
1566
1577
  type: "picklist",
1567
1578
  reference: Dr,
1568
- expects: /* @__PURE__ */ Js(e.map(De), "|"),
1579
+ expects: /* @__PURE__ */ Xs(e.map(De), "|"),
1569
1580
  async: !1,
1570
1581
  options: e,
1571
1582
  message: r,
1572
1583
  get "~standard"() {
1573
- return /* @__PURE__ */ fe(this);
1584
+ return /* @__PURE__ */ pe(this);
1574
1585
  },
1575
1586
  "~run"(t, s) {
1576
- return this.options.includes(t.value) ? t.typed = !0 : Y(this, "type", t, s), t;
1587
+ return this.options.includes(t.value) ? t.typed = !0 : Z(this, "type", t, s), t;
1577
1588
  }
1578
1589
  };
1579
1590
  }
@@ -1589,46 +1600,46 @@ function Or(e, r, t) {
1589
1600
  value: r,
1590
1601
  message: t,
1591
1602
  get "~standard"() {
1592
- return /* @__PURE__ */ fe(this);
1603
+ return /* @__PURE__ */ pe(this);
1593
1604
  },
1594
- "~run"(s, a) {
1605
+ "~run"(s, i) {
1595
1606
  var n, o;
1596
- const i = s.value;
1597
- if (i && typeof i == "object") {
1607
+ const a = s.value;
1608
+ if (a && typeof a == "object") {
1598
1609
  s.typed = !0, s.value = {};
1599
- for (const c in i)
1600
- if (/* @__PURE__ */ Hs(i, c)) {
1601
- const h = i[c], b = this.key["~run"]({ value: c }, a);
1610
+ for (const c in a)
1611
+ if (/* @__PURE__ */ Js(a, c)) {
1612
+ const h = a[c], b = this.key["~run"]({ value: c }, i);
1602
1613
  if (b.issues) {
1603
1614
  const p = {
1604
1615
  type: "object",
1605
1616
  origin: "key",
1606
- input: i,
1617
+ input: a,
1607
1618
  key: c,
1608
1619
  value: h
1609
1620
  };
1610
1621
  for (const m of b.issues)
1611
1622
  m.path = [p], (n = s.issues) == null || n.push(m);
1612
- if (s.issues || (s.issues = b.issues), a.abortEarly) {
1623
+ if (s.issues || (s.issues = b.issues), i.abortEarly) {
1613
1624
  s.typed = !1;
1614
1625
  break;
1615
1626
  }
1616
1627
  }
1617
1628
  const x = this.value["~run"](
1618
1629
  { value: h },
1619
- a
1630
+ i
1620
1631
  );
1621
1632
  if (x.issues) {
1622
1633
  const p = {
1623
1634
  type: "object",
1624
1635
  origin: "value",
1625
- input: i,
1636
+ input: a,
1626
1637
  key: c,
1627
1638
  value: h
1628
1639
  };
1629
1640
  for (const m of x.issues)
1630
1641
  m.path ? m.path.unshift(p) : m.path = [p], (o = s.issues) == null || o.push(m);
1631
- if (s.issues || (s.issues = x.issues), a.abortEarly) {
1642
+ if (s.issues || (s.issues = x.issues), i.abortEarly) {
1632
1643
  s.typed = !1;
1633
1644
  break;
1634
1645
  }
@@ -1636,44 +1647,44 @@ function Or(e, r, t) {
1636
1647
  (!b.typed || !x.typed) && (s.typed = !1), b.typed && (s.value[b.value] = x.value);
1637
1648
  }
1638
1649
  } else
1639
- Y(this, "type", s, a);
1650
+ Z(this, "type", s, i);
1640
1651
  return s;
1641
1652
  }
1642
1653
  };
1643
1654
  }
1644
1655
  // @__NO_SIDE_EFFECTS__
1645
- function ae(e) {
1656
+ function ie(e) {
1646
1657
  return {
1647
1658
  kind: "schema",
1648
1659
  type: "string",
1649
- reference: ae,
1660
+ reference: ie,
1650
1661
  expects: "string",
1651
1662
  async: !1,
1652
1663
  message: e,
1653
1664
  get "~standard"() {
1654
- return /* @__PURE__ */ fe(this);
1665
+ return /* @__PURE__ */ pe(this);
1655
1666
  },
1656
1667
  "~run"(r, t) {
1657
- return typeof r.value == "string" ? r.typed = !0 : Y(this, "type", r, t), r;
1668
+ return typeof r.value == "string" ? r.typed = !0 : Z(this, "type", r, t), r;
1658
1669
  }
1659
1670
  };
1660
1671
  }
1661
- function en(e, r, t) {
1662
- const s = e["~run"]({ value: r }, /* @__PURE__ */ nt(t));
1672
+ function tn(e, r, t) {
1673
+ const s = e["~run"]({ value: r }, /* @__PURE__ */ it(t));
1663
1674
  if (s.issues)
1664
- throw new Xs(s.issues);
1675
+ throw new Ys(s.issues);
1665
1676
  return s.value;
1666
1677
  }
1667
1678
  // @__NO_SIDE_EFFECTS__
1668
- function tn(e, r) {
1679
+ function rn(e, r) {
1669
1680
  const t = {};
1670
1681
  for (const s in e.entries)
1671
- t[s] = !r || r.includes(s) ? /* @__PURE__ */ We(e.entries[s]) : e.entries[s];
1682
+ t[s] = !r || r.includes(s) ? /* @__PURE__ */ Ge(e.entries[s]) : e.entries[s];
1672
1683
  return {
1673
1684
  ...e,
1674
1685
  entries: t,
1675
1686
  get "~standard"() {
1676
- return /* @__PURE__ */ fe(this);
1687
+ return /* @__PURE__ */ pe(this);
1677
1688
  }
1678
1689
  };
1679
1690
  }
@@ -1683,7 +1694,7 @@ function Se(...e) {
1683
1694
  ...e[0],
1684
1695
  pipe: e,
1685
1696
  get "~standard"() {
1686
- return /* @__PURE__ */ fe(this);
1697
+ return /* @__PURE__ */ pe(this);
1687
1698
  },
1688
1699
  "~run"(r, t) {
1689
1700
  for (const s of e)
@@ -1699,8 +1710,8 @@ function Se(...e) {
1699
1710
  };
1700
1711
  }
1701
1712
  // @__NO_SIDE_EFFECTS__
1702
- function rn(e, r, t) {
1703
- const s = e["~run"]({ value: r }, /* @__PURE__ */ nt(t));
1713
+ function sn(e, r, t) {
1714
+ const s = e["~run"]({ value: r }, /* @__PURE__ */ it(t));
1704
1715
  return {
1705
1716
  typed: s.typed,
1706
1717
  success: !s.issues,
@@ -1709,10 +1720,10 @@ function rn(e, r, t) {
1709
1720
  };
1710
1721
  }
1711
1722
  // @__NO_SIDE_EFFECTS__
1712
- async function sn(e, r, t) {
1723
+ async function nn(e, r, t) {
1713
1724
  const s = await e["~run"](
1714
1725
  { value: r },
1715
- /* @__PURE__ */ nt(t)
1726
+ /* @__PURE__ */ it(t)
1716
1727
  );
1717
1728
  return {
1718
1729
  typed: s.typed,
@@ -1721,7 +1732,7 @@ async function sn(e, r, t) {
1721
1732
  issues: s.issues
1722
1733
  };
1723
1734
  }
1724
- const Be = ({
1735
+ const Pe = ({
1725
1736
  error: e
1726
1737
  }) => !e || !e.message ? null : u("div", {
1727
1738
  role: "alert",
@@ -1754,7 +1765,7 @@ const Be = ({
1754
1765
  class: "break-words pr-1 text-sm",
1755
1766
  children: e.message
1756
1767
  })]
1757
- }), Ee = ({
1768
+ }), Fe = ({
1758
1769
  class: e,
1759
1770
  ...r
1760
1771
  }) => {
@@ -1786,7 +1797,7 @@ const Be = ({
1786
1797
  });
1787
1798
  };
1788
1799
  var Ft = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" };
1789
- const Je = st("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", {
1800
+ const Xe = nt("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", {
1790
1801
  variants: {
1791
1802
  optional: {
1792
1803
  true: "pr-16 pl-3",
@@ -1796,47 +1807,47 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1796
1807
  defaultVariants: {
1797
1808
  optional: !1
1798
1809
  }
1799
- }), nn = "https://api.mapbox.com/search/searchbox/v1/suggest", an = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", on = (e) => atob(e).split("").reverse().join(""), pe = /* @__PURE__ */ ge({
1800
- name: /* @__PURE__ */ ae()
1801
- }), ln = /* @__PURE__ */ ge({
1802
- suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */ ge({
1803
- full_address: /* @__PURE__ */ We(/* @__PURE__ */ ae()),
1804
- place_formatted: /* @__PURE__ */ We(/* @__PURE__ */ ae()),
1805
- name: /* @__PURE__ */ We(/* @__PURE__ */ ae()),
1806
- mapbox_id: /* @__PURE__ */ ae(),
1807
- context: /* @__PURE__ */ tn(/* @__PURE__ */ ge({
1808
- address: pe,
1809
- street: pe,
1810
- neighborhood: pe,
1811
- locality: pe,
1812
- district: pe,
1813
- place: pe,
1814
- region: pe,
1815
- postcode: pe,
1816
- country: pe
1810
+ }), an = "https://api.mapbox.com/search/searchbox/v1/suggest", on = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ln = (e) => atob(e).split("").reverse().join(""), me = /* @__PURE__ */ ve({
1811
+ name: /* @__PURE__ */ ie()
1812
+ }), un = /* @__PURE__ */ ve({
1813
+ suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */ ve({
1814
+ full_address: /* @__PURE__ */ Ge(/* @__PURE__ */ ie()),
1815
+ place_formatted: /* @__PURE__ */ Ge(/* @__PURE__ */ ie()),
1816
+ name: /* @__PURE__ */ Ge(/* @__PURE__ */ ie()),
1817
+ mapbox_id: /* @__PURE__ */ ie(),
1818
+ context: /* @__PURE__ */ rn(/* @__PURE__ */ ve({
1819
+ address: me,
1820
+ street: me,
1821
+ neighborhood: me,
1822
+ locality: me,
1823
+ district: me,
1824
+ place: me,
1825
+ region: me,
1826
+ postcode: me,
1827
+ country: me
1817
1828
  }))
1818
1829
  }))
1819
- }), un = ({
1830
+ }), cn = ({
1820
1831
  logger: e,
1821
1832
  t: r
1822
- }) => us(() => {
1833
+ }) => cs(() => {
1823
1834
  var s;
1824
1835
  const t = (s = $.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
1825
1836
  return t ? {
1826
1837
  enabled: !0,
1827
- getPredictions: async (a) => {
1838
+ getPredictions: async (i) => {
1828
1839
  var x;
1829
- const i = new URL(nn);
1830
- i.searchParams.set("q", a), i.searchParams.set("session_token", t);
1840
+ const a = new URL(an);
1841
+ a.searchParams.set("q", i), a.searchParams.set("session_token", t);
1831
1842
  const n = (x = $.current$.peek().flow) == null ? void 0 : x.locationOrigin;
1832
- n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && i.searchParams.set("proximity", `${n.lng},${n.lat}`), i.searchParams.set("access_token", on(an));
1833
- const c = await fetch(i);
1843
+ n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && a.searchParams.set("proximity", `${n.lng},${n.lat}`), a.searchParams.set("access_token", ln(on));
1844
+ const c = await fetch(a);
1834
1845
  if (!c.ok)
1835
1846
  return e.error("Failed to get address details", c), {
1836
1847
  ok: !1,
1837
1848
  error: r("address_error")
1838
1849
  };
1839
- const h = /* @__PURE__ */ rn(ln, await c.json());
1850
+ const h = /* @__PURE__ */ sn(un, await c.json());
1840
1851
  if (h.success === !1)
1841
1852
  return e.error("Failed to parse address details", h.issues), {
1842
1853
  ok: !1,
@@ -1868,7 +1879,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1868
1879
  } : {
1869
1880
  enabled: !1
1870
1881
  };
1871
- }, [e, r]), Kt = (e) => {
1882
+ }, [e, r]), Wt = (e) => {
1872
1883
  const {
1873
1884
  t: r
1874
1885
  } = se();
@@ -1891,22 +1902,22 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1891
1902
  children: r("back")
1892
1903
  })]
1893
1904
  });
1894
- }, cn = ({
1905
+ }, dn = ({
1895
1906
  input: e,
1896
1907
  onSubmitSuccess: r,
1897
1908
  logger: t
1898
1909
  }) => {
1899
1910
  const {
1900
1911
  t: s
1901
- } = se(), [a, i] = me(), {
1912
+ } = se(), [i, a] = be(), {
1902
1913
  enabled: n,
1903
1914
  getPredictions: o
1904
- } = un({
1915
+ } = cn({
1905
1916
  logger: t,
1906
1917
  t: s
1907
- }), [c, h] = me(n ? "query" : "manual"), [b, x] = me(""), [p, m] = me(), C = ce(), E = ce(), A = (y) => {
1918
+ }), [c, h] = be(n ? "query" : "manual"), [b, x] = be(""), [p, m] = be(), C = fe(), E = fe(), A = (y) => {
1908
1919
  var V;
1909
- if (Ae(n, "Query state should not be enabled"), y = y.trim(), y === ((V = C.current) == null ? void 0 : V.query) || y === (p == null ? void 0 : p.query) && p.status === "done")
1920
+ if (Me(n, "Query state should not be enabled"), y = y.trim(), y === ((V = C.current) == null ? void 0 : V.query) || y === (p == null ? void 0 : p.query) && p.status === "done")
1910
1921
  return;
1911
1922
  if (x(y), y === "") {
1912
1923
  C.current = void 0, m(void 0);
@@ -1936,14 +1947,14 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1936
1947
  }));
1937
1948
  });
1938
1949
  }, I = (y, _) => {
1939
- i((V) => ({
1950
+ a((V) => ({
1940
1951
  ...V,
1941
1952
  [y]: _
1942
1953
  }));
1943
1954
  };
1944
1955
  switch (c) {
1945
1956
  case "query":
1946
- return Ae(n, "Query state should not be enabled"), u(dn, {
1957
+ return Me(n, "Query state should not be enabled"), u(fn, {
1947
1958
  input: e,
1948
1959
  onSkip: () => r(null),
1949
1960
  onAddressSelect: (y) => {
@@ -1952,59 +1963,64 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1952
1963
  return;
1953
1964
  }
1954
1965
  const _ = (p == null ? void 0 : p.status) === "done" ? p.items.find((V) => V.id === y) : void 0;
1955
- _ && (E.current !== y && i(_.address), E.current = y, h("details"));
1966
+ _ && (E.current !== y && a(_.address), E.current = y, h("details"));
1956
1967
  },
1957
1968
  onAddressSearch: A,
1958
1969
  lookup: p,
1959
1970
  query: b
1960
1971
  });
1961
1972
  case "details":
1962
- return Ae(a !== void 0), u(Wt, {
1973
+ return Me(i !== void 0), u(Kt, {
1963
1974
  input: e,
1964
1975
  logger: t,
1965
1976
  onSubmitSuccess: r,
1966
- addressFields: a,
1977
+ addressFields: i,
1967
1978
  onFieldChange: I,
1968
- actions: u(Kt, {
1979
+ actions: u(Wt, {
1969
1980
  onClick: () => {
1970
1981
  h("query");
1971
1982
  }
1972
1983
  })
1973
1984
  });
1974
1985
  case "manual":
1975
- return u(Wt, {
1986
+ return u(Kt, {
1976
1987
  logger: t,
1977
1988
  input: e,
1978
1989
  onSubmitSuccess: r,
1979
- addressFields: a ?? {},
1990
+ addressFields: i ?? {},
1980
1991
  onFieldChange: I,
1981
- actions: n ? u(Kt, {
1992
+ actions: n ? u(Wt, {
1982
1993
  onClick: () => {
1983
1994
  h("query");
1984
1995
  }
1985
- }) : void 0
1996
+ }) : e.config.optional ? (
1997
+ // Without address search this is the only screen, so an optional question needs its own way past.
1998
+ u(Fe, {
1999
+ onClick: () => r(null)
2000
+ })
2001
+ ) : void 0
1986
2002
  });
1987
2003
  }
1988
- }, dn = ({
2004
+ }, fn = ({
1989
2005
  input: e,
1990
2006
  onSkip: r,
1991
2007
  lookup: t,
1992
2008
  onAddressSelect: s,
1993
- query: a,
1994
- onAddressSearch: i
2009
+ query: i,
2010
+ onAddressSearch: a
1995
2011
  }) => {
1996
2012
  const {
1997
2013
  t: n
1998
- } = se(), o = ce(null);
2014
+ } = se(), o = fe(null);
1999
2015
  return Ie(() => {
2000
2016
  o.current && (o.current.focus(), o.current.select());
2001
- }, []), u(be, {
2017
+ }, []), u(xe, {
2002
2018
  children: [u("form", {
2003
2019
  noValidate: !0,
2004
2020
  onSubmit: (c) => {
2005
2021
  c.preventDefault();
2006
2022
  const b = new FormData(c.currentTarget).get("address");
2007
- typeof b == "string" && i(b);
2023
+ typeof b == "string" && a(b);
2008
2024
  },
2009
2025
  class: "flex gap-2 p-2.5",
2010
2026
  children: [u("div", {
@@ -2016,8 +2032,8 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2016
2032
  autocomplete: "address-line1 country-name postal-code",
2017
2033
  autoFocus: !0,
2018
2034
  placeholder: e.config.placeholder || n("address_search"),
2019
- defaultValue: a,
2020
- class: Je({
2035
+ defaultValue: i,
2036
+ class: Xe({
2021
2037
  optional: !!e.config.optional,
2022
2038
  className: "w-full rounded-full"
2023
2039
  })
@@ -2050,18 +2066,18 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2050
2066
  children: n("search")
2051
2067
  })]
2052
2068
  })]
2053
- }), e.config.optional && u(Ee, {
2069
+ }), e.config.optional && u(Fe, {
2054
2070
  class: "relative",
2055
2071
  onClick: r
2056
2072
  })]
2057
- }), (t == null ? void 0 : t.status) === "failed" ? u(Be, {
2073
+ }), (t == null ? void 0 : t.status) === "failed" ? u(Pe, {
2058
2074
  error: {
2059
2075
  message: t.error
2060
2076
  }
2061
2077
  }) : null, u("p", {
2062
2078
  role: "status",
2063
2079
  class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-10 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
2064
- children: (t == null ? void 0 : t.status) === "pending" ? u(be, {
2080
+ children: (t == null ? void 0 : t.status) === "pending" ? u(xe, {
2065
2081
  children: [u(Ct, {
2066
2082
  "aria-hidden": "true",
2067
2083
  class: "h-4 w-4 shrink-0"
@@ -2105,17 +2121,17 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2105
2121
  }, "")]
2106
2122
  })]
2107
2123
  });
2108
- }, bt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Wt = ({
2124
+ }, bt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Kt = ({
2109
2125
  addressFields: e,
2110
2126
  onFieldChange: r,
2111
2127
  onSubmitSuccess: t,
2112
2128
  actions: s,
2113
- input: a
2129
+ input: i
2114
2130
  }) => {
2115
- const i = ce(null);
2131
+ const a = fe(null);
2116
2132
  Ie(() => {
2117
- if (i.current) {
2118
- const c = i.current.querySelector("input");
2133
+ if (a.current) {
2134
+ const c = a.current.querySelector("input");
2119
2135
  c && (c.focus(), c.select());
2120
2136
  }
2121
2137
  }, []);
@@ -2126,14 +2142,13 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2126
2142
  class: "flex flex-col px-2 pt-2",
2127
2143
  onSubmit: (c) => {
2128
2144
  const h = c.currentTarget, b = [...h.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
2129
- if (b.length > 0) {
2130
- c.preventDefault();
2131
- for (const m of b) {
2132
- m.value = "";
2133
- const C = bt.find((E) => a.config.keys[E] === m.name);
2134
- C && r(C, "");
2135
- }
2136
- h.reportValidity();
2145
+ for (const m of b) {
2146
+ m.value = "";
2147
+ const C = bt.find((E) => i.config.keys[E] === m.name);
2148
+ C && r(C, "");
2149
+ }
2150
+ if (b.length > 0 && !h.checkValidity()) {
2151
+ c.preventDefault(), h.reportValidity();
2137
2152
  return;
2138
2153
  }
2139
2154
  const x = new FormData(h), p = Object.fromEntries(x.entries());
@@ -2144,10 +2159,10 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2144
2159
  },
2145
2160
  children: [u("div", {
2146
2161
  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]",
2147
- ref: i,
2162
+ ref: a,
2148
2163
  children: bt.map((c, h) => {
2149
- const b = `isdk_${c}`, x = a.config.keys[c];
2150
- return x ? u(be, {
2164
+ const b = `isdk_${c}`, x = i.config.keys[c];
2165
+ return x ? u(xe, {
2151
2166
  children: [u("label", {
2152
2167
  for: b,
2153
2168
  class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
@@ -2195,7 +2210,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2195
2210
  id: b,
2196
2211
  defaultValue: e[c],
2197
2212
  onInput: (p) => r(c, p.currentTarget.value),
2198
- required: !0
2213
+ required: c !== "line2" || i.config.line2Required === !0
2199
2214
  }), h === bt.length - 1 ? u("hr", {
2200
2215
  class: "m-0 w-full border-b border-b-transparent"
2201
2216
  }) : u("hr", {
@@ -2206,18 +2221,18 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2206
2221
  })
2207
2222
  }), u("div", {
2208
2223
  class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
2209
- children: [s, u(Me, {
2224
+ children: [s, u(Ee, {
2210
2225
  class: "ml-auto"
2211
2226
  })]
2212
2227
  })]
2213
2228
  });
2214
2229
  }, Vt = () => {
2215
- const e = ce(null);
2230
+ const e = fe(null);
2216
2231
  return vr(() => {
2217
2232
  var r;
2218
2233
  (r = e.current) == null || r.focus();
2219
2234
  }, []), e;
2220
- }, Rr = ["true", "false"], fn = /* @__PURE__ */ Dr(Rr), hn = "answer", Br = "flex items-center flex-wrap gap-2 p-2.5", Pr = "min-w-0 max-w-full flex-auto", jr = xr(({
2235
+ }, Rr = ["true", "false"], hn = /* @__PURE__ */ Dr(Rr), pn = "answer", Pr = "flex items-center flex-wrap gap-2 p-2.5", Br = "min-w-0 max-w-full flex-auto", jr = xr(({
2221
2236
  label: e,
2222
2237
  ...r
2223
2238
  }, t) => u("button", {
@@ -2228,7 +2243,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2228
2243
  class: "text-center text-base",
2229
2244
  children: e
2230
2245
  })
2231
- })), pn = ({
2246
+ })), yn = ({
2232
2247
  input: e,
2233
2248
  onSubmitSuccess: r
2234
2249
  }) => {
@@ -2238,49 +2253,49 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2238
2253
  class: "",
2239
2254
  onSubmit: (s) => {
2240
2255
  s.preventDefault();
2241
- const a = cs(s).value, i = en(fn, a);
2256
+ const i = ds(s).value, a = tn(hn, i);
2242
2257
  r({
2243
2258
  type: "boolean",
2244
- value: i === "true"
2259
+ value: a === "true"
2245
2260
  });
2246
2261
  },
2247
2262
  children: [u("ul", {
2248
- class: Br,
2249
- children: Rr.map((s, a) => u("li", {
2250
- class: Pr,
2263
+ class: Pr,
2264
+ children: Rr.map((s, i) => u("li", {
2265
+ class: Br,
2251
2266
  children: u(jr, {
2252
- ref: a === 0 ? t : null,
2267
+ ref: i === 0 ? t : null,
2253
2268
  type: "submit",
2254
- name: hn,
2269
+ name: pn,
2255
2270
  value: s,
2256
2271
  label: e.config.labels[s]
2257
2272
  }, s)
2258
2273
  }))
2259
2274
  }), e.config.optional && u("div", {
2260
2275
  class: "px-2 pb-2",
2261
- children: u(Ee, {
2276
+ children: u(Fe, {
2262
2277
  class: "relative w-full",
2263
2278
  type: "button",
2264
2279
  onClick: () => r(null)
2265
2280
  })
2266
2281
  })]
2267
2282
  });
2268
- }, yn = (e) => new Promise((r, t) => {
2283
+ }, mn = (e) => new Promise((r, t) => {
2269
2284
  const s = new FileReader();
2270
2285
  s.onload = () => {
2271
2286
  if (typeof s.result != "string" || !s.result)
2272
2287
  return t(new Error("Invalid file"));
2273
2288
  r(s.result);
2274
2289
  }, s.onerror = t, s.readAsDataURL(e);
2275
- }), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), mn = Re("file"), Ht = 3, at = (e) => {
2290
+ }), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), gn = Re("file"), Ht = 3, at = (e) => {
2276
2291
  const r = e.lastIndexOf(".");
2277
2292
  return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
2278
- }, gn = ({
2293
+ }, bn = ({
2279
2294
  file: e,
2280
2295
  class: r,
2281
2296
  ...t
2282
2297
  }) => {
2283
- const [s, a] = at(e.name);
2298
+ const [s, i] = at(e.name);
2284
2299
  return u("div", {
2285
2300
  class: Oe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
2286
2301
  ...t,
@@ -2291,12 +2306,12 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2291
2306
  class: "block truncate",
2292
2307
  children: s
2293
2308
  }), u("span", {
2294
- children: a
2309
+ children: i
2295
2310
  })]
2296
2311
  }), u("p", {
2297
2312
  "aria-label": "File size",
2298
2313
  class: "text-accent-11",
2299
- children: ze(e.sizeKb)
2314
+ children: We(e.sizeKb)
2300
2315
  })]
2301
2316
  });
2302
2317
  }, Jt = ({
@@ -2305,27 +2320,27 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2305
2320
  }) => u("li", {
2306
2321
  class: Oe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
2307
2322
  ...r
2308
- }), bn = (e, r) => {
2323
+ }), vn = (e, r) => {
2309
2324
  const [t, s] = at(e);
2310
2325
  return `${t.slice(0, r)}${s}`;
2311
- }, Zt = (e) => ({
2312
- name: bn(e.name, 42),
2326
+ }, Xt = (e) => ({
2327
+ name: vn(e.name, 42),
2313
2328
  sizeKb: e.size / 1e3
2314
- }), vn = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], xn = (e, r, t) => {
2315
- const s = at(r.name)[1].toLowerCase(), a = [...t.map((n) => n.toLowerCase()), ...vn], i = s === "" ? "none" : a.includes(s) ? s : "other";
2316
- return `chatbot-file-refused:${e}:${i}`;
2317
- }, wn = ({
2329
+ }), xn = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], wn = (e, r, t) => {
2330
+ const s = at(r.name)[1].toLowerCase(), i = [...t.map((n) => n.toLowerCase()), ...xn], a = s === "" ? "none" : i.includes(s) ? s : "other";
2331
+ return `chatbot-file-refused:${e}:${a}`;
2332
+ }, _n = ({
2318
2333
  input: e,
2319
2334
  onSubmitSuccess: r,
2320
2335
  analytics: t
2321
2336
  }) => {
2322
2337
  var A;
2323
- const s = (A = $.current$.value.flow) == null ? void 0 : A.data.submissions[e.key], [a, i] = me(mn(s) && s.value.length ? {
2338
+ const s = (A = $.current$.value.flow) == null ? void 0 : A.data.submissions[e.key], [i, a] = be(gn(s) && s.value.length ? {
2324
2339
  status: "ready",
2325
2340
  files: s.value
2326
2341
  } : {
2327
2342
  status: "empty"
2328
- }), n = ce(0), o = a.status === "ready" ? a.files : [], c = a.status === "ready" || a.status === "pending" ? a.files : [], h = a.status === "error" ? a.error : void 0, b = c.length - Ht, x = Gt(c), p = Vt(), {
2343
+ }), n = fe(0), o = i.status === "ready" ? i.files : [], c = i.status === "ready" || i.status === "pending" ? i.files : [], h = i.status === "error" ? i.error : void 0, b = c.length - Ht, x = Gt(c), p = Vt(), {
2329
2344
  t: m
2330
2345
  } = se(), C = (I) => {
2331
2346
  if (!I.length)
@@ -2353,7 +2368,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2353
2368
  error: {
2354
2369
  type: "max",
2355
2370
  message: m("validation_file_size", {
2356
- size: ze(e.config.fileSizeLimitKib)
2371
+ size: We(e.config.fileSizeLimitKib)
2357
2372
  })
2358
2373
  }
2359
2374
  };
@@ -2372,7 +2387,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2372
2387
  return t.log({
2373
2388
  event: "INTERACTION",
2374
2389
  properties: {
2375
- tag: xn(I, y, e.config.extensions)
2390
+ tag: wn(I, y, e.config.extensions)
2376
2391
  },
2377
2392
  customProperties: (V = (_ = $.current$.peek().flow) == null ? void 0 : _.analytics) == null ? void 0 : V.customProperties
2378
2393
  });
@@ -2380,10 +2395,10 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2380
2395
  return u("form", {
2381
2396
  class: "flex flex-col gap-1 p-2.5",
2382
2397
  onSubmit: (I) => {
2383
- if (I.preventDefault(), a.status === "pending" || a.status === "error")
2398
+ if (I.preventDefault(), i.status === "pending" || i.status === "error")
2384
2399
  return;
2385
2400
  const y = C(o);
2386
- y ? i({
2401
+ y ? a({
2387
2402
  status: "error",
2388
2403
  error: y.error
2389
2404
  }) : r({
@@ -2438,7 +2453,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2438
2453
  }), e.config.fileSizeLimitKib ? u("p", {
2439
2454
  class: "text-neutral-10 text-xs",
2440
2455
  children: ["(", m("file_max_size", {
2441
- size: ze(e.config.fileSizeLimitKib)
2456
+ size: We(e.config.fileSizeLimitKib)
2442
2457
  }), ")"]
2443
2458
  }) : null]
2444
2459
  }), u("aside", {
@@ -2459,15 +2474,15 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2459
2474
  }), u("p", {
2460
2475
  role: "status",
2461
2476
  class: Oe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
2462
- children: a.status === "pending" ? u(be, {
2477
+ children: i.status === "pending" ? u(xe, {
2463
2478
  children: [u(Ct, {
2464
2479
  "aria-hidden": "true",
2465
2480
  class: "h-4 w-4"
2466
2481
  }), m("file_preparing", {
2467
2482
  count: c.length
2468
2483
  })]
2469
- }) : a.status === "ready" ? u(be, {
2470
- children: [ze(x), " ", o.length > 1 ? "total" : "", u("span", {
2484
+ }) : i.status === "ready" ? u(xe, {
2485
+ children: [We(x), " ", o.length > 1 ? "total" : "", u("span", {
2471
2486
  class: "sr-only",
2472
2487
  children: [". ", m("file_ready", {
2473
2488
  count: o.length
@@ -2477,42 +2492,42 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2477
2492
  }), u("input", {
2478
2493
  id: "dropzone-file",
2479
2494
  onInput: async (I) => {
2480
- Ae(I.target instanceof HTMLInputElement);
2495
+ Me(I.target instanceof HTMLInputElement);
2481
2496
  const y = I.target.files ? Array.from(I.target.files) : [];
2482
2497
  I.target.value = "";
2483
2498
  const [_] = y;
2484
2499
  if (!_)
2485
2500
  return;
2486
- const V = ++n.current, M = a.status === "ready", D = y.map(Zt), G = C(D);
2501
+ const V = ++n.current, M = i.status === "ready", O = y.map(Xt), G = C(O);
2487
2502
  if (G)
2488
- return E(G.reason, G.file ?? _), i({
2503
+ return E(G.reason, G.file ?? _), a({
2489
2504
  status: "error",
2490
2505
  error: G.error
2491
2506
  });
2492
- i({
2507
+ a({
2493
2508
  status: "pending",
2494
- files: D
2509
+ files: O
2495
2510
  });
2496
2511
  let N;
2497
2512
  try {
2498
- const q = await Promise.all(y.map(async (L) => {
2513
+ const U = await Promise.all(y.map(async (L) => {
2499
2514
  try {
2500
2515
  return {
2501
- ...Zt(L),
2502
- data: await yn(L)
2516
+ ...Xt(L),
2517
+ data: await mn(L)
2503
2518
  };
2504
- } catch (O) {
2505
- throw N ?? (N = L), O;
2519
+ } catch (D) {
2520
+ throw N ?? (N = L), D;
2506
2521
  }
2507
2522
  }));
2508
- n.current === V && i({
2523
+ n.current === V && a({
2509
2524
  status: "ready",
2510
- files: q
2525
+ files: U
2511
2526
  });
2512
2527
  } catch {
2513
2528
  if (n.current !== V)
2514
2529
  return;
2515
- E("unreadable", N ?? _), i({
2530
+ E("unreadable", N ?? _), a({
2516
2531
  status: "error",
2517
2532
  error: {
2518
2533
  type: "invalid",
@@ -2528,23 +2543,23 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2528
2543
  })]
2529
2544
  }), u("div", {
2530
2545
  class: "flex h-full flex-col items-center gap-2",
2531
- children: [u(Me, {
2546
+ children: [u(Ee, {
2532
2547
  disabled: o.length === 0
2533
- }), e.config.optional && u(Ee, {
2548
+ }), e.config.optional && u(Fe, {
2534
2549
  class: "relative",
2535
2550
  onClick: () => r(null)
2536
2551
  })]
2537
2552
  })]
2538
- }), u(Be, {
2553
+ }), u(Pe, {
2539
2554
  error: h
2540
2555
  })]
2541
2556
  });
2542
2557
  };
2543
- var Ze = (e) => e.type === "checkbox", Ve = (e) => e instanceof Date, re = (e) => e == null;
2558
+ var Ze = (e) => e.type === "checkbox", Ae = (e) => e instanceof Date, re = (e) => e == null;
2544
2559
  const $r = (e) => typeof e == "object";
2545
- var W = (e) => !re(e) && !Array.isArray(e) && $r(e) && !Ve(e), _n = (e) => W(e) && e.target ? Ze(e.target) ? e.target.checked : e.target.value : e, kn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Cn = (e, r) => e.has(kn(r)), Sn = (e) => {
2560
+ var K = (e) => !re(e) && !Array.isArray(e) && $r(e) && !Ae(e), kn = (e) => K(e) && e.target ? Ze(e.target) ? e.target.checked : e.target.value : e, Cn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Sn = (e, r) => e.has(Cn(r)), In = (e) => {
2546
2561
  const r = e.constructor && e.constructor.prototype;
2547
- return W(r) && r.hasOwnProperty("isPrototypeOf");
2562
+ return K(r) && r.hasOwnProperty("isPrototypeOf");
2548
2563
  }, At = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2549
2564
  function H(e) {
2550
2565
  if (e instanceof Date)
@@ -2553,34 +2568,34 @@ function H(e) {
2553
2568
  if (At && (e instanceof Blob || r))
2554
2569
  return e;
2555
2570
  const t = Array.isArray(e);
2556
- if (!t && !(W(e) && Sn(e)))
2571
+ if (!t && !(K(e) && In(e)))
2557
2572
  return e;
2558
2573
  const s = t ? [] : Object.create(Object.getPrototypeOf(e));
2559
- for (const a in e)
2560
- Object.prototype.hasOwnProperty.call(e, a) && (s[a] = H(e[a]));
2574
+ for (const i in e)
2575
+ Object.prototype.hasOwnProperty.call(e, i) && (s[i] = H(e[i]));
2561
2576
  return s;
2562
2577
  }
2563
- var it = (e) => /^\w*$/.test(e), z = (e) => e === void 0, Mt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Et = (e) => Mt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2564
- if (!r || !W(e))
2578
+ var ot = (e) => /^\w*$/.test(e), z = (e) => e === void 0, Mt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Et = (e) => Mt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2579
+ if (!r || !K(e))
2565
2580
  return t;
2566
- const s = (it(r) ? [r] : Et(r)).reduce((a, i) => re(a) ? a : a[i], e);
2581
+ const s = (ot(r) ? [r] : Et(r)).reduce((i, a) => re(i) ? i : i[a], e);
2567
2582
  return z(s) || s === e ? z(e[r]) ? t : e[r] : s;
2568
- }, ue = (e) => typeof e == "boolean", oe = (e) => typeof e == "function", j = (e, r, t) => {
2583
+ }, de = (e) => typeof e == "boolean", oe = (e) => typeof e == "function", B = (e, r, t) => {
2569
2584
  let s = -1;
2570
- const a = it(r) ? [r] : Et(r), i = a.length, n = i - 1;
2571
- for (; ++s < i; ) {
2572
- const o = a[s];
2585
+ const i = ot(r) ? [r] : Et(r), a = i.length, n = a - 1;
2586
+ for (; ++s < a; ) {
2587
+ const o = i[s];
2573
2588
  let c = t;
2574
2589
  if (s !== n) {
2575
2590
  const h = e[o];
2576
- c = W(h) || Array.isArray(h) ? h : isNaN(+a[s + 1]) ? {} : [];
2591
+ c = K(h) || Array.isArray(h) ? h : isNaN(+i[s + 1]) ? {} : [];
2577
2592
  }
2578
2593
  if (o === "__proto__" || o === "constructor" || o === "prototype")
2579
2594
  return;
2580
2595
  e[o] = c, e = e[o];
2581
2596
  }
2582
2597
  };
2583
- const Xt = {
2598
+ const Zt = {
2584
2599
  BLUR: "blur",
2585
2600
  FOCUS_OUT: "focusout",
2586
2601
  CHANGE: "change"
@@ -2590,7 +2605,7 @@ const Xt = {
2590
2605
  onSubmit: "onSubmit",
2591
2606
  onTouched: "onTouched",
2592
2607
  all: "all"
2593
- }, ye = {
2608
+ }, ge = {
2594
2609
  max: "max",
2595
2610
  min: "min",
2596
2611
  maxLength: "maxLength",
@@ -2598,67 +2613,67 @@ const Xt = {
2598
2613
  pattern: "pattern",
2599
2614
  required: "required",
2600
2615
  validate: "validate"
2601
- }, In = ee.createContext(null);
2602
- In.displayName = "HookFormControlContext";
2603
- var Fn = (e, r, t, s = !0) => {
2604
- const a = {
2616
+ }, Fn = Q.createContext(null);
2617
+ Fn.displayName = "HookFormControlContext";
2618
+ var Vn = (e, r, t, s = !0) => {
2619
+ const i = {
2605
2620
  defaultValues: r._defaultValues
2606
2621
  };
2607
- for (const i in e)
2608
- Object.defineProperty(a, i, {
2622
+ for (const a in e)
2623
+ Object.defineProperty(i, a, {
2609
2624
  get: () => {
2610
- const n = i;
2625
+ const n = a;
2611
2626
  return r._proxyFormState[n] !== le.all && (r._proxyFormState[n] = !s || le.all), t && (t[n] = !0), e[n];
2612
2627
  }
2613
2628
  });
2614
- return a;
2629
+ return i;
2615
2630
  };
2616
- const Vn = typeof window < "u" ? ee.useLayoutEffect : ee.useEffect;
2617
- var ne = (e) => typeof e == "string", An = (e, r, t, s, a) => ne(e) ? (s && r.watch.add(e), S(t, e, a)) : Array.isArray(e) ? e.map((i) => (s && r.watch.add(i), S(t, i))) : (s && (r.watchAll = !0), t), wt = (e) => re(e) || !$r(e);
2631
+ const An = typeof window < "u" ? Q.useLayoutEffect : Q.useEffect;
2632
+ var ne = (e) => typeof e == "string", Mn = (e, r, t, s, i) => ne(e) ? (s && r.watch.add(e), S(t, e, i)) : Array.isArray(e) ? e.map((a) => (s && r.watch.add(a), S(t, a))) : (s && (r.watchAll = !0), t), wt = (e) => re(e) || !$r(e);
2618
2633
  function Ce(e, r, t = /* @__PURE__ */ new WeakSet()) {
2619
2634
  if (wt(e) || wt(r))
2620
2635
  return Object.is(e, r);
2621
- if (Ve(e) && Ve(r))
2636
+ if (Ae(e) && Ae(r))
2622
2637
  return Object.is(e.getTime(), r.getTime());
2623
- const s = Object.keys(e), a = Object.keys(r);
2624
- if (s.length !== a.length)
2638
+ const s = Object.keys(e), i = Object.keys(r);
2639
+ if (s.length !== i.length)
2625
2640
  return !1;
2626
2641
  if (t.has(e) || t.has(r))
2627
2642
  return !0;
2628
2643
  t.add(e), t.add(r);
2629
- for (const i of s) {
2630
- const n = e[i];
2631
- if (!a.includes(i))
2644
+ for (const a of s) {
2645
+ const n = e[a];
2646
+ if (!i.includes(a))
2632
2647
  return !1;
2633
- if (i !== "ref") {
2634
- const o = r[i];
2635
- if (Ve(n) && Ve(o) || W(n) && W(o) || Array.isArray(n) && Array.isArray(o) ? !Ce(n, o, t) : !Object.is(n, o))
2648
+ if (a !== "ref") {
2649
+ const o = r[a];
2650
+ if (Ae(n) && Ae(o) || K(n) && K(o) || Array.isArray(n) && Array.isArray(o) ? !Ce(n, o, t) : !Object.is(n, o))
2636
2651
  return !1;
2637
2652
  }
2638
2653
  }
2639
2654
  return !0;
2640
2655
  }
2641
- const Mn = ee.createContext(null);
2642
- Mn.displayName = "HookFormContext";
2643
- var qr = (e, r, t, s, a) => r ? {
2656
+ const En = Q.createContext(null);
2657
+ En.displayName = "HookFormContext";
2658
+ var qr = (e, r, t, s, i) => r ? {
2644
2659
  ...t[e],
2645
2660
  types: {
2646
2661
  ...t[e] && t[e].types ? t[e].types : {},
2647
- [s]: a || !0
2662
+ [s]: i || !0
2648
2663
  }
2649
- } : {}, Ge = (e) => Array.isArray(e) ? e : [e], Yt = () => {
2664
+ } : {}, He = (e) => Array.isArray(e) ? e : [e], Yt = () => {
2650
2665
  let e = [];
2651
2666
  return {
2652
2667
  get observers() {
2653
2668
  return e;
2654
2669
  },
2655
- next: (a) => {
2656
- for (const i of e)
2657
- i.next && i.next(a);
2670
+ next: (i) => {
2671
+ for (const a of e)
2672
+ a.next && a.next(i);
2658
2673
  },
2659
- subscribe: (a) => (e.push(a), {
2674
+ subscribe: (i) => (e.push(i), {
2660
2675
  unsubscribe: () => {
2661
- e = e.filter((i) => i !== a);
2676
+ e = e.filter((a) => a !== i);
2662
2677
  }
2663
2678
  }),
2664
2679
  unsubscribe: () => {
@@ -2670,63 +2685,63 @@ function Ur(e, r) {
2670
2685
  const t = {};
2671
2686
  for (const s in e)
2672
2687
  if (e.hasOwnProperty(s)) {
2673
- const a = e[s], i = r[s];
2674
- if (a && W(a) && i) {
2675
- const n = Ur(a, i);
2676
- W(n) && (t[s] = n);
2688
+ const i = e[s], a = r[s];
2689
+ if (i && K(i) && a) {
2690
+ const n = Ur(i, a);
2691
+ K(n) && (t[s] = n);
2677
2692
  } else
2678
- e[s] && (t[s] = i);
2693
+ e[s] && (t[s] = a);
2679
2694
  }
2680
2695
  return t;
2681
2696
  }
2682
- var te = (e) => W(e) && !Object.keys(e).length, Nt = (e) => e.type === "file", et = (e) => {
2697
+ var ee = (e) => K(e) && !Object.keys(e).length, Nt = (e) => e.type === "file", tt = (e) => {
2683
2698
  if (!At)
2684
2699
  return !1;
2685
2700
  const r = e ? e.ownerDocument : 0;
2686
2701
  return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
2687
- }, zr = (e) => e.type === "select-multiple", Lt = (e) => e.type === "radio", En = (e) => Lt(e) || Ze(e), vt = (e) => et(e) && e.isConnected;
2688
- function Nn(e, r) {
2702
+ }, zr = (e) => e.type === "select-multiple", Lt = (e) => e.type === "radio", Nn = (e) => Lt(e) || Ze(e), vt = (e) => tt(e) && e.isConnected;
2703
+ function Ln(e, r) {
2689
2704
  const t = r.slice(0, -1).length;
2690
2705
  let s = 0;
2691
2706
  for (; s < t; )
2692
2707
  e = z(e) ? s++ : e[r[s++]];
2693
2708
  return e;
2694
2709
  }
2695
- function Ln(e) {
2710
+ function Tn(e) {
2696
2711
  for (const r in e)
2697
2712
  if (e.hasOwnProperty(r) && !z(e[r]))
2698
2713
  return !1;
2699
2714
  return !0;
2700
2715
  }
2701
- function K(e, r) {
2702
- const t = Array.isArray(r) ? r : it(r) ? [r] : Et(r), s = t.length === 1 ? e : Nn(e, t), a = t.length - 1, i = t[a];
2703
- return s && delete s[i], a !== 0 && (W(s) && te(s) || Array.isArray(s) && Ln(s)) && K(e, t.slice(0, -1)), e;
2716
+ function W(e, r) {
2717
+ const t = Array.isArray(r) ? r : ot(r) ? [r] : Et(r), s = t.length === 1 ? e : Ln(e, t), i = t.length - 1, a = t[i];
2718
+ return s && delete s[a], i !== 0 && (K(s) && ee(s) || Array.isArray(s) && Tn(s)) && W(e, t.slice(0, -1)), e;
2704
2719
  }
2705
- var Tn = (e) => {
2720
+ var Dn = (e) => {
2706
2721
  for (const r in e)
2707
2722
  if (oe(e[r]))
2708
2723
  return !0;
2709
2724
  return !1;
2710
2725
  };
2711
- function Kr(e) {
2712
- return Array.isArray(e) || W(e) && !Tn(e);
2726
+ function Wr(e) {
2727
+ return Array.isArray(e) || K(e) && !Dn(e);
2713
2728
  }
2714
2729
  function _t(e, r = {}) {
2715
2730
  for (const t in e) {
2716
2731
  const s = e[t];
2717
- Kr(s) ? (r[t] = Array.isArray(s) ? [] : {}, _t(s, r[t])) : z(s) || (r[t] = !0);
2732
+ Wr(s) ? (r[t] = Array.isArray(s) ? [] : {}, _t(s, r[t])) : z(s) || (r[t] = !0);
2718
2733
  }
2719
2734
  return r;
2720
2735
  }
2721
2736
  function Le(e, r, t) {
2722
2737
  t || (t = _t(r));
2723
2738
  for (const s in e) {
2724
- const a = e[s];
2725
- if (Kr(a))
2726
- z(r) || wt(t[s]) ? t[s] = _t(a, Array.isArray(a) ? [] : {}) : Le(a, re(r) ? {} : r[s], t[s]);
2739
+ const i = e[s];
2740
+ if (Wr(i))
2741
+ z(r) || wt(t[s]) ? t[s] = _t(i, Array.isArray(i) ? [] : {}) : Le(i, re(r) ? {} : r[s], t[s]);
2727
2742
  else {
2728
- const i = r[s];
2729
- t[s] = !Ce(a, i);
2743
+ const a = r[s];
2744
+ t[s] = !Ce(i, a);
2730
2745
  }
2731
2746
  }
2732
2747
  return t;
@@ -2735,7 +2750,7 @@ const Qt = {
2735
2750
  value: !1,
2736
2751
  isValid: !1
2737
2752
  }, er = { value: !0, isValid: !0 };
2738
- var Wr = (e) => {
2753
+ var Kr = (e) => {
2739
2754
  if (Array.isArray(e)) {
2740
2755
  if (e.length > 1) {
2741
2756
  const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
@@ -2758,21 +2773,21 @@ var Hr = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
2758
2773
  } : r, tr) : tr;
2759
2774
  function rr(e) {
2760
2775
  const r = e.ref;
2761
- return Nt(r) ? r.files : Lt(r) ? Hr(e.refs).value : zr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Ze(r) ? Wr(e.refs).value : Gr(z(r.value) ? e.ref.value : r.value, e);
2776
+ return Nt(r) ? r.files : Lt(r) ? Hr(e.refs).value : zr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Ze(r) ? Kr(e.refs).value : Gr(z(r.value) ? e.ref.value : r.value, e);
2762
2777
  }
2763
- var Dn = (e, r, t, s) => {
2764
- const a = {};
2765
- for (const i of e) {
2766
- const n = S(r, i);
2767
- n && j(a, i, n._f);
2778
+ var On = (e, r, t, s) => {
2779
+ const i = {};
2780
+ for (const a of e) {
2781
+ const n = S(r, a);
2782
+ n && B(i, a, n._f);
2768
2783
  }
2769
2784
  return {
2770
2785
  criteriaMode: t,
2771
2786
  names: [...e],
2772
- fields: a,
2787
+ fields: i,
2773
2788
  shouldUseNativeValidation: s
2774
2789
  };
2775
- }, tt = (e) => e instanceof RegExp, $e = (e) => z(e) ? e : tt(e) ? e.source : W(e) ? tt(e.value) ? e.value.source : e.value : e, sr = (e) => ({
2790
+ }, rt = (e) => e instanceof RegExp, qe = (e) => z(e) ? e : rt(e) ? e.source : K(e) ? rt(e.value) ? e.value.source : e.value : e, sr = (e) => ({
2776
2791
  isOnSubmit: !e || e === le.onSubmit,
2777
2792
  isOnBlur: e === le.onBlur,
2778
2793
  isOnChange: e === le.onChange,
@@ -2780,47 +2795,47 @@ var Dn = (e, r, t, s) => {
2780
2795
  isOnTouch: e === le.onTouched
2781
2796
  });
2782
2797
  const nr = "AsyncFunction";
2783
- var On = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || W(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Rn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ar = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
2784
- const He = (e, r, t, s) => {
2785
- for (const a of t || Object.keys(e)) {
2786
- const i = S(e, a);
2787
- if (i) {
2788
- const { _f: n, ...o } = i;
2798
+ var Rn = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || K(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Pn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ir = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
2799
+ const Je = (e, r, t, s) => {
2800
+ for (const i of t || Object.keys(e)) {
2801
+ const a = S(e, i);
2802
+ if (a) {
2803
+ const { _f: n, ...o } = a;
2789
2804
  if (n) {
2790
- if (n.refs && n.refs[0] && r(n.refs[0], a) && !s)
2805
+ if (n.refs && n.refs[0] && r(n.refs[0], i) && !s)
2791
2806
  return !0;
2792
2807
  if (n.ref && r(n.ref, n.name) && !s)
2793
2808
  return !0;
2794
- if (He(o, r))
2809
+ if (Je(o, r))
2795
2810
  break;
2796
- } else if (W(o) && He(o, r))
2811
+ } else if (K(o) && Je(o, r))
2797
2812
  break;
2798
2813
  }
2799
2814
  }
2800
2815
  };
2801
- function ir(e, r, t) {
2816
+ function ar(e, r, t) {
2802
2817
  const s = S(e, t);
2803
- if (s || it(t))
2818
+ if (s || ot(t))
2804
2819
  return {
2805
2820
  error: s,
2806
2821
  name: t
2807
2822
  };
2808
- const a = t.split(".");
2809
- for (; a.length; ) {
2810
- const i = a.join("."), n = S(r, i), o = S(e, i);
2811
- if (n && !Array.isArray(n) && t !== i)
2823
+ const i = t.split(".");
2824
+ for (; i.length; ) {
2825
+ const a = i.join("."), n = S(r, a), o = S(e, a);
2826
+ if (n && !Array.isArray(n) && t !== a)
2812
2827
  return { name: t };
2813
2828
  if (o && o.type)
2814
2829
  return {
2815
- name: i,
2830
+ name: a,
2816
2831
  error: o
2817
2832
  };
2818
2833
  if (o && o.root && o.root.type)
2819
2834
  return {
2820
- name: `${i}.root`,
2835
+ name: `${a}.root`,
2821
2836
  error: o.root
2822
2837
  };
2823
- a.pop();
2838
+ i.pop();
2824
2839
  }
2825
2840
  return {
2826
2841
  name: t
@@ -2828,73 +2843,73 @@ function ir(e, r, t) {
2828
2843
  }
2829
2844
  var Bn = (e, r, t, s) => {
2830
2845
  t(e);
2831
- const { name: a, ...i } = e;
2832
- return te(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((n) => r[n] === (!s || le.all));
2833
- }, Pn = (e, r, t) => !e || !r || e === r || Ge(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), jn = (e, r, t, s, a) => a.isOnAll ? !1 : !t && a.isOnTouch ? !(r || e) : (t ? s.isOnBlur : a.isOnBlur) ? !e : (t ? s.isOnChange : a.isOnChange) ? e : !0, $n = (e, r) => !Mt(S(e, r)).length && K(e, r), qn = (e, r, t) => {
2834
- const s = Ge(S(e, t));
2835
- return j(s, "root", r[t]), j(e, t, s), e;
2846
+ const { name: i, ...a } = e;
2847
+ return ee(a) || Object.keys(a).length >= Object.keys(r).length || Object.keys(a).find((n) => r[n] === (!s || le.all));
2848
+ }, jn = (e, r, t) => !e || !r || e === r || He(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), $n = (e, r, t, s, i) => i.isOnAll ? !1 : !t && i.isOnTouch ? !(r || e) : (t ? s.isOnBlur : i.isOnBlur) ? !e : (t ? s.isOnChange : i.isOnChange) ? e : !0, qn = (e, r) => !Mt(S(e, r)).length && W(e, r), Un = (e, r, t) => {
2849
+ const s = He(S(e, t));
2850
+ return B(s, "root", r[t]), B(e, t, s), e;
2836
2851
  };
2837
2852
  function or(e, r, t = "validate") {
2838
- if (ne(e) || Array.isArray(e) && e.every(ne) || ue(e) && !e)
2853
+ if (ne(e) || Array.isArray(e) && e.every(ne) || de(e) && !e)
2839
2854
  return {
2840
2855
  type: t,
2841
2856
  message: ne(e) ? e : "",
2842
2857
  ref: r
2843
2858
  };
2844
2859
  }
2845
- var Ne = (e) => W(e) && !tt(e) ? e : {
2860
+ var Ne = (e) => K(e) && !rt(e) ? e : {
2846
2861
  value: e,
2847
2862
  message: ""
2848
- }, lr = async (e, r, t, s, a, i) => {
2863
+ }, lr = async (e, r, t, s, i, a) => {
2849
2864
  const { ref: n, refs: o, required: c, maxLength: h, minLength: b, min: x, max: p, pattern: m, validate: C, name: E, valueAsNumber: A, mount: I } = e._f, y = S(t, E);
2850
2865
  if (!I || r.has(E))
2851
2866
  return {};
2852
2867
  const _ = o ? o[0] : n, V = (w) => {
2853
- a && _.reportValidity && (_.setCustomValidity(ue(w) ? "" : w || ""), _.reportValidity());
2854
- }, M = {}, D = Lt(n), G = Ze(n), N = D || G, q = (A || Nt(n)) && z(n.value) && z(y) || et(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, L = qr.bind(null, E, s, M), O = (w, T, U, Z = ye.maxLength, X = ye.minLength) => {
2855
- const J = w ? T : U;
2868
+ i && _.reportValidity && (_.setCustomValidity(de(w) ? "" : w || ""), _.reportValidity());
2869
+ }, M = {}, O = Lt(n), G = Ze(n), N = O || G, U = (A || Nt(n)) && z(n.value) && z(y) || tt(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, L = qr.bind(null, E, s, M), D = (w, T, q, X = ge.maxLength, te = ge.minLength) => {
2870
+ const J = w ? T : q;
2856
2871
  M[E] = {
2857
- type: w ? Z : X,
2872
+ type: w ? X : te,
2858
2873
  message: J,
2859
2874
  ref: n,
2860
- ...L(w ? Z : X, J)
2875
+ ...L(w ? X : te, J)
2861
2876
  };
2862
2877
  };
2863
- if (i ? !Array.isArray(y) || !y.length : c && (!N && (q || re(y)) || ue(y) && !y || G && !Wr(o).isValid || D && !Hr(o).isValid)) {
2878
+ if (a ? !Array.isArray(y) || !y.length : c && (!N && (U || re(y)) || de(y) && !y || G && !Kr(o).isValid || O && !Hr(o).isValid)) {
2864
2879
  const { value: w, message: T } = ne(c) ? { value: !!c, message: c } : Ne(c);
2865
2880
  if (w && (M[E] = {
2866
- type: ye.required,
2881
+ type: ge.required,
2867
2882
  message: T,
2868
2883
  ref: _,
2869
- ...L(ye.required, T)
2884
+ ...L(ge.required, T)
2870
2885
  }, !s))
2871
2886
  return V(T), M;
2872
2887
  }
2873
- if (!q && (!re(x) || !re(p))) {
2888
+ if (!U && (!re(x) || !re(p))) {
2874
2889
  let w, T;
2875
- const U = Ne(p), Z = Ne(x);
2890
+ const q = Ne(p), X = Ne(x);
2876
2891
  if (!re(y) && !isNaN(y)) {
2877
- const X = n.valueAsNumber || y && +y;
2878
- re(U.value) || (w = X > U.value), re(Z.value) || (T = X < Z.value);
2892
+ const te = n.valueAsNumber || y && +y;
2893
+ re(q.value) || (w = te > q.value), re(X.value) || (T = te < X.value);
2879
2894
  } else {
2880
- const X = n.valueAsDate || new Date(y), J = (we) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + we), ve = n.type == "time", xe = n.type == "week";
2881
- ne(U.value) && y && (w = ve ? J(y) > J(U.value) : xe ? y > U.value : X > new Date(U.value)), ne(Z.value) && y && (T = ve ? J(y) < J(Z.value) : xe ? y < Z.value : X < new Date(Z.value));
2895
+ const te = n.valueAsDate || new Date(y), J = (_e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + _e), ue = n.type == "time", we = n.type == "week";
2896
+ ne(q.value) && y && (w = ue ? J(y) > J(q.value) : we ? y > q.value : te > new Date(q.value)), ne(X.value) && y && (T = ue ? J(y) < J(X.value) : we ? y < X.value : te < new Date(X.value));
2882
2897
  }
2883
- if ((w || T) && (O(!!w, U.message, Z.message, ye.max, ye.min), !s))
2898
+ if ((w || T) && (D(!!w, q.message, X.message, ge.max, ge.min), !s))
2884
2899
  return V(M[E].message), M;
2885
2900
  }
2886
- if ((h || b) && !q && (ne(y) || i && Array.isArray(y))) {
2887
- const w = Ne(h), T = Ne(b), U = !re(w.value) && y.length > +w.value, Z = !re(T.value) && y.length < +T.value;
2888
- if ((U || Z) && (O(U, w.message, T.message), !s))
2901
+ if ((h || b) && !U && (ne(y) || a && Array.isArray(y))) {
2902
+ const w = Ne(h), T = Ne(b), q = !re(w.value) && y.length > +w.value, X = !re(T.value) && y.length < +T.value;
2903
+ if ((q || X) && (D(q, w.message, T.message), !s))
2889
2904
  return V(M[E].message), M;
2890
2905
  }
2891
- if (m && !q && ne(y)) {
2906
+ if (m && !U && ne(y)) {
2892
2907
  const { value: w, message: T } = Ne(m);
2893
- if (tt(w) && !y.match(w) && (M[E] = {
2894
- type: ye.pattern,
2908
+ if (rt(w) && !y.match(w) && (M[E] = {
2909
+ type: ge.pattern,
2895
2910
  message: T,
2896
2911
  ref: n,
2897
- ...L(ye.pattern, T)
2912
+ ...L(ge.pattern, T)
2898
2913
  }, !s))
2899
2914
  return V(T), M;
2900
2915
  }
@@ -2903,21 +2918,21 @@ var Ne = (e) => W(e) && !tt(e) ? e : {
2903
2918
  const w = await C(y, t), T = or(w, _);
2904
2919
  if (T && (M[E] = {
2905
2920
  ...T,
2906
- ...L(ye.validate, T.message)
2921
+ ...L(ge.validate, T.message)
2907
2922
  }, !s))
2908
2923
  return V(T.message), M;
2909
- } else if (W(C)) {
2924
+ } else if (K(C)) {
2910
2925
  let w = {};
2911
2926
  for (const T in C) {
2912
- if (!te(w) && !s)
2927
+ if (!ee(w) && !s)
2913
2928
  break;
2914
- const U = or(await C[T](y, t), _, T);
2915
- U && (w = {
2916
- ...U,
2917
- ...L(T, U.message)
2918
- }, V(U.message), s && (M[E] = w));
2929
+ const q = or(await C[T](y, t), _, T);
2930
+ q && (w = {
2931
+ ...q,
2932
+ ...L(T, q.message)
2933
+ }, V(q.message), s && (M[E] = w));
2919
2934
  }
2920
- if (!te(w) && (M[E] = {
2935
+ if (!ee(w) && (M[E] = {
2921
2936
  ref: _,
2922
2937
  ...w
2923
2938
  }, !s))
@@ -2926,14 +2941,14 @@ var Ne = (e) => W(e) && !tt(e) ? e : {
2926
2941
  }
2927
2942
  return V(!0), M;
2928
2943
  };
2929
- const Un = {
2944
+ const zn = {
2930
2945
  mode: le.onSubmit,
2931
2946
  reValidateMode: le.onChange,
2932
2947
  shouldFocusError: !0
2933
2948
  };
2934
- function zn(e = {}) {
2949
+ function Wn(e = {}) {
2935
2950
  let r = {
2936
- ...Un,
2951
+ ...zn,
2937
2952
  ...e
2938
2953
  }, t = {
2939
2954
  submitCount: 0,
@@ -2950,7 +2965,7 @@ function zn(e = {}) {
2950
2965
  validatingFields: {},
2951
2966
  errors: r.errors || {},
2952
2967
  disabled: r.disabled || !1
2953
- }, s = {}, a = W(r.defaultValues) || W(r.values) ? H(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : H(a), n = {
2968
+ }, s = {}, i = K(r.defaultValues) || K(r.values) ? H(r.defaultValues || r.values) || {} : {}, a = r.shouldUnregister ? {} : H(i), n = {
2954
2969
  action: !1,
2955
2970
  mount: !1,
2956
2971
  watch: !1,
@@ -2984,32 +2999,32 @@ function zn(e = {}) {
2984
2999
  }, A = async (l) => {
2985
3000
  if (!n.keepIsValid && !r.disabled && (x.isValid || p.isValid || l)) {
2986
3001
  let d;
2987
- r.resolver ? (d = te((await N()).errors), I()) : d = await L(s, !0), d !== t.isValid && m.state.next({
3002
+ r.resolver ? (d = ee((await N()).errors), I()) : d = await L(s, !0), d !== t.isValid && m.state.next({
2988
3003
  isValid: d
2989
3004
  });
2990
3005
  }
2991
3006
  }, I = (l, d) => {
2992
3007
  !r.disabled && (x.isValidating || x.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
2993
- f && (d ? j(t.validatingFields, f, d) : K(t.validatingFields, f));
3008
+ f && (d ? B(t.validatingFields, f, d) : W(t.validatingFields, f));
2994
3009
  }), m.state.next({
2995
3010
  validatingFields: t.validatingFields,
2996
- isValidating: !te(t.validatingFields)
3011
+ isValidating: !ee(t.validatingFields)
2997
3012
  }));
2998
3013
  }, y = (l, d = [], f, k, v = !0, g = !0) => {
2999
3014
  if (k && f && !r.disabled) {
3000
3015
  if (n.action = !0, g && Array.isArray(S(s, l))) {
3001
3016
  const F = f(S(s, l), k.argA, k.argB);
3002
- v && j(s, l, F);
3017
+ v && B(s, l, F);
3003
3018
  }
3004
3019
  if (g && Array.isArray(S(t.errors, l))) {
3005
3020
  const F = f(S(t.errors, l), k.argA, k.argB);
3006
- v && j(t.errors, l, F), $n(t.errors, l);
3021
+ v && B(t.errors, l, F), qn(t.errors, l);
3007
3022
  }
3008
3023
  if ((x.touchedFields || p.touchedFields) && g && Array.isArray(S(t.touchedFields, l))) {
3009
3024
  const F = f(S(t.touchedFields, l), k.argA, k.argB);
3010
- v && j(t.touchedFields, l, F);
3025
+ v && B(t.touchedFields, l, F);
3011
3026
  }
3012
- (x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Le(a, i)), m.state.next({
3027
+ (x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Le(i, a)), m.state.next({
3013
3028
  name: l,
3014
3029
  isDirty: w(l, d),
3015
3030
  dirtyFields: t.dirtyFields,
@@ -3017,9 +3032,9 @@ function zn(e = {}) {
3017
3032
  isValid: t.isValid
3018
3033
  });
3019
3034
  } else
3020
- j(i, l, d);
3035
+ B(a, l, d);
3021
3036
  }, _ = (l, d) => {
3022
- j(t.errors, l, d), m.state.next({
3037
+ B(t.errors, l, d), m.state.next({
3023
3038
  errors: t.errors
3024
3039
  });
3025
3040
  }, V = (l) => {
@@ -3030,10 +3045,10 @@ function zn(e = {}) {
3030
3045
  }, M = (l, d, f, k) => {
3031
3046
  const v = S(s, l);
3032
3047
  if (v) {
3033
- const g = S(i, l, z(f) ? S(a, l) : f);
3034
- z(g) || k && k.defaultChecked || d ? j(i, l, d ? g : rr(v._f)) : Z(l, g), n.mount && !n.action && A();
3048
+ const g = S(a, l, z(f) ? S(i, l) : f);
3049
+ z(g) || k && k.defaultChecked || d ? B(a, l, d ? g : rr(v._f)) : X(l, g), n.mount && !n.action && A();
3035
3050
  }
3036
- }, D = (l, d, f, k, v) => {
3051
+ }, O = (l, d, f, k, v) => {
3037
3052
  let g = !1, F = !1;
3038
3053
  const R = {
3039
3054
  name: l
@@ -3041,22 +3056,22 @@ function zn(e = {}) {
3041
3056
  if (!r.disabled) {
3042
3057
  if (!f || k) {
3043
3058
  (x.isDirty || p.isDirty) && (F = t.isDirty, t.isDirty = R.isDirty = w(), g = F !== R.isDirty);
3044
- const B = Ce(S(a, l), d);
3045
- F = !!S(t.dirtyFields, l), B ? K(t.dirtyFields, l) : j(t.dirtyFields, l, !0), R.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || p.dirtyFields) && F !== !B;
3059
+ const P = Ce(S(i, l), d);
3060
+ F = !!S(t.dirtyFields, l), P ? W(t.dirtyFields, l) : B(t.dirtyFields, l, !0), R.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || p.dirtyFields) && F !== !P;
3046
3061
  }
3047
3062
  if (f) {
3048
- const B = S(t.touchedFields, l);
3049
- B || (j(t.touchedFields, l, f), R.touchedFields = t.touchedFields, g = g || (x.touchedFields || p.touchedFields) && B !== f);
3063
+ const P = S(t.touchedFields, l);
3064
+ P || (B(t.touchedFields, l, f), R.touchedFields = t.touchedFields, g = g || (x.touchedFields || p.touchedFields) && P !== f);
3050
3065
  }
3051
3066
  g && v && m.state.next(R);
3052
3067
  }
3053
3068
  return g ? R : {};
3054
3069
  }, G = (l, d, f, k) => {
3055
- const v = S(t.errors, l), g = (x.isValid || p.isValid) && ue(d) && t.isValid !== d;
3056
- if (r.delayError && f ? (c = E(() => _(l, f)), c(r.delayError)) : (clearTimeout(h), c = null, f ? j(t.errors, l, f) : K(t.errors, l)), (f ? !Ce(v, f) : v) || !te(k) || g) {
3070
+ const v = S(t.errors, l), g = (x.isValid || p.isValid) && de(d) && t.isValid !== d;
3071
+ if (r.delayError && f ? (c = E(() => _(l, f)), c(r.delayError)) : (clearTimeout(h), c = null, f ? B(t.errors, l, f) : W(t.errors, l)), (f ? !Ce(v, f) : v) || !ee(k) || g) {
3057
3072
  const F = {
3058
3073
  ...k,
3059
- ...g && ue(d) ? { isValid: d } : {},
3074
+ ...g && de(d) ? { isValid: d } : {},
3060
3075
  errors: t.errors,
3061
3076
  name: l
3062
3077
  };
@@ -3065,12 +3080,12 @@ function zn(e = {}) {
3065
3080
  ...F
3066
3081
  }, m.state.next(F);
3067
3082
  }
3068
- }, N = async (l) => (I(l, !0), await r.resolver(i, r.context, Dn(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), q = async (l) => {
3083
+ }, N = async (l) => (I(l, !0), await r.resolver(a, r.context, On(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), U = async (l) => {
3069
3084
  const { errors: d } = await N(l);
3070
3085
  if (I(l), l)
3071
3086
  for (const f of l) {
3072
3087
  const k = S(d, f);
3073
- k ? j(t.errors, f, k) : K(t.errors, f);
3088
+ k ? B(t.errors, f, k) : W(t.errors, f);
3074
3089
  }
3075
3090
  else
3076
3091
  t.errors = d;
@@ -3083,99 +3098,99 @@ function zn(e = {}) {
3083
3098
  if (v) {
3084
3099
  const { _f: g, ...F } = v;
3085
3100
  if (g) {
3086
- const R = o.array.has(g.name), B = v._f && On(v._f);
3087
- B && x.validatingFields && I([g.name], !0);
3088
- const Q = await lr(v, o.disabled, i, C, r.shouldUseNativeValidation && !d, R);
3089
- if (B && x.validatingFields && I([g.name]), Q[g.name] && (f.valid = !1, d || e.shouldUseNativeValidation))
3101
+ const R = o.array.has(g.name), P = v._f && Rn(v._f);
3102
+ P && x.validatingFields && I([g.name], !0);
3103
+ const Y = await lr(v, o.disabled, a, C, r.shouldUseNativeValidation && !d, R);
3104
+ if (P && x.validatingFields && I([g.name]), Y[g.name] && (f.valid = !1, d || e.shouldUseNativeValidation))
3090
3105
  break;
3091
- !d && (S(Q, g.name) ? R ? qn(t.errors, Q, g.name) : j(t.errors, g.name, Q[g.name]) : K(t.errors, g.name));
3106
+ !d && (S(Y, g.name) ? R ? Un(t.errors, Y, g.name) : B(t.errors, g.name, Y[g.name]) : W(t.errors, g.name));
3092
3107
  }
3093
- !te(F) && await L(F, d, f);
3108
+ !ee(F) && await L(F, d, f);
3094
3109
  }
3095
3110
  }
3096
3111
  return f.valid;
3097
- }, O = () => {
3112
+ }, D = () => {
3098
3113
  for (const l of o.unMount) {
3099
3114
  const d = S(s, l);
3100
- d && (d._f.refs ? d._f.refs.every((f) => !vt(f)) : !vt(d._f.ref)) && ct(l);
3115
+ d && (d._f.refs ? d._f.refs.every((f) => !vt(f)) : !vt(d._f.ref)) && ce(l);
3101
3116
  }
3102
3117
  o.unMount = /* @__PURE__ */ new Set();
3103
- }, w = (l, d) => !r.disabled && (l && d && j(i, l, d), !Ce(Pe(), a)), T = (l, d, f) => An(l, o, {
3104
- ...n.mount ? i : z(d) ? a : ne(l) ? { [l]: d } : d
3105
- }, f, d), U = (l) => Mt(S(n.mount ? i : a, l, r.shouldUnregister ? S(a, l, []) : [])), Z = (l, d, f = {}) => {
3118
+ }, w = (l, d) => !r.disabled && (l && d && B(a, l, d), !Ce(Be(), i)), T = (l, d, f) => Mn(l, o, {
3119
+ ...n.mount ? a : z(d) ? i : ne(l) ? { [l]: d } : d
3120
+ }, f, d), q = (l) => Mt(S(n.mount ? a : i, l, r.shouldUnregister ? S(i, l, []) : [])), X = (l, d, f = {}) => {
3106
3121
  const k = S(s, l);
3107
3122
  let v = d;
3108
3123
  if (k) {
3109
3124
  const g = k._f;
3110
- g && (!g.disabled && j(i, l, Gr(d, g)), v = et(g.ref) && re(d) ? "" : d, zr(g.ref) ? [...g.ref.options].forEach((F) => F.selected = v.includes(F.value)) : g.refs ? Ze(g.ref) ? g.refs.forEach((F) => {
3125
+ g && (!g.disabled && B(a, l, Gr(d, g)), v = tt(g.ref) && re(d) ? "" : d, zr(g.ref) ? [...g.ref.options].forEach((F) => F.selected = v.includes(F.value)) : g.refs ? Ze(g.ref) ? g.refs.forEach((F) => {
3111
3126
  (!F.defaultChecked || !F.disabled) && (Array.isArray(v) ? F.checked = !!v.find((R) => R === F.value) : F.checked = v === F.value || !!v);
3112
3127
  }) : g.refs.forEach((F) => F.checked = F.value === v) : Nt(g.ref) ? g.ref.value = "" : (g.ref.value = v, g.ref.type || m.state.next({
3113
3128
  name: l,
3114
- values: H(i)
3129
+ values: H(a)
3115
3130
  })));
3116
3131
  }
3117
- (f.shouldDirty || f.shouldTouch) && D(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && we(l);
3118
- }, X = (l, d, f) => {
3132
+ (f.shouldDirty || f.shouldTouch) && O(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && _e(l);
3133
+ }, te = (l, d, f) => {
3119
3134
  for (const k in d) {
3120
3135
  if (!d.hasOwnProperty(k))
3121
3136
  return;
3122
3137
  const v = d[k], g = l + "." + k, F = S(s, g);
3123
- (o.array.has(l) || W(v) || F && !F._f) && !Ve(v) ? X(g, v, f) : Z(g, v, f);
3138
+ (o.array.has(l) || K(v) || F && !F._f) && !Ae(v) ? te(g, v, f) : X(g, v, f);
3124
3139
  }
3125
3140
  }, J = (l, d, f = {}) => {
3126
3141
  const k = S(s, l), v = o.array.has(l), g = H(d);
3127
- j(i, l, g), v ? (m.array.next({
3142
+ B(a, l, g), v ? (m.array.next({
3128
3143
  name: l,
3129
- values: H(i)
3144
+ values: H(a)
3130
3145
  }), (x.isDirty || x.dirtyFields || p.isDirty || p.dirtyFields) && f.shouldDirty && m.state.next({
3131
3146
  name: l,
3132
- dirtyFields: Le(a, i),
3147
+ dirtyFields: Le(i, a),
3133
3148
  isDirty: w(l, g)
3134
- })) : k && !k._f && !re(g) ? X(l, g, f) : Z(l, g, f), ar(l, o) ? m.state.next({
3149
+ })) : k && !k._f && !re(g) ? te(l, g, f) : X(l, g, f), ir(l, o) ? m.state.next({
3135
3150
  ...t,
3136
3151
  name: l,
3137
- values: H(i)
3152
+ values: H(a)
3138
3153
  }) : m.state.next({
3139
3154
  name: n.mount ? l : void 0,
3140
- values: H(i)
3155
+ values: H(a)
3141
3156
  });
3142
- }, ve = async (l) => {
3157
+ }, ue = async (l) => {
3143
3158
  n.mount = !0;
3144
3159
  const d = l.target;
3145
3160
  let f = d.name, k = !0;
3146
- const v = S(s, f), g = (B) => {
3147
- k = Number.isNaN(B) || Ve(B) && isNaN(B.getTime()) || Ce(B, S(i, f, B));
3161
+ const v = S(s, f), g = (P) => {
3162
+ k = Number.isNaN(P) || Ae(P) && isNaN(P.getTime()) || Ce(P, S(a, f, P));
3148
3163
  }, F = sr(r.mode), R = sr(r.reValidateMode);
3149
3164
  if (v) {
3150
- let B, Q;
3151
- const Fe = d.type ? rr(v._f) : _n(l), ke = l.type === Xt.BLUR || l.type === Xt.FOCUS_OUT, es = !Rn(v._f) && !r.resolver && !S(t.errors, f) && !v._f.deps || jn(ke, S(t.touchedFields, f), t.isSubmitted, R, F), ht = ar(f, o, ke);
3152
- j(i, f, Fe), ke ? (!d || !d.readOnly) && (v._f.onBlur && v._f.onBlur(l), c && c(0)) : v._f.onChange && v._f.onChange(l);
3153
- const pt = D(f, Fe, ke), ts = !te(pt) || ht;
3165
+ let P, Y;
3166
+ const Ve = d.type ? rr(v._f) : kn(l), ke = l.type === Zt.BLUR || l.type === Zt.FOCUS_OUT, es = !Pn(v._f) && !r.resolver && !S(t.errors, f) && !v._f.deps || $n(ke, S(t.touchedFields, f), t.isSubmitted, R, F), ht = ir(f, o, ke);
3167
+ B(a, f, Ve), ke ? (!d || !d.readOnly) && (v._f.onBlur && v._f.onBlur(l), c && c(0)) : v._f.onChange && v._f.onChange(l);
3168
+ const pt = O(f, Ve, ke), ts = !ee(pt) || ht;
3154
3169
  if (!ke && m.state.next({
3155
3170
  name: f,
3156
3171
  type: l.type,
3157
- values: H(i)
3172
+ values: H(a)
3158
3173
  }), es)
3159
3174
  return (x.isValid || p.isValid) && (r.mode === "onBlur" ? ke && A() : ke || A()), ts && m.state.next({ name: f, ...ht ? {} : pt });
3160
3175
  if (!ke && ht && m.state.next({ ...t }), r.resolver) {
3161
- const { errors: Pt } = await N([f]);
3162
- if (I([f]), g(Fe), k) {
3163
- const rs = ir(t.errors, s, f), jt = ir(Pt, s, rs.name || f);
3164
- B = jt.error, f = jt.name, Q = te(Pt);
3176
+ const { errors: Bt } = await N([f]);
3177
+ if (I([f]), g(Ve), k) {
3178
+ const rs = ar(t.errors, s, f), jt = ar(Bt, s, rs.name || f);
3179
+ P = jt.error, f = jt.name, Y = ee(Bt);
3165
3180
  }
3166
3181
  } else
3167
- I([f], !0), B = (await lr(v, o.disabled, i, C, r.shouldUseNativeValidation))[f], I([f]), g(Fe), k && (B ? Q = !1 : (x.isValid || p.isValid) && (Q = await L(s, !0)));
3168
- k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && we(v._f.deps), G(f, Q, B, pt));
3182
+ I([f], !0), P = (await lr(v, o.disabled, a, C, r.shouldUseNativeValidation))[f], I([f]), g(Ve), k && (P ? Y = !1 : (x.isValid || p.isValid) && (Y = await L(s, !0)));
3183
+ k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && _e(v._f.deps), G(f, Y, P, pt));
3169
3184
  }
3170
- }, xe = (l, d) => {
3185
+ }, we = (l, d) => {
3171
3186
  if (S(t.errors, d) && l.focus)
3172
3187
  return l.focus(), 1;
3173
- }, we = async (l, d = {}) => {
3188
+ }, _e = async (l, d = {}) => {
3174
3189
  let f, k;
3175
- const v = Ge(l);
3190
+ const v = He(l);
3176
3191
  if (r.resolver) {
3177
- const g = await q(z(l) ? l : v);
3178
- f = te(g), k = l ? !v.some((F) => S(g, F)) : f;
3192
+ const g = await U(z(l) ? l : v);
3193
+ f = ee(g), k = l ? !v.some((F) => S(g, F)) : f;
3179
3194
  } else
3180
3195
  l ? (k = (await Promise.all(v.map(async (g) => {
3181
3196
  const F = S(s, g);
@@ -3185,10 +3200,10 @@ function zn(e = {}) {
3185
3200
  ...!ne(l) || (x.isValid || p.isValid) && f !== t.isValid ? {} : { name: l },
3186
3201
  ...r.resolver || !l ? { isValid: f } : {},
3187
3202
  errors: t.errors
3188
- }), d.shouldFocus && !k && He(s, xe, l ? v : o.mount), k;
3189
- }, Pe = (l, d) => {
3203
+ }), d.shouldFocus && !k && Je(s, we, l ? v : o.mount), k;
3204
+ }, Be = (l, d) => {
3190
3205
  let f = {
3191
- ...n.mount ? i : a
3206
+ ...n.mount ? a : i
3192
3207
  };
3193
3208
  return d && (f = Ur(d.dirtyFields ? t.dirtyFields : t.touchedFields, f)), z(l) ? f : ne(l) ? S(f, l) : l.map((k) => S(f, k));
3194
3209
  }, je = (l, d) => ({
@@ -3197,9 +3212,9 @@ function zn(e = {}) {
3197
3212
  error: S((d || t).errors, l),
3198
3213
  isValidating: !!S(t.validatingFields, l),
3199
3214
  isTouched: !!S((d || t).touchedFields, l)
3200
- }), Xe = (l) => {
3201
- const d = l ? Ge(l) : void 0;
3202
- d == null || d.forEach((f) => K(t.errors, f)), d ? d.forEach((f) => {
3215
+ }), Ye = (l) => {
3216
+ const d = l ? He(l) : void 0;
3217
+ d == null || d.forEach((f) => W(t.errors, f)), d ? d.forEach((f) => {
3203
3218
  m.state.next({
3204
3219
  name: f,
3205
3220
  errors: t.errors
@@ -3207,10 +3222,10 @@ function zn(e = {}) {
3207
3222
  }) : m.state.next({
3208
3223
  errors: {}
3209
3224
  });
3210
- }, P = (l, d, f) => {
3211
- const k = (S(s, l, { _f: {} })._f || {}).ref, v = S(t.errors, l) || {}, { ref: g, message: F, type: R, ...B } = v;
3212
- j(t.errors, l, {
3213
- ...B,
3225
+ }, $e = (l, d, f) => {
3226
+ const k = (S(s, l, { _f: {} })._f || {}).ref, v = S(t.errors, l) || {}, { ref: g, message: F, type: R, ...P } = v;
3227
+ B(t.errors, l, {
3228
+ ...P,
3214
3229
  ...d,
3215
3230
  ref: k
3216
3231
  }), m.state.next({
@@ -3218,44 +3233,44 @@ function zn(e = {}) {
3218
3233
  errors: t.errors,
3219
3234
  isValid: !1
3220
3235
  }), f && f.shouldFocus && k && k.focus && k.focus();
3221
- }, ut = (l, d) => oe(l) ? m.state.subscribe({
3236
+ }, j = (l, d) => oe(l) ? m.state.subscribe({
3222
3237
  next: (f) => "values" in f && l(T(void 0, d), f)
3223
- }) : T(l, d, !0), Ye = (l) => m.state.subscribe({
3238
+ }) : T(l, d, !0), Qe = (l) => m.state.subscribe({
3224
3239
  next: (d) => {
3225
- Pn(l.name, d.name, l.exact) && Bn(d, l.formState || x, Qr, l.reRenderRoot) && l.callback({
3226
- values: { ...i },
3240
+ jn(l.name, d.name, l.exact) && Bn(d, l.formState || x, Qr, l.reRenderRoot) && l.callback({
3241
+ values: { ...a },
3227
3242
  ...t,
3228
3243
  ...d,
3229
- defaultValues: a
3244
+ defaultValues: i
3230
3245
  });
3231
3246
  }
3232
- }).unsubscribe, _e = (l) => (n.mount = !0, p = {
3247
+ }).unsubscribe, ct = (l) => (n.mount = !0, p = {
3233
3248
  ...p,
3234
3249
  ...l.formState
3235
- }, Ye({
3250
+ }, Qe({
3236
3251
  ...l,
3237
3252
  formState: {
3238
3253
  ...b,
3239
3254
  ...l.formState
3240
3255
  }
3241
- })), ct = (l, d = {}) => {
3242
- for (const f of l ? Ge(l) : o.mount)
3243
- o.mount.delete(f), o.array.delete(f), d.keepValue || (K(s, f), K(i, f)), !d.keepError && K(t.errors, f), !d.keepDirty && K(t.dirtyFields, f), !d.keepTouched && K(t.touchedFields, f), !d.keepIsValidating && K(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && K(a, f);
3256
+ })), ce = (l, d = {}) => {
3257
+ for (const f of l ? He(l) : o.mount)
3258
+ o.mount.delete(f), o.array.delete(f), d.keepValue || (W(s, f), W(a, f)), !d.keepError && W(t.errors, f), !d.keepDirty && W(t.dirtyFields, f), !d.keepTouched && W(t.touchedFields, f), !d.keepIsValidating && W(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && W(i, f);
3244
3259
  m.state.next({
3245
- values: H(i)
3260
+ values: H(a)
3246
3261
  }), m.state.next({
3247
3262
  ...t,
3248
3263
  ...d.keepDirty ? { isDirty: w() } : {}
3249
3264
  }), !d.keepIsValid && A();
3250
3265
  }, Tt = ({ disabled: l, name: d }) => {
3251
- if (ue(l) && n.mount || l || o.disabled.has(d)) {
3266
+ if (de(l) && n.mount || l || o.disabled.has(d)) {
3252
3267
  const v = o.disabled.has(d) !== !!l;
3253
3268
  l ? o.disabled.add(d) : o.disabled.delete(d), v && n.mount && !n.action && A();
3254
3269
  }
3255
3270
  }, dt = (l, d = {}) => {
3256
3271
  let f = S(s, l);
3257
- const k = ue(d.disabled) || ue(r.disabled);
3258
- return j(s, l, {
3272
+ const k = de(d.disabled) || de(r.disabled);
3273
+ return B(s, l, {
3259
3274
  ...f || {},
3260
3275
  _f: {
3261
3276
  ...f && f._f ? f._f : { ref: { name: l } },
@@ -3264,46 +3279,46 @@ function zn(e = {}) {
3264
3279
  ...d
3265
3280
  }
3266
3281
  }), o.mount.add(l), f ? Tt({
3267
- disabled: ue(d.disabled) ? d.disabled : r.disabled,
3282
+ disabled: de(d.disabled) ? d.disabled : r.disabled,
3268
3283
  name: l
3269
3284
  }) : M(l, !0, d.value), {
3270
3285
  ...k ? { disabled: d.disabled || r.disabled } : {},
3271
3286
  ...r.progressive ? {
3272
3287
  required: !!d.required,
3273
- min: $e(d.min),
3274
- max: $e(d.max),
3275
- minLength: $e(d.minLength),
3276
- maxLength: $e(d.maxLength),
3277
- pattern: $e(d.pattern)
3288
+ min: qe(d.min),
3289
+ max: qe(d.max),
3290
+ minLength: qe(d.minLength),
3291
+ maxLength: qe(d.maxLength),
3292
+ pattern: qe(d.pattern)
3278
3293
  } : {},
3279
3294
  name: l,
3280
- onChange: ve,
3281
- onBlur: ve,
3295
+ onChange: ue,
3296
+ onBlur: ue,
3282
3297
  ref: (v) => {
3283
3298
  if (v) {
3284
3299
  dt(l, d), f = S(s, l);
3285
- const g = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, F = En(g), R = f._f.refs || [];
3286
- if (F ? R.find((B) => B === g) : g === f._f.ref)
3300
+ const g = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, F = Nn(g), R = f._f.refs || [];
3301
+ if (F ? R.find((P) => P === g) : g === f._f.ref)
3287
3302
  return;
3288
- j(s, l, {
3303
+ B(s, l, {
3289
3304
  _f: {
3290
3305
  ...f._f,
3291
3306
  ...F ? {
3292
3307
  refs: [
3293
3308
  ...R.filter(vt),
3294
3309
  g,
3295
- ...Array.isArray(S(a, l)) ? [{}] : []
3310
+ ...Array.isArray(S(i, l)) ? [{}] : []
3296
3311
  ],
3297
3312
  ref: { type: g.type, name: l }
3298
3313
  } : { ref: g }
3299
3314
  }
3300
3315
  }), M(l, !1, void 0, g);
3301
3316
  } else
3302
- f = S(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Cn(o.array, l) && n.action) && o.unMount.add(l);
3317
+ f = S(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Sn(o.array, l) && n.action) && o.unMount.add(l);
3303
3318
  }
3304
3319
  };
3305
- }, ft = () => r.shouldFocusError && He(s, xe, o.mount), Zr = (l) => {
3306
- ue(l) && (m.state.next({ disabled: l }), He(s, (d, f) => {
3320
+ }, ft = () => r.shouldFocusError && Je(s, we, o.mount), Xr = (l) => {
3321
+ de(l) && (m.state.next({ disabled: l }), Je(s, (d, f) => {
3307
3322
  const k = S(s, f);
3308
3323
  k && (d.disabled = k._f.disabled || l, Array.isArray(k._f.refs) && k._f.refs.forEach((v) => {
3309
3324
  v.disabled = k._f.disabled || l;
@@ -3312,7 +3327,7 @@ function zn(e = {}) {
3312
3327
  }, Dt = (l, d) => async (f) => {
3313
3328
  let k;
3314
3329
  f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
3315
- let v = H(i);
3330
+ let v = H(a);
3316
3331
  if (m.state.next({
3317
3332
  isSubmitting: !0
3318
3333
  }), r.resolver) {
@@ -3322,8 +3337,8 @@ function zn(e = {}) {
3322
3337
  await L(s);
3323
3338
  if (o.disabled.size)
3324
3339
  for (const g of o.disabled)
3325
- K(v, g);
3326
- if (K(t.errors, "root"), te(t.errors)) {
3340
+ W(v, g);
3341
+ if (W(t.errors, "root"), ee(t.errors)) {
3327
3342
  m.state.next({
3328
3343
  errors: {}
3329
3344
  });
@@ -3337,35 +3352,35 @@ function zn(e = {}) {
3337
3352
  if (m.state.next({
3338
3353
  isSubmitted: !0,
3339
3354
  isSubmitting: !1,
3340
- isSubmitSuccessful: te(t.errors) && !k,
3355
+ isSubmitSuccessful: ee(t.errors) && !k,
3341
3356
  submitCount: t.submitCount + 1,
3342
3357
  errors: t.errors
3343
3358
  }), k)
3344
3359
  throw k;
3345
- }, Xr = (l, d = {}) => {
3346
- S(s, l) && (z(d.defaultValue) ? J(l, H(S(a, l))) : (J(l, d.defaultValue), j(a, l, H(d.defaultValue))), d.keepTouched || K(t.touchedFields, l), d.keepDirty || (K(t.dirtyFields, l), t.isDirty = d.defaultValue ? w(l, H(S(a, l))) : w()), d.keepError || (K(t.errors, l), x.isValid && A()), m.state.next({ ...t }));
3360
+ }, Zr = (l, d = {}) => {
3361
+ S(s, l) && (z(d.defaultValue) ? J(l, H(S(i, l))) : (J(l, d.defaultValue), B(i, l, H(d.defaultValue))), d.keepTouched || W(t.touchedFields, l), d.keepDirty || (W(t.dirtyFields, l), t.isDirty = d.defaultValue ? w(l, H(S(i, l))) : w()), d.keepError || (W(t.errors, l), x.isValid && A()), m.state.next({ ...t }));
3347
3362
  }, Ot = (l, d = {}) => {
3348
- const f = l ? H(l) : a, k = H(f), v = te(l), g = v ? a : k;
3349
- if (d.keepDefaultValues || (a = f), !d.keepValues) {
3363
+ const f = l ? H(l) : i, k = H(f), v = ee(l), g = v ? i : k;
3364
+ if (d.keepDefaultValues || (i = f), !d.keepValues) {
3350
3365
  if (d.keepDirtyValues) {
3351
3366
  const F = /* @__PURE__ */ new Set([
3352
3367
  ...o.mount,
3353
- ...Object.keys(Le(a, i))
3368
+ ...Object.keys(Le(i, a))
3354
3369
  ]);
3355
3370
  for (const R of Array.from(F)) {
3356
- const B = S(t.dirtyFields, R), Q = S(i, R), Fe = S(g, R);
3357
- B && !z(Q) ? j(g, R, Q) : !B && !z(Fe) && J(R, Fe);
3371
+ const P = S(t.dirtyFields, R), Y = S(a, R), Ve = S(g, R);
3372
+ P && !z(Y) ? B(g, R, Y) : !P && !z(Ve) && J(R, Ve);
3358
3373
  }
3359
3374
  } else {
3360
3375
  if (At && z(l))
3361
3376
  for (const F of o.mount) {
3362
3377
  const R = S(s, F);
3363
3378
  if (R && R._f) {
3364
- const B = Array.isArray(R._f.refs) ? R._f.refs[0] : R._f.ref;
3365
- if (et(B)) {
3366
- const Q = B.closest("form");
3367
- if (Q) {
3368
- Q.reset();
3379
+ const P = Array.isArray(R._f.refs) ? R._f.refs[0] : R._f.ref;
3380
+ if (tt(P)) {
3381
+ const Y = P.closest("form");
3382
+ if (Y) {
3383
+ Y.reset();
3369
3384
  break;
3370
3385
  }
3371
3386
  }
@@ -3377,7 +3392,7 @@ function zn(e = {}) {
3377
3392
  else
3378
3393
  s = {};
3379
3394
  }
3380
- i = r.shouldUnregister ? d.keepDefaultValues ? H(a) : {} : H(g), m.array.next({
3395
+ a = r.shouldUnregister ? d.keepDefaultValues ? H(i) : {} : H(g), m.array.next({
3381
3396
  values: { ...g }
3382
3397
  }), m.state.next({
3383
3398
  values: { ...g }
@@ -3391,18 +3406,18 @@ function zn(e = {}) {
3391
3406
  watch: /* @__PURE__ */ new Set(),
3392
3407
  watchAll: !1,
3393
3408
  focus: ""
3394
- }, n.mount = !x.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !te(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!d.keepIsValid, n.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
3409
+ }, n.mount = !x.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ee(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!d.keepIsValid, n.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
3395
3410
  submitCount: d.keepSubmitCount ? t.submitCount : 0,
3396
- isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l, a)),
3411
+ isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l, i)),
3397
3412
  isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
3398
- dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Le(a, i) : t.dirtyFields : d.keepDefaultValues && l ? Le(a, l) : d.keepDirty ? t.dirtyFields : {},
3413
+ dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues && a ? Le(i, a) : t.dirtyFields : d.keepDefaultValues && l ? Le(i, l) : d.keepDirty ? t.dirtyFields : {},
3399
3414
  touchedFields: d.keepTouched ? t.touchedFields : {},
3400
3415
  errors: d.keepErrors ? t.errors : {},
3401
3416
  isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
3402
3417
  isSubmitting: !1,
3403
- defaultValues: a
3418
+ defaultValues: i
3404
3419
  });
3405
- }, Rt = (l, d) => Ot(oe(l) ? l(i) : l, { ...r.resetOptions, ...d }), Yr = (l, d = {}) => {
3420
+ }, Rt = (l, d) => Ot(oe(l) ? l(a) : l, { ...r.resetOptions, ...d }), Yr = (l, d = {}) => {
3406
3421
  const f = S(s, l), k = f && f._f;
3407
3422
  if (k) {
3408
3423
  const v = k.refs ? k.refs[0] : k.ref;
@@ -3415,14 +3430,14 @@ function zn(e = {}) {
3415
3430
  ...t,
3416
3431
  ...l
3417
3432
  };
3418
- }, Bt = {
3433
+ }, Pt = {
3419
3434
  control: {
3420
3435
  register: dt,
3421
- unregister: ct,
3436
+ unregister: ce,
3422
3437
  getFieldState: je,
3423
3438
  handleSubmit: Dt,
3424
- setError: P,
3425
- _subscribe: Ye,
3439
+ setError: $e,
3440
+ _subscribe: Qe,
3426
3441
  _runSchema: N,
3427
3442
  _updateIsValidating: I,
3428
3443
  _focusError: ft,
@@ -3432,22 +3447,22 @@ function zn(e = {}) {
3432
3447
  _setFieldArray: y,
3433
3448
  _setDisabledField: Tt,
3434
3449
  _setErrors: V,
3435
- _getFieldArray: U,
3450
+ _getFieldArray: q,
3436
3451
  _reset: Ot,
3437
3452
  _resetDefaultValues: () => oe(r.defaultValues) && r.defaultValues().then((l) => {
3438
3453
  Rt(l, r.resetOptions), m.state.next({
3439
3454
  isLoading: !1
3440
3455
  });
3441
3456
  }),
3442
- _removeUnmounted: O,
3443
- _disableForm: Zr,
3457
+ _removeUnmounted: D,
3458
+ _disableForm: Xr,
3444
3459
  _subjects: m,
3445
3460
  _proxyFormState: x,
3446
3461
  get _fields() {
3447
3462
  return s;
3448
3463
  },
3449
3464
  get _formValues() {
3450
- return i;
3465
+ return a;
3451
3466
  },
3452
3467
  get _state() {
3453
3468
  return n;
@@ -3456,7 +3471,7 @@ function zn(e = {}) {
3456
3471
  n = l;
3457
3472
  },
3458
3473
  get _defaultValues() {
3459
- return a;
3474
+ return i;
3460
3475
  },
3461
3476
  get _names() {
3462
3477
  return o;
@@ -3477,28 +3492,28 @@ function zn(e = {}) {
3477
3492
  };
3478
3493
  }
3479
3494
  },
3480
- subscribe: _e,
3481
- trigger: we,
3495
+ subscribe: ct,
3496
+ trigger: _e,
3482
3497
  register: dt,
3483
3498
  handleSubmit: Dt,
3484
- watch: ut,
3499
+ watch: j,
3485
3500
  setValue: J,
3486
- getValues: Pe,
3501
+ getValues: Be,
3487
3502
  reset: Rt,
3488
- resetField: Xr,
3489
- clearErrors: Xe,
3490
- unregister: ct,
3491
- setError: P,
3503
+ resetField: Zr,
3504
+ clearErrors: Ye,
3505
+ unregister: ce,
3506
+ setError: $e,
3492
3507
  setFocus: Yr,
3493
3508
  getFieldState: je
3494
3509
  };
3495
3510
  return {
3496
- ...Bt,
3497
- formControl: Bt
3511
+ ...Pt,
3512
+ formControl: Pt
3498
3513
  };
3499
3514
  }
3500
- function ot(e = {}) {
3501
- const r = ee.useRef(void 0), t = ee.useRef(void 0), [s, a] = ee.useState({
3515
+ function lt(e = {}) {
3516
+ const r = Q.useRef(void 0), t = Q.useRef(void 0), [s, i] = Q.useState({
3502
3517
  isDirty: !1,
3503
3518
  isValidating: !1,
3504
3519
  isLoading: oe(e.defaultValues),
@@ -3522,47 +3537,47 @@ function ot(e = {}) {
3522
3537
  formState: s
3523
3538
  }, e.defaultValues && !oe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
3524
3539
  else {
3525
- const { formControl: n, ...o } = zn(e);
3540
+ const { formControl: n, ...o } = Wn(e);
3526
3541
  r.current = {
3527
3542
  ...o,
3528
3543
  formState: s
3529
3544
  };
3530
3545
  }
3531
- const i = r.current.control;
3532
- return i._options = e, Vn(() => {
3533
- const n = i._subscribe({
3534
- formState: i._proxyFormState,
3535
- callback: () => a({ ...i._formState }),
3546
+ const a = r.current.control;
3547
+ return a._options = e, An(() => {
3548
+ const n = a._subscribe({
3549
+ formState: a._proxyFormState,
3550
+ callback: () => i({ ...a._formState }),
3536
3551
  reRenderRoot: !0
3537
3552
  });
3538
- return a((o) => ({
3553
+ return i((o) => ({
3539
3554
  ...o,
3540
3555
  isReady: !0
3541
- })), i._formState.isReady = !0, n;
3542
- }, [i]), ee.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), ee.useEffect(() => {
3543
- e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
3544
- }, [i, e.mode, e.reValidateMode]), ee.useEffect(() => {
3545
- e.errors && (i._setErrors(e.errors), i._focusError());
3546
- }, [i, e.errors]), ee.useEffect(() => {
3547
- e.shouldUnregister && i._subjects.state.next({
3548
- values: i._getWatch()
3556
+ })), a._formState.isReady = !0, n;
3557
+ }, [a]), Q.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Q.useEffect(() => {
3558
+ e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
3559
+ }, [a, e.mode, e.reValidateMode]), Q.useEffect(() => {
3560
+ e.errors && (a._setErrors(e.errors), a._focusError());
3561
+ }, [a, e.errors]), Q.useEffect(() => {
3562
+ e.shouldUnregister && a._subjects.state.next({
3563
+ values: a._getWatch()
3549
3564
  });
3550
- }, [i, e.shouldUnregister]), ee.useEffect(() => {
3551
- if (i._proxyFormState.isDirty) {
3552
- const n = i._getDirty();
3553
- n !== s.isDirty && i._subjects.state.next({
3565
+ }, [a, e.shouldUnregister]), Q.useEffect(() => {
3566
+ if (a._proxyFormState.isDirty) {
3567
+ const n = a._getDirty();
3568
+ n !== s.isDirty && a._subjects.state.next({
3554
3569
  isDirty: n
3555
3570
  });
3556
3571
  }
3557
- }, [i, s.isDirty]), ee.useEffect(() => {
3572
+ }, [a, s.isDirty]), Q.useEffect(() => {
3558
3573
  var n;
3559
- e.values && !Ce(e.values, t.current) ? (i._reset(e.values, {
3574
+ e.values && !Ce(e.values, t.current) ? (a._reset(e.values, {
3560
3575
  keepFieldsRef: !0,
3561
- ...i._options.resetOptions
3562
- }), !((n = i._options.resetOptions) === null || n === void 0) && n.keepIsValid || i._setValid(), t.current = e.values, a((o) => ({ ...o }))) : i._resetDefaultValues();
3563
- }, [i, e.values]), ee.useEffect(() => {
3564
- i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
3565
- }), r.current.formState = ee.useMemo(() => Fn(s, i), [i, s]), r.current;
3576
+ ...a._options.resetOptions
3577
+ }), !((n = a._options.resetOptions) === null || n === void 0) && n.keepIsValid || a._setValid(), t.current = e.values, i((o) => ({ ...o }))) : a._resetDefaultValues();
3578
+ }, [a, e.values]), Q.useEffect(() => {
3579
+ a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
3580
+ }), r.current.formState = Q.useMemo(() => Vn(s, a), [a, s]), r.current;
3566
3581
  }
3567
3582
  const ur = (e, r, t) => {
3568
3583
  if (e && "reportValidity" in e) {
@@ -3572,26 +3587,26 @@ const ur = (e, r, t) => {
3572
3587
  }, Kn = (e, r) => {
3573
3588
  for (const t in r.fields) {
3574
3589
  const s = r.fields[t];
3575
- s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((a) => ur(a, t, e));
3590
+ s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((i) => ur(i, t, e));
3576
3591
  }
3577
- }, Wn = (e, r) => {
3592
+ }, Gn = (e, r) => {
3578
3593
  r.shouldUseNativeValidation && Kn(e, r);
3579
3594
  const t = {};
3580
3595
  for (const s in e) {
3581
- const a = S(r.fields, s), i = Object.assign(e[s] || {}, { ref: a && a.ref });
3582
- if (Gn(r.names || Object.keys(e), s)) {
3596
+ const i = S(r.fields, s), a = Object.assign(e[s] || {}, { ref: i && i.ref });
3597
+ if (Hn(r.names || Object.keys(e), s)) {
3583
3598
  const n = Object.assign({}, S(t, s));
3584
- j(n, "root", i), j(t, s, n);
3599
+ B(n, "root", a), B(t, s, n);
3585
3600
  } else
3586
- j(t, s, i);
3601
+ B(t, s, a);
3587
3602
  }
3588
3603
  return t;
3589
- }, Gn = (e, r) => e.some((t) => t.startsWith(r + "."));
3590
- var lt = function(e, r, t) {
3591
- return t === void 0 && (t = {}), function(s, a, i) {
3604
+ }, Hn = (e, r) => e.some((t) => t.startsWith(r + "."));
3605
+ var ut = function(e, r, t) {
3606
+ return t === void 0 && (t = {}), function(s, i, a) {
3592
3607
  try {
3593
- var n = !i.shouldUseNativeValidation && i.criteriaMode === "all";
3594
- return Promise.resolve(/* @__PURE__ */ sn(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
3608
+ var n = !a.shouldUseNativeValidation && a.criteriaMode === "all";
3609
+ return Promise.resolve(/* @__PURE__ */ nn(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
3595
3610
  if (o.issues) {
3596
3611
  for (var c = {}; o.issues.length; ) {
3597
3612
  var h = o.issues[0], b = /* @__PURE__ */ Zs(h);
@@ -3601,7 +3616,7 @@ var lt = function(e, r, t) {
3601
3616
  }
3602
3617
  o.issues.shift();
3603
3618
  }
3604
- return { values: {}, errors: Wn(c, i) };
3619
+ return { values: {}, errors: Gn(c, a) };
3605
3620
  }
3606
3621
  return { values: t.raw ? s : o.output, errors: {} };
3607
3622
  });
@@ -3610,13 +3625,13 @@ var lt = function(e, r, t) {
3610
3625
  }
3611
3626
  };
3612
3627
  };
3613
- const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3628
+ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
3614
3629
  const t = {
3615
3630
  min: e.minSelected ?? 0,
3616
3631
  max: e.maxSelected ?? e.options.length
3617
3632
  };
3618
- return lt(/* @__PURE__ */ ge({
3619
- checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */ ae(), /* @__PURE__ */ Lr()), /* @__PURE__ */ It((s) => Object.entries(s).filter(([a, i]) => i).map(([a, i]) => a)), /* @__PURE__ */ Ke(t.max, r("validation_multiple_choice_max", {
3633
+ return ut(/* @__PURE__ */ ve({
3634
+ checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */ ie(), /* @__PURE__ */ Lr()), /* @__PURE__ */ It((s) => Object.entries(s).filter(([i, a]) => a).map(([i, a]) => i)), /* @__PURE__ */ Ke(t.max, r("validation_multiple_choice_max", {
3620
3635
  count: t.max
3621
3636
  })), /* @__PURE__ */ Te(t.min, r("validation_multiple_choice_min", {
3622
3637
  count: t.min
@@ -3625,7 +3640,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3625
3640
  }, Zn = xr(({
3626
3641
  option: e,
3627
3642
  ...r
3628
- }, t) => u(be, {
3643
+ }, t) => u(xe, {
3629
3644
  children: [u("input", {
3630
3645
  class: "peer sr-only h-full",
3631
3646
  type: "checkbox",
@@ -3636,35 +3651,35 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3636
3651
  htmlFor: r.id,
3637
3652
  children: e.label
3638
3653
  })]
3639
- })), hr = st("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3654
+ })), hr = nt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3640
3655
  variants: {
3641
3656
  variant: {
3642
3657
  // In cases where there is only one option, we want to center it
3643
3658
  singleOption: "justify-center",
3644
3659
  // Two choices with exactly 1 min 1 max
3645
- booleanLike: Br
3660
+ booleanLike: Pr
3646
3661
  }
3647
3662
  }
3648
- }), Xn = ({
3663
+ }), Yn = ({
3649
3664
  input: e,
3650
3665
  onSubmitSuccess: r
3651
3666
  }) => {
3652
3667
  var b, x;
3653
- const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, a = s && e.config.options.length === 2, {
3654
- t: i
3668
+ const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, i = s && e.config.options.length === 2, {
3669
+ t: a
3655
3670
  } = se(), {
3656
3671
  register: n,
3657
3672
  handleSubmit: o,
3658
3673
  formState: {
3659
3674
  errors: c
3660
3675
  }
3661
- } = ot({
3676
+ } = lt({
3662
3677
  defaultValues: {
3663
- checked: s ? {} : Hn(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
3678
+ checked: s ? {} : Jn(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
3664
3679
  },
3665
- resolver: Jn(e.config, i)
3680
+ resolver: Xn(e.config, a)
3666
3681
  }), h = Vt();
3667
- return a ? u("ul", {
3682
+ return i ? u("ul", {
3668
3683
  style: {
3669
3684
  maxHeight: 6.5 * cr + 5 * dr + 2 * fr
3670
3685
  },
@@ -3672,7 +3687,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3672
3687
  variant: "booleanLike"
3673
3688
  }),
3674
3689
  children: e.config.options.map((p, m) => u("li", {
3675
- class: Pr,
3690
+ class: Br,
3676
3691
  children: u(jr, {
3677
3692
  type: "submit",
3678
3693
  ref: (C) => {
@@ -3728,7 +3743,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3728
3743
  })
3729
3744
  }), u("div", {
3730
3745
  class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
3731
- children: [s ? null : u(Me, {}), e.config.minSelected === 0 && u(Ee, {
3746
+ children: [s ? null : u(Ee, {}), e.config.minSelected === 0 && u(Fe, {
3732
3747
  class: "relative",
3733
3748
  type: "button",
3734
3749
  onClick: () => r({
@@ -3739,47 +3754,47 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3739
3754
  })]
3740
3755
  }), u("div", {
3741
3756
  class: "px-1",
3742
- children: u(Be, {
3757
+ children: u(Pe, {
3743
3758
  error: (x = c.checked) == null ? void 0 : x.root
3744
3759
  })
3745
3760
  })]
3746
3761
  });
3747
- }, Yn = Re("number"), Qn = (e, r) => {
3748
- const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, a = e.decimalCases ?? 0;
3749
- return lt(/* @__PURE__ */ ge({
3762
+ }, Qn = Re("number"), ei = (e, r) => {
3763
+ const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, i = e.decimalCases ?? 0;
3764
+ return ut(/* @__PURE__ */ ve({
3750
3765
  number: /* @__PURE__ */ Se(/* @__PURE__ */ Tr(r("validation_number")), /* @__PURE__ */ Ar(t, r("validation_number_min", {
3751
3766
  min: t
3752
3767
  })), /* @__PURE__ */ Vr(s, r("validation_number_max", {
3753
3768
  max: s
3754
- })), /* @__PURE__ */ Ir((i) => i === Number(i.toFixed(a)), r("validation_number_decimal_cases", {
3755
- count: a
3769
+ })), /* @__PURE__ */ Ir((a) => a === Number(a.toFixed(i)), r("validation_number_decimal_cases", {
3770
+ count: i
3756
3771
  })))
3757
3772
  }));
3758
- }, ea = ({
3773
+ }, ti = ({
3759
3774
  input: e,
3760
3775
  onSubmitSuccess: r
3761
3776
  }) => {
3762
3777
  var x;
3763
3778
  const t = e.config.defaultValue, s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, {
3764
- t: a
3779
+ t: i
3765
3780
  } = se(), {
3766
- register: i,
3781
+ register: a,
3767
3782
  handleSubmit: n,
3768
3783
  formState: {
3769
3784
  errors: o
3770
3785
  }
3771
- } = ot({
3786
+ } = lt({
3772
3787
  defaultValues: {
3773
- number: Yn(s) ? s.value : t ? Number(t) : void 0
3788
+ number: Qn(s) ? s.value : t ? Number(t) : void 0
3774
3789
  },
3775
- resolver: Qn(e.config, a)
3790
+ resolver: ei(e.config, i)
3776
3791
  }), {
3777
3792
  ref: c,
3778
3793
  ...h
3779
- } = i("number", {
3794
+ } = a("number", {
3780
3795
  required: !e.config.optional,
3781
3796
  valueAsNumber: !0
3782
- }), b = ce();
3797
+ }), b = fe();
3783
3798
  return Ie(() => {
3784
3799
  b.current && (b.current.focus(), b.current.select());
3785
3800
  }, []), u("form", {
@@ -3807,27 +3822,27 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3807
3822
  type: "text",
3808
3823
  min: e.config.min,
3809
3824
  max: e.config.max,
3810
- class: Je({
3825
+ class: Xe({
3811
3826
  optional: e.config.optional,
3812
3827
  className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
3813
3828
  }),
3814
3829
  placeholder: e.config.placeholder
3815
- }), e.config.optional && u(Ee, {
3830
+ }), e.config.optional && u(Fe, {
3816
3831
  class: "absolute bottom-0 right-0.5 top-0",
3817
3832
  onClick: () => r(null)
3818
3833
  })]
3819
- }), u(Me, {})]
3820
- }), u(Be, {
3834
+ }), u(Ee, {})]
3835
+ }), u(Pe, {
3821
3836
  error: o.number
3822
3837
  })]
3823
3838
  });
3824
- }, ta = (e) => {
3839
+ }, ri = (e) => {
3825
3840
  if (e === "")
3826
3841
  return {
3827
3842
  countryCode: "",
3828
3843
  phoneNumber: ""
3829
3844
  };
3830
- const r = Object.entries(Ft).find((a) => e.startsWith(a[1])), t = r ? r[1] : "", s = e.replace(t, "");
3845
+ const r = Object.entries(Ft).find((i) => e.startsWith(i[1])), t = r ? r[1] : "", s = e.replace(t, "");
3831
3846
  return /^\d+$/.test(s) ? {
3832
3847
  countryCode: t,
3833
3848
  phoneNumber: s
@@ -3835,38 +3850,38 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3835
3850
  countryCode: "",
3836
3851
  phoneNumber: ""
3837
3852
  };
3838
- }, ra = "44", sa = /^[0-9 ]+$/, na = Re("string"), aa = Re("phone"), ia = (e) => {
3839
- const r = /* @__PURE__ */ Se(/* @__PURE__ */ ae(e("validation_country_code")), /* @__PURE__ */ St(sa, e("validation_country_code"))), t = /* @__PURE__ */ Se(/* @__PURE__ */ ae(e("validation_phone")), /* @__PURE__ */ Te(1, e("validation_phone")), /* @__PURE__ */ It((s) => s.replace(/[^0-9]/g, "")));
3840
- return lt(/* @__PURE__ */ ge({
3853
+ }, si = "44", ni = /^[0-9 ]+$/, ii = Re("string"), ai = Re("phone"), oi = (e) => {
3854
+ const r = /* @__PURE__ */ Se(/* @__PURE__ */ ie(e("validation_country_code")), /* @__PURE__ */ St(ni, e("validation_country_code"))), t = /* @__PURE__ */ Se(/* @__PURE__ */ ie(e("validation_phone")), /* @__PURE__ */ Te(1, e("validation_phone")), /* @__PURE__ */ It((s) => s.replace(/[^0-9]/g, "")));
3855
+ return ut(/* @__PURE__ */ ve({
3841
3856
  countryCode: r,
3842
3857
  phoneNumber: t
3843
3858
  }));
3844
- }, oa = ({
3859
+ }, li = ({
3845
3860
  input: e,
3846
3861
  onSubmitSuccess: r
3847
3862
  }) => {
3848
3863
  var E;
3849
3864
  const t = e.key ? (E = $.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, {
3850
3865
  t: s
3851
- } = se(), [a, i] = me(), n = na(t) ? ta(t.value) : aa(t) ? t.value : void 0, {
3866
+ } = se(), [i, a] = be(), n = ii(t) ? ri(t.value) : ai(t) ? t.value : void 0, {
3852
3867
  register: o,
3853
3868
  handleSubmit: c,
3854
3869
  formState: {
3855
3870
  errors: h
3856
3871
  },
3857
3872
  watch: b
3858
- } = ot({
3873
+ } = lt({
3859
3874
  defaultValues: {
3860
- countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? ra,
3875
+ countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? si,
3861
3876
  phoneNumber: (n == null ? void 0 : n.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3862
3877
  },
3863
- resolver: ia(s)
3878
+ resolver: oi(s)
3864
3879
  }), {
3865
3880
  ref: x,
3866
3881
  ...p
3867
3882
  } = o("phoneNumber", {
3868
3883
  required: !e.config.optional
3869
- }), m = ce(), C = b("countryCode");
3884
+ }), m = fe(), C = b("countryCode");
3870
3885
  return Ie(() => {
3871
3886
  m.current && (m.current.focus(), m.current.select());
3872
3887
  }, []), u("form", {
@@ -3874,15 +3889,15 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3874
3889
  class: "flex flex-col gap-1 p-2.5",
3875
3890
  onSubmit: c((A) => {
3876
3891
  const I = A.phoneNumber.replace(/[^0-9]/g, ""), y = A.countryCode.replace(/[^0-9]/g, "");
3877
- i(void 0);
3892
+ a(void 0);
3878
3893
  const _ = e.config.minChars ?? 7, V = I.length + y.length;
3879
3894
  if (V < _)
3880
- return i(s("validation_phone_min_chars", {
3895
+ return a(s("validation_phone_min_chars", {
3881
3896
  count: _
3882
3897
  }));
3883
3898
  const M = e.config.maxChars;
3884
3899
  if (M != null && V > M)
3885
- return i(s("validation_max_chars", {
3900
+ return a(s("validation_max_chars", {
3886
3901
  count: M
3887
3902
  }));
3888
3903
  e.config.submissionFormat === "phone" ? r({
@@ -3926,23 +3941,23 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3926
3941
  ref: (A) => {
3927
3942
  A && (m.current = A), x(A);
3928
3943
  },
3929
- class: Je({
3944
+ class: Xe({
3930
3945
  optional: e.config.optional,
3931
3946
  className: "min-w-0 flex-1 rounded-r-full"
3932
3947
  }),
3933
3948
  placeholder: e.config.placeholder
3934
- }), e.config.optional && u(Ee, {
3949
+ }), e.config.optional && u(Fe, {
3935
3950
  class: "absolute bottom-0 right-1 top-0",
3936
3951
  onClick: () => r(null)
3937
3952
  })]
3938
- }), u(Me, {})]
3939
- }), u(Be, {
3953
+ }), u(Ee, {})]
3954
+ }), u(Pe, {
3940
3955
  error: h.countryCode || h.phoneNumber || {
3941
- message: a
3956
+ message: i
3942
3957
  }
3943
3958
  })]
3944
3959
  });
3945
- }, Qe = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), la = ({
3960
+ }, et = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), ui = ({
3946
3961
  input: e,
3947
3962
  onSubmitSuccess: r
3948
3963
  }) => {
@@ -3950,21 +3965,21 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3950
3965
  t
3951
3966
  } = se(), {
3952
3967
  availableAt: s
3953
- } = e.config, [a, i] = me(() => Qe(s)), [n, o] = me("");
3968
+ } = e.config, [i, a] = be(() => et(s)), [n, o] = be("");
3954
3969
  vr(() => {
3955
- const h = Qe(s);
3956
- if (i(h), h === 0)
3970
+ const h = et(s);
3971
+ if (a(h), h === 0)
3957
3972
  return;
3958
3973
  o(t("submission_cooldown", {
3959
3974
  count: h
3960
3975
  }));
3961
3976
  const b = setInterval(() => {
3962
- const x = Qe(s);
3963
- i(x), !(x > 0) && (clearInterval(b), o(t("submission_cooldown_ready")));
3977
+ const x = et(s);
3978
+ a(x), !(x > 0) && (clearInterval(b), o(t("submission_cooldown_ready")));
3964
3979
  }, 250);
3965
3980
  return () => clearInterval(b);
3966
3981
  }, [s, t]);
3967
- const c = a > 0;
3982
+ const c = i > 0;
3968
3983
  return u("div", {
3969
3984
  class: "flex flex-col items-center gap-2 py-3",
3970
3985
  children: [u("button", {
@@ -3973,7 +3988,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
3973
3988
  "aria-disabled": c,
3974
3989
  "aria-describedby": c ? "submit-cooldown" : void 0,
3975
3990
  onClick: () => {
3976
- Qe(s) > 0 || r(null);
3991
+ et(s) > 0 || r(null);
3977
3992
  },
3978
3993
  children: u("span", {
3979
3994
  class: "flex items-center gap-1.5",
@@ -4000,7 +4015,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4000
4015
  "aria-hidden": "true",
4001
4016
  class: "text-neutral-11 text-xs",
4002
4017
  children: t("submission_cooldown", {
4003
- count: a
4018
+ count: i
4004
4019
  })
4005
4020
  }), u("p", {
4006
4021
  role: "status",
@@ -4008,7 +4023,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4008
4023
  children: n
4009
4024
  })]
4010
4025
  });
4011
- }, ua = {
4026
+ }, ci = {
4012
4027
  date: {
4013
4028
  type: "date",
4014
4029
  inputMode: "text"
@@ -4027,7 +4042,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4027
4042
  inputMode: "url",
4028
4043
  formNoValidate: !0
4029
4044
  }
4030
- }, ca = Re("string"), da = (e, r) => {
4045
+ }, di = Re("string"), fi = (e, r) => {
4031
4046
  const t = {
4032
4047
  maxLength: r("validation_max_chars", {
4033
4048
  count: e.maxChars ?? 999
@@ -4036,38 +4051,38 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4036
4051
  count: e.minChars ?? 1
4037
4052
  })
4038
4053
  };
4039
- return lt(/* @__PURE__ */ ge({
4054
+ return ut(/* @__PURE__ */ ve({
4040
4055
  text: {
4041
- date: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_date")), /* @__PURE__ */ St(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
4042
- email: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_email")), /* @__PURE__ */ Fr(r("validation_email")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
4043
- text: /* @__PURE__ */ Se(/* @__PURE__ */ ae(), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
4044
- url: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_url")), /* @__PURE__ */ Mr(r("validation_url")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength))
4056
+ date: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_date")), /* @__PURE__ */ St(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
4057
+ email: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_email")), /* @__PURE__ */ Fr(r("validation_email")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
4058
+ text: /* @__PURE__ */ Se(/* @__PURE__ */ ie(), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
4059
+ url: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_url")), /* @__PURE__ */ Mr(r("validation_url")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength))
4045
4060
  }[e.format]
4046
4061
  }));
4047
- }, fa = ({
4062
+ }, hi = ({
4048
4063
  input: e,
4049
4064
  onSubmitSuccess: r
4050
4065
  }) => {
4051
4066
  var x;
4052
4067
  const {
4053
4068
  t
4054
- } = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, a = e.config.defaultValue, {
4055
- register: i,
4069
+ } = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, i = e.config.defaultValue, {
4070
+ register: a,
4056
4071
  handleSubmit: n,
4057
4072
  formState: {
4058
4073
  errors: o
4059
4074
  }
4060
- } = ot({
4075
+ } = lt({
4061
4076
  defaultValues: {
4062
- text: ca(s) ? s.value : a ?? ""
4077
+ text: di(s) ? s.value : i ?? ""
4063
4078
  },
4064
- resolver: da(e.config, t)
4079
+ resolver: fi(e.config, t)
4065
4080
  }), {
4066
4081
  ref: c,
4067
4082
  ...h
4068
- } = i("text", {
4083
+ } = a("text", {
4069
4084
  required: !e.config.optional
4070
- }), b = ce();
4085
+ }), b = fe();
4071
4086
  return Ie(() => {
4072
4087
  b.current && (b.current.focus(), b.current.select());
4073
4088
  }, []), u("form", {
@@ -4086,7 +4101,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4086
4101
  children: [u("input", {
4087
4102
  id: "chat-input",
4088
4103
  ...h,
4089
- ...ua[e.config.format],
4104
+ ...ci[e.config.format],
4090
4105
  autocomplete: "off",
4091
4106
  autoCapitalize: "off",
4092
4107
  autoCorrect: "off",
@@ -4095,34 +4110,34 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4095
4110
  p && (b.current = p), c(p);
4096
4111
  },
4097
4112
  placeholder: e.config.placeholder,
4098
- class: Je({
4113
+ class: Xe({
4099
4114
  optional: !!e.config.optional,
4100
4115
  className: "w-full rounded-full"
4101
4116
  })
4102
- }), e.config.optional && u(Ee, {
4117
+ }), e.config.optional && u(Fe, {
4103
4118
  class: "absolute bottom-0 right-0.5 top-0",
4104
4119
  onClick: () => r(null)
4105
4120
  })]
4106
- }), u(Me, {})]
4107
- }), u(Be, {
4121
+ }), u(Ee, {})]
4122
+ }), u(Pe, {
4108
4123
  error: o.text
4109
4124
  })]
4110
4125
  });
4111
- }, ha = {
4112
- text: fa,
4113
- phone: oa,
4114
- "multiple-choice": Xn,
4115
- boolean: pn,
4116
- file: wn,
4117
- submit: la,
4118
- address: cn,
4119
- number: ea
4120
- }, pa = ({
4126
+ }, pi = {
4127
+ text: hi,
4128
+ phone: li,
4129
+ "multiple-choice": Yn,
4130
+ boolean: yn,
4131
+ file: _n,
4132
+ submit: ui,
4133
+ address: dn,
4134
+ number: ti
4135
+ }, yi = ({
4121
4136
  logger: e,
4122
4137
  analytics: r
4123
4138
  }) => {
4124
- var i;
4125
- const t = (i = $.current$.value.flow) == null ? void 0 : i.data.currentInput, s = ce(null), a = () => ie.onInteractionFn$.value();
4139
+ var a;
4140
+ const t = (a = $.current$.value.flow) == null ? void 0 : a.data.currentInput, s = fe(null), i = () => ae.onInteractionFn$.value();
4126
4141
  return Ie(() => {
4127
4142
  var n;
4128
4143
  (n = s.current) == null || n.scrollTo({
@@ -4133,14 +4148,14 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4133
4148
  class: "border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",
4134
4149
  children: u("div", {
4135
4150
  class: "flex flex-col",
4136
- onPointerDownCapture: t ? a : void 0,
4137
- onKeyDownCapture: t ? a : void 0,
4151
+ onPointerDownCapture: t ? i : void 0,
4152
+ onKeyDownCapture: t ? i : void 0,
4138
4153
  children: t ? (() => {
4139
- const n = ha[t.type];
4154
+ const n = pi[t.type];
4140
4155
  return u(n, {
4141
4156
  logger: e,
4142
4157
  analytics: r,
4143
- onSubmitSuccess: ie.onSubmitSuccessFn$.value,
4158
+ onSubmitSuccess: ae.onSubmitSuccessFn$.value,
4144
4159
  input: t
4145
4160
  });
4146
4161
  })() : u("div", {
@@ -4148,12 +4163,12 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4148
4163
  children: [u("input", {
4149
4164
  "aria-hidden": "true",
4150
4165
  id: "chat-input",
4151
- class: Je({
4166
+ class: Xe({
4152
4167
  optional: !1,
4153
4168
  className: "flex-grow rounded-full"
4154
4169
  }),
4155
4170
  disabled: !0
4156
- }), u(Me, {
4171
+ }), u(Ee, {
4157
4172
  disabled: !0,
4158
4173
  "aria-hidden": "true",
4159
4174
  tabIndex: -1
@@ -4162,47 +4177,47 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
4162
4177
  })
4163
4178
  });
4164
4179
  };
4165
- function ya(e) {
4180
+ function mi(e) {
4166
4181
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4167
4182
  }
4168
- var ma = function(e) {
4183
+ var gi = function(e) {
4169
4184
  return e instanceof RegExp;
4170
- }, ga = function(r) {
4185
+ }, bi = function(r) {
4171
4186
  var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
4172
4187
  return r && s.test(r) ? r.replace(t, "\\$&") : r;
4173
4188
  }, Jr = function(e) {
4174
4189
  return typeof e == "string";
4175
- }, ba = function(e) {
4190
+ }, vi = function(e) {
4176
4191
  var r = [];
4177
4192
  return e.forEach(function(t) {
4178
4193
  Array.isArray(t) ? r = r.concat(t) : r.push(t);
4179
4194
  }), r;
4180
4195
  };
4181
- function va(e, r, t) {
4182
- var s = 0, a = 0;
4196
+ function xi(e, r, t) {
4197
+ var s = 0, i = 0;
4183
4198
  if (e === "")
4184
4199
  return e;
4185
4200
  if (!e || !Jr(e))
4186
4201
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
4187
- var i = r;
4188
- ma(i) || (i = new RegExp("(" + ga(i) + ")", "gi"));
4189
- for (var n = e.split(i), o = 1, c = n.length; o < c; o += 2) {
4202
+ var a = r;
4203
+ gi(a) || (a = new RegExp("(" + bi(a) + ")", "gi"));
4204
+ for (var n = e.split(a), o = 1, c = n.length; o < c; o += 2) {
4190
4205
  if (n[o] === void 0 || n[o - 1] === void 0) {
4191
4206
  console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
4192
4207
  continue;
4193
4208
  }
4194
- a = n[o].length, s += n[o - 1].length, n[o] = t(n[o], o, s), s += a;
4209
+ i = n[o].length, s += n[o - 1].length, n[o] = t(n[o], o, s), s += i;
4195
4210
  }
4196
4211
  return n;
4197
4212
  }
4198
- var xa = function(r, t, s) {
4199
- return Array.isArray(r) || (r = [r]), ba(r.map(function(a) {
4200
- return Jr(a) ? va(a, t, s) : a;
4213
+ var wi = function(r, t, s) {
4214
+ return Array.isArray(r) || (r = [r]), vi(r.map(function(i) {
4215
+ return Jr(i) ? xi(i, t, s) : i;
4201
4216
  }));
4202
4217
  };
4203
- const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]+)\]\(([^)]+)\)/, ka = /(https?:\/\/[^\s]+)/g, Ca = /_(.*?)_/g, Sa = /\*\*(.*?)\*\*/g, Ia = /\\n|\n/g, pr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Fa = (e) => {
4204
- const r = qe(e, wa, (n, o) => {
4205
- const [, c, h] = n.match(_a) ?? [];
4218
+ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]+)\]\(([^)]+)\)/, Ci = /(https?:\/\/[^\s]+)/g, Si = /_(.*?)_/g, Ii = /\*\*(.*?)\*\*/g, Fi = /\\n|\n/g, pr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Vi = (e) => {
4219
+ const r = Ue(e, _i, (n, o) => {
4220
+ const [, c, h] = n.match(ki) ?? [];
4206
4221
  return h ? u("a", {
4207
4222
  class: pr,
4208
4223
  href: h,
@@ -4210,17 +4225,17 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4210
4225
  }, h + o) : u("span", {
4211
4226
  children: "INVALID LINK"
4212
4227
  });
4213
- }), t = qe(r, ka, (n, o) => u("a", {
4228
+ }), t = Ue(r, Ci, (n, o) => u("a", {
4214
4229
  class: pr,
4215
4230
  href: n,
4216
4231
  children: n
4217
- }, n + o)), s = qe(t, Ca, (n, o) => u("em", {
4232
+ }, n + o)), s = Ue(t, Si, (n, o) => u("em", {
4218
4233
  children: n
4219
- }, n + o)), a = qe(s, Sa, (n, o) => u("strong", {
4234
+ }, n + o)), i = Ue(s, Ii, (n, o) => u("strong", {
4220
4235
  children: n
4221
4236
  }, n + o));
4222
- return qe(a, Ia, (n, o) => u("br", {}, `br-${o}`));
4223
- }, Va = st("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", {
4237
+ return Ue(i, Fi, (n, o) => u("br", {}, `br-${o}`));
4238
+ }, Ai = nt("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", {
4224
4239
  variants: {
4225
4240
  side: {
4226
4241
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -4234,24 +4249,24 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4234
4249
  defaultVariants: {
4235
4250
  side: "left"
4236
4251
  }
4237
- }), Aa = ({
4252
+ }), Mi = ({
4238
4253
  children: e,
4239
4254
  className: r,
4240
4255
  animate: t,
4241
4256
  side: s,
4242
- ...a
4257
+ ...i
4243
4258
  }) => u("p", {
4244
4259
  style: {
4245
4260
  transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
4246
4261
  },
4247
- class: Va({
4262
+ class: Ai({
4248
4263
  className: r,
4249
4264
  side: s,
4250
4265
  animate: t
4251
4266
  }),
4252
- ...a,
4267
+ ...i,
4253
4268
  children: e
4254
- }), Ma = ({
4269
+ }), Ei = ({
4255
4270
  message: e
4256
4271
  }) => u("div", {
4257
4272
  class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
@@ -4275,12 +4290,12 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4275
4290
  })
4276
4291
  })]
4277
4292
  })
4278
- }), Ea = ({
4293
+ }), Ni = ({
4279
4294
  className: e,
4280
4295
  ...r
4281
4296
  }) => u("div", {
4282
4297
  "aria-hidden": !0,
4283
- children: ie.isBotTyping$.value === !0 ? u("div", {
4298
+ children: ae.isBotTyping$.value === !0 ? u("div", {
4284
4299
  "aria-label": "Typing…",
4285
4300
  class: Oe("flex gap-1 p-4", e),
4286
4301
  ...r,
@@ -4293,10 +4308,10 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4293
4308
  }
4294
4309
  }))
4295
4310
  }) : void 0
4296
- }), Na = {
4311
+ }), Li = {
4297
4312
  bot: "left",
4298
4313
  user: "right"
4299
- }, La = st("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)]", {
4314
+ }, Ti = nt("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)]", {
4300
4315
  variants: {
4301
4316
  variant: {
4302
4317
  info: "text-neutral-8",
@@ -4305,7 +4320,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4305
4320
  success: "text-[#4CAF50]"
4306
4321
  }
4307
4322
  }
4308
- }), Ta = ({
4323
+ }), Di = ({
4309
4324
  lastSentMessageFooter: e
4310
4325
  }) => {
4311
4326
  const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? kt(r) : void 0;
@@ -4313,32 +4328,32 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4313
4328
  "aria-label": "Chat messages",
4314
4329
  "aria-live": "polite",
4315
4330
  class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
4316
- children: [t.map((a, i) => u(be, {
4331
+ children: [t.map((i, a) => u(xe, {
4317
4332
  children: u("li", {
4318
4333
  class: "flex",
4319
- tabIndex: i === t.length - 1 ? -1 : void 0,
4320
- children: [s && a.groupId === s && !t.slice(i + 1).some((n) => n.groupId === s) ? e : null, ds(a).with({
4334
+ tabIndex: a === t.length - 1 ? -1 : void 0,
4335
+ children: [s && i.groupId === s && !t.slice(a + 1).some((n) => n.groupId === s) ? e : null, fs(i).with({
4321
4336
  type: "system"
4322
4337
  }, (n) => u("p", {
4323
- class: La({
4338
+ class: Ti({
4324
4339
  variant: n.variant
4325
4340
  }),
4326
4341
  children: n.text
4327
4342
  })).with({
4328
4343
  type: "text",
4329
- author: fs.union("bot", "user")
4344
+ author: hs.union("bot", "user")
4330
4345
  }, (n) => {
4331
- const o = i === t.length - 1, c = n.author === "bot" ? Fa(n.text) : n.text;
4332
- return u(be, {
4333
- children: u(Aa, {
4346
+ const o = a === t.length - 1, c = n.author === "bot" ? Vi(n.text) : n.text;
4347
+ return u(xe, {
4348
+ children: u(Mi, {
4334
4349
  animate: o,
4335
- side: Na[n.author],
4350
+ side: Li[n.author],
4336
4351
  children: c
4337
- }, i)
4352
+ }, a)
4338
4353
  });
4339
4354
  }).with({
4340
4355
  type: "link"
4341
- }, (n) => u(Ma, {
4356
+ }, (n) => u(Ei, {
4342
4357
  message: n
4343
4358
  })).with({
4344
4359
  type: "image"
@@ -4350,7 +4365,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4350
4365
  }
4351
4366
  })).with({
4352
4367
  type: "file"
4353
- }, (n) => u(gn, {
4368
+ }, (n) => u(bn, {
4354
4369
  class: n.author === "bot" ? void 0 : "ml-auto",
4355
4370
  file: {
4356
4371
  name: n.fileName,
@@ -4360,7 +4375,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4360
4375
  type: "loading"
4361
4376
  }, (n) => {
4362
4377
  const o = t[t.length - 1];
4363
- return !(n === o) || ie.isBotTyping$.value ? null : u("div", {
4378
+ return !(n === o) || ae.isBotTyping$.value ? null : u("div", {
4364
4379
  class: "flex flex-grow flex-col items-center justify-center gap-2",
4365
4380
  children: [u(Ct, {
4366
4381
  "aria-hidden": n.text ? "true" : void 0,
@@ -4373,27 +4388,27 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4373
4388
  });
4374
4389
  }).exhaustive()]
4375
4390
  })
4376
- }, i)), u(Ea, {}, "typing")]
4391
+ }, a)), u(Ni, {}, "typing")]
4377
4392
  });
4378
- }, Pa = ({
4393
+ }, ji = ({
4379
4394
  logger: e,
4380
4395
  apiClient: r,
4381
4396
  analytics: t,
4382
4397
  talentBankClient: s
4383
4398
  }) => {
4384
4399
  const {
4385
- flow: a
4400
+ flow: i
4386
4401
  } = $.current$.value;
4387
- Ae(a, "Flow is required to exist to show chatbot body");
4388
- const i = $.viewState$.value, {
4402
+ Me(i, "Flow is required to exist to show chatbot body");
4403
+ const a = $.viewState$.value, {
4389
4404
  chatRef: n,
4390
4405
  chatService: o
4391
- } = hs(), {
4406
+ } = ps(), {
4392
4407
  t: c
4393
- } = se(), [h, b] = me();
4408
+ } = se(), [h, b] = be();
4394
4409
  return Ie(() => {
4395
- i === "maximised" && ie.scrollToEnd();
4396
- }, [i]), Ie(() => {
4410
+ a === "maximised" && ae.scrollToEnd();
4411
+ }, [a]), Ie(() => {
4397
4412
  var y;
4398
4413
  const {
4399
4414
  state: x,
@@ -4402,27 +4417,27 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4402
4417
  if (x !== "loaded")
4403
4418
  throw new Error(c("invalid_state"));
4404
4419
  let m = p.data.nodeHistory.at(-1);
4405
- if (ie.scrollToEnd(), $.setInput(void 0), p.data.isFinished)
4420
+ if (ae.scrollToEnd(), $.setInput(void 0), p.data.isFinished)
4406
4421
  return;
4407
4422
  const C = () => {
4408
4423
  const _ = $.current$.peek().flow;
4409
4424
  !_ || _.data.hasInteracted || ($.markAsInteracted(), Ut(t, _, "FLOW_INTERACT"));
4410
4425
  };
4411
- ie.onInteractionFn$.value = C, m === void 0 ? (m = gr(a.nodes).id, $.setCurrentNodeId(m), Ut(t, p, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
4426
+ ae.onInteractionFn$.value = C, m === void 0 ? (m = gr(i.nodes).id, $.setCurrentNodeId(m), Ut(t, p, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
4412
4427
  const {
4413
4428
  interpret: E,
4414
4429
  abort: A,
4415
4430
  undo: I
4416
- } = ws({
4417
- context: a.context,
4431
+ } = _s({
4432
+ context: i.context,
4418
4433
  analytics: {
4419
4434
  service: t,
4420
- customProperties: (y = a.analytics) == null ? void 0 : y.customProperties
4435
+ customProperties: (y = i.analytics) == null ? void 0 : y.customProperties
4421
4436
  },
4422
4437
  apiClient: r,
4423
4438
  logger: e,
4424
4439
  talentBankClient: s,
4425
- flow: a,
4440
+ flow: i,
4426
4441
  chatService: o,
4427
4442
  t: c,
4428
4443
  getApplicationRecovery: () => {
@@ -4441,24 +4456,24 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4441
4456
  var V;
4442
4457
  $.markAsFinished();
4443
4458
  const _ = $.current$.peek().flow;
4444
- Ae(_), t.log({
4459
+ Me(_), t.log({
4445
4460
  event: "FLOW_END",
4446
4461
  properties: {
4447
- flow_id: a.id,
4448
- flow_version: a.version,
4462
+ flow_id: i.id,
4463
+ flow_version: i.version,
4449
4464
  flow_session_id: _.data.flowSessionId,
4450
- flow_build: a.build,
4451
- job: a.job
4465
+ flow_build: i.build,
4466
+ job: i.job
4452
4467
  },
4453
- customProperties: (V = a.analytics) == null ? void 0 : V.customProperties
4468
+ customProperties: (V = i.analytics) == null ? void 0 : V.customProperties
4454
4469
  });
4455
4470
  }
4456
4471
  });
4457
4472
  return b(() => I), E(m), () => {
4458
- ie.onInteractionFn$.value === C && (ie.onInteractionFn$.value = () => {
4473
+ ae.onInteractionFn$.value === C && (ae.onInteractionFn$.value = () => {
4459
4474
  }), A();
4460
4475
  };
4461
- }, [t, r, o, e, a, s, c]), u(be, {
4476
+ }, [t, r, o, e, i, s, c]), u(xe, {
4462
4477
  children: [u("div", {
4463
4478
  class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
4464
4479
  children: [u("div", {
@@ -4470,31 +4485,31 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4470
4485
  style: {
4471
4486
  WebkitOverflowScrolling: "touch"
4472
4487
  },
4473
- children: u(Ta, {
4474
- lastSentMessageFooter: !kt(a) || !h ? null : u(Da, {
4488
+ children: u(Di, {
4489
+ lastSentMessageFooter: !kt(i) || !h ? null : u(Oi, {
4475
4490
  undoFn: h
4476
4491
  })
4477
4492
  })
4478
- }), ie.isReadingHistory$.value && !a.data.isFinished && !ie.isBotTyping$.value && u("div", {
4493
+ }), ae.isReadingHistory$.value && !i.data.isFinished && !ae.isBotTyping$.value && u("div", {
4479
4494
  class: "absolute bottom-2 left-1/2 -translate-x-1/2",
4480
4495
  children: u(wr, {
4481
4496
  class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
4482
4497
  "aria-label": c("jump_to_current"),
4483
4498
  onClick: () => {
4484
4499
  var p, m;
4485
- ie.scrollToEnd(), (m = ((p = n.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
4500
+ ae.scrollToEnd(), (m = ((p = n.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
4486
4501
  preventScroll: !0
4487
4502
  });
4488
4503
  },
4489
- children: u(ps, {})
4504
+ children: u(ys, {})
4490
4505
  })
4491
4506
  })]
4492
- }), u(pa, {
4507
+ }), u(yi, {
4493
4508
  logger: e,
4494
4509
  analytics: t
4495
4510
  })]
4496
4511
  });
4497
- }, Da = ({
4512
+ }, Oi = ({
4498
4513
  undoFn: e
4499
4514
  }) => {
4500
4515
  const {
@@ -4508,7 +4523,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4508
4523
  const {
4509
4524
  flow: t
4510
4525
  } = $.current$.peek();
4511
- Ae(t), e(t.data.nodeHistory);
4526
+ Me(t), e(t.data.nodeHistory);
4512
4527
  },
4513
4528
  children: u("path", {
4514
4529
  d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
@@ -4517,5 +4532,5 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
4517
4532
  });
4518
4533
  };
4519
4534
  export {
4520
- Pa as ChatbotBody
4535
+ ji as ChatbotBody
4521
4536
  };