@inploi/plugin-chatbot 14.13.0 → 14.13.1
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.
- package/cdn/index.js +4 -4
- package/dist/chatbot-body-2dd1b047.cjs +5 -0
- package/dist/{chatbot-body-dc3edab9.js → chatbot-body-ea673b1c.js} +201 -217
- package/dist/i18n.d.ts +220 -220
- package/dist/index-4ef46fa9.cjs +5 -0
- package/dist/{index-5b3244e1.js → index-8c30932d.js} +284 -312
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +2 -2
- package/package.json +2 -2
- package/dist/chatbot-body-3e43f3a7.cjs +0 -5
- package/dist/components/chat-input/chat-input.phone-number.utils.d.ts +0 -4
- package/dist/index-ba15cfce.cjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Sn = Object.defineProperty;
|
|
2
2
|
var En = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var Y = (e, r, t) => (En(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
-
import { u as Br, p as vt, D as Dt, l as Ge, f as $r, T as jr, a as An, E as In, N as Fn, I as Pr, C as Vn, s as Mn, g as Ln, S as Nn, U as nr, $ as sr, R as Rn, w as ar, m as Tn, y as Dn, b as qr, k as On, x as Bn, h as $n, z as jn, Z as Ur, H as Pn, v as qn, c as q, d as ne, o as c, e as Qe, i as xt, j as _e, _ as ye, n as Oe, q as Me, r as Ce, L as Ut, F as Un, t as Wr, A as zr, B as Wn, G as
|
|
4
|
+
import { u as Br, p as vt, D as Dt, l as Ge, f as $r, T as jr, a as An, E as In, N as Fn, I as Pr, C as Vn, s as Mn, g as Ln, S as Nn, U as nr, $ as sr, R as Rn, w as ar, m as Tn, y as Dn, b as qr, k as On, x as Bn, h as $n, z as jn, Z as Ur, H as Pn, v as qn, c as q, d as ne, o as c, e as Qe, i as xt, j as _e, _ as ye, n as Oe, q as Me, r as Ce, L as Ut, F as Un, t as Wr, A as zr, B as Wn, G as zn, J as et, K as ir, M as ae, O as ce, P as Hn, Q as Kn, V as Gn, W as Jn, X as Hr, Y as Zn } from "./index-8c30932d.js";
|
|
5
5
|
import "@inploi/sdk";
|
|
6
|
-
var
|
|
6
|
+
var Xn = "9.10.0", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/index.html`, Yn = new URL(Kr).origin, or = 3e4, Qn = 5 * 6e4, es = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), ts = (e) => {
|
|
7
7
|
let r = Ft.get(e);
|
|
8
8
|
return r || (r = e.fetch("/flow/captcha").then((t) => {
|
|
9
9
|
let n = t == null ? void 0 : t.site_key;
|
|
@@ -11,7 +11,7 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
11
11
|
}).catch((t) => {
|
|
12
12
|
throw Ft.delete(e), t;
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
|
-
},
|
|
14
|
+
}, rs = (e, r = {}) => new Promise((t, n) => {
|
|
15
15
|
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, u = !1, f = () => {
|
|
16
16
|
}, v = (_) => {
|
|
17
17
|
u || (u = !0, clearTimeout(y), s == null || s.removeEventListener("abort", p), f(), _());
|
|
@@ -21,7 +21,7 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
21
21
|
if (C(or), s == null ? void 0 : s.aborted)
|
|
22
22
|
return p();
|
|
23
23
|
s == null || s.addEventListener("abort", p), (async () => {
|
|
24
|
-
let _ = await
|
|
24
|
+
let _ = await ts(e);
|
|
25
25
|
if (_ === void 0)
|
|
26
26
|
return v(() => t(void 0));
|
|
27
27
|
if (u)
|
|
@@ -29,7 +29,7 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
29
29
|
let k = document.createElement("iframe");
|
|
30
30
|
k.src = `${Kr}?${new URLSearchParams({ sitekey: _, origin: window.location.origin, ...a && { theme: a } }).toString()}`, k.title = "Cloudflare security check", k.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(k) : (k.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(k));
|
|
31
31
|
let E = !1, g = (N) => {
|
|
32
|
-
if (!k.contentWindow || N.source !== k.contentWindow || N.origin !==
|
|
32
|
+
if (!k.contentWindow || N.source !== k.contentWindow || N.origin !== Yn || !es(N.data))
|
|
33
33
|
return;
|
|
34
34
|
let V = N.data;
|
|
35
35
|
switch (V.type) {
|
|
@@ -39,7 +39,7 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
39
39
|
k.style.height = `${Math.max(0, Math.ceil(V.height))}px`;
|
|
40
40
|
return;
|
|
41
41
|
case "before-interactive":
|
|
42
|
-
return E = !0, C(
|
|
42
|
+
return E = !0, C(Qn), o == null ? void 0 : o();
|
|
43
43
|
case "after-interactive":
|
|
44
44
|
return E = !1, C(or);
|
|
45
45
|
case "error":
|
|
@@ -166,7 +166,7 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
166
166
|
return !1;
|
|
167
167
|
return !0;
|
|
168
168
|
}
|
|
169
|
-
},
|
|
169
|
+
}, ns = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ss = (e, { context: r, submissions: t }) => e.replace(ns, (n, s, i = "") => {
|
|
170
170
|
let [a, ...o] = s.trim().split("."), u = Br({ key: a, path: o, submissions: t, context: r });
|
|
171
171
|
if (!u)
|
|
172
172
|
return i;
|
|
@@ -205,11 +205,11 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
205
205
|
return i;
|
|
206
206
|
});
|
|
207
207
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
208
|
-
function
|
|
208
|
+
function as(e) {
|
|
209
209
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
210
210
|
}
|
|
211
211
|
function Wt(e, r, t = "") {
|
|
212
|
-
const n =
|
|
212
|
+
const n = as(e), s = e == null ? void 0 : e.length, i = r !== void 0;
|
|
213
213
|
if (!n || i && s !== r) {
|
|
214
214
|
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", u = n ? `length=${s}` : `type=${typeof e}`;
|
|
215
215
|
throw new Error(a + "expected Uint8Array" + o + ", got " + u);
|
|
@@ -222,7 +222,7 @@ function cr(e, r = !0) {
|
|
|
222
222
|
if (r && e.finished)
|
|
223
223
|
throw new Error("Hash#digest() has already been called");
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function is(e, r) {
|
|
226
226
|
Wt(e, void 0, "digestInto() output");
|
|
227
227
|
const t = r.outputLen;
|
|
228
228
|
if (e.length < t)
|
|
@@ -238,32 +238,32 @@ function Vt(e) {
|
|
|
238
238
|
function pe(e, r) {
|
|
239
239
|
return e << 32 - r | e >>> r;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const os = /* @__PURE__ */ (() => (
|
|
242
242
|
// @ts-ignore
|
|
243
243
|
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
|
|
244
|
-
))(),
|
|
245
|
-
function
|
|
246
|
-
if (Wt(e),
|
|
244
|
+
))(), ls = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
|
|
245
|
+
function cs(e) {
|
|
246
|
+
if (Wt(e), os)
|
|
247
247
|
return e.toHex();
|
|
248
248
|
let r = "";
|
|
249
249
|
for (let t = 0; t < e.length; t++)
|
|
250
|
-
r +=
|
|
250
|
+
r += ls[e[t]];
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function us(e, r = {}) {
|
|
254
254
|
const t = (s, i) => e(i).update(s).digest(), n = e(void 0);
|
|
255
255
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => e(s), Object.assign(t, r), Object.freeze(t);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const ds = (e) => ({
|
|
258
258
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, e])
|
|
259
259
|
});
|
|
260
|
-
function
|
|
260
|
+
function fs(e, r, t) {
|
|
261
261
|
return e & r ^ ~e & t;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function hs(e, r, t) {
|
|
264
264
|
return e & r ^ e & t ^ r & t;
|
|
265
265
|
}
|
|
266
|
-
class
|
|
266
|
+
class ps {
|
|
267
267
|
constructor(r, t, n, s) {
|
|
268
268
|
Y(this, "blockLen");
|
|
269
269
|
Y(this, "outputLen");
|
|
@@ -294,7 +294,7 @@ class hs {
|
|
|
294
294
|
return this.length += r.length, this.roundClean(), this;
|
|
295
295
|
}
|
|
296
296
|
digestInto(r) {
|
|
297
|
-
cr(this),
|
|
297
|
+
cr(this), is(r, this), this.finished = !0;
|
|
298
298
|
const { buffer: t, view: n, blockLen: s, isLE: i } = this;
|
|
299
299
|
let { pos: a } = this;
|
|
300
300
|
t[a++] = 128, Ot(this.buffer.subarray(a)), this.padOffset > s - a && (this.process(n, 0), a = 0);
|
|
@@ -334,7 +334,7 @@ const Ae = /* @__PURE__ */ Uint32Array.from([
|
|
|
334
334
|
2600822924,
|
|
335
335
|
528734635,
|
|
336
336
|
1541459225
|
|
337
|
-
]),
|
|
337
|
+
]), ms = /* @__PURE__ */ Uint32Array.from([
|
|
338
338
|
1116352408,
|
|
339
339
|
1899447441,
|
|
340
340
|
3049323471,
|
|
@@ -400,7 +400,7 @@ const Ae = /* @__PURE__ */ Uint32Array.from([
|
|
|
400
400
|
3204031479,
|
|
401
401
|
3329325298
|
|
402
402
|
]), Ie = /* @__PURE__ */ new Uint32Array(64);
|
|
403
|
-
class
|
|
403
|
+
class ys extends ps {
|
|
404
404
|
constructor(r) {
|
|
405
405
|
super(64, r, 8, !1);
|
|
406
406
|
}
|
|
@@ -421,7 +421,7 @@ class ms extends hs {
|
|
|
421
421
|
}
|
|
422
422
|
let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H: v } = this;
|
|
423
423
|
for (let b = 0; b < 64; b++) {
|
|
424
|
-
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p +
|
|
424
|
+
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p + fs(o, u, f) + ms[b] + Ie[b] | 0, _ = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + hs(n, s, i) | 0;
|
|
425
425
|
v = f, f = u, u = o, o = a + y | 0, a = i, i = s, s = n, n = y + _ | 0;
|
|
426
426
|
}
|
|
427
427
|
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0, v = v + this.H | 0, this.set(n, s, i, a, o, u, f, v);
|
|
@@ -433,7 +433,7 @@ class ms extends hs {
|
|
|
433
433
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class bs extends ys {
|
|
437
437
|
constructor() {
|
|
438
438
|
super(32);
|
|
439
439
|
// We cannot use array here since array allows indexing by variable
|
|
@@ -448,9 +448,9 @@ class ys extends ms {
|
|
|
448
448
|
Y(this, "H", Ae[7] | 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
() => new
|
|
453
|
-
/* @__PURE__ */
|
|
451
|
+
const gs = /* @__PURE__ */ us(
|
|
452
|
+
() => new bs(),
|
|
453
|
+
/* @__PURE__ */ ds(1)
|
|
454
454
|
);
|
|
455
455
|
var Gr = (e) => {
|
|
456
456
|
let r = e.find((t) => t.isHead);
|
|
@@ -461,12 +461,12 @@ var Gr = (e) => {
|
|
|
461
461
|
var r, t;
|
|
462
462
|
if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
|
|
463
463
|
return (t = [...e.data.messages].reverse().find((n) => n.groupId && e.nodes.some((s) => s.id === n.groupId && s.type.startsWith("question-")) && (n.type === "system" || "author" in n && n.author === "user"))) == null ? void 0 : t.groupId;
|
|
464
|
-
}, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e,
|
|
465
|
-
function
|
|
464
|
+
}, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e, vs = (e) => cs(gs(new TextEncoder().encode(JSON.stringify(Bt(e)))));
|
|
465
|
+
function xs(e, r, t, n) {
|
|
466
466
|
var s;
|
|
467
467
|
if (n != null && n.aborted)
|
|
468
468
|
return;
|
|
469
|
-
let i =
|
|
469
|
+
let i = vs(t), a = (s = e.data).preApplyFingerprints ?? (s.preApplyFingerprints = []);
|
|
470
470
|
if (a.includes(i))
|
|
471
471
|
return;
|
|
472
472
|
a.push(i);
|
|
@@ -478,13 +478,13 @@ function vs(e, r, t, n) {
|
|
|
478
478
|
clearTimeout(u);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) =>
|
|
481
|
+
var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ss(e, Jr(r)), ws = (e, r) => lt(e, Jr(r)), Zr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
482
482
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
483
483
|
return e;
|
|
484
484
|
let n = e.nextId ? r.find((s) => s.id === e.nextId) : void 0;
|
|
485
485
|
if (n)
|
|
486
486
|
return Zr({ node: n, nodes: r, stopWhen: t });
|
|
487
|
-
},
|
|
487
|
+
}, _s = ({ childNode: e, nodes: r }) => {
|
|
488
488
|
let t = r.filter((n) => n.type === "if-block").find((n) => {
|
|
489
489
|
if (!n.branchId)
|
|
490
490
|
return !1;
|
|
@@ -496,7 +496,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((n) => n.id === t.nextId);
|
|
499
|
-
},
|
|
499
|
+
}, ks = 3, Cs = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier: v, onSubmitNetworkError: b, closedRoleBehaviour: p, settledOutcomes: y = p, dateEchoLocale: C, onFlowEnd: _, onInterpret: k, forceSubmitConfirmation: E, flowType: g, t: N }) => {
|
|
500
500
|
var V;
|
|
501
501
|
let M = new AbortController(), O = { submitAccepted: !1 };
|
|
502
502
|
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((T) => {
|
|
@@ -518,7 +518,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
518
518
|
return ee(j, R);
|
|
519
519
|
k == null || k(T, R);
|
|
520
520
|
try {
|
|
521
|
-
await
|
|
521
|
+
await Ss({ flow: e, analytics: K, logger: t, talentBankClient: n, apiClient: i, context: s, node: T, submissions: I, applicationRecovery: F, setApplicationRecovery: async (L) => {
|
|
522
522
|
if (!B.aborted)
|
|
523
523
|
try {
|
|
524
524
|
await u(L);
|
|
@@ -530,7 +530,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
530
530
|
}, captcha: f.captcha }, next: (L) => {
|
|
531
531
|
if (B.aborted)
|
|
532
532
|
return;
|
|
533
|
-
let W = (F == null ? void 0 : F.fileQuestionNodeId) === T.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) :
|
|
533
|
+
let W = (F == null ? void 0 : F.fileQuestionNodeId) === T.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) : _s({ childNode: T, nodes: e.nodes });
|
|
534
534
|
return U ? ee(U, T) : _ == null ? void 0 : _(T);
|
|
535
535
|
}, end: () => {
|
|
536
536
|
B.aborted || (_ == null || _(T));
|
|
@@ -567,57 +567,57 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
567
567
|
M.abort();
|
|
568
568
|
} };
|
|
569
569
|
};
|
|
570
|
-
async function
|
|
570
|
+
async function Ss(e) {
|
|
571
571
|
let r = e.node;
|
|
572
572
|
switch (r.type) {
|
|
573
573
|
case "flow-section":
|
|
574
574
|
return await e.chat.sendMessage({ type: "system", variant: "info", text: r.data.title }), e.next(r.nextId);
|
|
575
575
|
case "pre-apply-result":
|
|
576
|
-
return
|
|
576
|
+
return Gs({ ...e, node: r });
|
|
577
577
|
case "text":
|
|
578
|
-
return Os({ ...e, node: r });
|
|
579
|
-
case "image":
|
|
580
578
|
return Bs({ ...e, node: r });
|
|
581
|
-
case "
|
|
579
|
+
case "image":
|
|
582
580
|
return $s({ ...e, node: r });
|
|
581
|
+
case "question-text":
|
|
582
|
+
return js({ ...e, node: r });
|
|
583
583
|
case "question-enum":
|
|
584
|
-
return
|
|
584
|
+
return Us({ ...e, node: r });
|
|
585
585
|
case "question-number":
|
|
586
|
-
return js({ ...e, node: r });
|
|
587
|
-
case "question-phone":
|
|
588
586
|
return Ps({ ...e, node: r });
|
|
587
|
+
case "question-phone":
|
|
588
|
+
return qs({ ...e, node: r });
|
|
589
589
|
case "question-boolean":
|
|
590
|
-
return
|
|
590
|
+
return Ws({ ...e, node: r });
|
|
591
591
|
case "question-file":
|
|
592
|
-
return
|
|
592
|
+
return Hs({ ...e, node: r });
|
|
593
593
|
case "question-address":
|
|
594
|
-
return
|
|
594
|
+
return zs({ ...e, node: r });
|
|
595
595
|
case "end-flow":
|
|
596
|
-
return
|
|
596
|
+
return Ks({ ...e, node: r });
|
|
597
597
|
case "if-block":
|
|
598
|
-
return
|
|
598
|
+
return Os({ ...e, node: r });
|
|
599
599
|
case "jump":
|
|
600
|
-
return
|
|
600
|
+
return Is({ ...e, node: r });
|
|
601
601
|
case "link":
|
|
602
|
-
return
|
|
602
|
+
return Ds({ ...e, node: r });
|
|
603
603
|
case "integration-application-submit":
|
|
604
|
-
return
|
|
604
|
+
return Ts({ ...e, node: r });
|
|
605
605
|
case "add-submission":
|
|
606
|
-
return
|
|
606
|
+
return Fs({ ...e, node: r });
|
|
607
607
|
case "integration-workflow-get":
|
|
608
608
|
throw Error("Workflow should be unreachable");
|
|
609
609
|
case "check-duplicate":
|
|
610
|
-
return
|
|
610
|
+
return As({ ...e, node: r });
|
|
611
611
|
case "feedback":
|
|
612
|
-
return
|
|
612
|
+
return Es({ ...e, node: r });
|
|
613
613
|
default:
|
|
614
614
|
throw new Error(`Unknown node: ${JSON.stringify(r)}`);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
async function
|
|
617
|
+
async function Es({ next: e, node: r }) {
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
|
-
async function
|
|
620
|
+
async function As({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
|
|
621
621
|
var u;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (n && t) {
|
|
@@ -631,24 +631,24 @@ async function Es({ next: e, node: r, talentBankClient: t, submissions: n, flow:
|
|
|
631
631
|
}
|
|
632
632
|
a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
|
|
633
633
|
}
|
|
634
|
-
async function
|
|
634
|
+
async function Is({ next: e, node: r }) {
|
|
635
635
|
e(r.data.targetId);
|
|
636
636
|
}
|
|
637
|
-
async function
|
|
637
|
+
async function Fs({ next: e, node: r, logger: t, submissions: n, context: s }) {
|
|
638
638
|
if (!n) {
|
|
639
639
|
t.error("Submissions not found");
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
642
|
n[r.data.key] = { type: "string", value: he(r.data.value, { submissions: n, context: s }) }, e(r.nextId);
|
|
643
643
|
}
|
|
644
|
-
var
|
|
644
|
+
var Vs = 5e3, Ms = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Ls = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? jn : e.throttles ? Ur : Pn)), Ns = (e, r, t) => {
|
|
645
645
|
let { waitMs: n, throttles: s, maintenance: i } = qn(r == null ? void 0 : r.throttles, t);
|
|
646
646
|
return { key: e, until: Date.now() + n, ...s !== void 0 && { throttles: s }, ...i && { maintenance: i } };
|
|
647
|
-
},
|
|
647
|
+
}, Rs = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && Rs.includes(e.name) ? e : void 0, ur = (e) => {
|
|
648
648
|
let r = $t(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function
|
|
651
|
+
async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: u, applicationRecovery: f, setApplicationRecovery: v, forceSubmitConfirmation: b, flowType: p, run: y, persistWriteBarrier: C, signal: _, onSubmitNetworkError: k, settledOutcomes: E, t: g }) {
|
|
652
652
|
var ee, T;
|
|
653
653
|
let N = async ({ redirect_url: R, message: B, button_text: I }) => {
|
|
654
654
|
let { anonymous_id: F, session_id: j } = o.getSessionInfo();
|
|
@@ -670,17 +670,17 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
670
670
|
let R = (T = u.data.submitRedirects) == null ? void 0 : T[n.id];
|
|
671
671
|
return R ? (await N(R), r(n.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: g("submission_unknown") }), t());
|
|
672
672
|
}
|
|
673
|
-
let V =
|
|
673
|
+
let V = Ms(n.id, u.job), M = 0, O = y.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, K = async (R) => {
|
|
674
674
|
var st, pt, mt, Et, at, l, d, h, w;
|
|
675
675
|
let B = ((st = u.data.submitCooldown) == null ? void 0 : st.key) === V ? u.data.submitCooldown : void 0;
|
|
676
|
-
B && (B.until =
|
|
676
|
+
B && (B.until = Ls(B));
|
|
677
677
|
let I = B == null ? void 0 : B.until;
|
|
678
678
|
(u.data.reviewRequiresSend === !0 && !O || R !== !0 || I !== void 0 && I > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...I !== void 0 && { availableAt: I } } }), O = !1;
|
|
679
679
|
let F;
|
|
680
680
|
if (n.data.captcha) {
|
|
681
681
|
let m = e.captcha, x = !0;
|
|
682
682
|
try {
|
|
683
|
-
F = await
|
|
683
|
+
F = await rs(i, { signal: _, container: (m == null ? void 0 : m.container()) ?? null, theme: m == null ? void 0 : m.theme, onInteractive: () => {
|
|
684
684
|
e.sendMessage({ type: "text", author: "bot", text: g("captcha_check") }).catch(() => {
|
|
685
685
|
}).then(() => {
|
|
686
686
|
x && (m == null || m.reveal(!0));
|
|
@@ -702,7 +702,7 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
702
702
|
return;
|
|
703
703
|
let U, te = setTimeout(() => {
|
|
704
704
|
U = e.sendMessage({ type: "loading", semantic: "submission-still-working", text: g("submission_still_working") }).catch((m) => s.error("Failed to send submission progress message", m));
|
|
705
|
-
},
|
|
705
|
+
}, Vs), X, H = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: j, session_id: L, job: u.job, flow_build: u.build, ...F !== void 0 && { captcha_token: F }, submissions: Vn(u.nodes, Mn(a || {}, n.data.submitKeys)), pre_apply: Pr(u.nodes, a || {}, u.data.flowSessionId) }) }).catch((m) => {
|
|
706
706
|
X = m;
|
|
707
707
|
let x = ur(m);
|
|
708
708
|
return (x == null ? void 0 : x.data) !== void 0 ? x.data : m;
|
|
@@ -727,7 +727,7 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
727
727
|
if ((H == null ? void 0 : H.success) === !0)
|
|
728
728
|
return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: g("submission_completed") }), r(n.nextId);
|
|
729
729
|
let We = Rn(D), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Re = ze === void 0 ? void 0 : u.nodes.find((m) => m.type === "question-file" && m.data.key === ze);
|
|
730
|
-
if (!Re && !Pe && !ar(D) && (u.data.submitCooldown =
|
|
730
|
+
if (!Re && !Pe && !ar(D) && (u.data.submitCooldown = Ns(V, B, D)), (D == null ? void 0 : D.outcome) !== "duplicate" && !je && (u.data.failedAttemptAt = { ...u.data.failedAttemptAt, [V]: Date.now() }, (h = u.data.unconfirmedAttemptKeys) != null && h.includes(V) && (u.data.unconfirmedAttemptKeys = u.data.unconfirmedAttemptKeys.filter((m) => m !== V))), (D == null ? void 0 : D.verdict) === "not_submitted" || (D == null ? void 0 : D.outcome) === "duplicate" || (D == null ? void 0 : D.outcome) === "closed" || je || Tn(H, $e) ? (W || (u.data.startedWriteNodeIds = (w = u.data.startedWriteNodeIds) == null ? void 0 : w.filter((m) => m !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await v(f), await C().catch((m) => s.error("Failed to persist application write barrier release", m))) : await C().catch((m) => s.error("Failed to persist submit cooldown", m)), D) {
|
|
731
731
|
if (s.error(X ?? D.message), Re && ze !== void 0)
|
|
732
732
|
return e.setSubmission(ze, null), await v({ fileQuestionNodeId: Re.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: g("submission_unreadable_document") }), r(Re.id);
|
|
733
733
|
if (D.outcome === "duplicate")
|
|
@@ -735,50 +735,50 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
735
735
|
if (D.outcome === "closed")
|
|
736
736
|
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: g("submission_closed") }), Pe ? (delete u.data.submitCooldown, t()) : K(!1);
|
|
737
737
|
let m = Dn(D);
|
|
738
|
-
return m ? (await e.sendMessage({ type: "system", variant: "warning", text: m.until === void 0 ? g("submission_provider_maintenance_later") : g("submission_provider_maintenance", { time: qr(m.until, void 0) }) }), K(!1)) : D.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: g(On(D) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(D) ? Bn(H) ? (await e.sendMessage({ type: "text", author: "bot", text: D.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: g("captcha_failed") }), M++, K(M <=
|
|
738
|
+
return m ? (await e.sendMessage({ type: "system", variant: "warning", text: m.until === void 0 ? g("submission_provider_maintenance_later") : g("submission_provider_maintenance", { time: qr(m.until, void 0) }) }), K(!1)) : D.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: g(On(D) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(D) ? Bn(H) ? (await e.sendMessage({ type: "text", author: "bot", text: D.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: g("captcha_failed") }), M++, K(M <= ks)) : $n(D) ? (await e.sendMessage({ type: "system", variant: "error", text: g("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: g("submission_failed") }), t());
|
|
739
739
|
}
|
|
740
740
|
return s.error(X ?? H), je ? (await e.sendMessage({ type: "system", variant: "error", text: g("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: g("submission_failed") }), t());
|
|
741
741
|
};
|
|
742
742
|
await K(b === !0 && !O ? !1 : n.data.skipConfirmation);
|
|
743
743
|
}
|
|
744
|
-
async function
|
|
744
|
+
async function Ds({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
745
745
|
await e.sendMessage({ type: "link", href: he(t.data.href, { submissions: n, context: s }), text: he(t.data.cta, { submissions: n, context: s }) }), r(t.nextId);
|
|
746
746
|
}
|
|
747
|
-
async function
|
|
748
|
-
r(
|
|
747
|
+
async function Os({ submissions: e, next: r, node: t, context: n }) {
|
|
748
|
+
r(ws(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
|
|
749
749
|
}
|
|
750
|
-
async function
|
|
750
|
+
async function Bs({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
751
751
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.text, { submissions: n, context: s }) }), r(t.nextId);
|
|
752
752
|
}
|
|
753
|
-
async function
|
|
753
|
+
async function $s({ chat: e, next: r, node: t }) {
|
|
754
754
|
await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
|
|
755
755
|
}
|
|
756
|
-
async function
|
|
756
|
+
async function js({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
|
|
757
757
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
758
758
|
let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
|
|
759
759
|
o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ? In(o.value, a) : o.value }), r(t.nextId);
|
|
760
760
|
}
|
|
761
|
-
async function
|
|
761
|
+
async function Ps({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
762
762
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
763
763
|
let a = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
|
|
764
764
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
|
|
765
765
|
}
|
|
766
|
-
async function
|
|
766
|
+
async function qs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
767
767
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
768
768
|
let a = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
|
|
769
769
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? vt(a.value) : a.value }), r(t.nextId);
|
|
770
770
|
}
|
|
771
|
-
async function
|
|
771
|
+
async function Us({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
772
772
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
773
773
|
let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
|
|
774
774
|
a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
|
|
775
775
|
}
|
|
776
|
-
async function
|
|
776
|
+
async function Ws({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
777
777
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
778
778
|
let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
|
|
779
779
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
|
|
780
780
|
}
|
|
781
|
-
async function
|
|
781
|
+
async function zs({ chat: e, next: r, node: t, t: n }) {
|
|
782
782
|
await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
|
|
783
783
|
let s = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
|
|
784
784
|
if (s === null)
|
|
@@ -789,7 +789,7 @@ async function Ws({ chat: e, next: r, node: t, t: n }) {
|
|
|
789
789
|
}
|
|
790
790
|
return r(t.nextId);
|
|
791
791
|
}
|
|
792
|
-
async function
|
|
792
|
+
async function Hs({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
|
|
793
793
|
await r.sendMessage({ author: "bot", type: "text", text: he(e.data.question, { submissions: n, context: s }) });
|
|
794
794
|
let a = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
|
|
795
795
|
if (a === null)
|
|
@@ -799,12 +799,12 @@ async function zs({ node: e, chat: r, next: t, submissions: n, context: s, t: i
|
|
|
799
799
|
await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
|
|
800
800
|
return t(e.nextId);
|
|
801
801
|
}
|
|
802
|
-
async function
|
|
802
|
+
async function Ks({ chat: e, end: r, node: t }) {
|
|
803
803
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
804
804
|
}
|
|
805
|
-
async function
|
|
805
|
+
async function Gs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: u }) {
|
|
806
806
|
let f = Fn(r.nodes, t || {}), { answers: v, ...b } = f;
|
|
807
|
-
if (n.setSubmission(e.data.key, { type: "integration", value: b }),
|
|
807
|
+
if (n.setSubmission(e.data.key, { type: "integration", value: b }), xs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Pr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
|
|
808
808
|
let p = [f.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : f.hasHardConcerns ? e.data.messages.hard : f.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
|
|
809
809
|
for (let y of ["hard", "advisory"]) {
|
|
810
810
|
let C = v.filter((_) => !_.matched && _.severity === y);
|
|
@@ -832,7 +832,7 @@ const dr = (e, r, t) => {
|
|
|
832
832
|
},
|
|
833
833
|
customProperties: (n = r.analytics) == null ? void 0 : n.customProperties
|
|
834
834
|
});
|
|
835
|
-
}, jt = "resume-prompt",
|
|
835
|
+
}, jt = "resume-prompt", Js = async ({
|
|
836
836
|
chatService: e,
|
|
837
837
|
t: r,
|
|
838
838
|
signal: t
|
|
@@ -903,17 +903,17 @@ function wt(e) {
|
|
|
903
903
|
}
|
|
904
904
|
var Mt;
|
|
905
905
|
// @__NO_SIDE_EFFECTS__
|
|
906
|
-
function
|
|
906
|
+
function Zs(e) {
|
|
907
907
|
return Mt == null ? void 0 : Mt.get(e);
|
|
908
908
|
}
|
|
909
909
|
var Lt;
|
|
910
910
|
// @__NO_SIDE_EFFECTS__
|
|
911
|
-
function
|
|
911
|
+
function Xs(e) {
|
|
912
912
|
return Lt == null ? void 0 : Lt.get(e);
|
|
913
913
|
}
|
|
914
914
|
var Nt;
|
|
915
915
|
// @__NO_SIDE_EFFECTS__
|
|
916
|
-
function
|
|
916
|
+
function Ys(e, r) {
|
|
917
917
|
var t;
|
|
918
918
|
return (t = Nt == null ? void 0 : Nt.get(e)) == null ? void 0 : t.get(r);
|
|
919
919
|
}
|
|
@@ -937,7 +937,7 @@ function re(e, r, t, n, s) {
|
|
|
937
937
|
lang: n.lang,
|
|
938
938
|
abortEarly: n.abortEarly,
|
|
939
939
|
abortPipeEarly: n.abortPipeEarly
|
|
940
|
-
}, f = e.kind === "schema", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */
|
|
940
|
+
}, f = e.kind === "schema", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Ys(e.reference, u.lang) ?? (f ? /* @__PURE__ */ Xs(u.lang) : null) ?? n.message ?? /* @__PURE__ */ Zs(u.lang);
|
|
941
941
|
v !== void 0 && (u.message = typeof v == "function" ? (
|
|
942
942
|
// @ts-expect-error
|
|
943
943
|
v(u)
|
|
@@ -954,16 +954,16 @@ function be(e) {
|
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
956
|
// @__NO_SIDE_EFFECTS__
|
|
957
|
-
function
|
|
957
|
+
function Qs(e, r) {
|
|
958
958
|
return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
959
959
|
}
|
|
960
960
|
// @__NO_SIDE_EFFECTS__
|
|
961
|
-
function
|
|
961
|
+
function ea(e, r) {
|
|
962
962
|
const t = [...new Set(e)];
|
|
963
963
|
return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
|
|
964
964
|
}
|
|
965
965
|
// @__NO_SIDE_EFFECTS__
|
|
966
|
-
function
|
|
966
|
+
function ta(e) {
|
|
967
967
|
if (e.path) {
|
|
968
968
|
let r = "";
|
|
969
969
|
for (const t of e.path)
|
|
@@ -975,7 +975,7 @@ function ea(e) {
|
|
|
975
975
|
}
|
|
976
976
|
return null;
|
|
977
977
|
}
|
|
978
|
-
var
|
|
978
|
+
var ra = class extends Error {
|
|
979
979
|
/**
|
|
980
980
|
* Creates a Valibot error with useful information.
|
|
981
981
|
*
|
|
@@ -984,7 +984,7 @@ var ta = class extends Error {
|
|
|
984
984
|
constructor(e) {
|
|
985
985
|
super(e[0].message), this.name = "ValiError", this.issues = e;
|
|
986
986
|
}
|
|
987
|
-
},
|
|
987
|
+
}, na = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
|
|
988
988
|
// @__NO_SIDE_EFFECTS__
|
|
989
989
|
function Xr(e, r) {
|
|
990
990
|
return {
|
|
@@ -1008,7 +1008,7 @@ function Yr(e) {
|
|
|
1008
1008
|
reference: Yr,
|
|
1009
1009
|
expects: null,
|
|
1010
1010
|
async: !1,
|
|
1011
|
-
requirement:
|
|
1011
|
+
requirement: na,
|
|
1012
1012
|
message: e,
|
|
1013
1013
|
"~run"(r, t) {
|
|
1014
1014
|
return r.typed && !this.requirement.test(r.value) && re(this, "email", r, t), r;
|
|
@@ -1133,7 +1133,7 @@ function tn(e) {
|
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
1135
|
// @__NO_SIDE_EFFECTS__
|
|
1136
|
-
function
|
|
1136
|
+
function sa(e, r, t) {
|
|
1137
1137
|
return typeof e.fallback == "function" ? (
|
|
1138
1138
|
// @ts-expect-error
|
|
1139
1139
|
e.fallback(r, t)
|
|
@@ -1272,7 +1272,7 @@ function ke(e, r) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
f.typed || (t.typed = !1), t.value[a] = f.value;
|
|
1274
1274
|
} else if (o.fallback !== void 0)
|
|
1275
|
-
t.value[a] = /* @__PURE__ */
|
|
1275
|
+
t.value[a] = /* @__PURE__ */ sa(o);
|
|
1276
1276
|
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (re(this, "key", t, n, {
|
|
1277
1277
|
input: void 0,
|
|
1278
1278
|
expected: `"${a}"`,
|
|
@@ -1319,7 +1319,7 @@ function on(e, r) {
|
|
|
1319
1319
|
kind: "schema",
|
|
1320
1320
|
type: "picklist",
|
|
1321
1321
|
reference: on,
|
|
1322
|
-
expects: /* @__PURE__ */
|
|
1322
|
+
expects: /* @__PURE__ */ ea(e.map(Xe), "|"),
|
|
1323
1323
|
async: !1,
|
|
1324
1324
|
options: e,
|
|
1325
1325
|
message: r,
|
|
@@ -1351,7 +1351,7 @@ function ln(e, r, t) {
|
|
|
1351
1351
|
if (i && typeof i == "object") {
|
|
1352
1352
|
n.typed = !0, n.value = {};
|
|
1353
1353
|
for (const u in i)
|
|
1354
|
-
if (/* @__PURE__ */
|
|
1354
|
+
if (/* @__PURE__ */ Qs(i, u)) {
|
|
1355
1355
|
const f = i[u], v = this.key["~run"]({ value: u }, s);
|
|
1356
1356
|
if (v.issues) {
|
|
1357
1357
|
const p = {
|
|
@@ -1412,14 +1412,14 @@ function le(e) {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function aa(e, r, t) {
|
|
1416
1416
|
const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1417
1417
|
if (n.issues)
|
|
1418
|
-
throw new
|
|
1418
|
+
throw new ra(n.issues);
|
|
1419
1419
|
return n.value;
|
|
1420
1420
|
}
|
|
1421
1421
|
// @__NO_SIDE_EFFECTS__
|
|
1422
|
-
function
|
|
1422
|
+
function ia(e, r) {
|
|
1423
1423
|
const t = {};
|
|
1424
1424
|
for (const n in e.entries)
|
|
1425
1425
|
t[n] = !r || r.includes(n) ? /* @__PURE__ */ Je(e.entries[n]) : e.entries[n];
|
|
@@ -1453,7 +1453,7 @@ function Ve(...e) {
|
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
1455
|
// @__NO_SIDE_EFFECTS__
|
|
1456
|
-
function
|
|
1456
|
+
function oa(e, r, t) {
|
|
1457
1457
|
const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1458
1458
|
return {
|
|
1459
1459
|
typed: n.typed,
|
|
@@ -1463,7 +1463,7 @@ function ia(e, r, t) {
|
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
1465
|
// @__NO_SIDE_EFFECTS__
|
|
1466
|
-
async function
|
|
1466
|
+
async function la(e, r, t) {
|
|
1467
1467
|
const n = await e["~run"](
|
|
1468
1468
|
{ value: r },
|
|
1469
1469
|
/* @__PURE__ */ wt(t)
|
|
@@ -1539,7 +1539,12 @@ const tt = ({
|
|
|
1539
1539
|
}), t("skip")]
|
|
1540
1540
|
});
|
|
1541
1541
|
};
|
|
1542
|
-
var Gt = { 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" }
|
|
1542
|
+
var Gt = { 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" }, ca = (e) => {
|
|
1543
|
+
if (e === "")
|
|
1544
|
+
return { countryCode: "", phoneNumber: "" };
|
|
1545
|
+
let r = Object.values(Gt).find((n) => e.startsWith(n)) ?? "", t = e.replace(r, "");
|
|
1546
|
+
return /^\d+$/.test(t) ? { countryCode: r, phoneNumber: t } : { countryCode: "", phoneNumber: "" };
|
|
1547
|
+
};
|
|
1543
1548
|
const Ye = xt("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", {
|
|
1544
1549
|
variants: {
|
|
1545
1550
|
optional: {
|
|
@@ -1550,16 +1555,16 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1550
1555
|
defaultVariants: {
|
|
1551
1556
|
optional: !1
|
|
1552
1557
|
}
|
|
1553
|
-
}),
|
|
1558
|
+
}), ua = "https://api.mapbox.com/search/searchbox/v1/suggest", da = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", fa = (e) => atob(e).split("").reverse().join(""), xe = /* @__PURE__ */ ke({
|
|
1554
1559
|
name: /* @__PURE__ */ le()
|
|
1555
|
-
}),
|
|
1560
|
+
}), ha = /* @__PURE__ */ ke({
|
|
1556
1561
|
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ ke({
|
|
1557
1562
|
feature_type: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1558
1563
|
full_address: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1559
1564
|
place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1560
1565
|
name: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1561
1566
|
mapbox_id: /* @__PURE__ */ le(),
|
|
1562
|
-
context: /* @__PURE__ */
|
|
1567
|
+
context: /* @__PURE__ */ ia(/* @__PURE__ */ ke({
|
|
1563
1568
|
address: xe,
|
|
1564
1569
|
street: xe,
|
|
1565
1570
|
neighborhood: xe,
|
|
@@ -1571,7 +1576,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1571
1576
|
country: xe
|
|
1572
1577
|
}))
|
|
1573
1578
|
}))
|
|
1574
|
-
}),
|
|
1579
|
+
}), pa = ({
|
|
1575
1580
|
logger: e,
|
|
1576
1581
|
t: r
|
|
1577
1582
|
}) => Un(() => {
|
|
@@ -1581,17 +1586,17 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1581
1586
|
enabled: !0,
|
|
1582
1587
|
getPredictions: async (s) => {
|
|
1583
1588
|
var b;
|
|
1584
|
-
const i = new URL(
|
|
1589
|
+
const i = new URL(ua);
|
|
1585
1590
|
i.searchParams.set("q", s), i.searchParams.set("session_token", t);
|
|
1586
1591
|
const a = (b = q.current$.peek().flow) == null ? void 0 : b.locationOrigin;
|
|
1587
|
-
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token",
|
|
1592
|
+
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", fa(da));
|
|
1588
1593
|
const u = await fetch(i);
|
|
1589
1594
|
if (!u.ok)
|
|
1590
1595
|
return e.error("Failed to get address details", u), {
|
|
1591
1596
|
ok: !1,
|
|
1592
1597
|
error: r("address_error")
|
|
1593
1598
|
};
|
|
1594
|
-
const f = /* @__PURE__ */
|
|
1599
|
+
const f = /* @__PURE__ */ oa(ha, await u.json());
|
|
1595
1600
|
if (f.success === !1)
|
|
1596
1601
|
return e.error("Failed to parse address details", f.issues), {
|
|
1597
1602
|
ok: !1,
|
|
@@ -1647,7 +1652,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1647
1652
|
children: r("back")
|
|
1648
1653
|
})]
|
|
1649
1654
|
});
|
|
1650
|
-
},
|
|
1655
|
+
}, ma = ({
|
|
1651
1656
|
input: e,
|
|
1652
1657
|
onSubmitSuccess: r,
|
|
1653
1658
|
logger: t
|
|
@@ -1657,7 +1662,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1657
1662
|
} = ne(), [s, i] = _e(), {
|
|
1658
1663
|
enabled: a,
|
|
1659
1664
|
getPredictions: o
|
|
1660
|
-
} =
|
|
1665
|
+
} = pa({
|
|
1661
1666
|
logger: t,
|
|
1662
1667
|
t: n
|
|
1663
1668
|
}), [u, f] = _e(a ? "query" : "manual"), [v, b] = _e(""), [p, y] = _e(), C = ye(), _ = ye(), k = (g) => {
|
|
@@ -1699,7 +1704,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1699
1704
|
};
|
|
1700
1705
|
switch (u) {
|
|
1701
1706
|
case "query":
|
|
1702
|
-
return Oe(a, "Query state should not be enabled"), c(
|
|
1707
|
+
return Oe(a, "Query state should not be enabled"), c(ya, {
|
|
1703
1708
|
input: e,
|
|
1704
1709
|
onSkip: () => r(null),
|
|
1705
1710
|
onAddressSelect: (g) => {
|
|
@@ -1746,7 +1751,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1746
1751
|
) : void 0
|
|
1747
1752
|
});
|
|
1748
1753
|
}
|
|
1749
|
-
},
|
|
1754
|
+
}, ya = ({
|
|
1750
1755
|
input: e,
|
|
1751
1756
|
onSkip: r,
|
|
1752
1757
|
lookup: t,
|
|
@@ -1978,7 +1983,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1978
1983
|
var r;
|
|
1979
1984
|
(r = e.current) == null || r.focus();
|
|
1980
1985
|
}, []), e;
|
|
1981
|
-
}, cn = ["true", "false"],
|
|
1986
|
+
}, cn = ["true", "false"], ba = /* @__PURE__ */ on(cn), ga = "answer", un = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = zr(({
|
|
1982
1987
|
label: e,
|
|
1983
1988
|
...r
|
|
1984
1989
|
}, t) => c("button", {
|
|
@@ -1989,7 +1994,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1989
1994
|
class: "text-center text-base",
|
|
1990
1995
|
children: e
|
|
1991
1996
|
})
|
|
1992
|
-
})),
|
|
1997
|
+
})), va = ({
|
|
1993
1998
|
input: e,
|
|
1994
1999
|
onSubmitSuccess: r
|
|
1995
2000
|
}) => {
|
|
@@ -1999,7 +2004,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1999
2004
|
class: "",
|
|
2000
2005
|
onSubmit: (n) => {
|
|
2001
2006
|
n.preventDefault();
|
|
2002
|
-
const s = Wn(n).value, i =
|
|
2007
|
+
const s = Wn(n).value, i = aa(ba, s);
|
|
2003
2008
|
r({
|
|
2004
2009
|
type: "boolean",
|
|
2005
2010
|
value: i === "true"
|
|
@@ -2012,7 +2017,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2012
2017
|
children: c(fn, {
|
|
2013
2018
|
ref: s === 0 ? t : null,
|
|
2014
2019
|
type: "submit",
|
|
2015
|
-
name:
|
|
2020
|
+
name: ga,
|
|
2016
2021
|
value: n,
|
|
2017
2022
|
label: e.config.labels[n]
|
|
2018
2023
|
}, n)
|
|
@@ -2026,17 +2031,10 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2026
2031
|
})
|
|
2027
2032
|
})]
|
|
2028
2033
|
});
|
|
2029
|
-
},
|
|
2030
|
-
const n = new FileReader();
|
|
2031
|
-
n.onload = () => {
|
|
2032
|
-
if (typeof n.result != "string" || !n.result)
|
|
2033
|
-
return t(new Error("Invalid file"));
|
|
2034
|
-
r(n.result);
|
|
2035
|
-
}, n.onerror = t, n.readAsDataURL(e);
|
|
2036
|
-
}), pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), va = et("file"), mr = 3, _t = (e) => {
|
|
2034
|
+
}, pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), xa = et("file"), mr = 3, _t = (e) => {
|
|
2037
2035
|
const r = e.lastIndexOf(".");
|
|
2038
2036
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2039
|
-
},
|
|
2037
|
+
}, wa = ({
|
|
2040
2038
|
file: e,
|
|
2041
2039
|
class: r,
|
|
2042
2040
|
...t
|
|
@@ -2072,22 +2070,22 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2072
2070
|
}) => c("li", {
|
|
2073
2071
|
class: Qe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2074
2072
|
...r
|
|
2075
|
-
}),
|
|
2073
|
+
}), _a = (e, r) => {
|
|
2076
2074
|
const [t, n] = _t(e);
|
|
2077
2075
|
return `${t.slice(0, r)}${n}`;
|
|
2078
2076
|
}, br = (e) => ({
|
|
2079
|
-
name:
|
|
2077
|
+
name: _a(e.name, 42),
|
|
2080
2078
|
sizeKb: e.size / 1e3
|
|
2081
|
-
}),
|
|
2082
|
-
const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...
|
|
2079
|
+
}), ka = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], Ca = (e, r, t) => {
|
|
2080
|
+
const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...ka], i = n === "" ? "none" : s.includes(n) ? n : "other";
|
|
2083
2081
|
return `chatbot-file-refused:${e}:${i}`;
|
|
2084
|
-
},
|
|
2082
|
+
}, Sa = ({
|
|
2085
2083
|
input: e,
|
|
2086
2084
|
onSubmitSuccess: r,
|
|
2087
2085
|
analytics: t
|
|
2088
2086
|
}) => {
|
|
2089
2087
|
var k;
|
|
2090
|
-
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = _e(
|
|
2088
|
+
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = _e(xa(n) && n.value.length ? {
|
|
2091
2089
|
status: "ready",
|
|
2092
2090
|
files: n.value
|
|
2093
2091
|
} : {
|
|
@@ -2148,7 +2146,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2148
2146
|
return t.log({
|
|
2149
2147
|
event: "INTERACTION",
|
|
2150
2148
|
properties: {
|
|
2151
|
-
tag:
|
|
2149
|
+
tag: Ca(E, g, e.config.extensions)
|
|
2152
2150
|
},
|
|
2153
2151
|
customProperties: (V = (N = q.current$.peek().flow) == null ? void 0 : N.analytics) == null ? void 0 : V.customProperties
|
|
2154
2152
|
});
|
|
@@ -2282,7 +2280,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2282
2280
|
try {
|
|
2283
2281
|
return {
|
|
2284
2282
|
...br(R),
|
|
2285
|
-
data: await
|
|
2283
|
+
data: await zn(R)
|
|
2286
2284
|
};
|
|
2287
2285
|
} catch (B) {
|
|
2288
2286
|
throw ee ?? (ee = R), B;
|
|
@@ -2325,7 +2323,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2325
2323
|
};
|
|
2326
2324
|
var ft = (e) => e.type === "checkbox", De = (e) => e instanceof Date, oe = (e) => e == null;
|
|
2327
2325
|
const hn = (e) => typeof e == "object";
|
|
2328
|
-
var Z = (e) => !oe(e) && !Array.isArray(e) && hn(e) && !De(e),
|
|
2326
|
+
var Z = (e) => !oe(e) && !Array.isArray(e) && hn(e) && !De(e), Ea = (e) => Z(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, Aa = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ia = (e, r) => e.has(Aa(r)), Fa = (e) => {
|
|
2329
2327
|
const r = e.constructor && e.constructor.prototype;
|
|
2330
2328
|
return Z(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2331
2329
|
}, Zt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -2336,7 +2334,7 @@ function Q(e) {
|
|
|
2336
2334
|
if (Zt && (e instanceof Blob || r))
|
|
2337
2335
|
return e;
|
|
2338
2336
|
const t = Array.isArray(e);
|
|
2339
|
-
if (!t && !(Z(e) &&
|
|
2337
|
+
if (!t && !(Z(e) && Fa(e)))
|
|
2340
2338
|
return e;
|
|
2341
2339
|
const n = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2342
2340
|
for (const s in e)
|
|
@@ -2381,9 +2379,9 @@ const gr = {
|
|
|
2381
2379
|
pattern: "pattern",
|
|
2382
2380
|
required: "required",
|
|
2383
2381
|
validate: "validate"
|
|
2384
|
-
},
|
|
2385
|
-
|
|
2386
|
-
var
|
|
2382
|
+
}, Va = ae.createContext(null);
|
|
2383
|
+
Va.displayName = "HookFormControlContext";
|
|
2384
|
+
var Ma = (e, r, t, n = !0) => {
|
|
2387
2385
|
const s = {
|
|
2388
2386
|
defaultValues: r._defaultValues
|
|
2389
2387
|
};
|
|
@@ -2396,8 +2394,8 @@ var Va = (e, r, t, n = !0) => {
|
|
|
2396
2394
|
});
|
|
2397
2395
|
return s;
|
|
2398
2396
|
};
|
|
2399
|
-
const
|
|
2400
|
-
var ue = (e) => typeof e == "string",
|
|
2397
|
+
const La = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
|
|
2398
|
+
var ue = (e) => typeof e == "string", Na = (e, r, t, n, s) => ue(e) ? (n && r.watch.add(e), S(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), S(t, i))) : (n && (r.watchAll = !0), t), Pt = (e) => oe(e) || !hn(e);
|
|
2401
2399
|
function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2402
2400
|
if (Pt(e) || Pt(r))
|
|
2403
2401
|
return Object.is(e, r);
|
|
@@ -2421,8 +2419,8 @@ function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2421
2419
|
}
|
|
2422
2420
|
return !0;
|
|
2423
2421
|
}
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2422
|
+
const Ra = ae.createContext(null);
|
|
2423
|
+
Ra.displayName = "HookFormContext";
|
|
2426
2424
|
var pn = (e, r, t, n, s) => r ? {
|
|
2427
2425
|
...t[e],
|
|
2428
2426
|
types: {
|
|
@@ -2467,32 +2465,32 @@ var ie = (e) => Z(e) && !Object.keys(e).length, Qt = (e) => e.type === "file", b
|
|
|
2467
2465
|
return !1;
|
|
2468
2466
|
const r = e ? e.ownerDocument : 0;
|
|
2469
2467
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2470
|
-
}, yn = (e) => e.type === "select-multiple", er = (e) => e.type === "radio",
|
|
2471
|
-
function
|
|
2468
|
+
}, yn = (e) => e.type === "select-multiple", er = (e) => e.type === "radio", Ta = (e) => er(e) || ft(e), Tt = (e) => bt(e) && e.isConnected;
|
|
2469
|
+
function Da(e, r) {
|
|
2472
2470
|
const t = r.slice(0, -1).length;
|
|
2473
2471
|
let n = 0;
|
|
2474
2472
|
for (; n < t; )
|
|
2475
2473
|
e = G(e) ? n++ : e[r[n++]];
|
|
2476
2474
|
return e;
|
|
2477
2475
|
}
|
|
2478
|
-
function
|
|
2476
|
+
function Oa(e) {
|
|
2479
2477
|
for (const r in e)
|
|
2480
2478
|
if (e.hasOwnProperty(r) && !G(e[r]))
|
|
2481
2479
|
return !1;
|
|
2482
2480
|
return !0;
|
|
2483
2481
|
}
|
|
2484
2482
|
function J(e, r) {
|
|
2485
|
-
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), n = t.length === 1 ? e :
|
|
2486
|
-
return n && delete n[i], s !== 0 && (Z(n) && ie(n) || Array.isArray(n) &&
|
|
2483
|
+
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), n = t.length === 1 ? e : Da(e, t), s = t.length - 1, i = t[s];
|
|
2484
|
+
return n && delete n[i], s !== 0 && (Z(n) && ie(n) || Array.isArray(n) && Oa(n)) && J(e, t.slice(0, -1)), e;
|
|
2487
2485
|
}
|
|
2488
|
-
var
|
|
2486
|
+
var Ba = (e) => {
|
|
2489
2487
|
for (const r in e)
|
|
2490
2488
|
if (de(e[r]))
|
|
2491
2489
|
return !0;
|
|
2492
2490
|
return !1;
|
|
2493
2491
|
};
|
|
2494
2492
|
function bn(e) {
|
|
2495
|
-
return Array.isArray(e) || Z(e) && !
|
|
2493
|
+
return Array.isArray(e) || Z(e) && !Ba(e);
|
|
2496
2494
|
}
|
|
2497
2495
|
function qt(e, r = {}) {
|
|
2498
2496
|
for (const t in e) {
|
|
@@ -2543,7 +2541,7 @@ function kr(e) {
|
|
|
2543
2541
|
const r = e.ref;
|
|
2544
2542
|
return Qt(r) ? r.files : er(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? gn(e.refs).value : vn(G(r.value) ? e.ref.value : r.value, e);
|
|
2545
2543
|
}
|
|
2546
|
-
var
|
|
2544
|
+
var $a = (e, r, t, n) => {
|
|
2547
2545
|
const s = {};
|
|
2548
2546
|
for (const i of e) {
|
|
2549
2547
|
const a = S(r, i);
|
|
@@ -2563,7 +2561,7 @@ var Ba = (e, r, t, n) => {
|
|
|
2563
2561
|
isOnTouch: e === fe.onTouched
|
|
2564
2562
|
});
|
|
2565
2563
|
const Sr = "AsyncFunction";
|
|
2566
|
-
var
|
|
2564
|
+
var ja = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Sr || Z(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Sr)), Pa = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Er = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
2567
2565
|
const dt = (e, r, t, n) => {
|
|
2568
2566
|
for (const s of t || Object.keys(e)) {
|
|
2569
2567
|
const i = S(e, s);
|
|
@@ -2609,11 +2607,11 @@ function Ar(e, r, t) {
|
|
|
2609
2607
|
name: t
|
|
2610
2608
|
};
|
|
2611
2609
|
}
|
|
2612
|
-
var
|
|
2610
|
+
var qa = (e, r, t, n) => {
|
|
2613
2611
|
t(e);
|
|
2614
2612
|
const { name: s, ...i } = e;
|
|
2615
2613
|
return ie(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
|
|
2616
|
-
},
|
|
2614
|
+
}, Ua = (e, r, t) => !e || !r || e === r || ut(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Wa = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0, za = (e, r) => !Xt(S(e, r)).length && J(e, r), Ha = (e, r, t) => {
|
|
2617
2615
|
const n = ut(S(e, t));
|
|
2618
2616
|
return z(n, "root", r[t]), z(e, t, n), e;
|
|
2619
2617
|
};
|
|
@@ -2709,14 +2707,14 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2709
2707
|
}
|
|
2710
2708
|
return V(!0), M;
|
|
2711
2709
|
};
|
|
2712
|
-
const
|
|
2710
|
+
const Ka = {
|
|
2713
2711
|
mode: fe.onSubmit,
|
|
2714
2712
|
reValidateMode: fe.onChange,
|
|
2715
2713
|
shouldFocusError: !0
|
|
2716
2714
|
};
|
|
2717
|
-
function
|
|
2715
|
+
function Ga(e = {}) {
|
|
2718
2716
|
let r = {
|
|
2719
|
-
...
|
|
2717
|
+
...Ka,
|
|
2720
2718
|
...e
|
|
2721
2719
|
}, t = {
|
|
2722
2720
|
submitCount: 0,
|
|
@@ -2786,7 +2784,7 @@ function Ka(e = {}) {
|
|
|
2786
2784
|
}
|
|
2787
2785
|
if (x && Array.isArray(S(t.errors, l))) {
|
|
2788
2786
|
const A = h(S(t.errors, l), w.argA, w.argB);
|
|
2789
|
-
m && z(t.errors, l, A),
|
|
2787
|
+
m && z(t.errors, l, A), za(t.errors, l);
|
|
2790
2788
|
}
|
|
2791
2789
|
if ((b.touchedFields || p.touchedFields) && x && Array.isArray(S(t.touchedFields, l))) {
|
|
2792
2790
|
const A = h(S(t.touchedFields, l), w.argA, w.argB);
|
|
@@ -2848,7 +2846,7 @@ function Ka(e = {}) {
|
|
|
2848
2846
|
...A
|
|
2849
2847
|
}, y.state.next(A);
|
|
2850
2848
|
}
|
|
2851
|
-
}, ee = async (l) => (E(l, !0), await r.resolver(i, r.context,
|
|
2849
|
+
}, ee = async (l) => (E(l, !0), await r.resolver(i, r.context, $a(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), T = async (l) => {
|
|
2852
2850
|
const { errors: d } = await ee(l);
|
|
2853
2851
|
if (E(l), l)
|
|
2854
2852
|
for (const h of l) {
|
|
@@ -2866,12 +2864,12 @@ function Ka(e = {}) {
|
|
|
2866
2864
|
if (m) {
|
|
2867
2865
|
const { _f: x, ...A } = m;
|
|
2868
2866
|
if (x) {
|
|
2869
|
-
const $ = o.array.has(x.name), P = m._f &&
|
|
2867
|
+
const $ = o.array.has(x.name), P = m._f && ja(m._f);
|
|
2870
2868
|
P && b.validatingFields && E([x.name], !0);
|
|
2871
2869
|
const se = await Fr(m, o.disabled, i, C, r.shouldUseNativeValidation && !d, $);
|
|
2872
2870
|
if (P && b.validatingFields && E([x.name]), se[x.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
|
|
2873
2871
|
break;
|
|
2874
|
-
!d && (S(se, x.name) ? $ ?
|
|
2872
|
+
!d && (S(se, x.name) ? $ ? Ha(t.errors, se, x.name) : z(t.errors, x.name, se[x.name]) : J(t.errors, x.name));
|
|
2875
2873
|
}
|
|
2876
2874
|
!ie(A) && await R(A, d, h);
|
|
2877
2875
|
}
|
|
@@ -2883,7 +2881,7 @@ function Ka(e = {}) {
|
|
|
2883
2881
|
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) && qe(l);
|
|
2884
2882
|
}
|
|
2885
2883
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2886
|
-
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !Fe(rt(), s)), F = (l, d, h) =>
|
|
2884
|
+
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !Fe(rt(), s)), F = (l, d, h) => Na(l, o, {
|
|
2887
2885
|
...a.mount ? i : G(d) ? s : ue(l) ? { [l]: d } : d
|
|
2888
2886
|
}, h, d), j = (l) => Xt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), L = (l, d, h = {}) => {
|
|
2889
2887
|
const w = S(n, l);
|
|
@@ -2931,7 +2929,7 @@ function Ka(e = {}) {
|
|
|
2931
2929
|
}, A = Cr(r.mode), $ = Cr(r.reValidateMode);
|
|
2932
2930
|
if (m) {
|
|
2933
2931
|
let P, se;
|
|
2934
|
-
const Te = d.type ? kr(m._f) :
|
|
2932
|
+
const Te = d.type ? kr(m._f) : Ea(l), Ee = l.type === gr.BLUR || l.type === gr.FOCUS_OUT, _n = !Pa(m._f) && !r.resolver && !S(t.errors, h) && !m._f.deps || Wa(Ee, S(t.touchedFields, h), t.isSubmitted, $, A), At = Er(h, o, Ee);
|
|
2935
2933
|
z(i, h, Te), Ee ? (!d || !d.readOnly) && (m._f.onBlur && m._f.onBlur(l), u && u(0)) : m._f.onChange && m._f.onChange(l);
|
|
2936
2934
|
const It = O(h, Te, Ee), kn = !ie(It) || At;
|
|
2937
2935
|
if (!Ee && y.state.next({
|
|
@@ -3005,7 +3003,7 @@ function Ka(e = {}) {
|
|
|
3005
3003
|
next: (h) => "values" in h && l(F(void 0, d), h)
|
|
3006
3004
|
}) : F(l, d, !0), Se = (l) => y.state.subscribe({
|
|
3007
3005
|
next: (d) => {
|
|
3008
|
-
|
|
3006
|
+
Ua(l.name, d.name, l.exact) && qa(d, l.formState || b, mt, l.reRenderRoot) && l.callback({
|
|
3009
3007
|
values: { ...i },
|
|
3010
3008
|
...t,
|
|
3011
3009
|
...d,
|
|
@@ -3065,7 +3063,7 @@ function Ka(e = {}) {
|
|
|
3065
3063
|
ref: (m) => {
|
|
3066
3064
|
if (m) {
|
|
3067
3065
|
ge(l, d), h = S(n, l);
|
|
3068
|
-
const x = G(m.value) && m.querySelectorAll && m.querySelectorAll("input,select,textarea")[0] || m, A =
|
|
3066
|
+
const x = G(m.value) && m.querySelectorAll && m.querySelectorAll("input,select,textarea")[0] || m, A = Ta(x), $ = h._f.refs || [];
|
|
3069
3067
|
if (A ? $.find((P) => P === x) : x === h._f.ref)
|
|
3070
3068
|
return;
|
|
3071
3069
|
z(n, l, {
|
|
@@ -3082,7 +3080,7 @@ function Ka(e = {}) {
|
|
|
3082
3080
|
}
|
|
3083
3081
|
}), M(l, !1, void 0, x);
|
|
3084
3082
|
} else
|
|
3085
|
-
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(
|
|
3083
|
+
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Ia(o.array, l) && a.action) && o.unMount.add(l);
|
|
3086
3084
|
}
|
|
3087
3085
|
};
|
|
3088
3086
|
}, Ue = () => r.shouldFocusError && dt(n, X, o.mount), ht = (l) => {
|
|
@@ -3305,14 +3303,14 @@ function Ct(e = {}) {
|
|
|
3305
3303
|
formState: n
|
|
3306
3304
|
}, e.defaultValues && !de(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3307
3305
|
else {
|
|
3308
|
-
const { formControl: a, ...o } =
|
|
3306
|
+
const { formControl: a, ...o } = Ga(e);
|
|
3309
3307
|
r.current = {
|
|
3310
3308
|
...o,
|
|
3311
3309
|
formState: n
|
|
3312
3310
|
};
|
|
3313
3311
|
}
|
|
3314
3312
|
const i = r.current.control;
|
|
3315
|
-
return i._options = e,
|
|
3313
|
+
return i._options = e, La(() => {
|
|
3316
3314
|
const a = i._subscribe({
|
|
3317
3315
|
formState: i._proxyFormState,
|
|
3318
3316
|
callback: () => s({ ...i._formState }),
|
|
@@ -3345,46 +3343,46 @@ function Ct(e = {}) {
|
|
|
3345
3343
|
}), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
3346
3344
|
}, [i, e.values]), ae.useEffect(() => {
|
|
3347
3345
|
i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
|
|
3348
|
-
}), r.current.formState = ae.useMemo(() =>
|
|
3346
|
+
}), r.current.formState = ae.useMemo(() => Ma(n, i), [i, n]), r.current;
|
|
3349
3347
|
}
|
|
3350
3348
|
const Vr = (e, r, t) => {
|
|
3351
3349
|
if (e && "reportValidity" in e) {
|
|
3352
3350
|
const n = S(t, r);
|
|
3353
3351
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
3354
3352
|
}
|
|
3355
|
-
},
|
|
3353
|
+
}, Ja = (e, r) => {
|
|
3356
3354
|
for (const t in r.fields) {
|
|
3357
3355
|
const n = r.fields[t];
|
|
3358
3356
|
n && n.ref && "reportValidity" in n.ref ? Vr(n.ref, t, e) : n.refs && n.refs.forEach((s) => Vr(s, t, e));
|
|
3359
3357
|
}
|
|
3360
|
-
},
|
|
3361
|
-
r.shouldUseNativeValidation &&
|
|
3358
|
+
}, Za = (e, r) => {
|
|
3359
|
+
r.shouldUseNativeValidation && Ja(e, r);
|
|
3362
3360
|
const t = {};
|
|
3363
3361
|
for (const n in e) {
|
|
3364
3362
|
const s = S(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3365
|
-
if (
|
|
3363
|
+
if (Xa(r.names || Object.keys(e), n)) {
|
|
3366
3364
|
const a = Object.assign({}, S(t, n));
|
|
3367
3365
|
z(a, "root", i), z(t, n, a);
|
|
3368
3366
|
} else
|
|
3369
3367
|
z(t, n, i);
|
|
3370
3368
|
}
|
|
3371
3369
|
return t;
|
|
3372
|
-
},
|
|
3370
|
+
}, Xa = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3373
3371
|
var St = function(e, r, t) {
|
|
3374
3372
|
return t === void 0 && (t = {}), function(n, s, i) {
|
|
3375
3373
|
try {
|
|
3376
3374
|
var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3377
|
-
return Promise.resolve(/* @__PURE__ */
|
|
3375
|
+
return Promise.resolve(/* @__PURE__ */ la(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3378
3376
|
if (o.issues) {
|
|
3379
3377
|
for (var u = {}; o.issues.length; ) {
|
|
3380
|
-
var f = o.issues[0], v = /* @__PURE__ */
|
|
3378
|
+
var f = o.issues[0], v = /* @__PURE__ */ ta(f);
|
|
3381
3379
|
if (v && (u[v] || (u[v] = { message: f.message, type: f.type }), a)) {
|
|
3382
3380
|
var b = u[v].types, p = b && b[f.type];
|
|
3383
3381
|
u[v] = pn(v, a, u, f.type, p ? [].concat(p, f.message) : f.message);
|
|
3384
3382
|
}
|
|
3385
3383
|
o.issues.shift();
|
|
3386
3384
|
}
|
|
3387
|
-
return { values: {}, errors:
|
|
3385
|
+
return { values: {}, errors: Za(u, i) };
|
|
3388
3386
|
}
|
|
3389
3387
|
return { values: t.raw ? n : o.output, errors: {} };
|
|
3390
3388
|
});
|
|
@@ -3393,7 +3391,7 @@ var St = function(e, r, t) {
|
|
|
3393
3391
|
}
|
|
3394
3392
|
};
|
|
3395
3393
|
};
|
|
3396
|
-
const Mr = 27, Lr = 12, Nr = 10,
|
|
3394
|
+
const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
3397
3395
|
const t = {
|
|
3398
3396
|
min: e.minSelected ?? 0,
|
|
3399
3397
|
max: e.maxSelected ?? e.options.length
|
|
@@ -3405,7 +3403,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3405
3403
|
count: t.min
|
|
3406
3404
|
})))
|
|
3407
3405
|
}));
|
|
3408
|
-
},
|
|
3406
|
+
}, ei = zr(({
|
|
3409
3407
|
option: e,
|
|
3410
3408
|
...r
|
|
3411
3409
|
}, t) => c(Ce, {
|
|
@@ -3428,7 +3426,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3428
3426
|
booleanLike: un
|
|
3429
3427
|
}
|
|
3430
3428
|
}
|
|
3431
|
-
}),
|
|
3429
|
+
}), ti = ({
|
|
3432
3430
|
input: e,
|
|
3433
3431
|
onSubmitSuccess: r
|
|
3434
3432
|
}) => {
|
|
@@ -3443,9 +3441,9 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3443
3441
|
}
|
|
3444
3442
|
} = Ct({
|
|
3445
3443
|
defaultValues: {
|
|
3446
|
-
checked: n ? {} :
|
|
3444
|
+
checked: n ? {} : Ya(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3447
3445
|
},
|
|
3448
|
-
resolver:
|
|
3446
|
+
resolver: Qa(e.config, i)
|
|
3449
3447
|
}), f = Jt();
|
|
3450
3448
|
return s ? c("ul", {
|
|
3451
3449
|
style: {
|
|
@@ -3494,7 +3492,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3494
3492
|
} = a(C);
|
|
3495
3493
|
return c("li", {
|
|
3496
3494
|
class: "relative",
|
|
3497
|
-
children: c(
|
|
3495
|
+
children: c(ei, {
|
|
3498
3496
|
option: p,
|
|
3499
3497
|
autoFocus: y === 0,
|
|
3500
3498
|
ref: (E) => {
|
|
@@ -3527,7 +3525,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3527
3525
|
})
|
|
3528
3526
|
})]
|
|
3529
3527
|
});
|
|
3530
|
-
},
|
|
3528
|
+
}, ri = et("number"), ni = (e, r) => {
|
|
3531
3529
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3532
3530
|
return St(/* @__PURE__ */ ke({
|
|
3533
3531
|
number: /* @__PURE__ */ Ve(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
|
|
@@ -3538,7 +3536,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3538
3536
|
count: s
|
|
3539
3537
|
})))
|
|
3540
3538
|
}));
|
|
3541
|
-
},
|
|
3539
|
+
}, si = ({
|
|
3542
3540
|
input: e,
|
|
3543
3541
|
onSubmitSuccess: r
|
|
3544
3542
|
}) => {
|
|
@@ -3553,9 +3551,9 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3553
3551
|
}
|
|
3554
3552
|
} = Ct({
|
|
3555
3553
|
defaultValues: {
|
|
3556
|
-
number:
|
|
3554
|
+
number: ri(n) ? n.value : t ? Number(t) : void 0
|
|
3557
3555
|
},
|
|
3558
|
-
resolver:
|
|
3556
|
+
resolver: ni(e.config, s)
|
|
3559
3557
|
}), {
|
|
3560
3558
|
ref: u,
|
|
3561
3559
|
...f
|
|
@@ -3604,20 +3602,6 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3604
3602
|
error: o.number
|
|
3605
3603
|
})]
|
|
3606
3604
|
});
|
|
3607
|
-
}, si = (e) => {
|
|
3608
|
-
if (e === "")
|
|
3609
|
-
return {
|
|
3610
|
-
countryCode: "",
|
|
3611
|
-
phoneNumber: ""
|
|
3612
|
-
};
|
|
3613
|
-
const r = Object.entries(Gt).find((s) => e.startsWith(s[1])), t = r ? r[1] : "", n = e.replace(t, "");
|
|
3614
|
-
return /^\d+$/.test(n) ? {
|
|
3615
|
-
countryCode: t,
|
|
3616
|
-
phoneNumber: n
|
|
3617
|
-
} : {
|
|
3618
|
-
countryCode: "",
|
|
3619
|
-
phoneNumber: ""
|
|
3620
|
-
};
|
|
3621
3605
|
}, ai = "44", ii = /^[0-9 ]+$/, oi = et("string"), li = et("phone"), ci = (e) => {
|
|
3622
3606
|
const r = /* @__PURE__ */ Ve(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(ii, e("validation_country_code"))), t = /* @__PURE__ */ Ve(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((n) => n.replace(/[^0-9]/g, "")));
|
|
3623
3607
|
return St(/* @__PURE__ */ ke({
|
|
@@ -3631,7 +3615,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3631
3615
|
var _;
|
|
3632
3616
|
const t = e.key ? (_ = q.current$.value.flow) == null ? void 0 : _.data.submissions[e.key] : void 0, {
|
|
3633
3617
|
t: n
|
|
3634
|
-
} = ne(), [s, i] = _e(), a = oi(t) ?
|
|
3618
|
+
} = ne(), [s, i] = _e(), a = oi(t) ? ca(t.value) : li(t) ? t.value : void 0, {
|
|
3635
3619
|
register: o,
|
|
3636
3620
|
handleSubmit: u,
|
|
3637
3621
|
formState: {
|
|
@@ -3927,12 +3911,12 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3927
3911
|
}, bi = {
|
|
3928
3912
|
text: yi,
|
|
3929
3913
|
phone: ui,
|
|
3930
|
-
"multiple-choice":
|
|
3931
|
-
boolean:
|
|
3932
|
-
file:
|
|
3914
|
+
"multiple-choice": ti,
|
|
3915
|
+
boolean: va,
|
|
3916
|
+
file: Sa,
|
|
3933
3917
|
submit: di,
|
|
3934
|
-
address:
|
|
3935
|
-
number:
|
|
3918
|
+
address: ma,
|
|
3919
|
+
number: si
|
|
3936
3920
|
}, gi = ({
|
|
3937
3921
|
logger: e,
|
|
3938
3922
|
analytics: r
|
|
@@ -4136,7 +4120,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4136
4120
|
children: c("li", {
|
|
4137
4121
|
class: "flex",
|
|
4138
4122
|
tabIndex: a === n.length - 1 ? -1 : void 0,
|
|
4139
|
-
children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null,
|
|
4123
|
+
children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, Hn(i).with({
|
|
4140
4124
|
type: "system"
|
|
4141
4125
|
}, (o) => c("p", {
|
|
4142
4126
|
class: Oi({
|
|
@@ -4145,7 +4129,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4145
4129
|
children: o.text
|
|
4146
4130
|
})).with({
|
|
4147
4131
|
type: "text",
|
|
4148
|
-
author:
|
|
4132
|
+
author: Kn.union("bot", "user")
|
|
4149
4133
|
}, (o) => {
|
|
4150
4134
|
const u = a === n.length - 1, f = o.author === "bot" ? Mi(o.text) : o.text;
|
|
4151
4135
|
return c(Ce, {
|
|
@@ -4169,7 +4153,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4169
4153
|
}
|
|
4170
4154
|
})).with({
|
|
4171
4155
|
type: "file"
|
|
4172
|
-
}, (o) => c(
|
|
4156
|
+
}, (o) => c(wa, {
|
|
4173
4157
|
class: o.author === "bot" ? void 0 : "ml-auto",
|
|
4174
4158
|
file: {
|
|
4175
4159
|
name: o.fileName,
|
|
@@ -4216,7 +4200,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4216
4200
|
const i = q.viewState$.value, {
|
|
4217
4201
|
chatRef: a,
|
|
4218
4202
|
chatService: o
|
|
4219
|
-
} =
|
|
4203
|
+
} = Gn(), {
|
|
4220
4204
|
t: u
|
|
4221
4205
|
} = ne(), [f, v] = _e();
|
|
4222
4206
|
return Me(() => {
|
|
@@ -4241,7 +4225,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4241
4225
|
interpret: _,
|
|
4242
4226
|
abort: k,
|
|
4243
4227
|
undo: E
|
|
4244
|
-
} =
|
|
4228
|
+
} = Cs({
|
|
4245
4229
|
context: s.context,
|
|
4246
4230
|
analytics: {
|
|
4247
4231
|
service: t,
|
|
@@ -4284,11 +4268,11 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4284
4268
|
}), g = y, N = () => {
|
|
4285
4269
|
v(() => E), _(g);
|
|
4286
4270
|
}, V = new AbortController();
|
|
4287
|
-
return p.offerResume ?
|
|
4271
|
+
return p.offerResume ? Js({
|
|
4288
4272
|
chatService: o,
|
|
4289
4273
|
t: u,
|
|
4290
4274
|
signal: V.signal
|
|
4291
|
-
}).then((O) => (q.settleResume(p), O ? N() : (q.restart(),
|
|
4275
|
+
}).then((O) => (q.settleResume(p), O ? N() : (q.restart(), Jn.flushStateData()))).catch((O) => {
|
|
4292
4276
|
O instanceof jr || e.error("Resume prompt failed", O);
|
|
4293
4277
|
}) : N(), () => {
|
|
4294
4278
|
V.abort(), ce.onInteractionFn$.value === C && (ce.onInteractionFn$.value = () => {
|
|
@@ -4322,7 +4306,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4322
4306
|
preventScroll: !0
|
|
4323
4307
|
});
|
|
4324
4308
|
},
|
|
4325
|
-
children: c(
|
|
4309
|
+
children: c(Zn, {})
|
|
4326
4310
|
})
|
|
4327
4311
|
})]
|
|
4328
4312
|
}), c(gi, {
|