@inploi/plugin-chatbot 14.13.0 → 14.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +4 -4
- package/dist/chatbot-body-21b3975a.cjs +5 -0
- package/dist/{chatbot-body-dc3edab9.js → chatbot-body-25f7559d.js} +736 -737
- package/dist/components/chat-input/chat-input.multiple-choice.test.d.ts +1 -0
- package/dist/i18n.d.ts +226 -220
- package/dist/index-0b229542.cjs +5 -0
- package/dist/{index-5b3244e1.js → index-d9d11554.js} +285 -312
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +2 -2
- package/package.json +2 -2
- package/dist/chatbot-body-3e43f3a7.cjs +0 -5
- package/dist/components/chat-input/chat-input.phone-number.utils.d.ts +0 -4
- package/dist/index-ba15cfce.cjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Sn = Object.defineProperty;
|
|
2
2
|
var En = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var Y = (e, r, t) => (En(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
-
import { u as Br, p as vt, D as Dt, l as Ge, f as $r, T as jr, a as An, E as In, N as Fn, I as Pr, C as Vn, s as Mn, g as Ln, S as Nn, U as nr, $ as sr, R as Rn, w as ar, m as Tn, y as Dn, b as qr, k as On, x as Bn, h as $n, z as jn, Z as Ur, H as Pn, v as qn, c as q, d as ne, o as
|
|
4
|
+
import { u as Br, p as vt, D as Dt, l as Ge, f as $r, T as jr, a as An, E as In, N as Fn, I as Pr, C as Vn, s as Mn, g as Ln, S as Nn, U as nr, $ as sr, R as Rn, w as ar, m as Tn, y as Dn, b as qr, k as On, x as Bn, h as $n, z as jn, Z as Ur, H as Pn, v as qn, c as q, d as ne, o as u, e as Qe, i as xt, j as ke, _ as ye, n as Oe, q as Le, r as be, L as Ut, F as Un, t as Wr, A as zr, B as Wn, G as zn, J as et, K as ir, M as ae, O as ue, P as Hn, Q as Kn, V as Gn, W as Jn, X as Hr, Y as Zn } from "./index-d9d11554.js";
|
|
5
5
|
import "@inploi/sdk";
|
|
6
|
-
var
|
|
6
|
+
var Xn = "9.10.0", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/index.html`, Yn = new URL(Kr).origin, or = 3e4, Qn = 5 * 6e4, es = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), ts = (e) => {
|
|
7
7
|
let r = Ft.get(e);
|
|
8
8
|
return r || (r = e.fetch("/flow/captcha").then((t) => {
|
|
9
9
|
let n = t == null ? void 0 : t.site_key;
|
|
@@ -11,25 +11,25 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
11
11
|
}).catch((t) => {
|
|
12
12
|
throw Ft.delete(e), t;
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
|
-
},
|
|
15
|
-
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r,
|
|
14
|
+
}, rs = (e, r = {}) => new Promise((t, n) => {
|
|
15
|
+
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, f = () => {
|
|
16
16
|
}, v = (_) => {
|
|
17
|
-
|
|
17
|
+
c || (c = !0, clearTimeout(y), s == null || s.removeEventListener("abort", p), f(), _());
|
|
18
18
|
}, b = (_) => v(() => n(new Error(_))), p = () => b("Captcha aborted"), y, C = (_) => {
|
|
19
19
|
clearTimeout(y), y = setTimeout(() => b("Captcha timed out"), _);
|
|
20
20
|
};
|
|
21
21
|
if (C(or), s == null ? void 0 : s.aborted)
|
|
22
22
|
return p();
|
|
23
23
|
s == null || s.addEventListener("abort", p), (async () => {
|
|
24
|
-
let _ = await
|
|
24
|
+
let _ = await ts(e);
|
|
25
25
|
if (_ === void 0)
|
|
26
26
|
return v(() => t(void 0));
|
|
27
|
-
if (
|
|
27
|
+
if (c)
|
|
28
28
|
return;
|
|
29
29
|
let k = document.createElement("iframe");
|
|
30
30
|
k.src = `${Kr}?${new URLSearchParams({ sitekey: _, origin: window.location.origin, ...a && { theme: a } }).toString()}`, k.title = "Cloudflare security check", k.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(k) : (k.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(k));
|
|
31
31
|
let E = !1, g = (N) => {
|
|
32
|
-
if (!k.contentWindow || N.source !== k.contentWindow || N.origin !==
|
|
32
|
+
if (!k.contentWindow || N.source !== k.contentWindow || N.origin !== Yn || !es(N.data))
|
|
33
33
|
return;
|
|
34
34
|
let V = N.data;
|
|
35
35
|
switch (V.type) {
|
|
@@ -39,7 +39,7 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
39
39
|
k.style.height = `${Math.max(0, Math.ceil(V.height))}px`;
|
|
40
40
|
return;
|
|
41
41
|
case "before-interactive":
|
|
42
|
-
return E = !0, C(
|
|
42
|
+
return E = !0, C(Qn), o == null ? void 0 : o();
|
|
43
43
|
case "after-interactive":
|
|
44
44
|
return E = !1, C(or);
|
|
45
45
|
case "error":
|
|
@@ -80,16 +80,16 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
80
80
|
case "integration": {
|
|
81
81
|
if (typeof a.value != "object" || Array.isArray(a.value))
|
|
82
82
|
return !1;
|
|
83
|
-
let o = Dt(a.value, i),
|
|
83
|
+
let o = Dt(a.value, i), c = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
84
84
|
switch (typeof o) {
|
|
85
85
|
case "boolean":
|
|
86
|
-
return lt(
|
|
86
|
+
return lt(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
87
87
|
case "string":
|
|
88
|
-
return lt(
|
|
88
|
+
return lt(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
|
|
89
89
|
case "number":
|
|
90
|
-
return lt(
|
|
90
|
+
return lt(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
91
91
|
case "object":
|
|
92
|
-
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(
|
|
92
|
+
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
93
93
|
}
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
@@ -166,28 +166,28 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
166
166
|
return !1;
|
|
167
167
|
return !0;
|
|
168
168
|
}
|
|
169
|
-
},
|
|
170
|
-
let [a, ...o] = s.trim().split("."),
|
|
171
|
-
if (!
|
|
169
|
+
}, ns = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ss = (e, { context: r, submissions: t }) => e.replace(ns, (n, s, i = "") => {
|
|
170
|
+
let [a, ...o] = s.trim().split("."), c = Br({ key: a, path: o, submissions: t, context: r });
|
|
171
|
+
if (!c)
|
|
172
172
|
return i;
|
|
173
|
-
switch (
|
|
173
|
+
switch (c.type) {
|
|
174
174
|
case "boolean":
|
|
175
|
-
return
|
|
175
|
+
return c.value === !0 ? "true" : "false";
|
|
176
176
|
case "file":
|
|
177
|
-
return
|
|
177
|
+
return c.value.map((f) => `${f.name} (${Ge(f.sizeKb)})`).join(", ");
|
|
178
178
|
case "enum":
|
|
179
|
-
return
|
|
179
|
+
return c.value.join(", ");
|
|
180
180
|
case "address":
|
|
181
|
-
return Object.values(
|
|
181
|
+
return Object.values(c.value).filter((f) => f && f.trim().length > 0).join(", ");
|
|
182
182
|
case "number":
|
|
183
183
|
case "string":
|
|
184
|
-
return
|
|
184
|
+
return c.value ? c.value.toString() : i;
|
|
185
185
|
case "phone":
|
|
186
|
-
return vt(
|
|
186
|
+
return vt(c.value);
|
|
187
187
|
case "integration": {
|
|
188
|
-
if (typeof
|
|
188
|
+
if (typeof c.value != "object" || Array.isArray(c.value))
|
|
189
189
|
break;
|
|
190
|
-
let f = Dt(
|
|
190
|
+
let f = Dt(c.value, o);
|
|
191
191
|
switch (typeof f) {
|
|
192
192
|
case "boolean":
|
|
193
193
|
return f === !0 ? "true" : "false";
|
|
@@ -205,24 +205,24 @@ var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
205
205
|
return i;
|
|
206
206
|
});
|
|
207
207
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
208
|
-
function
|
|
208
|
+
function as(e) {
|
|
209
209
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
210
210
|
}
|
|
211
211
|
function Wt(e, r, t = "") {
|
|
212
|
-
const n =
|
|
212
|
+
const n = as(e), s = e == null ? void 0 : e.length, i = r !== void 0;
|
|
213
213
|
if (!n || i && s !== r) {
|
|
214
|
-
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "",
|
|
215
|
-
throw new Error(a + "expected Uint8Array" + o + ", got " +
|
|
214
|
+
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", c = n ? `length=${s}` : `type=${typeof e}`;
|
|
215
|
+
throw new Error(a + "expected Uint8Array" + o + ", got " + c);
|
|
216
216
|
}
|
|
217
217
|
return e;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function ur(e, r = !0) {
|
|
220
220
|
if (e.destroyed)
|
|
221
221
|
throw new Error("Hash instance has been destroyed");
|
|
222
222
|
if (r && e.finished)
|
|
223
223
|
throw new Error("Hash#digest() has already been called");
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function is(e, r) {
|
|
226
226
|
Wt(e, void 0, "digestInto() output");
|
|
227
227
|
const t = r.outputLen;
|
|
228
228
|
if (e.length < t)
|
|
@@ -238,32 +238,32 @@ function Vt(e) {
|
|
|
238
238
|
function pe(e, r) {
|
|
239
239
|
return e << 32 - r | e >>> r;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const os = /* @__PURE__ */ (() => (
|
|
242
242
|
// @ts-ignore
|
|
243
243
|
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
|
|
244
|
-
))(),
|
|
245
|
-
function
|
|
246
|
-
if (Wt(e),
|
|
244
|
+
))(), ls = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
|
|
245
|
+
function us(e) {
|
|
246
|
+
if (Wt(e), os)
|
|
247
247
|
return e.toHex();
|
|
248
248
|
let r = "";
|
|
249
249
|
for (let t = 0; t < e.length; t++)
|
|
250
|
-
r +=
|
|
250
|
+
r += ls[e[t]];
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
253
|
function cs(e, r = {}) {
|
|
254
254
|
const t = (s, i) => e(i).update(s).digest(), n = e(void 0);
|
|
255
255
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => e(s), Object.assign(t, r), Object.freeze(t);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const ds = (e) => ({
|
|
258
258
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, e])
|
|
259
259
|
});
|
|
260
|
-
function
|
|
260
|
+
function fs(e, r, t) {
|
|
261
261
|
return e & r ^ ~e & t;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function hs(e, r, t) {
|
|
264
264
|
return e & r ^ e & t ^ r & t;
|
|
265
265
|
}
|
|
266
|
-
class
|
|
266
|
+
class ps {
|
|
267
267
|
constructor(r, t, n, s) {
|
|
268
268
|
Y(this, "blockLen");
|
|
269
269
|
Y(this, "outputLen");
|
|
@@ -279,14 +279,14 @@ class hs {
|
|
|
279
279
|
this.blockLen = r, this.outputLen = t, this.padOffset = n, this.isLE = s, this.buffer = new Uint8Array(r), this.view = Vt(this.buffer);
|
|
280
280
|
}
|
|
281
281
|
update(r) {
|
|
282
|
-
|
|
282
|
+
ur(this), Wt(r);
|
|
283
283
|
const { view: t, buffer: n, blockLen: s } = this, i = r.length;
|
|
284
284
|
for (let a = 0; a < i; ) {
|
|
285
285
|
const o = Math.min(s - this.pos, i - a);
|
|
286
286
|
if (o === s) {
|
|
287
|
-
const
|
|
287
|
+
const c = Vt(r);
|
|
288
288
|
for (; s <= i - a; a += s)
|
|
289
|
-
this.process(
|
|
289
|
+
this.process(c, a);
|
|
290
290
|
continue;
|
|
291
291
|
}
|
|
292
292
|
n.set(r.subarray(a, a + o), this.pos), this.pos += o, a += o, this.pos === s && (this.process(t, 0), this.pos = 0);
|
|
@@ -294,17 +294,17 @@ class hs {
|
|
|
294
294
|
return this.length += r.length, this.roundClean(), this;
|
|
295
295
|
}
|
|
296
296
|
digestInto(r) {
|
|
297
|
-
|
|
297
|
+
ur(this), is(r, this), this.finished = !0;
|
|
298
298
|
const { buffer: t, view: n, blockLen: s, isLE: i } = this;
|
|
299
299
|
let { pos: a } = this;
|
|
300
300
|
t[a++] = 128, Ot(this.buffer.subarray(a)), this.padOffset > s - a && (this.process(n, 0), a = 0);
|
|
301
301
|
for (let b = a; b < s; b++)
|
|
302
302
|
t[b] = 0;
|
|
303
303
|
n.setBigUint64(s - 8, BigInt(this.length * 8), i), this.process(n, 0);
|
|
304
|
-
const o = Vt(r),
|
|
305
|
-
if (
|
|
304
|
+
const o = Vt(r), c = this.outputLen;
|
|
305
|
+
if (c % 4)
|
|
306
306
|
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
307
|
-
const f =
|
|
307
|
+
const f = c / 4, v = this.get();
|
|
308
308
|
if (f > v.length)
|
|
309
309
|
throw new Error("_sha2: outputLen bigger than state");
|
|
310
310
|
for (let b = 0; b < f; b++)
|
|
@@ -325,7 +325,7 @@ class hs {
|
|
|
325
325
|
return this._cloneInto();
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const Ie = /* @__PURE__ */ Uint32Array.from([
|
|
329
329
|
1779033703,
|
|
330
330
|
3144134277,
|
|
331
331
|
1013904242,
|
|
@@ -334,7 +334,7 @@ const Ae = /* @__PURE__ */ Uint32Array.from([
|
|
|
334
334
|
2600822924,
|
|
335
335
|
528734635,
|
|
336
336
|
1541459225
|
|
337
|
-
]),
|
|
337
|
+
]), ms = /* @__PURE__ */ Uint32Array.from([
|
|
338
338
|
1116352408,
|
|
339
339
|
1899447441,
|
|
340
340
|
3049323471,
|
|
@@ -399,58 +399,58 @@ const Ae = /* @__PURE__ */ Uint32Array.from([
|
|
|
399
399
|
2756734187,
|
|
400
400
|
3204031479,
|
|
401
401
|
3329325298
|
|
402
|
-
]),
|
|
403
|
-
class
|
|
402
|
+
]), Fe = /* @__PURE__ */ new Uint32Array(64);
|
|
403
|
+
class ys extends ps {
|
|
404
404
|
constructor(r) {
|
|
405
405
|
super(64, r, 8, !1);
|
|
406
406
|
}
|
|
407
407
|
get() {
|
|
408
|
-
const { A: r, B: t, C: n, D: s, E: i, F: a, G: o, H:
|
|
409
|
-
return [r, t, n, s, i, a, o,
|
|
408
|
+
const { A: r, B: t, C: n, D: s, E: i, F: a, G: o, H: c } = this;
|
|
409
|
+
return [r, t, n, s, i, a, o, c];
|
|
410
410
|
}
|
|
411
411
|
// prettier-ignore
|
|
412
|
-
set(r, t, n, s, i, a, o,
|
|
413
|
-
this.A = r | 0, this.B = t | 0, this.C = n | 0, this.D = s | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H =
|
|
412
|
+
set(r, t, n, s, i, a, o, c) {
|
|
413
|
+
this.A = r | 0, this.B = t | 0, this.C = n | 0, this.D = s | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = c | 0;
|
|
414
414
|
}
|
|
415
415
|
process(r, t) {
|
|
416
416
|
for (let b = 0; b < 16; b++, t += 4)
|
|
417
|
-
|
|
417
|
+
Fe[b] = r.getUint32(t, !1);
|
|
418
418
|
for (let b = 16; b < 64; b++) {
|
|
419
|
-
const p =
|
|
420
|
-
|
|
419
|
+
const p = Fe[b - 15], y = Fe[b - 2], C = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, _ = pe(y, 17) ^ pe(y, 19) ^ y >>> 10;
|
|
420
|
+
Fe[b] = _ + Fe[b - 7] + C + Fe[b - 16] | 0;
|
|
421
421
|
}
|
|
422
|
-
let { A: n, B: s, C: i, D: a, E: o, F:
|
|
422
|
+
let { A: n, B: s, C: i, D: a, E: o, F: c, G: f, H: v } = this;
|
|
423
423
|
for (let b = 0; b < 64; b++) {
|
|
424
|
-
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p +
|
|
425
|
-
v = f, f =
|
|
424
|
+
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p + fs(o, c, f) + ms[b] + Fe[b] | 0, _ = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + hs(n, s, i) | 0;
|
|
425
|
+
v = f, f = c, c = o, o = a + y | 0, a = i, i = s, s = n, n = y + _ | 0;
|
|
426
426
|
}
|
|
427
|
-
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0,
|
|
427
|
+
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, c = c + this.F | 0, f = f + this.G | 0, v = v + this.H | 0, this.set(n, s, i, a, o, c, f, v);
|
|
428
428
|
}
|
|
429
429
|
roundClean() {
|
|
430
|
-
Ot(
|
|
430
|
+
Ot(Fe);
|
|
431
431
|
}
|
|
432
432
|
destroy() {
|
|
433
433
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class bs extends ys {
|
|
437
437
|
constructor() {
|
|
438
438
|
super(32);
|
|
439
439
|
// We cannot use array here since array allows indexing by variable
|
|
440
440
|
// which means optimizer/compiler cannot use registers.
|
|
441
|
-
Y(this, "A",
|
|
442
|
-
Y(this, "B",
|
|
443
|
-
Y(this, "C",
|
|
444
|
-
Y(this, "D",
|
|
445
|
-
Y(this, "E",
|
|
446
|
-
Y(this, "F",
|
|
447
|
-
Y(this, "G",
|
|
448
|
-
Y(this, "H",
|
|
441
|
+
Y(this, "A", Ie[0] | 0);
|
|
442
|
+
Y(this, "B", Ie[1] | 0);
|
|
443
|
+
Y(this, "C", Ie[2] | 0);
|
|
444
|
+
Y(this, "D", Ie[3] | 0);
|
|
445
|
+
Y(this, "E", Ie[4] | 0);
|
|
446
|
+
Y(this, "F", Ie[5] | 0);
|
|
447
|
+
Y(this, "G", Ie[6] | 0);
|
|
448
|
+
Y(this, "H", Ie[7] | 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
() => new
|
|
453
|
-
/* @__PURE__ */
|
|
451
|
+
const gs = /* @__PURE__ */ cs(
|
|
452
|
+
() => new bs(),
|
|
453
|
+
/* @__PURE__ */ ds(1)
|
|
454
454
|
);
|
|
455
455
|
var Gr = (e) => {
|
|
456
456
|
let r = e.find((t) => t.isHead);
|
|
@@ -461,30 +461,30 @@ var Gr = (e) => {
|
|
|
461
461
|
var r, t;
|
|
462
462
|
if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
|
|
463
463
|
return (t = [...e.data.messages].reverse().find((n) => n.groupId && e.nodes.some((s) => s.id === n.groupId && s.type.startsWith("question-")) && (n.type === "system" || "author" in n && n.author === "user"))) == null ? void 0 : t.groupId;
|
|
464
|
-
}, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e,
|
|
465
|
-
function
|
|
464
|
+
}, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e, vs = (e) => us(gs(new TextEncoder().encode(JSON.stringify(Bt(e)))));
|
|
465
|
+
function xs(e, r, t, n) {
|
|
466
466
|
var s;
|
|
467
467
|
if (n != null && n.aborted)
|
|
468
468
|
return;
|
|
469
|
-
let i =
|
|
469
|
+
let i = vs(t), a = (s = e.data).preApplyFingerprints ?? (s.preApplyFingerprints = []);
|
|
470
470
|
if (a.includes(i))
|
|
471
471
|
return;
|
|
472
472
|
a.push(i);
|
|
473
|
-
let o = new AbortController(),
|
|
473
|
+
let o = new AbortController(), c = setTimeout(() => o.abort(), 5e3);
|
|
474
474
|
r.fetch("/flow/pre-apply", { method: "POST", signal: o.signal, body: JSON.stringify(t) }).catch(() => {
|
|
475
475
|
let f = a.indexOf(i);
|
|
476
476
|
f !== -1 && a.splice(f, 1);
|
|
477
477
|
}).finally(() => {
|
|
478
|
-
clearTimeout(
|
|
478
|
+
clearTimeout(c);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) =>
|
|
481
|
+
var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ss(e, Jr(r)), ws = (e, r) => lt(e, Jr(r)), Zr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
482
482
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
483
483
|
return e;
|
|
484
484
|
let n = e.nextId ? r.find((s) => s.id === e.nextId) : void 0;
|
|
485
485
|
if (n)
|
|
486
486
|
return Zr({ node: n, nodes: r, stopWhen: t });
|
|
487
|
-
},
|
|
487
|
+
}, _s = ({ childNode: e, nodes: r }) => {
|
|
488
488
|
let t = r.filter((n) => n.type === "if-block").find((n) => {
|
|
489
489
|
if (!n.branchId)
|
|
490
490
|
return !1;
|
|
@@ -496,7 +496,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((n) => n.id === t.nextId);
|
|
499
|
-
},
|
|
499
|
+
}, ks = 3, Cs = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: c, chatService: f, persistWriteBarrier: v, onSubmitNetworkError: b, closedRoleBehaviour: p, settledOutcomes: y = p, dateEchoLocale: C, onFlowEnd: _, onInterpret: k, forceSubmitConfirmation: E, flowType: g, t: N }) => {
|
|
500
500
|
var V;
|
|
501
501
|
let M = new AbortController(), O = { submitAccepted: !1 };
|
|
502
502
|
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((T) => {
|
|
@@ -518,10 +518,10 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
518
518
|
return ee(j, R);
|
|
519
519
|
k == null || k(T, R);
|
|
520
520
|
try {
|
|
521
|
-
await
|
|
521
|
+
await Ss({ flow: e, analytics: K, logger: t, talentBankClient: n, apiClient: i, context: s, node: T, submissions: I, applicationRecovery: F, setApplicationRecovery: async (L) => {
|
|
522
522
|
if (!B.aborted)
|
|
523
523
|
try {
|
|
524
|
-
await
|
|
524
|
+
await c(L);
|
|
525
525
|
} catch (W) {
|
|
526
526
|
t.error("Failed to persist application recovery", W);
|
|
527
527
|
}
|
|
@@ -530,7 +530,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
530
530
|
}, captcha: f.captcha }, next: (L) => {
|
|
531
531
|
if (B.aborted)
|
|
532
532
|
return;
|
|
533
|
-
let W = (F == null ? void 0 : F.fileQuestionNodeId) === T.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) :
|
|
533
|
+
let W = (F == null ? void 0 : F.fileQuestionNodeId) === T.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) : _s({ childNode: T, nodes: e.nodes });
|
|
534
534
|
return U ? ee(U, T) : _ == null ? void 0 : _(T);
|
|
535
535
|
}, end: () => {
|
|
536
536
|
B.aborted || (_ == null || _(T));
|
|
@@ -567,61 +567,61 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
567
567
|
M.abort();
|
|
568
568
|
} };
|
|
569
569
|
};
|
|
570
|
-
async function
|
|
570
|
+
async function Ss(e) {
|
|
571
571
|
let r = e.node;
|
|
572
572
|
switch (r.type) {
|
|
573
573
|
case "flow-section":
|
|
574
574
|
return await e.chat.sendMessage({ type: "system", variant: "info", text: r.data.title }), e.next(r.nextId);
|
|
575
575
|
case "pre-apply-result":
|
|
576
|
-
return
|
|
576
|
+
return Gs({ ...e, node: r });
|
|
577
577
|
case "text":
|
|
578
|
-
return Os({ ...e, node: r });
|
|
579
|
-
case "image":
|
|
580
578
|
return Bs({ ...e, node: r });
|
|
581
|
-
case "
|
|
579
|
+
case "image":
|
|
582
580
|
return $s({ ...e, node: r });
|
|
581
|
+
case "question-text":
|
|
582
|
+
return js({ ...e, node: r });
|
|
583
583
|
case "question-enum":
|
|
584
|
-
return
|
|
584
|
+
return Us({ ...e, node: r });
|
|
585
585
|
case "question-number":
|
|
586
|
-
return js({ ...e, node: r });
|
|
587
|
-
case "question-phone":
|
|
588
586
|
return Ps({ ...e, node: r });
|
|
587
|
+
case "question-phone":
|
|
588
|
+
return qs({ ...e, node: r });
|
|
589
589
|
case "question-boolean":
|
|
590
|
-
return
|
|
590
|
+
return Ws({ ...e, node: r });
|
|
591
591
|
case "question-file":
|
|
592
|
-
return
|
|
592
|
+
return Hs({ ...e, node: r });
|
|
593
593
|
case "question-address":
|
|
594
|
-
return
|
|
594
|
+
return zs({ ...e, node: r });
|
|
595
595
|
case "end-flow":
|
|
596
|
-
return
|
|
596
|
+
return Ks({ ...e, node: r });
|
|
597
597
|
case "if-block":
|
|
598
|
-
return
|
|
598
|
+
return Os({ ...e, node: r });
|
|
599
599
|
case "jump":
|
|
600
|
-
return
|
|
600
|
+
return Is({ ...e, node: r });
|
|
601
601
|
case "link":
|
|
602
|
-
return
|
|
602
|
+
return Ds({ ...e, node: r });
|
|
603
603
|
case "integration-application-submit":
|
|
604
|
-
return
|
|
604
|
+
return Ts({ ...e, node: r });
|
|
605
605
|
case "add-submission":
|
|
606
|
-
return
|
|
606
|
+
return Fs({ ...e, node: r });
|
|
607
607
|
case "integration-workflow-get":
|
|
608
608
|
throw Error("Workflow should be unreachable");
|
|
609
609
|
case "check-duplicate":
|
|
610
|
-
return
|
|
610
|
+
return As({ ...e, node: r });
|
|
611
611
|
case "feedback":
|
|
612
|
-
return
|
|
612
|
+
return Es({ ...e, node: r });
|
|
613
613
|
default:
|
|
614
614
|
throw new Error(`Unknown node: ${JSON.stringify(r)}`);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
async function
|
|
617
|
+
async function Es({ next: e, node: r }) {
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
|
-
async function
|
|
621
|
-
var
|
|
620
|
+
async function As({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
|
|
621
|
+
var c;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (n && t) {
|
|
624
|
-
let f = r.data.scope === "job" ? (
|
|
624
|
+
let f = r.data.scope === "job" ? (c = s.job) == null ? void 0 : c.id : void 0;
|
|
625
625
|
if (r.data.scope === "company" || f != null)
|
|
626
626
|
try {
|
|
627
627
|
o = await t.checkDuplicate({ email: An({ key: r.data.email, submissions: n }).toString(), jobId: f, scope: r.data.scope });
|
|
@@ -631,24 +631,24 @@ async function Es({ next: e, node: r, talentBankClient: t, submissions: n, flow:
|
|
|
631
631
|
}
|
|
632
632
|
a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
|
|
633
633
|
}
|
|
634
|
-
async function
|
|
634
|
+
async function Is({ next: e, node: r }) {
|
|
635
635
|
e(r.data.targetId);
|
|
636
636
|
}
|
|
637
|
-
async function
|
|
637
|
+
async function Fs({ next: e, node: r, logger: t, submissions: n, context: s }) {
|
|
638
638
|
if (!n) {
|
|
639
639
|
t.error("Submissions not found");
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
642
|
n[r.data.key] = { type: "string", value: he(r.data.value, { submissions: n, context: s }) }, e(r.nextId);
|
|
643
643
|
}
|
|
644
|
-
var
|
|
644
|
+
var Vs = 5e3, Ms = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Ls = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? jn : e.throttles ? Ur : Pn)), Ns = (e, r, t) => {
|
|
645
645
|
let { waitMs: n, throttles: s, maintenance: i } = qn(r == null ? void 0 : r.throttles, t);
|
|
646
646
|
return { key: e, until: Date.now() + n, ...s !== void 0 && { throttles: s }, ...i && { maintenance: i } };
|
|
647
|
-
},
|
|
647
|
+
}, Rs = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && Rs.includes(e.name) ? e : void 0, cr = (e) => {
|
|
648
648
|
let r = $t(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function
|
|
651
|
+
async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: c, applicationRecovery: f, setApplicationRecovery: v, forceSubmitConfirmation: b, flowType: p, run: y, persistWriteBarrier: C, signal: _, onSubmitNetworkError: k, settledOutcomes: E, t: g }) {
|
|
652
652
|
var ee, T;
|
|
653
653
|
let N = async ({ redirect_url: R, message: B, button_text: I }) => {
|
|
654
654
|
let { anonymous_id: F, session_id: j } = o.getSessionInfo();
|
|
@@ -660,27 +660,27 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
660
660
|
s.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
|
-
o.log({ event: "FLOW_REDIRECT", properties: { flow_build:
|
|
663
|
+
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: j, flow_version: c.version, href: L.toString(), job: c.job } });
|
|
664
664
|
} });
|
|
665
665
|
} catch (L) {
|
|
666
666
|
s.error(`Invalid redirect URL: ${R}`, L), e.sendMessage({ type: "system", variant: "error", text: g("redirect_url_error") });
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
if ((ee =
|
|
670
|
-
let R = (T =
|
|
669
|
+
if ((ee = c.data.startedWriteNodeIds) != null && ee.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id) {
|
|
670
|
+
let R = (T = c.data.submitRedirects) == null ? void 0 : T[n.id];
|
|
671
671
|
return R ? (await N(R), r(n.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: g("submission_unknown") }), t());
|
|
672
672
|
}
|
|
673
|
-
let V =
|
|
673
|
+
let V = Ms(n.id, c.job), M = 0, O = y.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, K = async (R) => {
|
|
674
674
|
var st, pt, mt, Et, at, l, d, h, w;
|
|
675
|
-
let B = ((st =
|
|
676
|
-
B && (B.until =
|
|
675
|
+
let B = ((st = c.data.submitCooldown) == null ? void 0 : st.key) === V ? c.data.submitCooldown : void 0;
|
|
676
|
+
B && (B.until = Ls(B));
|
|
677
677
|
let I = B == null ? void 0 : B.until;
|
|
678
|
-
(
|
|
678
|
+
(c.data.reviewRequiresSend === !0 && !O || R !== !0 || I !== void 0 && I > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...I !== void 0 && { availableAt: I } } }), O = !1;
|
|
679
679
|
let F;
|
|
680
680
|
if (n.data.captcha) {
|
|
681
681
|
let m = e.captcha, x = !0;
|
|
682
682
|
try {
|
|
683
|
-
F = await
|
|
683
|
+
F = await rs(i, { signal: _, container: (m == null ? void 0 : m.container()) ?? null, theme: m == null ? void 0 : m.theme, onInteractive: () => {
|
|
684
684
|
e.sendMessage({ type: "text", author: "bot", text: g("captcha_check") }).catch(() => {
|
|
685
685
|
}).then(() => {
|
|
686
686
|
x && (m == null || m.reveal(!0));
|
|
@@ -697,14 +697,14 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
697
697
|
let { anonymous_id: j, session_id: L } = o.getSessionInfo();
|
|
698
698
|
if (_.aborted)
|
|
699
699
|
return;
|
|
700
|
-
let W = ((pt =
|
|
701
|
-
if ((f == null ? void 0 : f.submitNodeId) === n.id && await v(void 0), W || (
|
|
700
|
+
let W = ((pt = c.data.startedWriteNodeIds) == null ? void 0 : pt.includes(n.id)) === !0;
|
|
701
|
+
if ((f == null ? void 0 : f.submitNodeId) === n.id && await v(void 0), W || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], n.id]), await C().catch((m) => s.error("Failed to persist application write barrier", m)), _.aborted)
|
|
702
702
|
return;
|
|
703
703
|
let U, te = setTimeout(() => {
|
|
704
704
|
U = e.sendMessage({ type: "loading", semantic: "submission-still-working", text: g("submission_still_working") }).catch((m) => s.error("Failed to send submission progress message", m));
|
|
705
|
-
},
|
|
705
|
+
}, Vs), X, H = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: j, session_id: L, job: c.job, flow_build: c.build, ...F !== void 0 && { captcha_token: F }, submissions: Vn(c.nodes, Mn(a || {}, n.data.submitKeys)), pre_apply: Pr(c.nodes, a || {}, c.data.flowSessionId) }) }).catch((m) => {
|
|
706
706
|
X = m;
|
|
707
|
-
let x =
|
|
707
|
+
let x = cr(m);
|
|
708
708
|
return (x == null ? void 0 : x.data) !== void 0 ? x.data : m;
|
|
709
709
|
});
|
|
710
710
|
if (clearTimeout(te), await U, _.aborted)
|
|
@@ -712,73 +712,73 @@ async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
712
712
|
if (X !== void 0 && !$t(X) && k)
|
|
713
713
|
return await k(X, _), K(!0);
|
|
714
714
|
n.data.key && e.setSubmission(n.data.key, { type: "integration", value: H });
|
|
715
|
-
let rt = (mt =
|
|
716
|
-
|
|
717
|
-
let qe = Ne !== void 0 && Date.now() - Ne < Ln || ((Et =
|
|
718
|
-
|
|
715
|
+
let rt = (mt = cr(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, D = $r(H, $e), je = D === void 0 && $e === 429, Pe = E === "terminal" && ((D == null ? void 0 : D.outcome) === "closed" || (D == null ? void 0 : D.outcome) === "duplicate"), Ee = c.data.failedAttemptAt, Ne = Ee == null ? void 0 : Ee[V];
|
|
716
|
+
Ee && Ne !== void 0 && Ne > Date.now() && (Ne = Ee[V] = Date.now());
|
|
717
|
+
let qe = Ne !== void 0 && Date.now() - Ne < Ln || ((Et = c.data.unconfirmedAttemptKeys) == null ? void 0 : Et.includes(V)) === !0, nt = (at = $t(X)) == null ? void 0 : at.status, ve = Nn(H, typeof nt == "number" ? nt : void 0);
|
|
718
|
+
ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: c.id, flow_version: c.version, flow_session_id: c.data.flowSessionId, flow_build: c.build, service: ve.service, response: ve.response, captured: (H == null ? void 0 : H.captured) === !0, flow_type: (p == null ? void 0 : p()) ?? "CHATBOT_DRAWER", job: c.job, ...(D == null ? void 0 : D.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ve.outcome && { outcome: ve.outcome } } });
|
|
719
719
|
let Ue = nr(H) || (H == null ? void 0 : H.success) === !0;
|
|
720
|
-
if ((Ue || sr(H)) && (y.submitAccepted = !0), Ue && ((l =
|
|
720
|
+
if ((Ue || sr(H)) && (y.submitAccepted = !0), Ue && ((l = c.data.submitCooldown) == null ? void 0 : l.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await C().catch((m) => s.error("Failed to persist submit cooldown reset", m))), nr(H)) {
|
|
721
721
|
let { redirect_url: m, message: x, button_text: A } = H.integration_response.data, $ = { redirect_url: m, message: x, button_text: A };
|
|
722
|
-
return _.aborted ? void 0 : (
|
|
722
|
+
return _.aborted ? void 0 : (c.data.submitRedirects = { ...c.data.submitRedirects, [n.id]: $ }, await C().catch((P) => s.error("Failed to persist submit redirect", P)), await N($), r(n.nextId));
|
|
723
723
|
}
|
|
724
724
|
let ht = sr(H);
|
|
725
725
|
if (ht)
|
|
726
726
|
return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? g("submission_pending") }), r(n.nextId);
|
|
727
727
|
if ((H == null ? void 0 : H.success) === !0)
|
|
728
728
|
return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: g("submission_completed") }), r(n.nextId);
|
|
729
|
-
let We = Rn(D), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Re = ze === void 0 ? void 0 :
|
|
730
|
-
if (!Re && !Pe && !ar(D) && (
|
|
729
|
+
let We = Rn(D), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Re = ze === void 0 ? void 0 : c.nodes.find((m) => m.type === "question-file" && m.data.key === ze);
|
|
730
|
+
if (!Re && !Pe && !ar(D) && (c.data.submitCooldown = Ns(V, B, D)), (D == null ? void 0 : D.outcome) !== "duplicate" && !je && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [V]: Date.now() }, (h = c.data.unconfirmedAttemptKeys) != null && h.includes(V) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((m) => m !== V))), (D == null ? void 0 : D.verdict) === "not_submitted" || (D == null ? void 0 : D.outcome) === "duplicate" || (D == null ? void 0 : D.outcome) === "closed" || je || Tn(H, $e) ? (W || (c.data.startedWriteNodeIds = (w = c.data.startedWriteNodeIds) == null ? void 0 : w.filter((m) => m !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await v(f), await C().catch((m) => s.error("Failed to persist application write barrier release", m))) : await C().catch((m) => s.error("Failed to persist submit cooldown", m)), D) {
|
|
731
731
|
if (s.error(X ?? D.message), Re && ze !== void 0)
|
|
732
732
|
return e.setSubmission(ze, null), await v({ fileQuestionNodeId: Re.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: g("submission_unreadable_document") }), r(Re.id);
|
|
733
733
|
if (D.outcome === "duplicate")
|
|
734
|
-
return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: g(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete
|
|
734
|
+
return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: g(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
|
|
735
735
|
if (D.outcome === "closed")
|
|
736
|
-
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: g("submission_closed") }), Pe ? (delete
|
|
736
|
+
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: g("submission_closed") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
|
|
737
737
|
let m = Dn(D);
|
|
738
|
-
return m ? (await e.sendMessage({ type: "system", variant: "warning", text: m.until === void 0 ? g("submission_provider_maintenance_later") : g("submission_provider_maintenance", { time: qr(m.until, void 0) }) }), K(!1)) : D.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: g(On(D) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(D) ? Bn(H) ? (await e.sendMessage({ type: "text", author: "bot", text: D.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: g("captcha_failed") }), M++, K(M <=
|
|
738
|
+
return m ? (await e.sendMessage({ type: "system", variant: "warning", text: m.until === void 0 ? g("submission_provider_maintenance_later") : g("submission_provider_maintenance", { time: qr(m.until, void 0) }) }), K(!1)) : D.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: g(On(D) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(D) ? Bn(H) ? (await e.sendMessage({ type: "text", author: "bot", text: D.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: g("captcha_failed") }), M++, K(M <= ks)) : $n(D) ? (await e.sendMessage({ type: "system", variant: "error", text: g("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: g("submission_failed") }), t());
|
|
739
739
|
}
|
|
740
740
|
return s.error(X ?? H), je ? (await e.sendMessage({ type: "system", variant: "error", text: g("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: g("submission_failed") }), t());
|
|
741
741
|
};
|
|
742
742
|
await K(b === !0 && !O ? !1 : n.data.skipConfirmation);
|
|
743
743
|
}
|
|
744
|
-
async function
|
|
744
|
+
async function Ds({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
745
745
|
await e.sendMessage({ type: "link", href: he(t.data.href, { submissions: n, context: s }), text: he(t.data.cta, { submissions: n, context: s }) }), r(t.nextId);
|
|
746
746
|
}
|
|
747
|
-
async function
|
|
748
|
-
r(
|
|
747
|
+
async function Os({ submissions: e, next: r, node: t, context: n }) {
|
|
748
|
+
r(ws(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
|
|
749
749
|
}
|
|
750
|
-
async function
|
|
750
|
+
async function Bs({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
751
751
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.text, { submissions: n, context: s }) }), r(t.nextId);
|
|
752
752
|
}
|
|
753
|
-
async function
|
|
753
|
+
async function $s({ chat: e, next: r, node: t }) {
|
|
754
754
|
await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
|
|
755
755
|
}
|
|
756
|
-
async function
|
|
756
|
+
async function js({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
|
|
757
757
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
758
758
|
let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
|
|
759
759
|
o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ? In(o.value, a) : o.value }), r(t.nextId);
|
|
760
760
|
}
|
|
761
|
-
async function
|
|
761
|
+
async function Ps({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
762
762
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
763
763
|
let a = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
|
|
764
764
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
|
|
765
765
|
}
|
|
766
|
-
async function
|
|
766
|
+
async function qs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
767
767
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
768
768
|
let a = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
|
|
769
769
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? vt(a.value) : a.value }), r(t.nextId);
|
|
770
770
|
}
|
|
771
|
-
async function
|
|
771
|
+
async function Us({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
772
772
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
773
773
|
let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
|
|
774
774
|
a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
|
|
775
775
|
}
|
|
776
|
-
async function
|
|
776
|
+
async function Ws({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
777
777
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
778
778
|
let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
|
|
779
779
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
|
|
780
780
|
}
|
|
781
|
-
async function
|
|
781
|
+
async function zs({ chat: e, next: r, node: t, t: n }) {
|
|
782
782
|
await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
|
|
783
783
|
let s = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
|
|
784
784
|
if (s === null)
|
|
@@ -789,7 +789,7 @@ async function Ws({ chat: e, next: r, node: t, t: n }) {
|
|
|
789
789
|
}
|
|
790
790
|
return r(t.nextId);
|
|
791
791
|
}
|
|
792
|
-
async function
|
|
792
|
+
async function Hs({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
|
|
793
793
|
await r.sendMessage({ author: "bot", type: "text", text: he(e.data.question, { submissions: n, context: s }) });
|
|
794
794
|
let a = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
|
|
795
795
|
if (a === null)
|
|
@@ -799,12 +799,12 @@ async function zs({ node: e, chat: r, next: t, submissions: n, context: s, t: i
|
|
|
799
799
|
await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
|
|
800
800
|
return t(e.nextId);
|
|
801
801
|
}
|
|
802
|
-
async function
|
|
802
|
+
async function Ks({ chat: e, end: r, node: t }) {
|
|
803
803
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
804
804
|
}
|
|
805
|
-
async function
|
|
805
|
+
async function Gs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: c }) {
|
|
806
806
|
let f = Fn(r.nodes, t || {}), { answers: v, ...b } = f;
|
|
807
|
-
if (n.setSubmission(e.data.key, { type: "integration", value: b }),
|
|
807
|
+
if (n.setSubmission(e.data.key, { type: "integration", value: b }), xs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Pr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
|
|
808
808
|
let p = [f.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : f.hasHardConcerns ? e.data.messages.hard : f.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
|
|
809
809
|
for (let y of ["hard", "advisory"]) {
|
|
810
810
|
let C = v.filter((_) => !_.matched && _.severity === y);
|
|
@@ -814,7 +814,7 @@ async function Ks({ node: e, flow: r, submissions: t, chat: n, next: s, apiClien
|
|
|
814
814
|
}
|
|
815
815
|
await n.sendMessage({ type: "text", author: "bot", text: p.join(`
|
|
816
816
|
|
|
817
|
-
`) }), f.hasHardConcerns && e.data.alternativeLink && await n.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await n.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context:
|
|
817
|
+
`) }), f.hasHardConcerns && e.data.alternativeLink && await n.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await n.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context: c }) } });
|
|
818
818
|
}
|
|
819
819
|
return s(e.nextId);
|
|
820
820
|
}
|
|
@@ -832,7 +832,7 @@ const dr = (e, r, t) => {
|
|
|
832
832
|
},
|
|
833
833
|
customProperties: (n = r.analytics) == null ? void 0 : n.customProperties
|
|
834
834
|
});
|
|
835
|
-
}, jt = "resume-prompt",
|
|
835
|
+
}, jt = "resume-prompt", Js = async ({
|
|
836
836
|
chatService: e,
|
|
837
837
|
t: r,
|
|
838
838
|
signal: t
|
|
@@ -868,11 +868,11 @@ const dr = (e, r, t) => {
|
|
|
868
868
|
const {
|
|
869
869
|
t
|
|
870
870
|
} = ne();
|
|
871
|
-
return
|
|
871
|
+
return u("button", {
|
|
872
872
|
class: Qe("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
873
873
|
type: "submit",
|
|
874
874
|
...r,
|
|
875
|
-
children:
|
|
875
|
+
children: u("svg", {
|
|
876
876
|
class: "block",
|
|
877
877
|
width: "16",
|
|
878
878
|
height: "16",
|
|
@@ -881,39 +881,39 @@ const dr = (e, r, t) => {
|
|
|
881
881
|
stroke: "currentColor",
|
|
882
882
|
"stroke-linecap": "round",
|
|
883
883
|
"stroke-width": "2",
|
|
884
|
-
children: [
|
|
884
|
+
children: [u("title", {
|
|
885
885
|
children: t("send")
|
|
886
|
-
}),
|
|
886
|
+
}), u("path", {
|
|
887
887
|
d: "M3.5 7.5L8 3L12.5 7.5"
|
|
888
|
-
}),
|
|
888
|
+
}), u("path", {
|
|
889
889
|
d: "M8 4V13"
|
|
890
890
|
})]
|
|
891
891
|
})
|
|
892
892
|
});
|
|
893
893
|
};
|
|
894
|
-
var
|
|
894
|
+
var xe;
|
|
895
895
|
// @__NO_SIDE_EFFECTS__
|
|
896
896
|
function wt(e) {
|
|
897
897
|
return {
|
|
898
|
-
lang: (e == null ? void 0 : e.lang) ?? (
|
|
898
|
+
lang: (e == null ? void 0 : e.lang) ?? (xe == null ? void 0 : xe.lang),
|
|
899
899
|
message: e == null ? void 0 : e.message,
|
|
900
|
-
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (
|
|
901
|
-
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (
|
|
900
|
+
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (xe == null ? void 0 : xe.abortEarly),
|
|
901
|
+
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (xe == null ? void 0 : xe.abortPipeEarly)
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
904
|
var Mt;
|
|
905
905
|
// @__NO_SIDE_EFFECTS__
|
|
906
|
-
function
|
|
906
|
+
function Zs(e) {
|
|
907
907
|
return Mt == null ? void 0 : Mt.get(e);
|
|
908
908
|
}
|
|
909
909
|
var Lt;
|
|
910
910
|
// @__NO_SIDE_EFFECTS__
|
|
911
|
-
function
|
|
911
|
+
function Xs(e) {
|
|
912
912
|
return Lt == null ? void 0 : Lt.get(e);
|
|
913
913
|
}
|
|
914
914
|
var Nt;
|
|
915
915
|
// @__NO_SIDE_EFFECTS__
|
|
916
|
-
function
|
|
916
|
+
function Ys(e, r) {
|
|
917
917
|
var t;
|
|
918
918
|
return (t = Nt == null ? void 0 : Nt.get(e)) == null ? void 0 : t.get(r);
|
|
919
919
|
}
|
|
@@ -924,7 +924,7 @@ function Xe(e) {
|
|
|
924
924
|
return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((n = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : n.name)) ?? "null" : r;
|
|
925
925
|
}
|
|
926
926
|
function re(e, r, t, n, s) {
|
|
927
|
-
const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */ Xe(i),
|
|
927
|
+
const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */ Xe(i), c = {
|
|
928
928
|
kind: e.kind,
|
|
929
929
|
type: e.type,
|
|
930
930
|
input: i,
|
|
@@ -937,14 +937,14 @@ function re(e, r, t, n, s) {
|
|
|
937
937
|
lang: n.lang,
|
|
938
938
|
abortEarly: n.abortEarly,
|
|
939
939
|
abortPipeEarly: n.abortPipeEarly
|
|
940
|
-
}, f = e.kind === "schema", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */
|
|
941
|
-
v !== void 0 && (
|
|
940
|
+
}, f = e.kind === "schema", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Ys(e.reference, c.lang) ?? (f ? /* @__PURE__ */ Xs(c.lang) : null) ?? n.message ?? /* @__PURE__ */ Zs(c.lang);
|
|
941
|
+
v !== void 0 && (c.message = typeof v == "function" ? (
|
|
942
942
|
// @ts-expect-error
|
|
943
|
-
v(
|
|
944
|
-
) : v), f && (t.typed = !1), t.issues ? t.issues.push(
|
|
943
|
+
v(c)
|
|
944
|
+
) : v), f && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
|
|
945
945
|
}
|
|
946
946
|
// @__NO_SIDE_EFFECTS__
|
|
947
|
-
function
|
|
947
|
+
function ge(e) {
|
|
948
948
|
return {
|
|
949
949
|
version: 1,
|
|
950
950
|
vendor: "valibot",
|
|
@@ -954,16 +954,16 @@ function be(e) {
|
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
956
|
// @__NO_SIDE_EFFECTS__
|
|
957
|
-
function
|
|
957
|
+
function Qs(e, r) {
|
|
958
958
|
return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
959
959
|
}
|
|
960
960
|
// @__NO_SIDE_EFFECTS__
|
|
961
|
-
function
|
|
961
|
+
function ea(e, r) {
|
|
962
962
|
const t = [...new Set(e)];
|
|
963
963
|
return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
|
|
964
964
|
}
|
|
965
965
|
// @__NO_SIDE_EFFECTS__
|
|
966
|
-
function
|
|
966
|
+
function ta(e) {
|
|
967
967
|
if (e.path) {
|
|
968
968
|
let r = "";
|
|
969
969
|
for (const t of e.path)
|
|
@@ -975,7 +975,7 @@ function ea(e) {
|
|
|
975
975
|
}
|
|
976
976
|
return null;
|
|
977
977
|
}
|
|
978
|
-
var
|
|
978
|
+
var ra = class extends Error {
|
|
979
979
|
/**
|
|
980
980
|
* Creates a Valibot error with useful information.
|
|
981
981
|
*
|
|
@@ -984,7 +984,7 @@ var ta = class extends Error {
|
|
|
984
984
|
constructor(e) {
|
|
985
985
|
super(e[0].message), this.name = "ValiError", this.issues = e;
|
|
986
986
|
}
|
|
987
|
-
},
|
|
987
|
+
}, na = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
|
|
988
988
|
// @__NO_SIDE_EFFECTS__
|
|
989
989
|
function Xr(e, r) {
|
|
990
990
|
return {
|
|
@@ -1008,7 +1008,7 @@ function Yr(e) {
|
|
|
1008
1008
|
reference: Yr,
|
|
1009
1009
|
expects: null,
|
|
1010
1010
|
async: !1,
|
|
1011
|
-
requirement:
|
|
1011
|
+
requirement: na,
|
|
1012
1012
|
message: e,
|
|
1013
1013
|
"~run"(r, t) {
|
|
1014
1014
|
return r.typed && !this.requirement.test(r.value) && re(this, "email", r, t), r;
|
|
@@ -1016,11 +1016,11 @@ function Yr(e) {
|
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
1018
|
// @__NO_SIDE_EFFECTS__
|
|
1019
|
-
function
|
|
1019
|
+
function ut(e, r) {
|
|
1020
1020
|
return {
|
|
1021
1021
|
kind: "validation",
|
|
1022
1022
|
type: "max_length",
|
|
1023
|
-
reference:
|
|
1023
|
+
reference: ut,
|
|
1024
1024
|
async: !1,
|
|
1025
1025
|
expects: `<=${e}`,
|
|
1026
1026
|
requirement: e,
|
|
@@ -1133,7 +1133,7 @@ function tn(e) {
|
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
1135
|
// @__NO_SIDE_EFFECTS__
|
|
1136
|
-
function
|
|
1136
|
+
function sa(e, r, t) {
|
|
1137
1137
|
return typeof e.fallback == "function" ? (
|
|
1138
1138
|
// @ts-expect-error
|
|
1139
1139
|
e.fallback(r, t)
|
|
@@ -1163,7 +1163,7 @@ function nn(e, r) {
|
|
|
1163
1163
|
item: e,
|
|
1164
1164
|
message: r,
|
|
1165
1165
|
get "~standard"() {
|
|
1166
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ ge(this);
|
|
1167
1167
|
},
|
|
1168
1168
|
"~run"(t, n) {
|
|
1169
1169
|
var i;
|
|
@@ -1171,8 +1171,8 @@ function nn(e, r) {
|
|
|
1171
1171
|
if (Array.isArray(s)) {
|
|
1172
1172
|
t.typed = !0, t.value = [];
|
|
1173
1173
|
for (let a = 0; a < s.length; a++) {
|
|
1174
|
-
const o = s[a],
|
|
1175
|
-
if (
|
|
1174
|
+
const o = s[a], c = this.item["~run"]({ value: o }, n);
|
|
1175
|
+
if (c.issues) {
|
|
1176
1176
|
const f = {
|
|
1177
1177
|
type: "array",
|
|
1178
1178
|
origin: "value",
|
|
@@ -1180,14 +1180,14 @@ function nn(e, r) {
|
|
|
1180
1180
|
key: a,
|
|
1181
1181
|
value: o
|
|
1182
1182
|
};
|
|
1183
|
-
for (const v of
|
|
1183
|
+
for (const v of c.issues)
|
|
1184
1184
|
v.path ? v.path.unshift(f) : v.path = [f], (i = t.issues) == null || i.push(v);
|
|
1185
|
-
if (t.issues || (t.issues =
|
|
1185
|
+
if (t.issues || (t.issues = c.issues), n.abortEarly) {
|
|
1186
1186
|
t.typed = !1;
|
|
1187
1187
|
break;
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
|
|
1190
|
+
c.typed || (t.typed = !1), t.value.push(c.value);
|
|
1191
1191
|
}
|
|
1192
1192
|
} else
|
|
1193
1193
|
re(this, "type", t, n);
|
|
@@ -1205,7 +1205,7 @@ function sn(e) {
|
|
|
1205
1205
|
async: !1,
|
|
1206
1206
|
message: e,
|
|
1207
1207
|
get "~standard"() {
|
|
1208
|
-
return /* @__PURE__ */
|
|
1208
|
+
return /* @__PURE__ */ ge(this);
|
|
1209
1209
|
},
|
|
1210
1210
|
"~run"(r, t) {
|
|
1211
1211
|
return typeof r.value == "boolean" ? r.typed = !0 : re(this, "type", r, t), r;
|
|
@@ -1222,7 +1222,7 @@ function an(e) {
|
|
|
1222
1222
|
async: !1,
|
|
1223
1223
|
message: e,
|
|
1224
1224
|
get "~standard"() {
|
|
1225
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ ge(this);
|
|
1226
1226
|
},
|
|
1227
1227
|
"~run"(r, t) {
|
|
1228
1228
|
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : re(this, "type", r, t), r;
|
|
@@ -1230,17 +1230,17 @@ function an(e) {
|
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
1232
|
// @__NO_SIDE_EFFECTS__
|
|
1233
|
-
function
|
|
1233
|
+
function Ce(e, r) {
|
|
1234
1234
|
return {
|
|
1235
1235
|
kind: "schema",
|
|
1236
1236
|
type: "object",
|
|
1237
|
-
reference:
|
|
1237
|
+
reference: Ce,
|
|
1238
1238
|
expects: "Object",
|
|
1239
1239
|
async: !1,
|
|
1240
1240
|
entries: e,
|
|
1241
1241
|
message: r,
|
|
1242
1242
|
get "~standard"() {
|
|
1243
|
-
return /* @__PURE__ */
|
|
1243
|
+
return /* @__PURE__ */ ge(this);
|
|
1244
1244
|
},
|
|
1245
1245
|
"~run"(t, n) {
|
|
1246
1246
|
var i;
|
|
@@ -1251,17 +1251,17 @@ function ke(e, r) {
|
|
|
1251
1251
|
const o = this.entries[a];
|
|
1252
1252
|
if (a in s || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
|
|
1253
1253
|
o.default !== void 0) {
|
|
1254
|
-
const
|
|
1254
|
+
const c = a in s ? (
|
|
1255
1255
|
// @ts-expect-error
|
|
1256
1256
|
s[a]
|
|
1257
|
-
) : /* @__PURE__ */ rn(o), f = o["~run"]({ value:
|
|
1257
|
+
) : /* @__PURE__ */ rn(o), f = o["~run"]({ value: c }, n);
|
|
1258
1258
|
if (f.issues) {
|
|
1259
1259
|
const v = {
|
|
1260
1260
|
type: "object",
|
|
1261
1261
|
origin: "value",
|
|
1262
1262
|
input: s,
|
|
1263
1263
|
key: a,
|
|
1264
|
-
value:
|
|
1264
|
+
value: c
|
|
1265
1265
|
};
|
|
1266
1266
|
for (const b of f.issues)
|
|
1267
1267
|
b.path ? b.path.unshift(v) : b.path = [v], (i = t.issues) == null || i.push(b);
|
|
@@ -1272,7 +1272,7 @@ function ke(e, r) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
f.typed || (t.typed = !1), t.value[a] = f.value;
|
|
1274
1274
|
} else if (o.fallback !== void 0)
|
|
1275
|
-
t.value[a] = /* @__PURE__ */
|
|
1275
|
+
t.value[a] = /* @__PURE__ */ sa(o);
|
|
1276
1276
|
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (re(this, "key", t, n, {
|
|
1277
1277
|
input: void 0,
|
|
1278
1278
|
expected: `"${a}"`,
|
|
@@ -1306,7 +1306,7 @@ function Je(e, r) {
|
|
|
1306
1306
|
wrapped: e,
|
|
1307
1307
|
default: r,
|
|
1308
1308
|
get "~standard"() {
|
|
1309
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ ge(this);
|
|
1310
1310
|
},
|
|
1311
1311
|
"~run"(t, n) {
|
|
1312
1312
|
return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ rn(this, t, n)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
|
|
@@ -1319,12 +1319,12 @@ function on(e, r) {
|
|
|
1319
1319
|
kind: "schema",
|
|
1320
1320
|
type: "picklist",
|
|
1321
1321
|
reference: on,
|
|
1322
|
-
expects: /* @__PURE__ */
|
|
1322
|
+
expects: /* @__PURE__ */ ea(e.map(Xe), "|"),
|
|
1323
1323
|
async: !1,
|
|
1324
1324
|
options: e,
|
|
1325
1325
|
message: r,
|
|
1326
1326
|
get "~standard"() {
|
|
1327
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ ge(this);
|
|
1328
1328
|
},
|
|
1329
1329
|
"~run"(t, n) {
|
|
1330
1330
|
return this.options.includes(t.value) ? t.typed = !0 : re(this, "type", t, n), t;
|
|
@@ -1343,22 +1343,22 @@ function ln(e, r, t) {
|
|
|
1343
1343
|
value: r,
|
|
1344
1344
|
message: t,
|
|
1345
1345
|
get "~standard"() {
|
|
1346
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ ge(this);
|
|
1347
1347
|
},
|
|
1348
1348
|
"~run"(n, s) {
|
|
1349
1349
|
var a, o;
|
|
1350
1350
|
const i = n.value;
|
|
1351
1351
|
if (i && typeof i == "object") {
|
|
1352
1352
|
n.typed = !0, n.value = {};
|
|
1353
|
-
for (const
|
|
1354
|
-
if (/* @__PURE__ */
|
|
1355
|
-
const f = i[
|
|
1353
|
+
for (const c in i)
|
|
1354
|
+
if (/* @__PURE__ */ Qs(i, c)) {
|
|
1355
|
+
const f = i[c], v = this.key["~run"]({ value: c }, s);
|
|
1356
1356
|
if (v.issues) {
|
|
1357
1357
|
const p = {
|
|
1358
1358
|
type: "object",
|
|
1359
1359
|
origin: "key",
|
|
1360
1360
|
input: i,
|
|
1361
|
-
key:
|
|
1361
|
+
key: c,
|
|
1362
1362
|
value: f
|
|
1363
1363
|
};
|
|
1364
1364
|
for (const y of v.issues)
|
|
@@ -1377,7 +1377,7 @@ function ln(e, r, t) {
|
|
|
1377
1377
|
type: "object",
|
|
1378
1378
|
origin: "value",
|
|
1379
1379
|
input: i,
|
|
1380
|
-
key:
|
|
1380
|
+
key: c,
|
|
1381
1381
|
value: f
|
|
1382
1382
|
};
|
|
1383
1383
|
for (const y of b.issues)
|
|
@@ -1405,21 +1405,21 @@ function le(e) {
|
|
|
1405
1405
|
async: !1,
|
|
1406
1406
|
message: e,
|
|
1407
1407
|
get "~standard"() {
|
|
1408
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ ge(this);
|
|
1409
1409
|
},
|
|
1410
1410
|
"~run"(r, t) {
|
|
1411
1411
|
return typeof r.value == "string" ? r.typed = !0 : re(this, "type", r, t), r;
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function aa(e, r, t) {
|
|
1416
1416
|
const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1417
1417
|
if (n.issues)
|
|
1418
|
-
throw new
|
|
1418
|
+
throw new ra(n.issues);
|
|
1419
1419
|
return n.value;
|
|
1420
1420
|
}
|
|
1421
1421
|
// @__NO_SIDE_EFFECTS__
|
|
1422
|
-
function
|
|
1422
|
+
function ia(e, r) {
|
|
1423
1423
|
const t = {};
|
|
1424
1424
|
for (const n in e.entries)
|
|
1425
1425
|
t[n] = !r || r.includes(n) ? /* @__PURE__ */ Je(e.entries[n]) : e.entries[n];
|
|
@@ -1427,17 +1427,17 @@ function aa(e, r) {
|
|
|
1427
1427
|
...e,
|
|
1428
1428
|
entries: t,
|
|
1429
1429
|
get "~standard"() {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ ge(this);
|
|
1431
1431
|
}
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
// @__NO_SIDE_EFFECTS__
|
|
1435
|
-
function
|
|
1435
|
+
function Me(...e) {
|
|
1436
1436
|
return {
|
|
1437
1437
|
...e[0],
|
|
1438
1438
|
pipe: e,
|
|
1439
1439
|
get "~standard"() {
|
|
1440
|
-
return /* @__PURE__ */
|
|
1440
|
+
return /* @__PURE__ */ ge(this);
|
|
1441
1441
|
},
|
|
1442
1442
|
"~run"(r, t) {
|
|
1443
1443
|
for (const n of e)
|
|
@@ -1453,7 +1453,7 @@ function Ve(...e) {
|
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
1455
|
// @__NO_SIDE_EFFECTS__
|
|
1456
|
-
function
|
|
1456
|
+
function oa(e, r, t) {
|
|
1457
1457
|
const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1458
1458
|
return {
|
|
1459
1459
|
typed: n.typed,
|
|
@@ -1463,7 +1463,7 @@ function ia(e, r, t) {
|
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
1465
|
// @__NO_SIDE_EFFECTS__
|
|
1466
|
-
async function
|
|
1466
|
+
async function la(e, r, t) {
|
|
1467
1467
|
const n = await e["~run"](
|
|
1468
1468
|
{ value: r },
|
|
1469
1469
|
/* @__PURE__ */ wt(t)
|
|
@@ -1477,49 +1477,49 @@ async function oa(e, r, t) {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
const tt = ({
|
|
1479
1479
|
error: e
|
|
1480
|
-
}) => !e || !e.message ? null :
|
|
1480
|
+
}) => !e || !e.message ? null : u("div", {
|
|
1481
1481
|
role: "alert",
|
|
1482
1482
|
class: "text-error-11 flex max-w-full items-start gap-1 overflow-hidden rounded-2xl px-2 py-2",
|
|
1483
|
-
children: [
|
|
1483
|
+
children: [u("svg", {
|
|
1484
1484
|
class: "text-error-9 mt-0.5 h-4 w-4 shrink-0",
|
|
1485
1485
|
viewBox: "0 0 16 16",
|
|
1486
1486
|
fill: "none",
|
|
1487
1487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1488
|
-
children: [
|
|
1488
|
+
children: [u("circle", {
|
|
1489
1489
|
cx: "8",
|
|
1490
1490
|
cy: "8",
|
|
1491
1491
|
r: "6.3",
|
|
1492
1492
|
stroke: "currentColor",
|
|
1493
1493
|
"stroke-width": "1.4"
|
|
1494
|
-
}),
|
|
1494
|
+
}), u("rect", {
|
|
1495
1495
|
x: "7",
|
|
1496
1496
|
y: "4",
|
|
1497
1497
|
width: "2",
|
|
1498
1498
|
height: "5",
|
|
1499
1499
|
fill: "currentColor"
|
|
1500
|
-
}),
|
|
1500
|
+
}), u("rect", {
|
|
1501
1501
|
x: "7",
|
|
1502
1502
|
y: "10",
|
|
1503
1503
|
width: "2",
|
|
1504
1504
|
height: "2",
|
|
1505
1505
|
fill: "currentColor"
|
|
1506
1506
|
})]
|
|
1507
|
-
}),
|
|
1507
|
+
}), u("p", {
|
|
1508
1508
|
class: "break-words pr-1 text-sm",
|
|
1509
1509
|
children: e.message
|
|
1510
1510
|
})]
|
|
1511
|
-
}),
|
|
1511
|
+
}), Se = ({
|
|
1512
1512
|
class: e,
|
|
1513
1513
|
...r
|
|
1514
1514
|
}) => {
|
|
1515
1515
|
const {
|
|
1516
1516
|
t
|
|
1517
1517
|
} = ne();
|
|
1518
|
-
return
|
|
1518
|
+
return u("button", {
|
|
1519
1519
|
type: "button",
|
|
1520
1520
|
class: Qe("fr touch-hitbox text-neutral-11 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all", e),
|
|
1521
1521
|
...r,
|
|
1522
|
-
children: [
|
|
1522
|
+
children: [u("svg", {
|
|
1523
1523
|
"aria-hidden": !0,
|
|
1524
1524
|
class: "block",
|
|
1525
1525
|
width: "16",
|
|
@@ -1529,17 +1529,22 @@ const tt = ({
|
|
|
1529
1529
|
stroke: "currentColor",
|
|
1530
1530
|
"stroke-linecap": "round",
|
|
1531
1531
|
"stroke-width": "1.5",
|
|
1532
|
-
children: [
|
|
1532
|
+
children: [u("title", {
|
|
1533
1533
|
children: t("skip")
|
|
1534
|
-
}),
|
|
1534
|
+
}), u("path", {
|
|
1535
1535
|
d: "M3.25 11.25A5 5 0 0 1 12 7"
|
|
1536
|
-
}),
|
|
1536
|
+
}), u("path", {
|
|
1537
1537
|
d: "M13.25 4.5V8.25H9.5"
|
|
1538
1538
|
})]
|
|
1539
1539
|
}), t("skip")]
|
|
1540
1540
|
});
|
|
1541
1541
|
};
|
|
1542
|
-
var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" }
|
|
1542
|
+
var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" }, ua = (e) => {
|
|
1543
|
+
if (e === "")
|
|
1544
|
+
return { countryCode: "", phoneNumber: "" };
|
|
1545
|
+
let r = Object.values(Gt).find((n) => e.startsWith(n)) ?? "", t = e.replace(r, "");
|
|
1546
|
+
return /^\d+$/.test(t) ? { countryCode: r, phoneNumber: t } : { countryCode: "", phoneNumber: "" };
|
|
1547
|
+
};
|
|
1543
1548
|
const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
|
|
1544
1549
|
variants: {
|
|
1545
1550
|
optional: {
|
|
@@ -1550,28 +1555,28 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1550
1555
|
defaultVariants: {
|
|
1551
1556
|
optional: !1
|
|
1552
1557
|
}
|
|
1553
|
-
}),
|
|
1558
|
+
}), ca = "https://api.mapbox.com/search/searchbox/v1/suggest", da = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", fa = (e) => atob(e).split("").reverse().join(""), we = /* @__PURE__ */ Ce({
|
|
1554
1559
|
name: /* @__PURE__ */ le()
|
|
1555
|
-
}),
|
|
1556
|
-
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */
|
|
1560
|
+
}), ha = /* @__PURE__ */ Ce({
|
|
1561
|
+
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ Ce({
|
|
1557
1562
|
feature_type: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1558
1563
|
full_address: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1559
1564
|
place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1560
1565
|
name: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1561
1566
|
mapbox_id: /* @__PURE__ */ le(),
|
|
1562
|
-
context: /* @__PURE__ */
|
|
1563
|
-
address:
|
|
1564
|
-
street:
|
|
1565
|
-
neighborhood:
|
|
1566
|
-
locality:
|
|
1567
|
-
district:
|
|
1568
|
-
place:
|
|
1569
|
-
region:
|
|
1570
|
-
postcode:
|
|
1571
|
-
country:
|
|
1567
|
+
context: /* @__PURE__ */ ia(/* @__PURE__ */ Ce({
|
|
1568
|
+
address: we,
|
|
1569
|
+
street: we,
|
|
1570
|
+
neighborhood: we,
|
|
1571
|
+
locality: we,
|
|
1572
|
+
district: we,
|
|
1573
|
+
place: we,
|
|
1574
|
+
region: we,
|
|
1575
|
+
postcode: we,
|
|
1576
|
+
country: we
|
|
1572
1577
|
}))
|
|
1573
1578
|
}))
|
|
1574
|
-
}),
|
|
1579
|
+
}), pa = ({
|
|
1575
1580
|
logger: e,
|
|
1576
1581
|
t: r
|
|
1577
1582
|
}) => Un(() => {
|
|
@@ -1581,17 +1586,17 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1581
1586
|
enabled: !0,
|
|
1582
1587
|
getPredictions: async (s) => {
|
|
1583
1588
|
var b;
|
|
1584
|
-
const i = new URL(
|
|
1589
|
+
const i = new URL(ca);
|
|
1585
1590
|
i.searchParams.set("q", s), i.searchParams.set("session_token", t);
|
|
1586
1591
|
const a = (b = q.current$.peek().flow) == null ? void 0 : b.locationOrigin;
|
|
1587
|
-
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token",
|
|
1588
|
-
const
|
|
1589
|
-
if (!
|
|
1590
|
-
return e.error("Failed to get address details",
|
|
1592
|
+
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", fa(da));
|
|
1593
|
+
const c = await fetch(i);
|
|
1594
|
+
if (!c.ok)
|
|
1595
|
+
return e.error("Failed to get address details", c), {
|
|
1591
1596
|
ok: !1,
|
|
1592
1597
|
error: r("address_error")
|
|
1593
1598
|
};
|
|
1594
|
-
const f = /* @__PURE__ */
|
|
1599
|
+
const f = /* @__PURE__ */ oa(ha, await c.json());
|
|
1595
1600
|
if (f.success === !1)
|
|
1596
1601
|
return e.error("Failed to parse address details", f.issues), {
|
|
1597
1602
|
ok: !1,
|
|
@@ -1628,11 +1633,11 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1628
1633
|
const {
|
|
1629
1634
|
t: r
|
|
1630
1635
|
} = ne();
|
|
1631
|
-
return
|
|
1636
|
+
return u("button", {
|
|
1632
1637
|
type: "button",
|
|
1633
1638
|
class: "touch-hitbox text-neutral-11 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",
|
|
1634
1639
|
...e,
|
|
1635
|
-
children: [
|
|
1640
|
+
children: [u("svg", {
|
|
1636
1641
|
width: "16",
|
|
1637
1642
|
height: "16",
|
|
1638
1643
|
viewBox: "0 0 16 16",
|
|
@@ -1640,27 +1645,27 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1640
1645
|
"stroke-width": "1.5",
|
|
1641
1646
|
fill: "none",
|
|
1642
1647
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1643
|
-
children:
|
|
1648
|
+
children: u("path", {
|
|
1644
1649
|
d: "M10 3L5 8L10 13"
|
|
1645
1650
|
})
|
|
1646
|
-
}),
|
|
1651
|
+
}), u("span", {
|
|
1647
1652
|
children: r("back")
|
|
1648
1653
|
})]
|
|
1649
1654
|
});
|
|
1650
|
-
},
|
|
1655
|
+
}, ma = ({
|
|
1651
1656
|
input: e,
|
|
1652
1657
|
onSubmitSuccess: r,
|
|
1653
1658
|
logger: t
|
|
1654
1659
|
}) => {
|
|
1655
1660
|
const {
|
|
1656
1661
|
t: n
|
|
1657
|
-
} = ne(), [s, i] =
|
|
1662
|
+
} = ne(), [s, i] = ke(), {
|
|
1658
1663
|
enabled: a,
|
|
1659
1664
|
getPredictions: o
|
|
1660
|
-
} =
|
|
1665
|
+
} = pa({
|
|
1661
1666
|
logger: t,
|
|
1662
1667
|
t: n
|
|
1663
|
-
}), [
|
|
1668
|
+
}), [c, f] = ke(a ? "query" : "manual"), [v, b] = ke(""), [p, y] = ke(), C = ye(), _ = ye(), k = (g) => {
|
|
1664
1669
|
var V;
|
|
1665
1670
|
if (Oe(a, "Query state should not be enabled"), g = g.trim(), g === ((V = C.current) == null ? void 0 : V.query) || g === (p == null ? void 0 : p.query) && p.status === "done")
|
|
1666
1671
|
return;
|
|
@@ -1697,9 +1702,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1697
1702
|
[g]: N
|
|
1698
1703
|
}));
|
|
1699
1704
|
};
|
|
1700
|
-
switch (
|
|
1705
|
+
switch (c) {
|
|
1701
1706
|
case "query":
|
|
1702
|
-
return Oe(a, "Query state should not be enabled"),
|
|
1707
|
+
return Oe(a, "Query state should not be enabled"), u(ya, {
|
|
1703
1708
|
input: e,
|
|
1704
1709
|
onSkip: () => r(null),
|
|
1705
1710
|
onAddressSelect: (g) => {
|
|
@@ -1715,38 +1720,38 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1715
1720
|
query: v
|
|
1716
1721
|
});
|
|
1717
1722
|
case "details":
|
|
1718
|
-
return Oe(s !== void 0),
|
|
1723
|
+
return Oe(s !== void 0), u(hr, {
|
|
1719
1724
|
input: e,
|
|
1720
1725
|
logger: t,
|
|
1721
1726
|
onSubmitSuccess: r,
|
|
1722
1727
|
addressFields: s,
|
|
1723
1728
|
onFieldChange: E,
|
|
1724
|
-
actions:
|
|
1729
|
+
actions: u(fr, {
|
|
1725
1730
|
onClick: () => {
|
|
1726
1731
|
f("query");
|
|
1727
1732
|
}
|
|
1728
1733
|
})
|
|
1729
1734
|
});
|
|
1730
1735
|
case "manual":
|
|
1731
|
-
return
|
|
1736
|
+
return u(hr, {
|
|
1732
1737
|
logger: t,
|
|
1733
1738
|
input: e,
|
|
1734
1739
|
onSubmitSuccess: r,
|
|
1735
1740
|
addressFields: s ?? {},
|
|
1736
1741
|
onFieldChange: E,
|
|
1737
|
-
actions: a ?
|
|
1742
|
+
actions: a ? u(fr, {
|
|
1738
1743
|
onClick: () => {
|
|
1739
1744
|
f("query");
|
|
1740
1745
|
}
|
|
1741
1746
|
}) : e.config.optional ? (
|
|
1742
1747
|
// Without address search this is the only screen, so an optional question needs its own way past.
|
|
1743
|
-
|
|
1748
|
+
u(Se, {
|
|
1744
1749
|
onClick: () => r(null)
|
|
1745
1750
|
})
|
|
1746
1751
|
) : void 0
|
|
1747
1752
|
});
|
|
1748
1753
|
}
|
|
1749
|
-
},
|
|
1754
|
+
}, ya = ({
|
|
1750
1755
|
input: e,
|
|
1751
1756
|
onSkip: r,
|
|
1752
1757
|
lookup: t,
|
|
@@ -1757,20 +1762,20 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1757
1762
|
const {
|
|
1758
1763
|
t: a
|
|
1759
1764
|
} = ne(), o = ye(null);
|
|
1760
|
-
return
|
|
1765
|
+
return Le(() => {
|
|
1761
1766
|
o.current && (o.current.focus(), o.current.select());
|
|
1762
|
-
}, []),
|
|
1763
|
-
children: [
|
|
1767
|
+
}, []), u(be, {
|
|
1768
|
+
children: [u("form", {
|
|
1764
1769
|
noValidate: !0,
|
|
1765
|
-
onSubmit: (
|
|
1766
|
-
|
|
1767
|
-
const v = new FormData(
|
|
1770
|
+
onSubmit: (c) => {
|
|
1771
|
+
c.preventDefault();
|
|
1772
|
+
const v = new FormData(c.currentTarget).get("address");
|
|
1768
1773
|
typeof v == "string" && i(v);
|
|
1769
1774
|
},
|
|
1770
1775
|
class: "flex gap-2 p-2.5",
|
|
1771
|
-
children: [
|
|
1776
|
+
children: [u("div", {
|
|
1772
1777
|
class: "group relative flex-1",
|
|
1773
|
-
children: [
|
|
1778
|
+
children: [u("input", {
|
|
1774
1779
|
ref: o,
|
|
1775
1780
|
name: "address",
|
|
1776
1781
|
id: "chat-address",
|
|
@@ -1782,63 +1787,63 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1782
1787
|
optional: !!e.config.optional,
|
|
1783
1788
|
className: "w-full rounded-full"
|
|
1784
1789
|
})
|
|
1785
|
-
}),
|
|
1790
|
+
}), u("button", {
|
|
1786
1791
|
type: "submit",
|
|
1787
1792
|
class: "touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",
|
|
1788
|
-
children: [
|
|
1793
|
+
children: [u("svg", {
|
|
1789
1794
|
"aria-hidden": "true",
|
|
1790
1795
|
width: "16",
|
|
1791
1796
|
height: "16",
|
|
1792
1797
|
viewBox: "0 0 16 16",
|
|
1793
1798
|
fill: "none",
|
|
1794
1799
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1795
|
-
children:
|
|
1800
|
+
children: u("g", {
|
|
1796
1801
|
id: "inploi",
|
|
1797
1802
|
stroke: "currentColor",
|
|
1798
1803
|
"stroke-linecap": "round",
|
|
1799
1804
|
"stroke-linejoin": "round",
|
|
1800
1805
|
strokeWidth: "1.5",
|
|
1801
|
-
children: [
|
|
1806
|
+
children: [u("circle", {
|
|
1802
1807
|
cx: "7",
|
|
1803
1808
|
cy: "7",
|
|
1804
1809
|
r: "4"
|
|
1805
|
-
}),
|
|
1810
|
+
}), u("path", {
|
|
1806
1811
|
d: "M10 10L13 13"
|
|
1807
1812
|
})]
|
|
1808
1813
|
})
|
|
1809
|
-
}),
|
|
1814
|
+
}), u("span", {
|
|
1810
1815
|
class: "sr-only",
|
|
1811
1816
|
children: a("search")
|
|
1812
1817
|
})]
|
|
1813
1818
|
})]
|
|
1814
|
-
}), e.config.optional &&
|
|
1819
|
+
}), e.config.optional && u(Se, {
|
|
1815
1820
|
class: "relative",
|
|
1816
1821
|
onClick: r
|
|
1817
1822
|
})]
|
|
1818
|
-
}), (t == null ? void 0 : t.status) === "failed" ?
|
|
1823
|
+
}), (t == null ? void 0 : t.status) === "failed" ? u(tt, {
|
|
1819
1824
|
error: {
|
|
1820
1825
|
message: t.error
|
|
1821
1826
|
}
|
|
1822
|
-
}) : null,
|
|
1827
|
+
}) : null, u("p", {
|
|
1823
1828
|
role: "status",
|
|
1824
1829
|
class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-11 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
|
|
1825
|
-
children: (t == null ? void 0 : t.status) === "pending" ?
|
|
1826
|
-
children: [
|
|
1830
|
+
children: (t == null ? void 0 : t.status) === "pending" ? u(be, {
|
|
1831
|
+
children: [u(Ut, {
|
|
1827
1832
|
"aria-hidden": "true",
|
|
1828
1833
|
class: "h-4 w-4 shrink-0"
|
|
1829
1834
|
}), a("address_searching")]
|
|
1830
1835
|
}) : (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? a("address_no_results") : null
|
|
1831
|
-
}),
|
|
1832
|
-
children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((
|
|
1833
|
-
children:
|
|
1836
|
+
}), u("ul", {
|
|
1837
|
+
children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((c) => u("li", {
|
|
1838
|
+
children: u("button", {
|
|
1834
1839
|
class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
|
|
1835
1840
|
onClick: () => {
|
|
1836
|
-
n(
|
|
1841
|
+
n(c.id);
|
|
1837
1842
|
},
|
|
1838
|
-
children: [
|
|
1843
|
+
children: [u("span", {
|
|
1839
1844
|
class: "flex-grow",
|
|
1840
|
-
children:
|
|
1841
|
-
}),
|
|
1845
|
+
children: c.label
|
|
1846
|
+
}), u("svg", {
|
|
1842
1847
|
class: "flex-none",
|
|
1843
1848
|
width: "16",
|
|
1844
1849
|
height: "16",
|
|
@@ -1847,18 +1852,18 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1847
1852
|
"stroke-width": "1.5",
|
|
1848
1853
|
fill: "none",
|
|
1849
1854
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1850
|
-
children:
|
|
1855
|
+
children: u("path", {
|
|
1851
1856
|
d: "M6 3L11 8L6 13"
|
|
1852
1857
|
})
|
|
1853
1858
|
})]
|
|
1854
1859
|
})
|
|
1855
|
-
},
|
|
1856
|
-
children:
|
|
1860
|
+
}, c.id)), u("li", {
|
|
1861
|
+
children: u("button", {
|
|
1857
1862
|
class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
|
|
1858
1863
|
onClick: () => {
|
|
1859
1864
|
n("");
|
|
1860
1865
|
},
|
|
1861
|
-
children:
|
|
1866
|
+
children: u("span", {
|
|
1862
1867
|
class: "flex-grow",
|
|
1863
1868
|
children: a("address_manual")
|
|
1864
1869
|
})
|
|
@@ -1874,20 +1879,20 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1874
1879
|
input: s
|
|
1875
1880
|
}) => {
|
|
1876
1881
|
const i = ye(null);
|
|
1877
|
-
|
|
1882
|
+
Le(() => {
|
|
1878
1883
|
if (i.current) {
|
|
1879
|
-
const
|
|
1880
|
-
|
|
1884
|
+
const c = i.current.querySelector("input");
|
|
1885
|
+
c && (c.focus(), c.select());
|
|
1881
1886
|
}
|
|
1882
1887
|
}, []);
|
|
1883
1888
|
const a = Object.keys(Gt), {
|
|
1884
1889
|
t: o
|
|
1885
1890
|
} = ne();
|
|
1886
|
-
return
|
|
1891
|
+
return u("form", {
|
|
1887
1892
|
class: "flex flex-col px-2 pt-2",
|
|
1888
|
-
onSubmit: (
|
|
1889
|
-
|
|
1890
|
-
const f =
|
|
1893
|
+
onSubmit: (c) => {
|
|
1894
|
+
c.preventDefault();
|
|
1895
|
+
const f = c.currentTarget, v = [...f.querySelectorAll("input")].filter((y) => y.value !== "" && !y.value.trim());
|
|
1891
1896
|
for (const y of v) {
|
|
1892
1897
|
y.value = "";
|
|
1893
1898
|
const C = Rt.find((_) => s.config.keys[_] === y.name);
|
|
@@ -1903,38 +1908,38 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1903
1908
|
value: p
|
|
1904
1909
|
});
|
|
1905
1910
|
},
|
|
1906
|
-
children: [
|
|
1911
|
+
children: [u("div", {
|
|
1907
1912
|
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]",
|
|
1908
1913
|
ref: i,
|
|
1909
|
-
children: Rt.map((
|
|
1910
|
-
const v = `isdk_${
|
|
1911
|
-
return b ?
|
|
1912
|
-
children: [
|
|
1914
|
+
children: Rt.map((c, f) => {
|
|
1915
|
+
const v = `isdk_${c}`, b = s.config.keys[c];
|
|
1916
|
+
return b ? u(be, {
|
|
1917
|
+
children: [u("label", {
|
|
1913
1918
|
for: v,
|
|
1914
1919
|
class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
1915
|
-
children: o(
|
|
1916
|
-
}),
|
|
1920
|
+
children: o(c)
|
|
1921
|
+
}), u("div", {
|
|
1917
1922
|
class: "flex flex-col items-stretch gap-1.5",
|
|
1918
|
-
children: [
|
|
1923
|
+
children: [c === "country" ? u("div", {
|
|
1919
1924
|
class: "relative",
|
|
1920
|
-
children: [
|
|
1925
|
+
children: [u("select", {
|
|
1921
1926
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
|
|
1922
1927
|
name: b,
|
|
1923
1928
|
id: v,
|
|
1924
|
-
defaultValue: e[
|
|
1925
|
-
onChange: (p) => r(
|
|
1929
|
+
defaultValue: e[c],
|
|
1930
|
+
onChange: (p) => r(c, p.currentTarget.value),
|
|
1926
1931
|
required: !0,
|
|
1927
|
-
children: [e.country && !a.includes(e.country) ?
|
|
1928
|
-
value: e[
|
|
1929
|
-
children: e[
|
|
1930
|
-
}) :
|
|
1932
|
+
children: [e.country && !a.includes(e.country) ? u("option", {
|
|
1933
|
+
value: e[c],
|
|
1934
|
+
children: e[c]
|
|
1935
|
+
}) : u("option", {
|
|
1931
1936
|
value: "",
|
|
1932
1937
|
children: o("select_country")
|
|
1933
|
-
}), a.map((p) =>
|
|
1938
|
+
}), a.map((p) => u("option", {
|
|
1934
1939
|
value: p,
|
|
1935
1940
|
children: p
|
|
1936
1941
|
}, p))]
|
|
1937
|
-
}),
|
|
1942
|
+
}), u("svg", {
|
|
1938
1943
|
class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
|
|
1939
1944
|
width: "16",
|
|
1940
1945
|
height: "16",
|
|
@@ -1945,29 +1950,29 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1945
1950
|
viewBox: "0 0 16 16",
|
|
1946
1951
|
fill: "none",
|
|
1947
1952
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1948
|
-
children:
|
|
1953
|
+
children: u("path", {
|
|
1949
1954
|
d: "M4 6.5L8 10.5L12 6.5"
|
|
1950
1955
|
})
|
|
1951
1956
|
})]
|
|
1952
|
-
}) :
|
|
1957
|
+
}) : u("input", {
|
|
1953
1958
|
autoFocus: f === 0 ? !0 : void 0,
|
|
1954
1959
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
|
|
1955
1960
|
name: b,
|
|
1956
1961
|
id: v,
|
|
1957
|
-
defaultValue: e[
|
|
1958
|
-
onInput: (p) => r(
|
|
1959
|
-
required:
|
|
1960
|
-
}), f === Rt.length - 1 ?
|
|
1962
|
+
defaultValue: e[c],
|
|
1963
|
+
onInput: (p) => r(c, p.currentTarget.value),
|
|
1964
|
+
required: c === "line2" ? s.config.line2Required === !0 : c !== "line3"
|
|
1965
|
+
}), f === Rt.length - 1 ? u("hr", {
|
|
1961
1966
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1962
|
-
}) :
|
|
1967
|
+
}) : u("hr", {
|
|
1963
1968
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
1964
1969
|
})]
|
|
1965
1970
|
})]
|
|
1966
1971
|
}) : null;
|
|
1967
1972
|
})
|
|
1968
|
-
}),
|
|
1973
|
+
}), u("div", {
|
|
1969
1974
|
class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
|
|
1970
|
-
children: [n,
|
|
1975
|
+
children: [n, u(Be, {
|
|
1971
1976
|
class: "ml-auto"
|
|
1972
1977
|
})]
|
|
1973
1978
|
})]
|
|
@@ -1978,65 +1983,58 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1978
1983
|
var r;
|
|
1979
1984
|
(r = e.current) == null || r.focus();
|
|
1980
1985
|
}, []), e;
|
|
1981
|
-
},
|
|
1986
|
+
}, un = ["true", "false"], ba = /* @__PURE__ */ on(un), ga = "answer", cn = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = zr(({
|
|
1982
1987
|
label: e,
|
|
1983
1988
|
...r
|
|
1984
|
-
}, t) =>
|
|
1989
|
+
}, t) => u("button", {
|
|
1985
1990
|
class: "bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2 py-2.5 ring-2 transition-all selection:bg-transparent",
|
|
1986
1991
|
...r,
|
|
1987
1992
|
ref: t,
|
|
1988
|
-
children:
|
|
1993
|
+
children: u("p", {
|
|
1989
1994
|
class: "text-center text-base",
|
|
1990
1995
|
children: e
|
|
1991
1996
|
})
|
|
1992
|
-
})),
|
|
1997
|
+
})), va = ({
|
|
1993
1998
|
input: e,
|
|
1994
1999
|
onSubmitSuccess: r
|
|
1995
2000
|
}) => {
|
|
1996
2001
|
const t = Jt();
|
|
1997
|
-
return
|
|
2002
|
+
return u("form", {
|
|
1998
2003
|
noValidate: !0,
|
|
1999
2004
|
class: "",
|
|
2000
2005
|
onSubmit: (n) => {
|
|
2001
2006
|
n.preventDefault();
|
|
2002
|
-
const s = Wn(n).value, i =
|
|
2007
|
+
const s = Wn(n).value, i = aa(ba, s);
|
|
2003
2008
|
r({
|
|
2004
2009
|
type: "boolean",
|
|
2005
2010
|
value: i === "true"
|
|
2006
2011
|
});
|
|
2007
2012
|
},
|
|
2008
|
-
children: [
|
|
2009
|
-
class:
|
|
2010
|
-
children:
|
|
2013
|
+
children: [u("ul", {
|
|
2014
|
+
class: cn,
|
|
2015
|
+
children: un.map((n, s) => u("li", {
|
|
2011
2016
|
class: dn,
|
|
2012
|
-
children:
|
|
2017
|
+
children: u(fn, {
|
|
2013
2018
|
ref: s === 0 ? t : null,
|
|
2014
2019
|
type: "submit",
|
|
2015
|
-
name:
|
|
2020
|
+
name: ga,
|
|
2016
2021
|
value: n,
|
|
2017
2022
|
label: e.config.labels[n]
|
|
2018
2023
|
}, n)
|
|
2019
2024
|
}))
|
|
2020
|
-
}), e.config.optional &&
|
|
2025
|
+
}), e.config.optional && u("div", {
|
|
2021
2026
|
class: "px-2 pb-2",
|
|
2022
|
-
children:
|
|
2027
|
+
children: u(Se, {
|
|
2023
2028
|
class: "relative w-full",
|
|
2024
2029
|
type: "button",
|
|
2025
2030
|
onClick: () => r(null)
|
|
2026
2031
|
})
|
|
2027
2032
|
})]
|
|
2028
2033
|
});
|
|
2029
|
-
},
|
|
2030
|
-
const n = new FileReader();
|
|
2031
|
-
n.onload = () => {
|
|
2032
|
-
if (typeof n.result != "string" || !n.result)
|
|
2033
|
-
return t(new Error("Invalid file"));
|
|
2034
|
-
r(n.result);
|
|
2035
|
-
}, n.onerror = t, n.readAsDataURL(e);
|
|
2036
|
-
}), pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), va = et("file"), mr = 3, _t = (e) => {
|
|
2034
|
+
}, pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), xa = et("file"), mr = 3, _t = (e) => {
|
|
2037
2035
|
const r = e.lastIndexOf(".");
|
|
2038
2036
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2039
|
-
},
|
|
2037
|
+
}, wa = ({
|
|
2040
2038
|
file: e,
|
|
2041
2039
|
class: r,
|
|
2042
2040
|
...t
|
|
@@ -2044,23 +2042,23 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2044
2042
|
const {
|
|
2045
2043
|
t: n
|
|
2046
2044
|
} = ne(), [s, i] = _t(e.name);
|
|
2047
|
-
return
|
|
2045
|
+
return u("div", {
|
|
2048
2046
|
class: Qe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
|
|
2049
2047
|
...t,
|
|
2050
|
-
children: [
|
|
2048
|
+
children: [u("p", {
|
|
2051
2049
|
class: "text-accent-12 flex flex-grow overflow-hidden",
|
|
2052
|
-
children: [
|
|
2050
|
+
children: [u("span", {
|
|
2053
2051
|
class: "sr-only",
|
|
2054
2052
|
children: [n("file_name"), ": "]
|
|
2055
|
-
}),
|
|
2053
|
+
}), u("span", {
|
|
2056
2054
|
class: "block truncate",
|
|
2057
2055
|
children: s
|
|
2058
|
-
}),
|
|
2056
|
+
}), u("span", {
|
|
2059
2057
|
children: i
|
|
2060
2058
|
})]
|
|
2061
|
-
}),
|
|
2059
|
+
}), u("p", {
|
|
2062
2060
|
class: "text-accent-11",
|
|
2063
|
-
children: [
|
|
2061
|
+
children: [u("span", {
|
|
2064
2062
|
class: "sr-only",
|
|
2065
2063
|
children: [n("file_size"), ": "]
|
|
2066
2064
|
}), Ge(e.sizeKb)]
|
|
@@ -2069,30 +2067,30 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2069
2067
|
}, yr = ({
|
|
2070
2068
|
class: e,
|
|
2071
2069
|
...r
|
|
2072
|
-
}) =>
|
|
2070
|
+
}) => u("li", {
|
|
2073
2071
|
class: Qe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2074
2072
|
...r
|
|
2075
|
-
}),
|
|
2073
|
+
}), _a = (e, r) => {
|
|
2076
2074
|
const [t, n] = _t(e);
|
|
2077
2075
|
return `${t.slice(0, r)}${n}`;
|
|
2078
2076
|
}, br = (e) => ({
|
|
2079
|
-
name:
|
|
2077
|
+
name: _a(e.name, 42),
|
|
2080
2078
|
sizeKb: e.size / 1e3
|
|
2081
|
-
}),
|
|
2082
|
-
const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...
|
|
2079
|
+
}), ka = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], Ca = (e, r, t) => {
|
|
2080
|
+
const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...ka], i = n === "" ? "none" : s.includes(n) ? n : "other";
|
|
2083
2081
|
return `chatbot-file-refused:${e}:${i}`;
|
|
2084
|
-
},
|
|
2082
|
+
}, Sa = ({
|
|
2085
2083
|
input: e,
|
|
2086
2084
|
onSubmitSuccess: r,
|
|
2087
2085
|
analytics: t
|
|
2088
2086
|
}) => {
|
|
2089
2087
|
var k;
|
|
2090
|
-
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] =
|
|
2088
|
+
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = ke(xa(n) && n.value.length ? {
|
|
2091
2089
|
status: "ready",
|
|
2092
2090
|
files: n.value
|
|
2093
2091
|
} : {
|
|
2094
2092
|
status: "empty"
|
|
2095
|
-
}), a = ye(0), o = s.status === "ready" ? s.files : [],
|
|
2093
|
+
}), a = ye(0), o = s.status === "ready" ? s.files : [], c = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, v = c.length - mr, b = pr(c), p = Jt(), {
|
|
2096
2094
|
t: y
|
|
2097
2095
|
} = ne(), C = (E) => {
|
|
2098
2096
|
if (!E.length)
|
|
@@ -2148,12 +2146,12 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2148
2146
|
return t.log({
|
|
2149
2147
|
event: "INTERACTION",
|
|
2150
2148
|
properties: {
|
|
2151
|
-
tag:
|
|
2149
|
+
tag: Ca(E, g, e.config.extensions)
|
|
2152
2150
|
},
|
|
2153
2151
|
customProperties: (V = (N = q.current$.peek().flow) == null ? void 0 : N.analytics) == null ? void 0 : V.customProperties
|
|
2154
2152
|
});
|
|
2155
2153
|
};
|
|
2156
|
-
return
|
|
2154
|
+
return u("form", {
|
|
2157
2155
|
class: "flex flex-col gap-1 p-2.5",
|
|
2158
2156
|
onSubmit: (E) => {
|
|
2159
2157
|
if (E.preventDefault(), s.status === "pending" || s.status === "error")
|
|
@@ -2167,94 +2165,94 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2167
2165
|
value: o
|
|
2168
2166
|
});
|
|
2169
2167
|
},
|
|
2170
|
-
children: [
|
|
2168
|
+
children: [u("div", {
|
|
2171
2169
|
class: "flex items-center gap-2",
|
|
2172
|
-
children: [
|
|
2170
|
+
children: [u("label", {
|
|
2173
2171
|
ref: p,
|
|
2174
2172
|
for: "dropzone-file",
|
|
2175
2173
|
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",
|
|
2176
|
-
children: [
|
|
2174
|
+
children: [c.length > 0 ? u("ul", {
|
|
2177
2175
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2178
|
-
children: [
|
|
2176
|
+
children: [c.slice(0, mr).map((E) => {
|
|
2179
2177
|
const [g, N] = _t(E.name);
|
|
2180
|
-
return
|
|
2178
|
+
return u(yr, {
|
|
2181
2179
|
class: "flex overflow-hidden",
|
|
2182
|
-
children: [
|
|
2180
|
+
children: [u("span", {
|
|
2183
2181
|
class: "block truncate",
|
|
2184
2182
|
children: g
|
|
2185
|
-
}),
|
|
2183
|
+
}), u("span", {
|
|
2186
2184
|
children: N
|
|
2187
2185
|
})]
|
|
2188
2186
|
});
|
|
2189
|
-
}), v > 0 ?
|
|
2187
|
+
}), v > 0 ? u(yr, {
|
|
2190
2188
|
children: y("file_more", {
|
|
2191
2189
|
count: v
|
|
2192
2190
|
})
|
|
2193
2191
|
}) : null]
|
|
2194
|
-
}) :
|
|
2192
|
+
}) : u("div", {
|
|
2195
2193
|
class: "flex flex-col justify-center gap-4 pb-6 pt-5",
|
|
2196
|
-
children: [
|
|
2194
|
+
children: [u("header", {
|
|
2197
2195
|
class: "flex flex-col items-center gap-0",
|
|
2198
|
-
children: [
|
|
2196
|
+
children: [u("svg", {
|
|
2199
2197
|
class: "text-neutral-11 mb-1 h-8 w-8",
|
|
2200
2198
|
"aria-hidden": "true",
|
|
2201
2199
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2202
2200
|
fill: "none",
|
|
2203
2201
|
viewBox: "0 0 20 16",
|
|
2204
|
-
children:
|
|
2202
|
+
children: u("path", {
|
|
2205
2203
|
stroke: "currentColor",
|
|
2206
2204
|
"stroke-linecap": "round",
|
|
2207
2205
|
"stroke-linejoin": "round",
|
|
2208
2206
|
"stroke-width": "1.5",
|
|
2209
2207
|
d: "M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"
|
|
2210
2208
|
})
|
|
2211
|
-
}),
|
|
2209
|
+
}), u("p", {
|
|
2212
2210
|
class: "text-neutral-12 tracking-[-0.01em]",
|
|
2213
2211
|
children: y("upload_file", {
|
|
2214
2212
|
count: e.config.allowMultiple ? 2 : 1
|
|
2215
2213
|
})
|
|
2216
|
-
}), e.config.fileSizeLimitKib ?
|
|
2214
|
+
}), e.config.fileSizeLimitKib ? u("p", {
|
|
2217
2215
|
class: "text-neutral-11 text-xs",
|
|
2218
2216
|
children: ["(", y("file_max_size", {
|
|
2219
2217
|
size: Ge(e.config.fileSizeLimitKib)
|
|
2220
2218
|
}), ")"]
|
|
2221
2219
|
}) : null]
|
|
2222
|
-
}),
|
|
2220
|
+
}), u("aside", {
|
|
2223
2221
|
class: "flex flex-col items-center gap-2",
|
|
2224
|
-
children: [
|
|
2222
|
+
children: [u("p", {
|
|
2225
2223
|
id: "accepted-filetypes",
|
|
2226
2224
|
class: "sr-only",
|
|
2227
2225
|
children: y("file_extensions")
|
|
2228
|
-
}),
|
|
2226
|
+
}), u("ul", {
|
|
2229
2227
|
"aria-describedby": "accepted-filetypes",
|
|
2230
2228
|
class: "flex flex-wrap justify-center gap-2",
|
|
2231
|
-
children: e.config.extensions.map((E) =>
|
|
2229
|
+
children: e.config.extensions.map((E) => u("li", {
|
|
2232
2230
|
class: "ring-lowest outline-neutral-6 text-neutral-11 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",
|
|
2233
2231
|
children: E.replace(".", "")
|
|
2234
2232
|
}))
|
|
2235
2233
|
})]
|
|
2236
2234
|
})]
|
|
2237
|
-
}),
|
|
2235
|
+
}), u("p", {
|
|
2238
2236
|
role: "status",
|
|
2239
|
-
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs",
|
|
2240
|
-
children: s.status === "pending" ?
|
|
2241
|
-
children: [
|
|
2237
|
+
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
|
|
2238
|
+
children: s.status === "pending" ? u(be, {
|
|
2239
|
+
children: [u(Ut, {
|
|
2242
2240
|
"aria-hidden": "true",
|
|
2243
2241
|
class: "h-4 w-4"
|
|
2244
2242
|
}), y("file_preparing", {
|
|
2245
|
-
count:
|
|
2243
|
+
count: c.length
|
|
2246
2244
|
})]
|
|
2247
|
-
}) : s.status === "ready" ?
|
|
2245
|
+
}) : s.status === "ready" ? u(be, {
|
|
2248
2246
|
children: [o.length > 1 ? y("file_total_size", {
|
|
2249
2247
|
size: Ge(b)
|
|
2250
|
-
}) : Ge(b),
|
|
2248
|
+
}) : Ge(b), u("span", {
|
|
2251
2249
|
class: "sr-only",
|
|
2252
2250
|
children: [". ", y("file_ready", {
|
|
2253
2251
|
count: o.length
|
|
2254
2252
|
})]
|
|
2255
2253
|
})]
|
|
2256
2254
|
}) : null
|
|
2257
|
-
}),
|
|
2255
|
+
}), u("input", {
|
|
2258
2256
|
id: "dropzone-file",
|
|
2259
2257
|
"aria-label": y("upload_file", {
|
|
2260
2258
|
count: e.config.allowMultiple ? 2 : 1
|
|
@@ -2282,7 +2280,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2282
2280
|
try {
|
|
2283
2281
|
return {
|
|
2284
2282
|
...br(R),
|
|
2285
|
-
data: await
|
|
2283
|
+
data: await zn(R)
|
|
2286
2284
|
};
|
|
2287
2285
|
} catch (B) {
|
|
2288
2286
|
throw ee ?? (ee = R), B;
|
|
@@ -2309,23 +2307,23 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2309
2307
|
type: "file",
|
|
2310
2308
|
class: "sr-only"
|
|
2311
2309
|
})]
|
|
2312
|
-
}),
|
|
2310
|
+
}), u("div", {
|
|
2313
2311
|
class: "flex h-full flex-col items-center gap-2",
|
|
2314
|
-
children: [
|
|
2312
|
+
children: [u(Be, {
|
|
2315
2313
|
disabled: o.length === 0
|
|
2316
|
-
}), e.config.optional &&
|
|
2314
|
+
}), e.config.optional && u(Se, {
|
|
2317
2315
|
class: "relative",
|
|
2318
2316
|
onClick: () => r(null)
|
|
2319
2317
|
})]
|
|
2320
2318
|
})]
|
|
2321
|
-
}),
|
|
2319
|
+
}), u(tt, {
|
|
2322
2320
|
error: f
|
|
2323
2321
|
})]
|
|
2324
2322
|
});
|
|
2325
2323
|
};
|
|
2326
2324
|
var ft = (e) => e.type === "checkbox", De = (e) => e instanceof Date, oe = (e) => e == null;
|
|
2327
2325
|
const hn = (e) => typeof e == "object";
|
|
2328
|
-
var Z = (e) => !oe(e) && !Array.isArray(e) && hn(e) && !De(e),
|
|
2326
|
+
var Z = (e) => !oe(e) && !Array.isArray(e) && hn(e) && !De(e), Ea = (e) => Z(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, Aa = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ia = (e, r) => e.has(Aa(r)), Fa = (e) => {
|
|
2329
2327
|
const r = e.constructor && e.constructor.prototype;
|
|
2330
2328
|
return Z(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2331
2329
|
}, Zt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -2336,7 +2334,7 @@ function Q(e) {
|
|
|
2336
2334
|
if (Zt && (e instanceof Blob || r))
|
|
2337
2335
|
return e;
|
|
2338
2336
|
const t = Array.isArray(e);
|
|
2339
|
-
if (!t && !(Z(e) &&
|
|
2337
|
+
if (!t && !(Z(e) && Fa(e)))
|
|
2340
2338
|
return e;
|
|
2341
2339
|
const n = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2342
2340
|
for (const s in e)
|
|
@@ -2353,14 +2351,14 @@ var kt = (e) => /^\w*$/.test(e), G = (e) => e === void 0, Xt = (e) => Array.isAr
|
|
|
2353
2351
|
const s = kt(r) ? [r] : Yt(r), i = s.length, a = i - 1;
|
|
2354
2352
|
for (; ++n < i; ) {
|
|
2355
2353
|
const o = s[n];
|
|
2356
|
-
let
|
|
2354
|
+
let c = t;
|
|
2357
2355
|
if (n !== a) {
|
|
2358
2356
|
const f = e[o];
|
|
2359
|
-
|
|
2357
|
+
c = Z(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
|
|
2360
2358
|
}
|
|
2361
2359
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2362
2360
|
return;
|
|
2363
|
-
e[o] =
|
|
2361
|
+
e[o] = c, e = e[o];
|
|
2364
2362
|
}
|
|
2365
2363
|
};
|
|
2366
2364
|
const gr = {
|
|
@@ -2373,7 +2371,7 @@ const gr = {
|
|
|
2373
2371
|
onSubmit: "onSubmit",
|
|
2374
2372
|
onTouched: "onTouched",
|
|
2375
2373
|
all: "all"
|
|
2376
|
-
},
|
|
2374
|
+
}, _e = {
|
|
2377
2375
|
max: "max",
|
|
2378
2376
|
min: "min",
|
|
2379
2377
|
maxLength: "maxLength",
|
|
@@ -2381,9 +2379,9 @@ const gr = {
|
|
|
2381
2379
|
pattern: "pattern",
|
|
2382
2380
|
required: "required",
|
|
2383
2381
|
validate: "validate"
|
|
2384
|
-
},
|
|
2385
|
-
|
|
2386
|
-
var
|
|
2382
|
+
}, Va = ae.createContext(null);
|
|
2383
|
+
Va.displayName = "HookFormControlContext";
|
|
2384
|
+
var Ma = (e, r, t, n = !0) => {
|
|
2387
2385
|
const s = {
|
|
2388
2386
|
defaultValues: r._defaultValues
|
|
2389
2387
|
};
|
|
@@ -2396,9 +2394,9 @@ var Va = (e, r, t, n = !0) => {
|
|
|
2396
2394
|
});
|
|
2397
2395
|
return s;
|
|
2398
2396
|
};
|
|
2399
|
-
const
|
|
2400
|
-
var
|
|
2401
|
-
function
|
|
2397
|
+
const La = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
|
|
2398
|
+
var ce = (e) => typeof e == "string", Na = (e, r, t, n, s) => ce(e) ? (n && r.watch.add(e), S(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), S(t, i))) : (n && (r.watchAll = !0), t), Pt = (e) => oe(e) || !hn(e);
|
|
2399
|
+
function Ve(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2402
2400
|
if (Pt(e) || Pt(r))
|
|
2403
2401
|
return Object.is(e, r);
|
|
2404
2402
|
if (De(e) && De(r))
|
|
@@ -2415,21 +2413,21 @@ function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2415
2413
|
return !1;
|
|
2416
2414
|
if (i !== "ref") {
|
|
2417
2415
|
const o = r[i];
|
|
2418
|
-
if (De(a) && De(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !
|
|
2416
|
+
if (De(a) && De(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !Ve(a, o, t) : !Object.is(a, o))
|
|
2419
2417
|
return !1;
|
|
2420
2418
|
}
|
|
2421
2419
|
}
|
|
2422
2420
|
return !0;
|
|
2423
2421
|
}
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2422
|
+
const Ra = ae.createContext(null);
|
|
2423
|
+
Ra.displayName = "HookFormContext";
|
|
2426
2424
|
var pn = (e, r, t, n, s) => r ? {
|
|
2427
2425
|
...t[e],
|
|
2428
2426
|
types: {
|
|
2429
2427
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2430
2428
|
[n]: s || !0
|
|
2431
2429
|
}
|
|
2432
|
-
} : {},
|
|
2430
|
+
} : {}, ct = (e) => Array.isArray(e) ? e : [e], vr = () => {
|
|
2433
2431
|
let e = [];
|
|
2434
2432
|
return {
|
|
2435
2433
|
get observers() {
|
|
@@ -2467,32 +2465,32 @@ var ie = (e) => Z(e) && !Object.keys(e).length, Qt = (e) => e.type === "file", b
|
|
|
2467
2465
|
return !1;
|
|
2468
2466
|
const r = e ? e.ownerDocument : 0;
|
|
2469
2467
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2470
|
-
}, yn = (e) => e.type === "select-multiple", er = (e) => e.type === "radio",
|
|
2471
|
-
function
|
|
2468
|
+
}, yn = (e) => e.type === "select-multiple", er = (e) => e.type === "radio", Ta = (e) => er(e) || ft(e), Tt = (e) => bt(e) && e.isConnected;
|
|
2469
|
+
function Da(e, r) {
|
|
2472
2470
|
const t = r.slice(0, -1).length;
|
|
2473
2471
|
let n = 0;
|
|
2474
2472
|
for (; n < t; )
|
|
2475
2473
|
e = G(e) ? n++ : e[r[n++]];
|
|
2476
2474
|
return e;
|
|
2477
2475
|
}
|
|
2478
|
-
function
|
|
2476
|
+
function Oa(e) {
|
|
2479
2477
|
for (const r in e)
|
|
2480
2478
|
if (e.hasOwnProperty(r) && !G(e[r]))
|
|
2481
2479
|
return !1;
|
|
2482
2480
|
return !0;
|
|
2483
2481
|
}
|
|
2484
2482
|
function J(e, r) {
|
|
2485
|
-
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), n = t.length === 1 ? e :
|
|
2486
|
-
return n && delete n[i], s !== 0 && (Z(n) && ie(n) || Array.isArray(n) &&
|
|
2483
|
+
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), n = t.length === 1 ? e : Da(e, t), s = t.length - 1, i = t[s];
|
|
2484
|
+
return n && delete n[i], s !== 0 && (Z(n) && ie(n) || Array.isArray(n) && Oa(n)) && J(e, t.slice(0, -1)), e;
|
|
2487
2485
|
}
|
|
2488
|
-
var
|
|
2486
|
+
var Ba = (e) => {
|
|
2489
2487
|
for (const r in e)
|
|
2490
2488
|
if (de(e[r]))
|
|
2491
2489
|
return !0;
|
|
2492
2490
|
return !1;
|
|
2493
2491
|
};
|
|
2494
2492
|
function bn(e) {
|
|
2495
|
-
return Array.isArray(e) || Z(e) && !
|
|
2493
|
+
return Array.isArray(e) || Z(e) && !Ba(e);
|
|
2496
2494
|
}
|
|
2497
2495
|
function qt(e, r = {}) {
|
|
2498
2496
|
for (const t in e) {
|
|
@@ -2509,7 +2507,7 @@ function Ke(e, r, t) {
|
|
|
2509
2507
|
G(r) || Pt(t[n]) ? t[n] = qt(s, Array.isArray(s) ? [] : {}) : Ke(s, oe(r) ? {} : r[n], t[n]);
|
|
2510
2508
|
else {
|
|
2511
2509
|
const i = r[n];
|
|
2512
|
-
t[n] = !
|
|
2510
|
+
t[n] = !Ve(s, i);
|
|
2513
2511
|
}
|
|
2514
2512
|
}
|
|
2515
2513
|
return t;
|
|
@@ -2530,7 +2528,7 @@ var gn = (e) => {
|
|
|
2530
2528
|
) : xr;
|
|
2531
2529
|
}
|
|
2532
2530
|
return xr;
|
|
2533
|
-
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t &&
|
|
2531
|
+
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t && ce(e) ? new Date(e) : n ? n(e) : e;
|
|
2534
2532
|
const _r = {
|
|
2535
2533
|
isValid: !1,
|
|
2536
2534
|
value: null
|
|
@@ -2543,7 +2541,7 @@ function kr(e) {
|
|
|
2543
2541
|
const r = e.ref;
|
|
2544
2542
|
return Qt(r) ? r.files : er(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? gn(e.refs).value : vn(G(r.value) ? e.ref.value : r.value, e);
|
|
2545
2543
|
}
|
|
2546
|
-
var
|
|
2544
|
+
var $a = (e, r, t, n) => {
|
|
2547
2545
|
const s = {};
|
|
2548
2546
|
for (const i of e) {
|
|
2549
2547
|
const a = S(r, i);
|
|
@@ -2563,7 +2561,7 @@ var Ba = (e, r, t, n) => {
|
|
|
2563
2561
|
isOnTouch: e === fe.onTouched
|
|
2564
2562
|
});
|
|
2565
2563
|
const Sr = "AsyncFunction";
|
|
2566
|
-
var
|
|
2564
|
+
var ja = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Sr || Z(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Sr)), Pa = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Er = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
2567
2565
|
const dt = (e, r, t, n) => {
|
|
2568
2566
|
for (const s of t || Object.keys(e)) {
|
|
2569
2567
|
const i = S(e, s);
|
|
@@ -2609,19 +2607,19 @@ function Ar(e, r, t) {
|
|
|
2609
2607
|
name: t
|
|
2610
2608
|
};
|
|
2611
2609
|
}
|
|
2612
|
-
var
|
|
2610
|
+
var qa = (e, r, t, n) => {
|
|
2613
2611
|
t(e);
|
|
2614
2612
|
const { name: s, ...i } = e;
|
|
2615
2613
|
return ie(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
|
|
2616
|
-
},
|
|
2617
|
-
const n =
|
|
2614
|
+
}, Ua = (e, r, t) => !e || !r || e === r || ct(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Wa = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0, za = (e, r) => !Xt(S(e, r)).length && J(e, r), Ha = (e, r, t) => {
|
|
2615
|
+
const n = ct(S(e, t));
|
|
2618
2616
|
return z(n, "root", r[t]), z(e, t, n), e;
|
|
2619
2617
|
};
|
|
2620
2618
|
function Ir(e, r, t = "validate") {
|
|
2621
|
-
if (
|
|
2619
|
+
if (ce(e) || Array.isArray(e) && e.every(ce) || me(e) && !e)
|
|
2622
2620
|
return {
|
|
2623
2621
|
type: t,
|
|
2624
|
-
message:
|
|
2622
|
+
message: ce(e) ? e : "",
|
|
2625
2623
|
ref: r
|
|
2626
2624
|
};
|
|
2627
2625
|
}
|
|
@@ -2629,12 +2627,12 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2629
2627
|
value: e,
|
|
2630
2628
|
message: ""
|
|
2631
2629
|
}, Fr = async (e, r, t, n, s, i) => {
|
|
2632
|
-
const { ref: a, refs: o, required:
|
|
2630
|
+
const { ref: a, refs: o, required: c, maxLength: f, minLength: v, min: b, max: p, pattern: y, validate: C, name: _, valueAsNumber: k, mount: E } = e._f, g = S(t, _);
|
|
2633
2631
|
if (!E || r.has(_))
|
|
2634
2632
|
return {};
|
|
2635
2633
|
const N = o ? o[0] : a, V = (I) => {
|
|
2636
2634
|
s && N.reportValidity && (N.setCustomValidity(me(I) ? "" : I || ""), N.reportValidity());
|
|
2637
|
-
}, M = {}, O = er(a), K = ft(a), ee = O || K, T = (k || Qt(a)) && G(a.value) && G(g) || bt(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, R = pn.bind(null, _, n, M), B = (I, F, j, L =
|
|
2635
|
+
}, M = {}, O = er(a), K = ft(a), ee = O || K, T = (k || Qt(a)) && G(a.value) && G(g) || bt(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, R = pn.bind(null, _, n, M), B = (I, F, j, L = _e.maxLength, W = _e.minLength) => {
|
|
2638
2636
|
const U = I ? F : j;
|
|
2639
2637
|
M[_] = {
|
|
2640
2638
|
type: I ? L : W,
|
|
@@ -2643,13 +2641,13 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2643
2641
|
...R(I ? L : W, U)
|
|
2644
2642
|
};
|
|
2645
2643
|
};
|
|
2646
|
-
if (i ? !Array.isArray(g) || !g.length :
|
|
2647
|
-
const { value: I, message: F } =
|
|
2644
|
+
if (i ? !Array.isArray(g) || !g.length : c && (!ee && (T || oe(g)) || me(g) && !g || K && !gn(o).isValid || O && !xn(o).isValid)) {
|
|
2645
|
+
const { value: I, message: F } = ce(c) ? { value: !!c, message: c } : He(c);
|
|
2648
2646
|
if (I && (M[_] = {
|
|
2649
|
-
type:
|
|
2647
|
+
type: _e.required,
|
|
2650
2648
|
message: F,
|
|
2651
2649
|
ref: N,
|
|
2652
|
-
...R(
|
|
2650
|
+
...R(_e.required, F)
|
|
2653
2651
|
}, !n))
|
|
2654
2652
|
return V(F), M;
|
|
2655
2653
|
}
|
|
@@ -2661,23 +2659,23 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2661
2659
|
oe(j.value) || (I = W > j.value), oe(L.value) || (F = W < L.value);
|
|
2662
2660
|
} else {
|
|
2663
2661
|
const W = a.valueAsDate || new Date(g), U = (H) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + H), te = a.type == "time", X = a.type == "week";
|
|
2664
|
-
|
|
2662
|
+
ce(j.value) && g && (I = te ? U(g) > U(j.value) : X ? g > j.value : W > new Date(j.value)), ce(L.value) && g && (F = te ? U(g) < U(L.value) : X ? g < L.value : W < new Date(L.value));
|
|
2665
2663
|
}
|
|
2666
|
-
if ((I || F) && (B(!!I, j.message, L.message,
|
|
2664
|
+
if ((I || F) && (B(!!I, j.message, L.message, _e.max, _e.min), !n))
|
|
2667
2665
|
return V(M[_].message), M;
|
|
2668
2666
|
}
|
|
2669
|
-
if ((f || v) && !T && (
|
|
2667
|
+
if ((f || v) && !T && (ce(g) || i && Array.isArray(g))) {
|
|
2670
2668
|
const I = He(f), F = He(v), j = !oe(I.value) && g.length > +I.value, L = !oe(F.value) && g.length < +F.value;
|
|
2671
2669
|
if ((j || L) && (B(j, I.message, F.message), !n))
|
|
2672
2670
|
return V(M[_].message), M;
|
|
2673
2671
|
}
|
|
2674
|
-
if (y && !T &&
|
|
2672
|
+
if (y && !T && ce(g)) {
|
|
2675
2673
|
const { value: I, message: F } = He(y);
|
|
2676
2674
|
if (gt(I) && !g.match(I) && (M[_] = {
|
|
2677
|
-
type:
|
|
2675
|
+
type: _e.pattern,
|
|
2678
2676
|
message: F,
|
|
2679
2677
|
ref: a,
|
|
2680
|
-
...R(
|
|
2678
|
+
...R(_e.pattern, F)
|
|
2681
2679
|
}, !n))
|
|
2682
2680
|
return V(F), M;
|
|
2683
2681
|
}
|
|
@@ -2686,7 +2684,7 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2686
2684
|
const I = await C(g, t), F = Ir(I, N);
|
|
2687
2685
|
if (F && (M[_] = {
|
|
2688
2686
|
...F,
|
|
2689
|
-
...R(
|
|
2687
|
+
...R(_e.validate, F.message)
|
|
2690
2688
|
}, !n))
|
|
2691
2689
|
return V(F.message), M;
|
|
2692
2690
|
} else if (Z(C)) {
|
|
@@ -2709,14 +2707,14 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2709
2707
|
}
|
|
2710
2708
|
return V(!0), M;
|
|
2711
2709
|
};
|
|
2712
|
-
const
|
|
2710
|
+
const Ka = {
|
|
2713
2711
|
mode: fe.onSubmit,
|
|
2714
2712
|
reValidateMode: fe.onChange,
|
|
2715
2713
|
shouldFocusError: !0
|
|
2716
2714
|
};
|
|
2717
|
-
function
|
|
2715
|
+
function Ga(e = {}) {
|
|
2718
2716
|
let r = {
|
|
2719
|
-
...
|
|
2717
|
+
...Ka,
|
|
2720
2718
|
...e
|
|
2721
2719
|
}, t = {
|
|
2722
2720
|
submitCount: 0,
|
|
@@ -2744,7 +2742,7 @@ function Ka(e = {}) {
|
|
|
2744
2742
|
unMount: /* @__PURE__ */ new Set(),
|
|
2745
2743
|
array: /* @__PURE__ */ new Set(),
|
|
2746
2744
|
watch: /* @__PURE__ */ new Set()
|
|
2747
|
-
},
|
|
2745
|
+
}, c, f = 0;
|
|
2748
2746
|
const v = {
|
|
2749
2747
|
isDirty: !1,
|
|
2750
2748
|
dirtyFields: !1,
|
|
@@ -2786,7 +2784,7 @@ function Ka(e = {}) {
|
|
|
2786
2784
|
}
|
|
2787
2785
|
if (x && Array.isArray(S(t.errors, l))) {
|
|
2788
2786
|
const A = h(S(t.errors, l), w.argA, w.argB);
|
|
2789
|
-
m && z(t.errors, l, A),
|
|
2787
|
+
m && z(t.errors, l, A), za(t.errors, l);
|
|
2790
2788
|
}
|
|
2791
2789
|
if ((b.touchedFields || p.touchedFields) && x && Array.isArray(S(t.touchedFields, l))) {
|
|
2792
2790
|
const A = h(S(t.touchedFields, l), w.argA, w.argB);
|
|
@@ -2824,7 +2822,7 @@ function Ka(e = {}) {
|
|
|
2824
2822
|
if (!r.disabled) {
|
|
2825
2823
|
if (!h || w) {
|
|
2826
2824
|
(b.isDirty || p.isDirty) && (A = t.isDirty, t.isDirty = $.isDirty = I(), x = A !== $.isDirty);
|
|
2827
|
-
const P =
|
|
2825
|
+
const P = Ve(S(s, l), d);
|
|
2828
2826
|
A = !!S(t.dirtyFields, l), P ? J(t.dirtyFields, l) : z(t.dirtyFields, l, !0), $.dirtyFields = t.dirtyFields, x = x || (b.dirtyFields || p.dirtyFields) && A !== !P;
|
|
2829
2827
|
}
|
|
2830
2828
|
if (h) {
|
|
@@ -2836,7 +2834,7 @@ function Ka(e = {}) {
|
|
|
2836
2834
|
return x ? $ : {};
|
|
2837
2835
|
}, K = (l, d, h, w) => {
|
|
2838
2836
|
const m = S(t.errors, l), x = (b.isValid || p.isValid) && me(d) && t.isValid !== d;
|
|
2839
|
-
if (r.delayError && h ? (
|
|
2837
|
+
if (r.delayError && h ? (c = _(() => N(l, h)), c(r.delayError)) : (clearTimeout(f), c = null, h ? z(t.errors, l, h) : J(t.errors, l)), (h ? !Ve(m, h) : m) || !ie(w) || x) {
|
|
2840
2838
|
const A = {
|
|
2841
2839
|
...w,
|
|
2842
2840
|
...x && me(d) ? { isValid: d } : {},
|
|
@@ -2848,7 +2846,7 @@ function Ka(e = {}) {
|
|
|
2848
2846
|
...A
|
|
2849
2847
|
}, y.state.next(A);
|
|
2850
2848
|
}
|
|
2851
|
-
}, ee = async (l) => (E(l, !0), await r.resolver(i, r.context,
|
|
2849
|
+
}, ee = async (l) => (E(l, !0), await r.resolver(i, r.context, $a(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), T = async (l) => {
|
|
2852
2850
|
const { errors: d } = await ee(l);
|
|
2853
2851
|
if (E(l), l)
|
|
2854
2852
|
for (const h of l) {
|
|
@@ -2866,12 +2864,12 @@ function Ka(e = {}) {
|
|
|
2866
2864
|
if (m) {
|
|
2867
2865
|
const { _f: x, ...A } = m;
|
|
2868
2866
|
if (x) {
|
|
2869
|
-
const $ = o.array.has(x.name), P = m._f &&
|
|
2867
|
+
const $ = o.array.has(x.name), P = m._f && ja(m._f);
|
|
2870
2868
|
P && b.validatingFields && E([x.name], !0);
|
|
2871
2869
|
const se = await Fr(m, o.disabled, i, C, r.shouldUseNativeValidation && !d, $);
|
|
2872
2870
|
if (P && b.validatingFields && E([x.name]), se[x.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
|
|
2873
2871
|
break;
|
|
2874
|
-
!d && (S(se, x.name) ? $ ?
|
|
2872
|
+
!d && (S(se, x.name) ? $ ? Ha(t.errors, se, x.name) : z(t.errors, x.name, se[x.name]) : J(t.errors, x.name));
|
|
2875
2873
|
}
|
|
2876
2874
|
!ie(A) && await R(A, d, h);
|
|
2877
2875
|
}
|
|
@@ -2883,8 +2881,8 @@ function Ka(e = {}) {
|
|
|
2883
2881
|
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) && qe(l);
|
|
2884
2882
|
}
|
|
2885
2883
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2886
|
-
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !
|
|
2887
|
-
...a.mount ? i : G(d) ? s :
|
|
2884
|
+
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !Ve(rt(), s)), F = (l, d, h) => Na(l, o, {
|
|
2885
|
+
...a.mount ? i : G(d) ? s : ce(l) ? { [l]: d } : d
|
|
2888
2886
|
}, h, d), j = (l) => Xt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), L = (l, d, h = {}) => {
|
|
2889
2887
|
const w = S(n, l);
|
|
2890
2888
|
let m = d;
|
|
@@ -2927,20 +2925,20 @@ function Ka(e = {}) {
|
|
|
2927
2925
|
const d = l.target;
|
|
2928
2926
|
let h = d.name, w = !0;
|
|
2929
2927
|
const m = S(n, h), x = (P) => {
|
|
2930
|
-
w = Number.isNaN(P) || De(P) && isNaN(P.getTime()) ||
|
|
2928
|
+
w = Number.isNaN(P) || De(P) && isNaN(P.getTime()) || Ve(P, S(i, h, P));
|
|
2931
2929
|
}, A = Cr(r.mode), $ = Cr(r.reValidateMode);
|
|
2932
2930
|
if (m) {
|
|
2933
2931
|
let P, se;
|
|
2934
|
-
const Te = d.type ? kr(m._f) :
|
|
2935
|
-
z(i, h, Te),
|
|
2936
|
-
const It = O(h, Te,
|
|
2937
|
-
if (!
|
|
2932
|
+
const Te = d.type ? kr(m._f) : Ea(l), Ae = l.type === gr.BLUR || l.type === gr.FOCUS_OUT, _n = !Pa(m._f) && !r.resolver && !S(t.errors, h) && !m._f.deps || Wa(Ae, S(t.touchedFields, h), t.isSubmitted, $, A), At = Er(h, o, Ae);
|
|
2933
|
+
z(i, h, Te), Ae ? (!d || !d.readOnly) && (m._f.onBlur && m._f.onBlur(l), c && c(0)) : m._f.onChange && m._f.onChange(l);
|
|
2934
|
+
const It = O(h, Te, Ae), kn = !ie(It) || At;
|
|
2935
|
+
if (!Ae && y.state.next({
|
|
2938
2936
|
name: h,
|
|
2939
2937
|
type: l.type,
|
|
2940
2938
|
values: Q(i)
|
|
2941
2939
|
}), _n)
|
|
2942
|
-
return (b.isValid || p.isValid) && (r.mode === "onBlur" ?
|
|
2943
|
-
if (!
|
|
2940
|
+
return (b.isValid || p.isValid) && (r.mode === "onBlur" ? Ae && k() : Ae || k()), kn && y.state.next({ name: h, ...At ? {} : It });
|
|
2941
|
+
if (!Ae && At && y.state.next({ ...t }), r.resolver) {
|
|
2944
2942
|
const { errors: tr } = await ee([h]);
|
|
2945
2943
|
if (E([h]), x(Te), w) {
|
|
2946
2944
|
const Cn = Ar(t.errors, n, h), rr = Ar(tr, n, Cn.name || h);
|
|
@@ -2955,7 +2953,7 @@ function Ka(e = {}) {
|
|
|
2955
2953
|
return l.focus(), 1;
|
|
2956
2954
|
}, H = async (l, d = {}) => {
|
|
2957
2955
|
let h, w;
|
|
2958
|
-
const m =
|
|
2956
|
+
const m = ct(l);
|
|
2959
2957
|
if (r.resolver) {
|
|
2960
2958
|
const x = await T(G(l) ? l : m);
|
|
2961
2959
|
h = ie(x), w = l ? !m.some((A) => S(x, A)) : h;
|
|
@@ -2965,7 +2963,7 @@ function Ka(e = {}) {
|
|
|
2965
2963
|
return await R(A && A._f ? { [x]: A } : A);
|
|
2966
2964
|
}))).every(Boolean), !(!w && !t.isValid) && k()) : w = h = await R(n);
|
|
2967
2965
|
return y.state.next({
|
|
2968
|
-
...!
|
|
2966
|
+
...!ce(l) || (b.isValid || p.isValid) && h !== t.isValid ? {} : { name: l },
|
|
2969
2967
|
...r.resolver || !l ? { isValid: h } : {},
|
|
2970
2968
|
errors: t.errors
|
|
2971
2969
|
}), d.shouldFocus && !w && dt(n, X, l ? m : o.mount), w;
|
|
@@ -2973,7 +2971,7 @@ function Ka(e = {}) {
|
|
|
2973
2971
|
let h = {
|
|
2974
2972
|
...a.mount ? i : s
|
|
2975
2973
|
};
|
|
2976
|
-
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(l) ? h :
|
|
2974
|
+
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(l) ? h : ce(l) ? S(h, l) : l.map((w) => S(h, w));
|
|
2977
2975
|
}, $e = (l, d) => ({
|
|
2978
2976
|
invalid: !!S((d || t).errors, l),
|
|
2979
2977
|
isDirty: !!S((d || t).dirtyFields, l),
|
|
@@ -2981,7 +2979,7 @@ function Ka(e = {}) {
|
|
|
2981
2979
|
isValidating: !!S(t.validatingFields, l),
|
|
2982
2980
|
isTouched: !!S((d || t).touchedFields, l)
|
|
2983
2981
|
}), D = (l) => {
|
|
2984
|
-
const d = l ?
|
|
2982
|
+
const d = l ? ct(l) : void 0;
|
|
2985
2983
|
d == null || d.forEach((h) => J(t.errors, h)), d ? d.forEach((h) => {
|
|
2986
2984
|
y.state.next({
|
|
2987
2985
|
name: h,
|
|
@@ -3003,9 +3001,9 @@ function Ka(e = {}) {
|
|
|
3003
3001
|
}), h && h.shouldFocus && w && w.focus && w.focus();
|
|
3004
3002
|
}, Pe = (l, d) => de(l) ? y.state.subscribe({
|
|
3005
3003
|
next: (h) => "values" in h && l(F(void 0, d), h)
|
|
3006
|
-
}) : F(l, d, !0),
|
|
3004
|
+
}) : F(l, d, !0), Ee = (l) => y.state.subscribe({
|
|
3007
3005
|
next: (d) => {
|
|
3008
|
-
|
|
3006
|
+
Ua(l.name, d.name, l.exact) && qa(d, l.formState || b, mt, l.reRenderRoot) && l.callback({
|
|
3009
3007
|
values: { ...i },
|
|
3010
3008
|
...t,
|
|
3011
3009
|
...d,
|
|
@@ -3015,14 +3013,14 @@ function Ka(e = {}) {
|
|
|
3015
3013
|
}).unsubscribe, Ne = (l) => (a.mount = !0, p = {
|
|
3016
3014
|
...p,
|
|
3017
3015
|
...l.formState
|
|
3018
|
-
},
|
|
3016
|
+
}, Ee({
|
|
3019
3017
|
...l,
|
|
3020
3018
|
formState: {
|
|
3021
3019
|
...v,
|
|
3022
3020
|
...l.formState
|
|
3023
3021
|
}
|
|
3024
3022
|
})), qe = (l, d = {}) => {
|
|
3025
|
-
for (const h of l ?
|
|
3023
|
+
for (const h of l ? ct(l) : o.mount)
|
|
3026
3024
|
o.mount.delete(h), o.array.delete(h), d.keepValue || (J(n, h), J(i, h)), !d.keepError && J(t.errors, h), !d.keepDirty && J(t.dirtyFields, h), !d.keepTouched && J(t.touchedFields, h), !d.keepIsValidating && J(t.validatingFields, h), !r.shouldUnregister && !d.keepDefaultValue && J(s, h);
|
|
3027
3025
|
y.state.next({
|
|
3028
3026
|
values: Q(i)
|
|
@@ -3035,7 +3033,7 @@ function Ka(e = {}) {
|
|
|
3035
3033
|
const m = o.disabled.has(d) !== !!l;
|
|
3036
3034
|
l ? o.disabled.add(d) : o.disabled.delete(d), m && a.mount && !a.action && k();
|
|
3037
3035
|
}
|
|
3038
|
-
},
|
|
3036
|
+
}, ve = (l, d = {}) => {
|
|
3039
3037
|
let h = S(n, l);
|
|
3040
3038
|
const w = me(d.disabled) || me(r.disabled);
|
|
3041
3039
|
return z(n, l, {
|
|
@@ -3064,8 +3062,8 @@ function Ka(e = {}) {
|
|
|
3064
3062
|
onBlur: te,
|
|
3065
3063
|
ref: (m) => {
|
|
3066
3064
|
if (m) {
|
|
3067
|
-
|
|
3068
|
-
const x = G(m.value) && m.querySelectorAll && m.querySelectorAll("input,select,textarea")[0] || m, A =
|
|
3065
|
+
ve(l, d), h = S(n, l);
|
|
3066
|
+
const x = G(m.value) && m.querySelectorAll && m.querySelectorAll("input,select,textarea")[0] || m, A = Ta(x), $ = h._f.refs || [];
|
|
3069
3067
|
if (A ? $.find((P) => P === x) : x === h._f.ref)
|
|
3070
3068
|
return;
|
|
3071
3069
|
z(n, l, {
|
|
@@ -3082,7 +3080,7 @@ function Ka(e = {}) {
|
|
|
3082
3080
|
}
|
|
3083
3081
|
}), M(l, !1, void 0, x);
|
|
3084
3082
|
} else
|
|
3085
|
-
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(
|
|
3083
|
+
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Ia(o.array, l) && a.action) && o.unMount.add(l);
|
|
3086
3084
|
}
|
|
3087
3085
|
};
|
|
3088
3086
|
}, Ue = () => r.shouldFocusError && dt(n, X, o.mount), ht = (l) => {
|
|
@@ -3176,7 +3174,7 @@ function Ka(e = {}) {
|
|
|
3176
3174
|
focus: ""
|
|
3177
3175
|
}, a.mount = !b.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ie(x), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), y.state.next({
|
|
3178
3176
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3179
|
-
isDirty: m ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !
|
|
3177
|
+
isDirty: m ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ve(l, s)),
|
|
3180
3178
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3181
3179
|
dirtyFields: m ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ke(s, i) : t.dirtyFields : d.keepDefaultValues && l ? Ke(s, l) : d.keepDirty ? t.dirtyFields : {},
|
|
3182
3180
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
@@ -3200,12 +3198,12 @@ function Ka(e = {}) {
|
|
|
3200
3198
|
};
|
|
3201
3199
|
}, at = {
|
|
3202
3200
|
control: {
|
|
3203
|
-
register:
|
|
3201
|
+
register: ve,
|
|
3204
3202
|
unregister: qe,
|
|
3205
3203
|
getFieldState: $e,
|
|
3206
3204
|
handleSubmit: We,
|
|
3207
3205
|
setError: je,
|
|
3208
|
-
_subscribe:
|
|
3206
|
+
_subscribe: Ee,
|
|
3209
3207
|
_runSchema: ee,
|
|
3210
3208
|
_updateIsValidating: E,
|
|
3211
3209
|
_focusError: Ue,
|
|
@@ -3262,7 +3260,7 @@ function Ka(e = {}) {
|
|
|
3262
3260
|
},
|
|
3263
3261
|
subscribe: Ne,
|
|
3264
3262
|
trigger: H,
|
|
3265
|
-
register:
|
|
3263
|
+
register: ve,
|
|
3266
3264
|
handleSubmit: We,
|
|
3267
3265
|
watch: Pe,
|
|
3268
3266
|
setValue: U,
|
|
@@ -3305,14 +3303,14 @@ function Ct(e = {}) {
|
|
|
3305
3303
|
formState: n
|
|
3306
3304
|
}, e.defaultValues && !de(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3307
3305
|
else {
|
|
3308
|
-
const { formControl: a, ...o } =
|
|
3306
|
+
const { formControl: a, ...o } = Ga(e);
|
|
3309
3307
|
r.current = {
|
|
3310
3308
|
...o,
|
|
3311
3309
|
formState: n
|
|
3312
3310
|
};
|
|
3313
3311
|
}
|
|
3314
3312
|
const i = r.current.control;
|
|
3315
|
-
return i._options = e,
|
|
3313
|
+
return i._options = e, La(() => {
|
|
3316
3314
|
const a = i._subscribe({
|
|
3317
3315
|
formState: i._proxyFormState,
|
|
3318
3316
|
callback: () => s({ ...i._formState }),
|
|
@@ -3339,52 +3337,52 @@ function Ct(e = {}) {
|
|
|
3339
3337
|
}
|
|
3340
3338
|
}, [i, n.isDirty]), ae.useEffect(() => {
|
|
3341
3339
|
var a;
|
|
3342
|
-
e.values && !
|
|
3340
|
+
e.values && !Ve(e.values, t.current) ? (i._reset(e.values, {
|
|
3343
3341
|
keepFieldsRef: !0,
|
|
3344
3342
|
...i._options.resetOptions
|
|
3345
3343
|
}), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
3346
3344
|
}, [i, e.values]), ae.useEffect(() => {
|
|
3347
3345
|
i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
|
|
3348
|
-
}), r.current.formState = ae.useMemo(() =>
|
|
3346
|
+
}), r.current.formState = ae.useMemo(() => Ma(n, i), [i, n]), r.current;
|
|
3349
3347
|
}
|
|
3350
3348
|
const Vr = (e, r, t) => {
|
|
3351
3349
|
if (e && "reportValidity" in e) {
|
|
3352
3350
|
const n = S(t, r);
|
|
3353
3351
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
3354
3352
|
}
|
|
3355
|
-
},
|
|
3353
|
+
}, Ja = (e, r) => {
|
|
3356
3354
|
for (const t in r.fields) {
|
|
3357
3355
|
const n = r.fields[t];
|
|
3358
3356
|
n && n.ref && "reportValidity" in n.ref ? Vr(n.ref, t, e) : n.refs && n.refs.forEach((s) => Vr(s, t, e));
|
|
3359
3357
|
}
|
|
3360
|
-
},
|
|
3361
|
-
r.shouldUseNativeValidation &&
|
|
3358
|
+
}, Za = (e, r) => {
|
|
3359
|
+
r.shouldUseNativeValidation && Ja(e, r);
|
|
3362
3360
|
const t = {};
|
|
3363
3361
|
for (const n in e) {
|
|
3364
3362
|
const s = S(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3365
|
-
if (
|
|
3363
|
+
if (Xa(r.names || Object.keys(e), n)) {
|
|
3366
3364
|
const a = Object.assign({}, S(t, n));
|
|
3367
3365
|
z(a, "root", i), z(t, n, a);
|
|
3368
3366
|
} else
|
|
3369
3367
|
z(t, n, i);
|
|
3370
3368
|
}
|
|
3371
3369
|
return t;
|
|
3372
|
-
},
|
|
3370
|
+
}, Xa = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3373
3371
|
var St = function(e, r, t) {
|
|
3374
3372
|
return t === void 0 && (t = {}), function(n, s, i) {
|
|
3375
3373
|
try {
|
|
3376
3374
|
var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3377
|
-
return Promise.resolve(/* @__PURE__ */
|
|
3375
|
+
return Promise.resolve(/* @__PURE__ */ la(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3378
3376
|
if (o.issues) {
|
|
3379
|
-
for (var
|
|
3380
|
-
var f = o.issues[0], v = /* @__PURE__ */
|
|
3381
|
-
if (v && (
|
|
3382
|
-
var b =
|
|
3383
|
-
|
|
3377
|
+
for (var c = {}; o.issues.length; ) {
|
|
3378
|
+
var f = o.issues[0], v = /* @__PURE__ */ ta(f);
|
|
3379
|
+
if (v && (c[v] || (c[v] = { message: f.message, type: f.type }), a)) {
|
|
3380
|
+
var b = c[v].types, p = b && b[f.type];
|
|
3381
|
+
c[v] = pn(v, a, c, f.type, p ? [].concat(p, f.message) : f.message);
|
|
3384
3382
|
}
|
|
3385
3383
|
o.issues.shift();
|
|
3386
3384
|
}
|
|
3387
|
-
return { values: {}, errors:
|
|
3385
|
+
return { values: {}, errors: Za(c, i) };
|
|
3388
3386
|
}
|
|
3389
3387
|
return { values: t.raw ? n : o.output, errors: {} };
|
|
3390
3388
|
});
|
|
@@ -3393,28 +3391,28 @@ var St = function(e, r, t) {
|
|
|
3393
3391
|
}
|
|
3394
3392
|
};
|
|
3395
3393
|
};
|
|
3396
|
-
const Mr = 27, Lr = 12, Nr = 10,
|
|
3394
|
+
const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
3397
3395
|
const t = {
|
|
3398
3396
|
min: e.minSelected ?? 0,
|
|
3399
3397
|
max: e.maxSelected ?? e.options.length
|
|
3400
3398
|
};
|
|
3401
|
-
return St(/* @__PURE__ */
|
|
3402
|
-
checked: /* @__PURE__ */
|
|
3399
|
+
return St(/* @__PURE__ */ Ce({
|
|
3400
|
+
checked: /* @__PURE__ */ Me(/* @__PURE__ */ ln(/* @__PURE__ */ le(), /* @__PURE__ */ sn()), /* @__PURE__ */ Kt((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ ut(t.max, r("validation_multiple_choice_max", {
|
|
3403
3401
|
count: t.max
|
|
3404
3402
|
})), /* @__PURE__ */ Ze(t.min, r("validation_multiple_choice_min", {
|
|
3405
3403
|
count: t.min
|
|
3406
3404
|
})))
|
|
3407
3405
|
}));
|
|
3408
|
-
},
|
|
3406
|
+
}, ei = zr(({
|
|
3409
3407
|
option: e,
|
|
3410
3408
|
...r
|
|
3411
|
-
}, t) =>
|
|
3412
|
-
children: [
|
|
3409
|
+
}, t) => u(be, {
|
|
3410
|
+
children: [u("input", {
|
|
3413
3411
|
class: "peer sr-only h-full",
|
|
3414
3412
|
type: "checkbox",
|
|
3415
3413
|
...r,
|
|
3416
3414
|
ref: t
|
|
3417
|
-
}),
|
|
3415
|
+
}), u("label", {
|
|
3418
3416
|
class: "bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",
|
|
3419
3417
|
htmlFor: r.id,
|
|
3420
3418
|
children: e.label
|
|
@@ -3424,52 +3422,64 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3424
3422
|
variant: {
|
|
3425
3423
|
// In cases where there is only one option, we want to center it
|
|
3426
3424
|
singleOption: "justify-center",
|
|
3427
|
-
// Two choices
|
|
3428
|
-
booleanLike:
|
|
3425
|
+
// Two choices, one answer
|
|
3426
|
+
booleanLike: cn
|
|
3429
3427
|
}
|
|
3430
3428
|
}
|
|
3431
|
-
}),
|
|
3429
|
+
}), ti = ({
|
|
3432
3430
|
input: e,
|
|
3433
3431
|
onSubmitSuccess: r
|
|
3434
3432
|
}) => {
|
|
3435
3433
|
var v, b;
|
|
3436
|
-
const t = e.key ? (v = q.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, n =
|
|
3434
|
+
const t = e.key ? (v = q.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, n = e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
|
|
3437
3435
|
t: i
|
|
3438
3436
|
} = ne(), {
|
|
3439
3437
|
register: a,
|
|
3440
3438
|
handleSubmit: o,
|
|
3441
3439
|
formState: {
|
|
3442
|
-
errors:
|
|
3440
|
+
errors: c
|
|
3443
3441
|
}
|
|
3444
3442
|
} = Ct({
|
|
3445
3443
|
defaultValues: {
|
|
3446
|
-
checked: n ? {} :
|
|
3444
|
+
checked: n ? {} : Ya(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3447
3445
|
},
|
|
3448
|
-
resolver:
|
|
3446
|
+
resolver: Qa(e.config, i)
|
|
3449
3447
|
}), f = Jt();
|
|
3450
|
-
return s ?
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3448
|
+
return s ? u(be, {
|
|
3449
|
+
children: [u("ul", {
|
|
3450
|
+
style: {
|
|
3451
|
+
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3452
|
+
},
|
|
3453
|
+
class: Rr({
|
|
3454
|
+
variant: "booleanLike"
|
|
3455
|
+
}),
|
|
3456
|
+
children: e.config.options.map((p, y) => u("li", {
|
|
3457
|
+
class: dn,
|
|
3458
|
+
children: u(fn, {
|
|
3459
|
+
type: "submit",
|
|
3460
|
+
ref: (C) => {
|
|
3461
|
+
C && y === 0 && (f.current = C);
|
|
3462
|
+
},
|
|
3463
|
+
label: p.label,
|
|
3464
|
+
value: "true",
|
|
3465
|
+
onClick: () => r({
|
|
3466
|
+
type: "enum",
|
|
3467
|
+
value: [p.value]
|
|
3468
|
+
})
|
|
3469
|
+
})
|
|
3470
|
+
}, p.value))
|
|
3471
|
+
}), e.config.minSelected === 0 && u("div", {
|
|
3472
|
+
class: "px-2 pb-2",
|
|
3473
|
+
children: u(Se, {
|
|
3474
|
+
class: "relative w-full",
|
|
3475
|
+
type: "button",
|
|
3466
3476
|
onClick: () => r({
|
|
3467
3477
|
type: "enum",
|
|
3468
|
-
value: [
|
|
3478
|
+
value: []
|
|
3469
3479
|
})
|
|
3470
3480
|
})
|
|
3471
|
-
}
|
|
3472
|
-
}) :
|
|
3481
|
+
})]
|
|
3482
|
+
}) : u("form", {
|
|
3473
3483
|
noValidate: !0,
|
|
3474
3484
|
onSubmit: (p) => o((y) => {
|
|
3475
3485
|
const C = y.checked;
|
|
@@ -3478,9 +3488,9 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3478
3488
|
value: C
|
|
3479
3489
|
});
|
|
3480
3490
|
})(p),
|
|
3481
|
-
children: [
|
|
3491
|
+
children: [u("div", {
|
|
3482
3492
|
class: "flex items-center gap-1",
|
|
3483
|
-
children: [
|
|
3493
|
+
children: [u("ul", {
|
|
3484
3494
|
style: {
|
|
3485
3495
|
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3486
3496
|
},
|
|
@@ -3492,9 +3502,9 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3492
3502
|
ref: _,
|
|
3493
3503
|
...k
|
|
3494
3504
|
} = a(C);
|
|
3495
|
-
return
|
|
3505
|
+
return u("li", {
|
|
3496
3506
|
class: "relative",
|
|
3497
|
-
children:
|
|
3507
|
+
children: u(ei, {
|
|
3498
3508
|
option: p,
|
|
3499
3509
|
autoFocus: y === 0,
|
|
3500
3510
|
ref: (E) => {
|
|
@@ -3509,9 +3519,9 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3509
3519
|
})
|
|
3510
3520
|
}, p.value);
|
|
3511
3521
|
})
|
|
3512
|
-
}),
|
|
3522
|
+
}), u("div", {
|
|
3513
3523
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3514
|
-
children: [n ? null :
|
|
3524
|
+
children: [n ? null : u(Be, {}), e.config.minSelected === 0 && u(Se, {
|
|
3515
3525
|
class: "relative",
|
|
3516
3526
|
type: "button",
|
|
3517
3527
|
onClick: () => r({
|
|
@@ -3520,17 +3530,17 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3520
3530
|
})
|
|
3521
3531
|
})]
|
|
3522
3532
|
})]
|
|
3523
|
-
}),
|
|
3533
|
+
}), u("div", {
|
|
3524
3534
|
class: "px-1",
|
|
3525
|
-
children:
|
|
3526
|
-
error: (b =
|
|
3535
|
+
children: u(tt, {
|
|
3536
|
+
error: (b = c.checked) == null ? void 0 : b.root
|
|
3527
3537
|
})
|
|
3528
3538
|
})]
|
|
3529
3539
|
});
|
|
3530
|
-
},
|
|
3540
|
+
}, ri = et("number"), ni = (e, r) => {
|
|
3531
3541
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3532
|
-
return St(/* @__PURE__ */
|
|
3533
|
-
number: /* @__PURE__ */
|
|
3542
|
+
return St(/* @__PURE__ */ Ce({
|
|
3543
|
+
number: /* @__PURE__ */ Me(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
|
|
3534
3544
|
min: t
|
|
3535
3545
|
})), /* @__PURE__ */ Qr(n, r("validation_number_max", {
|
|
3536
3546
|
max: n
|
|
@@ -3538,7 +3548,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3538
3548
|
count: s
|
|
3539
3549
|
})))
|
|
3540
3550
|
}));
|
|
3541
|
-
},
|
|
3551
|
+
}, si = ({
|
|
3542
3552
|
input: e,
|
|
3543
3553
|
onSubmitSuccess: r
|
|
3544
3554
|
}) => {
|
|
@@ -3553,19 +3563,19 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3553
3563
|
}
|
|
3554
3564
|
} = Ct({
|
|
3555
3565
|
defaultValues: {
|
|
3556
|
-
number:
|
|
3566
|
+
number: ri(n) ? n.value : t ? Number(t) : void 0
|
|
3557
3567
|
},
|
|
3558
|
-
resolver:
|
|
3568
|
+
resolver: ni(e.config, s)
|
|
3559
3569
|
}), {
|
|
3560
|
-
ref:
|
|
3570
|
+
ref: c,
|
|
3561
3571
|
...f
|
|
3562
3572
|
} = i("number", {
|
|
3563
3573
|
required: !e.config.optional,
|
|
3564
3574
|
valueAsNumber: !0
|
|
3565
3575
|
}), v = ye();
|
|
3566
|
-
return
|
|
3576
|
+
return Le(() => {
|
|
3567
3577
|
v.current && (v.current.focus(), v.current.select());
|
|
3568
|
-
}, []),
|
|
3578
|
+
}, []), u("form", {
|
|
3569
3579
|
class: "flex flex-col gap-1 p-2.5",
|
|
3570
3580
|
onSubmit: a((p) => {
|
|
3571
3581
|
p.number !== void 0 && r({
|
|
@@ -3573,11 +3583,11 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3573
3583
|
value: p.number
|
|
3574
3584
|
});
|
|
3575
3585
|
}),
|
|
3576
|
-
children: [
|
|
3586
|
+
children: [u("div", {
|
|
3577
3587
|
class: "flex items-center gap-2",
|
|
3578
|
-
children: [
|
|
3588
|
+
children: [u("div", {
|
|
3579
3589
|
class: "relative min-w-0 flex-grow",
|
|
3580
|
-
children: [
|
|
3590
|
+
children: [u("input", {
|
|
3581
3591
|
...f,
|
|
3582
3592
|
id: "chat-input",
|
|
3583
3593
|
autocomplete: "off",
|
|
@@ -3585,7 +3595,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3585
3595
|
autoCorrect: "off",
|
|
3586
3596
|
autoFocus: !0,
|
|
3587
3597
|
ref: (p) => {
|
|
3588
|
-
p && (v.current = p),
|
|
3598
|
+
p && (v.current = p), c(p);
|
|
3589
3599
|
},
|
|
3590
3600
|
type: "text",
|
|
3591
3601
|
min: e.config.min,
|
|
@@ -3595,45 +3605,31 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3595
3605
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3596
3606
|
}),
|
|
3597
3607
|
placeholder: e.config.placeholder
|
|
3598
|
-
}), e.config.optional &&
|
|
3608
|
+
}), e.config.optional && u(Se, {
|
|
3599
3609
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3600
3610
|
onClick: () => r(null)
|
|
3601
3611
|
})]
|
|
3602
|
-
}),
|
|
3603
|
-
}),
|
|
3612
|
+
}), u(Be, {})]
|
|
3613
|
+
}), u(tt, {
|
|
3604
3614
|
error: o.number
|
|
3605
3615
|
})]
|
|
3606
3616
|
});
|
|
3607
|
-
},
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
countryCode: "",
|
|
3611
|
-
phoneNumber: ""
|
|
3612
|
-
};
|
|
3613
|
-
const r = Object.entries(Gt).find((s) => e.startsWith(s[1])), t = r ? r[1] : "", n = e.replace(t, "");
|
|
3614
|
-
return /^\d+$/.test(n) ? {
|
|
3615
|
-
countryCode: t,
|
|
3616
|
-
phoneNumber: n
|
|
3617
|
-
} : {
|
|
3618
|
-
countryCode: "",
|
|
3619
|
-
phoneNumber: ""
|
|
3620
|
-
};
|
|
3621
|
-
}, ai = "44", ii = /^[0-9 ]+$/, oi = et("string"), li = et("phone"), ci = (e) => {
|
|
3622
|
-
const r = /* @__PURE__ */ Ve(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(ii, e("validation_country_code"))), t = /* @__PURE__ */ Ve(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((n) => n.replace(/[^0-9]/g, "")));
|
|
3623
|
-
return St(/* @__PURE__ */ ke({
|
|
3617
|
+
}, ai = "44", ii = /^[0-9 ]+$/, oi = et("string"), li = et("phone"), ui = (e) => {
|
|
3618
|
+
const r = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(ii, e("validation_country_code"))), t = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((n) => n.replace(/[^0-9]/g, "")));
|
|
3619
|
+
return St(/* @__PURE__ */ Ce({
|
|
3624
3620
|
countryCode: r,
|
|
3625
3621
|
phoneNumber: t
|
|
3626
3622
|
}));
|
|
3627
|
-
},
|
|
3623
|
+
}, ci = ({
|
|
3628
3624
|
input: e,
|
|
3629
3625
|
onSubmitSuccess: r
|
|
3630
3626
|
}) => {
|
|
3631
3627
|
var _;
|
|
3632
3628
|
const t = e.key ? (_ = q.current$.value.flow) == null ? void 0 : _.data.submissions[e.key] : void 0, {
|
|
3633
3629
|
t: n
|
|
3634
|
-
} = ne(), [s, i] =
|
|
3630
|
+
} = ne(), [s, i] = ke(), a = oi(t) ? ua(t.value) : li(t) ? t.value : void 0, {
|
|
3635
3631
|
register: o,
|
|
3636
|
-
handleSubmit:
|
|
3632
|
+
handleSubmit: c,
|
|
3637
3633
|
formState: {
|
|
3638
3634
|
errors: f
|
|
3639
3635
|
},
|
|
@@ -3643,19 +3639,19 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3643
3639
|
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? ai,
|
|
3644
3640
|
phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3645
3641
|
},
|
|
3646
|
-
resolver:
|
|
3642
|
+
resolver: ui(n)
|
|
3647
3643
|
}), {
|
|
3648
3644
|
ref: b,
|
|
3649
3645
|
...p
|
|
3650
3646
|
} = o("phoneNumber", {
|
|
3651
3647
|
required: !e.config.optional
|
|
3652
3648
|
}), y = ye(), C = v("countryCode");
|
|
3653
|
-
return
|
|
3649
|
+
return Le(() => {
|
|
3654
3650
|
y.current && (y.current.focus(), y.current.select());
|
|
3655
|
-
}, []),
|
|
3651
|
+
}, []), u("form", {
|
|
3656
3652
|
noValidate: !0,
|
|
3657
3653
|
class: "flex flex-col gap-1 p-2.5",
|
|
3658
|
-
onSubmit:
|
|
3654
|
+
onSubmit: c((k) => {
|
|
3659
3655
|
const E = k.phoneNumber.replace(/[^0-9]/g, ""), g = k.countryCode.replace(/[^0-9]/g, "");
|
|
3660
3656
|
i(void 0);
|
|
3661
3657
|
const N = e.config.minChars ?? 7, V = E.length + g.length;
|
|
@@ -3679,25 +3675,25 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3679
3675
|
value: C + k.phoneNumber
|
|
3680
3676
|
});
|
|
3681
3677
|
}),
|
|
3682
|
-
children: [
|
|
3678
|
+
children: [u("div", {
|
|
3683
3679
|
class: "flex items-center gap-2",
|
|
3684
|
-
children: [
|
|
3680
|
+
children: [u("div", {
|
|
3685
3681
|
class: "relative flex min-w-0 flex-1 flex-grow gap-2",
|
|
3686
|
-
children: [
|
|
3682
|
+
children: [u("label", {
|
|
3687
3683
|
class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
|
|
3688
3684
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3689
|
-
children: [
|
|
3685
|
+
children: [u("span", {
|
|
3690
3686
|
children: ["+", C]
|
|
3691
|
-
}),
|
|
3687
|
+
}), u("select", {
|
|
3692
3688
|
...o("countryCode", {}),
|
|
3693
3689
|
id: `isdk_phone_${e.key}`,
|
|
3694
3690
|
class: "absolute inset-0 opacity-0",
|
|
3695
|
-
children: Object.entries(Gt).map(([k, E]) =>
|
|
3691
|
+
children: Object.entries(Gt).map(([k, E]) => u("option", {
|
|
3696
3692
|
value: E,
|
|
3697
3693
|
children: [k, " (+", E, ")"]
|
|
3698
3694
|
}, k))
|
|
3699
3695
|
})]
|
|
3700
|
-
}),
|
|
3696
|
+
}), u("input", {
|
|
3701
3697
|
...p,
|
|
3702
3698
|
id: "chat-input",
|
|
3703
3699
|
type: "tel",
|
|
@@ -3714,12 +3710,12 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3714
3710
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3715
3711
|
}),
|
|
3716
3712
|
placeholder: e.config.placeholder
|
|
3717
|
-
}), e.config.optional &&
|
|
3713
|
+
}), e.config.optional && u(Se, {
|
|
3718
3714
|
class: "absolute bottom-0 right-1 top-0",
|
|
3719
3715
|
onClick: () => r(null)
|
|
3720
3716
|
})]
|
|
3721
|
-
}),
|
|
3722
|
-
}),
|
|
3717
|
+
}), u(Be, {})]
|
|
3718
|
+
}), u(tt, {
|
|
3723
3719
|
error: f.countryCode || f.phoneNumber || {
|
|
3724
3720
|
message: s
|
|
3725
3721
|
}
|
|
@@ -3729,7 +3725,10 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3729
3725
|
time: qr(t, r)
|
|
3730
3726
|
}) : e("submission_cooldown", {
|
|
3731
3727
|
count: n
|
|
3732
|
-
}), di = ({
|
|
3728
|
+
}), di = (e, r) => {
|
|
3729
|
+
const t = e == null ? void 0 : e.trim();
|
|
3730
|
+
return t && t !== "Submit" ? t : r("submit");
|
|
3731
|
+
}, fi = ({
|
|
3733
3732
|
input: e,
|
|
3734
3733
|
onSubmitSuccess: r
|
|
3735
3734
|
}) => {
|
|
@@ -3738,22 +3737,22 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3738
3737
|
locale: n
|
|
3739
3738
|
} = ne(), {
|
|
3740
3739
|
availableAt: s
|
|
3741
|
-
} = e.config, [i, a] =
|
|
3740
|
+
} = e.config, [i, a] = ke(() => yt(s)), [o, c] = ke("");
|
|
3742
3741
|
Wr(() => {
|
|
3743
3742
|
const v = yt(s);
|
|
3744
3743
|
if (a(v), v === 0)
|
|
3745
3744
|
return;
|
|
3746
|
-
|
|
3745
|
+
c(Tr(t, n, s, v));
|
|
3747
3746
|
const b = setInterval(() => {
|
|
3748
3747
|
const p = yt(s);
|
|
3749
|
-
a(p), !(p > 0) && (clearInterval(b),
|
|
3748
|
+
a(p), !(p > 0) && (clearInterval(b), c(t("submission_cooldown_ready")));
|
|
3750
3749
|
}, 250);
|
|
3751
3750
|
return () => clearInterval(b);
|
|
3752
3751
|
}, [s, n, t]);
|
|
3753
3752
|
const f = i > 0;
|
|
3754
|
-
return
|
|
3753
|
+
return u("div", {
|
|
3755
3754
|
class: "flex flex-col items-center gap-2 py-3",
|
|
3756
|
-
children: [
|
|
3755
|
+
children: [u("button", {
|
|
3757
3756
|
class: "bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 aria-disabled:hover:bg-accent-9 aria-disabled:hover:border-accent-9 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:active:ring-1 aria-disabled:active:ring-offset-[1.5px]",
|
|
3758
3757
|
name: e.key,
|
|
3759
3758
|
"aria-disabled": f,
|
|
@@ -3761,12 +3760,12 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3761
3760
|
onClick: () => {
|
|
3762
3761
|
yt(s) > 0 || r(null);
|
|
3763
3762
|
},
|
|
3764
|
-
children:
|
|
3763
|
+
children: u("span", {
|
|
3765
3764
|
class: "flex items-center gap-1.5",
|
|
3766
|
-
children: [
|
|
3765
|
+
children: [u("span", {
|
|
3767
3766
|
class: "inline-flex items-center text-sm font-medium",
|
|
3768
|
-
children: e.config.label
|
|
3769
|
-
}),
|
|
3767
|
+
children: di(e.config.label, t)
|
|
3768
|
+
}), u("svg", {
|
|
3770
3769
|
stroke: "currentColor",
|
|
3771
3770
|
"stroke-width": "1.5",
|
|
3772
3771
|
width: "16",
|
|
@@ -3774,27 +3773,27 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3774
3773
|
viewBox: "0 0 16 16",
|
|
3775
3774
|
fill: "none",
|
|
3776
3775
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3777
|
-
children: [
|
|
3776
|
+
children: [u("path", {
|
|
3778
3777
|
d: "M4 8L8 4L12 8"
|
|
3779
|
-
}),
|
|
3778
|
+
}), u("path", {
|
|
3780
3779
|
d: "M8 4V13"
|
|
3781
3780
|
})]
|
|
3782
3781
|
})]
|
|
3783
3782
|
})
|
|
3784
|
-
}), f &&
|
|
3783
|
+
}), f && u("p", {
|
|
3785
3784
|
id: "submit-cooldown",
|
|
3786
3785
|
"aria-hidden": "true",
|
|
3787
3786
|
class: "text-neutral-11 text-xs",
|
|
3788
3787
|
children: Tr(t, n, s, i)
|
|
3789
|
-
}),
|
|
3788
|
+
}), u("p", {
|
|
3790
3789
|
role: "status",
|
|
3791
3790
|
class: "sr-only",
|
|
3792
3791
|
children: o
|
|
3793
3792
|
})]
|
|
3794
3793
|
});
|
|
3795
|
-
},
|
|
3796
|
-
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
3797
|
-
},
|
|
3794
|
+
}, hi = 160, Dr = (e) => {
|
|
3795
|
+
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, hi)}px`;
|
|
3796
|
+
}, pi = {
|
|
3798
3797
|
date: {
|
|
3799
3798
|
type: "date",
|
|
3800
3799
|
inputMode: "text"
|
|
@@ -3813,7 +3812,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3813
3812
|
inputMode: "url",
|
|
3814
3813
|
formNoValidate: !0
|
|
3815
3814
|
}
|
|
3816
|
-
},
|
|
3815
|
+
}, mi = et("string"), yi = (e, r) => {
|
|
3817
3816
|
const t = {
|
|
3818
3817
|
maxLength: r("validation_max_chars", {
|
|
3819
3818
|
count: e.maxChars ?? 999
|
|
@@ -3822,15 +3821,15 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3822
3821
|
count: e.minChars ?? 1
|
|
3823
3822
|
})
|
|
3824
3823
|
};
|
|
3825
|
-
return St(/* @__PURE__ */
|
|
3824
|
+
return St(/* @__PURE__ */ Ce({
|
|
3826
3825
|
text: {
|
|
3827
|
-
date: /* @__PURE__ */
|
|
3828
|
-
email: /* @__PURE__ */
|
|
3829
|
-
text: /* @__PURE__ */
|
|
3830
|
-
url: /* @__PURE__ */
|
|
3826
|
+
date: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_date")), /* @__PURE__ */ Ht(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3827
|
+
email: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_email")), /* @__PURE__ */ Yr(r("validation_email")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ut(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3828
|
+
text: /* @__PURE__ */ Me(/* @__PURE__ */ le(), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ut(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3829
|
+
url: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_url")), /* @__PURE__ */ tn(r("validation_url")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ut(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3831
3830
|
}[e.format]
|
|
3832
3831
|
}));
|
|
3833
|
-
},
|
|
3832
|
+
}, bi = ({
|
|
3834
3833
|
input: e,
|
|
3835
3834
|
onSubmitSuccess: r
|
|
3836
3835
|
}) => {
|
|
@@ -3840,26 +3839,26 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3840
3839
|
} = ne(), n = e.key ? (_ = q.current$.value.flow) == null ? void 0 : _.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
|
|
3841
3840
|
register: a,
|
|
3842
3841
|
handleSubmit: o,
|
|
3843
|
-
watch:
|
|
3842
|
+
watch: c,
|
|
3844
3843
|
formState: {
|
|
3845
3844
|
errors: f
|
|
3846
3845
|
}
|
|
3847
3846
|
} = Ct({
|
|
3848
3847
|
defaultValues: {
|
|
3849
|
-
text:
|
|
3848
|
+
text: mi(n) ? n.value : s ?? ""
|
|
3850
3849
|
},
|
|
3851
|
-
resolver:
|
|
3850
|
+
resolver: yi(e.config, t)
|
|
3852
3851
|
}), {
|
|
3853
3852
|
ref: v,
|
|
3854
3853
|
...b
|
|
3855
3854
|
} = a("text", {
|
|
3856
3855
|
required: !e.config.optional
|
|
3857
3856
|
}), p = ye();
|
|
3858
|
-
|
|
3857
|
+
Le(() => {
|
|
3859
3858
|
p.current && (p.current instanceof HTMLTextAreaElement && Dr(p.current), p.current.focus(), p.current.select());
|
|
3860
3859
|
}, []);
|
|
3861
|
-
const y = e.config.maxChars, C = i && y !== void 0 ?
|
|
3862
|
-
return
|
|
3860
|
+
const y = e.config.maxChars, C = i && y !== void 0 ? c("text").length : void 0;
|
|
3861
|
+
return u("form", {
|
|
3863
3862
|
noValidate: !0,
|
|
3864
3863
|
class: "flex flex-col gap-1 p-2.5",
|
|
3865
3864
|
onSubmit: o((k) => {
|
|
@@ -3868,11 +3867,11 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3868
3867
|
value: k.text
|
|
3869
3868
|
});
|
|
3870
3869
|
}),
|
|
3871
|
-
children: [
|
|
3870
|
+
children: [u("div", {
|
|
3872
3871
|
class: i ? "flex items-end gap-2" : "flex items-center gap-2",
|
|
3873
|
-
children: [
|
|
3872
|
+
children: [u("div", {
|
|
3874
3873
|
class: "relative min-w-0 flex-1",
|
|
3875
|
-
children: [i ?
|
|
3874
|
+
children: [i ? u("textarea", {
|
|
3876
3875
|
id: "chat-input",
|
|
3877
3876
|
...b,
|
|
3878
3877
|
rows: 2,
|
|
@@ -3892,10 +3891,10 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3892
3891
|
optional: !!e.config.optional,
|
|
3893
3892
|
className: "block w-full resize-none overflow-y-auto rounded-2xl"
|
|
3894
3893
|
})
|
|
3895
|
-
}) :
|
|
3894
|
+
}) : u("input", {
|
|
3896
3895
|
id: "chat-input",
|
|
3897
3896
|
...b,
|
|
3898
|
-
...
|
|
3897
|
+
...pi[e.config.format],
|
|
3899
3898
|
autocomplete: "off",
|
|
3900
3899
|
autoCapitalize: "off",
|
|
3901
3900
|
autoCorrect: "off",
|
|
@@ -3908,60 +3907,60 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3908
3907
|
optional: !!e.config.optional,
|
|
3909
3908
|
className: "w-full rounded-full"
|
|
3910
3909
|
})
|
|
3911
|
-
}), e.config.optional &&
|
|
3912
|
-
|
|
3910
|
+
}), e.config.optional && u(
|
|
3911
|
+
Se,
|
|
3913
3912
|
{
|
|
3914
3913
|
class: i ? "absolute bottom-1 right-0.5" : "absolute bottom-0 right-0.5 top-0",
|
|
3915
3914
|
onClick: () => r(null)
|
|
3916
3915
|
}
|
|
3917
3916
|
)]
|
|
3918
|
-
}),
|
|
3919
|
-
}), C !== void 0 && y !== void 0 &&
|
|
3917
|
+
}), u(Be, {})]
|
|
3918
|
+
}), C !== void 0 && y !== void 0 && u("p", {
|
|
3920
3919
|
id: "chat-input-count",
|
|
3921
3920
|
class: "text-neutral-10 px-3 text-right text-xs",
|
|
3922
3921
|
children: [C, "/", y]
|
|
3923
|
-
}),
|
|
3922
|
+
}), u(tt, {
|
|
3924
3923
|
error: f.text
|
|
3925
3924
|
})]
|
|
3926
3925
|
});
|
|
3927
|
-
},
|
|
3928
|
-
text:
|
|
3929
|
-
phone:
|
|
3930
|
-
"multiple-choice":
|
|
3931
|
-
boolean:
|
|
3932
|
-
file:
|
|
3933
|
-
submit:
|
|
3934
|
-
address:
|
|
3935
|
-
number:
|
|
3936
|
-
},
|
|
3926
|
+
}, gi = {
|
|
3927
|
+
text: bi,
|
|
3928
|
+
phone: ci,
|
|
3929
|
+
"multiple-choice": ti,
|
|
3930
|
+
boolean: va,
|
|
3931
|
+
file: Sa,
|
|
3932
|
+
submit: fi,
|
|
3933
|
+
address: ma,
|
|
3934
|
+
number: si
|
|
3935
|
+
}, vi = ({
|
|
3937
3936
|
logger: e,
|
|
3938
3937
|
analytics: r
|
|
3939
3938
|
}) => {
|
|
3940
3939
|
var i;
|
|
3941
|
-
const t = (i = q.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () =>
|
|
3942
|
-
return
|
|
3940
|
+
const t = (i = q.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () => ue.onInteractionFn$.value();
|
|
3941
|
+
return Le(() => {
|
|
3943
3942
|
var a;
|
|
3944
3943
|
(a = n.current) == null || a.scrollTo({
|
|
3945
3944
|
top: 0
|
|
3946
3945
|
});
|
|
3947
|
-
}, [t]),
|
|
3946
|
+
}, [t]), u("div", {
|
|
3948
3947
|
ref: n,
|
|
3949
3948
|
class: "border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",
|
|
3950
|
-
children:
|
|
3949
|
+
children: u("div", {
|
|
3951
3950
|
class: "flex flex-col",
|
|
3952
3951
|
onPointerDownCapture: t ? s : void 0,
|
|
3953
3952
|
onKeyDownCapture: t ? s : void 0,
|
|
3954
3953
|
children: t ? (() => {
|
|
3955
|
-
const a =
|
|
3956
|
-
return
|
|
3954
|
+
const a = gi[t.type];
|
|
3955
|
+
return u(a, {
|
|
3957
3956
|
logger: e,
|
|
3958
3957
|
analytics: r,
|
|
3959
|
-
onSubmitSuccess:
|
|
3958
|
+
onSubmitSuccess: ue.onSubmitSuccessFn$.value,
|
|
3960
3959
|
input: t
|
|
3961
3960
|
});
|
|
3962
|
-
})() :
|
|
3961
|
+
})() : u("div", {
|
|
3963
3962
|
class: "flex items-center gap-2 p-2.5",
|
|
3964
|
-
children: [
|
|
3963
|
+
children: [u("input", {
|
|
3965
3964
|
"aria-hidden": "true",
|
|
3966
3965
|
id: "chat-input",
|
|
3967
3966
|
class: Ye({
|
|
@@ -3969,7 +3968,7 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3969
3968
|
className: "flex-grow rounded-full"
|
|
3970
3969
|
}),
|
|
3971
3970
|
disabled: !0
|
|
3972
|
-
}),
|
|
3971
|
+
}), u(Be, {
|
|
3973
3972
|
disabled: !0,
|
|
3974
3973
|
"aria-hidden": "true",
|
|
3975
3974
|
tabIndex: -1
|
|
@@ -3978,31 +3977,31 @@ const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
|
3978
3977
|
})
|
|
3979
3978
|
});
|
|
3980
3979
|
};
|
|
3981
|
-
function
|
|
3980
|
+
function xi(e) {
|
|
3982
3981
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3983
3982
|
}
|
|
3984
|
-
var
|
|
3983
|
+
var wi = function(e) {
|
|
3985
3984
|
return e instanceof RegExp;
|
|
3986
|
-
},
|
|
3985
|
+
}, _i = function(r) {
|
|
3987
3986
|
var t = /[\\^$.*+?()[\]{}|]/g, n = RegExp(t.source);
|
|
3988
3987
|
return r && n.test(r) ? r.replace(t, "\\$&") : r;
|
|
3989
3988
|
}, wn = function(e) {
|
|
3990
3989
|
return typeof e == "string";
|
|
3991
|
-
},
|
|
3990
|
+
}, ki = function(e) {
|
|
3992
3991
|
var r = [];
|
|
3993
3992
|
return e.forEach(function(t) {
|
|
3994
3993
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
3995
3994
|
}), r;
|
|
3996
3995
|
};
|
|
3997
|
-
function
|
|
3996
|
+
function Ci(e, r, t) {
|
|
3998
3997
|
var n = 0, s = 0;
|
|
3999
3998
|
if (e === "")
|
|
4000
3999
|
return e;
|
|
4001
4000
|
if (!e || !wn(e))
|
|
4002
4001
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4003
4002
|
var i = r;
|
|
4004
|
-
|
|
4005
|
-
for (var a = e.split(i), o = 1,
|
|
4003
|
+
wi(i) || (i = new RegExp("(" + _i(i) + ")", "gi"));
|
|
4004
|
+
for (var a = e.split(i), o = 1, c = a.length; o < c; o += 2) {
|
|
4006
4005
|
if (a[o] === void 0 || a[o - 1] === void 0) {
|
|
4007
4006
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
4008
4007
|
continue;
|
|
@@ -4011,33 +4010,33 @@ function ki(e, r, t) {
|
|
|
4011
4010
|
}
|
|
4012
4011
|
return a;
|
|
4013
4012
|
}
|
|
4014
|
-
var
|
|
4015
|
-
return Array.isArray(r) || (r = [r]),
|
|
4016
|
-
return wn(s) ?
|
|
4013
|
+
var Si = function(r, t, n) {
|
|
4014
|
+
return Array.isArray(r) || (r = [r]), ki(r.map(function(s) {
|
|
4015
|
+
return wn(s) ? Ci(s, t, n) : s;
|
|
4017
4016
|
}));
|
|
4018
4017
|
};
|
|
4019
|
-
const ot = /* @__PURE__ */
|
|
4020
|
-
const r = ot(e,
|
|
4021
|
-
const [, f, v] = o.match(
|
|
4022
|
-
return v ?
|
|
4018
|
+
const ot = /* @__PURE__ */ xi(Si), Ei = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]+)\]\(([^)]+)\)/, Ii = /(https?:\/\/[^\s]+)/g, Fi = /_(.*?)_/g, Vi = /\*\*(.*?)\*\*/g, Mi = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Li = (e) => {
|
|
4019
|
+
const r = ot(e, Ei, (o, c) => {
|
|
4020
|
+
const [, f, v] = o.match(Ai) ?? [];
|
|
4021
|
+
return v ? u("a", {
|
|
4023
4022
|
class: Or,
|
|
4024
4023
|
href: v,
|
|
4025
4024
|
children: f ?? v
|
|
4026
|
-
}, v +
|
|
4025
|
+
}, v + c) : u("span", {
|
|
4027
4026
|
children: "INVALID LINK"
|
|
4028
4027
|
});
|
|
4029
|
-
}), t = ot(r,
|
|
4028
|
+
}), t = ot(r, Ii, (o, c) => u("a", {
|
|
4030
4029
|
class: Or,
|
|
4031
4030
|
href: o,
|
|
4032
4031
|
children: o
|
|
4033
|
-
}, o +
|
|
4032
|
+
}, o + c)), n = ot(t, Fi, (o, c) => u("em", {
|
|
4034
4033
|
children: o
|
|
4035
|
-
}, o +
|
|
4034
|
+
}, o + c)), s = ot(n, Vi, (o, c) => u("strong", {
|
|
4036
4035
|
children: o
|
|
4037
|
-
}, o +
|
|
4036
|
+
}, o + c));
|
|
4038
4037
|
let i = 0;
|
|
4039
|
-
return ot(s,
|
|
4040
|
-
},
|
|
4038
|
+
return ot(s, Mi, () => u("br", {}, `br-${i++}`));
|
|
4039
|
+
}, Ni = xt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
|
|
4041
4040
|
variants: {
|
|
4042
4041
|
side: {
|
|
4043
4042
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4051,40 +4050,40 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4051
4050
|
defaultVariants: {
|
|
4052
4051
|
side: "left"
|
|
4053
4052
|
}
|
|
4054
|
-
}),
|
|
4053
|
+
}), Ri = ({
|
|
4055
4054
|
children: e,
|
|
4056
4055
|
className: r,
|
|
4057
4056
|
animate: t,
|
|
4058
4057
|
side: n,
|
|
4059
4058
|
...s
|
|
4060
|
-
}) =>
|
|
4059
|
+
}) => u("p", {
|
|
4061
4060
|
style: {
|
|
4062
4061
|
transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
|
|
4063
4062
|
},
|
|
4064
|
-
class:
|
|
4063
|
+
class: Ni({
|
|
4065
4064
|
className: r,
|
|
4066
4065
|
side: n,
|
|
4067
4066
|
animate: t
|
|
4068
4067
|
}),
|
|
4069
4068
|
...s,
|
|
4070
4069
|
children: e
|
|
4071
|
-
}),
|
|
4070
|
+
}), Ti = ({
|
|
4072
4071
|
message: e
|
|
4073
|
-
}) =>
|
|
4072
|
+
}) => u("div", {
|
|
4074
4073
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
4075
|
-
children:
|
|
4074
|
+
children: u("a", {
|
|
4076
4075
|
onClick: e.onClick,
|
|
4077
4076
|
class: "bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",
|
|
4078
4077
|
target: "_blank",
|
|
4079
4078
|
href: e.href,
|
|
4080
|
-
children: [e.text,
|
|
4079
|
+
children: [e.text, u("svg", {
|
|
4081
4080
|
class: "flex-none",
|
|
4082
4081
|
width: "15",
|
|
4083
4082
|
height: "15",
|
|
4084
4083
|
viewBox: "0 0 15 15",
|
|
4085
4084
|
fill: "none",
|
|
4086
4085
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4087
|
-
children:
|
|
4086
|
+
children: u("path", {
|
|
4088
4087
|
d: "M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",
|
|
4089
4088
|
fill: "currentColor",
|
|
4090
4089
|
"fill-rule": "evenodd",
|
|
@@ -4092,28 +4091,28 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4092
4091
|
})
|
|
4093
4092
|
})]
|
|
4094
4093
|
})
|
|
4095
|
-
}),
|
|
4094
|
+
}), Di = ({
|
|
4096
4095
|
className: e,
|
|
4097
4096
|
...r
|
|
4098
|
-
}) =>
|
|
4097
|
+
}) => u("div", {
|
|
4099
4098
|
"aria-hidden": !0,
|
|
4100
|
-
children:
|
|
4099
|
+
children: ue.isBotTyping$.value === !0 ? u("div", {
|
|
4101
4100
|
"data-testid": "typing-indicator",
|
|
4102
4101
|
class: Qe("flex gap-1 p-4", e),
|
|
4103
4102
|
...r,
|
|
4104
4103
|
children: Array.from({
|
|
4105
4104
|
length: 3
|
|
4106
|
-
}, (t, n) =>
|
|
4105
|
+
}, (t, n) => u("div", {
|
|
4107
4106
|
class: "bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",
|
|
4108
4107
|
style: {
|
|
4109
4108
|
animationDelay: `${-n * 200}ms`
|
|
4110
4109
|
}
|
|
4111
4110
|
}))
|
|
4112
4111
|
}) : void 0
|
|
4113
|
-
}),
|
|
4112
|
+
}), Oi = {
|
|
4114
4113
|
bot: "left",
|
|
4115
4114
|
user: "right"
|
|
4116
|
-
},
|
|
4115
|
+
}, Bi = xt("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)]", {
|
|
4117
4116
|
variants: {
|
|
4118
4117
|
variant: {
|
|
4119
4118
|
info: "text-neutral-11",
|
|
@@ -4122,46 +4121,46 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4122
4121
|
success: "text-system-success"
|
|
4123
4122
|
}
|
|
4124
4123
|
}
|
|
4125
|
-
}),
|
|
4124
|
+
}), $i = ({
|
|
4126
4125
|
lastSentMessageFooter: e
|
|
4127
4126
|
}) => {
|
|
4128
4127
|
const {
|
|
4129
4128
|
t: r
|
|
4130
4129
|
} = ne(), t = q.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? zt(t) : void 0;
|
|
4131
|
-
return
|
|
4130
|
+
return u("ol", {
|
|
4132
4131
|
"aria-label": r("chat_messages"),
|
|
4133
4132
|
"aria-live": "polite",
|
|
4134
4133
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4135
|
-
children: [n.map((i, a) =>
|
|
4136
|
-
children:
|
|
4134
|
+
children: [n.map((i, a) => u(be, {
|
|
4135
|
+
children: u("li", {
|
|
4137
4136
|
class: "flex",
|
|
4138
4137
|
tabIndex: a === n.length - 1 ? -1 : void 0,
|
|
4139
|
-
children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null,
|
|
4138
|
+
children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, Hn(i).with({
|
|
4140
4139
|
type: "system"
|
|
4141
|
-
}, (o) =>
|
|
4142
|
-
class:
|
|
4140
|
+
}, (o) => u("p", {
|
|
4141
|
+
class: Bi({
|
|
4143
4142
|
variant: o.variant
|
|
4144
4143
|
}),
|
|
4145
4144
|
children: o.text
|
|
4146
4145
|
})).with({
|
|
4147
4146
|
type: "text",
|
|
4148
|
-
author:
|
|
4147
|
+
author: Kn.union("bot", "user")
|
|
4149
4148
|
}, (o) => {
|
|
4150
|
-
const
|
|
4151
|
-
return
|
|
4152
|
-
children:
|
|
4153
|
-
animate:
|
|
4154
|
-
side:
|
|
4149
|
+
const c = a === n.length - 1, f = o.author === "bot" ? Li(o.text) : o.text;
|
|
4150
|
+
return u(be, {
|
|
4151
|
+
children: u(Ri, {
|
|
4152
|
+
animate: c,
|
|
4153
|
+
side: Oi[o.author],
|
|
4155
4154
|
children: f
|
|
4156
4155
|
}, a)
|
|
4157
4156
|
});
|
|
4158
4157
|
}).with({
|
|
4159
4158
|
type: "link"
|
|
4160
|
-
}, (o) =>
|
|
4159
|
+
}, (o) => u(Ti, {
|
|
4161
4160
|
message: o
|
|
4162
4161
|
})).with({
|
|
4163
4162
|
type: "image"
|
|
4164
|
-
}, (o) =>
|
|
4163
|
+
}, (o) => u("img", {
|
|
4165
4164
|
class: "shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",
|
|
4166
4165
|
src: o.url,
|
|
4167
4166
|
style: {
|
|
@@ -4169,7 +4168,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4169
4168
|
}
|
|
4170
4169
|
})).with({
|
|
4171
4170
|
type: "file"
|
|
4172
|
-
}, (o) =>
|
|
4171
|
+
}, (o) => u(wa, {
|
|
4173
4172
|
class: o.author === "bot" ? void 0 : "ml-auto",
|
|
4174
4173
|
file: {
|
|
4175
4174
|
name: o.fileName,
|
|
@@ -4178,13 +4177,13 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4178
4177
|
})).with({
|
|
4179
4178
|
type: "loading"
|
|
4180
4179
|
}, (o) => {
|
|
4181
|
-
const
|
|
4182
|
-
return !(o ===
|
|
4180
|
+
const c = n[n.length - 1];
|
|
4181
|
+
return !(o === c) || ue.isBotTyping$.value || t != null && t.data.isFinished ? null : u("div", {
|
|
4183
4182
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4184
|
-
children: [
|
|
4183
|
+
children: [u(Ut, {
|
|
4185
4184
|
"aria-hidden": o.text ? "true" : void 0,
|
|
4186
4185
|
class: "text-neutral-6 h-8 w-8"
|
|
4187
|
-
}), o.text ?
|
|
4186
|
+
}), o.text ? u("p", {
|
|
4188
4187
|
role: "status",
|
|
4189
4188
|
class: "text-neutral-11 text-sm",
|
|
4190
4189
|
children: o.text
|
|
@@ -4192,18 +4191,18 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4192
4191
|
});
|
|
4193
4192
|
}).exhaustive()]
|
|
4194
4193
|
})
|
|
4195
|
-
}, a)),
|
|
4196
|
-
class:
|
|
4197
|
-
children:
|
|
4194
|
+
}, a)), u("li", {
|
|
4195
|
+
class: ue.captchaVisible$.value ? "flex" : "hidden",
|
|
4196
|
+
children: u("div", {
|
|
4198
4197
|
"data-captcha-slot": !0,
|
|
4199
4198
|
tabIndex: -1,
|
|
4200
4199
|
role: "group",
|
|
4201
4200
|
"aria-label": r("captcha_check"),
|
|
4202
4201
|
class: "w-full max-w-[min(100%,24rem)] rounded-md"
|
|
4203
4202
|
})
|
|
4204
|
-
}, "captcha"),
|
|
4203
|
+
}, "captcha"), u(Di, {}, "typing")]
|
|
4205
4204
|
});
|
|
4206
|
-
},
|
|
4205
|
+
}, Wi = ({
|
|
4207
4206
|
logger: e,
|
|
4208
4207
|
apiClient: r,
|
|
4209
4208
|
analytics: t,
|
|
@@ -4216,32 +4215,32 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4216
4215
|
const i = q.viewState$.value, {
|
|
4217
4216
|
chatRef: a,
|
|
4218
4217
|
chatService: o
|
|
4219
|
-
} =
|
|
4220
|
-
t:
|
|
4221
|
-
} = ne(), [f, v] =
|
|
4222
|
-
return
|
|
4223
|
-
i === "maximised" &&
|
|
4224
|
-
}, [i]),
|
|
4218
|
+
} = Gn(), {
|
|
4219
|
+
t: c
|
|
4220
|
+
} = ne(), [f, v] = ke();
|
|
4221
|
+
return Le(() => {
|
|
4222
|
+
i === "maximised" && ue.scrollToEnd();
|
|
4223
|
+
}, [i]), Le(() => {
|
|
4225
4224
|
var M;
|
|
4226
4225
|
const {
|
|
4227
4226
|
state: b,
|
|
4228
4227
|
flow: p
|
|
4229
4228
|
} = q.current$.peek();
|
|
4230
4229
|
if (b !== "loaded")
|
|
4231
|
-
throw new Error(
|
|
4230
|
+
throw new Error(c("invalid_state"));
|
|
4232
4231
|
let y = p.data.nodeHistory.at(-1);
|
|
4233
|
-
if (
|
|
4232
|
+
if (ue.scrollToEnd(), q.setInput(void 0), p.data.isFinished)
|
|
4234
4233
|
return;
|
|
4235
4234
|
const C = () => {
|
|
4236
4235
|
const O = q.current$.peek().flow;
|
|
4237
4236
|
!O || O.data.hasInteracted || (q.markAsInteracted(), dr(t, O, "FLOW_INTERACT"));
|
|
4238
4237
|
};
|
|
4239
|
-
|
|
4238
|
+
ue.onInteractionFn$.value = C, y === void 0 ? (y = Gr(s.nodes).id, q.setCurrentNodeId(y), dr(t, p, "FLOW_START")) : q.removeMessagesSentByNodeIds([y, jt]);
|
|
4240
4239
|
const {
|
|
4241
4240
|
interpret: _,
|
|
4242
4241
|
abort: k,
|
|
4243
4242
|
undo: E
|
|
4244
|
-
} =
|
|
4243
|
+
} = Cs({
|
|
4245
4244
|
context: s.context,
|
|
4246
4245
|
analytics: {
|
|
4247
4246
|
service: t,
|
|
@@ -4252,7 +4251,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4252
4251
|
talentBankClient: n,
|
|
4253
4252
|
flow: s,
|
|
4254
4253
|
chatService: o,
|
|
4255
|
-
t:
|
|
4254
|
+
t: c,
|
|
4256
4255
|
getApplicationRecovery: () => {
|
|
4257
4256
|
var O;
|
|
4258
4257
|
return (O = q.current$.peek().flow) == null ? void 0 : O.data.applicationRecovery;
|
|
@@ -4284,61 +4283,61 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4284
4283
|
}), g = y, N = () => {
|
|
4285
4284
|
v(() => E), _(g);
|
|
4286
4285
|
}, V = new AbortController();
|
|
4287
|
-
return p.offerResume ?
|
|
4286
|
+
return p.offerResume ? Js({
|
|
4288
4287
|
chatService: o,
|
|
4289
|
-
t:
|
|
4288
|
+
t: c,
|
|
4290
4289
|
signal: V.signal
|
|
4291
|
-
}).then((O) => (q.settleResume(p), O ? N() : (q.restart(),
|
|
4290
|
+
}).then((O) => (q.settleResume(p), O ? N() : (q.restart(), Jn.flushStateData()))).catch((O) => {
|
|
4292
4291
|
O instanceof jr || e.error("Resume prompt failed", O);
|
|
4293
4292
|
}) : N(), () => {
|
|
4294
|
-
V.abort(),
|
|
4293
|
+
V.abort(), ue.onInteractionFn$.value === C && (ue.onInteractionFn$.value = () => {
|
|
4295
4294
|
}), k();
|
|
4296
4295
|
};
|
|
4297
|
-
}, [t, r, o, e, s, n,
|
|
4298
|
-
children: [
|
|
4296
|
+
}, [t, r, o, e, s, n, c]), u(be, {
|
|
4297
|
+
children: [u("div", {
|
|
4299
4298
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4300
|
-
children: [
|
|
4299
|
+
children: [u("div", {
|
|
4301
4300
|
ref: a,
|
|
4302
4301
|
role: "region",
|
|
4303
|
-
"aria-label":
|
|
4302
|
+
"aria-label": c("conversation_history"),
|
|
4304
4303
|
tabIndex: 0,
|
|
4305
4304
|
className: "hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",
|
|
4306
4305
|
style: {
|
|
4307
4306
|
WebkitOverflowScrolling: "touch"
|
|
4308
4307
|
},
|
|
4309
|
-
children:
|
|
4310
|
-
lastSentMessageFooter: !zt(s) || !f ? null :
|
|
4308
|
+
children: u($i, {
|
|
4309
|
+
lastSentMessageFooter: !zt(s) || !f ? null : u(ji, {
|
|
4311
4310
|
undoFn: f
|
|
4312
4311
|
})
|
|
4313
4312
|
})
|
|
4314
|
-
}),
|
|
4313
|
+
}), ue.isReadingHistory$.value && !s.data.isFinished && !ue.isBotTyping$.value && u("div", {
|
|
4315
4314
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4316
|
-
children:
|
|
4315
|
+
children: u(Hr, {
|
|
4317
4316
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4318
|
-
"aria-label":
|
|
4317
|
+
"aria-label": c("jump_to_current"),
|
|
4319
4318
|
onClick: () => {
|
|
4320
4319
|
var p, y;
|
|
4321
|
-
|
|
4320
|
+
ue.scrollToEnd(), (y = ((p = a.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? a.current) == null || y.focus({
|
|
4322
4321
|
preventScroll: !0
|
|
4323
4322
|
});
|
|
4324
4323
|
},
|
|
4325
|
-
children:
|
|
4324
|
+
children: u(Zn, {})
|
|
4326
4325
|
})
|
|
4327
4326
|
})]
|
|
4328
|
-
}),
|
|
4327
|
+
}), u(vi, {
|
|
4329
4328
|
logger: e,
|
|
4330
4329
|
analytics: t
|
|
4331
4330
|
})]
|
|
4332
4331
|
});
|
|
4333
|
-
},
|
|
4332
|
+
}, ji = ({
|
|
4334
4333
|
undoFn: e
|
|
4335
4334
|
}) => {
|
|
4336
4335
|
const {
|
|
4337
4336
|
t: r
|
|
4338
4337
|
} = ne();
|
|
4339
|
-
return
|
|
4338
|
+
return u("div", {
|
|
4340
4339
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4341
|
-
children:
|
|
4340
|
+
children: u(Hr, {
|
|
4342
4341
|
"aria-label": r("undo"),
|
|
4343
4342
|
onClick: async () => {
|
|
4344
4343
|
const {
|
|
@@ -4346,12 +4345,12 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4346
4345
|
} = q.current$.peek();
|
|
4347
4346
|
Oe(t), e(t.data.nodeHistory);
|
|
4348
4347
|
},
|
|
4349
|
-
children:
|
|
4348
|
+
children: u("path", {
|
|
4350
4349
|
d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
|
|
4351
4350
|
})
|
|
4352
4351
|
})
|
|
4353
4352
|
});
|
|
4354
4353
|
};
|
|
4355
4354
|
export {
|
|
4356
|
-
|
|
4355
|
+
Wi as ChatbotBody
|
|
4357
4356
|
};
|