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