@inploi/plugin-chatbot 14.16.0 → 14.17.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.
- package/cdn/index.js +4 -4
- package/dist/{chatbot-body-1d399b73.cjs → chatbot-body-126a69ce.cjs} +2 -2
- package/dist/{chatbot-body-c30b12cc.js → chatbot-body-493e57db.js} +429 -426
- package/dist/chatbot.d.ts +2 -0
- package/dist/chatbot.state.d.ts +2 -1
- package/dist/i18n.d.ts +6 -0
- package/dist/index-9976f9fd.cjs +5 -0
- package/dist/{index-cea8111c.js → index-eeb96c22.js} +96 -92
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +3 -3
- package/dist/index-2b9b0c8e.cjs +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ss = Object.defineProperty;
|
|
2
2
|
var As = (e, r, t) => r in e ? Ss(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var Y = (e, r, t) => (As(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
-
import { p as $r, f as vt, L as Tt, m as Ge, v as Br, O as Pr, l as Is, I as Es, C as Fs, j as qr, P as Vs, u as Ms, y as Ls, w as Rs, F as Ns, V as sr, W as nr, A as Ds, k as ar, b as Ts, x as Os, h as Ur, E as js, S as $s, R as Bs, Q as Ps, J as Wr, Z as qs, _ as Us, s as q, a as re, o as l, c as Qe, d as xt, e as ke, g as ye, i as Oe, n as Le, q as be, r as Ut, t as Ws, z as zr, B as Hr, D as zs, G as Hs, H as et, K as ir, M as ae, N as ce, T as Ks, U as Gs, X as Js, Y as Zs, $ as Xs, a0 as Kr, a1 as Ys } from "./index-
|
|
4
|
+
import { p as $r, f as vt, L as Tt, m as Ge, v as Br, O as Pr, l as Is, I as Es, C as Fs, j as qr, P as Vs, u as Ms, y as Ls, w as Rs, F as Ns, V as sr, W as nr, A as Ds, k as ar, b as Ts, x as Os, h as Ur, E as js, S as $s, R as Bs, Q as Ps, J as Wr, Z as qs, _ as Us, s as q, a as re, o as l, c as Qe, d as xt, e as ke, g as ye, i as Oe, n as Le, q as be, r as Ut, t as Ws, z as zr, B as Hr, D as zs, G as Hs, H as et, K as ir, M as ae, N as ce, T as Ks, U as Gs, X as Js, Y as Zs, $ as Xs, a0 as Kr, a1 as Ys } from "./index-eeb96c22.js";
|
|
5
5
|
import { saveClosedRoleJobAlerts as Qs } from "@inploi/sdk";
|
|
6
6
|
var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/index.html`, tn = new URL(Gr).origin, or = 3e4, rn = 5 * 6e4, sn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), nn = (e) => {
|
|
7
7
|
let r = Ft.get(e);
|
|
@@ -12,10 +12,10 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
12
12
|
throw Ft.delete(e), t;
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
14
|
}, an = (e, r = {}) => new Promise((t, s) => {
|
|
15
|
-
let { signal: n, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r,
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
}, g = (w) =>
|
|
15
|
+
let { signal: n, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, u = !1, f = () => {
|
|
16
|
+
}, h = (w) => {
|
|
17
|
+
u || (u = !0, clearTimeout(b), n == null || n.removeEventListener("abort", m), f(), w());
|
|
18
|
+
}, g = (w) => h(() => s(new Error(w))), m = () => g("Captcha aborted"), b, k = (w) => {
|
|
19
19
|
clearTimeout(b), b = setTimeout(() => g("Captcha timed out"), w);
|
|
20
20
|
};
|
|
21
21
|
if (k(or), n == null ? void 0 : n.aborted)
|
|
@@ -23,8 +23,8 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
23
23
|
n == null || n.addEventListener("abort", m), (async () => {
|
|
24
24
|
let w = await nn(e);
|
|
25
25
|
if (w === void 0)
|
|
26
|
-
return
|
|
27
|
-
if (
|
|
26
|
+
return h(() => t(void 0));
|
|
27
|
+
if (u)
|
|
28
28
|
return;
|
|
29
29
|
let C = document.createElement("iframe");
|
|
30
30
|
C.src = `${Gr}?${new URLSearchParams({ sitekey: w, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
|
|
@@ -34,7 +34,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
34
34
|
let V = R.data;
|
|
35
35
|
switch (V.type) {
|
|
36
36
|
case "token":
|
|
37
|
-
return
|
|
37
|
+
return h(() => t(V.token));
|
|
38
38
|
case "resize":
|
|
39
39
|
C.style.height = `${Math.max(0, Math.ceil(V.height))}px`;
|
|
40
40
|
return;
|
|
@@ -54,7 +54,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
54
54
|
window.addEventListener("message", v), f = () => {
|
|
55
55
|
window.removeEventListener("message", v), C.remove();
|
|
56
56
|
};
|
|
57
|
-
})().catch((w) =>
|
|
57
|
+
})().catch((w) => h(() => s(w)));
|
|
58
58
|
}), lr = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
59
59
|
let [n, ...i] = e.compareKey.split(".");
|
|
60
60
|
if (!n)
|
|
@@ -80,16 +80,16 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
80
80
|
case "integration": {
|
|
81
81
|
if (typeof a.value != "object" || Array.isArray(a.value))
|
|
82
82
|
return !1;
|
|
83
|
-
let o = Tt(a.value, i),
|
|
83
|
+
let o = Tt(a.value, i), u = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
84
84
|
switch (typeof o) {
|
|
85
85
|
case "boolean":
|
|
86
|
-
return lt(
|
|
86
|
+
return lt(u, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
87
87
|
case "string":
|
|
88
|
-
return lt(
|
|
88
|
+
return lt(u, { submissions: { _temp: { value: o, type: "string" } }, context: r });
|
|
89
89
|
case "number":
|
|
90
|
-
return lt(
|
|
90
|
+
return lt(u, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
91
91
|
case "object":
|
|
92
|
-
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(
|
|
92
|
+
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(u, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
93
93
|
}
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
@@ -167,27 +167,27 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
167
167
|
return !0;
|
|
168
168
|
}
|
|
169
169
|
}, on = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ln = (e, { context: r, submissions: t }) => e.replace(on, (s, n, i = "") => {
|
|
170
|
-
let [a, ...o] = n.trim().split("."),
|
|
171
|
-
if (!
|
|
170
|
+
let [a, ...o] = n.trim().split("."), u = $r({ key: a, path: o, submissions: t, context: r });
|
|
171
|
+
if (!u)
|
|
172
172
|
return i;
|
|
173
|
-
switch (
|
|
173
|
+
switch (u.type) {
|
|
174
174
|
case "boolean":
|
|
175
|
-
return
|
|
175
|
+
return u.value === !0 ? "true" : "false";
|
|
176
176
|
case "file":
|
|
177
|
-
return
|
|
177
|
+
return u.value.map((f) => `${f.name} (${Ge(f.sizeKb)})`).join(", ");
|
|
178
178
|
case "enum":
|
|
179
|
-
return
|
|
179
|
+
return u.value.join(", ");
|
|
180
180
|
case "address":
|
|
181
|
-
return Object.values(
|
|
181
|
+
return Object.values(u.value).filter((f) => f && f.trim().length > 0).join(", ");
|
|
182
182
|
case "number":
|
|
183
183
|
case "string":
|
|
184
|
-
return
|
|
184
|
+
return u.value ? u.value.toString() : i;
|
|
185
185
|
case "phone":
|
|
186
|
-
return vt(
|
|
186
|
+
return vt(u.value);
|
|
187
187
|
case "integration": {
|
|
188
|
-
if (typeof
|
|
188
|
+
if (typeof u.value != "object" || Array.isArray(u.value))
|
|
189
189
|
break;
|
|
190
|
-
let f = Tt(
|
|
190
|
+
let f = Tt(u.value, o);
|
|
191
191
|
switch (typeof f) {
|
|
192
192
|
case "boolean":
|
|
193
193
|
return f === !0 ? "true" : "false";
|
|
@@ -196,7 +196,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
196
196
|
case "number":
|
|
197
197
|
return f.toString();
|
|
198
198
|
case "object":
|
|
199
|
-
if (Array.isArray(f) && f.every((
|
|
199
|
+
if (Array.isArray(f) && f.every((h) => typeof h == "string"))
|
|
200
200
|
return f.join(", ");
|
|
201
201
|
}
|
|
202
202
|
break;
|
|
@@ -211,8 +211,8 @@ function cn(e) {
|
|
|
211
211
|
function Wt(e, r, t = "") {
|
|
212
212
|
const s = cn(e), n = e == null ? void 0 : e.length, i = r !== void 0;
|
|
213
213
|
if (!s || i && n !== r) {
|
|
214
|
-
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "",
|
|
215
|
-
throw new Error(a + "expected Uint8Array" + o + ", got " +
|
|
214
|
+
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", u = s ? `length=${n}` : `type=${typeof e}`;
|
|
215
|
+
throw new Error(a + "expected Uint8Array" + o + ", got " + u);
|
|
216
216
|
}
|
|
217
217
|
return e;
|
|
218
218
|
}
|
|
@@ -284,9 +284,9 @@ class gn {
|
|
|
284
284
|
for (let a = 0; a < i; ) {
|
|
285
285
|
const o = Math.min(n - this.pos, i - a);
|
|
286
286
|
if (o === n) {
|
|
287
|
-
const
|
|
287
|
+
const u = Vt(r);
|
|
288
288
|
for (; n <= i - a; a += n)
|
|
289
|
-
this.process(
|
|
289
|
+
this.process(u, a);
|
|
290
290
|
continue;
|
|
291
291
|
}
|
|
292
292
|
s.set(r.subarray(a, a + o), this.pos), this.pos += o, a += o, this.pos === n && (this.process(t, 0), this.pos = 0);
|
|
@@ -301,14 +301,14 @@ class gn {
|
|
|
301
301
|
for (let g = a; g < n; g++)
|
|
302
302
|
t[g] = 0;
|
|
303
303
|
s.setBigUint64(n - 8, BigInt(this.length * 8), i), this.process(s, 0);
|
|
304
|
-
const o = Vt(r),
|
|
305
|
-
if (
|
|
304
|
+
const o = Vt(r), u = this.outputLen;
|
|
305
|
+
if (u % 4)
|
|
306
306
|
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
307
|
-
const f =
|
|
308
|
-
if (f >
|
|
307
|
+
const f = u / 4, h = this.get();
|
|
308
|
+
if (f > h.length)
|
|
309
309
|
throw new Error("_sha2: outputLen bigger than state");
|
|
310
310
|
for (let g = 0; g < f; g++)
|
|
311
|
-
o.setUint32(4 * g,
|
|
311
|
+
o.setUint32(4 * g, h[g], i);
|
|
312
312
|
}
|
|
313
313
|
digest() {
|
|
314
314
|
const { buffer: r, outputLen: t } = this;
|
|
@@ -405,12 +405,12 @@ class xn extends gn {
|
|
|
405
405
|
super(64, r, 8, !1);
|
|
406
406
|
}
|
|
407
407
|
get() {
|
|
408
|
-
const { A: r, B: t, C: s, D: n, E: i, F: a, G: o, H:
|
|
409
|
-
return [r, t, s, n, i, a, o,
|
|
408
|
+
const { A: r, B: t, C: s, D: n, E: i, F: a, G: o, H: u } = this;
|
|
409
|
+
return [r, t, s, n, i, a, o, u];
|
|
410
410
|
}
|
|
411
411
|
// prettier-ignore
|
|
412
|
-
set(r, t, s, n, i, a, o,
|
|
413
|
-
this.A = r | 0, this.B = t | 0, this.C = s | 0, this.D = n | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H =
|
|
412
|
+
set(r, t, s, n, i, a, o, u) {
|
|
413
|
+
this.A = r | 0, this.B = t | 0, this.C = s | 0, this.D = n | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = u | 0;
|
|
414
414
|
}
|
|
415
415
|
process(r, t) {
|
|
416
416
|
for (let g = 0; g < 16; g++, t += 4)
|
|
@@ -419,12 +419,12 @@ class xn extends gn {
|
|
|
419
419
|
const m = Fe[g - 15], b = Fe[g - 2], k = pe(m, 7) ^ pe(m, 18) ^ m >>> 3, w = pe(b, 17) ^ pe(b, 19) ^ b >>> 10;
|
|
420
420
|
Fe[g] = w + Fe[g - 7] + k + Fe[g - 16] | 0;
|
|
421
421
|
}
|
|
422
|
-
let { A: s, B: n, C: i, D: a, E: o, F:
|
|
422
|
+
let { A: s, B: n, C: i, D: a, E: o, F: u, G: f, H: h } = this;
|
|
423
423
|
for (let g = 0; g < 64; g++) {
|
|
424
|
-
const m = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), b =
|
|
425
|
-
|
|
424
|
+
const m = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), b = h + m + yn(o, u, f) + vn[g] + Fe[g] | 0, w = (pe(s, 2) ^ pe(s, 13) ^ pe(s, 22)) + bn(s, n, i) | 0;
|
|
425
|
+
h = f, f = u, u = o, o = a + b | 0, a = i, i = n, n = s, s = b + w | 0;
|
|
426
426
|
}
|
|
427
|
-
s = s + this.A | 0, n = n + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0,
|
|
427
|
+
s = s + this.A | 0, n = n + 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, h = h + this.H | 0, this.set(s, n, i, a, o, u, f, h);
|
|
428
428
|
}
|
|
429
429
|
roundClean() {
|
|
430
430
|
Ot(Fe);
|
|
@@ -470,12 +470,12 @@ function Cn(e, r, t, s) {
|
|
|
470
470
|
if (a.includes(i))
|
|
471
471
|
return;
|
|
472
472
|
a.push(i);
|
|
473
|
-
let o = new AbortController(),
|
|
473
|
+
let o = new AbortController(), u = setTimeout(() => o.abort(), 5e3);
|
|
474
474
|
r.fetch("/flow/pre-apply", { method: "POST", signal: o.signal, body: JSON.stringify(t) }).catch(() => {
|
|
475
475
|
let f = a.indexOf(i);
|
|
476
476
|
f !== -1 && a.splice(f, 1);
|
|
477
477
|
}).finally(() => {
|
|
478
|
-
clearTimeout(
|
|
478
|
+
clearTimeout(u);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
var Zr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ln(e, Zr(r)), Sn = (e, r) => lt(e, Zr(r)), Xr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
@@ -496,7 +496,7 @@ var Zr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((s) => s.id === t.nextId);
|
|
499
|
-
}, In = 3, En = ({ flow: e, analytics: r, logger: t, talentBankClient: s, context: n, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery:
|
|
499
|
+
}, In = 3, En = ({ flow: e, analytics: r, logger: t, talentBankClient: s, context: n, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier: h, onSubmitNetworkError: g, closedRoleBehaviour: m, settledOutcomes: b = m, dateEchoLocale: k, onFlowEnd: w, onInterpret: C, forceSubmitConfirmation: A, flowType: v, t: R }) => {
|
|
500
500
|
var V;
|
|
501
501
|
let M = new AbortController(), ee = { submitAccepted: !1 };
|
|
502
502
|
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((N) => {
|
|
@@ -521,11 +521,11 @@ var Zr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
521
521
|
await Fn({ flow: e, analytics: K, logger: t, talentBankClient: s, apiClient: i, context: n, node: N, submissions: E, applicationRecovery: F, setApplicationRecovery: async (L) => {
|
|
522
522
|
if (!j.aborted)
|
|
523
523
|
try {
|
|
524
|
-
await
|
|
524
|
+
await u(L);
|
|
525
525
|
} catch (W) {
|
|
526
526
|
t.error("Failed to persist application recovery", W);
|
|
527
527
|
}
|
|
528
|
-
}, forceSubmitConfirmation: A || (F == null ? void 0 : F.submitNodeId) === N.id, run: ee, persistWriteBarrier:
|
|
528
|
+
}, forceSubmitConfirmation: A || (F == null ? void 0 : F.submitNodeId) === N.id, run: ee, persistWriteBarrier: h, onSubmitNetworkError: g, settledOutcomes: b, dateEchoLocale: k, flowType: v, signal: j, t: R, chat: { sendMessage: async (L) => f.send({ groupId: N.id, message: L, signal: j }), userInput: async (L) => f.input({ input: L, signal: j }), setSubmission: (L, W) => {
|
|
529
529
|
j.aborted || f.setSubmission(L, W);
|
|
530
530
|
}, captcha: f.captcha }, next: (L) => {
|
|
531
531
|
if (j.aborted)
|
|
@@ -618,15 +618,15 @@ async function Vn({ next: e, node: r }) {
|
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
620
|
async function Mn({ next: e, node: r, talentBankClient: t, submissions: s, flow: n, logger: i, chat: a }) {
|
|
621
|
-
var
|
|
621
|
+
var u;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (s && t) {
|
|
624
|
-
let f = r.data.scope === "job" ? (
|
|
624
|
+
let f = r.data.scope === "job" ? (u = n.job) == null ? void 0 : u.id : void 0;
|
|
625
625
|
if (r.data.scope === "company" || f != null)
|
|
626
626
|
try {
|
|
627
627
|
o = await t.checkDuplicate({ email: Is({ key: r.data.email, submissions: s }).toString(), jobId: f, scope: r.data.scope });
|
|
628
|
-
} catch (
|
|
629
|
-
i.error("[check-duplicate]",
|
|
628
|
+
} catch (h) {
|
|
629
|
+
i.error("[check-duplicate]", h);
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
|
|
@@ -648,7 +648,7 @@ var Nn = 5e3, Dn = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Tn = (e, r = D
|
|
|
648
648
|
let r = $t(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i, submissions: a, analytics: o, flow:
|
|
651
|
+
async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i, submissions: a, analytics: o, flow: u, applicationRecovery: f, setApplicationRecovery: h, forceSubmitConfirmation: g, flowType: m, run: b, persistWriteBarrier: k, signal: w, onSubmitNetworkError: C, settledOutcomes: A, t: v }) {
|
|
652
652
|
var T, N;
|
|
653
653
|
let R = async ({ redirect_url: D, message: j, button_text: E }) => {
|
|
654
654
|
let { anonymous_id: F, session_id: B } = o.getSessionInfo();
|
|
@@ -660,22 +660,22 @@ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i,
|
|
|
660
660
|
n.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
|
-
o.log({ event: "FLOW_REDIRECT", properties: { flow_build:
|
|
663
|
+
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id: B, flow_version: u.version, href: L.toString(), job: u.job } });
|
|
664
664
|
} });
|
|
665
665
|
} catch (L) {
|
|
666
666
|
n.error(`Invalid redirect URL: ${D}`, L), e.sendMessage({ type: "system", variant: "error", text: v("redirect_url_error") });
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
if ((T =
|
|
670
|
-
let D = (N =
|
|
669
|
+
if ((T = u.data.startedWriteNodeIds) != null && T.includes(s.id) && (f == null ? void 0 : f.submitNodeId) !== s.id) {
|
|
670
|
+
let D = (N = u.data.submitRedirects) == null ? void 0 : N[s.id];
|
|
671
671
|
return D ? (await R(D), r(s.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: v("submission_unknown") }), t());
|
|
672
672
|
}
|
|
673
|
-
let V = Dn(s.id,
|
|
674
|
-
var nt, pt, mt, At, at,
|
|
675
|
-
let j = ((nt =
|
|
673
|
+
let V = Dn(s.id, u.job), M = 0, ee = b.submitAccepted && s.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== s.id, K = async (D) => {
|
|
674
|
+
var nt, pt, mt, At, at, c, d, p, _;
|
|
675
|
+
let j = ((nt = u.data.submitCooldown) == null ? void 0 : nt.key) === V ? u.data.submitCooldown : void 0;
|
|
676
676
|
j && (j.until = Tn(j));
|
|
677
677
|
let E = j == null ? void 0 : j.until;
|
|
678
|
-
(
|
|
678
|
+
(u.data.reviewRequiresSend === !0 && !ee || D !== !0 || E !== void 0 && E > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: s.data.submitLabel, ...E !== void 0 && { availableAt: E } } }), ee = !1;
|
|
679
679
|
let F;
|
|
680
680
|
if (s.data.captcha) {
|
|
681
681
|
let y = e.captcha, x = !0;
|
|
@@ -697,12 +697,12 @@ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i,
|
|
|
697
697
|
let { anonymous_id: B, session_id: L } = o.getSessionInfo();
|
|
698
698
|
if (w.aborted)
|
|
699
699
|
return;
|
|
700
|
-
let W = ((pt =
|
|
701
|
-
if ((f == null ? void 0 : f.submitNodeId) === s.id && await
|
|
700
|
+
let W = ((pt = u.data.startedWriteNodeIds) == null ? void 0 : pt.includes(s.id)) === !0;
|
|
701
|
+
if ((f == null ? void 0 : f.submitNodeId) === s.id && await h(void 0), W || (u.data.startedWriteNodeIds = [...u.data.startedWriteNodeIds ?? [], s.id]), await k().catch((y) => n.error("Failed to persist application write barrier", y)), w.aborted)
|
|
702
702
|
return;
|
|
703
703
|
let U, te = setTimeout(() => {
|
|
704
704
|
U = e.sendMessage({ type: "loading", semantic: "submission-still-working", text: v("submission_still_working") }).catch((y) => n.error("Failed to send submission progress message", y));
|
|
705
|
-
}, Nn), X, z = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: s.data.integrationId, anonymous_id: B, session_id: L, job:
|
|
705
|
+
}, Nn), X, z = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: s.data.integrationId, anonymous_id: B, session_id: L, job: u.job, flow_build: u.build, ...F !== void 0 && { captcha_token: F }, submissions: Vs(u.nodes, Ms(a || {}, s.data.submitKeys)), pre_apply: qr(u.nodes, a || {}, u.data.flowSessionId) }) }).catch((y) => {
|
|
706
706
|
X = y;
|
|
707
707
|
let x = ur(y);
|
|
708
708
|
return (x == null ? void 0 : x.data) !== void 0 ? x.data : y;
|
|
@@ -711,29 +711,29 @@ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i,
|
|
|
711
711
|
return;
|
|
712
712
|
if (X !== void 0 && !$t(X) && C)
|
|
713
713
|
return await C(X, w), K(!0);
|
|
714
|
-
|
|
715
|
-
let rt = (mt = ur(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, O = Br(z, $e), Be = O === void 0 && $e === 429, Pe = A === "terminal" && ((O == null ? void 0 : O.outcome) === "closed" || (O == null ? void 0 : O.outcome) === "duplicate"), Ae =
|
|
714
|
+
u.data.stagingDestination = Ls(z), s.data.key && e.setSubmission(s.data.key, { type: "integration", value: z });
|
|
715
|
+
let rt = (mt = ur(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, O = Br(z, $e), Be = O === void 0 && $e === 429, Pe = A === "terminal" && ((O == null ? void 0 : O.outcome) === "closed" || (O == null ? void 0 : O.outcome) === "duplicate"), Ae = u.data.failedAttemptAt, Re = Ae == null ? void 0 : Ae[V];
|
|
716
716
|
Ae && Re !== void 0 && Re > Date.now() && (Re = Ae[V] = Date.now());
|
|
717
|
-
let qe = Re !== void 0 && Date.now() - Re < Rs || ((At =
|
|
718
|
-
ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id:
|
|
717
|
+
let qe = Re !== void 0 && Date.now() - Re < Rs || ((At = u.data.unconfirmedAttemptKeys) == null ? void 0 : At.includes(V)) === !0, st = (at = $t(X)) == null ? void 0 : at.status, ve = Ns(z, typeof st == "number" ? st : void 0);
|
|
718
|
+
ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: u.id, flow_version: u.version, flow_session_id: u.data.flowSessionId, flow_build: u.build, service: ve.service, response: ve.response, captured: (z == null ? void 0 : z.captured) === !0, flow_type: (m == null ? void 0 : m()) ?? "CHATBOT_DRAWER", job: u.job, ...(O == null ? void 0 : O.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ve.outcome && { outcome: ve.outcome } } });
|
|
719
719
|
let Ue = sr(z) || (z == null ? void 0 : z.success) === !0;
|
|
720
|
-
if ((Ue || nr(z)) && (b.submitAccepted = !0), Ue && ((
|
|
720
|
+
if ((Ue || nr(z)) && (b.submitAccepted = !0), Ue && ((c = u.data.submitCooldown) == null ? void 0 : c.throttles) !== void 0 && (delete u.data.submitCooldown.throttles, await k().catch((y) => n.error("Failed to persist submit cooldown reset", y))), sr(z)) {
|
|
721
721
|
let { redirect_url: y, message: x, button_text: I } = z.integration_response.data, $ = { redirect_url: y, message: x, button_text: I };
|
|
722
|
-
return w.aborted ? void 0 : (
|
|
722
|
+
return w.aborted ? void 0 : (u.data.submitRedirects = { ...u.data.submitRedirects, [s.id]: $ }, await k().catch((P) => n.error("Failed to persist submit redirect", P)), await R($), r(s.nextId));
|
|
723
723
|
}
|
|
724
724
|
let ht = nr(z);
|
|
725
725
|
if (ht)
|
|
726
726
|
return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? v("submission_pending") }), r(s.nextId);
|
|
727
727
|
if ((z == null ? void 0 : z.success) === !0)
|
|
728
728
|
return s.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: v("submission_completed") }), r(s.nextId);
|
|
729
|
-
let We = Ds(O), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Ne = ze === void 0 ? void 0 :
|
|
730
|
-
if (!Ne && !Pe && !ar(O) && (
|
|
729
|
+
let We = Ds(O), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Ne = ze === void 0 ? void 0 : u.nodes.find((y) => y.type === "question-file" && y.data.key === ze);
|
|
730
|
+
if (!Ne && !Pe && !ar(O) && (u.data.submitCooldown = On(V, j, O)), (O == null ? void 0 : O.outcome) !== "duplicate" && !Be && (u.data.failedAttemptAt = { ...u.data.failedAttemptAt, [V]: Date.now() }, (p = u.data.unconfirmedAttemptKeys) != null && p.includes(V) && (u.data.unconfirmedAttemptKeys = u.data.unconfirmedAttemptKeys.filter((y) => y !== V))), (O == null ? void 0 : O.verdict) === "not_submitted" || (O == null ? void 0 : O.outcome) === "duplicate" || (O == null ? void 0 : O.outcome) === "closed" || Be || Ts(z, $e) ? (W || (u.data.startedWriteNodeIds = (_ = u.data.startedWriteNodeIds) == null ? void 0 : _.filter((y) => y !== s.id)), (f == null ? void 0 : f.submitNodeId) === s.id && await h(f), await k().catch((y) => n.error("Failed to persist application write barrier release", y))) : await k().catch((y) => n.error("Failed to persist submit cooldown", y)), O) {
|
|
731
731
|
if (n.error(X ?? O.message), Ne && ze !== void 0)
|
|
732
|
-
return e.setSubmission(ze, null), await
|
|
732
|
+
return e.setSubmission(ze, null), await h({ fileQuestionNodeId: Ne.id, submitNodeId: s.id }), await e.sendMessage({ type: "system", variant: "error", text: v("submission_unreadable_document") }), r(Ne.id);
|
|
733
733
|
if (O.outcome === "duplicate")
|
|
734
|
-
return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: v(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete
|
|
734
|
+
return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: v(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete u.data.submitCooldown, t()) : K(!1);
|
|
735
735
|
if (O.outcome === "closed")
|
|
736
|
-
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: v("submission_closed") }), Pe ? (delete
|
|
736
|
+
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: v("submission_closed") }), Pe ? (delete u.data.submitCooldown, t()) : K(!1);
|
|
737
737
|
let y = Os(O);
|
|
738
738
|
return y ? (await e.sendMessage({ type: "system", variant: "warning", text: y.until === void 0 ? v("submission_provider_maintenance_later") : v("submission_provider_maintenance", { time: Ur(y.until, void 0) }) }), K(!1)) : O.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: v(js(O) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(O) ? $s(z) ? (await e.sendMessage({ type: "text", author: "bot", text: O.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: v("captcha_failed") }), M++, K(M <= In)) : Bs(O) ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
|
|
739
739
|
}
|
|
@@ -752,9 +752,9 @@ var Bn = /{{\s*\$context\.job\.apply_url\s*(?:\|[^}]*)?}}/, Pn = (e, r) => {
|
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
async function qn({ chat: e, next: r, node: t, submissions: s, context: n, analytics: i, flow: a }) {
|
|
755
|
-
let o = he(t.data.href, { submissions: s, context: n }), { flowSessionId:
|
|
755
|
+
let o = he(t.data.href, { submissions: s, context: n }), { flowSessionId: u } = a.data;
|
|
756
756
|
await e.sendMessage({ type: "link", href: o, text: he(t.data.cta, { submissions: s, context: n }), ...Pn(t.data.href, o) && { onClick: () => {
|
|
757
|
-
i.log({ event: "FLOW_REDIRECT", properties: { flow_build: a.build, flow_id: a.id, flow_session_id:
|
|
757
|
+
i.log({ event: "FLOW_REDIRECT", properties: { flow_build: a.build, flow_id: a.id, flow_session_id: u, flow_version: a.version, href: o, job: a.job } });
|
|
758
758
|
} } }), r(t.nextId);
|
|
759
759
|
}
|
|
760
760
|
async function Un({ submissions: e, next: r, node: t, context: s }) {
|
|
@@ -815,19 +815,19 @@ async function Yn({ node: e, chat: r, next: t, submissions: s, context: n, t: i
|
|
|
815
815
|
async function Qn({ chat: e, end: r, node: t }) {
|
|
816
816
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
817
817
|
}
|
|
818
|
-
async function ea({ node: e, flow: r, submissions: t, chat: s, next: n, apiClient: i, analytics: a, signal: o, context:
|
|
819
|
-
let f = Fs(r.nodes, t || {}), { answers:
|
|
818
|
+
async function ea({ node: e, flow: r, submissions: t, chat: s, next: n, apiClient: i, analytics: a, signal: o, context: u }) {
|
|
819
|
+
let f = Fs(r.nodes, t || {}), { answers: h, ...g } = f;
|
|
820
820
|
if (s.setSubmission(e.data.key, { type: "integration", value: g }), Cn(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: qr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
|
|
821
821
|
let m = [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];
|
|
822
822
|
for (let b of ["hard", "advisory"]) {
|
|
823
|
-
let k =
|
|
823
|
+
let k = h.filter((w) => !w.matched && w.severity === b);
|
|
824
824
|
k.length && m.push((b === "hard" ? "Role requirements" : "Other things to consider") + `
|
|
825
825
|
` + k.map((w) => `• ${w.message}`).join(`
|
|
826
826
|
`));
|
|
827
827
|
}
|
|
828
828
|
await s.sendMessage({ type: "text", author: "bot", text: m.join(`
|
|
829
829
|
|
|
830
|
-
`) }), f.hasHardConcerns && e.data.alternativeLink && await s.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await s.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context:
|
|
830
|
+
`) }), f.hasHardConcerns && e.data.alternativeLink && await s.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await s.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context: u }) } });
|
|
831
831
|
}
|
|
832
832
|
return n(e.nextId);
|
|
833
833
|
}
|
|
@@ -937,7 +937,7 @@ function Xe(e) {
|
|
|
937
937
|
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;
|
|
938
938
|
}
|
|
939
939
|
function se(e, r, t, s, n) {
|
|
940
|
-
const i = n && "input" in n ? n.input : t.value, a = (n == null ? void 0 : n.expected) ?? e.expects ?? null, o = (n == null ? void 0 : n.received) ?? /* @__PURE__ */ Xe(i),
|
|
940
|
+
const i = n && "input" in n ? n.input : t.value, a = (n == null ? void 0 : n.expected) ?? e.expects ?? null, o = (n == null ? void 0 : n.received) ?? /* @__PURE__ */ Xe(i), u = {
|
|
941
941
|
kind: e.kind,
|
|
942
942
|
type: e.type,
|
|
943
943
|
input: i,
|
|
@@ -950,11 +950,11 @@ function se(e, r, t, s, n) {
|
|
|
950
950
|
lang: s.lang,
|
|
951
951
|
abortEarly: s.abortEarly,
|
|
952
952
|
abortPipeEarly: s.abortPipeEarly
|
|
953
|
-
}, f = e.kind === "schema",
|
|
954
|
-
|
|
953
|
+
}, f = e.kind === "schema", h = (n == null ? void 0 : n.message) ?? e.message ?? /* @__PURE__ */ na(e.reference, u.lang) ?? (f ? /* @__PURE__ */ sa(u.lang) : null) ?? s.message ?? /* @__PURE__ */ ra(u.lang);
|
|
954
|
+
h !== void 0 && (u.message = typeof h == "function" ? (
|
|
955
955
|
// @ts-expect-error
|
|
956
|
-
|
|
957
|
-
) :
|
|
956
|
+
h(u)
|
|
957
|
+
) : h), f && (t.typed = !1), t.issues ? t.issues.push(u) : t.issues = [u];
|
|
958
958
|
}
|
|
959
959
|
// @__NO_SIDE_EFFECTS__
|
|
960
960
|
function ge(e) {
|
|
@@ -1184,8 +1184,8 @@ function ns(e, r) {
|
|
|
1184
1184
|
if (Array.isArray(n)) {
|
|
1185
1185
|
t.typed = !0, t.value = [];
|
|
1186
1186
|
for (let a = 0; a < n.length; a++) {
|
|
1187
|
-
const o = n[a],
|
|
1188
|
-
if (
|
|
1187
|
+
const o = n[a], u = this.item["~run"]({ value: o }, s);
|
|
1188
|
+
if (u.issues) {
|
|
1189
1189
|
const f = {
|
|
1190
1190
|
type: "array",
|
|
1191
1191
|
origin: "value",
|
|
@@ -1193,14 +1193,14 @@ function ns(e, r) {
|
|
|
1193
1193
|
key: a,
|
|
1194
1194
|
value: o
|
|
1195
1195
|
};
|
|
1196
|
-
for (const
|
|
1197
|
-
|
|
1198
|
-
if (t.issues || (t.issues =
|
|
1196
|
+
for (const h of u.issues)
|
|
1197
|
+
h.path ? h.path.unshift(f) : h.path = [f], (i = t.issues) == null || i.push(h);
|
|
1198
|
+
if (t.issues || (t.issues = u.issues), s.abortEarly) {
|
|
1199
1199
|
t.typed = !1;
|
|
1200
1200
|
break;
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
|
|
1203
|
+
u.typed || (t.typed = !1), t.value.push(u.value);
|
|
1204
1204
|
}
|
|
1205
1205
|
} else
|
|
1206
1206
|
se(this, "type", t, s);
|
|
@@ -1264,20 +1264,20 @@ function Ce(e, r) {
|
|
|
1264
1264
|
const o = this.entries[a];
|
|
1265
1265
|
if (a in n || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
|
|
1266
1266
|
o.default !== void 0) {
|
|
1267
|
-
const
|
|
1267
|
+
const u = a in n ? (
|
|
1268
1268
|
// @ts-expect-error
|
|
1269
1269
|
n[a]
|
|
1270
|
-
) : /* @__PURE__ */ ss(o), f = o["~run"]({ value:
|
|
1270
|
+
) : /* @__PURE__ */ ss(o), f = o["~run"]({ value: u }, s);
|
|
1271
1271
|
if (f.issues) {
|
|
1272
|
-
const
|
|
1272
|
+
const h = {
|
|
1273
1273
|
type: "object",
|
|
1274
1274
|
origin: "value",
|
|
1275
1275
|
input: n,
|
|
1276
1276
|
key: a,
|
|
1277
|
-
value:
|
|
1277
|
+
value: u
|
|
1278
1278
|
};
|
|
1279
1279
|
for (const g of f.issues)
|
|
1280
|
-
g.path ? g.path.unshift(
|
|
1280
|
+
g.path ? g.path.unshift(h) : g.path = [h], (i = t.issues) == null || i.push(g);
|
|
1281
1281
|
if (t.issues || (t.issues = f.issues), s.abortEarly) {
|
|
1282
1282
|
t.typed = !1;
|
|
1283
1283
|
break;
|
|
@@ -1363,20 +1363,20 @@ function ls(e, r, t) {
|
|
|
1363
1363
|
const i = s.value;
|
|
1364
1364
|
if (i && typeof i == "object") {
|
|
1365
1365
|
s.typed = !0, s.value = {};
|
|
1366
|
-
for (const
|
|
1367
|
-
if (/* @__PURE__ */ aa(i,
|
|
1368
|
-
const f = i[
|
|
1369
|
-
if (
|
|
1366
|
+
for (const u in i)
|
|
1367
|
+
if (/* @__PURE__ */ aa(i, u)) {
|
|
1368
|
+
const f = i[u], h = this.key["~run"]({ value: u }, n);
|
|
1369
|
+
if (h.issues) {
|
|
1370
1370
|
const m = {
|
|
1371
1371
|
type: "object",
|
|
1372
1372
|
origin: "key",
|
|
1373
1373
|
input: i,
|
|
1374
|
-
key:
|
|
1374
|
+
key: u,
|
|
1375
1375
|
value: f
|
|
1376
1376
|
};
|
|
1377
|
-
for (const b of
|
|
1377
|
+
for (const b of h.issues)
|
|
1378
1378
|
b.path = [m], (a = s.issues) == null || a.push(b);
|
|
1379
|
-
if (s.issues || (s.issues =
|
|
1379
|
+
if (s.issues || (s.issues = h.issues), n.abortEarly) {
|
|
1380
1380
|
s.typed = !1;
|
|
1381
1381
|
break;
|
|
1382
1382
|
}
|
|
@@ -1390,7 +1390,7 @@ function ls(e, r, t) {
|
|
|
1390
1390
|
type: "object",
|
|
1391
1391
|
origin: "value",
|
|
1392
1392
|
input: i,
|
|
1393
|
-
key:
|
|
1393
|
+
key: u,
|
|
1394
1394
|
value: f
|
|
1395
1395
|
};
|
|
1396
1396
|
for (const b of g.issues)
|
|
@@ -1400,7 +1400,7 @@ function ls(e, r, t) {
|
|
|
1400
1400
|
break;
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
|
-
(!
|
|
1403
|
+
(!h.typed || !g.typed) && (s.typed = !1), h.typed && (s.value[h.value] = g.value);
|
|
1404
1404
|
}
|
|
1405
1405
|
} else
|
|
1406
1406
|
se(this, "type", s, n);
|
|
@@ -1603,24 +1603,24 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1603
1603
|
i.searchParams.set("q", n), i.searchParams.set("session_token", t);
|
|
1604
1604
|
const a = (g = q.current$.peek().flow) == null ? void 0 : g.locationOrigin;
|
|
1605
1605
|
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", ga(ba));
|
|
1606
|
-
const
|
|
1607
|
-
if (!
|
|
1608
|
-
return e.error("Failed to get address details",
|
|
1606
|
+
const u = await fetch(i);
|
|
1607
|
+
if (!u.ok)
|
|
1608
|
+
return e.error("Failed to get address details", u), {
|
|
1609
1609
|
ok: !1,
|
|
1610
1610
|
error: r("address_error")
|
|
1611
1611
|
};
|
|
1612
|
-
const f = /* @__PURE__ */ ha(va, await
|
|
1612
|
+
const f = /* @__PURE__ */ ha(va, await u.json());
|
|
1613
1613
|
if (f.success === !1)
|
|
1614
1614
|
return e.error("Failed to parse address details", f.issues), {
|
|
1615
1615
|
ok: !1,
|
|
1616
1616
|
error: r("address_error")
|
|
1617
1617
|
};
|
|
1618
1618
|
const {
|
|
1619
|
-
suggestions:
|
|
1619
|
+
suggestions: h
|
|
1620
1620
|
} = f.output;
|
|
1621
1621
|
return {
|
|
1622
1622
|
ok: !0,
|
|
1623
|
-
data:
|
|
1623
|
+
data: h.map((m) => {
|
|
1624
1624
|
var b, k, w, C, A, v, R, V, M;
|
|
1625
1625
|
return {
|
|
1626
1626
|
// A postcode result has no full address and is named by the postcode itself (PROD-7311).
|
|
@@ -1678,7 +1678,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1678
1678
|
} = xa({
|
|
1679
1679
|
logger: t,
|
|
1680
1680
|
t: s
|
|
1681
|
-
}), [
|
|
1681
|
+
}), [u, f] = ke(a ? "query" : "manual"), [h, g] = ke(""), [m, b] = ke(), k = ye(), w = ye(), C = (v) => {
|
|
1682
1682
|
var V;
|
|
1683
1683
|
if (Oe(a, "Query state should not be enabled"), v = v.trim(), v === ((V = k.current) == null ? void 0 : V.query) || v === (m == null ? void 0 : m.query) && m.status === "done")
|
|
1684
1684
|
return;
|
|
@@ -1715,7 +1715,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1715
1715
|
[v]: R
|
|
1716
1716
|
}));
|
|
1717
1717
|
};
|
|
1718
|
-
switch (
|
|
1718
|
+
switch (u) {
|
|
1719
1719
|
case "query":
|
|
1720
1720
|
return Oe(a, "Query state should not be enabled"), l(_a, {
|
|
1721
1721
|
input: e,
|
|
@@ -1730,7 +1730,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1730
1730
|
},
|
|
1731
1731
|
onAddressSearch: C,
|
|
1732
1732
|
lookup: m,
|
|
1733
|
-
query:
|
|
1733
|
+
query: h
|
|
1734
1734
|
});
|
|
1735
1735
|
case "details":
|
|
1736
1736
|
return Oe(n !== void 0), l(hr, {
|
|
@@ -1780,10 +1780,10 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1780
1780
|
}, []), l(be, {
|
|
1781
1781
|
children: [l("form", {
|
|
1782
1782
|
noValidate: !0,
|
|
1783
|
-
onSubmit: (
|
|
1784
|
-
|
|
1785
|
-
const
|
|
1786
|
-
typeof
|
|
1783
|
+
onSubmit: (u) => {
|
|
1784
|
+
u.preventDefault();
|
|
1785
|
+
const h = new FormData(u.currentTarget).get("address");
|
|
1786
|
+
typeof h == "string" && i(h);
|
|
1787
1787
|
},
|
|
1788
1788
|
class: "flex gap-2 p-2.5",
|
|
1789
1789
|
children: [l("div", {
|
|
@@ -1847,15 +1847,15 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1847
1847
|
}), a("address_searching")]
|
|
1848
1848
|
}) : (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? a("address_no_results") : null
|
|
1849
1849
|
}), l("ul", {
|
|
1850
|
-
children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((
|
|
1850
|
+
children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((u) => l("li", {
|
|
1851
1851
|
children: l("button", {
|
|
1852
1852
|
class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
|
|
1853
1853
|
onClick: () => {
|
|
1854
|
-
s(
|
|
1854
|
+
s(u.id);
|
|
1855
1855
|
},
|
|
1856
1856
|
children: [l("span", {
|
|
1857
1857
|
class: "flex-grow",
|
|
1858
|
-
children:
|
|
1858
|
+
children: u.label
|
|
1859
1859
|
}), l("svg", {
|
|
1860
1860
|
class: "flex-none",
|
|
1861
1861
|
width: "16",
|
|
@@ -1870,7 +1870,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1870
1870
|
})
|
|
1871
1871
|
})]
|
|
1872
1872
|
})
|
|
1873
|
-
},
|
|
1873
|
+
}, u.id)), l("li", {
|
|
1874
1874
|
children: l("button", {
|
|
1875
1875
|
class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
|
|
1876
1876
|
onClick: () => {
|
|
@@ -1894,8 +1894,8 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1894
1894
|
const i = ye(null);
|
|
1895
1895
|
Le(() => {
|
|
1896
1896
|
if (i.current) {
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1897
|
+
const u = i.current.querySelector("input");
|
|
1898
|
+
u && (u.focus(), u.select());
|
|
1899
1899
|
}
|
|
1900
1900
|
}, []);
|
|
1901
1901
|
const a = Object.keys(Gt), {
|
|
@@ -1903,15 +1903,15 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1903
1903
|
} = re();
|
|
1904
1904
|
return l("form", {
|
|
1905
1905
|
class: "flex flex-col px-2 pt-2",
|
|
1906
|
-
onSubmit: (
|
|
1907
|
-
|
|
1908
|
-
const f =
|
|
1909
|
-
for (const b of
|
|
1906
|
+
onSubmit: (u) => {
|
|
1907
|
+
u.preventDefault();
|
|
1908
|
+
const f = u.currentTarget, h = [...f.querySelectorAll("input")].filter((b) => b.value !== "" && !b.value.trim());
|
|
1909
|
+
for (const b of h) {
|
|
1910
1910
|
b.value = "";
|
|
1911
1911
|
const k = Nt.find((w) => n.config.keys[w] === b.name);
|
|
1912
1912
|
k && r(k, "");
|
|
1913
1913
|
}
|
|
1914
|
-
if (
|
|
1914
|
+
if (h.length > 0 && !f.checkValidity()) {
|
|
1915
1915
|
f.reportValidity();
|
|
1916
1916
|
return;
|
|
1917
1917
|
}
|
|
@@ -1924,27 +1924,27 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1924
1924
|
children: [l("div", {
|
|
1925
1925
|
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]",
|
|
1926
1926
|
ref: i,
|
|
1927
|
-
children: Nt.map((
|
|
1928
|
-
const
|
|
1927
|
+
children: Nt.map((u, f) => {
|
|
1928
|
+
const h = `isdk_${u}`, g = n.config.keys[u];
|
|
1929
1929
|
return g ? l(be, {
|
|
1930
1930
|
children: [l("label", {
|
|
1931
|
-
for:
|
|
1931
|
+
for: h,
|
|
1932
1932
|
class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
1933
|
-
children: o(
|
|
1933
|
+
children: o(u)
|
|
1934
1934
|
}), l("div", {
|
|
1935
1935
|
class: "flex flex-col items-stretch gap-1.5",
|
|
1936
|
-
children: [
|
|
1936
|
+
children: [u === "country" ? l("div", {
|
|
1937
1937
|
class: "relative",
|
|
1938
1938
|
children: [l("select", {
|
|
1939
1939
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
|
|
1940
1940
|
name: g,
|
|
1941
|
-
id:
|
|
1942
|
-
defaultValue: e[
|
|
1943
|
-
onChange: (m) => r(
|
|
1941
|
+
id: h,
|
|
1942
|
+
defaultValue: e[u],
|
|
1943
|
+
onChange: (m) => r(u, m.currentTarget.value),
|
|
1944
1944
|
required: !0,
|
|
1945
1945
|
children: [e.country && !a.includes(e.country) ? l("option", {
|
|
1946
|
-
value: e[
|
|
1947
|
-
children: e[
|
|
1946
|
+
value: e[u],
|
|
1947
|
+
children: e[u]
|
|
1948
1948
|
}) : l("option", {
|
|
1949
1949
|
value: "",
|
|
1950
1950
|
children: o("select_country")
|
|
@@ -1971,10 +1971,10 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1971
1971
|
autoFocus: f === 0 ? !0 : void 0,
|
|
1972
1972
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
|
|
1973
1973
|
name: g,
|
|
1974
|
-
id:
|
|
1975
|
-
defaultValue: e[
|
|
1976
|
-
onInput: (m) => r(
|
|
1977
|
-
required:
|
|
1974
|
+
id: h,
|
|
1975
|
+
defaultValue: e[u],
|
|
1976
|
+
onInput: (m) => r(u, m.currentTarget.value),
|
|
1977
|
+
required: u === "line2" ? n.config.line2Required === !0 : u !== "line3"
|
|
1978
1978
|
}), f === Nt.length - 1 ? l("hr", {
|
|
1979
1979
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1980
1980
|
}) : l("hr", {
|
|
@@ -2103,7 +2103,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2103
2103
|
files: s.value
|
|
2104
2104
|
} : {
|
|
2105
2105
|
status: "empty"
|
|
2106
|
-
}), a = ye(0), o = n.status === "ready" ? n.files : [],
|
|
2106
|
+
}), a = ye(0), o = n.status === "ready" ? n.files : [], u = n.status === "ready" || n.status === "pending" ? n.files : [], f = n.status === "error" ? n.error : void 0, h = u.length - mr, g = pr(u), m = Jt(), {
|
|
2107
2107
|
t: b
|
|
2108
2108
|
} = re(), k = (A) => {
|
|
2109
2109
|
if (!A.length)
|
|
@@ -2184,9 +2184,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2184
2184
|
ref: m,
|
|
2185
2185
|
for: "dropzone-file",
|
|
2186
2186
|
class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
|
|
2187
|
-
children: [
|
|
2187
|
+
children: [u.length > 0 ? l("ul", {
|
|
2188
2188
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2189
|
-
children: [
|
|
2189
|
+
children: [u.slice(0, mr).map((A) => {
|
|
2190
2190
|
const [v, R] = _t(A.name);
|
|
2191
2191
|
return l(yr, {
|
|
2192
2192
|
class: "flex overflow-hidden",
|
|
@@ -2197,9 +2197,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2197
2197
|
children: R
|
|
2198
2198
|
})]
|
|
2199
2199
|
});
|
|
2200
|
-
}),
|
|
2200
|
+
}), h > 0 ? l(yr, {
|
|
2201
2201
|
children: b("file_more", {
|
|
2202
|
-
count:
|
|
2202
|
+
count: h
|
|
2203
2203
|
})
|
|
2204
2204
|
}) : null]
|
|
2205
2205
|
}) : l("div", {
|
|
@@ -2247,13 +2247,13 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2247
2247
|
})]
|
|
2248
2248
|
}), l("p", {
|
|
2249
2249
|
role: "status",
|
|
2250
|
-
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs",
|
|
2250
|
+
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs", u.length === 0 && "sr-only"),
|
|
2251
2251
|
children: n.status === "pending" ? l(be, {
|
|
2252
2252
|
children: [l(Ut, {
|
|
2253
2253
|
"aria-hidden": "true",
|
|
2254
2254
|
class: "h-4 w-4"
|
|
2255
2255
|
}), b("file_preparing", {
|
|
2256
|
-
count:
|
|
2256
|
+
count: u.length
|
|
2257
2257
|
})]
|
|
2258
2258
|
}) : n.status === "ready" ? l(be, {
|
|
2259
2259
|
children: [o.length > 1 ? b("file_total_size", {
|
|
@@ -2364,14 +2364,14 @@ var kt = (e) => /^\w*$/.test(e), G = (e) => e === void 0, Xt = (e) => Array.isAr
|
|
|
2364
2364
|
const n = kt(r) ? [r] : Yt(r), i = n.length, a = i - 1;
|
|
2365
2365
|
for (; ++s < i; ) {
|
|
2366
2366
|
const o = n[s];
|
|
2367
|
-
let
|
|
2367
|
+
let u = t;
|
|
2368
2368
|
if (s !== a) {
|
|
2369
2369
|
const f = e[o];
|
|
2370
|
-
|
|
2370
|
+
u = Z(f) || Array.isArray(f) ? f : isNaN(+n[s + 1]) ? {} : [];
|
|
2371
2371
|
}
|
|
2372
2372
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2373
2373
|
return;
|
|
2374
|
-
e[o] =
|
|
2374
|
+
e[o] = u, e = e[o];
|
|
2375
2375
|
}
|
|
2376
2376
|
};
|
|
2377
2377
|
const gr = {
|
|
@@ -2640,7 +2640,7 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2640
2640
|
value: e,
|
|
2641
2641
|
message: ""
|
|
2642
2642
|
}, Fr = async (e, r, t, s, n, i) => {
|
|
2643
|
-
const { ref: a, refs: o, required:
|
|
2643
|
+
const { ref: a, refs: o, required: u, maxLength: f, minLength: h, min: g, max: m, pattern: b, validate: k, name: w, valueAsNumber: C, mount: A } = e._f, v = S(t, w);
|
|
2644
2644
|
if (!A || r.has(w))
|
|
2645
2645
|
return {};
|
|
2646
2646
|
const R = o ? o[0] : a, V = (E) => {
|
|
@@ -2654,8 +2654,8 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2654
2654
|
...D(E ? L : W, U)
|
|
2655
2655
|
};
|
|
2656
2656
|
};
|
|
2657
|
-
if (i ? !Array.isArray(v) || !v.length :
|
|
2658
|
-
const { value: E, message: F } = ue(
|
|
2657
|
+
if (i ? !Array.isArray(v) || !v.length : u && (!T && (N || oe(v)) || me(v) && !v || K && !gs(o).isValid || ee && !xs(o).isValid)) {
|
|
2658
|
+
const { value: E, message: F } = ue(u) ? { value: !!u, message: u } : He(u);
|
|
2659
2659
|
if (E && (M[w] = {
|
|
2660
2660
|
type: _e.required,
|
|
2661
2661
|
message: F,
|
|
@@ -2677,8 +2677,8 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2677
2677
|
if ((E || F) && (j(!!E, B.message, L.message, _e.max, _e.min), !s))
|
|
2678
2678
|
return V(M[w].message), M;
|
|
2679
2679
|
}
|
|
2680
|
-
if ((f ||
|
|
2681
|
-
const E = He(f), F = He(
|
|
2680
|
+
if ((f || h) && !N && (ue(v) || i && Array.isArray(v))) {
|
|
2681
|
+
const E = He(f), F = He(h), B = !oe(E.value) && v.length > +E.value, L = !oe(F.value) && v.length < +F.value;
|
|
2682
2682
|
if ((B || L) && (j(B, E.message, F.message), !s))
|
|
2683
2683
|
return V(M[w].message), M;
|
|
2684
2684
|
}
|
|
@@ -2755,8 +2755,8 @@ function ei(e = {}) {
|
|
|
2755
2755
|
unMount: /* @__PURE__ */ new Set(),
|
|
2756
2756
|
array: /* @__PURE__ */ new Set(),
|
|
2757
2757
|
watch: /* @__PURE__ */ new Set()
|
|
2758
|
-
},
|
|
2759
|
-
const
|
|
2758
|
+
}, u, f = 0;
|
|
2759
|
+
const h = {
|
|
2760
2760
|
isDirty: !1,
|
|
2761
2761
|
dirtyFields: !1,
|
|
2762
2762
|
validatingFields: !1,
|
|
@@ -2765,7 +2765,7 @@ function ei(e = {}) {
|
|
|
2765
2765
|
isValid: !1,
|
|
2766
2766
|
errors: !1
|
|
2767
2767
|
}, g = {
|
|
2768
|
-
...
|
|
2768
|
+
...h
|
|
2769
2769
|
};
|
|
2770
2770
|
let m = {
|
|
2771
2771
|
...g
|
|
@@ -2773,294 +2773,294 @@ function ei(e = {}) {
|
|
|
2773
2773
|
const b = {
|
|
2774
2774
|
array: vr(),
|
|
2775
2775
|
state: vr()
|
|
2776
|
-
}, k = r.criteriaMode === fe.all, w = (
|
|
2777
|
-
clearTimeout(f), f = setTimeout(
|
|
2778
|
-
}, C = async (
|
|
2779
|
-
if (!a.keepIsValid && !r.disabled && (g.isValid || m.isValid ||
|
|
2776
|
+
}, k = r.criteriaMode === fe.all, w = (c) => (d) => {
|
|
2777
|
+
clearTimeout(f), f = setTimeout(c, d);
|
|
2778
|
+
}, C = async (c) => {
|
|
2779
|
+
if (!a.keepIsValid && !r.disabled && (g.isValid || m.isValid || c)) {
|
|
2780
2780
|
let d;
|
|
2781
2781
|
r.resolver ? (d = ie((await T()).errors), A()) : d = await D(s, !0), d !== t.isValid && b.state.next({
|
|
2782
2782
|
isValid: d
|
|
2783
2783
|
});
|
|
2784
2784
|
}
|
|
2785
|
-
}, A = (
|
|
2786
|
-
!r.disabled && (g.isValidating || g.validatingFields || m.isValidating || m.validatingFields) && ((
|
|
2787
|
-
|
|
2785
|
+
}, A = (c, d) => {
|
|
2786
|
+
!r.disabled && (g.isValidating || g.validatingFields || m.isValidating || m.validatingFields) && ((c || Array.from(o.mount)).forEach((p) => {
|
|
2787
|
+
p && (d ? H(t.validatingFields, p, d) : J(t.validatingFields, p));
|
|
2788
2788
|
}), b.state.next({
|
|
2789
2789
|
validatingFields: t.validatingFields,
|
|
2790
2790
|
isValidating: !ie(t.validatingFields)
|
|
2791
2791
|
}));
|
|
2792
|
-
}, v = (
|
|
2793
|
-
if (_ &&
|
|
2794
|
-
if (a.action = !0, x && Array.isArray(S(s,
|
|
2795
|
-
const I =
|
|
2796
|
-
y && H(s,
|
|
2792
|
+
}, v = (c, d = [], p, _, y = !0, x = !0) => {
|
|
2793
|
+
if (_ && p && !r.disabled) {
|
|
2794
|
+
if (a.action = !0, x && Array.isArray(S(s, c))) {
|
|
2795
|
+
const I = p(S(s, c), _.argA, _.argB);
|
|
2796
|
+
y && H(s, c, I);
|
|
2797
2797
|
}
|
|
2798
|
-
if (x && Array.isArray(S(t.errors,
|
|
2799
|
-
const I =
|
|
2800
|
-
y && H(t.errors,
|
|
2798
|
+
if (x && Array.isArray(S(t.errors, c))) {
|
|
2799
|
+
const I = p(S(t.errors, c), _.argA, _.argB);
|
|
2800
|
+
y && H(t.errors, c, I), Xa(t.errors, c);
|
|
2801
2801
|
}
|
|
2802
|
-
if ((g.touchedFields || m.touchedFields) && x && Array.isArray(S(t.touchedFields,
|
|
2803
|
-
const I =
|
|
2804
|
-
y && H(t.touchedFields,
|
|
2802
|
+
if ((g.touchedFields || m.touchedFields) && x && Array.isArray(S(t.touchedFields, c))) {
|
|
2803
|
+
const I = p(S(t.touchedFields, c), _.argA, _.argB);
|
|
2804
|
+
y && H(t.touchedFields, c, I);
|
|
2805
2805
|
}
|
|
2806
2806
|
(g.dirtyFields || m.dirtyFields) && (t.dirtyFields = Ke(n, i)), b.state.next({
|
|
2807
|
-
name:
|
|
2808
|
-
isDirty: E(
|
|
2807
|
+
name: c,
|
|
2808
|
+
isDirty: E(c, d),
|
|
2809
2809
|
dirtyFields: t.dirtyFields,
|
|
2810
2810
|
errors: t.errors,
|
|
2811
2811
|
isValid: t.isValid
|
|
2812
2812
|
});
|
|
2813
2813
|
} else
|
|
2814
|
-
H(i,
|
|
2815
|
-
}, R = (
|
|
2816
|
-
H(t.errors,
|
|
2814
|
+
H(i, c, d);
|
|
2815
|
+
}, R = (c, d) => {
|
|
2816
|
+
H(t.errors, c, d), b.state.next({
|
|
2817
2817
|
errors: t.errors
|
|
2818
2818
|
});
|
|
2819
|
-
}, V = (
|
|
2820
|
-
t.errors =
|
|
2819
|
+
}, V = (c) => {
|
|
2820
|
+
t.errors = c, b.state.next({
|
|
2821
2821
|
errors: t.errors,
|
|
2822
2822
|
isValid: !1
|
|
2823
2823
|
});
|
|
2824
|
-
}, M = (
|
|
2825
|
-
const y = S(s,
|
|
2824
|
+
}, M = (c, d, p, _) => {
|
|
2825
|
+
const y = S(s, c);
|
|
2826
2826
|
if (y) {
|
|
2827
|
-
const x = S(i,
|
|
2828
|
-
G(x) || _ && _.defaultChecked || d ? H(i,
|
|
2827
|
+
const x = S(i, c, G(p) ? S(n, c) : p);
|
|
2828
|
+
G(x) || _ && _.defaultChecked || d ? H(i, c, d ? x : kr(y._f)) : L(c, x), a.mount && !a.action && C();
|
|
2829
2829
|
}
|
|
2830
|
-
}, ee = (
|
|
2830
|
+
}, ee = (c, d, p, _, y) => {
|
|
2831
2831
|
let x = !1, I = !1;
|
|
2832
2832
|
const $ = {
|
|
2833
|
-
name:
|
|
2833
|
+
name: c
|
|
2834
2834
|
};
|
|
2835
2835
|
if (!r.disabled) {
|
|
2836
|
-
if (!
|
|
2836
|
+
if (!p || _) {
|
|
2837
2837
|
(g.isDirty || m.isDirty) && (I = t.isDirty, t.isDirty = $.isDirty = E(), x = I !== $.isDirty);
|
|
2838
|
-
const P = Ve(S(n,
|
|
2839
|
-
I = !!S(t.dirtyFields,
|
|
2838
|
+
const P = Ve(S(n, c), d);
|
|
2839
|
+
I = !!S(t.dirtyFields, c), P ? J(t.dirtyFields, c) : H(t.dirtyFields, c, !0), $.dirtyFields = t.dirtyFields, x = x || (g.dirtyFields || m.dirtyFields) && I !== !P;
|
|
2840
2840
|
}
|
|
2841
|
-
if (
|
|
2842
|
-
const P = S(t.touchedFields,
|
|
2843
|
-
P || (H(t.touchedFields,
|
|
2841
|
+
if (p) {
|
|
2842
|
+
const P = S(t.touchedFields, c);
|
|
2843
|
+
P || (H(t.touchedFields, c, p), $.touchedFields = t.touchedFields, x = x || (g.touchedFields || m.touchedFields) && P !== p);
|
|
2844
2844
|
}
|
|
2845
2845
|
x && y && b.state.next($);
|
|
2846
2846
|
}
|
|
2847
2847
|
return x ? $ : {};
|
|
2848
|
-
}, K = (
|
|
2849
|
-
const y = S(t.errors,
|
|
2850
|
-
if (r.delayError &&
|
|
2848
|
+
}, K = (c, d, p, _) => {
|
|
2849
|
+
const y = S(t.errors, c), x = (g.isValid || m.isValid) && me(d) && t.isValid !== d;
|
|
2850
|
+
if (r.delayError && p ? (u = w(() => R(c, p)), u(r.delayError)) : (clearTimeout(f), u = null, p ? H(t.errors, c, p) : J(t.errors, c)), (p ? !Ve(y, p) : y) || !ie(_) || x) {
|
|
2851
2851
|
const I = {
|
|
2852
2852
|
..._,
|
|
2853
2853
|
...x && me(d) ? { isValid: d } : {},
|
|
2854
2854
|
errors: t.errors,
|
|
2855
|
-
name:
|
|
2855
|
+
name: c
|
|
2856
2856
|
};
|
|
2857
2857
|
t = {
|
|
2858
2858
|
...t,
|
|
2859
2859
|
...I
|
|
2860
2860
|
}, b.state.next(I);
|
|
2861
2861
|
}
|
|
2862
|
-
}, T = async (
|
|
2863
|
-
const { errors: d } = await T(
|
|
2864
|
-
if (A(
|
|
2865
|
-
for (const
|
|
2866
|
-
const _ = S(d,
|
|
2867
|
-
_ ? H(t.errors,
|
|
2862
|
+
}, T = async (c) => (A(c, !0), await r.resolver(i, r.context, za(c || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), N = async (c) => {
|
|
2863
|
+
const { errors: d } = await T(c);
|
|
2864
|
+
if (A(c), c)
|
|
2865
|
+
for (const p of c) {
|
|
2866
|
+
const _ = S(d, p);
|
|
2867
|
+
_ ? H(t.errors, p, _) : J(t.errors, p);
|
|
2868
2868
|
}
|
|
2869
2869
|
else
|
|
2870
2870
|
t.errors = d;
|
|
2871
2871
|
return d;
|
|
2872
|
-
}, D = async (
|
|
2872
|
+
}, D = async (c, d, p = {
|
|
2873
2873
|
valid: !0
|
|
2874
2874
|
}) => {
|
|
2875
|
-
for (const _ in
|
|
2876
|
-
const y =
|
|
2875
|
+
for (const _ in c) {
|
|
2876
|
+
const y = c[_];
|
|
2877
2877
|
if (y) {
|
|
2878
2878
|
const { _f: x, ...I } = y;
|
|
2879
2879
|
if (x) {
|
|
2880
2880
|
const $ = o.array.has(x.name), P = y._f && Ha(y._f);
|
|
2881
2881
|
P && g.validatingFields && A([x.name], !0);
|
|
2882
2882
|
const ne = await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation && !d, $);
|
|
2883
|
-
if (P && g.validatingFields && A([x.name]), ne[x.name] && (
|
|
2883
|
+
if (P && g.validatingFields && A([x.name]), ne[x.name] && (p.valid = !1, d || e.shouldUseNativeValidation))
|
|
2884
2884
|
break;
|
|
2885
2885
|
!d && (S(ne, x.name) ? $ ? Ya(t.errors, ne, x.name) : H(t.errors, x.name, ne[x.name]) : J(t.errors, x.name));
|
|
2886
2886
|
}
|
|
2887
|
-
!ie(I) && await D(I, d,
|
|
2887
|
+
!ie(I) && await D(I, d, p);
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
|
-
return
|
|
2890
|
+
return p.valid;
|
|
2891
2891
|
}, j = () => {
|
|
2892
|
-
for (const
|
|
2893
|
-
const d = S(s,
|
|
2894
|
-
d && (d._f.refs ? d._f.refs.every((
|
|
2892
|
+
for (const c of o.unMount) {
|
|
2893
|
+
const d = S(s, c);
|
|
2894
|
+
d && (d._f.refs ? d._f.refs.every((p) => !Dt(p)) : !Dt(d._f.ref)) && qe(c);
|
|
2895
2895
|
}
|
|
2896
2896
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2897
|
-
}, E = (
|
|
2898
|
-
...a.mount ? i : G(d) ? n : ue(
|
|
2899
|
-
},
|
|
2900
|
-
const _ = S(s,
|
|
2897
|
+
}, E = (c, d) => !r.disabled && (c && d && H(i, c, d), !Ve(rt(), n)), F = (c, d, p) => $a(c, o, {
|
|
2898
|
+
...a.mount ? i : G(d) ? n : ue(c) ? { [c]: d } : d
|
|
2899
|
+
}, p, d), B = (c) => Xt(S(a.mount ? i : n, c, r.shouldUnregister ? S(n, c, []) : [])), L = (c, d, p = {}) => {
|
|
2900
|
+
const _ = S(s, c);
|
|
2901
2901
|
let y = d;
|
|
2902
2902
|
if (_) {
|
|
2903
2903
|
const x = _._f;
|
|
2904
|
-
x && (!x.disabled && H(i,
|
|
2904
|
+
x && (!x.disabled && H(i, c, vs(d, x)), y = bt(x.ref) && oe(d) ? "" : d, ys(x.ref) ? [...x.ref.options].forEach((I) => I.selected = y.includes(I.value)) : x.refs ? ft(x.ref) ? x.refs.forEach((I) => {
|
|
2905
2905
|
(!I.defaultChecked || !I.disabled) && (Array.isArray(y) ? I.checked = !!y.find(($) => $ === I.value) : I.checked = y === I.value || !!y);
|
|
2906
2906
|
}) : x.refs.forEach((I) => I.checked = I.value === y) : Qt(x.ref) ? x.ref.value = "" : (x.ref.value = y, x.ref.type || b.state.next({
|
|
2907
|
-
name:
|
|
2907
|
+
name: c,
|
|
2908
2908
|
values: Q(i)
|
|
2909
2909
|
})));
|
|
2910
2910
|
}
|
|
2911
|
-
(
|
|
2912
|
-
}, W = (
|
|
2911
|
+
(p.shouldDirty || p.shouldTouch) && ee(c, y, p.shouldTouch, p.shouldDirty, !0), p.shouldValidate && z(c);
|
|
2912
|
+
}, W = (c, d, p) => {
|
|
2913
2913
|
for (const _ in d) {
|
|
2914
2914
|
if (!d.hasOwnProperty(_))
|
|
2915
2915
|
return;
|
|
2916
|
-
const y = d[_], x =
|
|
2917
|
-
(o.array.has(
|
|
2916
|
+
const y = d[_], x = c + "." + _, I = S(s, x);
|
|
2917
|
+
(o.array.has(c) || Z(y) || I && !I._f) && !Te(y) ? W(x, y, p) : L(x, y, p);
|
|
2918
2918
|
}
|
|
2919
|
-
}, U = (
|
|
2920
|
-
const _ = S(s,
|
|
2921
|
-
H(i,
|
|
2922
|
-
name:
|
|
2919
|
+
}, U = (c, d, p = {}) => {
|
|
2920
|
+
const _ = S(s, c), y = o.array.has(c), x = Q(d);
|
|
2921
|
+
H(i, c, x), y ? (b.array.next({
|
|
2922
|
+
name: c,
|
|
2923
2923
|
values: Q(i)
|
|
2924
|
-
}), (g.isDirty || g.dirtyFields || m.isDirty || m.dirtyFields) &&
|
|
2925
|
-
name:
|
|
2924
|
+
}), (g.isDirty || g.dirtyFields || m.isDirty || m.dirtyFields) && p.shouldDirty && b.state.next({
|
|
2925
|
+
name: c,
|
|
2926
2926
|
dirtyFields: Ke(n, i),
|
|
2927
|
-
isDirty: E(
|
|
2928
|
-
})) : _ && !_._f && !oe(x) ? W(
|
|
2927
|
+
isDirty: E(c, x)
|
|
2928
|
+
})) : _ && !_._f && !oe(x) ? W(c, x, p) : L(c, x, p), Ar(c, o) ? b.state.next({
|
|
2929
2929
|
...t,
|
|
2930
|
-
name:
|
|
2930
|
+
name: c,
|
|
2931
2931
|
values: Q(i)
|
|
2932
2932
|
}) : b.state.next({
|
|
2933
|
-
name: a.mount ?
|
|
2933
|
+
name: a.mount ? c : void 0,
|
|
2934
2934
|
values: Q(i)
|
|
2935
2935
|
});
|
|
2936
|
-
}, te = async (
|
|
2936
|
+
}, te = async (c) => {
|
|
2937
2937
|
a.mount = !0;
|
|
2938
|
-
const d =
|
|
2939
|
-
let
|
|
2940
|
-
const y = S(s,
|
|
2941
|
-
_ = Number.isNaN(P) || Te(P) && isNaN(P.getTime()) || Ve(P, S(i,
|
|
2938
|
+
const d = c.target;
|
|
2939
|
+
let p = d.name, _ = !0;
|
|
2940
|
+
const y = S(s, p), x = (P) => {
|
|
2941
|
+
_ = Number.isNaN(P) || Te(P) && isNaN(P.getTime()) || Ve(P, S(i, p, P));
|
|
2942
2942
|
}, I = Cr(r.mode), $ = Cr(r.reValidateMode);
|
|
2943
2943
|
if (y) {
|
|
2944
2944
|
let P, ne;
|
|
2945
|
-
const De = d.type ? kr(y._f) : La(
|
|
2946
|
-
H(i,
|
|
2947
|
-
const Et = ee(
|
|
2945
|
+
const De = d.type ? kr(y._f) : La(c), Ie = c.type === gr.BLUR || c.type === gr.FOCUS_OUT, _s = !Ka(y._f) && !r.resolver && !S(t.errors, p) && !y._f.deps || Za(Ie, S(t.touchedFields, p), t.isSubmitted, $, I), It = Ar(p, o, Ie);
|
|
2946
|
+
H(i, p, De), Ie ? (!d || !d.readOnly) && (y._f.onBlur && y._f.onBlur(c), u && u(0)) : y._f.onChange && y._f.onChange(c);
|
|
2947
|
+
const Et = ee(p, De, Ie), ks = !ie(Et) || It;
|
|
2948
2948
|
if (!Ie && b.state.next({
|
|
2949
|
-
name:
|
|
2950
|
-
type:
|
|
2949
|
+
name: p,
|
|
2950
|
+
type: c.type,
|
|
2951
2951
|
values: Q(i)
|
|
2952
2952
|
}), _s)
|
|
2953
|
-
return (g.isValid || m.isValid) && (r.mode === "onBlur" ? Ie && C() : Ie || C()), ks && b.state.next({ name:
|
|
2953
|
+
return (g.isValid || m.isValid) && (r.mode === "onBlur" ? Ie && C() : Ie || C()), ks && b.state.next({ name: p, ...It ? {} : Et });
|
|
2954
2954
|
if (!Ie && It && b.state.next({ ...t }), r.resolver) {
|
|
2955
|
-
const { errors: tr } = await T([
|
|
2956
|
-
if (A([
|
|
2957
|
-
const Cs = Ir(t.errors, s,
|
|
2958
|
-
P = rr.error,
|
|
2955
|
+
const { errors: tr } = await T([p]);
|
|
2956
|
+
if (A([p]), x(De), _) {
|
|
2957
|
+
const Cs = Ir(t.errors, s, p), rr = Ir(tr, s, Cs.name || p);
|
|
2958
|
+
P = rr.error, p = rr.name, ne = ie(tr);
|
|
2959
2959
|
}
|
|
2960
2960
|
} else
|
|
2961
|
-
A([
|
|
2962
|
-
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && z(y._f.deps), K(
|
|
2961
|
+
A([p], !0), P = (await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation))[p], A([p]), x(De), _ && (P ? ne = !1 : (g.isValid || m.isValid) && (ne = await D(s, !0)));
|
|
2962
|
+
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && z(y._f.deps), K(p, ne, P, Et));
|
|
2963
2963
|
}
|
|
2964
|
-
}, X = (
|
|
2965
|
-
if (S(t.errors, d) &&
|
|
2966
|
-
return
|
|
2967
|
-
}, z = async (
|
|
2968
|
-
let
|
|
2969
|
-
const y = ut(
|
|
2964
|
+
}, X = (c, d) => {
|
|
2965
|
+
if (S(t.errors, d) && c.focus)
|
|
2966
|
+
return c.focus(), 1;
|
|
2967
|
+
}, z = async (c, d = {}) => {
|
|
2968
|
+
let p, _;
|
|
2969
|
+
const y = ut(c);
|
|
2970
2970
|
if (r.resolver) {
|
|
2971
|
-
const x = await N(G(
|
|
2972
|
-
|
|
2971
|
+
const x = await N(G(c) ? c : y);
|
|
2972
|
+
p = ie(x), _ = c ? !y.some((I) => S(x, I)) : p;
|
|
2973
2973
|
} else
|
|
2974
|
-
|
|
2974
|
+
c ? (_ = (await Promise.all(y.map(async (x) => {
|
|
2975
2975
|
const I = S(s, x);
|
|
2976
2976
|
return await D(I && I._f ? { [x]: I } : I);
|
|
2977
|
-
}))).every(Boolean), !(!_ && !t.isValid) && C()) : _ =
|
|
2977
|
+
}))).every(Boolean), !(!_ && !t.isValid) && C()) : _ = p = await D(s);
|
|
2978
2978
|
return b.state.next({
|
|
2979
|
-
...!ue(
|
|
2980
|
-
...r.resolver || !
|
|
2979
|
+
...!ue(c) || (g.isValid || m.isValid) && p !== t.isValid ? {} : { name: c },
|
|
2980
|
+
...r.resolver || !c ? { isValid: p } : {},
|
|
2981
2981
|
errors: t.errors
|
|
2982
|
-
}), d.shouldFocus && !_ && dt(s, X,
|
|
2983
|
-
}, rt = (
|
|
2984
|
-
let
|
|
2982
|
+
}), d.shouldFocus && !_ && dt(s, X, c ? y : o.mount), _;
|
|
2983
|
+
}, rt = (c, d) => {
|
|
2984
|
+
let p = {
|
|
2985
2985
|
...a.mount ? i : n
|
|
2986
2986
|
};
|
|
2987
|
-
return d && (
|
|
2988
|
-
}, $e = (
|
|
2989
|
-
invalid: !!S((d || t).errors,
|
|
2990
|
-
isDirty: !!S((d || t).dirtyFields,
|
|
2991
|
-
error: S((d || t).errors,
|
|
2992
|
-
isValidating: !!S(t.validatingFields,
|
|
2993
|
-
isTouched: !!S((d || t).touchedFields,
|
|
2994
|
-
}), O = (
|
|
2995
|
-
const d =
|
|
2996
|
-
d == null || d.forEach((
|
|
2987
|
+
return d && (p = ms(d.dirtyFields ? t.dirtyFields : t.touchedFields, p)), G(c) ? p : ue(c) ? S(p, c) : c.map((_) => S(p, _));
|
|
2988
|
+
}, $e = (c, d) => ({
|
|
2989
|
+
invalid: !!S((d || t).errors, c),
|
|
2990
|
+
isDirty: !!S((d || t).dirtyFields, c),
|
|
2991
|
+
error: S((d || t).errors, c),
|
|
2992
|
+
isValidating: !!S(t.validatingFields, c),
|
|
2993
|
+
isTouched: !!S((d || t).touchedFields, c)
|
|
2994
|
+
}), O = (c) => {
|
|
2995
|
+
const d = c ? ut(c) : void 0;
|
|
2996
|
+
d == null || d.forEach((p) => J(t.errors, p)), d ? d.forEach((p) => {
|
|
2997
2997
|
b.state.next({
|
|
2998
|
-
name:
|
|
2998
|
+
name: p,
|
|
2999
2999
|
errors: t.errors
|
|
3000
3000
|
});
|
|
3001
3001
|
}) : b.state.next({
|
|
3002
3002
|
errors: {}
|
|
3003
3003
|
});
|
|
3004
|
-
}, Be = (
|
|
3005
|
-
const _ = (S(s,
|
|
3006
|
-
H(t.errors,
|
|
3004
|
+
}, Be = (c, d, p) => {
|
|
3005
|
+
const _ = (S(s, c, { _f: {} })._f || {}).ref, y = S(t.errors, c) || {}, { ref: x, message: I, type: $, ...P } = y;
|
|
3006
|
+
H(t.errors, c, {
|
|
3007
3007
|
...P,
|
|
3008
3008
|
...d,
|
|
3009
3009
|
ref: _
|
|
3010
3010
|
}), b.state.next({
|
|
3011
|
-
name:
|
|
3011
|
+
name: c,
|
|
3012
3012
|
errors: t.errors,
|
|
3013
3013
|
isValid: !1
|
|
3014
|
-
}),
|
|
3015
|
-
}, Pe = (
|
|
3016
|
-
next: (
|
|
3017
|
-
}) : F(
|
|
3014
|
+
}), p && p.shouldFocus && _ && _.focus && _.focus();
|
|
3015
|
+
}, Pe = (c, d) => de(c) ? b.state.subscribe({
|
|
3016
|
+
next: (p) => "values" in p && c(F(void 0, d), p)
|
|
3017
|
+
}) : F(c, d, !0), Ae = (c) => b.state.subscribe({
|
|
3018
3018
|
next: (d) => {
|
|
3019
|
-
Ja(
|
|
3019
|
+
Ja(c.name, d.name, c.exact) && Ga(d, c.formState || g, mt, c.reRenderRoot) && c.callback({
|
|
3020
3020
|
values: { ...i },
|
|
3021
3021
|
...t,
|
|
3022
3022
|
...d,
|
|
3023
3023
|
defaultValues: n
|
|
3024
3024
|
});
|
|
3025
3025
|
}
|
|
3026
|
-
}).unsubscribe, Re = (
|
|
3026
|
+
}).unsubscribe, Re = (c) => (a.mount = !0, m = {
|
|
3027
3027
|
...m,
|
|
3028
|
-
...
|
|
3028
|
+
...c.formState
|
|
3029
3029
|
}, Ae({
|
|
3030
|
-
...
|
|
3030
|
+
...c,
|
|
3031
3031
|
formState: {
|
|
3032
|
-
...
|
|
3033
|
-
...
|
|
3032
|
+
...h,
|
|
3033
|
+
...c.formState
|
|
3034
3034
|
}
|
|
3035
|
-
})), qe = (
|
|
3036
|
-
for (const
|
|
3037
|
-
o.mount.delete(
|
|
3035
|
+
})), qe = (c, d = {}) => {
|
|
3036
|
+
for (const p of c ? ut(c) : o.mount)
|
|
3037
|
+
o.mount.delete(p), o.array.delete(p), d.keepValue || (J(s, p), J(i, p)), !d.keepError && J(t.errors, p), !d.keepDirty && J(t.dirtyFields, p), !d.keepTouched && J(t.touchedFields, p), !d.keepIsValidating && J(t.validatingFields, p), !r.shouldUnregister && !d.keepDefaultValue && J(n, p);
|
|
3038
3038
|
b.state.next({
|
|
3039
3039
|
values: Q(i)
|
|
3040
3040
|
}), b.state.next({
|
|
3041
3041
|
...t,
|
|
3042
3042
|
...d.keepDirty ? { isDirty: E() } : {}
|
|
3043
3043
|
}), !d.keepIsValid && C();
|
|
3044
|
-
}, st = ({ disabled:
|
|
3045
|
-
if (me(
|
|
3046
|
-
const y = o.disabled.has(d) !== !!
|
|
3047
|
-
|
|
3044
|
+
}, st = ({ disabled: c, name: d }) => {
|
|
3045
|
+
if (me(c) && a.mount || c || o.disabled.has(d)) {
|
|
3046
|
+
const y = o.disabled.has(d) !== !!c;
|
|
3047
|
+
c ? o.disabled.add(d) : o.disabled.delete(d), y && a.mount && !a.action && C();
|
|
3048
3048
|
}
|
|
3049
|
-
}, ve = (
|
|
3050
|
-
let
|
|
3049
|
+
}, ve = (c, d = {}) => {
|
|
3050
|
+
let p = S(s, c);
|
|
3051
3051
|
const _ = me(d.disabled) || me(r.disabled);
|
|
3052
|
-
return H(s,
|
|
3053
|
-
...
|
|
3052
|
+
return H(s, c, {
|
|
3053
|
+
...p || {},
|
|
3054
3054
|
_f: {
|
|
3055
|
-
...
|
|
3056
|
-
name:
|
|
3055
|
+
...p && p._f ? p._f : { ref: { name: c } },
|
|
3056
|
+
name: c,
|
|
3057
3057
|
mount: !0,
|
|
3058
3058
|
...d
|
|
3059
3059
|
}
|
|
3060
|
-
}), o.mount.add(
|
|
3060
|
+
}), o.mount.add(c), p ? st({
|
|
3061
3061
|
disabled: me(d.disabled) ? d.disabled : r.disabled,
|
|
3062
|
-
name:
|
|
3063
|
-
}) : M(
|
|
3062
|
+
name: c
|
|
3063
|
+
}) : M(c, !0, d.value), {
|
|
3064
3064
|
..._ ? { disabled: d.disabled || r.disabled } : {},
|
|
3065
3065
|
...r.progressive ? {
|
|
3066
3066
|
required: !!d.required,
|
|
@@ -3070,42 +3070,42 @@ function ei(e = {}) {
|
|
|
3070
3070
|
maxLength: it(d.maxLength),
|
|
3071
3071
|
pattern: it(d.pattern)
|
|
3072
3072
|
} : {},
|
|
3073
|
-
name:
|
|
3073
|
+
name: c,
|
|
3074
3074
|
onChange: te,
|
|
3075
3075
|
onBlur: te,
|
|
3076
3076
|
ref: (y) => {
|
|
3077
3077
|
if (y) {
|
|
3078
|
-
ve(
|
|
3079
|
-
const x = G(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, I = Pa(x), $ =
|
|
3080
|
-
if (I ? $.find((P) => P === x) : x ===
|
|
3078
|
+
ve(c, d), p = S(s, c);
|
|
3079
|
+
const x = G(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, I = Pa(x), $ = p._f.refs || [];
|
|
3080
|
+
if (I ? $.find((P) => P === x) : x === p._f.ref)
|
|
3081
3081
|
return;
|
|
3082
|
-
H(s,
|
|
3082
|
+
H(s, c, {
|
|
3083
3083
|
_f: {
|
|
3084
|
-
...
|
|
3084
|
+
...p._f,
|
|
3085
3085
|
...I ? {
|
|
3086
3086
|
refs: [
|
|
3087
3087
|
...$.filter(Dt),
|
|
3088
3088
|
x,
|
|
3089
|
-
...Array.isArray(S(n,
|
|
3089
|
+
...Array.isArray(S(n, c)) ? [{}] : []
|
|
3090
3090
|
],
|
|
3091
|
-
ref: { type: x.type, name:
|
|
3091
|
+
ref: { type: x.type, name: c }
|
|
3092
3092
|
} : { ref: x }
|
|
3093
3093
|
}
|
|
3094
|
-
}), M(
|
|
3094
|
+
}), M(c, !1, void 0, x);
|
|
3095
3095
|
} else
|
|
3096
|
-
|
|
3096
|
+
p = S(s, c, {}), p._f && (p._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Na(o.array, c) && a.action) && o.unMount.add(c);
|
|
3097
3097
|
}
|
|
3098
3098
|
};
|
|
3099
|
-
}, Ue = () => r.shouldFocusError && dt(s, X, o.mount), ht = (
|
|
3100
|
-
me(
|
|
3101
|
-
const _ = S(s,
|
|
3102
|
-
_ && (d.disabled = _._f.disabled ||
|
|
3103
|
-
y.disabled = _._f.disabled ||
|
|
3099
|
+
}, Ue = () => r.shouldFocusError && dt(s, X, o.mount), ht = (c) => {
|
|
3100
|
+
me(c) && (b.state.next({ disabled: c }), dt(s, (d, p) => {
|
|
3101
|
+
const _ = S(s, p);
|
|
3102
|
+
_ && (d.disabled = _._f.disabled || c, Array.isArray(_._f.refs) && _._f.refs.forEach((y) => {
|
|
3103
|
+
y.disabled = _._f.disabled || c;
|
|
3104
3104
|
}));
|
|
3105
3105
|
}, 0, !1));
|
|
3106
|
-
}, We = (
|
|
3106
|
+
}, We = (c, d) => async (p) => {
|
|
3107
3107
|
let _;
|
|
3108
|
-
|
|
3108
|
+
p && (p.preventDefault && p.preventDefault(), p.persist && p.persist());
|
|
3109
3109
|
let y = Q(i);
|
|
3110
3110
|
if (b.state.next({
|
|
3111
3111
|
isSubmitting: !0
|
|
@@ -3122,12 +3122,12 @@ function ei(e = {}) {
|
|
|
3122
3122
|
errors: {}
|
|
3123
3123
|
});
|
|
3124
3124
|
try {
|
|
3125
|
-
await
|
|
3125
|
+
await c(y, p);
|
|
3126
3126
|
} catch (x) {
|
|
3127
3127
|
_ = x;
|
|
3128
3128
|
}
|
|
3129
3129
|
} else
|
|
3130
|
-
d && await d({ ...t.errors },
|
|
3130
|
+
d && await d({ ...t.errors }, p), Ue(), setTimeout(Ue);
|
|
3131
3131
|
if (b.state.next({
|
|
3132
3132
|
isSubmitted: !0,
|
|
3133
3133
|
isSubmitting: !1,
|
|
@@ -3136,11 +3136,11 @@ function ei(e = {}) {
|
|
|
3136
3136
|
errors: t.errors
|
|
3137
3137
|
}), _)
|
|
3138
3138
|
throw _;
|
|
3139
|
-
}, ze = (
|
|
3140
|
-
S(s,
|
|
3141
|
-
}, Ne = (
|
|
3142
|
-
const
|
|
3143
|
-
if (d.keepDefaultValues || (n =
|
|
3139
|
+
}, ze = (c, d = {}) => {
|
|
3140
|
+
S(s, c) && (G(d.defaultValue) ? U(c, Q(S(n, c))) : (U(c, d.defaultValue), H(n, c, Q(d.defaultValue))), d.keepTouched || J(t.touchedFields, c), d.keepDirty || (J(t.dirtyFields, c), t.isDirty = d.defaultValue ? E(c, Q(S(n, c))) : E()), d.keepError || (J(t.errors, c), g.isValid && C()), b.state.next({ ...t }));
|
|
3141
|
+
}, Ne = (c, d = {}) => {
|
|
3142
|
+
const p = c ? Q(c) : n, _ = Q(p), y = ie(c), x = y ? n : _;
|
|
3143
|
+
if (d.keepDefaultValues || (n = p), !d.keepValues) {
|
|
3144
3144
|
if (d.keepDirtyValues) {
|
|
3145
3145
|
const I = /* @__PURE__ */ new Set([
|
|
3146
3146
|
...o.mount,
|
|
@@ -3151,7 +3151,7 @@ function ei(e = {}) {
|
|
|
3151
3151
|
P && !G(ne) ? H(x, $, ne) : !P && !G(De) && U($, De);
|
|
3152
3152
|
}
|
|
3153
3153
|
} else {
|
|
3154
|
-
if (Zt && G(
|
|
3154
|
+
if (Zt && G(c))
|
|
3155
3155
|
for (const I of o.mount) {
|
|
3156
3156
|
const $ = S(s, I);
|
|
3157
3157
|
if ($ && $._f) {
|
|
@@ -3187,27 +3187,27 @@ function ei(e = {}) {
|
|
|
3187
3187
|
focus: ""
|
|
3188
3188
|
}, a.mount = !g.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ie(x), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), b.state.next({
|
|
3189
3189
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3190
|
-
isDirty: y ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ve(
|
|
3190
|
+
isDirty: y ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ve(c, n)),
|
|
3191
3191
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3192
|
-
dirtyFields: y ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ke(n, i) : t.dirtyFields : d.keepDefaultValues &&
|
|
3192
|
+
dirtyFields: y ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ke(n, i) : t.dirtyFields : d.keepDefaultValues && c ? Ke(n, c) : d.keepDirty ? t.dirtyFields : {},
|
|
3193
3193
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
3194
3194
|
errors: d.keepErrors ? t.errors : {},
|
|
3195
3195
|
isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
3196
3196
|
isSubmitting: !1,
|
|
3197
3197
|
defaultValues: n
|
|
3198
3198
|
});
|
|
3199
|
-
}, nt = (
|
|
3200
|
-
const
|
|
3199
|
+
}, nt = (c, d) => Ne(de(c) ? c(i) : c, { ...r.resetOptions, ...d }), pt = (c, d = {}) => {
|
|
3200
|
+
const p = S(s, c), _ = p && p._f;
|
|
3201
3201
|
if (_) {
|
|
3202
3202
|
const y = _.refs ? _.refs[0] : _.ref;
|
|
3203
3203
|
y.focus && setTimeout(() => {
|
|
3204
3204
|
y.focus(), d.shouldSelect && de(y.select) && y.select();
|
|
3205
3205
|
});
|
|
3206
3206
|
}
|
|
3207
|
-
}, mt = (
|
|
3207
|
+
}, mt = (c) => {
|
|
3208
3208
|
t = {
|
|
3209
3209
|
...t,
|
|
3210
|
-
...
|
|
3210
|
+
...c
|
|
3211
3211
|
};
|
|
3212
3212
|
}, at = {
|
|
3213
3213
|
control: {
|
|
@@ -3228,8 +3228,8 @@ function ei(e = {}) {
|
|
|
3228
3228
|
_setErrors: V,
|
|
3229
3229
|
_getFieldArray: B,
|
|
3230
3230
|
_reset: Ne,
|
|
3231
|
-
_resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((
|
|
3232
|
-
nt(
|
|
3231
|
+
_resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((c) => {
|
|
3232
|
+
nt(c, r.resetOptions), b.state.next({
|
|
3233
3233
|
isLoading: !1
|
|
3234
3234
|
});
|
|
3235
3235
|
}),
|
|
@@ -3246,8 +3246,8 @@ function ei(e = {}) {
|
|
|
3246
3246
|
get _state() {
|
|
3247
3247
|
return a;
|
|
3248
3248
|
},
|
|
3249
|
-
set _state(
|
|
3250
|
-
a =
|
|
3249
|
+
set _state(c) {
|
|
3250
|
+
a = c;
|
|
3251
3251
|
},
|
|
3252
3252
|
get _defaultValues() {
|
|
3253
3253
|
return n;
|
|
@@ -3255,8 +3255,8 @@ function ei(e = {}) {
|
|
|
3255
3255
|
get _names() {
|
|
3256
3256
|
return o;
|
|
3257
3257
|
},
|
|
3258
|
-
set _names(
|
|
3259
|
-
o =
|
|
3258
|
+
set _names(c) {
|
|
3259
|
+
o = c;
|
|
3260
3260
|
},
|
|
3261
3261
|
get _formState() {
|
|
3262
3262
|
return t;
|
|
@@ -3264,10 +3264,10 @@ function ei(e = {}) {
|
|
|
3264
3264
|
get _options() {
|
|
3265
3265
|
return r;
|
|
3266
3266
|
},
|
|
3267
|
-
set _options(
|
|
3267
|
+
set _options(c) {
|
|
3268
3268
|
r = {
|
|
3269
3269
|
...r,
|
|
3270
|
-
...
|
|
3270
|
+
...c
|
|
3271
3271
|
};
|
|
3272
3272
|
}
|
|
3273
3273
|
},
|
|
@@ -3387,15 +3387,15 @@ var St = function(e, r, t) {
|
|
|
3387
3387
|
var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3388
3388
|
return Promise.resolve(/* @__PURE__ */ pa(e, s, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3389
3389
|
if (o.issues) {
|
|
3390
|
-
for (var
|
|
3391
|
-
var f = o.issues[0],
|
|
3392
|
-
if (
|
|
3393
|
-
var g =
|
|
3394
|
-
|
|
3390
|
+
for (var u = {}; o.issues.length; ) {
|
|
3391
|
+
var f = o.issues[0], h = /* @__PURE__ */ oa(f);
|
|
3392
|
+
if (h && (u[h] || (u[h] = { message: f.message, type: f.type }), a)) {
|
|
3393
|
+
var g = u[h].types, m = g && g[f.type];
|
|
3394
|
+
u[h] = ps(h, a, u, f.type, m ? [].concat(m, f.message) : f.message);
|
|
3395
3395
|
}
|
|
3396
3396
|
o.issues.shift();
|
|
3397
3397
|
}
|
|
3398
|
-
return { values: {}, errors: ri(
|
|
3398
|
+
return { values: {}, errors: ri(u, i) };
|
|
3399
3399
|
}
|
|
3400
3400
|
return { values: t.raw ? s : o.output, errors: {} };
|
|
3401
3401
|
});
|
|
@@ -3443,14 +3443,14 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3443
3443
|
input: e,
|
|
3444
3444
|
onSubmitSuccess: r
|
|
3445
3445
|
}) => {
|
|
3446
|
-
var
|
|
3447
|
-
const t = e.key ? (
|
|
3446
|
+
var h, g;
|
|
3447
|
+
const t = e.key ? (h = q.current$.value.flow) == null ? void 0 : h.data.submissions[e.key] : void 0, s = e.config.maxSelected === 1, n = s && e.config.options.length === 2, {
|
|
3448
3448
|
t: i
|
|
3449
3449
|
} = re(), {
|
|
3450
3450
|
register: a,
|
|
3451
3451
|
handleSubmit: o,
|
|
3452
3452
|
formState: {
|
|
3453
|
-
errors:
|
|
3453
|
+
errors: u
|
|
3454
3454
|
}
|
|
3455
3455
|
} = Ct({
|
|
3456
3456
|
defaultValues: {
|
|
@@ -3546,7 +3546,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3546
3546
|
}), l("div", {
|
|
3547
3547
|
class: "px-1",
|
|
3548
3548
|
children: l(tt, {
|
|
3549
|
-
error: (g =
|
|
3549
|
+
error: (g = u.checked) == null ? void 0 : g.root
|
|
3550
3550
|
})
|
|
3551
3551
|
})]
|
|
3552
3552
|
});
|
|
@@ -3580,14 +3580,14 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3580
3580
|
},
|
|
3581
3581
|
resolver: ci(e.config, n)
|
|
3582
3582
|
}), {
|
|
3583
|
-
ref:
|
|
3583
|
+
ref: u,
|
|
3584
3584
|
...f
|
|
3585
3585
|
} = i("number", {
|
|
3586
3586
|
required: !e.config.optional,
|
|
3587
3587
|
valueAsNumber: !0
|
|
3588
|
-
}),
|
|
3588
|
+
}), h = ye();
|
|
3589
3589
|
return Le(() => {
|
|
3590
|
-
|
|
3590
|
+
h.current && (h.current.focus(), h.current.select());
|
|
3591
3591
|
}, []), l("form", {
|
|
3592
3592
|
class: "flex flex-col gap-1 p-2.5",
|
|
3593
3593
|
onSubmit: a((m) => {
|
|
@@ -3608,7 +3608,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3608
3608
|
autoCorrect: "off",
|
|
3609
3609
|
autoFocus: !0,
|
|
3610
3610
|
ref: (m) => {
|
|
3611
|
-
m && (
|
|
3611
|
+
m && (h.current = m), u(m);
|
|
3612
3612
|
},
|
|
3613
3613
|
type: "text",
|
|
3614
3614
|
min: e.config.min,
|
|
@@ -3642,11 +3642,11 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3642
3642
|
t: s
|
|
3643
3643
|
} = re(), [n, i] = ke(), a = hi(t) ? ma(t.value) : pi(t) ? t.value : void 0, {
|
|
3644
3644
|
register: o,
|
|
3645
|
-
handleSubmit:
|
|
3645
|
+
handleSubmit: u,
|
|
3646
3646
|
formState: {
|
|
3647
3647
|
errors: f
|
|
3648
3648
|
},
|
|
3649
|
-
watch:
|
|
3649
|
+
watch: h
|
|
3650
3650
|
} = Ct({
|
|
3651
3651
|
defaultValues: {
|
|
3652
3652
|
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? di,
|
|
@@ -3658,13 +3658,13 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3658
3658
|
...m
|
|
3659
3659
|
} = o("phoneNumber", {
|
|
3660
3660
|
required: !e.config.optional
|
|
3661
|
-
}), b = ye(), k =
|
|
3661
|
+
}), b = ye(), k = h("countryCode");
|
|
3662
3662
|
return Le(() => {
|
|
3663
3663
|
b.current && (b.current.focus(), b.current.select());
|
|
3664
3664
|
}, []), l("form", {
|
|
3665
3665
|
noValidate: !0,
|
|
3666
3666
|
class: "flex flex-col gap-1 p-2.5",
|
|
3667
|
-
onSubmit:
|
|
3667
|
+
onSubmit: u((C) => {
|
|
3668
3668
|
const A = C.phoneNumber.replace(/[^0-9]/g, ""), v = C.countryCode.replace(/[^0-9]/g, "");
|
|
3669
3669
|
i(void 0);
|
|
3670
3670
|
const R = e.config.minChars ?? 7, V = A.length + v.length;
|
|
@@ -3750,15 +3750,15 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3750
3750
|
locale: s
|
|
3751
3751
|
} = re(), {
|
|
3752
3752
|
availableAt: n
|
|
3753
|
-
} = e.config, [i, a] = ke(() => yt(n)), [o,
|
|
3753
|
+
} = e.config, [i, a] = ke(() => yt(n)), [o, u] = ke("");
|
|
3754
3754
|
zr(() => {
|
|
3755
|
-
const
|
|
3756
|
-
if (a(
|
|
3755
|
+
const h = yt(n);
|
|
3756
|
+
if (a(h), h === 0)
|
|
3757
3757
|
return;
|
|
3758
|
-
|
|
3758
|
+
u(Dr(t, s, n, h));
|
|
3759
3759
|
const g = setInterval(() => {
|
|
3760
3760
|
const m = yt(n);
|
|
3761
|
-
a(m), !(m > 0) && (clearInterval(g),
|
|
3761
|
+
a(m), !(m > 0) && (clearInterval(g), u(t("submission_cooldown_ready")));
|
|
3762
3762
|
}, 250);
|
|
3763
3763
|
return () => clearInterval(g);
|
|
3764
3764
|
}, [n, s, t]);
|
|
@@ -3852,7 +3852,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3852
3852
|
} = re(), s = e.key ? (w = q.current$.value.flow) == null ? void 0 : w.data.submissions[e.key] : void 0, n = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
|
|
3853
3853
|
register: a,
|
|
3854
3854
|
handleSubmit: o,
|
|
3855
|
-
watch:
|
|
3855
|
+
watch: u,
|
|
3856
3856
|
formState: {
|
|
3857
3857
|
errors: f
|
|
3858
3858
|
}
|
|
@@ -3862,7 +3862,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3862
3862
|
},
|
|
3863
3863
|
resolver: _i(e.config, t)
|
|
3864
3864
|
}), {
|
|
3865
|
-
ref:
|
|
3865
|
+
ref: h,
|
|
3866
3866
|
...g
|
|
3867
3867
|
} = a("text", {
|
|
3868
3868
|
required: !e.config.optional
|
|
@@ -3870,7 +3870,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3870
3870
|
Le(() => {
|
|
3871
3871
|
m.current && (m.current instanceof HTMLTextAreaElement && Tr(m.current), m.current.focus(), m.current.select());
|
|
3872
3872
|
}, []);
|
|
3873
|
-
const b = e.config.maxChars, k = i && b !== void 0 ?
|
|
3873
|
+
const b = e.config.maxChars, k = i && b !== void 0 ? u("text").length : void 0;
|
|
3874
3874
|
return l("form", {
|
|
3875
3875
|
noValidate: !0,
|
|
3876
3876
|
class: "flex flex-col gap-1 p-2.5",
|
|
@@ -3897,7 +3897,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3897
3897
|
C.key === "Enter" && (C.ctrlKey || C.metaKey) && (C.preventDefault(), (A = C.currentTarget.form) == null || A.requestSubmit());
|
|
3898
3898
|
},
|
|
3899
3899
|
ref: (C) => {
|
|
3900
|
-
C && (m.current = C),
|
|
3900
|
+
C && (m.current = C), h(C);
|
|
3901
3901
|
},
|
|
3902
3902
|
placeholder: e.config.placeholder,
|
|
3903
3903
|
class: Ye({
|
|
@@ -3913,7 +3913,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3913
3913
|
autoCorrect: "off",
|
|
3914
3914
|
autoFocus: !0,
|
|
3915
3915
|
ref: (C) => {
|
|
3916
|
-
C && (m.current = C),
|
|
3916
|
+
C && (m.current = C), h(C);
|
|
3917
3917
|
},
|
|
3918
3918
|
placeholder: e.config.placeholder,
|
|
3919
3919
|
class: Ye({
|
|
@@ -4014,7 +4014,7 @@ function Vi(e, r, t) {
|
|
|
4014
4014
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4015
4015
|
var i = r;
|
|
4016
4016
|
Ii(i) || (i = new RegExp("(" + Ei(i) + ")", "gi"));
|
|
4017
|
-
for (var a = e.split(i), o = 1,
|
|
4017
|
+
for (var a = e.split(i), o = 1, u = a.length; o < u; o += 2) {
|
|
4018
4018
|
if (a[o] === void 0 || a[o - 1] === void 0) {
|
|
4019
4019
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
4020
4020
|
continue;
|
|
@@ -4029,24 +4029,24 @@ var Mi = function(r, t, s) {
|
|
|
4029
4029
|
}));
|
|
4030
4030
|
};
|
|
4031
4031
|
const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]+)\]\(([^)]+)\)/, Ni = /(https?:\/\/[^\s]+)/g, Di = /_(.*?)_/g, Ti = /\*\*(.*?)\*\*/g, Oi = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", ji = (e) => {
|
|
4032
|
-
const r = ot(e, Li, (o,
|
|
4033
|
-
const [, f,
|
|
4034
|
-
return
|
|
4032
|
+
const r = ot(e, Li, (o, u) => {
|
|
4033
|
+
const [, f, h] = o.match(Ri) ?? [];
|
|
4034
|
+
return h ? l("a", {
|
|
4035
4035
|
class: Or,
|
|
4036
|
-
href:
|
|
4037
|
-
children: f ??
|
|
4038
|
-
},
|
|
4036
|
+
href: h,
|
|
4037
|
+
children: f ?? h
|
|
4038
|
+
}, h + u) : l("span", {
|
|
4039
4039
|
children: "INVALID LINK"
|
|
4040
4040
|
});
|
|
4041
|
-
}), t = ot(r, Ni, (o,
|
|
4041
|
+
}), t = ot(r, Ni, (o, u) => l("a", {
|
|
4042
4042
|
class: Or,
|
|
4043
4043
|
href: o,
|
|
4044
4044
|
children: o
|
|
4045
|
-
}, o +
|
|
4045
|
+
}, o + u)), s = ot(t, Di, (o, u) => l("em", {
|
|
4046
4046
|
children: o
|
|
4047
|
-
}, o +
|
|
4047
|
+
}, o + u)), n = ot(s, Ti, (o, u) => l("strong", {
|
|
4048
4048
|
children: o
|
|
4049
|
-
}, o +
|
|
4049
|
+
}, o + u));
|
|
4050
4050
|
let i = 0;
|
|
4051
4051
|
return ot(n, Oi, () => l("br", {}, `br-${i++}`));
|
|
4052
4052
|
}, $i = xt("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", {
|
|
@@ -4084,14 +4084,15 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4084
4084
|
flow: e,
|
|
4085
4085
|
rpcClient: r
|
|
4086
4086
|
}) => {
|
|
4087
|
+
var u;
|
|
4087
4088
|
const {
|
|
4088
4089
|
t
|
|
4089
4090
|
} = re(), s = e.data.flowSessionId, n = jr.get(s) ?? Ks("offer");
|
|
4090
4091
|
jr.set(s, n);
|
|
4091
|
-
const i = (
|
|
4092
|
-
const
|
|
4093
|
-
return (
|
|
4094
|
-
}, a = i("email") || e.nodes.flatMap((
|
|
4092
|
+
const i = (f) => {
|
|
4093
|
+
const h = e.data.submissions[f];
|
|
4094
|
+
return (h == null ? void 0 : h.type) === "string" ? h.value.trim() : void 0;
|
|
4095
|
+
}, a = i("email") || e.nodes.flatMap((f) => f.type === "question-text" && f.data.format === "email" ? [i(f.data.key)] : []).find((f) => !!f);
|
|
4095
4096
|
if (!a || n.value === "declined")
|
|
4096
4097
|
return null;
|
|
4097
4098
|
if (n.value === "success")
|
|
@@ -4144,7 +4145,9 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4144
4145
|
})]
|
|
4145
4146
|
}), l("p", {
|
|
4146
4147
|
class: "text-xs",
|
|
4147
|
-
children: t("
|
|
4148
|
+
children: (u = e.employer) != null && u.trim() ? t("job_alerts_privacy_sender", {
|
|
4149
|
+
employer: e.employer.trim()
|
|
4150
|
+
}) : t("job_alerts_privacy")
|
|
4148
4151
|
})]
|
|
4149
4152
|
});
|
|
4150
4153
|
}, qi = ({
|
|
@@ -4208,67 +4211,67 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4208
4211
|
}) => {
|
|
4209
4212
|
const {
|
|
4210
4213
|
t: s
|
|
4211
|
-
} = re(), n = q.current$.value.flow, i = (n == null ? void 0 : n.data.messages) ?? [], a = i.findIndex((
|
|
4214
|
+
} = re(), n = q.current$.value.flow, i = (n == null ? void 0 : n.data.messages) ?? [], a = i.findIndex((u) => u.type === "system" && u.semantic === "submission-closed"), o = n ? zt(n) : void 0;
|
|
4212
4215
|
return l("ol", {
|
|
4213
4216
|
"aria-label": s("chat_messages"),
|
|
4214
4217
|
"aria-live": "polite",
|
|
4215
4218
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4216
|
-
children: [i.map((
|
|
4219
|
+
children: [i.map((u, f) => l(be, {
|
|
4217
4220
|
children: [l("li", {
|
|
4218
4221
|
class: "flex",
|
|
4219
4222
|
tabIndex: f === i.length - 1 ? -1 : void 0,
|
|
4220
|
-
children: [o &&
|
|
4223
|
+
children: [o && u.groupId === o && !i.slice(f + 1).some((h) => h.groupId === o) ? r : null, Gs(u).with({
|
|
4221
4224
|
type: "system"
|
|
4222
|
-
}, (
|
|
4225
|
+
}, (h) => l("p", {
|
|
4223
4226
|
class: zi({
|
|
4224
|
-
variant:
|
|
4227
|
+
variant: h.variant
|
|
4225
4228
|
}),
|
|
4226
|
-
children:
|
|
4229
|
+
children: h.text
|
|
4227
4230
|
})).with({
|
|
4228
4231
|
type: "text",
|
|
4229
4232
|
author: Js.union("bot", "user")
|
|
4230
|
-
}, (
|
|
4231
|
-
const g = f === i.length - 1, m =
|
|
4233
|
+
}, (h) => {
|
|
4234
|
+
const g = f === i.length - 1, m = h.author === "bot" ? ji(h.text) : h.text;
|
|
4232
4235
|
return l(be, {
|
|
4233
4236
|
children: l(Bi, {
|
|
4234
4237
|
animate: g,
|
|
4235
|
-
side: Wi[
|
|
4238
|
+
side: Wi[h.author],
|
|
4236
4239
|
children: m
|
|
4237
4240
|
}, f)
|
|
4238
4241
|
});
|
|
4239
4242
|
}).with({
|
|
4240
4243
|
type: "link"
|
|
4241
|
-
}, (
|
|
4242
|
-
message:
|
|
4244
|
+
}, (h) => l(qi, {
|
|
4245
|
+
message: h
|
|
4243
4246
|
})).with({
|
|
4244
4247
|
type: "image"
|
|
4245
|
-
}, (
|
|
4248
|
+
}, (h) => l("img", {
|
|
4246
4249
|
class: "shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",
|
|
4247
|
-
src:
|
|
4250
|
+
src: h.url,
|
|
4248
4251
|
style: {
|
|
4249
|
-
aspectRatio:
|
|
4252
|
+
aspectRatio: h.width / h.height
|
|
4250
4253
|
}
|
|
4251
4254
|
})).with({
|
|
4252
4255
|
type: "file"
|
|
4253
|
-
}, (
|
|
4254
|
-
class:
|
|
4256
|
+
}, (h) => l(Ia, {
|
|
4257
|
+
class: h.author === "bot" ? void 0 : "ml-auto",
|
|
4255
4258
|
file: {
|
|
4256
|
-
name:
|
|
4257
|
-
sizeKb:
|
|
4259
|
+
name: h.fileName,
|
|
4260
|
+
sizeKb: h.fileSizeKb
|
|
4258
4261
|
}
|
|
4259
4262
|
})).with({
|
|
4260
4263
|
type: "loading"
|
|
4261
|
-
}, (
|
|
4264
|
+
}, (h) => {
|
|
4262
4265
|
const g = i[i.length - 1];
|
|
4263
|
-
return !(
|
|
4266
|
+
return !(h === g) || ce.isBotTyping$.value || n != null && n.data.isFinished ? null : l("div", {
|
|
4264
4267
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4265
4268
|
children: [l(Ut, {
|
|
4266
|
-
"aria-hidden":
|
|
4269
|
+
"aria-hidden": h.text ? "true" : void 0,
|
|
4267
4270
|
class: "text-neutral-6 h-8 w-8"
|
|
4268
|
-
}),
|
|
4271
|
+
}), h.text ? l("p", {
|
|
4269
4272
|
role: "status",
|
|
4270
4273
|
class: "text-neutral-11 text-sm",
|
|
4271
|
-
children:
|
|
4274
|
+
children: h.text
|
|
4272
4275
|
}) : null]
|
|
4273
4276
|
});
|
|
4274
4277
|
}).exhaustive()]
|
|
@@ -4305,10 +4308,10 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4305
4308
|
} = q.current$.value;
|
|
4306
4309
|
Oe(a, "Flow is required to exist to show chatbot body");
|
|
4307
4310
|
const o = q.viewState$.value, {
|
|
4308
|
-
chatRef:
|
|
4311
|
+
chatRef: u,
|
|
4309
4312
|
chatService: f
|
|
4310
4313
|
} = Zs(), {
|
|
4311
|
-
t:
|
|
4314
|
+
t: h
|
|
4312
4315
|
} = re(), [g, m] = ke();
|
|
4313
4316
|
return Le(() => {
|
|
4314
4317
|
o === "maximised" && ce.scrollToEnd();
|
|
@@ -4319,7 +4322,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4319
4322
|
flow: k
|
|
4320
4323
|
} = q.current$.peek();
|
|
4321
4324
|
if (b !== "loaded")
|
|
4322
|
-
throw new Error(
|
|
4325
|
+
throw new Error(h("invalid_state"));
|
|
4323
4326
|
let w = k.data.nodeHistory.at(-1);
|
|
4324
4327
|
if (ce.scrollToEnd(), q.setInput(void 0), k.data.isFinished)
|
|
4325
4328
|
return;
|
|
@@ -4343,7 +4346,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4343
4346
|
talentBankClient: n,
|
|
4344
4347
|
flow: a,
|
|
4345
4348
|
chatService: f,
|
|
4346
|
-
t:
|
|
4349
|
+
t: h,
|
|
4347
4350
|
getApplicationRecovery: () => {
|
|
4348
4351
|
var T;
|
|
4349
4352
|
return (T = q.current$.peek().flow) == null ? void 0 : T.data.applicationRecovery;
|
|
@@ -4377,7 +4380,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4377
4380
|
}, ee = new AbortController();
|
|
4378
4381
|
return k.offerResume ? ta({
|
|
4379
4382
|
chatService: f,
|
|
4380
|
-
t:
|
|
4383
|
+
t: h,
|
|
4381
4384
|
signal: ee.signal
|
|
4382
4385
|
}).then((T) => (q.settleResume(k), T ? M() : (q.restart(), Xs.flushStateData()))).catch((T) => {
|
|
4383
4386
|
T instanceof Pr || e.error("Resume prompt failed", T);
|
|
@@ -4385,13 +4388,13 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4385
4388
|
ee.abort(), ce.onInteractionFn$.value === C && (ce.onInteractionFn$.value = () => {
|
|
4386
4389
|
}), v();
|
|
4387
4390
|
};
|
|
4388
|
-
}, [s, r, f, e, a, n,
|
|
4391
|
+
}, [s, r, f, e, a, n, h]), l(be, {
|
|
4389
4392
|
children: [l("div", {
|
|
4390
4393
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4391
4394
|
children: [l("div", {
|
|
4392
|
-
ref:
|
|
4395
|
+
ref: u,
|
|
4393
4396
|
role: "region",
|
|
4394
|
-
"aria-label":
|
|
4397
|
+
"aria-label": h("conversation_history"),
|
|
4395
4398
|
tabIndex: 0,
|
|
4396
4399
|
className: "hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",
|
|
4397
4400
|
style: {
|
|
@@ -4408,10 +4411,10 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4408
4411
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4409
4412
|
children: l(Kr, {
|
|
4410
4413
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4411
|
-
"aria-label":
|
|
4414
|
+
"aria-label": h("jump_to_current"),
|
|
4412
4415
|
onClick: () => {
|
|
4413
4416
|
var k, w;
|
|
4414
|
-
ce.scrollToEnd(), (w = ((k =
|
|
4417
|
+
ce.scrollToEnd(), (w = ((k = u.current) == null ? void 0 : k.querySelector('li[tabindex="-1"]')) ?? u.current) == null || w.focus({
|
|
4415
4418
|
preventScroll: !0
|
|
4416
4419
|
});
|
|
4417
4420
|
},
|