@inploi/plugin-chatbot 14.4.0 → 14.5.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-1daebc9e.cjs +5 -0
- package/dist/{chatbot-body-6b8fe3ae.js → chatbot-body-389badb2.js} +477 -472
- package/dist/chatbot.state.d.ts +1 -0
- package/dist/chatbot.utils.d.ts +1 -0
- package/dist/components/chat-input/chat-input.address.d.ts +1 -0
- package/dist/{index-7898ce86.cjs → index-94e88490.cjs} +1 -1
- package/dist/{index-d67c1a3c.js → index-985be818.js} +1 -1
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +3 -3
- package/dist/chatbot-body-3bc5386e.cjs +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as yr, Q as rt, _ as xt, J as ze, Y as mr, g as gr, a as kt, A as ss, z as ns, j as
|
|
1
|
+
import { G as yr, Q as rt, _ as xt, J as ze, Y as mr, g as gr, a as kt, A as ss, z as ns, j as is, F as br, I as as, K as os, Z as ls, W as $t, u as se, o as u, c as Oe, b as st, h as me, d as ce, i as Me, y as Ie, k as be, L as Ct, e as us, s as $, p as vr, f as xr, l as cs, m as Re, H as qt, C as ee, n as ae, M as ds, q as fs, r as hs, S as wr, t as ps } from "./index-985be818.js";
|
|
2
2
|
import { isApiErrorWithData as ys, ApiError as ms } from "@inploi/sdk";
|
|
3
3
|
const Ut = (e, r, t) => {
|
|
4
4
|
var s;
|
|
@@ -16,15 +16,15 @@ const Ut = (e, r, t) => {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
19
|
-
let [
|
|
20
|
-
if (!
|
|
19
|
+
let [i, ...a] = e.compareKey.split(".");
|
|
20
|
+
if (!i)
|
|
21
21
|
return !1;
|
|
22
|
-
let n = yr({ context: r, key:
|
|
22
|
+
let n = yr({ context: r, key: i, path: a, submissions: t });
|
|
23
23
|
if (!n)
|
|
24
24
|
return !1;
|
|
25
25
|
switch (n.type) {
|
|
26
26
|
case "address": {
|
|
27
|
-
let o = xt(n.value,
|
|
27
|
+
let o = xt(n.value, a);
|
|
28
28
|
switch (e.compare) {
|
|
29
29
|
case "equals":
|
|
30
30
|
return o === e.compareValue;
|
|
@@ -40,7 +40,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
40
40
|
case "integration": {
|
|
41
41
|
if (typeof n.value != "object" || Array.isArray(n.value))
|
|
42
42
|
return !1;
|
|
43
|
-
let o = xt(n.value,
|
|
43
|
+
let o = xt(n.value, a), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
44
44
|
switch (typeof o) {
|
|
45
45
|
case "boolean":
|
|
46
46
|
return Ue(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
@@ -116,20 +116,20 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
116
116
|
}, Ue = (e, { context: r, submissions: t }) => {
|
|
117
117
|
let s = "combinator" in e.data ? e.data.conditions : [e.data];
|
|
118
118
|
if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
|
|
119
|
-
for (let
|
|
120
|
-
if (zt({ condition:
|
|
119
|
+
for (let i of s)
|
|
120
|
+
if (zt({ condition: i, context: r, submissions: t, ifBlock: e }))
|
|
121
121
|
return !0;
|
|
122
122
|
return !1;
|
|
123
123
|
} else {
|
|
124
|
-
for (let
|
|
125
|
-
if (!zt({ condition:
|
|
124
|
+
for (let i of s)
|
|
125
|
+
if (!zt({ condition: i, context: r, submissions: t, ifBlock: e }))
|
|
126
126
|
return !1;
|
|
127
127
|
return !0;
|
|
128
128
|
}
|
|
129
|
-
}, gs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, bs = (e, { context: r, submissions: t }) => e.replace(gs, (s,
|
|
130
|
-
let [n, ...o] =
|
|
129
|
+
}, gs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, bs = (e, { context: r, submissions: t }) => e.replace(gs, (s, i, a = "") => {
|
|
130
|
+
let [n, ...o] = i.trim().split("."), c = yr({ key: n, path: o, submissions: t, context: r });
|
|
131
131
|
if (!c)
|
|
132
|
-
return
|
|
132
|
+
return a;
|
|
133
133
|
switch (c.type) {
|
|
134
134
|
case "boolean":
|
|
135
135
|
return c.value === !0 ? "true" : "false";
|
|
@@ -141,7 +141,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
141
141
|
return Object.values(c.value).filter((h) => h && h.trim().length > 0).join(", ");
|
|
142
142
|
case "number":
|
|
143
143
|
case "string":
|
|
144
|
-
return c.value ? c.value.toString() :
|
|
144
|
+
return c.value ? c.value.toString() : a;
|
|
145
145
|
case "phone":
|
|
146
146
|
return rt(c.value);
|
|
147
147
|
case "integration": {
|
|
@@ -162,7 +162,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return a;
|
|
166
166
|
});
|
|
167
167
|
const _r = ({
|
|
168
168
|
context: e,
|
|
@@ -177,7 +177,7 @@ const _r = ({
|
|
|
177
177
|
}) => {
|
|
178
178
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
179
179
|
return e;
|
|
180
|
-
const s = e.nextId ? r.find((
|
|
180
|
+
const s = e.nextId ? r.find((i) => i.id === e.nextId) : void 0;
|
|
181
181
|
if (s)
|
|
182
182
|
return kr({
|
|
183
183
|
node: s,
|
|
@@ -188,28 +188,28 @@ const _r = ({
|
|
|
188
188
|
childNode: e,
|
|
189
189
|
nodes: r
|
|
190
190
|
}) => {
|
|
191
|
-
const s = r.filter((
|
|
192
|
-
if (!
|
|
191
|
+
const s = r.filter((i) => i.type === "if-block").find((i) => {
|
|
192
|
+
if (!i.branchId)
|
|
193
193
|
return !1;
|
|
194
|
-
const
|
|
195
|
-
if (!
|
|
194
|
+
const a = r.find((o) => o.id === i.branchId);
|
|
195
|
+
if (!a)
|
|
196
196
|
return !1;
|
|
197
197
|
const n = kr({
|
|
198
|
-
node:
|
|
198
|
+
node: a,
|
|
199
199
|
nodes: r,
|
|
200
200
|
stopWhen: (o) => o.id === e.id
|
|
201
201
|
});
|
|
202
202
|
return !(!n || n.id !== e.id);
|
|
203
203
|
});
|
|
204
204
|
if (s != null && s.nextId)
|
|
205
|
-
return r.find((
|
|
205
|
+
return r.find((i) => i.id === s.nextId);
|
|
206
206
|
}, ws = ({
|
|
207
207
|
flow: e,
|
|
208
208
|
analytics: r,
|
|
209
209
|
logger: t,
|
|
210
210
|
talentBankClient: s,
|
|
211
|
-
context:
|
|
212
|
-
apiClient:
|
|
211
|
+
context: i,
|
|
212
|
+
apiClient: a,
|
|
213
213
|
getSubmissions: n,
|
|
214
214
|
getApplicationRecovery: o,
|
|
215
215
|
setApplicationRecovery: c,
|
|
@@ -254,8 +254,8 @@ const _r = ({
|
|
|
254
254
|
analytics: E,
|
|
255
255
|
logger: t,
|
|
256
256
|
talentBankClient: s,
|
|
257
|
-
apiClient:
|
|
258
|
-
context:
|
|
257
|
+
apiClient: a,
|
|
258
|
+
context: i,
|
|
259
259
|
node: y,
|
|
260
260
|
submissions: M,
|
|
261
261
|
applicationRecovery: D,
|
|
@@ -456,8 +456,8 @@ async function Cs({
|
|
|
456
456
|
node: r,
|
|
457
457
|
talentBankClient: t,
|
|
458
458
|
submissions: s,
|
|
459
|
-
flow:
|
|
460
|
-
logger:
|
|
459
|
+
flow: i,
|
|
460
|
+
logger: a,
|
|
461
461
|
chat: n
|
|
462
462
|
}) {
|
|
463
463
|
var c;
|
|
@@ -465,7 +465,7 @@ async function Cs({
|
|
|
465
465
|
isDuplicate: !1
|
|
466
466
|
};
|
|
467
467
|
if (s && t) {
|
|
468
|
-
const h = r.data.scope === "job" ? (c =
|
|
468
|
+
const h = r.data.scope === "job" ? (c = i.job) == null ? void 0 : c.id : void 0;
|
|
469
469
|
if (r.data.scope === "company" || h != null)
|
|
470
470
|
try {
|
|
471
471
|
o = await t.checkDuplicate({
|
|
@@ -477,7 +477,7 @@ async function Cs({
|
|
|
477
477
|
scope: r.data.scope
|
|
478
478
|
});
|
|
479
479
|
} catch (b) {
|
|
480
|
-
|
|
480
|
+
a.error("[check-duplicate]", b);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
n.setSubmission(r.data.key, {
|
|
@@ -496,7 +496,7 @@ async function Is({
|
|
|
496
496
|
node: r,
|
|
497
497
|
logger: t,
|
|
498
498
|
submissions: s,
|
|
499
|
-
context:
|
|
499
|
+
context: i
|
|
500
500
|
}) {
|
|
501
501
|
if (!s) {
|
|
502
502
|
t.error("Submissions not found");
|
|
@@ -506,7 +506,7 @@ async function Is({
|
|
|
506
506
|
type: "string",
|
|
507
507
|
value: de(r.data.value, {
|
|
508
508
|
submissions: s,
|
|
509
|
-
context:
|
|
509
|
+
context: i
|
|
510
510
|
})
|
|
511
511
|
}, e(r.nextId);
|
|
512
512
|
}
|
|
@@ -516,10 +516,10 @@ const Fs = 5e3, Cr = 3e4, Vs = 2e4, As = 6e4, Sr = 12e4, Ms = (e, r, t) => {
|
|
|
516
516
|
key: e,
|
|
517
517
|
until: Date.now() + Cr
|
|
518
518
|
};
|
|
519
|
-
const s = ((r == null ? void 0 : r.throttles) ?? 0) + 1,
|
|
519
|
+
const s = ((r == null ? void 0 : r.throttles) ?? 0) + 1, i = Math.min(s * Vs, As), a = (t.retryAfterSeconds ?? 0) * 1e3;
|
|
520
520
|
return {
|
|
521
521
|
key: e,
|
|
522
|
-
until: Date.now() + Math.min(Math.max(
|
|
522
|
+
until: Date.now() + Math.min(Math.max(i, a), Sr),
|
|
523
523
|
throttles: s
|
|
524
524
|
};
|
|
525
525
|
};
|
|
@@ -528,8 +528,8 @@ async function Es({
|
|
|
528
528
|
next: r,
|
|
529
529
|
end: t,
|
|
530
530
|
node: s,
|
|
531
|
-
logger:
|
|
532
|
-
apiClient:
|
|
531
|
+
logger: i,
|
|
532
|
+
apiClient: a,
|
|
533
533
|
submissions: n,
|
|
534
534
|
analytics: o,
|
|
535
535
|
flow: c,
|
|
@@ -572,7 +572,7 @@ async function Es({
|
|
|
572
572
|
if (m.aborted)
|
|
573
573
|
return;
|
|
574
574
|
const G = ((xe = c.data.startedWriteNodeIds) == null ? void 0 : xe.includes(s.id)) === !0;
|
|
575
|
-
if ((h == null ? void 0 : h.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await p().catch((P) =>
|
|
575
|
+
if ((h == null ? void 0 : h.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await p().catch((P) => i.error("Failed to persist application write barrier", P)), m.aborted)
|
|
576
576
|
return;
|
|
577
577
|
let N;
|
|
578
578
|
const q = setTimeout(() => {
|
|
@@ -585,10 +585,10 @@ async function Es({
|
|
|
585
585
|
type: "loading",
|
|
586
586
|
text: C("submitting")
|
|
587
587
|
});
|
|
588
|
-
})().catch((P) =>
|
|
588
|
+
})().catch((P) => i.error("Failed to send submission progress message", P));
|
|
589
589
|
}, Fs);
|
|
590
590
|
let L;
|
|
591
|
-
const O = await
|
|
591
|
+
const O = await a.fetch("/flow/submit", {
|
|
592
592
|
method: "POST",
|
|
593
593
|
body: JSON.stringify({
|
|
594
594
|
log_submit: !1,
|
|
@@ -597,7 +597,7 @@ async function Es({
|
|
|
597
597
|
session_id: D,
|
|
598
598
|
job: c.job,
|
|
599
599
|
flow_build: c.build,
|
|
600
|
-
submissions:
|
|
600
|
+
submissions: as(c.nodes, os(n || {}, s.data.submitKeys)),
|
|
601
601
|
pre_apply: br(c.nodes, n || {}, c.data.flowSessionId)
|
|
602
602
|
})
|
|
603
603
|
}).catch((P) => (L = P, ys(P) ? P.data : P));
|
|
@@ -624,7 +624,7 @@ async function Es({
|
|
|
624
624
|
outcome: T ? "duplicate_after_own_attempt" : "duplicate"
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
}), ($t(O) || (O == null ? void 0 : O.success) === !0) && ((Pe = c.data.submitCooldown) == null ? void 0 : Pe.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await p().catch((P) =>
|
|
627
|
+
}), ($t(O) || (O == null ? void 0 : O.success) === !0) && ((Pe = c.data.submitCooldown) == null ? void 0 : Pe.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await p().catch((P) => i.error("Failed to persist submit cooldown reset", P))), $t(O)) {
|
|
628
628
|
const {
|
|
629
629
|
redirect_url: P,
|
|
630
630
|
message: ut,
|
|
@@ -643,7 +643,7 @@ async function Es({
|
|
|
643
643
|
text: Ye ?? C("complete_submission"),
|
|
644
644
|
onClick: () => {
|
|
645
645
|
if (!D) {
|
|
646
|
-
|
|
646
|
+
i.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
649
|
o.log({
|
|
@@ -660,7 +660,7 @@ async function Es({
|
|
|
660
660
|
}
|
|
661
661
|
});
|
|
662
662
|
} catch (_e) {
|
|
663
|
-
|
|
663
|
+
i.error(`Invalid redirect URL: ${P}`, _e), e.sendMessage({
|
|
664
664
|
type: "system",
|
|
665
665
|
variant: "error",
|
|
666
666
|
text: C("redirect_url_error")
|
|
@@ -675,7 +675,7 @@ async function Es({
|
|
|
675
675
|
text: C("submission_completed")
|
|
676
676
|
}), r(s.nextId);
|
|
677
677
|
const X = (w == null ? void 0 : w.phase) === "submit" && w.verdict === "confirmed" && w.code === "unreadable_document" && typeof w.field == "string" && w.status !== void 0 && w.status >= 400 && w.status < 500 && ((je = n == null ? void 0 : n[w.field]) == null ? void 0 : je.type) === "file" ? w.field : void 0, J = X === void 0 ? void 0 : c.nodes.find((P) => P.type === "question-file" && P.data.key === X);
|
|
678
|
-
return J || (c.data.submitCooldown = Ms(E, _, w)), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = (Xe = c.data.startedWriteNodeIds) == null ? void 0 : Xe.filter((P) => P !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await b(h), await p().catch((P) =>
|
|
678
|
+
return J || (c.data.submitCooldown = Ms(E, _, w)), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = (Xe = c.data.startedWriteNodeIds) == null ? void 0 : Xe.filter((P) => P !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await b(h), await p().catch((P) => i.error("Failed to persist application write barrier release", P))) : (w == null ? void 0 : w.verdict) !== "confirmed" && !T ? (c.data.unconfirmedAttemptKeys = [...c.data.unconfirmedAttemptKeys ?? [], E], await p().catch((P) => i.error("Failed to persist unconfirmed attempt", P))) : await p().catch((P) => i.error("Failed to persist submit cooldown", P)), w ? (i.error(L ?? w.message), J && X !== void 0 ? (e.setSubmission(X, null), await b({
|
|
679
679
|
fileQuestionNodeId: J.id,
|
|
680
680
|
submitNodeId: s.id
|
|
681
681
|
}), await e.sendMessage({
|
|
@@ -702,7 +702,7 @@ async function Es({
|
|
|
702
702
|
type: "system",
|
|
703
703
|
variant: "error",
|
|
704
704
|
text: C("submission_failed")
|
|
705
|
-
}), t())) : (
|
|
705
|
+
}), t())) : (i.error(L ?? O), await e.sendMessage({
|
|
706
706
|
type: "system",
|
|
707
707
|
variant: "error",
|
|
708
708
|
text: C("submission_failed")
|
|
@@ -715,17 +715,17 @@ async function Ns({
|
|
|
715
715
|
next: r,
|
|
716
716
|
node: t,
|
|
717
717
|
submissions: s,
|
|
718
|
-
context:
|
|
718
|
+
context: i
|
|
719
719
|
}) {
|
|
720
720
|
await e.sendMessage({
|
|
721
721
|
type: "link",
|
|
722
722
|
href: de(t.data.href, {
|
|
723
723
|
submissions: s,
|
|
724
|
-
context:
|
|
724
|
+
context: i
|
|
725
725
|
}),
|
|
726
726
|
text: de(t.data.cta, {
|
|
727
727
|
submissions: s,
|
|
728
|
-
context:
|
|
728
|
+
context: i
|
|
729
729
|
})
|
|
730
730
|
}), r(t.nextId);
|
|
731
731
|
}
|
|
@@ -745,14 +745,14 @@ async function Ts({
|
|
|
745
745
|
next: r,
|
|
746
746
|
node: t,
|
|
747
747
|
submissions: s,
|
|
748
|
-
context:
|
|
748
|
+
context: i
|
|
749
749
|
}) {
|
|
750
750
|
await e.sendMessage({
|
|
751
751
|
author: "bot",
|
|
752
752
|
type: "text",
|
|
753
753
|
text: de(t.data.text, {
|
|
754
754
|
submissions: s,
|
|
755
|
-
context:
|
|
755
|
+
context: i
|
|
756
756
|
})
|
|
757
757
|
}), r(t.nextId);
|
|
758
758
|
}
|
|
@@ -774,15 +774,15 @@ async function Os({
|
|
|
774
774
|
next: r,
|
|
775
775
|
node: t,
|
|
776
776
|
submissions: s,
|
|
777
|
-
context:
|
|
778
|
-
t:
|
|
777
|
+
context: i,
|
|
778
|
+
t: a
|
|
779
779
|
}) {
|
|
780
780
|
await e.sendMessage({
|
|
781
781
|
author: "bot",
|
|
782
782
|
type: "text",
|
|
783
783
|
text: de(t.data.question, {
|
|
784
784
|
submissions: s,
|
|
785
|
-
context:
|
|
785
|
+
context: i
|
|
786
786
|
})
|
|
787
787
|
});
|
|
788
788
|
const n = t.data.format === "phone" ? await e.userInput({
|
|
@@ -810,7 +810,7 @@ async function Os({
|
|
|
810
810
|
n === null ? await e.sendMessage({
|
|
811
811
|
type: "system",
|
|
812
812
|
variant: "info",
|
|
813
|
-
text:
|
|
813
|
+
text: a("skipped")
|
|
814
814
|
}) : await e.sendMessage({
|
|
815
815
|
author: "user",
|
|
816
816
|
type: "text",
|
|
@@ -822,15 +822,15 @@ async function Rs({
|
|
|
822
822
|
next: r,
|
|
823
823
|
node: t,
|
|
824
824
|
submissions: s,
|
|
825
|
-
context:
|
|
826
|
-
t:
|
|
825
|
+
context: i,
|
|
826
|
+
t: a
|
|
827
827
|
}) {
|
|
828
828
|
await e.sendMessage({
|
|
829
829
|
author: "bot",
|
|
830
830
|
type: "text",
|
|
831
831
|
text: de(t.data.question, {
|
|
832
832
|
submissions: s,
|
|
833
|
-
context:
|
|
833
|
+
context: i
|
|
834
834
|
})
|
|
835
835
|
});
|
|
836
836
|
const n = await e.userInput({
|
|
@@ -847,7 +847,7 @@ async function Rs({
|
|
|
847
847
|
n === null ? await e.sendMessage({
|
|
848
848
|
type: "system",
|
|
849
849
|
variant: "info",
|
|
850
|
-
text:
|
|
850
|
+
text: a("skipped")
|
|
851
851
|
}) : await e.sendMessage({
|
|
852
852
|
author: "user",
|
|
853
853
|
type: "text",
|
|
@@ -859,15 +859,15 @@ async function Bs({
|
|
|
859
859
|
next: r,
|
|
860
860
|
node: t,
|
|
861
861
|
submissions: s,
|
|
862
|
-
context:
|
|
863
|
-
t:
|
|
862
|
+
context: i,
|
|
863
|
+
t: a
|
|
864
864
|
}) {
|
|
865
865
|
await e.sendMessage({
|
|
866
866
|
author: "bot",
|
|
867
867
|
type: "text",
|
|
868
868
|
text: de(t.data.question, {
|
|
869
869
|
submissions: s,
|
|
870
|
-
context:
|
|
870
|
+
context: i
|
|
871
871
|
})
|
|
872
872
|
});
|
|
873
873
|
const n = await e.userInput({
|
|
@@ -886,7 +886,7 @@ async function Bs({
|
|
|
886
886
|
n === null ? await e.sendMessage({
|
|
887
887
|
type: "system",
|
|
888
888
|
variant: "info",
|
|
889
|
-
text:
|
|
889
|
+
text: a("skipped")
|
|
890
890
|
}) : await e.sendMessage({
|
|
891
891
|
author: "user",
|
|
892
892
|
type: "text",
|
|
@@ -898,15 +898,15 @@ async function Ps({
|
|
|
898
898
|
next: r,
|
|
899
899
|
node: t,
|
|
900
900
|
submissions: s,
|
|
901
|
-
context:
|
|
902
|
-
t:
|
|
901
|
+
context: i,
|
|
902
|
+
t: a
|
|
903
903
|
}) {
|
|
904
904
|
await e.sendMessage({
|
|
905
905
|
author: "bot",
|
|
906
906
|
type: "text",
|
|
907
907
|
text: de(t.data.question, {
|
|
908
908
|
submissions: s,
|
|
909
|
-
context:
|
|
909
|
+
context: i
|
|
910
910
|
})
|
|
911
911
|
});
|
|
912
912
|
const n = await e.userInput({
|
|
@@ -917,7 +917,7 @@ async function Ps({
|
|
|
917
917
|
n.value.length === 0 ? await e.sendMessage({
|
|
918
918
|
type: "system",
|
|
919
919
|
variant: "info",
|
|
920
|
-
text:
|
|
920
|
+
text: a("skipped")
|
|
921
921
|
}) : await e.sendMessage({
|
|
922
922
|
author: "user",
|
|
923
923
|
type: "text",
|
|
@@ -929,15 +929,15 @@ async function js({
|
|
|
929
929
|
next: r,
|
|
930
930
|
node: t,
|
|
931
931
|
submissions: s,
|
|
932
|
-
context:
|
|
933
|
-
t:
|
|
932
|
+
context: i,
|
|
933
|
+
t: a
|
|
934
934
|
}) {
|
|
935
935
|
await e.sendMessage({
|
|
936
936
|
author: "bot",
|
|
937
937
|
type: "text",
|
|
938
938
|
text: de(t.data.question, {
|
|
939
939
|
submissions: s,
|
|
940
|
-
context:
|
|
940
|
+
context: i
|
|
941
941
|
})
|
|
942
942
|
});
|
|
943
943
|
const n = await e.userInput({
|
|
@@ -954,7 +954,7 @@ async function js({
|
|
|
954
954
|
n === null ? await e.sendMessage({
|
|
955
955
|
type: "system",
|
|
956
956
|
variant: "info",
|
|
957
|
-
text:
|
|
957
|
+
text: a("skipped")
|
|
958
958
|
}) : await e.sendMessage({
|
|
959
959
|
author: "user",
|
|
960
960
|
type: "text",
|
|
@@ -972,27 +972,28 @@ async function $s({
|
|
|
972
972
|
type: "text",
|
|
973
973
|
text: t.data.question
|
|
974
974
|
});
|
|
975
|
-
const
|
|
975
|
+
const i = await e.userInput({
|
|
976
976
|
type: "address",
|
|
977
977
|
key: t.data.key,
|
|
978
978
|
config: {
|
|
979
979
|
optional: t.data.optional,
|
|
980
980
|
keys: t.data.keys,
|
|
981
|
+
line2Required: t.data.line2Required,
|
|
981
982
|
placeholder: t.data.placeholder
|
|
982
983
|
}
|
|
983
984
|
});
|
|
984
|
-
if (
|
|
985
|
+
if (i === null)
|
|
985
986
|
await e.sendMessage({
|
|
986
987
|
type: "system",
|
|
987
988
|
variant: "info",
|
|
988
989
|
text: s("skipped")
|
|
989
990
|
});
|
|
990
991
|
else {
|
|
991
|
-
const
|
|
992
|
+
const a = Object.values(i.value).filter((n) => n && n.trim().length > 0).join(", ");
|
|
992
993
|
await e.sendMessage({
|
|
993
994
|
author: "user",
|
|
994
995
|
type: "text",
|
|
995
|
-
text:
|
|
996
|
+
text: a
|
|
996
997
|
});
|
|
997
998
|
}
|
|
998
999
|
return r(t.nextId);
|
|
@@ -1002,15 +1003,15 @@ async function qs({
|
|
|
1002
1003
|
chat: r,
|
|
1003
1004
|
next: t,
|
|
1004
1005
|
submissions: s,
|
|
1005
|
-
context:
|
|
1006
|
-
t:
|
|
1006
|
+
context: i,
|
|
1007
|
+
t: a
|
|
1007
1008
|
}) {
|
|
1008
1009
|
await r.sendMessage({
|
|
1009
1010
|
author: "bot",
|
|
1010
1011
|
type: "text",
|
|
1011
1012
|
text: de(e.data.question, {
|
|
1012
1013
|
submissions: s,
|
|
1013
|
-
context:
|
|
1014
|
+
context: i
|
|
1014
1015
|
})
|
|
1015
1016
|
});
|
|
1016
1017
|
const n = await r.userInput({
|
|
@@ -1028,7 +1029,7 @@ async function qs({
|
|
|
1028
1029
|
await r.sendMessage({
|
|
1029
1030
|
type: "system",
|
|
1030
1031
|
variant: "info",
|
|
1031
|
-
text:
|
|
1032
|
+
text: a("skipped")
|
|
1032
1033
|
});
|
|
1033
1034
|
else
|
|
1034
1035
|
for (const o of n.value)
|
|
@@ -1056,11 +1057,11 @@ async function zs({
|
|
|
1056
1057
|
flow: r,
|
|
1057
1058
|
submissions: t,
|
|
1058
1059
|
chat: s,
|
|
1059
|
-
next:
|
|
1060
|
-
apiClient:
|
|
1060
|
+
next: i,
|
|
1061
|
+
apiClient: a,
|
|
1061
1062
|
analytics: n
|
|
1062
1063
|
}) {
|
|
1063
|
-
const o =
|
|
1064
|
+
const o = is(r.nodes, t || {}), {
|
|
1064
1065
|
answers: c,
|
|
1065
1066
|
...h
|
|
1066
1067
|
} = o;
|
|
@@ -1069,7 +1070,7 @@ async function zs({
|
|
|
1069
1070
|
value: h
|
|
1070
1071
|
});
|
|
1071
1072
|
const b = new AbortController(), x = setTimeout(() => b.abort(), 5e3);
|
|
1072
|
-
if (
|
|
1073
|
+
if (a.fetch("/flow/pre-apply", {
|
|
1073
1074
|
method: "POST",
|
|
1074
1075
|
signal: b.signal,
|
|
1075
1076
|
body: JSON.stringify({
|
|
@@ -1105,9 +1106,9 @@ async function zs({
|
|
|
1105
1106
|
}
|
|
1106
1107
|
});
|
|
1107
1108
|
}
|
|
1108
|
-
return
|
|
1109
|
+
return i(e.nextId);
|
|
1109
1110
|
}
|
|
1110
|
-
const
|
|
1111
|
+
const Ee = ({
|
|
1111
1112
|
class: e,
|
|
1112
1113
|
...r
|
|
1113
1114
|
}) => {
|
|
@@ -1169,21 +1170,21 @@ function De(e) {
|
|
|
1169
1170
|
const r = typeof e;
|
|
1170
1171
|
return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((s = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : s.name)) ?? "null" : r;
|
|
1171
1172
|
}
|
|
1172
|
-
function Y(e, r, t, s,
|
|
1173
|
-
const
|
|
1173
|
+
function Y(e, r, t, s, i) {
|
|
1174
|
+
const a = i && "input" in i ? i.input : t.value, n = (i == null ? void 0 : i.expected) ?? e.expects ?? null, o = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ De(a), c = {
|
|
1174
1175
|
kind: e.kind,
|
|
1175
1176
|
type: e.type,
|
|
1176
|
-
input:
|
|
1177
|
+
input: a,
|
|
1177
1178
|
expected: n,
|
|
1178
1179
|
received: o,
|
|
1179
1180
|
message: `Invalid ${r}: ${n ? `Expected ${n} but r` : "R"}eceived ${o}`,
|
|
1180
1181
|
requirement: e.requirement,
|
|
1181
|
-
path:
|
|
1182
|
-
issues:
|
|
1182
|
+
path: i == null ? void 0 : i.path,
|
|
1183
|
+
issues: i == null ? void 0 : i.issues,
|
|
1183
1184
|
lang: s.lang,
|
|
1184
1185
|
abortEarly: s.abortEarly,
|
|
1185
1186
|
abortPipeEarly: s.abortPipeEarly
|
|
1186
|
-
}, h = e.kind === "schema", b = (
|
|
1187
|
+
}, h = e.kind === "schema", b = (i == null ? void 0 : i.message) ?? e.message ?? /* @__PURE__ */ Gs(e.reference, c.lang) ?? (h ? /* @__PURE__ */ Ws(c.lang) : null) ?? s.message ?? /* @__PURE__ */ Ks(c.lang);
|
|
1187
1188
|
b !== void 0 && (c.message = typeof b == "function" ? (
|
|
1188
1189
|
// @ts-expect-error
|
|
1189
1190
|
b(c)
|
|
@@ -1412,22 +1413,22 @@ function Nr(e, r) {
|
|
|
1412
1413
|
return /* @__PURE__ */ fe(this);
|
|
1413
1414
|
},
|
|
1414
1415
|
"~run"(t, s) {
|
|
1415
|
-
var
|
|
1416
|
-
const
|
|
1417
|
-
if (Array.isArray(
|
|
1416
|
+
var a;
|
|
1417
|
+
const i = t.value;
|
|
1418
|
+
if (Array.isArray(i)) {
|
|
1418
1419
|
t.typed = !0, t.value = [];
|
|
1419
|
-
for (let n = 0; n <
|
|
1420
|
-
const o =
|
|
1420
|
+
for (let n = 0; n < i.length; n++) {
|
|
1421
|
+
const o = i[n], c = this.item["~run"]({ value: o }, s);
|
|
1421
1422
|
if (c.issues) {
|
|
1422
1423
|
const h = {
|
|
1423
1424
|
type: "array",
|
|
1424
1425
|
origin: "value",
|
|
1425
|
-
input:
|
|
1426
|
+
input: i,
|
|
1426
1427
|
key: n,
|
|
1427
1428
|
value: o
|
|
1428
1429
|
};
|
|
1429
1430
|
for (const b of c.issues)
|
|
1430
|
-
b.path ? b.path.unshift(h) : b.path = [h], (
|
|
1431
|
+
b.path ? b.path.unshift(h) : b.path = [h], (a = t.issues) == null || a.push(b);
|
|
1431
1432
|
if (t.issues || (t.issues = c.issues), s.abortEarly) {
|
|
1432
1433
|
t.typed = !1;
|
|
1433
1434
|
break;
|
|
@@ -1489,28 +1490,28 @@ function ge(e, r) {
|
|
|
1489
1490
|
return /* @__PURE__ */ fe(this);
|
|
1490
1491
|
},
|
|
1491
1492
|
"~run"(t, s) {
|
|
1492
|
-
var
|
|
1493
|
-
const
|
|
1494
|
-
if (
|
|
1493
|
+
var a;
|
|
1494
|
+
const i = t.value;
|
|
1495
|
+
if (i && typeof i == "object") {
|
|
1495
1496
|
t.typed = !0, t.value = {};
|
|
1496
1497
|
for (const n in this.entries) {
|
|
1497
1498
|
const o = this.entries[n];
|
|
1498
|
-
if (n in
|
|
1499
|
+
if (n in i || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
|
|
1499
1500
|
o.default !== void 0) {
|
|
1500
|
-
const c = n in
|
|
1501
|
+
const c = n in i ? (
|
|
1501
1502
|
// @ts-expect-error
|
|
1502
|
-
|
|
1503
|
+
i[n]
|
|
1503
1504
|
) : /* @__PURE__ */ Er(o), h = o["~run"]({ value: c }, s);
|
|
1504
1505
|
if (h.issues) {
|
|
1505
1506
|
const b = {
|
|
1506
1507
|
type: "object",
|
|
1507
1508
|
origin: "value",
|
|
1508
|
-
input:
|
|
1509
|
+
input: i,
|
|
1509
1510
|
key: n,
|
|
1510
1511
|
value: c
|
|
1511
1512
|
};
|
|
1512
1513
|
for (const x of h.issues)
|
|
1513
|
-
x.path ? x.path.unshift(b) : x.path = [b], (
|
|
1514
|
+
x.path ? x.path.unshift(b) : x.path = [b], (a = t.issues) == null || a.push(x);
|
|
1514
1515
|
if (t.issues || (t.issues = h.issues), s.abortEarly) {
|
|
1515
1516
|
t.typed = !1;
|
|
1516
1517
|
break;
|
|
@@ -1526,10 +1527,10 @@ function ge(e, r) {
|
|
|
1526
1527
|
{
|
|
1527
1528
|
type: "object",
|
|
1528
1529
|
origin: "key",
|
|
1529
|
-
input:
|
|
1530
|
+
input: i,
|
|
1530
1531
|
key: n,
|
|
1531
1532
|
// @ts-expect-error
|
|
1532
|
-
value:
|
|
1533
|
+
value: i[n]
|
|
1533
1534
|
}
|
|
1534
1535
|
]
|
|
1535
1536
|
}), s.abortEarly))
|
|
@@ -1591,44 +1592,44 @@ function Or(e, r, t) {
|
|
|
1591
1592
|
get "~standard"() {
|
|
1592
1593
|
return /* @__PURE__ */ fe(this);
|
|
1593
1594
|
},
|
|
1594
|
-
"~run"(s,
|
|
1595
|
+
"~run"(s, i) {
|
|
1595
1596
|
var n, o;
|
|
1596
|
-
const
|
|
1597
|
-
if (
|
|
1597
|
+
const a = s.value;
|
|
1598
|
+
if (a && typeof a == "object") {
|
|
1598
1599
|
s.typed = !0, s.value = {};
|
|
1599
|
-
for (const c in
|
|
1600
|
-
if (/* @__PURE__ */ Hs(
|
|
1601
|
-
const h =
|
|
1600
|
+
for (const c in a)
|
|
1601
|
+
if (/* @__PURE__ */ Hs(a, c)) {
|
|
1602
|
+
const h = a[c], b = this.key["~run"]({ value: c }, i);
|
|
1602
1603
|
if (b.issues) {
|
|
1603
1604
|
const p = {
|
|
1604
1605
|
type: "object",
|
|
1605
1606
|
origin: "key",
|
|
1606
|
-
input:
|
|
1607
|
+
input: a,
|
|
1607
1608
|
key: c,
|
|
1608
1609
|
value: h
|
|
1609
1610
|
};
|
|
1610
1611
|
for (const m of b.issues)
|
|
1611
1612
|
m.path = [p], (n = s.issues) == null || n.push(m);
|
|
1612
|
-
if (s.issues || (s.issues = b.issues),
|
|
1613
|
+
if (s.issues || (s.issues = b.issues), i.abortEarly) {
|
|
1613
1614
|
s.typed = !1;
|
|
1614
1615
|
break;
|
|
1615
1616
|
}
|
|
1616
1617
|
}
|
|
1617
1618
|
const x = this.value["~run"](
|
|
1618
1619
|
{ value: h },
|
|
1619
|
-
|
|
1620
|
+
i
|
|
1620
1621
|
);
|
|
1621
1622
|
if (x.issues) {
|
|
1622
1623
|
const p = {
|
|
1623
1624
|
type: "object",
|
|
1624
1625
|
origin: "value",
|
|
1625
|
-
input:
|
|
1626
|
+
input: a,
|
|
1626
1627
|
key: c,
|
|
1627
1628
|
value: h
|
|
1628
1629
|
};
|
|
1629
1630
|
for (const m of x.issues)
|
|
1630
1631
|
m.path ? m.path.unshift(p) : m.path = [p], (o = s.issues) == null || o.push(m);
|
|
1631
|
-
if (s.issues || (s.issues = x.issues),
|
|
1632
|
+
if (s.issues || (s.issues = x.issues), i.abortEarly) {
|
|
1632
1633
|
s.typed = !1;
|
|
1633
1634
|
break;
|
|
1634
1635
|
}
|
|
@@ -1636,17 +1637,17 @@ function Or(e, r, t) {
|
|
|
1636
1637
|
(!b.typed || !x.typed) && (s.typed = !1), b.typed && (s.value[b.value] = x.value);
|
|
1637
1638
|
}
|
|
1638
1639
|
} else
|
|
1639
|
-
Y(this, "type", s,
|
|
1640
|
+
Y(this, "type", s, i);
|
|
1640
1641
|
return s;
|
|
1641
1642
|
}
|
|
1642
1643
|
};
|
|
1643
1644
|
}
|
|
1644
1645
|
// @__NO_SIDE_EFFECTS__
|
|
1645
|
-
function
|
|
1646
|
+
function ie(e) {
|
|
1646
1647
|
return {
|
|
1647
1648
|
kind: "schema",
|
|
1648
1649
|
type: "string",
|
|
1649
|
-
reference:
|
|
1650
|
+
reference: ie,
|
|
1650
1651
|
expects: "string",
|
|
1651
1652
|
async: !1,
|
|
1652
1653
|
message: e,
|
|
@@ -1754,7 +1755,7 @@ const Be = ({
|
|
|
1754
1755
|
class: "break-words pr-1 text-sm",
|
|
1755
1756
|
children: e.message
|
|
1756
1757
|
})]
|
|
1757
|
-
}),
|
|
1758
|
+
}), Fe = ({
|
|
1758
1759
|
class: e,
|
|
1759
1760
|
...r
|
|
1760
1761
|
}) => {
|
|
@@ -1797,13 +1798,13 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1797
1798
|
optional: !1
|
|
1798
1799
|
}
|
|
1799
1800
|
}), nn = "https://api.mapbox.com/search/searchbox/v1/suggest", an = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", on = (e) => atob(e).split("").reverse().join(""), pe = /* @__PURE__ */ ge({
|
|
1800
|
-
name: /* @__PURE__ */
|
|
1801
|
+
name: /* @__PURE__ */ ie()
|
|
1801
1802
|
}), ln = /* @__PURE__ */ ge({
|
|
1802
1803
|
suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */ ge({
|
|
1803
|
-
full_address: /* @__PURE__ */ We(/* @__PURE__ */
|
|
1804
|
-
place_formatted: /* @__PURE__ */ We(/* @__PURE__ */
|
|
1805
|
-
name: /* @__PURE__ */ We(/* @__PURE__ */
|
|
1806
|
-
mapbox_id: /* @__PURE__ */
|
|
1804
|
+
full_address: /* @__PURE__ */ We(/* @__PURE__ */ ie()),
|
|
1805
|
+
place_formatted: /* @__PURE__ */ We(/* @__PURE__ */ ie()),
|
|
1806
|
+
name: /* @__PURE__ */ We(/* @__PURE__ */ ie()),
|
|
1807
|
+
mapbox_id: /* @__PURE__ */ ie(),
|
|
1807
1808
|
context: /* @__PURE__ */ tn(/* @__PURE__ */ ge({
|
|
1808
1809
|
address: pe,
|
|
1809
1810
|
street: pe,
|
|
@@ -1824,13 +1825,13 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1824
1825
|
const t = (s = $.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
|
|
1825
1826
|
return t ? {
|
|
1826
1827
|
enabled: !0,
|
|
1827
|
-
getPredictions: async (
|
|
1828
|
+
getPredictions: async (i) => {
|
|
1828
1829
|
var x;
|
|
1829
|
-
const
|
|
1830
|
-
|
|
1830
|
+
const a = new URL(nn);
|
|
1831
|
+
a.searchParams.set("q", i), a.searchParams.set("session_token", t);
|
|
1831
1832
|
const n = (x = $.current$.peek().flow) == null ? void 0 : x.locationOrigin;
|
|
1832
|
-
n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 &&
|
|
1833
|
-
const c = await fetch(
|
|
1833
|
+
n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && a.searchParams.set("proximity", `${n.lng},${n.lat}`), a.searchParams.set("access_token", on(an));
|
|
1834
|
+
const c = await fetch(a);
|
|
1834
1835
|
if (!c.ok)
|
|
1835
1836
|
return e.error("Failed to get address details", c), {
|
|
1836
1837
|
ok: !1,
|
|
@@ -1898,7 +1899,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1898
1899
|
}) => {
|
|
1899
1900
|
const {
|
|
1900
1901
|
t: s
|
|
1901
|
-
} = se(), [
|
|
1902
|
+
} = se(), [i, a] = me(), {
|
|
1902
1903
|
enabled: n,
|
|
1903
1904
|
getPredictions: o
|
|
1904
1905
|
} = un({
|
|
@@ -1906,7 +1907,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1906
1907
|
t: s
|
|
1907
1908
|
}), [c, h] = me(n ? "query" : "manual"), [b, x] = me(""), [p, m] = me(), C = ce(), E = ce(), A = (y) => {
|
|
1908
1909
|
var V;
|
|
1909
|
-
if (
|
|
1910
|
+
if (Me(n, "Query state should not be enabled"), y = y.trim(), y === ((V = C.current) == null ? void 0 : V.query) || y === (p == null ? void 0 : p.query) && p.status === "done")
|
|
1910
1911
|
return;
|
|
1911
1912
|
if (x(y), y === "") {
|
|
1912
1913
|
C.current = void 0, m(void 0);
|
|
@@ -1936,14 +1937,14 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1936
1937
|
}));
|
|
1937
1938
|
});
|
|
1938
1939
|
}, I = (y, _) => {
|
|
1939
|
-
|
|
1940
|
+
a((V) => ({
|
|
1940
1941
|
...V,
|
|
1941
1942
|
[y]: _
|
|
1942
1943
|
}));
|
|
1943
1944
|
};
|
|
1944
1945
|
switch (c) {
|
|
1945
1946
|
case "query":
|
|
1946
|
-
return
|
|
1947
|
+
return Me(n, "Query state should not be enabled"), u(dn, {
|
|
1947
1948
|
input: e,
|
|
1948
1949
|
onSkip: () => r(null),
|
|
1949
1950
|
onAddressSelect: (y) => {
|
|
@@ -1952,18 +1953,18 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1952
1953
|
return;
|
|
1953
1954
|
}
|
|
1954
1955
|
const _ = (p == null ? void 0 : p.status) === "done" ? p.items.find((V) => V.id === y) : void 0;
|
|
1955
|
-
_ && (E.current !== y &&
|
|
1956
|
+
_ && (E.current !== y && a(_.address), E.current = y, h("details"));
|
|
1956
1957
|
},
|
|
1957
1958
|
onAddressSearch: A,
|
|
1958
1959
|
lookup: p,
|
|
1959
1960
|
query: b
|
|
1960
1961
|
});
|
|
1961
1962
|
case "details":
|
|
1962
|
-
return
|
|
1963
|
+
return Me(i !== void 0), u(Wt, {
|
|
1963
1964
|
input: e,
|
|
1964
1965
|
logger: t,
|
|
1965
1966
|
onSubmitSuccess: r,
|
|
1966
|
-
addressFields:
|
|
1967
|
+
addressFields: i,
|
|
1967
1968
|
onFieldChange: I,
|
|
1968
1969
|
actions: u(Kt, {
|
|
1969
1970
|
onClick: () => {
|
|
@@ -1976,13 +1977,18 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1976
1977
|
logger: t,
|
|
1977
1978
|
input: e,
|
|
1978
1979
|
onSubmitSuccess: r,
|
|
1979
|
-
addressFields:
|
|
1980
|
+
addressFields: i ?? {},
|
|
1980
1981
|
onFieldChange: I,
|
|
1981
1982
|
actions: n ? u(Kt, {
|
|
1982
1983
|
onClick: () => {
|
|
1983
1984
|
h("query");
|
|
1984
1985
|
}
|
|
1985
|
-
}) :
|
|
1986
|
+
}) : e.config.optional ? (
|
|
1987
|
+
// Without address search this is the only screen, so an optional question needs its own way past.
|
|
1988
|
+
u(Fe, {
|
|
1989
|
+
onClick: () => r(null)
|
|
1990
|
+
})
|
|
1991
|
+
) : void 0
|
|
1986
1992
|
});
|
|
1987
1993
|
}
|
|
1988
1994
|
}, dn = ({
|
|
@@ -1990,8 +1996,8 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1990
1996
|
onSkip: r,
|
|
1991
1997
|
lookup: t,
|
|
1992
1998
|
onAddressSelect: s,
|
|
1993
|
-
query:
|
|
1994
|
-
onAddressSearch:
|
|
1999
|
+
query: i,
|
|
2000
|
+
onAddressSearch: a
|
|
1995
2001
|
}) => {
|
|
1996
2002
|
const {
|
|
1997
2003
|
t: n
|
|
@@ -2004,7 +2010,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2004
2010
|
onSubmit: (c) => {
|
|
2005
2011
|
c.preventDefault();
|
|
2006
2012
|
const b = new FormData(c.currentTarget).get("address");
|
|
2007
|
-
typeof b == "string" &&
|
|
2013
|
+
typeof b == "string" && a(b);
|
|
2008
2014
|
},
|
|
2009
2015
|
class: "flex gap-2 p-2.5",
|
|
2010
2016
|
children: [u("div", {
|
|
@@ -2016,7 +2022,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2016
2022
|
autocomplete: "address-line1 country-name postal-code",
|
|
2017
2023
|
autoFocus: !0,
|
|
2018
2024
|
placeholder: e.config.placeholder || n("address_search"),
|
|
2019
|
-
defaultValue:
|
|
2025
|
+
defaultValue: i,
|
|
2020
2026
|
class: Je({
|
|
2021
2027
|
optional: !!e.config.optional,
|
|
2022
2028
|
className: "w-full rounded-full"
|
|
@@ -2050,7 +2056,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2050
2056
|
children: n("search")
|
|
2051
2057
|
})]
|
|
2052
2058
|
})]
|
|
2053
|
-
}), e.config.optional && u(
|
|
2059
|
+
}), e.config.optional && u(Fe, {
|
|
2054
2060
|
class: "relative",
|
|
2055
2061
|
onClick: r
|
|
2056
2062
|
})]
|
|
@@ -2110,12 +2116,12 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2110
2116
|
onFieldChange: r,
|
|
2111
2117
|
onSubmitSuccess: t,
|
|
2112
2118
|
actions: s,
|
|
2113
|
-
input:
|
|
2119
|
+
input: i
|
|
2114
2120
|
}) => {
|
|
2115
|
-
const
|
|
2121
|
+
const a = ce(null);
|
|
2116
2122
|
Ie(() => {
|
|
2117
|
-
if (
|
|
2118
|
-
const c =
|
|
2123
|
+
if (a.current) {
|
|
2124
|
+
const c = a.current.querySelector("input");
|
|
2119
2125
|
c && (c.focus(), c.select());
|
|
2120
2126
|
}
|
|
2121
2127
|
}, []);
|
|
@@ -2126,14 +2132,13 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2126
2132
|
class: "flex flex-col px-2 pt-2",
|
|
2127
2133
|
onSubmit: (c) => {
|
|
2128
2134
|
const h = c.currentTarget, b = [...h.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
h.reportValidity();
|
|
2135
|
+
for (const m of b) {
|
|
2136
|
+
m.value = "";
|
|
2137
|
+
const C = bt.find((E) => i.config.keys[E] === m.name);
|
|
2138
|
+
C && r(C, "");
|
|
2139
|
+
}
|
|
2140
|
+
if (b.length > 0 && !h.checkValidity()) {
|
|
2141
|
+
c.preventDefault(), h.reportValidity();
|
|
2137
2142
|
return;
|
|
2138
2143
|
}
|
|
2139
2144
|
const x = new FormData(h), p = Object.fromEntries(x.entries());
|
|
@@ -2144,9 +2149,9 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2144
2149
|
},
|
|
2145
2150
|
children: [u("div", {
|
|
2146
2151
|
class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
|
|
2147
|
-
ref:
|
|
2152
|
+
ref: a,
|
|
2148
2153
|
children: bt.map((c, h) => {
|
|
2149
|
-
const b = `isdk_${c}`, x =
|
|
2154
|
+
const b = `isdk_${c}`, x = i.config.keys[c];
|
|
2150
2155
|
return x ? u(be, {
|
|
2151
2156
|
children: [u("label", {
|
|
2152
2157
|
for: b,
|
|
@@ -2195,7 +2200,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2195
2200
|
id: b,
|
|
2196
2201
|
defaultValue: e[c],
|
|
2197
2202
|
onInput: (p) => r(c, p.currentTarget.value),
|
|
2198
|
-
required: !0
|
|
2203
|
+
required: c !== "line2" || i.config.line2Required === !0
|
|
2199
2204
|
}), h === bt.length - 1 ? u("hr", {
|
|
2200
2205
|
class: "m-0 w-full border-b border-b-transparent"
|
|
2201
2206
|
}) : u("hr", {
|
|
@@ -2206,7 +2211,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2206
2211
|
})
|
|
2207
2212
|
}), u("div", {
|
|
2208
2213
|
class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
|
|
2209
|
-
children: [s, u(
|
|
2214
|
+
children: [s, u(Ee, {
|
|
2210
2215
|
class: "ml-auto"
|
|
2211
2216
|
})]
|
|
2212
2217
|
})]
|
|
@@ -2238,18 +2243,18 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2238
2243
|
class: "",
|
|
2239
2244
|
onSubmit: (s) => {
|
|
2240
2245
|
s.preventDefault();
|
|
2241
|
-
const
|
|
2246
|
+
const i = cs(s).value, a = en(fn, i);
|
|
2242
2247
|
r({
|
|
2243
2248
|
type: "boolean",
|
|
2244
|
-
value:
|
|
2249
|
+
value: a === "true"
|
|
2245
2250
|
});
|
|
2246
2251
|
},
|
|
2247
2252
|
children: [u("ul", {
|
|
2248
2253
|
class: Br,
|
|
2249
|
-
children: Rr.map((s,
|
|
2254
|
+
children: Rr.map((s, i) => u("li", {
|
|
2250
2255
|
class: Pr,
|
|
2251
2256
|
children: u(jr, {
|
|
2252
|
-
ref:
|
|
2257
|
+
ref: i === 0 ? t : null,
|
|
2253
2258
|
type: "submit",
|
|
2254
2259
|
name: hn,
|
|
2255
2260
|
value: s,
|
|
@@ -2258,7 +2263,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2258
2263
|
}))
|
|
2259
2264
|
}), e.config.optional && u("div", {
|
|
2260
2265
|
class: "px-2 pb-2",
|
|
2261
|
-
children: u(
|
|
2266
|
+
children: u(Fe, {
|
|
2262
2267
|
class: "relative w-full",
|
|
2263
2268
|
type: "button",
|
|
2264
2269
|
onClick: () => r(null)
|
|
@@ -2272,7 +2277,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2272
2277
|
return t(new Error("Invalid file"));
|
|
2273
2278
|
r(s.result);
|
|
2274
2279
|
}, s.onerror = t, s.readAsDataURL(e);
|
|
2275
|
-
}), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), mn = Re("file"), Ht = 3,
|
|
2280
|
+
}), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), mn = Re("file"), Ht = 3, it = (e) => {
|
|
2276
2281
|
const r = e.lastIndexOf(".");
|
|
2277
2282
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2278
2283
|
}, gn = ({
|
|
@@ -2280,7 +2285,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2280
2285
|
class: r,
|
|
2281
2286
|
...t
|
|
2282
2287
|
}) => {
|
|
2283
|
-
const [s,
|
|
2288
|
+
const [s, i] = it(e.name);
|
|
2284
2289
|
return u("div", {
|
|
2285
2290
|
class: Oe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
|
|
2286
2291
|
...t,
|
|
@@ -2291,7 +2296,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2291
2296
|
class: "block truncate",
|
|
2292
2297
|
children: s
|
|
2293
2298
|
}), u("span", {
|
|
2294
|
-
children:
|
|
2299
|
+
children: i
|
|
2295
2300
|
})]
|
|
2296
2301
|
}), u("p", {
|
|
2297
2302
|
"aria-label": "File size",
|
|
@@ -2306,26 +2311,26 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2306
2311
|
class: Oe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2307
2312
|
...r
|
|
2308
2313
|
}), bn = (e, r) => {
|
|
2309
|
-
const [t, s] =
|
|
2314
|
+
const [t, s] = it(e);
|
|
2310
2315
|
return `${t.slice(0, r)}${s}`;
|
|
2311
2316
|
}, Zt = (e) => ({
|
|
2312
2317
|
name: bn(e.name, 42),
|
|
2313
2318
|
sizeKb: e.size / 1e3
|
|
2314
2319
|
}), vn = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], xn = (e, r, t) => {
|
|
2315
|
-
const s =
|
|
2316
|
-
return `chatbot-file-refused:${e}:${
|
|
2320
|
+
const s = it(r.name)[1].toLowerCase(), i = [...t.map((n) => n.toLowerCase()), ...vn], a = s === "" ? "none" : i.includes(s) ? s : "other";
|
|
2321
|
+
return `chatbot-file-refused:${e}:${a}`;
|
|
2317
2322
|
}, wn = ({
|
|
2318
2323
|
input: e,
|
|
2319
2324
|
onSubmitSuccess: r,
|
|
2320
2325
|
analytics: t
|
|
2321
2326
|
}) => {
|
|
2322
2327
|
var A;
|
|
2323
|
-
const s = (A = $.current$.value.flow) == null ? void 0 : A.data.submissions[e.key], [
|
|
2328
|
+
const s = (A = $.current$.value.flow) == null ? void 0 : A.data.submissions[e.key], [i, a] = me(mn(s) && s.value.length ? {
|
|
2324
2329
|
status: "ready",
|
|
2325
2330
|
files: s.value
|
|
2326
2331
|
} : {
|
|
2327
2332
|
status: "empty"
|
|
2328
|
-
}), n = ce(0), o =
|
|
2333
|
+
}), n = ce(0), o = i.status === "ready" ? i.files : [], c = i.status === "ready" || i.status === "pending" ? i.files : [], h = i.status === "error" ? i.error : void 0, b = c.length - Ht, x = Gt(c), p = Vt(), {
|
|
2329
2334
|
t: m
|
|
2330
2335
|
} = se(), C = (I) => {
|
|
2331
2336
|
if (!I.length)
|
|
@@ -2380,10 +2385,10 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2380
2385
|
return u("form", {
|
|
2381
2386
|
class: "flex flex-col gap-1 p-2.5",
|
|
2382
2387
|
onSubmit: (I) => {
|
|
2383
|
-
if (I.preventDefault(),
|
|
2388
|
+
if (I.preventDefault(), i.status === "pending" || i.status === "error")
|
|
2384
2389
|
return;
|
|
2385
2390
|
const y = C(o);
|
|
2386
|
-
y ?
|
|
2391
|
+
y ? a({
|
|
2387
2392
|
status: "error",
|
|
2388
2393
|
error: y.error
|
|
2389
2394
|
}) : r({
|
|
@@ -2400,7 +2405,7 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2400
2405
|
children: [c.length > 0 ? u("ul", {
|
|
2401
2406
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2402
2407
|
children: [c.slice(0, Ht).map((I) => {
|
|
2403
|
-
const [y, _] =
|
|
2408
|
+
const [y, _] = it(I.name);
|
|
2404
2409
|
return u(Jt, {
|
|
2405
2410
|
class: "flex overflow-hidden",
|
|
2406
2411
|
children: [u("span", {
|
|
@@ -2459,14 +2464,14 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2459
2464
|
}), u("p", {
|
|
2460
2465
|
role: "status",
|
|
2461
2466
|
class: Oe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
|
|
2462
|
-
children:
|
|
2467
|
+
children: i.status === "pending" ? u(be, {
|
|
2463
2468
|
children: [u(Ct, {
|
|
2464
2469
|
"aria-hidden": "true",
|
|
2465
2470
|
class: "h-4 w-4"
|
|
2466
2471
|
}), m("file_preparing", {
|
|
2467
2472
|
count: c.length
|
|
2468
2473
|
})]
|
|
2469
|
-
}) :
|
|
2474
|
+
}) : i.status === "ready" ? u(be, {
|
|
2470
2475
|
children: [ze(x), " ", o.length > 1 ? "total" : "", u("span", {
|
|
2471
2476
|
class: "sr-only",
|
|
2472
2477
|
children: [". ", m("file_ready", {
|
|
@@ -2477,19 +2482,19 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2477
2482
|
}), u("input", {
|
|
2478
2483
|
id: "dropzone-file",
|
|
2479
2484
|
onInput: async (I) => {
|
|
2480
|
-
|
|
2485
|
+
Me(I.target instanceof HTMLInputElement);
|
|
2481
2486
|
const y = I.target.files ? Array.from(I.target.files) : [];
|
|
2482
2487
|
I.target.value = "";
|
|
2483
2488
|
const [_] = y;
|
|
2484
2489
|
if (!_)
|
|
2485
2490
|
return;
|
|
2486
|
-
const V = ++n.current, M =
|
|
2491
|
+
const V = ++n.current, M = i.status === "ready", D = y.map(Zt), G = C(D);
|
|
2487
2492
|
if (G)
|
|
2488
|
-
return E(G.reason, G.file ?? _),
|
|
2493
|
+
return E(G.reason, G.file ?? _), a({
|
|
2489
2494
|
status: "error",
|
|
2490
2495
|
error: G.error
|
|
2491
2496
|
});
|
|
2492
|
-
|
|
2497
|
+
a({
|
|
2493
2498
|
status: "pending",
|
|
2494
2499
|
files: D
|
|
2495
2500
|
});
|
|
@@ -2505,14 +2510,14 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2505
2510
|
throw N ?? (N = L), O;
|
|
2506
2511
|
}
|
|
2507
2512
|
}));
|
|
2508
|
-
n.current === V &&
|
|
2513
|
+
n.current === V && a({
|
|
2509
2514
|
status: "ready",
|
|
2510
2515
|
files: q
|
|
2511
2516
|
});
|
|
2512
2517
|
} catch {
|
|
2513
2518
|
if (n.current !== V)
|
|
2514
2519
|
return;
|
|
2515
|
-
E("unreadable", N ?? _),
|
|
2520
|
+
E("unreadable", N ?? _), a({
|
|
2516
2521
|
status: "error",
|
|
2517
2522
|
error: {
|
|
2518
2523
|
type: "invalid",
|
|
@@ -2528,9 +2533,9 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2528
2533
|
})]
|
|
2529
2534
|
}), u("div", {
|
|
2530
2535
|
class: "flex h-full flex-col items-center gap-2",
|
|
2531
|
-
children: [u(
|
|
2536
|
+
children: [u(Ee, {
|
|
2532
2537
|
disabled: o.length === 0
|
|
2533
|
-
}), e.config.optional && u(
|
|
2538
|
+
}), e.config.optional && u(Fe, {
|
|
2534
2539
|
class: "relative",
|
|
2535
2540
|
onClick: () => r(null)
|
|
2536
2541
|
})]
|
|
@@ -2540,9 +2545,9 @@ const Je = st("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2540
2545
|
})]
|
|
2541
2546
|
});
|
|
2542
2547
|
};
|
|
2543
|
-
var Ze = (e) => e.type === "checkbox",
|
|
2548
|
+
var Ze = (e) => e.type === "checkbox", Ae = (e) => e instanceof Date, re = (e) => e == null;
|
|
2544
2549
|
const $r = (e) => typeof e == "object";
|
|
2545
|
-
var W = (e) => !re(e) && !Array.isArray(e) && $r(e) && !
|
|
2550
|
+
var W = (e) => !re(e) && !Array.isArray(e) && $r(e) && !Ae(e), _n = (e) => W(e) && e.target ? Ze(e.target) ? e.target.checked : e.target.value : e, kn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Cn = (e, r) => e.has(kn(r)), Sn = (e) => {
|
|
2546
2551
|
const r = e.constructor && e.constructor.prototype;
|
|
2547
2552
|
return W(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2548
2553
|
}, At = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -2556,24 +2561,24 @@ function H(e) {
|
|
|
2556
2561
|
if (!t && !(W(e) && Sn(e)))
|
|
2557
2562
|
return e;
|
|
2558
2563
|
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2559
|
-
for (const
|
|
2560
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
2564
|
+
for (const i in e)
|
|
2565
|
+
Object.prototype.hasOwnProperty.call(e, i) && (s[i] = H(e[i]));
|
|
2561
2566
|
return s;
|
|
2562
2567
|
}
|
|
2563
|
-
var
|
|
2568
|
+
var at = (e) => /^\w*$/.test(e), z = (e) => e === void 0, Mt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Et = (e) => Mt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
|
|
2564
2569
|
if (!r || !W(e))
|
|
2565
2570
|
return t;
|
|
2566
|
-
const s = (
|
|
2571
|
+
const s = (at(r) ? [r] : Et(r)).reduce((i, a) => re(i) ? i : i[a], e);
|
|
2567
2572
|
return z(s) || s === e ? z(e[r]) ? t : e[r] : s;
|
|
2568
2573
|
}, ue = (e) => typeof e == "boolean", oe = (e) => typeof e == "function", j = (e, r, t) => {
|
|
2569
2574
|
let s = -1;
|
|
2570
|
-
const
|
|
2571
|
-
for (; ++s <
|
|
2572
|
-
const o =
|
|
2575
|
+
const i = at(r) ? [r] : Et(r), a = i.length, n = a - 1;
|
|
2576
|
+
for (; ++s < a; ) {
|
|
2577
|
+
const o = i[s];
|
|
2573
2578
|
let c = t;
|
|
2574
2579
|
if (s !== n) {
|
|
2575
2580
|
const h = e[o];
|
|
2576
|
-
c = W(h) || Array.isArray(h) ? h : isNaN(+
|
|
2581
|
+
c = W(h) || Array.isArray(h) ? h : isNaN(+i[s + 1]) ? {} : [];
|
|
2577
2582
|
}
|
|
2578
2583
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2579
2584
|
return;
|
|
@@ -2601,38 +2606,38 @@ const Xt = {
|
|
|
2601
2606
|
}, In = ee.createContext(null);
|
|
2602
2607
|
In.displayName = "HookFormControlContext";
|
|
2603
2608
|
var Fn = (e, r, t, s = !0) => {
|
|
2604
|
-
const
|
|
2609
|
+
const i = {
|
|
2605
2610
|
defaultValues: r._defaultValues
|
|
2606
2611
|
};
|
|
2607
|
-
for (const
|
|
2608
|
-
Object.defineProperty(
|
|
2612
|
+
for (const a in e)
|
|
2613
|
+
Object.defineProperty(i, a, {
|
|
2609
2614
|
get: () => {
|
|
2610
|
-
const n =
|
|
2615
|
+
const n = a;
|
|
2611
2616
|
return r._proxyFormState[n] !== le.all && (r._proxyFormState[n] = !s || le.all), t && (t[n] = !0), e[n];
|
|
2612
2617
|
}
|
|
2613
2618
|
});
|
|
2614
|
-
return
|
|
2619
|
+
return i;
|
|
2615
2620
|
};
|
|
2616
2621
|
const Vn = typeof window < "u" ? ee.useLayoutEffect : ee.useEffect;
|
|
2617
|
-
var ne = (e) => typeof e == "string", An = (e, r, t, s,
|
|
2622
|
+
var ne = (e) => typeof e == "string", An = (e, r, t, s, i) => ne(e) ? (s && r.watch.add(e), S(t, e, i)) : Array.isArray(e) ? e.map((a) => (s && r.watch.add(a), S(t, a))) : (s && (r.watchAll = !0), t), wt = (e) => re(e) || !$r(e);
|
|
2618
2623
|
function Ce(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2619
2624
|
if (wt(e) || wt(r))
|
|
2620
2625
|
return Object.is(e, r);
|
|
2621
|
-
if (
|
|
2626
|
+
if (Ae(e) && Ae(r))
|
|
2622
2627
|
return Object.is(e.getTime(), r.getTime());
|
|
2623
|
-
const s = Object.keys(e),
|
|
2624
|
-
if (s.length !==
|
|
2628
|
+
const s = Object.keys(e), i = Object.keys(r);
|
|
2629
|
+
if (s.length !== i.length)
|
|
2625
2630
|
return !1;
|
|
2626
2631
|
if (t.has(e) || t.has(r))
|
|
2627
2632
|
return !0;
|
|
2628
2633
|
t.add(e), t.add(r);
|
|
2629
|
-
for (const
|
|
2630
|
-
const n = e[
|
|
2631
|
-
if (!
|
|
2634
|
+
for (const a of s) {
|
|
2635
|
+
const n = e[a];
|
|
2636
|
+
if (!i.includes(a))
|
|
2632
2637
|
return !1;
|
|
2633
|
-
if (
|
|
2634
|
-
const o = r[
|
|
2635
|
-
if (
|
|
2638
|
+
if (a !== "ref") {
|
|
2639
|
+
const o = r[a];
|
|
2640
|
+
if (Ae(n) && Ae(o) || W(n) && W(o) || Array.isArray(n) && Array.isArray(o) ? !Ce(n, o, t) : !Object.is(n, o))
|
|
2636
2641
|
return !1;
|
|
2637
2642
|
}
|
|
2638
2643
|
}
|
|
@@ -2640,11 +2645,11 @@ function Ce(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2640
2645
|
}
|
|
2641
2646
|
const Mn = ee.createContext(null);
|
|
2642
2647
|
Mn.displayName = "HookFormContext";
|
|
2643
|
-
var qr = (e, r, t, s,
|
|
2648
|
+
var qr = (e, r, t, s, i) => r ? {
|
|
2644
2649
|
...t[e],
|
|
2645
2650
|
types: {
|
|
2646
2651
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2647
|
-
[s]:
|
|
2652
|
+
[s]: i || !0
|
|
2648
2653
|
}
|
|
2649
2654
|
} : {}, Ge = (e) => Array.isArray(e) ? e : [e], Yt = () => {
|
|
2650
2655
|
let e = [];
|
|
@@ -2652,13 +2657,13 @@ var qr = (e, r, t, s, a) => r ? {
|
|
|
2652
2657
|
get observers() {
|
|
2653
2658
|
return e;
|
|
2654
2659
|
},
|
|
2655
|
-
next: (
|
|
2656
|
-
for (const
|
|
2657
|
-
|
|
2660
|
+
next: (i) => {
|
|
2661
|
+
for (const a of e)
|
|
2662
|
+
a.next && a.next(i);
|
|
2658
2663
|
},
|
|
2659
|
-
subscribe: (
|
|
2664
|
+
subscribe: (i) => (e.push(i), {
|
|
2660
2665
|
unsubscribe: () => {
|
|
2661
|
-
e = e.filter((
|
|
2666
|
+
e = e.filter((a) => a !== i);
|
|
2662
2667
|
}
|
|
2663
2668
|
}),
|
|
2664
2669
|
unsubscribe: () => {
|
|
@@ -2670,12 +2675,12 @@ function Ur(e, r) {
|
|
|
2670
2675
|
const t = {};
|
|
2671
2676
|
for (const s in e)
|
|
2672
2677
|
if (e.hasOwnProperty(s)) {
|
|
2673
|
-
const
|
|
2674
|
-
if (
|
|
2675
|
-
const n = Ur(
|
|
2678
|
+
const i = e[s], a = r[s];
|
|
2679
|
+
if (i && W(i) && a) {
|
|
2680
|
+
const n = Ur(i, a);
|
|
2676
2681
|
W(n) && (t[s] = n);
|
|
2677
2682
|
} else
|
|
2678
|
-
e[s] && (t[s] =
|
|
2683
|
+
e[s] && (t[s] = a);
|
|
2679
2684
|
}
|
|
2680
2685
|
return t;
|
|
2681
2686
|
}
|
|
@@ -2699,8 +2704,8 @@ function Ln(e) {
|
|
|
2699
2704
|
return !0;
|
|
2700
2705
|
}
|
|
2701
2706
|
function K(e, r) {
|
|
2702
|
-
const t = Array.isArray(r) ? r :
|
|
2703
|
-
return s && delete s[
|
|
2707
|
+
const t = Array.isArray(r) ? r : at(r) ? [r] : Et(r), s = t.length === 1 ? e : Nn(e, t), i = t.length - 1, a = t[i];
|
|
2708
|
+
return s && delete s[a], i !== 0 && (W(s) && te(s) || Array.isArray(s) && Ln(s)) && K(e, t.slice(0, -1)), e;
|
|
2704
2709
|
}
|
|
2705
2710
|
var Tn = (e) => {
|
|
2706
2711
|
for (const r in e)
|
|
@@ -2721,12 +2726,12 @@ function _t(e, r = {}) {
|
|
|
2721
2726
|
function Le(e, r, t) {
|
|
2722
2727
|
t || (t = _t(r));
|
|
2723
2728
|
for (const s in e) {
|
|
2724
|
-
const
|
|
2725
|
-
if (Kr(
|
|
2726
|
-
z(r) || wt(t[s]) ? t[s] = _t(
|
|
2729
|
+
const i = e[s];
|
|
2730
|
+
if (Kr(i))
|
|
2731
|
+
z(r) || wt(t[s]) ? t[s] = _t(i, Array.isArray(i) ? [] : {}) : Le(i, re(r) ? {} : r[s], t[s]);
|
|
2727
2732
|
else {
|
|
2728
|
-
const
|
|
2729
|
-
t[s] = !Ce(
|
|
2733
|
+
const a = r[s];
|
|
2734
|
+
t[s] = !Ce(i, a);
|
|
2730
2735
|
}
|
|
2731
2736
|
}
|
|
2732
2737
|
return t;
|
|
@@ -2761,15 +2766,15 @@ function rr(e) {
|
|
|
2761
2766
|
return Nt(r) ? r.files : Lt(r) ? Hr(e.refs).value : zr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Ze(r) ? Wr(e.refs).value : Gr(z(r.value) ? e.ref.value : r.value, e);
|
|
2762
2767
|
}
|
|
2763
2768
|
var Dn = (e, r, t, s) => {
|
|
2764
|
-
const
|
|
2765
|
-
for (const
|
|
2766
|
-
const n = S(r,
|
|
2767
|
-
n && j(
|
|
2769
|
+
const i = {};
|
|
2770
|
+
for (const a of e) {
|
|
2771
|
+
const n = S(r, a);
|
|
2772
|
+
n && j(i, a, n._f);
|
|
2768
2773
|
}
|
|
2769
2774
|
return {
|
|
2770
2775
|
criteriaMode: t,
|
|
2771
2776
|
names: [...e],
|
|
2772
|
-
fields:
|
|
2777
|
+
fields: i,
|
|
2773
2778
|
shouldUseNativeValidation: s
|
|
2774
2779
|
};
|
|
2775
2780
|
}, tt = (e) => e instanceof RegExp, $e = (e) => z(e) ? e : tt(e) ? e.source : W(e) ? tt(e.value) ? e.value.source : e.value : e, sr = (e) => ({
|
|
@@ -2780,14 +2785,14 @@ var Dn = (e, r, t, s) => {
|
|
|
2780
2785
|
isOnTouch: e === le.onTouched
|
|
2781
2786
|
});
|
|
2782
2787
|
const nr = "AsyncFunction";
|
|
2783
|
-
var On = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || W(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Rn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate),
|
|
2788
|
+
var On = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || W(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Rn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ir = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
|
|
2784
2789
|
const He = (e, r, t, s) => {
|
|
2785
|
-
for (const
|
|
2786
|
-
const
|
|
2787
|
-
if (
|
|
2788
|
-
const { _f: n, ...o } =
|
|
2790
|
+
for (const i of t || Object.keys(e)) {
|
|
2791
|
+
const a = S(e, i);
|
|
2792
|
+
if (a) {
|
|
2793
|
+
const { _f: n, ...o } = a;
|
|
2789
2794
|
if (n) {
|
|
2790
|
-
if (n.refs && n.refs[0] && r(n.refs[0],
|
|
2795
|
+
if (n.refs && n.refs[0] && r(n.refs[0], i) && !s)
|
|
2791
2796
|
return !0;
|
|
2792
2797
|
if (n.ref && r(n.ref, n.name) && !s)
|
|
2793
2798
|
return !0;
|
|
@@ -2798,29 +2803,29 @@ const He = (e, r, t, s) => {
|
|
|
2798
2803
|
}
|
|
2799
2804
|
}
|
|
2800
2805
|
};
|
|
2801
|
-
function
|
|
2806
|
+
function ar(e, r, t) {
|
|
2802
2807
|
const s = S(e, t);
|
|
2803
|
-
if (s ||
|
|
2808
|
+
if (s || at(t))
|
|
2804
2809
|
return {
|
|
2805
2810
|
error: s,
|
|
2806
2811
|
name: t
|
|
2807
2812
|
};
|
|
2808
|
-
const
|
|
2809
|
-
for (;
|
|
2810
|
-
const
|
|
2811
|
-
if (n && !Array.isArray(n) && t !==
|
|
2813
|
+
const i = t.split(".");
|
|
2814
|
+
for (; i.length; ) {
|
|
2815
|
+
const a = i.join("."), n = S(r, a), o = S(e, a);
|
|
2816
|
+
if (n && !Array.isArray(n) && t !== a)
|
|
2812
2817
|
return { name: t };
|
|
2813
2818
|
if (o && o.type)
|
|
2814
2819
|
return {
|
|
2815
|
-
name:
|
|
2820
|
+
name: a,
|
|
2816
2821
|
error: o
|
|
2817
2822
|
};
|
|
2818
2823
|
if (o && o.root && o.root.type)
|
|
2819
2824
|
return {
|
|
2820
|
-
name: `${
|
|
2825
|
+
name: `${a}.root`,
|
|
2821
2826
|
error: o.root
|
|
2822
2827
|
};
|
|
2823
|
-
|
|
2828
|
+
i.pop();
|
|
2824
2829
|
}
|
|
2825
2830
|
return {
|
|
2826
2831
|
name: t
|
|
@@ -2828,9 +2833,9 @@ function ir(e, r, t) {
|
|
|
2828
2833
|
}
|
|
2829
2834
|
var Bn = (e, r, t, s) => {
|
|
2830
2835
|
t(e);
|
|
2831
|
-
const { name:
|
|
2832
|
-
return te(
|
|
2833
|
-
}, Pn = (e, r, t) => !e || !r || e === r || Ge(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), jn = (e, r, t, s,
|
|
2836
|
+
const { name: i, ...a } = e;
|
|
2837
|
+
return te(a) || Object.keys(a).length >= Object.keys(r).length || Object.keys(a).find((n) => r[n] === (!s || le.all));
|
|
2838
|
+
}, Pn = (e, r, t) => !e || !r || e === r || Ge(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), jn = (e, r, t, s, i) => i.isOnAll ? !1 : !t && i.isOnTouch ? !(r || e) : (t ? s.isOnBlur : i.isOnBlur) ? !e : (t ? s.isOnChange : i.isOnChange) ? e : !0, $n = (e, r) => !Mt(S(e, r)).length && K(e, r), qn = (e, r, t) => {
|
|
2834
2839
|
const s = Ge(S(e, t));
|
|
2835
2840
|
return j(s, "root", r[t]), j(e, t, s), e;
|
|
2836
2841
|
};
|
|
@@ -2845,12 +2850,12 @@ function or(e, r, t = "validate") {
|
|
|
2845
2850
|
var Ne = (e) => W(e) && !tt(e) ? e : {
|
|
2846
2851
|
value: e,
|
|
2847
2852
|
message: ""
|
|
2848
|
-
}, lr = async (e, r, t, s,
|
|
2853
|
+
}, lr = async (e, r, t, s, i, a) => {
|
|
2849
2854
|
const { ref: n, refs: o, required: c, maxLength: h, minLength: b, min: x, max: p, pattern: m, validate: C, name: E, valueAsNumber: A, mount: I } = e._f, y = S(t, E);
|
|
2850
2855
|
if (!I || r.has(E))
|
|
2851
2856
|
return {};
|
|
2852
2857
|
const _ = o ? o[0] : n, V = (w) => {
|
|
2853
|
-
|
|
2858
|
+
i && _.reportValidity && (_.setCustomValidity(ue(w) ? "" : w || ""), _.reportValidity());
|
|
2854
2859
|
}, M = {}, D = Lt(n), G = Ze(n), N = D || G, q = (A || Nt(n)) && z(n.value) && z(y) || et(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, L = qr.bind(null, E, s, M), O = (w, T, U, Z = ye.maxLength, X = ye.minLength) => {
|
|
2855
2860
|
const J = w ? T : U;
|
|
2856
2861
|
M[E] = {
|
|
@@ -2860,7 +2865,7 @@ var Ne = (e) => W(e) && !tt(e) ? e : {
|
|
|
2860
2865
|
...L(w ? Z : X, J)
|
|
2861
2866
|
};
|
|
2862
2867
|
};
|
|
2863
|
-
if (
|
|
2868
|
+
if (a ? !Array.isArray(y) || !y.length : c && (!N && (q || re(y)) || ue(y) && !y || G && !Wr(o).isValid || D && !Hr(o).isValid)) {
|
|
2864
2869
|
const { value: w, message: T } = ne(c) ? { value: !!c, message: c } : Ne(c);
|
|
2865
2870
|
if (w && (M[E] = {
|
|
2866
2871
|
type: ye.required,
|
|
@@ -2883,7 +2888,7 @@ var Ne = (e) => W(e) && !tt(e) ? e : {
|
|
|
2883
2888
|
if ((w || T) && (O(!!w, U.message, Z.message, ye.max, ye.min), !s))
|
|
2884
2889
|
return V(M[E].message), M;
|
|
2885
2890
|
}
|
|
2886
|
-
if ((h || b) && !q && (ne(y) ||
|
|
2891
|
+
if ((h || b) && !q && (ne(y) || a && Array.isArray(y))) {
|
|
2887
2892
|
const w = Ne(h), T = Ne(b), U = !re(w.value) && y.length > +w.value, Z = !re(T.value) && y.length < +T.value;
|
|
2888
2893
|
if ((U || Z) && (O(U, w.message, T.message), !s))
|
|
2889
2894
|
return V(M[E].message), M;
|
|
@@ -2950,7 +2955,7 @@ function zn(e = {}) {
|
|
|
2950
2955
|
validatingFields: {},
|
|
2951
2956
|
errors: r.errors || {},
|
|
2952
2957
|
disabled: r.disabled || !1
|
|
2953
|
-
}, s = {},
|
|
2958
|
+
}, s = {}, i = W(r.defaultValues) || W(r.values) ? H(r.defaultValues || r.values) || {} : {}, a = r.shouldUnregister ? {} : H(i), n = {
|
|
2954
2959
|
action: !1,
|
|
2955
2960
|
mount: !1,
|
|
2956
2961
|
watch: !1,
|
|
@@ -3009,7 +3014,7 @@ function zn(e = {}) {
|
|
|
3009
3014
|
const F = f(S(t.touchedFields, l), k.argA, k.argB);
|
|
3010
3015
|
v && j(t.touchedFields, l, F);
|
|
3011
3016
|
}
|
|
3012
|
-
(x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Le(
|
|
3017
|
+
(x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Le(i, a)), m.state.next({
|
|
3013
3018
|
name: l,
|
|
3014
3019
|
isDirty: w(l, d),
|
|
3015
3020
|
dirtyFields: t.dirtyFields,
|
|
@@ -3017,7 +3022,7 @@ function zn(e = {}) {
|
|
|
3017
3022
|
isValid: t.isValid
|
|
3018
3023
|
});
|
|
3019
3024
|
} else
|
|
3020
|
-
j(
|
|
3025
|
+
j(a, l, d);
|
|
3021
3026
|
}, _ = (l, d) => {
|
|
3022
3027
|
j(t.errors, l, d), m.state.next({
|
|
3023
3028
|
errors: t.errors
|
|
@@ -3030,8 +3035,8 @@ function zn(e = {}) {
|
|
|
3030
3035
|
}, M = (l, d, f, k) => {
|
|
3031
3036
|
const v = S(s, l);
|
|
3032
3037
|
if (v) {
|
|
3033
|
-
const g = S(
|
|
3034
|
-
z(g) || k && k.defaultChecked || d ? j(
|
|
3038
|
+
const g = S(a, l, z(f) ? S(i, l) : f);
|
|
3039
|
+
z(g) || k && k.defaultChecked || d ? j(a, l, d ? g : rr(v._f)) : Z(l, g), n.mount && !n.action && A();
|
|
3035
3040
|
}
|
|
3036
3041
|
}, D = (l, d, f, k, v) => {
|
|
3037
3042
|
let g = !1, F = !1;
|
|
@@ -3041,7 +3046,7 @@ function zn(e = {}) {
|
|
|
3041
3046
|
if (!r.disabled) {
|
|
3042
3047
|
if (!f || k) {
|
|
3043
3048
|
(x.isDirty || p.isDirty) && (F = t.isDirty, t.isDirty = R.isDirty = w(), g = F !== R.isDirty);
|
|
3044
|
-
const B = Ce(S(
|
|
3049
|
+
const B = Ce(S(i, l), d);
|
|
3045
3050
|
F = !!S(t.dirtyFields, l), B ? K(t.dirtyFields, l) : j(t.dirtyFields, l, !0), R.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || p.dirtyFields) && F !== !B;
|
|
3046
3051
|
}
|
|
3047
3052
|
if (f) {
|
|
@@ -3065,7 +3070,7 @@ function zn(e = {}) {
|
|
|
3065
3070
|
...F
|
|
3066
3071
|
}, m.state.next(F);
|
|
3067
3072
|
}
|
|
3068
|
-
}, N = async (l) => (I(l, !0), await r.resolver(
|
|
3073
|
+
}, N = async (l) => (I(l, !0), await r.resolver(a, r.context, Dn(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), q = async (l) => {
|
|
3069
3074
|
const { errors: d } = await N(l);
|
|
3070
3075
|
if (I(l), l)
|
|
3071
3076
|
for (const f of l) {
|
|
@@ -3085,7 +3090,7 @@ function zn(e = {}) {
|
|
|
3085
3090
|
if (g) {
|
|
3086
3091
|
const R = o.array.has(g.name), B = v._f && On(v._f);
|
|
3087
3092
|
B && x.validatingFields && I([g.name], !0);
|
|
3088
|
-
const Q = await lr(v, o.disabled,
|
|
3093
|
+
const Q = await lr(v, o.disabled, a, C, r.shouldUseNativeValidation && !d, R);
|
|
3089
3094
|
if (B && x.validatingFields && I([g.name]), Q[g.name] && (f.valid = !1, d || e.shouldUseNativeValidation))
|
|
3090
3095
|
break;
|
|
3091
3096
|
!d && (S(Q, g.name) ? R ? qn(t.errors, Q, g.name) : j(t.errors, g.name, Q[g.name]) : K(t.errors, g.name));
|
|
@@ -3100,18 +3105,18 @@ function zn(e = {}) {
|
|
|
3100
3105
|
d && (d._f.refs ? d._f.refs.every((f) => !vt(f)) : !vt(d._f.ref)) && ct(l);
|
|
3101
3106
|
}
|
|
3102
3107
|
o.unMount = /* @__PURE__ */ new Set();
|
|
3103
|
-
}, w = (l, d) => !r.disabled && (l && d && j(
|
|
3104
|
-
...n.mount ?
|
|
3105
|
-
}, f, d), U = (l) => Mt(S(n.mount ?
|
|
3108
|
+
}, w = (l, d) => !r.disabled && (l && d && j(a, l, d), !Ce(Pe(), i)), T = (l, d, f) => An(l, o, {
|
|
3109
|
+
...n.mount ? a : z(d) ? i : ne(l) ? { [l]: d } : d
|
|
3110
|
+
}, f, d), U = (l) => Mt(S(n.mount ? a : i, l, r.shouldUnregister ? S(i, l, []) : [])), Z = (l, d, f = {}) => {
|
|
3106
3111
|
const k = S(s, l);
|
|
3107
3112
|
let v = d;
|
|
3108
3113
|
if (k) {
|
|
3109
3114
|
const g = k._f;
|
|
3110
|
-
g && (!g.disabled && j(
|
|
3115
|
+
g && (!g.disabled && j(a, l, Gr(d, g)), v = et(g.ref) && re(d) ? "" : d, zr(g.ref) ? [...g.ref.options].forEach((F) => F.selected = v.includes(F.value)) : g.refs ? Ze(g.ref) ? g.refs.forEach((F) => {
|
|
3111
3116
|
(!F.defaultChecked || !F.disabled) && (Array.isArray(v) ? F.checked = !!v.find((R) => R === F.value) : F.checked = v === F.value || !!v);
|
|
3112
3117
|
}) : g.refs.forEach((F) => F.checked = F.value === v) : Nt(g.ref) ? g.ref.value = "" : (g.ref.value = v, g.ref.type || m.state.next({
|
|
3113
3118
|
name: l,
|
|
3114
|
-
values: H(
|
|
3119
|
+
values: H(a)
|
|
3115
3120
|
})));
|
|
3116
3121
|
}
|
|
3117
3122
|
(f.shouldDirty || f.shouldTouch) && D(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && we(l);
|
|
@@ -3120,51 +3125,51 @@ function zn(e = {}) {
|
|
|
3120
3125
|
if (!d.hasOwnProperty(k))
|
|
3121
3126
|
return;
|
|
3122
3127
|
const v = d[k], g = l + "." + k, F = S(s, g);
|
|
3123
|
-
(o.array.has(l) || W(v) || F && !F._f) && !
|
|
3128
|
+
(o.array.has(l) || W(v) || F && !F._f) && !Ae(v) ? X(g, v, f) : Z(g, v, f);
|
|
3124
3129
|
}
|
|
3125
3130
|
}, J = (l, d, f = {}) => {
|
|
3126
3131
|
const k = S(s, l), v = o.array.has(l), g = H(d);
|
|
3127
|
-
j(
|
|
3132
|
+
j(a, l, g), v ? (m.array.next({
|
|
3128
3133
|
name: l,
|
|
3129
|
-
values: H(
|
|
3134
|
+
values: H(a)
|
|
3130
3135
|
}), (x.isDirty || x.dirtyFields || p.isDirty || p.dirtyFields) && f.shouldDirty && m.state.next({
|
|
3131
3136
|
name: l,
|
|
3132
|
-
dirtyFields: Le(
|
|
3137
|
+
dirtyFields: Le(i, a),
|
|
3133
3138
|
isDirty: w(l, g)
|
|
3134
|
-
})) : k && !k._f && !re(g) ? X(l, g, f) : Z(l, g, f),
|
|
3139
|
+
})) : k && !k._f && !re(g) ? X(l, g, f) : Z(l, g, f), ir(l, o) ? m.state.next({
|
|
3135
3140
|
...t,
|
|
3136
3141
|
name: l,
|
|
3137
|
-
values: H(
|
|
3142
|
+
values: H(a)
|
|
3138
3143
|
}) : m.state.next({
|
|
3139
3144
|
name: n.mount ? l : void 0,
|
|
3140
|
-
values: H(
|
|
3145
|
+
values: H(a)
|
|
3141
3146
|
});
|
|
3142
3147
|
}, ve = async (l) => {
|
|
3143
3148
|
n.mount = !0;
|
|
3144
3149
|
const d = l.target;
|
|
3145
3150
|
let f = d.name, k = !0;
|
|
3146
3151
|
const v = S(s, f), g = (B) => {
|
|
3147
|
-
k = Number.isNaN(B) ||
|
|
3152
|
+
k = Number.isNaN(B) || Ae(B) && isNaN(B.getTime()) || Ce(B, S(a, f, B));
|
|
3148
3153
|
}, F = sr(r.mode), R = sr(r.reValidateMode);
|
|
3149
3154
|
if (v) {
|
|
3150
3155
|
let B, Q;
|
|
3151
|
-
const
|
|
3152
|
-
j(
|
|
3153
|
-
const pt = D(f,
|
|
3156
|
+
const Ve = d.type ? rr(v._f) : _n(l), ke = l.type === Xt.BLUR || l.type === Xt.FOCUS_OUT, es = !Rn(v._f) && !r.resolver && !S(t.errors, f) && !v._f.deps || jn(ke, S(t.touchedFields, f), t.isSubmitted, R, F), ht = ir(f, o, ke);
|
|
3157
|
+
j(a, f, Ve), ke ? (!d || !d.readOnly) && (v._f.onBlur && v._f.onBlur(l), c && c(0)) : v._f.onChange && v._f.onChange(l);
|
|
3158
|
+
const pt = D(f, Ve, ke), ts = !te(pt) || ht;
|
|
3154
3159
|
if (!ke && m.state.next({
|
|
3155
3160
|
name: f,
|
|
3156
3161
|
type: l.type,
|
|
3157
|
-
values: H(
|
|
3162
|
+
values: H(a)
|
|
3158
3163
|
}), es)
|
|
3159
3164
|
return (x.isValid || p.isValid) && (r.mode === "onBlur" ? ke && A() : ke || A()), ts && m.state.next({ name: f, ...ht ? {} : pt });
|
|
3160
3165
|
if (!ke && ht && m.state.next({ ...t }), r.resolver) {
|
|
3161
3166
|
const { errors: Pt } = await N([f]);
|
|
3162
|
-
if (I([f]), g(
|
|
3163
|
-
const rs =
|
|
3167
|
+
if (I([f]), g(Ve), k) {
|
|
3168
|
+
const rs = ar(t.errors, s, f), jt = ar(Pt, s, rs.name || f);
|
|
3164
3169
|
B = jt.error, f = jt.name, Q = te(Pt);
|
|
3165
3170
|
}
|
|
3166
3171
|
} else
|
|
3167
|
-
I([f], !0), B = (await lr(v, o.disabled,
|
|
3172
|
+
I([f], !0), B = (await lr(v, o.disabled, a, C, r.shouldUseNativeValidation))[f], I([f]), g(Ve), k && (B ? Q = !1 : (x.isValid || p.isValid) && (Q = await L(s, !0)));
|
|
3168
3173
|
k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && we(v._f.deps), G(f, Q, B, pt));
|
|
3169
3174
|
}
|
|
3170
3175
|
}, xe = (l, d) => {
|
|
@@ -3188,7 +3193,7 @@ function zn(e = {}) {
|
|
|
3188
3193
|
}), d.shouldFocus && !k && He(s, xe, l ? v : o.mount), k;
|
|
3189
3194
|
}, Pe = (l, d) => {
|
|
3190
3195
|
let f = {
|
|
3191
|
-
...n.mount ?
|
|
3196
|
+
...n.mount ? a : i
|
|
3192
3197
|
};
|
|
3193
3198
|
return d && (f = Ur(d.dirtyFields ? t.dirtyFields : t.touchedFields, f)), z(l) ? f : ne(l) ? S(f, l) : l.map((k) => S(f, k));
|
|
3194
3199
|
}, je = (l, d) => ({
|
|
@@ -3223,10 +3228,10 @@ function zn(e = {}) {
|
|
|
3223
3228
|
}) : T(l, d, !0), Ye = (l) => m.state.subscribe({
|
|
3224
3229
|
next: (d) => {
|
|
3225
3230
|
Pn(l.name, d.name, l.exact) && Bn(d, l.formState || x, Qr, l.reRenderRoot) && l.callback({
|
|
3226
|
-
values: { ...
|
|
3231
|
+
values: { ...a },
|
|
3227
3232
|
...t,
|
|
3228
3233
|
...d,
|
|
3229
|
-
defaultValues:
|
|
3234
|
+
defaultValues: i
|
|
3230
3235
|
});
|
|
3231
3236
|
}
|
|
3232
3237
|
}).unsubscribe, _e = (l) => (n.mount = !0, p = {
|
|
@@ -3240,9 +3245,9 @@ function zn(e = {}) {
|
|
|
3240
3245
|
}
|
|
3241
3246
|
})), ct = (l, d = {}) => {
|
|
3242
3247
|
for (const f of l ? Ge(l) : o.mount)
|
|
3243
|
-
o.mount.delete(f), o.array.delete(f), d.keepValue || (K(s, f), K(
|
|
3248
|
+
o.mount.delete(f), o.array.delete(f), d.keepValue || (K(s, f), K(a, f)), !d.keepError && K(t.errors, f), !d.keepDirty && K(t.dirtyFields, f), !d.keepTouched && K(t.touchedFields, f), !d.keepIsValidating && K(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && K(i, f);
|
|
3244
3249
|
m.state.next({
|
|
3245
|
-
values: H(
|
|
3250
|
+
values: H(a)
|
|
3246
3251
|
}), m.state.next({
|
|
3247
3252
|
...t,
|
|
3248
3253
|
...d.keepDirty ? { isDirty: w() } : {}
|
|
@@ -3292,7 +3297,7 @@ function zn(e = {}) {
|
|
|
3292
3297
|
refs: [
|
|
3293
3298
|
...R.filter(vt),
|
|
3294
3299
|
g,
|
|
3295
|
-
...Array.isArray(S(
|
|
3300
|
+
...Array.isArray(S(i, l)) ? [{}] : []
|
|
3296
3301
|
],
|
|
3297
3302
|
ref: { type: g.type, name: l }
|
|
3298
3303
|
} : { ref: g }
|
|
@@ -3312,7 +3317,7 @@ function zn(e = {}) {
|
|
|
3312
3317
|
}, Dt = (l, d) => async (f) => {
|
|
3313
3318
|
let k;
|
|
3314
3319
|
f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
|
|
3315
|
-
let v = H(
|
|
3320
|
+
let v = H(a);
|
|
3316
3321
|
if (m.state.next({
|
|
3317
3322
|
isSubmitting: !0
|
|
3318
3323
|
}), r.resolver) {
|
|
@@ -3343,18 +3348,18 @@ function zn(e = {}) {
|
|
|
3343
3348
|
}), k)
|
|
3344
3349
|
throw k;
|
|
3345
3350
|
}, Xr = (l, d = {}) => {
|
|
3346
|
-
S(s, l) && (z(d.defaultValue) ? J(l, H(S(
|
|
3351
|
+
S(s, l) && (z(d.defaultValue) ? J(l, H(S(i, l))) : (J(l, d.defaultValue), j(i, l, H(d.defaultValue))), d.keepTouched || K(t.touchedFields, l), d.keepDirty || (K(t.dirtyFields, l), t.isDirty = d.defaultValue ? w(l, H(S(i, l))) : w()), d.keepError || (K(t.errors, l), x.isValid && A()), m.state.next({ ...t }));
|
|
3347
3352
|
}, Ot = (l, d = {}) => {
|
|
3348
|
-
const f = l ? H(l) :
|
|
3349
|
-
if (d.keepDefaultValues || (
|
|
3353
|
+
const f = l ? H(l) : i, k = H(f), v = te(l), g = v ? i : k;
|
|
3354
|
+
if (d.keepDefaultValues || (i = f), !d.keepValues) {
|
|
3350
3355
|
if (d.keepDirtyValues) {
|
|
3351
3356
|
const F = /* @__PURE__ */ new Set([
|
|
3352
3357
|
...o.mount,
|
|
3353
|
-
...Object.keys(Le(
|
|
3358
|
+
...Object.keys(Le(i, a))
|
|
3354
3359
|
]);
|
|
3355
3360
|
for (const R of Array.from(F)) {
|
|
3356
|
-
const B = S(t.dirtyFields, R), Q = S(
|
|
3357
|
-
B && !z(Q) ? j(g, R, Q) : !B && !z(
|
|
3361
|
+
const B = S(t.dirtyFields, R), Q = S(a, R), Ve = S(g, R);
|
|
3362
|
+
B && !z(Q) ? j(g, R, Q) : !B && !z(Ve) && J(R, Ve);
|
|
3358
3363
|
}
|
|
3359
3364
|
} else {
|
|
3360
3365
|
if (At && z(l))
|
|
@@ -3377,7 +3382,7 @@ function zn(e = {}) {
|
|
|
3377
3382
|
else
|
|
3378
3383
|
s = {};
|
|
3379
3384
|
}
|
|
3380
|
-
|
|
3385
|
+
a = r.shouldUnregister ? d.keepDefaultValues ? H(i) : {} : H(g), m.array.next({
|
|
3381
3386
|
values: { ...g }
|
|
3382
3387
|
}), m.state.next({
|
|
3383
3388
|
values: { ...g }
|
|
@@ -3393,16 +3398,16 @@ function zn(e = {}) {
|
|
|
3393
3398
|
focus: ""
|
|
3394
3399
|
}, n.mount = !x.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !te(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!d.keepIsValid, n.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
|
|
3395
3400
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3396
|
-
isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l,
|
|
3401
|
+
isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l, i)),
|
|
3397
3402
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3398
|
-
dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues &&
|
|
3403
|
+
dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues && a ? Le(i, a) : t.dirtyFields : d.keepDefaultValues && l ? Le(i, l) : d.keepDirty ? t.dirtyFields : {},
|
|
3399
3404
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
3400
3405
|
errors: d.keepErrors ? t.errors : {},
|
|
3401
3406
|
isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
3402
3407
|
isSubmitting: !1,
|
|
3403
|
-
defaultValues:
|
|
3408
|
+
defaultValues: i
|
|
3404
3409
|
});
|
|
3405
|
-
}, Rt = (l, d) => Ot(oe(l) ? l(
|
|
3410
|
+
}, Rt = (l, d) => Ot(oe(l) ? l(a) : l, { ...r.resetOptions, ...d }), Yr = (l, d = {}) => {
|
|
3406
3411
|
const f = S(s, l), k = f && f._f;
|
|
3407
3412
|
if (k) {
|
|
3408
3413
|
const v = k.refs ? k.refs[0] : k.ref;
|
|
@@ -3447,7 +3452,7 @@ function zn(e = {}) {
|
|
|
3447
3452
|
return s;
|
|
3448
3453
|
},
|
|
3449
3454
|
get _formValues() {
|
|
3450
|
-
return
|
|
3455
|
+
return a;
|
|
3451
3456
|
},
|
|
3452
3457
|
get _state() {
|
|
3453
3458
|
return n;
|
|
@@ -3456,7 +3461,7 @@ function zn(e = {}) {
|
|
|
3456
3461
|
n = l;
|
|
3457
3462
|
},
|
|
3458
3463
|
get _defaultValues() {
|
|
3459
|
-
return
|
|
3464
|
+
return i;
|
|
3460
3465
|
},
|
|
3461
3466
|
get _names() {
|
|
3462
3467
|
return o;
|
|
@@ -3498,7 +3503,7 @@ function zn(e = {}) {
|
|
|
3498
3503
|
};
|
|
3499
3504
|
}
|
|
3500
3505
|
function ot(e = {}) {
|
|
3501
|
-
const r = ee.useRef(void 0), t = ee.useRef(void 0), [s,
|
|
3506
|
+
const r = ee.useRef(void 0), t = ee.useRef(void 0), [s, i] = ee.useState({
|
|
3502
3507
|
isDirty: !1,
|
|
3503
3508
|
isValidating: !1,
|
|
3504
3509
|
isLoading: oe(e.defaultValues),
|
|
@@ -3528,41 +3533,41 @@ function ot(e = {}) {
|
|
|
3528
3533
|
formState: s
|
|
3529
3534
|
};
|
|
3530
3535
|
}
|
|
3531
|
-
const
|
|
3532
|
-
return
|
|
3533
|
-
const n =
|
|
3534
|
-
formState:
|
|
3535
|
-
callback: () =>
|
|
3536
|
+
const a = r.current.control;
|
|
3537
|
+
return a._options = e, Vn(() => {
|
|
3538
|
+
const n = a._subscribe({
|
|
3539
|
+
formState: a._proxyFormState,
|
|
3540
|
+
callback: () => i({ ...a._formState }),
|
|
3536
3541
|
reRenderRoot: !0
|
|
3537
3542
|
});
|
|
3538
|
-
return
|
|
3543
|
+
return i((o) => ({
|
|
3539
3544
|
...o,
|
|
3540
3545
|
isReady: !0
|
|
3541
|
-
})),
|
|
3542
|
-
}, [
|
|
3543
|
-
e.mode && (
|
|
3544
|
-
}, [
|
|
3545
|
-
e.errors && (
|
|
3546
|
-
}, [
|
|
3547
|
-
e.shouldUnregister &&
|
|
3548
|
-
values:
|
|
3546
|
+
})), a._formState.isReady = !0, n;
|
|
3547
|
+
}, [a]), ee.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), ee.useEffect(() => {
|
|
3548
|
+
e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
|
|
3549
|
+
}, [a, e.mode, e.reValidateMode]), ee.useEffect(() => {
|
|
3550
|
+
e.errors && (a._setErrors(e.errors), a._focusError());
|
|
3551
|
+
}, [a, e.errors]), ee.useEffect(() => {
|
|
3552
|
+
e.shouldUnregister && a._subjects.state.next({
|
|
3553
|
+
values: a._getWatch()
|
|
3549
3554
|
});
|
|
3550
|
-
}, [
|
|
3551
|
-
if (
|
|
3552
|
-
const n =
|
|
3553
|
-
n !== s.isDirty &&
|
|
3555
|
+
}, [a, e.shouldUnregister]), ee.useEffect(() => {
|
|
3556
|
+
if (a._proxyFormState.isDirty) {
|
|
3557
|
+
const n = a._getDirty();
|
|
3558
|
+
n !== s.isDirty && a._subjects.state.next({
|
|
3554
3559
|
isDirty: n
|
|
3555
3560
|
});
|
|
3556
3561
|
}
|
|
3557
|
-
}, [
|
|
3562
|
+
}, [a, s.isDirty]), ee.useEffect(() => {
|
|
3558
3563
|
var n;
|
|
3559
|
-
e.values && !Ce(e.values, t.current) ? (
|
|
3564
|
+
e.values && !Ce(e.values, t.current) ? (a._reset(e.values, {
|
|
3560
3565
|
keepFieldsRef: !0,
|
|
3561
|
-
...
|
|
3562
|
-
}), !((n =
|
|
3563
|
-
}, [
|
|
3564
|
-
|
|
3565
|
-
}), r.current.formState = ee.useMemo(() => Fn(s,
|
|
3566
|
+
...a._options.resetOptions
|
|
3567
|
+
}), !((n = a._options.resetOptions) === null || n === void 0) && n.keepIsValid || a._setValid(), t.current = e.values, i((o) => ({ ...o }))) : a._resetDefaultValues();
|
|
3568
|
+
}, [a, e.values]), ee.useEffect(() => {
|
|
3569
|
+
a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
3570
|
+
}), r.current.formState = ee.useMemo(() => Fn(s, a), [a, s]), r.current;
|
|
3566
3571
|
}
|
|
3567
3572
|
const ur = (e, r, t) => {
|
|
3568
3573
|
if (e && "reportValidity" in e) {
|
|
@@ -3572,25 +3577,25 @@ const ur = (e, r, t) => {
|
|
|
3572
3577
|
}, Kn = (e, r) => {
|
|
3573
3578
|
for (const t in r.fields) {
|
|
3574
3579
|
const s = r.fields[t];
|
|
3575
|
-
s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((
|
|
3580
|
+
s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((i) => ur(i, t, e));
|
|
3576
3581
|
}
|
|
3577
3582
|
}, Wn = (e, r) => {
|
|
3578
3583
|
r.shouldUseNativeValidation && Kn(e, r);
|
|
3579
3584
|
const t = {};
|
|
3580
3585
|
for (const s in e) {
|
|
3581
|
-
const
|
|
3586
|
+
const i = S(r.fields, s), a = Object.assign(e[s] || {}, { ref: i && i.ref });
|
|
3582
3587
|
if (Gn(r.names || Object.keys(e), s)) {
|
|
3583
3588
|
const n = Object.assign({}, S(t, s));
|
|
3584
|
-
j(n, "root",
|
|
3589
|
+
j(n, "root", a), j(t, s, n);
|
|
3585
3590
|
} else
|
|
3586
|
-
j(t, s,
|
|
3591
|
+
j(t, s, a);
|
|
3587
3592
|
}
|
|
3588
3593
|
return t;
|
|
3589
3594
|
}, Gn = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3590
3595
|
var lt = function(e, r, t) {
|
|
3591
|
-
return t === void 0 && (t = {}), function(s,
|
|
3596
|
+
return t === void 0 && (t = {}), function(s, i, a) {
|
|
3592
3597
|
try {
|
|
3593
|
-
var n = !
|
|
3598
|
+
var n = !a.shouldUseNativeValidation && a.criteriaMode === "all";
|
|
3594
3599
|
return Promise.resolve(/* @__PURE__ */ sn(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
|
|
3595
3600
|
if (o.issues) {
|
|
3596
3601
|
for (var c = {}; o.issues.length; ) {
|
|
@@ -3601,7 +3606,7 @@ var lt = function(e, r, t) {
|
|
|
3601
3606
|
}
|
|
3602
3607
|
o.issues.shift();
|
|
3603
3608
|
}
|
|
3604
|
-
return { values: {}, errors: Wn(c,
|
|
3609
|
+
return { values: {}, errors: Wn(c, a) };
|
|
3605
3610
|
}
|
|
3606
3611
|
return { values: t.raw ? s : o.output, errors: {} };
|
|
3607
3612
|
});
|
|
@@ -3616,7 +3621,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3616
3621
|
max: e.maxSelected ?? e.options.length
|
|
3617
3622
|
};
|
|
3618
3623
|
return lt(/* @__PURE__ */ ge({
|
|
3619
|
-
checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */
|
|
3624
|
+
checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */ ie(), /* @__PURE__ */ Lr()), /* @__PURE__ */ It((s) => Object.entries(s).filter(([i, a]) => a).map(([i, a]) => i)), /* @__PURE__ */ Ke(t.max, r("validation_multiple_choice_max", {
|
|
3620
3625
|
count: t.max
|
|
3621
3626
|
})), /* @__PURE__ */ Te(t.min, r("validation_multiple_choice_min", {
|
|
3622
3627
|
count: t.min
|
|
@@ -3650,8 +3655,8 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3650
3655
|
onSubmitSuccess: r
|
|
3651
3656
|
}) => {
|
|
3652
3657
|
var b, x;
|
|
3653
|
-
const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1,
|
|
3654
|
-
t:
|
|
3658
|
+
const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, i = s && e.config.options.length === 2, {
|
|
3659
|
+
t: a
|
|
3655
3660
|
} = se(), {
|
|
3656
3661
|
register: n,
|
|
3657
3662
|
handleSubmit: o,
|
|
@@ -3662,9 +3667,9 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3662
3667
|
defaultValues: {
|
|
3663
3668
|
checked: s ? {} : Hn(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3664
3669
|
},
|
|
3665
|
-
resolver: Jn(e.config,
|
|
3670
|
+
resolver: Jn(e.config, a)
|
|
3666
3671
|
}), h = Vt();
|
|
3667
|
-
return
|
|
3672
|
+
return i ? u("ul", {
|
|
3668
3673
|
style: {
|
|
3669
3674
|
maxHeight: 6.5 * cr + 5 * dr + 2 * fr
|
|
3670
3675
|
},
|
|
@@ -3728,7 +3733,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3728
3733
|
})
|
|
3729
3734
|
}), u("div", {
|
|
3730
3735
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3731
|
-
children: [s ? null : u(
|
|
3736
|
+
children: [s ? null : u(Ee, {}), e.config.minSelected === 0 && u(Fe, {
|
|
3732
3737
|
class: "relative",
|
|
3733
3738
|
type: "button",
|
|
3734
3739
|
onClick: () => r({
|
|
@@ -3745,25 +3750,25 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3745
3750
|
})]
|
|
3746
3751
|
});
|
|
3747
3752
|
}, Yn = Re("number"), Qn = (e, r) => {
|
|
3748
|
-
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER,
|
|
3753
|
+
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, i = e.decimalCases ?? 0;
|
|
3749
3754
|
return lt(/* @__PURE__ */ ge({
|
|
3750
3755
|
number: /* @__PURE__ */ Se(/* @__PURE__ */ Tr(r("validation_number")), /* @__PURE__ */ Ar(t, r("validation_number_min", {
|
|
3751
3756
|
min: t
|
|
3752
3757
|
})), /* @__PURE__ */ Vr(s, r("validation_number_max", {
|
|
3753
3758
|
max: s
|
|
3754
|
-
})), /* @__PURE__ */ Ir((
|
|
3755
|
-
count:
|
|
3759
|
+
})), /* @__PURE__ */ Ir((a) => a === Number(a.toFixed(i)), r("validation_number_decimal_cases", {
|
|
3760
|
+
count: i
|
|
3756
3761
|
})))
|
|
3757
3762
|
}));
|
|
3758
|
-
},
|
|
3763
|
+
}, ei = ({
|
|
3759
3764
|
input: e,
|
|
3760
3765
|
onSubmitSuccess: r
|
|
3761
3766
|
}) => {
|
|
3762
3767
|
var x;
|
|
3763
3768
|
const t = e.config.defaultValue, s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, {
|
|
3764
|
-
t:
|
|
3769
|
+
t: i
|
|
3765
3770
|
} = se(), {
|
|
3766
|
-
register:
|
|
3771
|
+
register: a,
|
|
3767
3772
|
handleSubmit: n,
|
|
3768
3773
|
formState: {
|
|
3769
3774
|
errors: o
|
|
@@ -3772,11 +3777,11 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3772
3777
|
defaultValues: {
|
|
3773
3778
|
number: Yn(s) ? s.value : t ? Number(t) : void 0
|
|
3774
3779
|
},
|
|
3775
|
-
resolver: Qn(e.config,
|
|
3780
|
+
resolver: Qn(e.config, i)
|
|
3776
3781
|
}), {
|
|
3777
3782
|
ref: c,
|
|
3778
3783
|
...h
|
|
3779
|
-
} =
|
|
3784
|
+
} = a("number", {
|
|
3780
3785
|
required: !e.config.optional,
|
|
3781
3786
|
valueAsNumber: !0
|
|
3782
3787
|
}), b = ce();
|
|
@@ -3812,22 +3817,22 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3812
3817
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3813
3818
|
}),
|
|
3814
3819
|
placeholder: e.config.placeholder
|
|
3815
|
-
}), e.config.optional && u(
|
|
3820
|
+
}), e.config.optional && u(Fe, {
|
|
3816
3821
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3817
3822
|
onClick: () => r(null)
|
|
3818
3823
|
})]
|
|
3819
|
-
}), u(
|
|
3824
|
+
}), u(Ee, {})]
|
|
3820
3825
|
}), u(Be, {
|
|
3821
3826
|
error: o.number
|
|
3822
3827
|
})]
|
|
3823
3828
|
});
|
|
3824
|
-
},
|
|
3829
|
+
}, ti = (e) => {
|
|
3825
3830
|
if (e === "")
|
|
3826
3831
|
return {
|
|
3827
3832
|
countryCode: "",
|
|
3828
3833
|
phoneNumber: ""
|
|
3829
3834
|
};
|
|
3830
|
-
const r = Object.entries(Ft).find((
|
|
3835
|
+
const r = Object.entries(Ft).find((i) => e.startsWith(i[1])), t = r ? r[1] : "", s = e.replace(t, "");
|
|
3831
3836
|
return /^\d+$/.test(s) ? {
|
|
3832
3837
|
countryCode: t,
|
|
3833
3838
|
phoneNumber: s
|
|
@@ -3835,20 +3840,20 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3835
3840
|
countryCode: "",
|
|
3836
3841
|
phoneNumber: ""
|
|
3837
3842
|
};
|
|
3838
|
-
},
|
|
3839
|
-
const r = /* @__PURE__ */ Se(/* @__PURE__ */
|
|
3843
|
+
}, ri = "44", si = /^[0-9 ]+$/, ni = Re("string"), ii = Re("phone"), ai = (e) => {
|
|
3844
|
+
const r = /* @__PURE__ */ Se(/* @__PURE__ */ ie(e("validation_country_code")), /* @__PURE__ */ St(si, e("validation_country_code"))), t = /* @__PURE__ */ Se(/* @__PURE__ */ ie(e("validation_phone")), /* @__PURE__ */ Te(1, e("validation_phone")), /* @__PURE__ */ It((s) => s.replace(/[^0-9]/g, "")));
|
|
3840
3845
|
return lt(/* @__PURE__ */ ge({
|
|
3841
3846
|
countryCode: r,
|
|
3842
3847
|
phoneNumber: t
|
|
3843
3848
|
}));
|
|
3844
|
-
},
|
|
3849
|
+
}, oi = ({
|
|
3845
3850
|
input: e,
|
|
3846
3851
|
onSubmitSuccess: r
|
|
3847
3852
|
}) => {
|
|
3848
3853
|
var E;
|
|
3849
3854
|
const t = e.key ? (E = $.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, {
|
|
3850
3855
|
t: s
|
|
3851
|
-
} = se(), [
|
|
3856
|
+
} = se(), [i, a] = me(), n = ni(t) ? ti(t.value) : ii(t) ? t.value : void 0, {
|
|
3852
3857
|
register: o,
|
|
3853
3858
|
handleSubmit: c,
|
|
3854
3859
|
formState: {
|
|
@@ -3857,10 +3862,10 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3857
3862
|
watch: b
|
|
3858
3863
|
} = ot({
|
|
3859
3864
|
defaultValues: {
|
|
3860
|
-
countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3865
|
+
countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? ri,
|
|
3861
3866
|
phoneNumber: (n == null ? void 0 : n.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3862
3867
|
},
|
|
3863
|
-
resolver:
|
|
3868
|
+
resolver: ai(s)
|
|
3864
3869
|
}), {
|
|
3865
3870
|
ref: x,
|
|
3866
3871
|
...p
|
|
@@ -3874,15 +3879,15 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3874
3879
|
class: "flex flex-col gap-1 p-2.5",
|
|
3875
3880
|
onSubmit: c((A) => {
|
|
3876
3881
|
const I = A.phoneNumber.replace(/[^0-9]/g, ""), y = A.countryCode.replace(/[^0-9]/g, "");
|
|
3877
|
-
|
|
3882
|
+
a(void 0);
|
|
3878
3883
|
const _ = e.config.minChars ?? 7, V = I.length + y.length;
|
|
3879
3884
|
if (V < _)
|
|
3880
|
-
return
|
|
3885
|
+
return a(s("validation_phone_min_chars", {
|
|
3881
3886
|
count: _
|
|
3882
3887
|
}));
|
|
3883
3888
|
const M = e.config.maxChars;
|
|
3884
3889
|
if (M != null && V > M)
|
|
3885
|
-
return
|
|
3890
|
+
return a(s("validation_max_chars", {
|
|
3886
3891
|
count: M
|
|
3887
3892
|
}));
|
|
3888
3893
|
e.config.submissionFormat === "phone" ? r({
|
|
@@ -3931,18 +3936,18 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3931
3936
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3932
3937
|
}),
|
|
3933
3938
|
placeholder: e.config.placeholder
|
|
3934
|
-
}), e.config.optional && u(
|
|
3939
|
+
}), e.config.optional && u(Fe, {
|
|
3935
3940
|
class: "absolute bottom-0 right-1 top-0",
|
|
3936
3941
|
onClick: () => r(null)
|
|
3937
3942
|
})]
|
|
3938
|
-
}), u(
|
|
3943
|
+
}), u(Ee, {})]
|
|
3939
3944
|
}), u(Be, {
|
|
3940
3945
|
error: h.countryCode || h.phoneNumber || {
|
|
3941
|
-
message:
|
|
3946
|
+
message: i
|
|
3942
3947
|
}
|
|
3943
3948
|
})]
|
|
3944
3949
|
});
|
|
3945
|
-
}, Qe = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)),
|
|
3950
|
+
}, Qe = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), li = ({
|
|
3946
3951
|
input: e,
|
|
3947
3952
|
onSubmitSuccess: r
|
|
3948
3953
|
}) => {
|
|
@@ -3950,21 +3955,21 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
3950
3955
|
t
|
|
3951
3956
|
} = se(), {
|
|
3952
3957
|
availableAt: s
|
|
3953
|
-
} = e.config, [
|
|
3958
|
+
} = e.config, [i, a] = me(() => Qe(s)), [n, o] = me("");
|
|
3954
3959
|
vr(() => {
|
|
3955
3960
|
const h = Qe(s);
|
|
3956
|
-
if (
|
|
3961
|
+
if (a(h), h === 0)
|
|
3957
3962
|
return;
|
|
3958
3963
|
o(t("submission_cooldown", {
|
|
3959
3964
|
count: h
|
|
3960
3965
|
}));
|
|
3961
3966
|
const b = setInterval(() => {
|
|
3962
3967
|
const x = Qe(s);
|
|
3963
|
-
|
|
3968
|
+
a(x), !(x > 0) && (clearInterval(b), o(t("submission_cooldown_ready")));
|
|
3964
3969
|
}, 250);
|
|
3965
3970
|
return () => clearInterval(b);
|
|
3966
3971
|
}, [s, t]);
|
|
3967
|
-
const c =
|
|
3972
|
+
const c = i > 0;
|
|
3968
3973
|
return u("div", {
|
|
3969
3974
|
class: "flex flex-col items-center gap-2 py-3",
|
|
3970
3975
|
children: [u("button", {
|
|
@@ -4000,7 +4005,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4000
4005
|
"aria-hidden": "true",
|
|
4001
4006
|
class: "text-neutral-11 text-xs",
|
|
4002
4007
|
children: t("submission_cooldown", {
|
|
4003
|
-
count:
|
|
4008
|
+
count: i
|
|
4004
4009
|
})
|
|
4005
4010
|
}), u("p", {
|
|
4006
4011
|
role: "status",
|
|
@@ -4008,7 +4013,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4008
4013
|
children: n
|
|
4009
4014
|
})]
|
|
4010
4015
|
});
|
|
4011
|
-
},
|
|
4016
|
+
}, ui = {
|
|
4012
4017
|
date: {
|
|
4013
4018
|
type: "date",
|
|
4014
4019
|
inputMode: "text"
|
|
@@ -4027,7 +4032,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4027
4032
|
inputMode: "url",
|
|
4028
4033
|
formNoValidate: !0
|
|
4029
4034
|
}
|
|
4030
|
-
},
|
|
4035
|
+
}, ci = Re("string"), di = (e, r) => {
|
|
4031
4036
|
const t = {
|
|
4032
4037
|
maxLength: r("validation_max_chars", {
|
|
4033
4038
|
count: e.maxChars ?? 999
|
|
@@ -4038,34 +4043,34 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4038
4043
|
};
|
|
4039
4044
|
return lt(/* @__PURE__ */ ge({
|
|
4040
4045
|
text: {
|
|
4041
|
-
date: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4042
|
-
email: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4043
|
-
text: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4044
|
-
url: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4046
|
+
date: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_date")), /* @__PURE__ */ St(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
4047
|
+
email: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_email")), /* @__PURE__ */ Fr(r("validation_email")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
4048
|
+
text: /* @__PURE__ */ Se(/* @__PURE__ */ ie(), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
4049
|
+
url: /* @__PURE__ */ Se(/* @__PURE__ */ ie(r("validation_url")), /* @__PURE__ */ Mr(r("validation_url")), /* @__PURE__ */ Te(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ke(e.maxChars ?? 1 / 0, t.maxLength))
|
|
4045
4050
|
}[e.format]
|
|
4046
4051
|
}));
|
|
4047
|
-
},
|
|
4052
|
+
}, fi = ({
|
|
4048
4053
|
input: e,
|
|
4049
4054
|
onSubmitSuccess: r
|
|
4050
4055
|
}) => {
|
|
4051
4056
|
var x;
|
|
4052
4057
|
const {
|
|
4053
4058
|
t
|
|
4054
|
-
} = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0,
|
|
4055
|
-
register:
|
|
4059
|
+
} = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, i = e.config.defaultValue, {
|
|
4060
|
+
register: a,
|
|
4056
4061
|
handleSubmit: n,
|
|
4057
4062
|
formState: {
|
|
4058
4063
|
errors: o
|
|
4059
4064
|
}
|
|
4060
4065
|
} = ot({
|
|
4061
4066
|
defaultValues: {
|
|
4062
|
-
text:
|
|
4067
|
+
text: ci(s) ? s.value : i ?? ""
|
|
4063
4068
|
},
|
|
4064
|
-
resolver:
|
|
4069
|
+
resolver: di(e.config, t)
|
|
4065
4070
|
}), {
|
|
4066
4071
|
ref: c,
|
|
4067
4072
|
...h
|
|
4068
|
-
} =
|
|
4073
|
+
} = a("text", {
|
|
4069
4074
|
required: !e.config.optional
|
|
4070
4075
|
}), b = ce();
|
|
4071
4076
|
return Ie(() => {
|
|
@@ -4086,7 +4091,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4086
4091
|
children: [u("input", {
|
|
4087
4092
|
id: "chat-input",
|
|
4088
4093
|
...h,
|
|
4089
|
-
...
|
|
4094
|
+
...ui[e.config.format],
|
|
4090
4095
|
autocomplete: "off",
|
|
4091
4096
|
autoCapitalize: "off",
|
|
4092
4097
|
autoCorrect: "off",
|
|
@@ -4099,30 +4104,30 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4099
4104
|
optional: !!e.config.optional,
|
|
4100
4105
|
className: "w-full rounded-full"
|
|
4101
4106
|
})
|
|
4102
|
-
}), e.config.optional && u(
|
|
4107
|
+
}), e.config.optional && u(Fe, {
|
|
4103
4108
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
4104
4109
|
onClick: () => r(null)
|
|
4105
4110
|
})]
|
|
4106
|
-
}), u(
|
|
4111
|
+
}), u(Ee, {})]
|
|
4107
4112
|
}), u(Be, {
|
|
4108
4113
|
error: o.text
|
|
4109
4114
|
})]
|
|
4110
4115
|
});
|
|
4111
|
-
},
|
|
4112
|
-
text:
|
|
4113
|
-
phone:
|
|
4116
|
+
}, hi = {
|
|
4117
|
+
text: fi,
|
|
4118
|
+
phone: oi,
|
|
4114
4119
|
"multiple-choice": Xn,
|
|
4115
4120
|
boolean: pn,
|
|
4116
4121
|
file: wn,
|
|
4117
|
-
submit:
|
|
4122
|
+
submit: li,
|
|
4118
4123
|
address: cn,
|
|
4119
|
-
number:
|
|
4120
|
-
},
|
|
4124
|
+
number: ei
|
|
4125
|
+
}, pi = ({
|
|
4121
4126
|
logger: e,
|
|
4122
4127
|
analytics: r
|
|
4123
4128
|
}) => {
|
|
4124
|
-
var
|
|
4125
|
-
const t = (
|
|
4129
|
+
var a;
|
|
4130
|
+
const t = (a = $.current$.value.flow) == null ? void 0 : a.data.currentInput, s = ce(null), i = () => ae.onInteractionFn$.value();
|
|
4126
4131
|
return Ie(() => {
|
|
4127
4132
|
var n;
|
|
4128
4133
|
(n = s.current) == null || n.scrollTo({
|
|
@@ -4133,14 +4138,14 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4133
4138
|
class: "border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",
|
|
4134
4139
|
children: u("div", {
|
|
4135
4140
|
class: "flex flex-col",
|
|
4136
|
-
onPointerDownCapture: t ?
|
|
4137
|
-
onKeyDownCapture: t ?
|
|
4141
|
+
onPointerDownCapture: t ? i : void 0,
|
|
4142
|
+
onKeyDownCapture: t ? i : void 0,
|
|
4138
4143
|
children: t ? (() => {
|
|
4139
|
-
const n =
|
|
4144
|
+
const n = hi[t.type];
|
|
4140
4145
|
return u(n, {
|
|
4141
4146
|
logger: e,
|
|
4142
4147
|
analytics: r,
|
|
4143
|
-
onSubmitSuccess:
|
|
4148
|
+
onSubmitSuccess: ae.onSubmitSuccessFn$.value,
|
|
4144
4149
|
input: t
|
|
4145
4150
|
});
|
|
4146
4151
|
})() : u("div", {
|
|
@@ -4153,7 +4158,7 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4153
4158
|
className: "flex-grow rounded-full"
|
|
4154
4159
|
}),
|
|
4155
4160
|
disabled: !0
|
|
4156
|
-
}), u(
|
|
4161
|
+
}), u(Ee, {
|
|
4157
4162
|
disabled: !0,
|
|
4158
4163
|
"aria-hidden": "true",
|
|
4159
4164
|
tabIndex: -1
|
|
@@ -4162,47 +4167,47 @@ const cr = 27, dr = 12, fr = 10, Hn = Re("enum"), Jn = (e, r) => {
|
|
|
4162
4167
|
})
|
|
4163
4168
|
});
|
|
4164
4169
|
};
|
|
4165
|
-
function
|
|
4170
|
+
function yi(e) {
|
|
4166
4171
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4167
4172
|
}
|
|
4168
|
-
var
|
|
4173
|
+
var mi = function(e) {
|
|
4169
4174
|
return e instanceof RegExp;
|
|
4170
|
-
},
|
|
4175
|
+
}, gi = function(r) {
|
|
4171
4176
|
var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
|
|
4172
4177
|
return r && s.test(r) ? r.replace(t, "\\$&") : r;
|
|
4173
4178
|
}, Jr = function(e) {
|
|
4174
4179
|
return typeof e == "string";
|
|
4175
|
-
},
|
|
4180
|
+
}, bi = function(e) {
|
|
4176
4181
|
var r = [];
|
|
4177
4182
|
return e.forEach(function(t) {
|
|
4178
4183
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
4179
4184
|
}), r;
|
|
4180
4185
|
};
|
|
4181
|
-
function
|
|
4182
|
-
var s = 0,
|
|
4186
|
+
function vi(e, r, t) {
|
|
4187
|
+
var s = 0, i = 0;
|
|
4183
4188
|
if (e === "")
|
|
4184
4189
|
return e;
|
|
4185
4190
|
if (!e || !Jr(e))
|
|
4186
4191
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4187
|
-
var
|
|
4188
|
-
|
|
4189
|
-
for (var n = e.split(
|
|
4192
|
+
var a = r;
|
|
4193
|
+
mi(a) || (a = new RegExp("(" + gi(a) + ")", "gi"));
|
|
4194
|
+
for (var n = e.split(a), o = 1, c = n.length; o < c; o += 2) {
|
|
4190
4195
|
if (n[o] === void 0 || n[o - 1] === void 0) {
|
|
4191
4196
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
4192
4197
|
continue;
|
|
4193
4198
|
}
|
|
4194
|
-
|
|
4199
|
+
i = n[o].length, s += n[o - 1].length, n[o] = t(n[o], o, s), s += i;
|
|
4195
4200
|
}
|
|
4196
4201
|
return n;
|
|
4197
4202
|
}
|
|
4198
|
-
var
|
|
4199
|
-
return Array.isArray(r) || (r = [r]),
|
|
4200
|
-
return Jr(
|
|
4203
|
+
var xi = function(r, t, s) {
|
|
4204
|
+
return Array.isArray(r) || (r = [r]), bi(r.map(function(i) {
|
|
4205
|
+
return Jr(i) ? vi(i, t, s) : i;
|
|
4201
4206
|
}));
|
|
4202
4207
|
};
|
|
4203
|
-
const qe = /* @__PURE__ */
|
|
4204
|
-
const r = qe(e,
|
|
4205
|
-
const [, c, h] = n.match(
|
|
4208
|
+
const qe = /* @__PURE__ */ yi(xi), wi = /(\[[^\]]+\]\([^)]+\))/g, _i = /\[([^\]]+)\]\(([^)]+)\)/, ki = /(https?:\/\/[^\s]+)/g, Ci = /_(.*?)_/g, Si = /\*\*(.*?)\*\*/g, Ii = /\\n|\n/g, pr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Fi = (e) => {
|
|
4209
|
+
const r = qe(e, wi, (n, o) => {
|
|
4210
|
+
const [, c, h] = n.match(_i) ?? [];
|
|
4206
4211
|
return h ? u("a", {
|
|
4207
4212
|
class: pr,
|
|
4208
4213
|
href: h,
|
|
@@ -4210,17 +4215,17 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4210
4215
|
}, h + o) : u("span", {
|
|
4211
4216
|
children: "INVALID LINK"
|
|
4212
4217
|
});
|
|
4213
|
-
}), t = qe(r,
|
|
4218
|
+
}), t = qe(r, ki, (n, o) => u("a", {
|
|
4214
4219
|
class: pr,
|
|
4215
4220
|
href: n,
|
|
4216
4221
|
children: n
|
|
4217
|
-
}, n + o)), s = qe(t,
|
|
4222
|
+
}, n + o)), s = qe(t, Ci, (n, o) => u("em", {
|
|
4218
4223
|
children: n
|
|
4219
|
-
}, n + o)),
|
|
4224
|
+
}, n + o)), i = qe(s, Si, (n, o) => u("strong", {
|
|
4220
4225
|
children: n
|
|
4221
4226
|
}, n + o));
|
|
4222
|
-
return qe(
|
|
4223
|
-
},
|
|
4227
|
+
return qe(i, Ii, (n, o) => u("br", {}, `br-${o}`));
|
|
4228
|
+
}, Vi = st("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
|
|
4224
4229
|
variants: {
|
|
4225
4230
|
side: {
|
|
4226
4231
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4234,24 +4239,24 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4234
4239
|
defaultVariants: {
|
|
4235
4240
|
side: "left"
|
|
4236
4241
|
}
|
|
4237
|
-
}),
|
|
4242
|
+
}), Ai = ({
|
|
4238
4243
|
children: e,
|
|
4239
4244
|
className: r,
|
|
4240
4245
|
animate: t,
|
|
4241
4246
|
side: s,
|
|
4242
|
-
...
|
|
4247
|
+
...i
|
|
4243
4248
|
}) => u("p", {
|
|
4244
4249
|
style: {
|
|
4245
4250
|
transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
|
|
4246
4251
|
},
|
|
4247
|
-
class:
|
|
4252
|
+
class: Vi({
|
|
4248
4253
|
className: r,
|
|
4249
4254
|
side: s,
|
|
4250
4255
|
animate: t
|
|
4251
4256
|
}),
|
|
4252
|
-
...
|
|
4257
|
+
...i,
|
|
4253
4258
|
children: e
|
|
4254
|
-
}),
|
|
4259
|
+
}), Mi = ({
|
|
4255
4260
|
message: e
|
|
4256
4261
|
}) => u("div", {
|
|
4257
4262
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -4275,12 +4280,12 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4275
4280
|
})
|
|
4276
4281
|
})]
|
|
4277
4282
|
})
|
|
4278
|
-
}),
|
|
4283
|
+
}), Ei = ({
|
|
4279
4284
|
className: e,
|
|
4280
4285
|
...r
|
|
4281
4286
|
}) => u("div", {
|
|
4282
4287
|
"aria-hidden": !0,
|
|
4283
|
-
children:
|
|
4288
|
+
children: ae.isBotTyping$.value === !0 ? u("div", {
|
|
4284
4289
|
"aria-label": "Typing…",
|
|
4285
4290
|
class: Oe("flex gap-1 p-4", e),
|
|
4286
4291
|
...r,
|
|
@@ -4293,10 +4298,10 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4293
4298
|
}
|
|
4294
4299
|
}))
|
|
4295
4300
|
}) : void 0
|
|
4296
|
-
}),
|
|
4301
|
+
}), Ni = {
|
|
4297
4302
|
bot: "left",
|
|
4298
4303
|
user: "right"
|
|
4299
|
-
},
|
|
4304
|
+
}, Li = st("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
|
|
4300
4305
|
variants: {
|
|
4301
4306
|
variant: {
|
|
4302
4307
|
info: "text-neutral-8",
|
|
@@ -4305,7 +4310,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4305
4310
|
success: "text-[#4CAF50]"
|
|
4306
4311
|
}
|
|
4307
4312
|
}
|
|
4308
|
-
}),
|
|
4313
|
+
}), Ti = ({
|
|
4309
4314
|
lastSentMessageFooter: e
|
|
4310
4315
|
}) => {
|
|
4311
4316
|
const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? kt(r) : void 0;
|
|
@@ -4313,14 +4318,14 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4313
4318
|
"aria-label": "Chat messages",
|
|
4314
4319
|
"aria-live": "polite",
|
|
4315
4320
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4316
|
-
children: [t.map((
|
|
4321
|
+
children: [t.map((i, a) => u(be, {
|
|
4317
4322
|
children: u("li", {
|
|
4318
4323
|
class: "flex",
|
|
4319
|
-
tabIndex:
|
|
4320
|
-
children: [s &&
|
|
4324
|
+
tabIndex: a === t.length - 1 ? -1 : void 0,
|
|
4325
|
+
children: [s && i.groupId === s && !t.slice(a + 1).some((n) => n.groupId === s) ? e : null, ds(i).with({
|
|
4321
4326
|
type: "system"
|
|
4322
4327
|
}, (n) => u("p", {
|
|
4323
|
-
class:
|
|
4328
|
+
class: Li({
|
|
4324
4329
|
variant: n.variant
|
|
4325
4330
|
}),
|
|
4326
4331
|
children: n.text
|
|
@@ -4328,17 +4333,17 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4328
4333
|
type: "text",
|
|
4329
4334
|
author: fs.union("bot", "user")
|
|
4330
4335
|
}, (n) => {
|
|
4331
|
-
const o =
|
|
4336
|
+
const o = a === t.length - 1, c = n.author === "bot" ? Fi(n.text) : n.text;
|
|
4332
4337
|
return u(be, {
|
|
4333
|
-
children: u(
|
|
4338
|
+
children: u(Ai, {
|
|
4334
4339
|
animate: o,
|
|
4335
|
-
side:
|
|
4340
|
+
side: Ni[n.author],
|
|
4336
4341
|
children: c
|
|
4337
|
-
},
|
|
4342
|
+
}, a)
|
|
4338
4343
|
});
|
|
4339
4344
|
}).with({
|
|
4340
4345
|
type: "link"
|
|
4341
|
-
}, (n) => u(
|
|
4346
|
+
}, (n) => u(Mi, {
|
|
4342
4347
|
message: n
|
|
4343
4348
|
})).with({
|
|
4344
4349
|
type: "image"
|
|
@@ -4360,7 +4365,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4360
4365
|
type: "loading"
|
|
4361
4366
|
}, (n) => {
|
|
4362
4367
|
const o = t[t.length - 1];
|
|
4363
|
-
return !(n === o) ||
|
|
4368
|
+
return !(n === o) || ae.isBotTyping$.value ? null : u("div", {
|
|
4364
4369
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4365
4370
|
children: [u(Ct, {
|
|
4366
4371
|
"aria-hidden": n.text ? "true" : void 0,
|
|
@@ -4373,27 +4378,27 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4373
4378
|
});
|
|
4374
4379
|
}).exhaustive()]
|
|
4375
4380
|
})
|
|
4376
|
-
},
|
|
4381
|
+
}, a)), u(Ei, {}, "typing")]
|
|
4377
4382
|
});
|
|
4378
|
-
},
|
|
4383
|
+
}, Pi = ({
|
|
4379
4384
|
logger: e,
|
|
4380
4385
|
apiClient: r,
|
|
4381
4386
|
analytics: t,
|
|
4382
4387
|
talentBankClient: s
|
|
4383
4388
|
}) => {
|
|
4384
4389
|
const {
|
|
4385
|
-
flow:
|
|
4390
|
+
flow: i
|
|
4386
4391
|
} = $.current$.value;
|
|
4387
|
-
|
|
4388
|
-
const
|
|
4392
|
+
Me(i, "Flow is required to exist to show chatbot body");
|
|
4393
|
+
const a = $.viewState$.value, {
|
|
4389
4394
|
chatRef: n,
|
|
4390
4395
|
chatService: o
|
|
4391
4396
|
} = hs(), {
|
|
4392
4397
|
t: c
|
|
4393
4398
|
} = se(), [h, b] = me();
|
|
4394
4399
|
return Ie(() => {
|
|
4395
|
-
|
|
4396
|
-
}, [
|
|
4400
|
+
a === "maximised" && ae.scrollToEnd();
|
|
4401
|
+
}, [a]), Ie(() => {
|
|
4397
4402
|
var y;
|
|
4398
4403
|
const {
|
|
4399
4404
|
state: x,
|
|
@@ -4402,27 +4407,27 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4402
4407
|
if (x !== "loaded")
|
|
4403
4408
|
throw new Error(c("invalid_state"));
|
|
4404
4409
|
let m = p.data.nodeHistory.at(-1);
|
|
4405
|
-
if (
|
|
4410
|
+
if (ae.scrollToEnd(), $.setInput(void 0), p.data.isFinished)
|
|
4406
4411
|
return;
|
|
4407
4412
|
const C = () => {
|
|
4408
4413
|
const _ = $.current$.peek().flow;
|
|
4409
4414
|
!_ || _.data.hasInteracted || ($.markAsInteracted(), Ut(t, _, "FLOW_INTERACT"));
|
|
4410
4415
|
};
|
|
4411
|
-
|
|
4416
|
+
ae.onInteractionFn$.value = C, m === void 0 ? (m = gr(i.nodes).id, $.setCurrentNodeId(m), Ut(t, p, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
|
|
4412
4417
|
const {
|
|
4413
4418
|
interpret: E,
|
|
4414
4419
|
abort: A,
|
|
4415
4420
|
undo: I
|
|
4416
4421
|
} = ws({
|
|
4417
|
-
context:
|
|
4422
|
+
context: i.context,
|
|
4418
4423
|
analytics: {
|
|
4419
4424
|
service: t,
|
|
4420
|
-
customProperties: (y =
|
|
4425
|
+
customProperties: (y = i.analytics) == null ? void 0 : y.customProperties
|
|
4421
4426
|
},
|
|
4422
4427
|
apiClient: r,
|
|
4423
4428
|
logger: e,
|
|
4424
4429
|
talentBankClient: s,
|
|
4425
|
-
flow:
|
|
4430
|
+
flow: i,
|
|
4426
4431
|
chatService: o,
|
|
4427
4432
|
t: c,
|
|
4428
4433
|
getApplicationRecovery: () => {
|
|
@@ -4441,24 +4446,24 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4441
4446
|
var V;
|
|
4442
4447
|
$.markAsFinished();
|
|
4443
4448
|
const _ = $.current$.peek().flow;
|
|
4444
|
-
|
|
4449
|
+
Me(_), t.log({
|
|
4445
4450
|
event: "FLOW_END",
|
|
4446
4451
|
properties: {
|
|
4447
|
-
flow_id:
|
|
4448
|
-
flow_version:
|
|
4452
|
+
flow_id: i.id,
|
|
4453
|
+
flow_version: i.version,
|
|
4449
4454
|
flow_session_id: _.data.flowSessionId,
|
|
4450
|
-
flow_build:
|
|
4451
|
-
job:
|
|
4455
|
+
flow_build: i.build,
|
|
4456
|
+
job: i.job
|
|
4452
4457
|
},
|
|
4453
|
-
customProperties: (V =
|
|
4458
|
+
customProperties: (V = i.analytics) == null ? void 0 : V.customProperties
|
|
4454
4459
|
});
|
|
4455
4460
|
}
|
|
4456
4461
|
});
|
|
4457
4462
|
return b(() => I), E(m), () => {
|
|
4458
|
-
|
|
4463
|
+
ae.onInteractionFn$.value === C && (ae.onInteractionFn$.value = () => {
|
|
4459
4464
|
}), A();
|
|
4460
4465
|
};
|
|
4461
|
-
}, [t, r, o, e,
|
|
4466
|
+
}, [t, r, o, e, i, s, c]), u(be, {
|
|
4462
4467
|
children: [u("div", {
|
|
4463
4468
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4464
4469
|
children: [u("div", {
|
|
@@ -4470,31 +4475,31 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4470
4475
|
style: {
|
|
4471
4476
|
WebkitOverflowScrolling: "touch"
|
|
4472
4477
|
},
|
|
4473
|
-
children: u(
|
|
4474
|
-
lastSentMessageFooter: !kt(
|
|
4478
|
+
children: u(Ti, {
|
|
4479
|
+
lastSentMessageFooter: !kt(i) || !h ? null : u(Di, {
|
|
4475
4480
|
undoFn: h
|
|
4476
4481
|
})
|
|
4477
4482
|
})
|
|
4478
|
-
}),
|
|
4483
|
+
}), ae.isReadingHistory$.value && !i.data.isFinished && !ae.isBotTyping$.value && u("div", {
|
|
4479
4484
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4480
4485
|
children: u(wr, {
|
|
4481
4486
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4482
4487
|
"aria-label": c("jump_to_current"),
|
|
4483
4488
|
onClick: () => {
|
|
4484
4489
|
var p, m;
|
|
4485
|
-
|
|
4490
|
+
ae.scrollToEnd(), (m = ((p = n.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
|
|
4486
4491
|
preventScroll: !0
|
|
4487
4492
|
});
|
|
4488
4493
|
},
|
|
4489
4494
|
children: u(ps, {})
|
|
4490
4495
|
})
|
|
4491
4496
|
})]
|
|
4492
|
-
}), u(
|
|
4497
|
+
}), u(pi, {
|
|
4493
4498
|
logger: e,
|
|
4494
4499
|
analytics: t
|
|
4495
4500
|
})]
|
|
4496
4501
|
});
|
|
4497
|
-
},
|
|
4502
|
+
}, Di = ({
|
|
4498
4503
|
undoFn: e
|
|
4499
4504
|
}) => {
|
|
4500
4505
|
const {
|
|
@@ -4508,7 +4513,7 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4508
4513
|
const {
|
|
4509
4514
|
flow: t
|
|
4510
4515
|
} = $.current$.peek();
|
|
4511
|
-
|
|
4516
|
+
Me(t), e(t.data.nodeHistory);
|
|
4512
4517
|
},
|
|
4513
4518
|
children: u("path", {
|
|
4514
4519
|
d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
|
|
@@ -4517,5 +4522,5 @@ const qe = /* @__PURE__ */ ya(xa), wa = /(\[[^\]]+\]\([^)]+\))/g, _a = /\[([^\]]
|
|
|
4517
4522
|
});
|
|
4518
4523
|
};
|
|
4519
4524
|
export {
|
|
4520
|
-
|
|
4525
|
+
Pi as ChatbotBody
|
|
4521
4526
|
};
|