@inploi/plugin-chatbot 4.0.2 → 4.0.4
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 +3 -3
- package/dist/{chatbot-body-3dfd1aa9.js → chatbot-body-4157a64b.js} +433 -438
- package/dist/{chatbot-body-ee776a4a.cjs → chatbot-body-faf3f35a.cjs} +1 -1
- package/dist/i18n.d.ts +12 -0
- package/dist/{index-daa7b492.js → index-432cb092.js} +4 -2
- package/dist/index-fc252b7c.cjs +5 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +9 -10
- package/dist/index-8ae8589d.cjs +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as Ue, i as
|
|
1
|
+
import { g as Ue, i as er, k as Ne, a as tr, b as le, A as Me, c as Mr, N as Ke, _ as I, d as rr, h as Y, e as re, p as ue, F as pt, u as J, o as l, f as Le, j as dt, y as pe, s as M, l as Ze, m as he, n as Fr, q as at, r as ee, t as Nr, v as ke, w as Lr, x as nr, z as Tr, B as sr, C as Dr, D as Se, E as X, G as Rr, V as Or, H as ar, I as $e, J as je, K as Br, L as Pr, M as $r, O as jr, P as zr, Q as qr, R as Ft, S as Ur, T as Kr, U as Gr } from "./index-432cb092.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
|
-
const
|
|
3
|
+
const Nt = ({
|
|
4
4
|
condition: e,
|
|
5
5
|
context: t,
|
|
6
6
|
submissions: r,
|
|
@@ -9,7 +9,7 @@ const Lt = ({
|
|
|
9
9
|
const [s, ...a] = e.compareKey.split(".");
|
|
10
10
|
if (!s)
|
|
11
11
|
return !1;
|
|
12
|
-
const i =
|
|
12
|
+
const i = or({
|
|
13
13
|
context: t,
|
|
14
14
|
key: s,
|
|
15
15
|
path: a,
|
|
@@ -74,7 +74,7 @@ const Lt = ({
|
|
|
74
74
|
context: t
|
|
75
75
|
});
|
|
76
76
|
case "object":
|
|
77
|
-
return Array.isArray(u) && u.every(
|
|
77
|
+
return Array.isArray(u) && u.every(er) ? Fe(d, {
|
|
78
78
|
submissions: {
|
|
79
79
|
_temp: {
|
|
80
80
|
value: u,
|
|
@@ -153,7 +153,7 @@ const Lt = ({
|
|
|
153
153
|
const n = "combinator" in e.data ? e.data.conditions : [e.data];
|
|
154
154
|
if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
|
|
155
155
|
for (const a of n)
|
|
156
|
-
if (
|
|
156
|
+
if (Nt({
|
|
157
157
|
condition: a,
|
|
158
158
|
context: t,
|
|
159
159
|
submissions: r,
|
|
@@ -163,7 +163,7 @@ const Lt = ({
|
|
|
163
163
|
return !1;
|
|
164
164
|
} else {
|
|
165
165
|
for (const a of n)
|
|
166
|
-
if (!
|
|
166
|
+
if (!Nt({
|
|
167
167
|
condition: a,
|
|
168
168
|
context: t,
|
|
169
169
|
submissions: r,
|
|
@@ -172,11 +172,11 @@ const Lt = ({
|
|
|
172
172
|
return !1;
|
|
173
173
|
return !0;
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, Hr = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ne = (e, {
|
|
176
176
|
context: t,
|
|
177
177
|
submissions: r
|
|
178
|
-
}) => e.replace(
|
|
179
|
-
const [i, ...u] = s.trim().split("."), d =
|
|
178
|
+
}) => e.replace(Hr, (n, s, a = "") => {
|
|
179
|
+
const [i, ...u] = s.trim().split("."), d = or({
|
|
180
180
|
key: i,
|
|
181
181
|
path: u,
|
|
182
182
|
submissions: r,
|
|
@@ -210,14 +210,14 @@ const Lt = ({
|
|
|
210
210
|
case "number":
|
|
211
211
|
return h.toString();
|
|
212
212
|
case "object":
|
|
213
|
-
if (Array.isArray(h) && h.every(
|
|
213
|
+
if (Array.isArray(h) && h.every(er))
|
|
214
214
|
return h.join(", ");
|
|
215
215
|
}
|
|
216
216
|
break;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
return a;
|
|
220
|
-
}),
|
|
220
|
+
}), ir = ({
|
|
221
221
|
node: e,
|
|
222
222
|
nodes: t,
|
|
223
223
|
stopWhen: r
|
|
@@ -226,12 +226,12 @@ const Lt = ({
|
|
|
226
226
|
return e;
|
|
227
227
|
const n = e.nextId ? t.find((s) => s.id === e.nextId) : void 0;
|
|
228
228
|
if (n)
|
|
229
|
-
return
|
|
229
|
+
return ir({
|
|
230
230
|
node: n,
|
|
231
231
|
nodes: t,
|
|
232
232
|
stopWhen: r
|
|
233
233
|
});
|
|
234
|
-
},
|
|
234
|
+
}, Wr = ({
|
|
235
235
|
childNode: e,
|
|
236
236
|
nodes: t
|
|
237
237
|
}) => {
|
|
@@ -241,7 +241,7 @@ const Lt = ({
|
|
|
241
241
|
const a = t.find((u) => u.id === s.branchId);
|
|
242
242
|
if (!a)
|
|
243
243
|
return !1;
|
|
244
|
-
const i =
|
|
244
|
+
const i = ir({
|
|
245
245
|
node: a,
|
|
246
246
|
nodes: t,
|
|
247
247
|
stopWhen: (u) => u.id === e.id
|
|
@@ -250,7 +250,7 @@ const Lt = ({
|
|
|
250
250
|
});
|
|
251
251
|
if (n != null && n.nextId)
|
|
252
252
|
return t.find((s) => s.id === n.nextId);
|
|
253
|
-
},
|
|
253
|
+
}, Jr = ({
|
|
254
254
|
flow: e,
|
|
255
255
|
analytics: t,
|
|
256
256
|
logger: r,
|
|
@@ -265,29 +265,29 @@ const Lt = ({
|
|
|
265
265
|
let x = new AbortController();
|
|
266
266
|
const y = {
|
|
267
267
|
...t.service,
|
|
268
|
-
log: (
|
|
269
|
-
...
|
|
268
|
+
log: (_) => t.service.log({
|
|
269
|
+
..._,
|
|
270
270
|
customProperties: {
|
|
271
|
-
...
|
|
271
|
+
..._.customProperties,
|
|
272
272
|
...t.customProperties
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
|
-
}, p = async (
|
|
275
|
+
}, p = async (_, v) => {
|
|
276
276
|
const E = a();
|
|
277
|
-
d == null || d(
|
|
277
|
+
d == null || d(_, v);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
279
|
+
await Zr({
|
|
280
280
|
flow: e,
|
|
281
281
|
analytics: y,
|
|
282
282
|
logger: r,
|
|
283
283
|
apiClient: s,
|
|
284
284
|
context: n,
|
|
285
|
-
node:
|
|
285
|
+
node: _,
|
|
286
286
|
submissions: E,
|
|
287
287
|
t: h,
|
|
288
288
|
chat: {
|
|
289
289
|
sendMessage: async (S) => i.send({
|
|
290
|
-
groupId:
|
|
290
|
+
groupId: _.id,
|
|
291
291
|
message: S,
|
|
292
292
|
signal: x.signal
|
|
293
293
|
}),
|
|
@@ -298,13 +298,13 @@ const Lt = ({
|
|
|
298
298
|
addToSubmissions: i.addToSubmissions
|
|
299
299
|
},
|
|
300
300
|
next: (S) => {
|
|
301
|
-
const A = S ? e.nodes.find((g) => g.id === S) :
|
|
302
|
-
childNode:
|
|
301
|
+
const A = S ? e.nodes.find((g) => g.id === S) : Wr({
|
|
302
|
+
childNode: _,
|
|
303
303
|
nodes: e.nodes
|
|
304
304
|
});
|
|
305
|
-
return A ? p(A,
|
|
305
|
+
return A ? p(A, _) : u == null ? void 0 : u(_);
|
|
306
306
|
},
|
|
307
|
-
end: () => u == null ? void 0 : u(
|
|
307
|
+
end: () => u == null ? void 0 : u(_)
|
|
308
308
|
});
|
|
309
309
|
} catch (S) {
|
|
310
310
|
if (S instanceof Me)
|
|
@@ -313,20 +313,20 @@ const Lt = ({
|
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
315
|
return {
|
|
316
|
-
interpret: async (
|
|
317
|
-
const v = e.nodes.find((E) => E.id ===
|
|
316
|
+
interpret: async (_) => {
|
|
317
|
+
const v = e.nodes.find((E) => E.id === _) ?? tr(e.nodes);
|
|
318
318
|
return p(v);
|
|
319
319
|
},
|
|
320
|
-
undo: (
|
|
320
|
+
undo: (_) => {
|
|
321
321
|
let v = 1;
|
|
322
|
-
const E = e.nodes.find((A) => A.id ===
|
|
323
|
-
for (let A =
|
|
324
|
-
const g =
|
|
322
|
+
const E = e.nodes.find((A) => A.id === _[_.length - 1]);
|
|
323
|
+
for (let A = _.length - 2; A > 0; A--) {
|
|
324
|
+
const g = _[A], T = e.nodes.find((P) => P.id === g);
|
|
325
325
|
if (!T || (v++, T.type.startsWith("question-")))
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
x.abort(), x = new AbortController();
|
|
329
|
-
const S = e.nodes.find((A) => A.id ===
|
|
329
|
+
const S = e.nodes.find((A) => A.id === _[_.length - v]);
|
|
330
330
|
return le(S, "Undo failed: new start node not found"), p(S, E), {
|
|
331
331
|
removed: v
|
|
332
332
|
};
|
|
@@ -336,93 +336,93 @@ const Lt = ({
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
}, Qe = (e) => `+${e.countryCode} ${e.phoneNumber}`;
|
|
339
|
-
async function
|
|
339
|
+
async function Zr(e) {
|
|
340
340
|
const t = e.node;
|
|
341
341
|
switch (t.type) {
|
|
342
342
|
case "text":
|
|
343
|
-
return
|
|
343
|
+
return sn({
|
|
344
344
|
...e,
|
|
345
345
|
node: t
|
|
346
346
|
});
|
|
347
347
|
case "image":
|
|
348
|
-
return
|
|
348
|
+
return an({
|
|
349
349
|
...e,
|
|
350
350
|
node: t
|
|
351
351
|
});
|
|
352
352
|
case "question-text":
|
|
353
|
-
return
|
|
353
|
+
return on({
|
|
354
354
|
...e,
|
|
355
355
|
node: t
|
|
356
356
|
});
|
|
357
357
|
case "question-enum":
|
|
358
|
-
return
|
|
358
|
+
return cn({
|
|
359
359
|
...e,
|
|
360
360
|
node: t
|
|
361
361
|
});
|
|
362
362
|
case "question-number":
|
|
363
|
-
return
|
|
363
|
+
return ln({
|
|
364
364
|
...e,
|
|
365
365
|
node: t
|
|
366
366
|
});
|
|
367
367
|
case "question-phone":
|
|
368
|
-
return
|
|
368
|
+
return un({
|
|
369
369
|
...e,
|
|
370
370
|
node: t
|
|
371
371
|
});
|
|
372
372
|
case "question-boolean":
|
|
373
|
-
return
|
|
373
|
+
return dn({
|
|
374
374
|
...e,
|
|
375
375
|
node: t
|
|
376
376
|
});
|
|
377
377
|
case "question-file":
|
|
378
|
-
return
|
|
378
|
+
return hn({
|
|
379
379
|
...e,
|
|
380
380
|
node: t
|
|
381
381
|
});
|
|
382
382
|
case "question-address":
|
|
383
|
-
return
|
|
383
|
+
return fn({
|
|
384
384
|
...e,
|
|
385
385
|
node: t
|
|
386
386
|
});
|
|
387
387
|
case "end-flow":
|
|
388
|
-
return
|
|
388
|
+
return pn({
|
|
389
389
|
...e,
|
|
390
390
|
node: t
|
|
391
391
|
});
|
|
392
392
|
case "if-block":
|
|
393
|
-
return
|
|
393
|
+
return nn({
|
|
394
394
|
...e,
|
|
395
395
|
node: t
|
|
396
396
|
});
|
|
397
397
|
case "jump":
|
|
398
|
-
return
|
|
398
|
+
return Yr({
|
|
399
399
|
...e,
|
|
400
400
|
node: t
|
|
401
401
|
});
|
|
402
402
|
case "link":
|
|
403
|
-
return
|
|
403
|
+
return rn({
|
|
404
404
|
...e,
|
|
405
405
|
node: t
|
|
406
406
|
});
|
|
407
407
|
case "integration-application-submit":
|
|
408
|
-
return
|
|
408
|
+
return tn({
|
|
409
409
|
...e,
|
|
410
410
|
node: t
|
|
411
411
|
});
|
|
412
412
|
case "add-submission":
|
|
413
|
-
return
|
|
413
|
+
return en({
|
|
414
414
|
...e,
|
|
415
415
|
node: t
|
|
416
416
|
});
|
|
417
417
|
case "integration-workflow-get":
|
|
418
418
|
throw Error("Workflow should be unreachable");
|
|
419
419
|
case "identify":
|
|
420
|
-
return
|
|
420
|
+
return Xr({
|
|
421
421
|
...e,
|
|
422
422
|
node: t
|
|
423
423
|
});
|
|
424
424
|
case "feedback":
|
|
425
|
-
return
|
|
425
|
+
return Qr({
|
|
426
426
|
...e,
|
|
427
427
|
node: t
|
|
428
428
|
});
|
|
@@ -437,13 +437,13 @@ const Ie = (e, t) => {
|
|
|
437
437
|
throw new Error(`Submission at “${t}” is not a string or number`);
|
|
438
438
|
return r;
|
|
439
439
|
};
|
|
440
|
-
async function
|
|
440
|
+
async function Qr({
|
|
441
441
|
next: e,
|
|
442
442
|
node: t
|
|
443
443
|
}) {
|
|
444
444
|
e(t.nextId);
|
|
445
445
|
}
|
|
446
|
-
async function
|
|
446
|
+
async function Xr({
|
|
447
447
|
next: e,
|
|
448
448
|
node: t,
|
|
449
449
|
analytics: r,
|
|
@@ -476,13 +476,13 @@ async function Yr({
|
|
|
476
476
|
e(t.nextId);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
async function
|
|
479
|
+
async function Yr({
|
|
480
480
|
next: e,
|
|
481
481
|
node: t
|
|
482
482
|
}) {
|
|
483
483
|
e(t.data.targetId);
|
|
484
484
|
}
|
|
485
|
-
async function
|
|
485
|
+
async function en({
|
|
486
486
|
next: e,
|
|
487
487
|
node: t,
|
|
488
488
|
logger: r,
|
|
@@ -501,7 +501,7 @@ async function tn({
|
|
|
501
501
|
})
|
|
502
502
|
}, e(t.nextId);
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
504
|
+
async function tn({
|
|
505
505
|
chat: e,
|
|
506
506
|
next: t,
|
|
507
507
|
node: r,
|
|
@@ -525,7 +525,7 @@ async function rn({
|
|
|
525
525
|
const {
|
|
526
526
|
anonymous_id: y,
|
|
527
527
|
session_id: p
|
|
528
|
-
} = i.getSessionInfo(),
|
|
528
|
+
} = i.getSessionInfo(), _ = await s.fetch("/flow/submit", {
|
|
529
529
|
method: "POST",
|
|
530
530
|
body: JSON.stringify({
|
|
531
531
|
log_submit: !1,
|
|
@@ -533,13 +533,13 @@ async function rn({
|
|
|
533
533
|
anonymous_id: y,
|
|
534
534
|
session_id: p,
|
|
535
535
|
job: u.job,
|
|
536
|
-
submissions:
|
|
536
|
+
submissions: Mr(a || {})
|
|
537
537
|
})
|
|
538
538
|
}).catch((v) => v);
|
|
539
539
|
r.data.key && e.addToSubmissions(r.data.key, {
|
|
540
540
|
type: "integration",
|
|
541
|
-
value:
|
|
542
|
-
}), Ke(
|
|
541
|
+
value: _
|
|
542
|
+
}), Ke(_).with({
|
|
543
543
|
integration_response: I.select(I.union({
|
|
544
544
|
service: I.optional(I.string),
|
|
545
545
|
status: I.number,
|
|
@@ -569,7 +569,7 @@ async function rn({
|
|
|
569
569
|
}
|
|
570
570
|
});
|
|
571
571
|
}).otherwise(() => {
|
|
572
|
-
}), await Ke(
|
|
572
|
+
}), await Ke(_).with(I.union({
|
|
573
573
|
ats_data: I.select("redirect", {
|
|
574
574
|
redirect_url: I.string,
|
|
575
575
|
message: I.optional(I.union(I.string, I.nullish)),
|
|
@@ -659,7 +659,7 @@ async function rn({
|
|
|
659
659
|
};
|
|
660
660
|
await h(r.data.skipConfirmation);
|
|
661
661
|
}
|
|
662
|
-
async function
|
|
662
|
+
async function rn({
|
|
663
663
|
chat: e,
|
|
664
664
|
next: t,
|
|
665
665
|
node: r,
|
|
@@ -678,7 +678,7 @@ async function nn({
|
|
|
678
678
|
})
|
|
679
679
|
}), t(r.nextId);
|
|
680
680
|
}
|
|
681
|
-
async function
|
|
681
|
+
async function nn({
|
|
682
682
|
submissions: e,
|
|
683
683
|
next: t,
|
|
684
684
|
node: r,
|
|
@@ -689,7 +689,7 @@ async function sn({
|
|
|
689
689
|
context: n
|
|
690
690
|
}) ? r.branchId : r.nextId);
|
|
691
691
|
}
|
|
692
|
-
async function
|
|
692
|
+
async function sn({
|
|
693
693
|
chat: e,
|
|
694
694
|
next: t,
|
|
695
695
|
node: r,
|
|
@@ -705,7 +705,7 @@ async function an({
|
|
|
705
705
|
})
|
|
706
706
|
}), t(r.nextId);
|
|
707
707
|
}
|
|
708
|
-
async function
|
|
708
|
+
async function an({
|
|
709
709
|
chat: e,
|
|
710
710
|
next: t,
|
|
711
711
|
node: r
|
|
@@ -718,7 +718,7 @@ async function on({
|
|
|
718
718
|
width: r.data.width
|
|
719
719
|
}), t(r.nextId);
|
|
720
720
|
}
|
|
721
|
-
async function
|
|
721
|
+
async function on({
|
|
722
722
|
chat: e,
|
|
723
723
|
next: t,
|
|
724
724
|
node: r,
|
|
@@ -766,7 +766,7 @@ async function ln({
|
|
|
766
766
|
text: i.type === "phone" ? Qe(i.value) : i.value
|
|
767
767
|
}), t(r.nextId);
|
|
768
768
|
}
|
|
769
|
-
async function
|
|
769
|
+
async function ln({
|
|
770
770
|
chat: e,
|
|
771
771
|
next: t,
|
|
772
772
|
node: r,
|
|
@@ -803,7 +803,7 @@ async function un({
|
|
|
803
803
|
text: i.value.toString()
|
|
804
804
|
}), t(r.nextId);
|
|
805
805
|
}
|
|
806
|
-
async function
|
|
806
|
+
async function un({
|
|
807
807
|
chat: e,
|
|
808
808
|
next: t,
|
|
809
809
|
node: r,
|
|
@@ -842,7 +842,7 @@ async function cn({
|
|
|
842
842
|
text: a.type === "phone" ? Qe(a.value) : a.value
|
|
843
843
|
}), t(r.nextId);
|
|
844
844
|
}
|
|
845
|
-
async function
|
|
845
|
+
async function cn({
|
|
846
846
|
chat: e,
|
|
847
847
|
next: t,
|
|
848
848
|
node: r,
|
|
@@ -873,7 +873,7 @@ async function dn({
|
|
|
873
873
|
text: r.data.options.filter((u) => i.value.includes(u.value)).map((u) => u.label).join(", ")
|
|
874
874
|
}), t(r.nextId);
|
|
875
875
|
}
|
|
876
|
-
async function
|
|
876
|
+
async function dn({
|
|
877
877
|
chat: e,
|
|
878
878
|
next: t,
|
|
879
879
|
node: r,
|
|
@@ -910,7 +910,7 @@ async function fn({
|
|
|
910
910
|
text: i.value === !0 ? r.data.trueLabel : r.data.falseLabel
|
|
911
911
|
}), t(r.nextId);
|
|
912
912
|
}
|
|
913
|
-
async function
|
|
913
|
+
async function fn({
|
|
914
914
|
chat: e,
|
|
915
915
|
next: t,
|
|
916
916
|
node: r,
|
|
@@ -946,7 +946,7 @@ async function hn({
|
|
|
946
946
|
}
|
|
947
947
|
return t(r.nextId);
|
|
948
948
|
}
|
|
949
|
-
async function
|
|
949
|
+
async function hn({
|
|
950
950
|
node: e,
|
|
951
951
|
chat: t,
|
|
952
952
|
next: r,
|
|
@@ -989,7 +989,7 @@ async function pn({
|
|
|
989
989
|
});
|
|
990
990
|
r(e.nextId);
|
|
991
991
|
}
|
|
992
|
-
async function
|
|
992
|
+
async function pn({
|
|
993
993
|
chat: e,
|
|
994
994
|
end: t,
|
|
995
995
|
node: r
|
|
@@ -1000,7 +1000,7 @@ async function mn({
|
|
|
1000
1000
|
text: r.data.systemMessage
|
|
1001
1001
|
}), t();
|
|
1002
1002
|
}
|
|
1003
|
-
const
|
|
1003
|
+
const or = ({
|
|
1004
1004
|
key: e,
|
|
1005
1005
|
path: t,
|
|
1006
1006
|
submissions: r,
|
|
@@ -1033,7 +1033,7 @@ const lr = ({
|
|
|
1033
1033
|
}
|
|
1034
1034
|
return r == null ? void 0 : r[e];
|
|
1035
1035
|
};
|
|
1036
|
-
function
|
|
1036
|
+
function ft(e, t, r) {
|
|
1037
1037
|
var n, s, a, i, u;
|
|
1038
1038
|
t == null && (t = 100);
|
|
1039
1039
|
function d() {
|
|
@@ -1051,10 +1051,10 @@ function ht(e, t, r) {
|
|
|
1051
1051
|
n && (u = e.apply(a, s), a = s = null, clearTimeout(n), n = null);
|
|
1052
1052
|
}, h;
|
|
1053
1053
|
}
|
|
1054
|
-
|
|
1055
|
-
var
|
|
1056
|
-
const
|
|
1057
|
-
function
|
|
1054
|
+
ft.debounce = ft;
|
|
1055
|
+
var mn = ft;
|
|
1056
|
+
const Lt = /* @__PURE__ */ rr(mn);
|
|
1057
|
+
function gn(e) {
|
|
1058
1058
|
let {
|
|
1059
1059
|
debounce: t,
|
|
1060
1060
|
scroll: r,
|
|
@@ -1085,7 +1085,7 @@ function yn(e) {
|
|
|
1085
1085
|
lastBounds: i
|
|
1086
1086
|
}), h = t ? typeof t == "number" ? t : t.scroll : null, x = t ? typeof t == "number" ? t : t.resize : null, y = re(!1);
|
|
1087
1087
|
ue(() => (y.current = !0, () => void (y.current = !1)));
|
|
1088
|
-
const [p,
|
|
1088
|
+
const [p, _, v] = pt(() => {
|
|
1089
1089
|
const g = () => {
|
|
1090
1090
|
if (!d.current.element)
|
|
1091
1091
|
return;
|
|
@@ -1108,9 +1108,9 @@ function yn(e) {
|
|
|
1108
1108
|
x: G,
|
|
1109
1109
|
y: se
|
|
1110
1110
|
};
|
|
1111
|
-
d.current.element instanceof HTMLElement && s && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), y.current && !
|
|
1111
|
+
d.current.element instanceof HTMLElement && s && (q.height = d.current.element.offsetHeight, q.width = d.current.element.offsetWidth), Object.freeze(q), y.current && !xn(d.current.lastBounds, q) && u(d.current.lastBounds = q);
|
|
1112
1112
|
};
|
|
1113
|
-
return [g, x ?
|
|
1113
|
+
return [g, x ? Lt(g, x) : g, h ? Lt(g, h) : g];
|
|
1114
1114
|
}, [u, s, h, x]);
|
|
1115
1115
|
function E() {
|
|
1116
1116
|
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll", v, !0)), d.current.scrollContainers = null), d.current.resizeObserver && (d.current.resizeObserver.disconnect(), d.current.resizeObserver = null);
|
|
@@ -1122,19 +1122,19 @@ function yn(e) {
|
|
|
1122
1122
|
})));
|
|
1123
1123
|
}
|
|
1124
1124
|
const A = (g) => {
|
|
1125
|
-
!g || g === d.current.element || (E(), d.current.element = g, d.current.scrollContainers =
|
|
1125
|
+
!g || g === d.current.element || (E(), d.current.element = g, d.current.scrollContainers = lr(g), S());
|
|
1126
1126
|
};
|
|
1127
|
-
return
|
|
1127
|
+
return bn(v, !!r), yn(_), ue(() => {
|
|
1128
1128
|
E(), S();
|
|
1129
|
-
}, [r, v,
|
|
1129
|
+
}, [r, v, _]), ue(() => E, []), [A, i, p];
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1131
|
+
function yn(e) {
|
|
1132
1132
|
ue(() => {
|
|
1133
1133
|
const t = e;
|
|
1134
1134
|
return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
|
|
1135
1135
|
}, [e]);
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function bn(e, t) {
|
|
1138
1138
|
ue(() => {
|
|
1139
1139
|
if (t) {
|
|
1140
1140
|
const r = e;
|
|
@@ -1145,7 +1145,7 @@ function vn(e, t) {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
}, [e, t]);
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function lr(e) {
|
|
1149
1149
|
const t = [];
|
|
1150
1150
|
if (!e || e === document.body)
|
|
1151
1151
|
return t;
|
|
@@ -1154,9 +1154,9 @@ function ur(e) {
|
|
|
1154
1154
|
overflowX: n,
|
|
1155
1155
|
overflowY: s
|
|
1156
1156
|
} = window.getComputedStyle(e);
|
|
1157
|
-
return [r, n, s].some((a) => a === "auto" || a === "scroll") && t.push(e), [...t, ...
|
|
1157
|
+
return [r, n, s].some((a) => a === "auto" || a === "scroll") && t.push(e), [...t, ...lr(e.parentElement)];
|
|
1158
1158
|
}
|
|
1159
|
-
const
|
|
1159
|
+
const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn = (e, t) => vn.every((r) => e[r] === t[r]), be = ({
|
|
1160
1160
|
class: e,
|
|
1161
1161
|
...t
|
|
1162
1162
|
}) => {
|
|
@@ -1185,23 +1185,23 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1185
1185
|
})]
|
|
1186
1186
|
})
|
|
1187
1187
|
});
|
|
1188
|
-
},
|
|
1188
|
+
}, wn = 25, ht = dt({
|
|
1189
1189
|
instant: () => {
|
|
1190
1190
|
},
|
|
1191
1191
|
smooth: () => {
|
|
1192
1192
|
}
|
|
1193
1193
|
}), z = {
|
|
1194
|
-
onSubmitSuccessFn$:
|
|
1194
|
+
onSubmitSuccessFn$: dt(() => {
|
|
1195
1195
|
}),
|
|
1196
|
-
isBotTyping$:
|
|
1196
|
+
isBotTyping$: dt(!1),
|
|
1197
1197
|
scrollToEnd: {
|
|
1198
|
-
instant: () =>
|
|
1199
|
-
smooth: () =>
|
|
1198
|
+
instant: () => ht.value.instant(),
|
|
1199
|
+
smooth: () => ht.value.smooth()
|
|
1200
1200
|
}
|
|
1201
1201
|
}, _n = () => {
|
|
1202
1202
|
const e = re(null);
|
|
1203
1203
|
pe(() => {
|
|
1204
|
-
|
|
1204
|
+
ht.value = {
|
|
1205
1205
|
instant: () => {
|
|
1206
1206
|
var r;
|
|
1207
1207
|
return (r = e.current) == null ? void 0 : r.scrollTo({
|
|
@@ -1217,7 +1217,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1217
1217
|
}
|
|
1218
1218
|
};
|
|
1219
1219
|
}, [e]);
|
|
1220
|
-
const t =
|
|
1220
|
+
const t = pt(() => ({
|
|
1221
1221
|
addToSubmissions: (n, s) => M.setSubmission(n, s),
|
|
1222
1222
|
send: async ({
|
|
1223
1223
|
message: n,
|
|
@@ -1231,7 +1231,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1231
1231
|
if (s != null && s.aborted)
|
|
1232
1232
|
throw new Me();
|
|
1233
1233
|
z.isBotTyping$.value = !0;
|
|
1234
|
-
const u = Math.min(Math.max(20, i.text.length), 100) *
|
|
1234
|
+
const u = Math.min(Math.max(20, i.text.length), 100) * wn;
|
|
1235
1235
|
await new Promise((d) => setTimeout(d, u, {
|
|
1236
1236
|
signal: s
|
|
1237
1237
|
})), z.isBotTyping$.value = !1;
|
|
@@ -1323,7 +1323,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1323
1323
|
})]
|
|
1324
1324
|
}), r("skip")]
|
|
1325
1325
|
});
|
|
1326
|
-
},
|
|
1326
|
+
}, mt = {
|
|
1327
1327
|
Afghanistan: "93",
|
|
1328
1328
|
Albania: "355",
|
|
1329
1329
|
Algeria: "213",
|
|
@@ -1581,15 +1581,15 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1581
1581
|
defaultVariants: {
|
|
1582
1582
|
optional: !1
|
|
1583
1583
|
}
|
|
1584
|
-
}),
|
|
1584
|
+
}), kn = "https://api.mapbox.com/search/searchbox/v1/suggest", Sn = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", Cn = (e) => atob(e).split("").reverse().join(""), ae = he({
|
|
1585
1585
|
name: ee()
|
|
1586
|
-
}),
|
|
1587
|
-
suggestions:
|
|
1586
|
+
}), An = he({
|
|
1587
|
+
suggestions: Fr(he({
|
|
1588
1588
|
full_address: at(ee()),
|
|
1589
1589
|
place_formatted: at(ee()),
|
|
1590
1590
|
name: at(ee()),
|
|
1591
1591
|
mapbox_id: ee(),
|
|
1592
|
-
context:
|
|
1592
|
+
context: Nr(he({
|
|
1593
1593
|
address: ae,
|
|
1594
1594
|
street: ae,
|
|
1595
1595
|
neighborhood: ae,
|
|
@@ -1601,24 +1601,24 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1601
1601
|
country: ae
|
|
1602
1602
|
}))
|
|
1603
1603
|
}))
|
|
1604
|
-
}),
|
|
1604
|
+
}), En = ({
|
|
1605
1605
|
logger: e,
|
|
1606
1606
|
t
|
|
1607
|
-
}) =>
|
|
1607
|
+
}) => pt(() => {
|
|
1608
1608
|
var n;
|
|
1609
1609
|
const r = (n = M.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
|
|
1610
1610
|
return r ? {
|
|
1611
1611
|
enabled: !0,
|
|
1612
1612
|
getPredictions: async (s) => {
|
|
1613
|
-
const a = new URL(
|
|
1614
|
-
a.searchParams.set("q", s), a.searchParams.set("session_token", r), a.searchParams.set("access_token",
|
|
1613
|
+
const a = new URL(kn);
|
|
1614
|
+
a.searchParams.set("q", s), a.searchParams.set("session_token", r), a.searchParams.set("access_token", Cn(Sn));
|
|
1615
1615
|
const i = await fetch(a);
|
|
1616
1616
|
if (!i.ok)
|
|
1617
1617
|
return e.error("Failed to get address details", i), {
|
|
1618
1618
|
ok: !1,
|
|
1619
1619
|
error: t("address_error")
|
|
1620
1620
|
};
|
|
1621
|
-
const u =
|
|
1621
|
+
const u = Lr(An, await i.json());
|
|
1622
1622
|
if (u.success === !1)
|
|
1623
1623
|
return e.error("Failed to parse address details", u.issues), {
|
|
1624
1624
|
ok: !1,
|
|
@@ -1630,14 +1630,14 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1630
1630
|
return {
|
|
1631
1631
|
ok: !0,
|
|
1632
1632
|
data: d.map((h) => {
|
|
1633
|
-
var x, y, p,
|
|
1633
|
+
var x, y, p, _, v, E, S, A, g;
|
|
1634
1634
|
return {
|
|
1635
1635
|
label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
|
|
1636
1636
|
id: h.mapbox_id,
|
|
1637
1637
|
address: {
|
|
1638
1638
|
line1: ((x = h.context.address) == null ? void 0 : x.name) ?? ((y = h.context.street) == null ? void 0 : y.name),
|
|
1639
1639
|
line2: void 0,
|
|
1640
|
-
line3: ((p = h.context.neighborhood) == null ? void 0 : p.name) ?? ((
|
|
1640
|
+
line3: ((p = h.context.neighborhood) == null ? void 0 : p.name) ?? ((_ = h.context.locality) == null ? void 0 : _.name),
|
|
1641
1641
|
city: ((v = h.context.place) == null ? void 0 : v.name) ?? ((E = h.context.district) == null ? void 0 : E.name),
|
|
1642
1642
|
state: (S = h.context.region) == null ? void 0 : S.name,
|
|
1643
1643
|
postcode: (A = h.context.postcode) == null ? void 0 : A.name,
|
|
@@ -1650,7 +1650,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1650
1650
|
} : {
|
|
1651
1651
|
enabled: !1
|
|
1652
1652
|
};
|
|
1653
|
-
}, [e, t]),
|
|
1653
|
+
}, [e, t]), Tt = (e) => {
|
|
1654
1654
|
const {
|
|
1655
1655
|
t
|
|
1656
1656
|
} = J();
|
|
@@ -1673,7 +1673,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1673
1673
|
children: t("back")
|
|
1674
1674
|
})]
|
|
1675
1675
|
});
|
|
1676
|
-
},
|
|
1676
|
+
}, In = ({
|
|
1677
1677
|
input: e,
|
|
1678
1678
|
onSubmitSuccess: t,
|
|
1679
1679
|
logger: r
|
|
@@ -1683,11 +1683,11 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1683
1683
|
} = J(), [s, a] = Y(), [i, u] = Y([]), {
|
|
1684
1684
|
enabled: d,
|
|
1685
1685
|
getPredictions: h
|
|
1686
|
-
} =
|
|
1686
|
+
} = En({
|
|
1687
1687
|
logger: r,
|
|
1688
1688
|
t: n
|
|
1689
|
-
}), [x, y] = Y(d ? "query" : "manual"), [p,
|
|
1690
|
-
le(d, "Query state should not be enabled"), A = A.trim(), A !== (p == null ? void 0 : p.trim()) && (
|
|
1689
|
+
}), [x, y] = Y(d ? "query" : "manual"), [p, _] = Y(""), [v, E] = Y(), S = (A) => {
|
|
1690
|
+
le(d, "Query state should not be enabled"), A = A.trim(), A !== (p == null ? void 0 : p.trim()) && (_(A), A === "" && u([]), E(void 0), h(A).then((g) => {
|
|
1691
1691
|
if (g.ok === !1) {
|
|
1692
1692
|
u([]), E(g.error);
|
|
1693
1693
|
return;
|
|
@@ -1697,7 +1697,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1697
1697
|
};
|
|
1698
1698
|
switch (x) {
|
|
1699
1699
|
case "query":
|
|
1700
|
-
return le(d, "Query state should not be enabled"), l(
|
|
1700
|
+
return le(d, "Query state should not be enabled"), l(Vn, {
|
|
1701
1701
|
input: e,
|
|
1702
1702
|
onSkip: () => t(null),
|
|
1703
1703
|
onAddressSelect: (A) => {
|
|
@@ -1716,31 +1716,31 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1716
1716
|
error: v
|
|
1717
1717
|
});
|
|
1718
1718
|
case "details":
|
|
1719
|
-
return le(s !== void 0), l(
|
|
1719
|
+
return le(s !== void 0), l(Rt, {
|
|
1720
1720
|
input: e,
|
|
1721
1721
|
logger: r,
|
|
1722
1722
|
onSubmitSuccess: t,
|
|
1723
1723
|
addressFields: s,
|
|
1724
|
-
actions: l(
|
|
1724
|
+
actions: l(Tt, {
|
|
1725
1725
|
onClick: () => {
|
|
1726
1726
|
y("query");
|
|
1727
1727
|
}
|
|
1728
1728
|
})
|
|
1729
1729
|
});
|
|
1730
1730
|
case "manual":
|
|
1731
|
-
return l(
|
|
1731
|
+
return l(Rt, {
|
|
1732
1732
|
logger: r,
|
|
1733
1733
|
input: e,
|
|
1734
1734
|
onSubmitSuccess: t,
|
|
1735
1735
|
addressFields: {},
|
|
1736
|
-
actions: d ? l(
|
|
1736
|
+
actions: d ? l(Tt, {
|
|
1737
1737
|
onClick: () => {
|
|
1738
1738
|
y("query");
|
|
1739
1739
|
}
|
|
1740
1740
|
}) : void 0
|
|
1741
1741
|
});
|
|
1742
1742
|
}
|
|
1743
|
-
},
|
|
1743
|
+
}, Vn = ({
|
|
1744
1744
|
input: e,
|
|
1745
1745
|
onSkip: t,
|
|
1746
1746
|
suggestions: r,
|
|
@@ -1754,7 +1754,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1754
1754
|
} = J(), d = re(null);
|
|
1755
1755
|
return pe(() => {
|
|
1756
1756
|
d.current && (d.current.focus(), d.current.select());
|
|
1757
|
-
}, []), l(
|
|
1757
|
+
}, []), l(ke, {
|
|
1758
1758
|
children: [l("form", {
|
|
1759
1759
|
noValidate: !0,
|
|
1760
1760
|
onSubmit: (h) => {
|
|
@@ -1851,7 +1851,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1851
1851
|
}, "")]
|
|
1852
1852
|
})]
|
|
1853
1853
|
});
|
|
1854
|
-
},
|
|
1854
|
+
}, Dt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Rt = ({
|
|
1855
1855
|
addressFields: e,
|
|
1856
1856
|
onSubmitSuccess: t,
|
|
1857
1857
|
actions: r,
|
|
@@ -1864,7 +1864,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1864
1864
|
u && (u.focus(), u.select());
|
|
1865
1865
|
}
|
|
1866
1866
|
}, []);
|
|
1867
|
-
const a = Object.keys(
|
|
1867
|
+
const a = Object.keys(mt), {
|
|
1868
1868
|
t: i
|
|
1869
1869
|
} = J();
|
|
1870
1870
|
return l("form", {
|
|
@@ -1879,9 +1879,9 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1879
1879
|
children: [l("div", {
|
|
1880
1880
|
class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
|
|
1881
1881
|
ref: s,
|
|
1882
|
-
children:
|
|
1882
|
+
children: Dt.map((u, d) => {
|
|
1883
1883
|
const h = `isdk_${u}`, x = n.config.keys[u];
|
|
1884
|
-
return x ? l(
|
|
1884
|
+
return x ? l(ke, {
|
|
1885
1885
|
children: [l("label", {
|
|
1886
1886
|
for: h,
|
|
1887
1887
|
class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
@@ -1928,7 +1928,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1928
1928
|
id: h,
|
|
1929
1929
|
defaultValue: e[u],
|
|
1930
1930
|
required: !0
|
|
1931
|
-
}), d ===
|
|
1931
|
+
}), d === Dt.length - 1 ? l("hr", {
|
|
1932
1932
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1933
1933
|
}) : l("hr", {
|
|
1934
1934
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -1946,13 +1946,13 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1946
1946
|
})]
|
|
1947
1947
|
})]
|
|
1948
1948
|
});
|
|
1949
|
-
},
|
|
1949
|
+
}, gt = () => {
|
|
1950
1950
|
const e = re(null);
|
|
1951
1951
|
return ue(() => {
|
|
1952
1952
|
var t;
|
|
1953
1953
|
(t = e.current) == null || t.focus();
|
|
1954
1954
|
}, []), e;
|
|
1955
|
-
},
|
|
1955
|
+
}, ur = ["true", "false"], Mn = Dr(ur), Fn = "answer", cr = "flex items-center gap-2 p-2.5", dr = nr(({
|
|
1956
1956
|
label: e,
|
|
1957
1957
|
...t
|
|
1958
1958
|
}, r) => l("button", {
|
|
@@ -1963,30 +1963,30 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
1963
1963
|
class: "truncate text-center text-base",
|
|
1964
1964
|
children: e
|
|
1965
1965
|
})
|
|
1966
|
-
})),
|
|
1966
|
+
})), Nn = ({
|
|
1967
1967
|
input: e,
|
|
1968
1968
|
onSubmitSuccess: t
|
|
1969
1969
|
}) => {
|
|
1970
|
-
const r =
|
|
1970
|
+
const r = gt();
|
|
1971
1971
|
return l("form", {
|
|
1972
1972
|
noValidate: !0,
|
|
1973
1973
|
class: "",
|
|
1974
1974
|
onSubmit: (n) => {
|
|
1975
1975
|
n.preventDefault();
|
|
1976
|
-
const s =
|
|
1976
|
+
const s = Tr(n).value, a = sr(Mn, s);
|
|
1977
1977
|
t({
|
|
1978
1978
|
type: "boolean",
|
|
1979
1979
|
value: a === "true"
|
|
1980
1980
|
});
|
|
1981
1981
|
},
|
|
1982
1982
|
children: [l("ul", {
|
|
1983
|
-
class:
|
|
1984
|
-
children:
|
|
1983
|
+
class: cr,
|
|
1984
|
+
children: ur.map((n, s) => l("li", {
|
|
1985
1985
|
class: "flex-1",
|
|
1986
|
-
children: l(
|
|
1986
|
+
children: l(dr, {
|
|
1987
1987
|
ref: s === 0 ? r : null,
|
|
1988
1988
|
type: "submit",
|
|
1989
|
-
name:
|
|
1989
|
+
name: Fn,
|
|
1990
1990
|
value: n,
|
|
1991
1991
|
label: e.config.labels[n]
|
|
1992
1992
|
}, n)
|
|
@@ -2000,10 +2000,10 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
2000
2000
|
})
|
|
2001
2001
|
})]
|
|
2002
2002
|
});
|
|
2003
|
-
},
|
|
2003
|
+
}, Ln = (e) => new Promise((t, r) => {
|
|
2004
2004
|
const n = new FileReader();
|
|
2005
2005
|
n.readAsDataURL(e), n.onload = () => n.result ? t(n.result.toString()) : r("No result from reader"), n.onerror = r;
|
|
2006
|
-
}),
|
|
2006
|
+
}), Tn = (e) => e.reduce((t, r) => t + r.sizeKb, 0), Dn = Se("file"), Ot = 3, Rn = ({
|
|
2007
2007
|
file: e,
|
|
2008
2008
|
class: t,
|
|
2009
2009
|
...r
|
|
@@ -2027,32 +2027,32 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
2027
2027
|
children: Ne(e.sizeKb)
|
|
2028
2028
|
})]
|
|
2029
2029
|
});
|
|
2030
|
-
},
|
|
2030
|
+
}, Bt = ({
|
|
2031
2031
|
class: e,
|
|
2032
2032
|
...t
|
|
2033
2033
|
}) => l("li", {
|
|
2034
2034
|
class: Le("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2035
2035
|
...t
|
|
2036
|
-
}),
|
|
2036
|
+
}), fr = (e) => {
|
|
2037
2037
|
const t = e.split(".").pop();
|
|
2038
2038
|
if (!t)
|
|
2039
2039
|
throw new Error("No file extension found");
|
|
2040
2040
|
return t ? "." + t : "";
|
|
2041
|
-
},
|
|
2041
|
+
}, On = ({
|
|
2042
2042
|
allowedExtensions: e,
|
|
2043
2043
|
files: t
|
|
2044
2044
|
}) => {
|
|
2045
2045
|
const r = e.map((n) => n.toLowerCase());
|
|
2046
|
-
return t.every((n) => r.includes(
|
|
2047
|
-
},
|
|
2048
|
-
const r =
|
|
2046
|
+
return t.every((n) => r.includes(fr(n.name).toLowerCase()));
|
|
2047
|
+
}, Bn = (e, t) => {
|
|
2048
|
+
const r = fr(e);
|
|
2049
2049
|
return `${e.replace(new RegExp(`${r}$`), "").slice(0, t)}${r}`;
|
|
2050
|
-
},
|
|
2050
|
+
}, Pn = ({
|
|
2051
2051
|
input: e,
|
|
2052
2052
|
onSubmitSuccess: t
|
|
2053
2053
|
}) => {
|
|
2054
2054
|
var y;
|
|
2055
|
-
const r = (y = M.current$.value.flow) == null ? void 0 : y.data.submissions[e.key], [n, s] = Y(
|
|
2055
|
+
const r = (y = M.current$.value.flow) == null ? void 0 : y.data.submissions[e.key], [n, s] = Y(Dn(r) ? r.value : []), [a, i] = Y(), u = n.length - Ot, d = Tn(n), h = gt(), {
|
|
2056
2056
|
t: x
|
|
2057
2057
|
} = J();
|
|
2058
2058
|
return l("form", {
|
|
@@ -2060,7 +2060,7 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
2060
2060
|
onSubmit: (p) => (p.preventDefault(), i(void 0), n.length === 0 ? i({
|
|
2061
2061
|
type: "required",
|
|
2062
2062
|
message: x("validation_file")
|
|
2063
|
-
}) : e.config.extensions.length > 0 && !
|
|
2063
|
+
}) : e.config.extensions.length > 0 && !On({
|
|
2064
2064
|
allowedExtensions: e.config.extensions,
|
|
2065
2065
|
files: n
|
|
2066
2066
|
}) ? i({
|
|
@@ -2086,21 +2086,21 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
2086
2086
|
ref: h,
|
|
2087
2087
|
for: "dropzone-file",
|
|
2088
2088
|
class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
|
|
2089
|
-
children: [n.length > 0 ? l(
|
|
2089
|
+
children: [n.length > 0 ? l(ke, {
|
|
2090
2090
|
children: [l("ul", {
|
|
2091
2091
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2092
|
-
children: [n.slice(0,
|
|
2093
|
-
const
|
|
2094
|
-
return l(
|
|
2092
|
+
children: [n.slice(0, Ot).map((p) => {
|
|
2093
|
+
const _ = p.name.split(".").pop(), v = p.name.replace(new RegExp(`.${_}$`), "");
|
|
2094
|
+
return l(Bt, {
|
|
2095
2095
|
class: "flex overflow-hidden",
|
|
2096
2096
|
children: [l("span", {
|
|
2097
2097
|
class: "block truncate",
|
|
2098
2098
|
children: v
|
|
2099
2099
|
}), l("span", {
|
|
2100
|
-
children: [".",
|
|
2100
|
+
children: [".", _]
|
|
2101
2101
|
})]
|
|
2102
2102
|
});
|
|
2103
|
-
}), u > 0 ? l(
|
|
2103
|
+
}), u > 0 ? l(Bt, {
|
|
2104
2104
|
children: ["+", u, " file", u !== 1 ? "s" : ""]
|
|
2105
2105
|
}) : null]
|
|
2106
2106
|
}), l("p", {
|
|
@@ -2154,10 +2154,10 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
2154
2154
|
id: "dropzone-file",
|
|
2155
2155
|
onInput: async (p) => {
|
|
2156
2156
|
le(p.target instanceof HTMLInputElement);
|
|
2157
|
-
const
|
|
2158
|
-
const A = await
|
|
2157
|
+
const _ = p.target.files ? Array.from(p.target.files) : [], v = await Promise.allSettled(_.map(async (S) => {
|
|
2158
|
+
const A = await Ln(S);
|
|
2159
2159
|
return {
|
|
2160
|
-
name:
|
|
2160
|
+
name: Bn(S.name, 42),
|
|
2161
2161
|
data: A,
|
|
2162
2162
|
sizeKb: S.size / 1e3
|
|
2163
2163
|
};
|
|
@@ -2189,12 +2189,12 @@ const xn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], wn =
|
|
|
2189
2189
|
})]
|
|
2190
2190
|
});
|
|
2191
2191
|
};
|
|
2192
|
-
var De = (e) => e.type === "checkbox",
|
|
2193
|
-
const
|
|
2194
|
-
var $ = (e) => !U(e) && !Array.isArray(e) &&
|
|
2192
|
+
var De = (e) => e.type === "checkbox", _e = (e) => e instanceof Date, U = (e) => e == null;
|
|
2193
|
+
const hr = (e) => typeof e == "object";
|
|
2194
|
+
var $ = (e) => !U(e) && !Array.isArray(e) && hr(e) && !_e(e), $n = (e) => $(e) && e.target ? De(e.target) ? e.target.checked : e.target.value : e, jn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, zn = (e, t) => e.has(jn(t)), qn = (e) => {
|
|
2195
2195
|
const t = e.constructor && e.constructor.prototype;
|
|
2196
2196
|
return $(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2197
|
-
},
|
|
2197
|
+
}, yt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2198
2198
|
function oe(e) {
|
|
2199
2199
|
let t;
|
|
2200
2200
|
const r = Array.isArray(e);
|
|
@@ -2202,8 +2202,8 @@ function oe(e) {
|
|
|
2202
2202
|
t = new Date(e);
|
|
2203
2203
|
else if (e instanceof Set)
|
|
2204
2204
|
t = new Set(e);
|
|
2205
|
-
else if (!(
|
|
2206
|
-
if (t = r ? [] : {}, !r && !
|
|
2205
|
+
else if (!(yt && (e instanceof Blob || e instanceof FileList)) && (r || $(e)))
|
|
2206
|
+
if (t = r ? [] : {}, !r && !qn(e))
|
|
2207
2207
|
t = e;
|
|
2208
2208
|
else
|
|
2209
2209
|
for (const n in e)
|
|
@@ -2218,7 +2218,7 @@ var Re = (e) => Array.isArray(e) ? e.filter(Boolean) : [], O = (e) => e === void
|
|
|
2218
2218
|
const n = Re(t.split(/[,[\].]+?/)).reduce((s, a) => U(s) ? s : s[a], e);
|
|
2219
2219
|
return O(n) || n === e ? O(e[t]) ? r : e[t] : n;
|
|
2220
2220
|
}, de = (e) => typeof e == "boolean";
|
|
2221
|
-
const
|
|
2221
|
+
const Pt = {
|
|
2222
2222
|
BLUR: "blur",
|
|
2223
2223
|
FOCUS_OUT: "focusout",
|
|
2224
2224
|
CHANGE: "change"
|
|
@@ -2238,7 +2238,7 @@ const $t = {
|
|
|
2238
2238
|
validate: "validate"
|
|
2239
2239
|
};
|
|
2240
2240
|
X.createContext(null);
|
|
2241
|
-
var
|
|
2241
|
+
var Un = (e, t, r, n = !0) => {
|
|
2242
2242
|
const s = {
|
|
2243
2243
|
defaultValues: t._defaultValues
|
|
2244
2244
|
};
|
|
@@ -2250,12 +2250,12 @@ var Kn = (e, t, r, n = !0) => {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
});
|
|
2252
2252
|
return s;
|
|
2253
|
-
}, W = (e) => $(e) && !Object.keys(e).length,
|
|
2253
|
+
}, W = (e) => $(e) && !Object.keys(e).length, Kn = (e, t, r, n) => {
|
|
2254
2254
|
r(e);
|
|
2255
2255
|
const { name: s, ...a } = e;
|
|
2256
2256
|
return W(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((i) => t[i] === (!n || Z.all));
|
|
2257
2257
|
}, it = (e) => Array.isArray(e) ? e : [e];
|
|
2258
|
-
function
|
|
2258
|
+
function Gn(e) {
|
|
2259
2259
|
const t = X.useRef(e);
|
|
2260
2260
|
t.current = e, X.useEffect(() => {
|
|
2261
2261
|
const r = !e.disabled && t.current.subject && t.current.subject.subscribe({
|
|
@@ -2266,10 +2266,10 @@ function Hn(e) {
|
|
|
2266
2266
|
};
|
|
2267
2267
|
}, [e.disabled]);
|
|
2268
2268
|
}
|
|
2269
|
-
var te = (e) => typeof e == "string",
|
|
2269
|
+
var te = (e) => typeof e == "string", Hn = (e, t, r, n, s) => te(e) ? (n && t.watch.add(e), w(r, e, s)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), w(r, a))) : (n && (t.watchAll = !0), r), bt = (e) => /^\w*$/.test(e), pr = (e) => Re(e.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
2270
2270
|
function N(e, t, r) {
|
|
2271
2271
|
let n = -1;
|
|
2272
|
-
const s =
|
|
2272
|
+
const s = bt(t) ? [t] : pr(t), a = s.length, i = a - 1;
|
|
2273
2273
|
for (; ++n < a; ) {
|
|
2274
2274
|
const u = s[n];
|
|
2275
2275
|
let d = r;
|
|
@@ -2281,19 +2281,19 @@ function N(e, t, r) {
|
|
|
2281
2281
|
}
|
|
2282
2282
|
return e;
|
|
2283
2283
|
}
|
|
2284
|
-
var
|
|
2284
|
+
var mr = (e, t, r, n, s) => t ? {
|
|
2285
2285
|
...r[e],
|
|
2286
2286
|
types: {
|
|
2287
2287
|
...r[e] && r[e].types ? r[e].types : {},
|
|
2288
2288
|
[n]: s || !0
|
|
2289
2289
|
}
|
|
2290
|
-
} : {},
|
|
2290
|
+
} : {}, $t = (e) => ({
|
|
2291
2291
|
isOnSubmit: !e || e === Z.onSubmit,
|
|
2292
2292
|
isOnBlur: e === Z.onBlur,
|
|
2293
2293
|
isOnChange: e === Z.onChange,
|
|
2294
2294
|
isOnAll: e === Z.all,
|
|
2295
2295
|
isOnTouch: e === Z.onTouched
|
|
2296
|
-
}),
|
|
2296
|
+
}), jt = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
2297
2297
|
const ze = (e, t, r, n) => {
|
|
2298
2298
|
for (const s of r || Object.keys(e)) {
|
|
2299
2299
|
const a = w(e, s);
|
|
@@ -2309,20 +2309,20 @@ const ze = (e, t, r, n) => {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
}
|
|
2311
2311
|
};
|
|
2312
|
-
var
|
|
2312
|
+
var Wn = (e, t, r) => {
|
|
2313
2313
|
const n = Re(w(e, r));
|
|
2314
2314
|
return N(n, "root", t[r]), N(e, r, n), e;
|
|
2315
|
-
},
|
|
2316
|
-
if (!
|
|
2315
|
+
}, vt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ge = (e) => {
|
|
2316
|
+
if (!yt)
|
|
2317
2317
|
return !1;
|
|
2318
2318
|
const t = e ? e.ownerDocument : 0;
|
|
2319
2319
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
2320
|
-
}, qe = (e) => te(e),
|
|
2321
|
-
const
|
|
2320
|
+
}, qe = (e) => te(e), xt = (e) => e.type === "radio", He = (e) => e instanceof RegExp;
|
|
2321
|
+
const zt = {
|
|
2322
2322
|
value: !1,
|
|
2323
2323
|
isValid: !1
|
|
2324
|
-
},
|
|
2325
|
-
var
|
|
2324
|
+
}, qt = { value: !0, isValid: !0 };
|
|
2325
|
+
var gr = (e) => {
|
|
2326
2326
|
if (Array.isArray(e)) {
|
|
2327
2327
|
if (e.length > 1) {
|
|
2328
2328
|
const t = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
|
|
@@ -2330,20 +2330,20 @@ var yr = (e) => {
|
|
|
2330
2330
|
}
|
|
2331
2331
|
return e[0].checked && !e[0].disabled ? (
|
|
2332
2332
|
// @ts-expect-error expected to work in the browser
|
|
2333
|
-
e[0].attributes && !O(e[0].attributes.value) ? O(e[0].value) || e[0].value === "" ?
|
|
2334
|
-
) :
|
|
2333
|
+
e[0].attributes && !O(e[0].attributes.value) ? O(e[0].value) || e[0].value === "" ? qt : { value: e[0].value, isValid: !0 } : qt
|
|
2334
|
+
) : zt;
|
|
2335
2335
|
}
|
|
2336
|
-
return
|
|
2336
|
+
return zt;
|
|
2337
2337
|
};
|
|
2338
|
-
const
|
|
2338
|
+
const Ut = {
|
|
2339
2339
|
isValid: !1,
|
|
2340
2340
|
value: null
|
|
2341
2341
|
};
|
|
2342
|
-
var
|
|
2342
|
+
var yr = (e) => Array.isArray(e) ? e.reduce((t, r) => r && r.checked && !r.disabled ? {
|
|
2343
2343
|
isValid: !0,
|
|
2344
2344
|
value: r.value
|
|
2345
|
-
} : t,
|
|
2346
|
-
function
|
|
2345
|
+
} : t, Ut) : Ut;
|
|
2346
|
+
function Kt(e, t, r = "validate") {
|
|
2347
2347
|
if (qe(e) || Array.isArray(e) && e.every(qe) || de(e) && !e)
|
|
2348
2348
|
return {
|
|
2349
2349
|
type: r,
|
|
@@ -2354,13 +2354,13 @@ function Gt(e, t, r = "validate") {
|
|
|
2354
2354
|
var we = (e) => $(e) && !He(e) ? e : {
|
|
2355
2355
|
value: e,
|
|
2356
2356
|
message: ""
|
|
2357
|
-
},
|
|
2358
|
-
const { ref: a, refs: i, required: u, maxLength: d, minLength: h, min: x, max: y, pattern: p, validate:
|
|
2357
|
+
}, Gt = async (e, t, r, n, s) => {
|
|
2358
|
+
const { ref: a, refs: i, required: u, maxLength: d, minLength: h, min: x, max: y, pattern: p, validate: _, name: v, valueAsNumber: E, mount: S, disabled: A } = e._f, g = w(t, v);
|
|
2359
2359
|
if (!S || A)
|
|
2360
2360
|
return {};
|
|
2361
2361
|
const T = i ? i[0] : a, P = (F) => {
|
|
2362
2362
|
n && T.reportValidity && (T.setCustomValidity(de(F) ? "" : F || ""), T.reportValidity());
|
|
2363
|
-
}, D = {}, me =
|
|
2363
|
+
}, D = {}, me = xt(a), ce = De(a), Ae = me || ce, G = (E || vt(a)) && O(a.value) && O(g) || Ge(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = mr.bind(null, v, r, D), q = (F, V, R, K = ie.maxLength, H = ie.minLength) => {
|
|
2364
2364
|
const Q = F ? V : R;
|
|
2365
2365
|
D[v] = {
|
|
2366
2366
|
type: F ? K : H,
|
|
@@ -2369,7 +2369,7 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2369
2369
|
...se(F ? K : H, Q)
|
|
2370
2370
|
};
|
|
2371
2371
|
};
|
|
2372
|
-
if (s ? !Array.isArray(g) || !g.length : u && (!Ae && (G || U(g)) || de(g) && !g || ce && !
|
|
2372
|
+
if (s ? !Array.isArray(g) || !g.length : u && (!Ae && (G || U(g)) || de(g) && !g || ce && !gr(i).isValid || me && !yr(i).isValid)) {
|
|
2373
2373
|
const { value: F, message: V } = qe(u) ? { value: !!u, message: u } : we(u);
|
|
2374
2374
|
if (F && (D[v] = {
|
|
2375
2375
|
type: ie.required,
|
|
@@ -2407,20 +2407,20 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2407
2407
|
}, !r))
|
|
2408
2408
|
return P(V), D;
|
|
2409
2409
|
}
|
|
2410
|
-
if (
|
|
2411
|
-
if (fe(
|
|
2412
|
-
const F = await
|
|
2410
|
+
if (_) {
|
|
2411
|
+
if (fe(_)) {
|
|
2412
|
+
const F = await _(g, t), V = Kt(F, T);
|
|
2413
2413
|
if (V && (D[v] = {
|
|
2414
2414
|
...V,
|
|
2415
2415
|
...se(ie.validate, V.message)
|
|
2416
2416
|
}, !r))
|
|
2417
2417
|
return P(V.message), D;
|
|
2418
|
-
} else if ($(
|
|
2418
|
+
} else if ($(_)) {
|
|
2419
2419
|
let F = {};
|
|
2420
|
-
for (const V in
|
|
2420
|
+
for (const V in _) {
|
|
2421
2421
|
if (!W(F) && !r)
|
|
2422
2422
|
break;
|
|
2423
|
-
const R =
|
|
2423
|
+
const R = Kt(await _[V](g, t), T, V);
|
|
2424
2424
|
R && (F = {
|
|
2425
2425
|
...R,
|
|
2426
2426
|
...se(V, R.message)
|
|
@@ -2435,22 +2435,22 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2435
2435
|
}
|
|
2436
2436
|
return P(!0), D;
|
|
2437
2437
|
};
|
|
2438
|
-
function
|
|
2438
|
+
function Jn(e, t) {
|
|
2439
2439
|
const r = t.slice(0, -1).length;
|
|
2440
2440
|
let n = 0;
|
|
2441
2441
|
for (; n < r; )
|
|
2442
2442
|
e = O(e) ? n++ : e[t[n++]];
|
|
2443
2443
|
return e;
|
|
2444
2444
|
}
|
|
2445
|
-
function
|
|
2445
|
+
function Zn(e) {
|
|
2446
2446
|
for (const t in e)
|
|
2447
2447
|
if (e.hasOwnProperty(t) && !O(e[t]))
|
|
2448
2448
|
return !1;
|
|
2449
2449
|
return !0;
|
|
2450
2450
|
}
|
|
2451
2451
|
function j(e, t) {
|
|
2452
|
-
const r = Array.isArray(t) ? t :
|
|
2453
|
-
return n && delete n[a], s !== 0 && ($(n) && W(n) || Array.isArray(n) &&
|
|
2452
|
+
const r = Array.isArray(t) ? t : bt(t) ? [t] : pr(t), n = r.length === 1 ? e : Jn(e, r), s = r.length - 1, a = r[s];
|
|
2453
|
+
return n && delete n[a], s !== 0 && ($(n) && W(n) || Array.isArray(n) && Zn(n)) && j(e, r.slice(0, -1)), e;
|
|
2454
2454
|
}
|
|
2455
2455
|
function ot() {
|
|
2456
2456
|
let e = [];
|
|
@@ -2472,11 +2472,11 @@ function ot() {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
};
|
|
2474
2474
|
}
|
|
2475
|
-
var We = (e) => U(e) || !
|
|
2475
|
+
var We = (e) => U(e) || !hr(e);
|
|
2476
2476
|
function ye(e, t) {
|
|
2477
2477
|
if (We(e) || We(t))
|
|
2478
2478
|
return e === t;
|
|
2479
|
-
if (
|
|
2479
|
+
if (_e(e) && _e(t))
|
|
2480
2480
|
return e.getTime() === t.getTime();
|
|
2481
2481
|
const r = Object.keys(e), n = Object.keys(t);
|
|
2482
2482
|
if (r.length !== n.length)
|
|
@@ -2487,13 +2487,13 @@ function ye(e, t) {
|
|
|
2487
2487
|
return !1;
|
|
2488
2488
|
if (s !== "ref") {
|
|
2489
2489
|
const i = t[s];
|
|
2490
|
-
if (
|
|
2490
|
+
if (_e(a) && _e(i) || $(a) && $(i) || Array.isArray(a) && Array.isArray(i) ? !ye(a, i) : a !== i)
|
|
2491
2491
|
return !1;
|
|
2492
2492
|
}
|
|
2493
2493
|
}
|
|
2494
2494
|
return !0;
|
|
2495
2495
|
}
|
|
2496
|
-
var
|
|
2496
|
+
var br = (e) => e.type === "select-multiple", Qn = (e) => xt(e) || De(e), lt = (e) => Ge(e) && e.isConnected, vr = (e) => {
|
|
2497
2497
|
for (const t in e)
|
|
2498
2498
|
if (fe(e[t]))
|
|
2499
2499
|
return !0;
|
|
@@ -2503,23 +2503,23 @@ function Je(e, t = {}) {
|
|
|
2503
2503
|
const r = Array.isArray(e);
|
|
2504
2504
|
if ($(e) || r)
|
|
2505
2505
|
for (const n in e)
|
|
2506
|
-
Array.isArray(e[n]) || $(e[n]) && !
|
|
2506
|
+
Array.isArray(e[n]) || $(e[n]) && !vr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Je(e[n], t[n])) : U(e[n]) || (t[n] = !0);
|
|
2507
2507
|
return t;
|
|
2508
2508
|
}
|
|
2509
|
-
function
|
|
2509
|
+
function xr(e, t, r) {
|
|
2510
2510
|
const n = Array.isArray(e);
|
|
2511
2511
|
if ($(e) || n)
|
|
2512
2512
|
for (const s in e)
|
|
2513
|
-
Array.isArray(e[s]) || $(e[s]) && !
|
|
2513
|
+
Array.isArray(e[s]) || $(e[s]) && !vr(e[s]) ? O(t) || We(r[s]) ? r[s] = Array.isArray(e[s]) ? Je(e[s], []) : { ...Je(e[s]) } : xr(e[s], U(t) ? {} : t[s], r[s]) : r[s] = !ye(e[s], t[s]);
|
|
2514
2514
|
return r;
|
|
2515
2515
|
}
|
|
2516
|
-
var ut = (e, t) =>
|
|
2516
|
+
var ut = (e, t) => xr(e, t, Je(t)), wr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => O(e) ? e : t ? e === "" ? NaN : e && +e : r && te(e) ? new Date(e) : n ? n(e) : e;
|
|
2517
2517
|
function ct(e) {
|
|
2518
2518
|
const t = e.ref;
|
|
2519
2519
|
if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
|
|
2520
|
-
return
|
|
2520
|
+
return vt(t) ? t.files : xt(t) ? yr(e.refs).value : br(t) ? [...t.selectedOptions].map(({ value: r }) => r) : De(t) ? gr(e.refs).value : wr(O(t.value) ? e.ref.value : t.value, e);
|
|
2521
2521
|
}
|
|
2522
|
-
var
|
|
2522
|
+
var Xn = (e, t, r, n) => {
|
|
2523
2523
|
const s = {};
|
|
2524
2524
|
for (const a of e) {
|
|
2525
2525
|
const i = w(t, a);
|
|
@@ -2531,10 +2531,10 @@ var Yn = (e, t, r, n) => {
|
|
|
2531
2531
|
fields: s,
|
|
2532
2532
|
shouldUseNativeValidation: n
|
|
2533
2533
|
};
|
|
2534
|
-
}, Ve = (e) => O(e) ? e : He(e) ? e.source : $(e) ? He(e.value) ? e.value.source : e.value : e,
|
|
2535
|
-
function
|
|
2534
|
+
}, Ve = (e) => O(e) ? e : He(e) ? e.source : $(e) ? He(e.value) ? e.value.source : e.value : e, Yn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2535
|
+
function Ht(e, t, r) {
|
|
2536
2536
|
const n = w(e, r);
|
|
2537
|
-
if (n ||
|
|
2537
|
+
if (n || bt(r))
|
|
2538
2538
|
return {
|
|
2539
2539
|
error: n,
|
|
2540
2540
|
name: r
|
|
@@ -2555,15 +2555,15 @@ function Wt(e, t, r) {
|
|
|
2555
2555
|
name: r
|
|
2556
2556
|
};
|
|
2557
2557
|
}
|
|
2558
|
-
var
|
|
2559
|
-
const
|
|
2558
|
+
var es = (e, t, r, n, s) => s.isOnAll ? !1 : !r && s.isOnTouch ? !(t || e) : (r ? n.isOnBlur : s.isOnBlur) ? !e : (r ? n.isOnChange : s.isOnChange) ? e : !0, ts = (e, t) => !Re(w(e, t)).length && j(e, t);
|
|
2559
|
+
const rs = {
|
|
2560
2560
|
mode: Z.onSubmit,
|
|
2561
2561
|
reValidateMode: Z.onChange,
|
|
2562
2562
|
shouldFocusError: !0
|
|
2563
2563
|
};
|
|
2564
|
-
function
|
|
2564
|
+
function ns(e = {}, t) {
|
|
2565
2565
|
let r = {
|
|
2566
|
-
...
|
|
2566
|
+
...rs,
|
|
2567
2567
|
...e
|
|
2568
2568
|
}, n = {
|
|
2569
2569
|
submitCount: 0,
|
|
@@ -2599,7 +2599,7 @@ function ss(e = {}, t) {
|
|
|
2599
2599
|
values: ot(),
|
|
2600
2600
|
array: ot(),
|
|
2601
2601
|
state: ot()
|
|
2602
|
-
},
|
|
2602
|
+
}, _ = e.resetOptions && e.resetOptions.keepDirtyValues, v = $t(r.mode), E = $t(r.reValidateMode), S = r.criteriaMode === Z.all, A = (o) => (c) => {
|
|
2603
2603
|
clearTimeout(x), x = setTimeout(o, c);
|
|
2604
2604
|
}, g = async (o) => {
|
|
2605
2605
|
if (y.isValid || o) {
|
|
@@ -2610,18 +2610,18 @@ function ss(e = {}, t) {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
}, T = (o) => y.isValidating && p.state.next({
|
|
2612
2612
|
isValidating: o
|
|
2613
|
-
}), P = (o, c = [], f,
|
|
2614
|
-
if (
|
|
2613
|
+
}), P = (o, c = [], f, k, b = !0, m = !0) => {
|
|
2614
|
+
if (k && f) {
|
|
2615
2615
|
if (u.action = !0, m && Array.isArray(w(s, o))) {
|
|
2616
|
-
const C = f(w(s, o),
|
|
2616
|
+
const C = f(w(s, o), k.argA, k.argB);
|
|
2617
2617
|
b && N(s, o, C);
|
|
2618
2618
|
}
|
|
2619
2619
|
if (m && Array.isArray(w(n.errors, o))) {
|
|
2620
|
-
const C = f(w(n.errors, o),
|
|
2621
|
-
b && N(n.errors, o, C),
|
|
2620
|
+
const C = f(w(n.errors, o), k.argA, k.argB);
|
|
2621
|
+
b && N(n.errors, o, C), ts(n.errors, o);
|
|
2622
2622
|
}
|
|
2623
2623
|
if (y.touchedFields && m && Array.isArray(w(n.touchedFields, o))) {
|
|
2624
|
-
const C = f(w(n.touchedFields, o),
|
|
2624
|
+
const C = f(w(n.touchedFields, o), k.argA, k.argB);
|
|
2625
2625
|
b && N(n.touchedFields, o, C);
|
|
2626
2626
|
}
|
|
2627
2627
|
y.dirtyFields && (n.dirtyFields = ut(a, i)), p.state.next({
|
|
@@ -2637,18 +2637,18 @@ function ss(e = {}, t) {
|
|
|
2637
2637
|
N(n.errors, o, c), p.state.next({
|
|
2638
2638
|
errors: n.errors
|
|
2639
2639
|
});
|
|
2640
|
-
}, me = (o, c, f,
|
|
2640
|
+
}, me = (o, c, f, k) => {
|
|
2641
2641
|
const b = w(s, o);
|
|
2642
2642
|
if (b) {
|
|
2643
2643
|
const m = w(i, o, O(f) ? w(a, o) : f);
|
|
2644
|
-
O(m) ||
|
|
2644
|
+
O(m) || k && k.defaultChecked || c ? N(i, o, c ? m : ct(b._f)) : H(o, m), u.mount && g();
|
|
2645
2645
|
}
|
|
2646
|
-
}, ce = (o, c, f,
|
|
2646
|
+
}, ce = (o, c, f, k, b) => {
|
|
2647
2647
|
let m = !1, C = !1;
|
|
2648
2648
|
const L = {
|
|
2649
2649
|
name: o
|
|
2650
2650
|
};
|
|
2651
|
-
if (!f ||
|
|
2651
|
+
if (!f || k) {
|
|
2652
2652
|
y.isDirty && (C = n.isDirty, n.isDirty = L.isDirty = V(), m = C !== L.isDirty);
|
|
2653
2653
|
const B = ye(w(a, o), c);
|
|
2654
2654
|
C = w(n.dirtyFields, o), B ? j(n.dirtyFields, o) : N(n.dirtyFields, o, !0), L.dirtyFields = n.dirtyFields, m = m || y.dirtyFields && C !== !B;
|
|
@@ -2658,11 +2658,11 @@ function ss(e = {}, t) {
|
|
|
2658
2658
|
B || (N(n.touchedFields, o, f), L.touchedFields = n.touchedFields, m = m || y.touchedFields && B !== f);
|
|
2659
2659
|
}
|
|
2660
2660
|
return m && b && p.state.next(L), m ? L : {};
|
|
2661
|
-
}, Ae = (o, c, f,
|
|
2661
|
+
}, Ae = (o, c, f, k) => {
|
|
2662
2662
|
const b = w(n.errors, o), m = y.isValid && de(c) && n.isValid !== c;
|
|
2663
|
-
if (e.delayError && f ? (h = A(() => D(o, f)), h(e.delayError)) : (clearTimeout(x), h = null, f ? N(n.errors, o, f) : j(n.errors, o)), (f ? !ye(b, f) : b) || !W(
|
|
2663
|
+
if (e.delayError && f ? (h = A(() => D(o, f)), h(e.delayError)) : (clearTimeout(x), h = null, f ? N(n.errors, o, f) : j(n.errors, o)), (f ? !ye(b, f) : b) || !W(k) || m) {
|
|
2664
2664
|
const C = {
|
|
2665
|
-
...
|
|
2665
|
+
...k,
|
|
2666
2666
|
...m && de(c) ? { isValid: c } : {},
|
|
2667
2667
|
errors: n.errors,
|
|
2668
2668
|
name: o
|
|
@@ -2673,12 +2673,12 @@ function ss(e = {}, t) {
|
|
|
2673
2673
|
}, p.state.next(C);
|
|
2674
2674
|
}
|
|
2675
2675
|
T(!1);
|
|
2676
|
-
}, G = async (o) => r.resolver(i, r.context,
|
|
2676
|
+
}, G = async (o) => r.resolver(i, r.context, Xn(o || d.mount, s, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
|
|
2677
2677
|
const { errors: c } = await G(o);
|
|
2678
2678
|
if (o)
|
|
2679
2679
|
for (const f of o) {
|
|
2680
|
-
const
|
|
2681
|
-
|
|
2680
|
+
const k = w(c, f);
|
|
2681
|
+
k ? N(n.errors, f, k) : j(n.errors, f);
|
|
2682
2682
|
}
|
|
2683
2683
|
else
|
|
2684
2684
|
n.errors = c;
|
|
@@ -2686,15 +2686,15 @@ function ss(e = {}, t) {
|
|
|
2686
2686
|
}, q = async (o, c, f = {
|
|
2687
2687
|
valid: !0
|
|
2688
2688
|
}) => {
|
|
2689
|
-
for (const
|
|
2690
|
-
const b = o[
|
|
2689
|
+
for (const k in o) {
|
|
2690
|
+
const b = o[k];
|
|
2691
2691
|
if (b) {
|
|
2692
2692
|
const { _f: m, ...C } = b;
|
|
2693
2693
|
if (m) {
|
|
2694
|
-
const L = d.array.has(m.name), B = await
|
|
2694
|
+
const L = d.array.has(m.name), B = await Gt(b, i, S, r.shouldUseNativeValidation && !c, L);
|
|
2695
2695
|
if (B[m.name] && (f.valid = !1, c))
|
|
2696
2696
|
break;
|
|
2697
|
-
!c && (w(B, m.name) ? L ?
|
|
2697
|
+
!c && (w(B, m.name) ? L ? Wn(n.errors, B, m.name) : N(n.errors, m.name, B[m.name]) : j(n.errors, m.name));
|
|
2698
2698
|
}
|
|
2699
2699
|
C && await q(C, c, f);
|
|
2700
2700
|
}
|
|
@@ -2706,26 +2706,26 @@ function ss(e = {}, t) {
|
|
|
2706
2706
|
c && (c._f.refs ? c._f.refs.every((f) => !lt(f)) : !lt(c._f.ref)) && tt(o);
|
|
2707
2707
|
}
|
|
2708
2708
|
d.unMount = /* @__PURE__ */ new Set();
|
|
2709
|
-
}, V = (o, c) => (o && c && N(i, o, c), !ye(
|
|
2709
|
+
}, V = (o, c) => (o && c && N(i, o, c), !ye(wt(), a)), R = (o, c, f) => Hn(o, d, {
|
|
2710
2710
|
...u.mount ? i : O(c) ? a : te(o) ? { [o]: c } : c
|
|
2711
2711
|
}, f, c), K = (o) => Re(w(u.mount ? i : a, o, e.shouldUnregister ? w(a, o, []) : [])), H = (o, c, f = {}) => {
|
|
2712
|
-
const
|
|
2712
|
+
const k = w(s, o);
|
|
2713
2713
|
let b = c;
|
|
2714
|
-
if (
|
|
2715
|
-
const m =
|
|
2716
|
-
m && (!m.disabled && N(i, o,
|
|
2714
|
+
if (k) {
|
|
2715
|
+
const m = k._f;
|
|
2716
|
+
m && (!m.disabled && N(i, o, wr(c, m)), b = Ge(m.ref) && U(c) ? "" : c, br(m.ref) ? [...m.ref.options].forEach((C) => C.selected = b.includes(C.value)) : m.refs ? De(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(b) ? !!b.find((L) => L === C.value) : b === C.value)) : m.refs[0] && (m.refs[0].checked = !!b) : m.refs.forEach((C) => C.checked = C.value === b) : vt(m.ref) ? m.ref.value = "" : (m.ref.value = b, m.ref.type || p.values.next({
|
|
2717
2717
|
name: o,
|
|
2718
2718
|
values: { ...i }
|
|
2719
2719
|
})));
|
|
2720
2720
|
}
|
|
2721
2721
|
(f.shouldDirty || f.shouldTouch) && ce(o, b, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && et(o);
|
|
2722
2722
|
}, Q = (o, c, f) => {
|
|
2723
|
-
for (const
|
|
2724
|
-
const b = c[
|
|
2725
|
-
(d.array.has(o) || !We(b) || C && !C._f) && !
|
|
2723
|
+
for (const k in c) {
|
|
2724
|
+
const b = c[k], m = `${o}.${k}`, C = w(s, m);
|
|
2725
|
+
(d.array.has(o) || !We(b) || C && !C._f) && !_e(b) ? Q(m, b, f) : H(m, b, f);
|
|
2726
2726
|
}
|
|
2727
2727
|
}, ge = (o, c, f = {}) => {
|
|
2728
|
-
const
|
|
2728
|
+
const k = w(s, o), b = d.array.has(o), m = oe(c);
|
|
2729
2729
|
N(i, o, m), b ? (p.array.next({
|
|
2730
2730
|
name: o,
|
|
2731
2731
|
values: { ...i }
|
|
@@ -2733,58 +2733,58 @@ function ss(e = {}, t) {
|
|
|
2733
2733
|
name: o,
|
|
2734
2734
|
dirtyFields: ut(a, i),
|
|
2735
2735
|
isDirty: V(o, m)
|
|
2736
|
-
})) :
|
|
2736
|
+
})) : k && !k._f && !U(m) ? Q(o, m, f) : H(o, m, f), jt(o, d) && p.state.next({ ...n }), p.values.next({
|
|
2737
2737
|
name: o,
|
|
2738
2738
|
values: { ...i }
|
|
2739
2739
|
}), !u.mount && t();
|
|
2740
2740
|
}, Ee = async (o) => {
|
|
2741
2741
|
const c = o.target;
|
|
2742
|
-
let f = c.name,
|
|
2743
|
-
const b = w(s, f), m = () => c.type ? ct(b._f) :
|
|
2744
|
-
|
|
2742
|
+
let f = c.name, k = !0;
|
|
2743
|
+
const b = w(s, f), m = () => c.type ? ct(b._f) : $n(o), C = (L) => {
|
|
2744
|
+
k = Number.isNaN(L) || L === w(i, f, L);
|
|
2745
2745
|
};
|
|
2746
2746
|
if (b) {
|
|
2747
2747
|
let L, B;
|
|
2748
|
-
const Be = m(), xe = o.type ===
|
|
2748
|
+
const Be = m(), xe = o.type === Pt.BLUR || o.type === Pt.FOCUS_OUT, Er = !Yn(b._f) && !r.resolver && !w(n.errors, f) && !b._f.deps || es(xe, w(n.touchedFields, f), n.isSubmitted, E, v), nt = jt(f, d, xe);
|
|
2749
2749
|
N(i, f, Be), xe ? (b._f.onBlur && b._f.onBlur(o), h && h(0)) : b._f.onChange && b._f.onChange(o);
|
|
2750
|
-
const st = ce(f, Be, xe, !1),
|
|
2750
|
+
const st = ce(f, Be, xe, !1), Ir = !W(st) || nt;
|
|
2751
2751
|
if (!xe && p.values.next({
|
|
2752
2752
|
name: f,
|
|
2753
2753
|
type: o.type,
|
|
2754
2754
|
values: { ...i }
|
|
2755
|
-
}),
|
|
2756
|
-
return y.isValid && g(),
|
|
2755
|
+
}), Er)
|
|
2756
|
+
return y.isValid && g(), Ir && p.state.next({ name: f, ...nt ? {} : st });
|
|
2757
2757
|
if (!xe && nt && p.state.next({ ...n }), T(!0), r.resolver) {
|
|
2758
|
-
const { errors:
|
|
2759
|
-
if (C(Be),
|
|
2760
|
-
const
|
|
2761
|
-
L =
|
|
2758
|
+
const { errors: Vt } = await G([f]);
|
|
2759
|
+
if (C(Be), k) {
|
|
2760
|
+
const Vr = Ht(n.errors, s, f), Mt = Ht(Vt, s, Vr.name || f);
|
|
2761
|
+
L = Mt.error, f = Mt.name, B = W(Vt);
|
|
2762
2762
|
}
|
|
2763
2763
|
} else
|
|
2764
|
-
L = (await
|
|
2765
|
-
|
|
2764
|
+
L = (await Gt(b, i, S, r.shouldUseNativeValidation))[f], C(Be), k && (L ? B = !1 : y.isValid && (B = await q(s, !0)));
|
|
2765
|
+
k && (b._f.deps && et(b._f.deps), Ae(f, B, L, st));
|
|
2766
2766
|
}
|
|
2767
2767
|
}, Oe = (o, c) => {
|
|
2768
2768
|
if (w(n.errors, c) && o.focus)
|
|
2769
2769
|
return o.focus(), 1;
|
|
2770
2770
|
}, et = async (o, c = {}) => {
|
|
2771
|
-
let f,
|
|
2771
|
+
let f, k;
|
|
2772
2772
|
const b = it(o);
|
|
2773
2773
|
if (T(!0), r.resolver) {
|
|
2774
2774
|
const m = await se(O(o) ? o : b);
|
|
2775
|
-
f = W(m),
|
|
2775
|
+
f = W(m), k = o ? !b.some((C) => w(m, C)) : f;
|
|
2776
2776
|
} else
|
|
2777
|
-
o ? (
|
|
2777
|
+
o ? (k = (await Promise.all(b.map(async (m) => {
|
|
2778
2778
|
const C = w(s, m);
|
|
2779
2779
|
return await q(C && C._f ? { [m]: C } : C);
|
|
2780
|
-
}))).every(Boolean), !(!
|
|
2780
|
+
}))).every(Boolean), !(!k && !n.isValid) && g()) : k = f = await q(s);
|
|
2781
2781
|
return p.state.next({
|
|
2782
2782
|
...!te(o) || y.isValid && f !== n.isValid ? {} : { name: o },
|
|
2783
2783
|
...r.resolver || !o ? { isValid: f } : {},
|
|
2784
2784
|
errors: n.errors,
|
|
2785
2785
|
isValidating: !1
|
|
2786
|
-
}), c.shouldFocus && !
|
|
2787
|
-
},
|
|
2786
|
+
}), c.shouldFocus && !k && ze(s, Oe, o ? b : d.mount), k;
|
|
2787
|
+
}, wt = (o) => {
|
|
2788
2788
|
const c = {
|
|
2789
2789
|
...a,
|
|
2790
2790
|
...u.mount ? i : {}
|
|
@@ -2795,21 +2795,21 @@ function ss(e = {}, t) {
|
|
|
2795
2795
|
isDirty: !!w((c || n).dirtyFields, o),
|
|
2796
2796
|
isTouched: !!w((c || n).touchedFields, o),
|
|
2797
2797
|
error: w((c || n).errors, o)
|
|
2798
|
-
}),
|
|
2798
|
+
}), kr = (o) => {
|
|
2799
2799
|
o && it(o).forEach((c) => j(n.errors, c)), p.state.next({
|
|
2800
2800
|
errors: o ? n.errors : {}
|
|
2801
2801
|
});
|
|
2802
|
-
},
|
|
2803
|
-
const
|
|
2802
|
+
}, kt = (o, c, f) => {
|
|
2803
|
+
const k = (w(s, o, { _f: {} })._f || {}).ref;
|
|
2804
2804
|
N(n.errors, o, {
|
|
2805
2805
|
...c,
|
|
2806
|
-
ref:
|
|
2806
|
+
ref: k
|
|
2807
2807
|
}), p.state.next({
|
|
2808
2808
|
name: o,
|
|
2809
2809
|
errors: n.errors,
|
|
2810
2810
|
isValid: !1
|
|
2811
|
-
}), f && f.shouldFocus &&
|
|
2812
|
-
},
|
|
2811
|
+
}), f && f.shouldFocus && k && k.focus && k.focus();
|
|
2812
|
+
}, Sr = (o, c) => fe(o) ? p.values.subscribe({
|
|
2813
2813
|
next: (f) => o(R(void 0, c), f)
|
|
2814
2814
|
}) : R(o, c, !0), tt = (o, c = {}) => {
|
|
2815
2815
|
for (const f of o ? it(o) : d.mount)
|
|
@@ -2820,14 +2820,14 @@ function ss(e = {}, t) {
|
|
|
2820
2820
|
...n,
|
|
2821
2821
|
...c.keepDirty ? { isDirty: V() } : {}
|
|
2822
2822
|
}), !c.keepIsValid && g();
|
|
2823
|
-
},
|
|
2823
|
+
}, St = ({ disabled: o, name: c, field: f, fields: k, value: b }) => {
|
|
2824
2824
|
if (de(o)) {
|
|
2825
|
-
const m = o ? void 0 : O(b) ? ct(f ? f._f : w(
|
|
2825
|
+
const m = o ? void 0 : O(b) ? ct(f ? f._f : w(k, c)._f) : b;
|
|
2826
2826
|
N(i, c, m), ce(c, m, !1, !1, !0);
|
|
2827
2827
|
}
|
|
2828
2828
|
}, rt = (o, c = {}) => {
|
|
2829
2829
|
let f = w(s, o);
|
|
2830
|
-
const
|
|
2830
|
+
const k = de(c.disabled);
|
|
2831
2831
|
return N(s, o, {
|
|
2832
2832
|
...f || {},
|
|
2833
2833
|
_f: {
|
|
@@ -2836,12 +2836,12 @@ function ss(e = {}, t) {
|
|
|
2836
2836
|
mount: !0,
|
|
2837
2837
|
...c
|
|
2838
2838
|
}
|
|
2839
|
-
}), d.mount.add(o), f ?
|
|
2839
|
+
}), d.mount.add(o), f ? St({
|
|
2840
2840
|
field: f,
|
|
2841
2841
|
disabled: c.disabled,
|
|
2842
2842
|
name: o
|
|
2843
2843
|
}) : me(o, !0, c.value), {
|
|
2844
|
-
...
|
|
2844
|
+
...k ? { disabled: c.disabled } : {},
|
|
2845
2845
|
...r.progressive ? {
|
|
2846
2846
|
required: !!c.required,
|
|
2847
2847
|
min: Ve(c.min),
|
|
@@ -2856,7 +2856,7 @@ function ss(e = {}, t) {
|
|
|
2856
2856
|
ref: (b) => {
|
|
2857
2857
|
if (b) {
|
|
2858
2858
|
rt(o, c), f = w(s, o);
|
|
2859
|
-
const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C =
|
|
2859
|
+
const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C = Qn(m), L = f._f.refs || [];
|
|
2860
2860
|
if (C ? L.find((B) => B === m) : m === f._f.ref)
|
|
2861
2861
|
return;
|
|
2862
2862
|
N(s, o, {
|
|
@@ -2873,42 +2873,42 @@ function ss(e = {}, t) {
|
|
|
2873
2873
|
}
|
|
2874
2874
|
}), me(o, !1, void 0, m);
|
|
2875
2875
|
} else
|
|
2876
|
-
f = w(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(
|
|
2876
|
+
f = w(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(zn(d.array, o) && u.action) && d.unMount.add(o);
|
|
2877
2877
|
}
|
|
2878
2878
|
};
|
|
2879
|
-
},
|
|
2879
|
+
}, Ct = () => r.shouldFocusError && ze(s, Oe, d.mount), Cr = (o) => {
|
|
2880
2880
|
de(o) && (p.state.next({ disabled: o }), ze(s, (c) => {
|
|
2881
2881
|
c.disabled = o;
|
|
2882
2882
|
}, 0, !1));
|
|
2883
|
-
},
|
|
2883
|
+
}, At = (o, c) => async (f) => {
|
|
2884
2884
|
f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
|
|
2885
|
-
let
|
|
2885
|
+
let k = oe(i);
|
|
2886
2886
|
if (p.state.next({
|
|
2887
2887
|
isSubmitting: !0
|
|
2888
2888
|
}), r.resolver) {
|
|
2889
2889
|
const { errors: b, values: m } = await G();
|
|
2890
|
-
n.errors = b,
|
|
2890
|
+
n.errors = b, k = m;
|
|
2891
2891
|
} else
|
|
2892
2892
|
await q(s);
|
|
2893
2893
|
j(n.errors, "root"), W(n.errors) ? (p.state.next({
|
|
2894
2894
|
errors: {}
|
|
2895
|
-
}), await o(
|
|
2895
|
+
}), await o(k, f)) : (c && await c({ ...n.errors }, f), Ct(), setTimeout(Ct)), p.state.next({
|
|
2896
2896
|
isSubmitted: !0,
|
|
2897
2897
|
isSubmitting: !1,
|
|
2898
2898
|
isSubmitSuccessful: W(n.errors),
|
|
2899
2899
|
submitCount: n.submitCount + 1,
|
|
2900
2900
|
errors: n.errors
|
|
2901
2901
|
});
|
|
2902
|
-
},
|
|
2902
|
+
}, Ar = (o, c = {}) => {
|
|
2903
2903
|
w(s, o) && (O(c.defaultValue) ? ge(o, w(a, o)) : (ge(o, c.defaultValue), N(a, o, c.defaultValue)), c.keepTouched || j(n.touchedFields, o), c.keepDirty || (j(n.dirtyFields, o), n.isDirty = c.defaultValue ? V(o, w(a, o)) : V()), c.keepError || (j(n.errors, o), y.isValid && g()), p.state.next({ ...n }));
|
|
2904
|
-
},
|
|
2905
|
-
const f = o ? oe(o) : a,
|
|
2904
|
+
}, Et = (o, c = {}) => {
|
|
2905
|
+
const f = o ? oe(o) : a, k = oe(f), b = o && !W(o) ? k : a;
|
|
2906
2906
|
if (c.keepDefaultValues || (a = f), !c.keepValues) {
|
|
2907
|
-
if (c.keepDirtyValues ||
|
|
2907
|
+
if (c.keepDirtyValues || _)
|
|
2908
2908
|
for (const m of d.mount)
|
|
2909
2909
|
w(n.dirtyFields, m) ? N(b, m, w(i, m)) : ge(m, w(b, m));
|
|
2910
2910
|
else {
|
|
2911
|
-
if (
|
|
2911
|
+
if (yt && O(o))
|
|
2912
2912
|
for (const m of d.mount) {
|
|
2913
2913
|
const C = w(s, m);
|
|
2914
2914
|
if (C && C._f) {
|
|
@@ -2947,25 +2947,25 @@ function ss(e = {}, t) {
|
|
|
2947
2947
|
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
2948
2948
|
isSubmitting: !1
|
|
2949
2949
|
});
|
|
2950
|
-
},
|
|
2950
|
+
}, It = (o, c) => Et(fe(o) ? o(i) : o, c);
|
|
2951
2951
|
return {
|
|
2952
2952
|
control: {
|
|
2953
2953
|
register: rt,
|
|
2954
2954
|
unregister: tt,
|
|
2955
2955
|
getFieldState: _t,
|
|
2956
|
-
handleSubmit:
|
|
2957
|
-
setError:
|
|
2956
|
+
handleSubmit: At,
|
|
2957
|
+
setError: kt,
|
|
2958
2958
|
_executeSchema: G,
|
|
2959
2959
|
_getWatch: R,
|
|
2960
2960
|
_getDirty: V,
|
|
2961
2961
|
_updateValid: g,
|
|
2962
2962
|
_removeUnmounted: F,
|
|
2963
2963
|
_updateFieldArray: P,
|
|
2964
|
-
_updateDisabledField:
|
|
2964
|
+
_updateDisabledField: St,
|
|
2965
2965
|
_getFieldArray: K,
|
|
2966
|
-
_reset:
|
|
2966
|
+
_reset: Et,
|
|
2967
2967
|
_resetDefaultValues: () => fe(r.defaultValues) && r.defaultValues().then((o) => {
|
|
2968
|
-
|
|
2968
|
+
It(o, r.resetOptions), p.state.next({
|
|
2969
2969
|
isLoading: !1
|
|
2970
2970
|
});
|
|
2971
2971
|
}),
|
|
@@ -2975,7 +2975,7 @@ function ss(e = {}, t) {
|
|
|
2975
2975
|
...o
|
|
2976
2976
|
};
|
|
2977
2977
|
},
|
|
2978
|
-
_disableForm:
|
|
2978
|
+
_disableForm: Cr,
|
|
2979
2979
|
_subjects: p,
|
|
2980
2980
|
_proxyFormState: y,
|
|
2981
2981
|
get _fields() {
|
|
@@ -3017,19 +3017,19 @@ function ss(e = {}, t) {
|
|
|
3017
3017
|
},
|
|
3018
3018
|
trigger: et,
|
|
3019
3019
|
register: rt,
|
|
3020
|
-
handleSubmit:
|
|
3021
|
-
watch:
|
|
3020
|
+
handleSubmit: At,
|
|
3021
|
+
watch: Sr,
|
|
3022
3022
|
setValue: ge,
|
|
3023
|
-
getValues:
|
|
3024
|
-
reset:
|
|
3025
|
-
resetField:
|
|
3026
|
-
clearErrors:
|
|
3023
|
+
getValues: wt,
|
|
3024
|
+
reset: It,
|
|
3025
|
+
resetField: Ar,
|
|
3026
|
+
clearErrors: kr,
|
|
3027
3027
|
unregister: tt,
|
|
3028
|
-
setError:
|
|
3028
|
+
setError: kt,
|
|
3029
3029
|
setFocus: (o, c = {}) => {
|
|
3030
|
-
const f = w(s, o),
|
|
3031
|
-
if (
|
|
3032
|
-
const b =
|
|
3030
|
+
const f = w(s, o), k = f && f._f;
|
|
3031
|
+
if (k) {
|
|
3032
|
+
const b = k.refs ? k.refs[0] : k.ref;
|
|
3033
3033
|
b.focus && (b.focus(), c.shouldSelect && b.select());
|
|
3034
3034
|
}
|
|
3035
3035
|
},
|
|
@@ -3053,14 +3053,14 @@ function Xe(e = {}) {
|
|
|
3053
3053
|
defaultValues: fe(e.defaultValues) ? void 0 : e.defaultValues
|
|
3054
3054
|
});
|
|
3055
3055
|
t.current || (t.current = {
|
|
3056
|
-
...
|
|
3056
|
+
...ns(e, () => s((i) => ({ ...i }))),
|
|
3057
3057
|
formState: n
|
|
3058
3058
|
});
|
|
3059
3059
|
const a = t.current.control;
|
|
3060
|
-
return a._options = e,
|
|
3060
|
+
return a._options = e, Gn({
|
|
3061
3061
|
subject: a._subjects.state,
|
|
3062
3062
|
next: (i) => {
|
|
3063
|
-
|
|
3063
|
+
Kn(i, a._proxyFormState, a._updateFormState, !0) && s({ ...a._formState });
|
|
3064
3064
|
}
|
|
3065
3065
|
}), X.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), X.useEffect(() => {
|
|
3066
3066
|
if (a._proxyFormState.isDirty) {
|
|
@@ -3073,41 +3073,41 @@ function Xe(e = {}) {
|
|
|
3073
3073
|
e.values && !ye(e.values, r.current) ? (a._reset(e.values, a._options.resetOptions), r.current = e.values) : a._resetDefaultValues();
|
|
3074
3074
|
}, [e.values, a]), X.useEffect(() => {
|
|
3075
3075
|
a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
3076
|
-
}), t.current.formState =
|
|
3076
|
+
}), t.current.formState = Un(n, a), t.current;
|
|
3077
3077
|
}
|
|
3078
|
-
var
|
|
3078
|
+
var Wt = function(e, t, r) {
|
|
3079
3079
|
if (e && "reportValidity" in e) {
|
|
3080
3080
|
var n = w(r, t);
|
|
3081
3081
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
3082
3082
|
}
|
|
3083
|
-
},
|
|
3083
|
+
}, ss = function(e, t) {
|
|
3084
3084
|
var r = function(s) {
|
|
3085
3085
|
var a = t.fields[s];
|
|
3086
|
-
a && a.ref && "reportValidity" in a.ref ?
|
|
3087
|
-
return
|
|
3086
|
+
a && a.ref && "reportValidity" in a.ref ? Wt(a.ref, s, e) : a.refs && a.refs.forEach(function(i) {
|
|
3087
|
+
return Wt(i, s, e);
|
|
3088
3088
|
});
|
|
3089
3089
|
};
|
|
3090
3090
|
for (var n in t.fields)
|
|
3091
3091
|
r(n);
|
|
3092
|
-
},
|
|
3093
|
-
t.shouldUseNativeValidation &&
|
|
3092
|
+
}, as = function(e, t) {
|
|
3093
|
+
t.shouldUseNativeValidation && ss(e, t);
|
|
3094
3094
|
var r = {};
|
|
3095
3095
|
for (var n in e) {
|
|
3096
3096
|
var s = w(t.fields, n), a = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3097
|
-
if (
|
|
3098
|
-
var i = Object.assign({},
|
|
3097
|
+
if (os(t.names || Object.keys(e), n)) {
|
|
3098
|
+
var i = Object.assign({}, is(w(r, n)));
|
|
3099
3099
|
N(i, "root", a), N(r, n, i);
|
|
3100
3100
|
} else
|
|
3101
3101
|
N(r, n, a);
|
|
3102
3102
|
}
|
|
3103
3103
|
return r;
|
|
3104
|
-
},
|
|
3104
|
+
}, is = function(e) {
|
|
3105
3105
|
return Array.isArray(e) ? e.filter(Boolean) : [];
|
|
3106
|
-
},
|
|
3106
|
+
}, os = function(e, t) {
|
|
3107
3107
|
return e.some(function(r) {
|
|
3108
3108
|
return r.startsWith(t + ".");
|
|
3109
3109
|
});
|
|
3110
|
-
},
|
|
3110
|
+
}, ls = function(e, t) {
|
|
3111
3111
|
for (var r = {}; e.issues.length; ) {
|
|
3112
3112
|
var n = e.issues[0];
|
|
3113
3113
|
if (n.path) {
|
|
@@ -3116,7 +3116,7 @@ var Jt = function(e, t, r) {
|
|
|
3116
3116
|
}).join(".");
|
|
3117
3117
|
if (r[s] || (r[s] = { message: n.message, type: n.validation }), t) {
|
|
3118
3118
|
var a = r[s].types, i = a && a[n.validation];
|
|
3119
|
-
r[s] =
|
|
3119
|
+
r[s] = mr(s, t, r, n.validation, i ? [].concat(i, n.message) : n.message);
|
|
3120
3120
|
}
|
|
3121
3121
|
e.issues.shift();
|
|
3122
3122
|
}
|
|
@@ -3132,15 +3132,15 @@ var Jt = function(e, t, r) {
|
|
|
3132
3132
|
return { values: r.raw ? n : y, errors: {} };
|
|
3133
3133
|
}
|
|
3134
3134
|
var x = Object.assign({}, { abortEarly: !1, abortPipeEarly: !1 }, t);
|
|
3135
|
-
return r.mode === "sync" ? h(
|
|
3135
|
+
return r.mode === "sync" ? h(sr(e, n, x)) : Promise.resolve(Rr(e, n, x)).then(h);
|
|
3136
3136
|
}();
|
|
3137
3137
|
} catch (h) {
|
|
3138
3138
|
return u(h);
|
|
3139
3139
|
}
|
|
3140
3140
|
return d && d.then ? d.then(void 0, u) : d;
|
|
3141
3141
|
}(0, function(i) {
|
|
3142
|
-
if (i instanceof
|
|
3143
|
-
return { values: {}, errors:
|
|
3142
|
+
if (i instanceof Or)
|
|
3143
|
+
return { values: {}, errors: as(ls(i, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a) };
|
|
3144
3144
|
throw i;
|
|
3145
3145
|
}));
|
|
3146
3146
|
} catch (i) {
|
|
@@ -3148,18 +3148,18 @@ var Jt = function(e, t, r) {
|
|
|
3148
3148
|
}
|
|
3149
3149
|
};
|
|
3150
3150
|
};
|
|
3151
|
-
const
|
|
3151
|
+
const Jt = 27, Zt = 12, Qt = 10, us = Se("enum"), cs = (e) => {
|
|
3152
3152
|
const t = {
|
|
3153
3153
|
min: e.minSelected ?? 0,
|
|
3154
3154
|
max: e.maxSelected ?? e.options.length
|
|
3155
3155
|
};
|
|
3156
3156
|
return Ye(he({
|
|
3157
|
-
checked:
|
|
3157
|
+
checked: ar(Br(Pr()), (r) => Object.entries(r).filter(([n, s]) => s).map(([n, s]) => n), [$e(t.max, `Please select at most ${t.max} option${t.max !== 1 ? "s" : ""}`), je(t.min, `Please select at least ${t.min} option${t.min !== 1 ? "s" : ""}`)])
|
|
3158
3158
|
}));
|
|
3159
|
-
},
|
|
3159
|
+
}, ds = nr(({
|
|
3160
3160
|
option: e,
|
|
3161
3161
|
...t
|
|
3162
|
-
}, r) => l(
|
|
3162
|
+
}, r) => l(ke, {
|
|
3163
3163
|
children: [l("input", {
|
|
3164
3164
|
class: "peer sr-only h-full",
|
|
3165
3165
|
type: "checkbox",
|
|
@@ -3170,16 +3170,16 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3170
3170
|
htmlFor: t.id,
|
|
3171
3171
|
children: e.label
|
|
3172
3172
|
})]
|
|
3173
|
-
})),
|
|
3173
|
+
})), Xt = Ze("gutter-stable flex w-full flex-1 flex-wrap gap-3 overflow-y-auto rounded-xl p-2.5 pr-4", {
|
|
3174
3174
|
variants: {
|
|
3175
3175
|
variant: {
|
|
3176
3176
|
// In cases where there is only one option, we want to center it
|
|
3177
3177
|
singleOption: "justify-center",
|
|
3178
3178
|
// Two choices with exactly 1 min 1 max
|
|
3179
|
-
booleanLike:
|
|
3179
|
+
booleanLike: cr
|
|
3180
3180
|
}
|
|
3181
3181
|
}
|
|
3182
|
-
}),
|
|
3182
|
+
}), fs = ({
|
|
3183
3183
|
input: e,
|
|
3184
3184
|
onSubmitSuccess: t
|
|
3185
3185
|
}) => {
|
|
@@ -3192,23 +3192,23 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3192
3192
|
}
|
|
3193
3193
|
} = Xe({
|
|
3194
3194
|
defaultValues: {
|
|
3195
|
-
checked: n ? {} :
|
|
3195
|
+
checked: n ? {} : us(r) ? Object.fromEntries(r.value.map((y) => [y, !0])) : {}
|
|
3196
3196
|
},
|
|
3197
|
-
resolver:
|
|
3198
|
-
}), d =
|
|
3197
|
+
resolver: cs(e.config)
|
|
3198
|
+
}), d = gt();
|
|
3199
3199
|
return s ? l("ul", {
|
|
3200
3200
|
style: {
|
|
3201
|
-
maxHeight: 6.5 *
|
|
3201
|
+
maxHeight: 6.5 * Jt + 5 * Zt + 2 * Qt
|
|
3202
3202
|
},
|
|
3203
|
-
class:
|
|
3203
|
+
class: Xt({
|
|
3204
3204
|
variant: "booleanLike"
|
|
3205
3205
|
}),
|
|
3206
3206
|
children: e.config.options.map((y, p) => l("li", {
|
|
3207
3207
|
class: "flex-1",
|
|
3208
|
-
children: l(
|
|
3208
|
+
children: l(dr, {
|
|
3209
3209
|
type: "submit",
|
|
3210
|
-
ref: (
|
|
3211
|
-
|
|
3210
|
+
ref: (_) => {
|
|
3211
|
+
_ && p === 0 && (d.current = _);
|
|
3212
3212
|
},
|
|
3213
3213
|
label: y.label,
|
|
3214
3214
|
value: "true",
|
|
@@ -3221,35 +3221,35 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3221
3221
|
}) : l("form", {
|
|
3222
3222
|
noValidate: !0,
|
|
3223
3223
|
onSubmit: (y) => i((p) => {
|
|
3224
|
-
const
|
|
3224
|
+
const _ = p.checked;
|
|
3225
3225
|
t({
|
|
3226
3226
|
type: "enum",
|
|
3227
|
-
value:
|
|
3227
|
+
value: _
|
|
3228
3228
|
});
|
|
3229
3229
|
})(y),
|
|
3230
3230
|
children: [l("div", {
|
|
3231
3231
|
class: "flex items-center gap-1",
|
|
3232
3232
|
children: [l("ul", {
|
|
3233
3233
|
style: {
|
|
3234
|
-
maxHeight: 6.5 *
|
|
3234
|
+
maxHeight: 6.5 * Jt + 5 * Zt + 2 * Qt
|
|
3235
3235
|
},
|
|
3236
|
-
class:
|
|
3236
|
+
class: Xt({
|
|
3237
3237
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3238
3238
|
}),
|
|
3239
3239
|
children: e.config.options.map((y, p) => {
|
|
3240
|
-
const
|
|
3240
|
+
const _ = `checked.${y.value}`, {
|
|
3241
3241
|
ref: v,
|
|
3242
3242
|
...E
|
|
3243
|
-
} = a(
|
|
3243
|
+
} = a(_);
|
|
3244
3244
|
return l("li", {
|
|
3245
3245
|
class: "relative",
|
|
3246
|
-
children: l(
|
|
3246
|
+
children: l(ds, {
|
|
3247
3247
|
option: y,
|
|
3248
3248
|
autoFocus: p === 0,
|
|
3249
3249
|
ref: (S) => {
|
|
3250
3250
|
S && p === 0 && (d.current = S), v(S);
|
|
3251
3251
|
},
|
|
3252
|
-
id:
|
|
3252
|
+
id: _,
|
|
3253
3253
|
...E,
|
|
3254
3254
|
onClick: n ? () => t({
|
|
3255
3255
|
type: "enum",
|
|
@@ -3275,18 +3275,18 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3275
3275
|
})
|
|
3276
3276
|
})]
|
|
3277
3277
|
});
|
|
3278
|
-
},
|
|
3278
|
+
}, hs = Se("number"), ps = (e, t) => {
|
|
3279
3279
|
const r = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3280
3280
|
return Ye(he({
|
|
3281
|
-
number:
|
|
3281
|
+
number: $r(t("validation_number"), [jr(r, t("validation_number_min", {
|
|
3282
3282
|
min: r
|
|
3283
|
-
})),
|
|
3283
|
+
})), zr(n, t("validation_number_max", {
|
|
3284
3284
|
max: n
|
|
3285
|
-
})),
|
|
3285
|
+
})), qr((a) => a === Number(a.toFixed(s)), t("validation_number_decimal_cases", {
|
|
3286
3286
|
count: s
|
|
3287
3287
|
}))])
|
|
3288
3288
|
}));
|
|
3289
|
-
},
|
|
3289
|
+
}, ms = ({
|
|
3290
3290
|
input: e,
|
|
3291
3291
|
onSubmitSuccess: t
|
|
3292
3292
|
}) => {
|
|
@@ -3301,9 +3301,9 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3301
3301
|
}
|
|
3302
3302
|
} = Xe({
|
|
3303
3303
|
defaultValues: {
|
|
3304
|
-
number: r ? Number(r) :
|
|
3304
|
+
number: r ? Number(r) : hs(n) ? n.value : void 0
|
|
3305
3305
|
},
|
|
3306
|
-
resolver:
|
|
3306
|
+
resolver: ps(e.config, s)
|
|
3307
3307
|
}), {
|
|
3308
3308
|
ref: d,
|
|
3309
3309
|
...h
|
|
@@ -3352,13 +3352,13 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3352
3352
|
error: u.number
|
|
3353
3353
|
})]
|
|
3354
3354
|
});
|
|
3355
|
-
},
|
|
3355
|
+
}, gs = (e) => {
|
|
3356
3356
|
if (e === "")
|
|
3357
3357
|
return {
|
|
3358
3358
|
countryCode: "",
|
|
3359
3359
|
phoneNumber: ""
|
|
3360
3360
|
};
|
|
3361
|
-
const t = Object.entries(
|
|
3361
|
+
const t = Object.entries(mt).find((s) => e.startsWith(s[1])), r = t ? t[1] : "", n = e.replace(r, "");
|
|
3362
3362
|
return /^\d+$/.test(n) ? {
|
|
3363
3363
|
countryCode: r,
|
|
3364
3364
|
phoneNumber: n
|
|
@@ -3366,20 +3366,20 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3366
3366
|
countryCode: "",
|
|
3367
3367
|
phoneNumber: ""
|
|
3368
3368
|
};
|
|
3369
|
-
},
|
|
3370
|
-
const t = ee(e("validation_country_code"), [
|
|
3369
|
+
}, ys = "44", bs = Se("string"), vs = Se("phone"), xs = (e) => {
|
|
3370
|
+
const t = ee(e("validation_country_code"), [Ft(/^\+?[0-9 -]+$/, e("validation_country_code"))]);
|
|
3371
3371
|
return Ye(he({
|
|
3372
3372
|
countryCode: t,
|
|
3373
|
-
phoneNumber:
|
|
3373
|
+
phoneNumber: ar(ee(e("validation_phone"), [Ft(/^\+?[0-9 -]+$/, e("validation_phone"))]), (r) => r.replace(/[^0-9]/g, ""), [])
|
|
3374
3374
|
}));
|
|
3375
|
-
},
|
|
3375
|
+
}, ws = ({
|
|
3376
3376
|
input: e,
|
|
3377
3377
|
onSubmitSuccess: t
|
|
3378
3378
|
}) => {
|
|
3379
3379
|
var E;
|
|
3380
3380
|
const r = e.key ? (E = M.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, {
|
|
3381
3381
|
t: n
|
|
3382
|
-
} = J(), [s, a] = Y(), i =
|
|
3382
|
+
} = J(), [s, a] = Y(), i = bs(r) ? gs(r.value) : vs(r) ? r.value : void 0, {
|
|
3383
3383
|
register: u,
|
|
3384
3384
|
handleSubmit: d,
|
|
3385
3385
|
formState: {
|
|
@@ -3388,18 +3388,18 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3388
3388
|
watch: x
|
|
3389
3389
|
} = Xe({
|
|
3390
3390
|
defaultValues: {
|
|
3391
|
-
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3391
|
+
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? ys,
|
|
3392
3392
|
phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3393
3393
|
},
|
|
3394
|
-
resolver:
|
|
3394
|
+
resolver: xs(n)
|
|
3395
3395
|
}), {
|
|
3396
3396
|
ref: y,
|
|
3397
3397
|
...p
|
|
3398
3398
|
} = u("phoneNumber", {
|
|
3399
3399
|
required: !e.config.optional
|
|
3400
|
-
}),
|
|
3400
|
+
}), _ = re(), v = x("countryCode");
|
|
3401
3401
|
return pe(() => {
|
|
3402
|
-
|
|
3402
|
+
_.current && (_.current.focus(), _.current.select());
|
|
3403
3403
|
}, []), l("form", {
|
|
3404
3404
|
noValidate: !0,
|
|
3405
3405
|
class: "flex flex-col gap-1 p-2.5",
|
|
@@ -3437,7 +3437,7 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3437
3437
|
...u("countryCode", {}),
|
|
3438
3438
|
id: `isdk_phone_${e.key}`,
|
|
3439
3439
|
class: "absolute inset-0 opacity-0",
|
|
3440
|
-
children: Object.entries(
|
|
3440
|
+
children: Object.entries(mt).map(([S, A]) => l("option", {
|
|
3441
3441
|
value: A,
|
|
3442
3442
|
children: [S, " (+", A, ")"]
|
|
3443
3443
|
}, S))
|
|
@@ -3452,7 +3452,7 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3452
3452
|
autoCorrect: "off",
|
|
3453
3453
|
autoFocus: !0,
|
|
3454
3454
|
ref: (S) => {
|
|
3455
|
-
S && (
|
|
3455
|
+
S && (_.current = S), y(S);
|
|
3456
3456
|
},
|
|
3457
3457
|
class: Te({
|
|
3458
3458
|
optional: e.config.optional,
|
|
@@ -3502,12 +3502,7 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3502
3502
|
})]
|
|
3503
3503
|
})
|
|
3504
3504
|
})
|
|
3505
|
-
}),
|
|
3506
|
-
empty: "Please enter some text",
|
|
3507
|
-
email: "That doesn’t look like a valid email address",
|
|
3508
|
-
phone: "That doesn’t look like a valid phone number",
|
|
3509
|
-
url: "That doesn’t look like a valid URL"
|
|
3510
|
-
}, Ss = {
|
|
3505
|
+
}), ks = {
|
|
3511
3506
|
email: {
|
|
3512
3507
|
type: "email",
|
|
3513
3508
|
inputMode: "email",
|
|
@@ -3522,7 +3517,7 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3522
3517
|
inputMode: "url",
|
|
3523
3518
|
formNoValidate: !0
|
|
3524
3519
|
}
|
|
3525
|
-
},
|
|
3520
|
+
}, Ss = Se("string"), Cs = (e, t) => {
|
|
3526
3521
|
const r = {
|
|
3527
3522
|
maxLength: t("validation_max_chars", {
|
|
3528
3523
|
count: e.maxChars ?? 999
|
|
@@ -3533,12 +3528,12 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3533
3528
|
};
|
|
3534
3529
|
return Ye(he({
|
|
3535
3530
|
text: {
|
|
3536
|
-
email: ee(
|
|
3531
|
+
email: ee(t("validation_email"), [Ur(t("validation_email")), je(e.minChars ?? 1, r.minLength), $e(e.maxChars ?? 1 / 0, r.maxLength)]),
|
|
3537
3532
|
text: ee([je(e.minChars ?? 1, r.minLength), $e(e.maxChars ?? 1 / 0, r.maxLength)]),
|
|
3538
|
-
url: ee([
|
|
3533
|
+
url: ee([Kr(t("validation_url")), je(e.minChars ?? 1, r.minLength), $e(e.maxChars ?? 1 / 0, r.maxLength)])
|
|
3539
3534
|
}[e.format]
|
|
3540
3535
|
}));
|
|
3541
|
-
},
|
|
3536
|
+
}, As = ({
|
|
3542
3537
|
input: e,
|
|
3543
3538
|
onSubmitSuccess: t
|
|
3544
3539
|
}) => {
|
|
@@ -3553,9 +3548,9 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3553
3548
|
}
|
|
3554
3549
|
} = Xe({
|
|
3555
3550
|
defaultValues: {
|
|
3556
|
-
text: s || (
|
|
3551
|
+
text: s || (Ss(n) ? n.value : "")
|
|
3557
3552
|
},
|
|
3558
|
-
resolver:
|
|
3553
|
+
resolver: Cs(e.config, r)
|
|
3559
3554
|
}), {
|
|
3560
3555
|
ref: d,
|
|
3561
3556
|
...h
|
|
@@ -3580,7 +3575,7 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3580
3575
|
children: [l("input", {
|
|
3581
3576
|
id: "chat-input",
|
|
3582
3577
|
...h,
|
|
3583
|
-
...
|
|
3578
|
+
...ks[e.config.format],
|
|
3584
3579
|
autocomplete: "off",
|
|
3585
3580
|
autoCapitalize: "off",
|
|
3586
3581
|
autoCorrect: "off",
|
|
@@ -3602,20 +3597,20 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3602
3597
|
error: u.text
|
|
3603
3598
|
})]
|
|
3604
3599
|
});
|
|
3605
|
-
},
|
|
3606
|
-
text:
|
|
3607
|
-
phone:
|
|
3608
|
-
"multiple-choice":
|
|
3609
|
-
boolean:
|
|
3610
|
-
file:
|
|
3600
|
+
}, Es = {
|
|
3601
|
+
text: As,
|
|
3602
|
+
phone: ws,
|
|
3603
|
+
"multiple-choice": fs,
|
|
3604
|
+
boolean: Nn,
|
|
3605
|
+
file: Pn,
|
|
3611
3606
|
submit: _s,
|
|
3612
|
-
address:
|
|
3613
|
-
number:
|
|
3614
|
-
},
|
|
3607
|
+
address: In,
|
|
3608
|
+
number: ms
|
|
3609
|
+
}, Is = ({
|
|
3615
3610
|
logger: e
|
|
3616
3611
|
}) => {
|
|
3617
3612
|
var a;
|
|
3618
|
-
const t = (a = M.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] =
|
|
3613
|
+
const t = (a = M.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] = gn(), s = re(null);
|
|
3619
3614
|
return M.inputHeight$.value = n.height, ue(() => {
|
|
3620
3615
|
const i = s.current;
|
|
3621
3616
|
if (i)
|
|
@@ -3632,7 +3627,7 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3632
3627
|
ref: r,
|
|
3633
3628
|
class: "border-divider flex flex-col justify-end border-t",
|
|
3634
3629
|
children: t ? (() => {
|
|
3635
|
-
const i =
|
|
3630
|
+
const i = Es[t.type];
|
|
3636
3631
|
return l(i, {
|
|
3637
3632
|
logger: e,
|
|
3638
3633
|
onSubmitSuccess: z.onSubmitSuccessFn$.value,
|
|
@@ -3657,27 +3652,27 @@ const Zt = 27, Qt = 12, Xt = 10, cs = Se("enum"), ds = (e) => {
|
|
|
3657
3652
|
})
|
|
3658
3653
|
});
|
|
3659
3654
|
};
|
|
3660
|
-
var
|
|
3655
|
+
var Vs = function(e) {
|
|
3661
3656
|
return e instanceof RegExp;
|
|
3662
|
-
},
|
|
3657
|
+
}, Ms = function(t) {
|
|
3663
3658
|
var r = /[\\^$.*+?()[\]{}|]/g, n = RegExp(r.source);
|
|
3664
3659
|
return t && n.test(t) ? t.replace(r, "\\$&") : t;
|
|
3665
3660
|
}, _r = function(e) {
|
|
3666
3661
|
return typeof e == "string";
|
|
3667
|
-
},
|
|
3662
|
+
}, Fs = function(e) {
|
|
3668
3663
|
var t = [];
|
|
3669
3664
|
return e.forEach(function(r) {
|
|
3670
3665
|
Array.isArray(r) ? t = t.concat(r) : t.push(r);
|
|
3671
3666
|
}), t;
|
|
3672
3667
|
};
|
|
3673
|
-
function
|
|
3668
|
+
function Ns(e, t, r) {
|
|
3674
3669
|
var n = 0, s = 0;
|
|
3675
3670
|
if (e === "")
|
|
3676
3671
|
return e;
|
|
3677
3672
|
if (!e || !_r(e))
|
|
3678
3673
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
3679
3674
|
var a = t;
|
|
3680
|
-
|
|
3675
|
+
Vs(a) || (a = new RegExp("(" + Ms(a) + ")", "gi"));
|
|
3681
3676
|
for (var i = e.split(a), u = 1, d = i.length; u < d; u += 2) {
|
|
3682
3677
|
if (i[u] === void 0 || i[u - 1] === void 0) {
|
|
3683
3678
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
@@ -3687,32 +3682,32 @@ function Ls(e, t, r) {
|
|
|
3687
3682
|
}
|
|
3688
3683
|
return i;
|
|
3689
3684
|
}
|
|
3690
|
-
var
|
|
3691
|
-
return Array.isArray(t) || (t = [t]),
|
|
3692
|
-
return _r(s) ?
|
|
3685
|
+
var Ls = function(t, r, n) {
|
|
3686
|
+
return Array.isArray(t) || (t = [t]), Fs(t.map(function(s) {
|
|
3687
|
+
return _r(s) ? Ns(s, r, n) : s;
|
|
3693
3688
|
}));
|
|
3694
3689
|
};
|
|
3695
|
-
const Pe = /* @__PURE__ */
|
|
3696
|
-
const t = Pe(e,
|
|
3697
|
-
const [, u, d] = a.match(
|
|
3690
|
+
const Pe = /* @__PURE__ */ rr(Ls), Ts = /(\[[^\]]+\]\([^)]+\))/g, Ds = /\[([^\]]+)\]\(([^)]+)\)/, Rs = /(https?:\/\/[^\s]+)/g, Os = /_(.*?)_/g, Bs = /\*\*(.*?)\*\*/g, Yt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Ps = (e) => {
|
|
3691
|
+
const t = Pe(e, Ts, (a, i) => {
|
|
3692
|
+
const [, u, d] = a.match(Ds) ?? [];
|
|
3698
3693
|
return d ? l("a", {
|
|
3699
|
-
class:
|
|
3694
|
+
class: Yt,
|
|
3700
3695
|
href: d,
|
|
3701
3696
|
children: u ?? d
|
|
3702
3697
|
}, d + i) : l("span", {
|
|
3703
3698
|
children: "INVALID LINK"
|
|
3704
3699
|
});
|
|
3705
|
-
}), r = Pe(t,
|
|
3706
|
-
class:
|
|
3700
|
+
}), r = Pe(t, Rs, (a, i) => l("a", {
|
|
3701
|
+
class: Yt,
|
|
3707
3702
|
href: a,
|
|
3708
3703
|
children: a
|
|
3709
|
-
}, a + i)), n = Pe(r,
|
|
3704
|
+
}, a + i)), n = Pe(r, Os, (a, i) => l("em", {
|
|
3710
3705
|
children: a
|
|
3711
3706
|
}, a + i));
|
|
3712
|
-
return Pe(n,
|
|
3707
|
+
return Pe(n, Bs, (a, i) => l("strong", {
|
|
3713
3708
|
children: a
|
|
3714
3709
|
}, a + i));
|
|
3715
|
-
},
|
|
3710
|
+
}, $s = Ze("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", {
|
|
3716
3711
|
variants: {
|
|
3717
3712
|
side: {
|
|
3718
3713
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -3726,7 +3721,7 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3726
3721
|
defaultVariants: {
|
|
3727
3722
|
side: "left"
|
|
3728
3723
|
}
|
|
3729
|
-
}),
|
|
3724
|
+
}), js = ({
|
|
3730
3725
|
children: e,
|
|
3731
3726
|
className: t,
|
|
3732
3727
|
animate: r,
|
|
@@ -3736,14 +3731,14 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3736
3731
|
style: {
|
|
3737
3732
|
transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
|
|
3738
3733
|
},
|
|
3739
|
-
class:
|
|
3734
|
+
class: $s({
|
|
3740
3735
|
className: t,
|
|
3741
3736
|
side: n,
|
|
3742
3737
|
animate: r
|
|
3743
3738
|
}),
|
|
3744
3739
|
...s,
|
|
3745
3740
|
children: e
|
|
3746
|
-
}),
|
|
3741
|
+
}), zs = ({
|
|
3747
3742
|
message: e
|
|
3748
3743
|
}) => l("div", {
|
|
3749
3744
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -3767,7 +3762,7 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3767
3762
|
})
|
|
3768
3763
|
})]
|
|
3769
3764
|
})
|
|
3770
|
-
}),
|
|
3765
|
+
}), qs = ({
|
|
3771
3766
|
className: e,
|
|
3772
3767
|
...t
|
|
3773
3768
|
}) => (ue(() => {
|
|
@@ -3787,10 +3782,10 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3787
3782
|
}
|
|
3788
3783
|
}))
|
|
3789
3784
|
}) : void 0
|
|
3790
|
-
})),
|
|
3785
|
+
})), Us = {
|
|
3791
3786
|
bot: "left",
|
|
3792
3787
|
user: "right"
|
|
3793
|
-
},
|
|
3788
|
+
}, Ks = Ze("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)]", {
|
|
3794
3789
|
variants: {
|
|
3795
3790
|
variant: {
|
|
3796
3791
|
info: "text-neutral-8",
|
|
@@ -3799,7 +3794,7 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3799
3794
|
success: "text-[#4CAF50]"
|
|
3800
3795
|
}
|
|
3801
3796
|
}
|
|
3802
|
-
}),
|
|
3797
|
+
}), Gs = ({
|
|
3803
3798
|
lastSentMessageFooter: e
|
|
3804
3799
|
}) => {
|
|
3805
3800
|
var r;
|
|
@@ -3809,13 +3804,13 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3809
3804
|
}, [t.length]), l("ol", {
|
|
3810
3805
|
"aria-label": "Chat messages",
|
|
3811
3806
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
3812
|
-
children: [t.map((n, s) => l(
|
|
3807
|
+
children: [t.map((n, s) => l(ke, {
|
|
3813
3808
|
children: l("li", {
|
|
3814
3809
|
class: "flex",
|
|
3815
3810
|
children: Ke(n).with({
|
|
3816
3811
|
type: "system"
|
|
3817
3812
|
}, (a) => l("p", {
|
|
3818
|
-
class:
|
|
3813
|
+
class: Ks({
|
|
3819
3814
|
variant: a.variant
|
|
3820
3815
|
}),
|
|
3821
3816
|
children: a.text
|
|
@@ -3823,15 +3818,15 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3823
3818
|
type: "text",
|
|
3824
3819
|
author: I.union("bot", "user")
|
|
3825
3820
|
}, (a) => {
|
|
3826
|
-
const i = a.author === "user" && !t.slice(s + 1).some((h) => h.type === "text" && h.author === "user"), u = s === t.length - 1, d = a.author === "bot" ?
|
|
3827
|
-
return l(
|
|
3821
|
+
const i = a.author === "user" && !t.slice(s + 1).some((h) => h.type === "text" && h.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? Ps(a.text) : a.text;
|
|
3822
|
+
return l(js, {
|
|
3828
3823
|
animate: u,
|
|
3829
|
-
side:
|
|
3824
|
+
side: Us[a.author],
|
|
3830
3825
|
children: [d, i ? e : null]
|
|
3831
3826
|
}, s);
|
|
3832
3827
|
}).with({
|
|
3833
3828
|
type: "link"
|
|
3834
|
-
}, (a) => l(
|
|
3829
|
+
}, (a) => l(zs, {
|
|
3835
3830
|
message: a
|
|
3836
3831
|
})).with({
|
|
3837
3832
|
type: "image"
|
|
@@ -3843,7 +3838,7 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3843
3838
|
}
|
|
3844
3839
|
})).with({
|
|
3845
3840
|
type: "file"
|
|
3846
|
-
}, (a) => l(
|
|
3841
|
+
}, (a) => l(Rn, {
|
|
3847
3842
|
class: a.author === "bot" ? void 0 : "ml-auto",
|
|
3848
3843
|
file: {
|
|
3849
3844
|
name: a.fileName,
|
|
@@ -3855,15 +3850,15 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3855
3850
|
const i = t[t.length - 1];
|
|
3856
3851
|
return !(a === i) || z.isBotTyping$.value ? null : l("div", {
|
|
3857
3852
|
class: "flex flex-grow flex-col items-center justify-center",
|
|
3858
|
-
children: l(
|
|
3853
|
+
children: l(Gr, {
|
|
3859
3854
|
class: "text-neutral-6 h-8 w-8"
|
|
3860
3855
|
})
|
|
3861
3856
|
});
|
|
3862
3857
|
}).exhaustive()
|
|
3863
3858
|
})
|
|
3864
|
-
}, s)), l(
|
|
3859
|
+
}, s)), l(qs, {}, "typing")]
|
|
3865
3860
|
});
|
|
3866
|
-
},
|
|
3861
|
+
}, ta = ({
|
|
3867
3862
|
logger: e,
|
|
3868
3863
|
apiClient: t,
|
|
3869
3864
|
analytics: r
|
|
@@ -3891,7 +3886,7 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3891
3886
|
let p = y.data.nodeHistory.at(-1);
|
|
3892
3887
|
if (z.scrollToEnd.instant(), M.setInput(void 0), y.data.isFinished)
|
|
3893
3888
|
return;
|
|
3894
|
-
p === void 0 ? (p =
|
|
3889
|
+
p === void 0 ? (p = tr(n.nodes).id, M.setCurrentNodeId(p), r.log({
|
|
3895
3890
|
event: "FLOW_START",
|
|
3896
3891
|
properties: {
|
|
3897
3892
|
flow_id: n.id,
|
|
@@ -3903,10 +3898,10 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3903
3898
|
customProperties: (S = n.analytics) == null ? void 0 : S.customProperties
|
|
3904
3899
|
})) : M.removeMessagesSentByNodeIds([p]);
|
|
3905
3900
|
const {
|
|
3906
|
-
interpret:
|
|
3901
|
+
interpret: _,
|
|
3907
3902
|
abort: v,
|
|
3908
3903
|
undo: E
|
|
3909
|
-
} =
|
|
3904
|
+
} = Jr({
|
|
3910
3905
|
context: n.context,
|
|
3911
3906
|
analytics: {
|
|
3912
3907
|
service: r,
|
|
@@ -3957,8 +3952,8 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3957
3952
|
});
|
|
3958
3953
|
}
|
|
3959
3954
|
});
|
|
3960
|
-
return h(() => E),
|
|
3961
|
-
}, [r, t, i, e, n, u]), l(
|
|
3955
|
+
return h(() => E), _(p), v;
|
|
3956
|
+
}, [r, t, i, e, n, u]), l(ke, {
|
|
3962
3957
|
children: [l("div", {
|
|
3963
3958
|
ref: a,
|
|
3964
3959
|
className: "hide-scrollbars relative flex w-full max-w-full flex-grow flex-col overflow-y-scroll",
|
|
@@ -3966,16 +3961,16 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3966
3961
|
WebkitOverflowScrolling: "touch",
|
|
3967
3962
|
paddingBottom: M.inputHeight$.value
|
|
3968
3963
|
},
|
|
3969
|
-
children: l(
|
|
3970
|
-
lastSentMessageFooter: n.data.isFinished || !d ? null : l(
|
|
3964
|
+
children: l(Gs, {
|
|
3965
|
+
lastSentMessageFooter: n.data.isFinished || !d ? null : l(Ws, {
|
|
3971
3966
|
undoFn: d
|
|
3972
3967
|
})
|
|
3973
3968
|
})
|
|
3974
|
-
}), l(
|
|
3969
|
+
}), l(Is, {
|
|
3975
3970
|
logger: e
|
|
3976
3971
|
})]
|
|
3977
3972
|
});
|
|
3978
|
-
},
|
|
3973
|
+
}, Hs = (e) => "key" in e.data && e.data.key ? [e.data.key] : "keys" in e.data ? Object.values(e.data.keys).filter((t) => typeof t == "string") : [], Ws = ({
|
|
3979
3974
|
undoFn: e
|
|
3980
3975
|
}) => {
|
|
3981
3976
|
const {
|
|
@@ -3993,7 +3988,7 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3993
3988
|
const {
|
|
3994
3989
|
removed: n
|
|
3995
3990
|
} = e(r.data.nodeHistory), s = r.data.nodeHistory.splice(-n);
|
|
3996
|
-
s.length !== 0 && (M.removeMessagesSentByNodeIds(s), M.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(
|
|
3991
|
+
s.length !== 0 && (M.removeMessagesSentByNodeIds(s), M.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(Hs).forEach((a) => delete r.data.submissions[a]), M.current$.value = {
|
|
3997
3992
|
...M.current$.value
|
|
3998
3993
|
});
|
|
3999
3994
|
},
|
|
@@ -4002,5 +3997,5 @@ const Pe = /* @__PURE__ */ nr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
4002
3997
|
});
|
|
4003
3998
|
};
|
|
4004
3999
|
export {
|
|
4005
|
-
|
|
4000
|
+
ta as ChatbotBody
|
|
4006
4001
|
};
|