@foisit/vue-wrapper 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -3,22 +3,22 @@
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- const se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {}, ze = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [], we = () => {
6
+ const se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {}, ze = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [], ve = () => {
7
7
  }, Be = (i) => i.charCodeAt(0) === 111 && i.charCodeAt(1) === 110 && // uppercase letter
8
- (i.charCodeAt(2) > 122 || i.charCodeAt(2) < 97), z = Object.assign, E = Array.isArray, M = (i) => typeof i == "function", R = (i) => typeof i == "string", xe = (i) => typeof i == "symbol", T = (i) => i !== null && typeof i == "object";
8
+ (i.charCodeAt(2) > 122 || i.charCodeAt(2) < 97), W = Object.assign, L = Array.isArray, R = (i) => typeof i == "function", $ = (i) => typeof i == "string", we = (i) => typeof i == "symbol", F = (i) => i !== null && typeof i == "object";
9
9
  let he;
10
10
  const Q = () => he || (he = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
11
11
  function le(i) {
12
- if (E(i)) {
12
+ if (L(i)) {
13
13
  const e = {};
14
14
  for (let t = 0; t < i.length; t++) {
15
- const s = i[t], n = R(s) ? Ye(s) : le(s);
15
+ const s = i[t], n = $(s) ? Ye(s) : le(s);
16
16
  if (n)
17
17
  for (const o in n)
18
18
  e[o] = n[o];
19
19
  }
20
20
  return e;
21
- } else if (R(i) || T(i))
21
+ } else if ($(i) || F(i))
22
22
  return i;
23
23
  }
24
24
  const Ue = /;(?![^(]*\))/g, We = /:([^]+)/, je = /\/\*[^]*?\*\//g;
@@ -33,14 +33,14 @@ function Ye(i) {
33
33
  }
34
34
  function ce(i) {
35
35
  let e = "";
36
- if (R(i))
36
+ if ($(i))
37
37
  e = i;
38
- else if (E(i))
38
+ else if (L(i))
39
39
  for (let t = 0; t < i.length; t++) {
40
40
  const s = ce(i[t]);
41
41
  s && (e += s + " ");
42
42
  }
43
- else if (T(i))
43
+ else if (F(i))
44
44
  for (const t in i)
45
45
  i[t] && (e += t + " ");
46
46
  return e.trim();
@@ -54,7 +54,7 @@ process.env.NODE_ENV;
54
54
  process.env.NODE_ENV;
55
55
  process.env.NODE_ENV;
56
56
  new Set(
57
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((i) => i !== "arguments" && i !== "caller").map((i) => Symbol[i]).filter(xe)
57
+ /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((i) => i !== "arguments" && i !== "caller").map((i) => Symbol[i]).filter(we)
58
58
  );
59
59
  function Ce(i) {
60
60
  return ne(i) ? Ce(i.__v_raw) : !!(i && i.__v_isReactive);
@@ -68,9 +68,9 @@ function Z(i) {
68
68
  function oe(i) {
69
69
  return i ? !!i.__v_raw : !1;
70
70
  }
71
- function O(i) {
71
+ function H(i) {
72
72
  const e = i && i.__v_raw;
73
- return e ? O(e) : i;
73
+ return e ? H(e) : i;
74
74
  }
75
75
  function de(i) {
76
76
  return i ? i.__v_isRef === !0 : !1;
@@ -80,18 +80,18 @@ function de(i) {
80
80
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
81
81
  * @license MIT
82
82
  **/
83
- const $ = [];
83
+ const P = [];
84
84
  function Ge(i) {
85
- $.push(i);
85
+ P.push(i);
86
86
  }
87
87
  function Ke() {
88
- $.pop();
88
+ P.pop();
89
89
  }
90
90
  let ee = !1;
91
- function _(i, ...e) {
91
+ function M(i, ...e) {
92
92
  if (ee) return;
93
93
  ee = !0;
94
- const t = $.length ? $[$.length - 1].component : null, s = t && t.appContext.config.warnHandler, n = Je();
94
+ const t = P.length ? P[P.length - 1].component : null, s = t && t.appContext.config.warnHandler, n = Je();
95
95
  if (s)
96
96
  ue(
97
97
  s,
@@ -119,7 +119,7 @@ function _(i, ...e) {
119
119
  ee = !1;
120
120
  }
121
121
  function Je() {
122
- let i = $[$.length - 1];
122
+ let i = P[P.length - 1];
123
123
  if (!i)
124
124
  return [];
125
125
  const e = [];
@@ -152,13 +152,13 @@ function Qe({ vnode: i, recurseCount: e }) {
152
152
  function Ze(i) {
153
153
  const e = [], t = Object.keys(i);
154
154
  return t.slice(0, 3).forEach((s) => {
155
- e.push(...Se(s, i[s]));
155
+ e.push(...ke(s, i[s]));
156
156
  }), t.length > 3 && e.push(" ..."), e;
157
157
  }
158
- function Se(i, e, t) {
159
- return R(e) ? (e = JSON.stringify(e), t ? e : [`${i}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? t ? e : [`${i}=${e}`] : de(e) ? (e = Se(i, O(e.value), !0), t ? e : [`${i}=Ref<`, e, ">"]) : M(e) ? [`${i}=fn${e.name ? `<${e.name}>` : ""}`] : (e = O(e), t ? e : [`${i}=`, e]);
158
+ function ke(i, e, t) {
159
+ return $(e) ? (e = JSON.stringify(e), t ? e : [`${i}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? t ? e : [`${i}=${e}`] : de(e) ? (e = ke(i, H(e.value), !0), t ? e : [`${i}=Ref<`, e, ">"]) : R(e) ? [`${i}=fn${e.name ? `<${e.name}>` : ""}`] : (e = H(e), t ? e : [`${i}=`, e]);
160
160
  }
161
- const ke = {
161
+ const Se = {
162
162
  sp: "serverPrefetch hook",
163
163
  bc: "beforeCreate hook",
164
164
  c: "created hook",
@@ -202,12 +202,12 @@ function Ee(i, e, t, s = !0) {
202
202
  const n = e ? e.vnode : null, { errorHandler: o, throwUnhandledErrorInProduction: a } = e && e.appContext.config || se;
203
203
  if (e) {
204
204
  let r = e.parent;
205
- const c = e.proxy, h = process.env.NODE_ENV !== "production" ? ke[t] : `https://vuejs.org/error-reference/#runtime-${t}`;
205
+ const l = e.proxy, m = process.env.NODE_ENV !== "production" ? Se[t] : `https://vuejs.org/error-reference/#runtime-${t}`;
206
206
  for (; r; ) {
207
207
  const d = r.ec;
208
208
  if (d) {
209
- for (let l = 0; l < d.length; l++)
210
- if (d[l](i, c, h) === !1)
209
+ for (let c = 0; c < d.length; c++)
210
+ if (d[c](i, l, m) === !1)
211
211
  return;
212
212
  }
213
213
  r = r.parent;
@@ -215,8 +215,8 @@ function Ee(i, e, t, s = !0) {
215
215
  if (o) {
216
216
  ue(o, null, 10, [
217
217
  i,
218
- c,
219
- h
218
+ l,
219
+ m
220
220
  ]);
221
221
  return;
222
222
  }
@@ -225,8 +225,8 @@ function Ee(i, e, t, s = !0) {
225
225
  }
226
226
  function et(i, e, t, s = !0, n = !1) {
227
227
  if (process.env.NODE_ENV !== "production") {
228
- const o = ke[e];
229
- if (t && Ge(t), _(`Unhandled error${o ? ` during execution of ${o}` : ""}`), t && Ke(), s)
228
+ const o = Se[e];
229
+ if (t && Ge(t), M(`Unhandled error${o ? ` during execution of ${o}` : ""}`), t && Ke(), s)
230
230
  throw i;
231
231
  console.error(i);
232
232
  } else {
@@ -235,57 +235,57 @@ function et(i, e, t, s = !0, n = !1) {
235
235
  console.error(i);
236
236
  }
237
237
  }
238
- const S = [];
239
- let A = -1;
240
- const P = [];
241
- let N = null, F = 0;
238
+ const _ = [];
239
+ let N = -1;
240
+ const z = [];
241
+ let O = null, D = 0;
242
242
  const tt = /* @__PURE__ */ Promise.resolve();
243
243
  let re = null;
244
244
  const it = 100;
245
245
  function st(i) {
246
- let e = A + 1, t = S.length;
246
+ let e = N + 1, t = _.length;
247
247
  for (; e < t; ) {
248
- const s = e + t >>> 1, n = S[s], o = D(n);
248
+ const s = e + t >>> 1, n = _[s], o = B(n);
249
249
  o < i || o === i && n.flags & 2 ? e = s + 1 : t = s;
250
250
  }
251
251
  return e;
252
252
  }
253
253
  function nt(i) {
254
254
  if (!(i.flags & 1)) {
255
- const e = D(i), t = S[S.length - 1];
255
+ const e = B(i), t = _[_.length - 1];
256
256
  !t || // fast path when the job id is larger than the tail
257
- !(i.flags & 2) && e >= D(t) ? S.push(i) : S.splice(st(e), 0, i), i.flags |= 1, _e();
257
+ !(i.flags & 2) && e >= B(t) ? _.push(i) : _.splice(st(e), 0, i), i.flags |= 1, _e();
258
258
  }
259
259
  }
260
260
  function _e() {
261
261
  re || (re = tt.then(Ae));
262
262
  }
263
263
  function ot(i) {
264
- E(i) ? P.push(...i) : N && i.id === -1 ? N.splice(F + 1, 0, i) : i.flags & 1 || (P.push(i), i.flags |= 1), _e();
264
+ L(i) ? z.push(...i) : O && i.id === -1 ? O.splice(D + 1, 0, i) : i.flags & 1 || (z.push(i), i.flags |= 1), _e();
265
265
  }
266
266
  function rt(i) {
267
- if (P.length) {
268
- const e = [...new Set(P)].sort(
269
- (t, s) => D(t) - D(s)
267
+ if (z.length) {
268
+ const e = [...new Set(z)].sort(
269
+ (t, s) => B(t) - B(s)
270
270
  );
271
- if (P.length = 0, N) {
272
- N.push(...e);
271
+ if (z.length = 0, O) {
272
+ O.push(...e);
273
273
  return;
274
274
  }
275
- for (N = e, process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map()), F = 0; F < N.length; F++) {
276
- const t = N[F];
275
+ for (O = e, process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map()), D = 0; D < O.length; D++) {
276
+ const t = O[D];
277
277
  process.env.NODE_ENV !== "production" && Le(i, t) || (t.flags & 4 && (t.flags &= -2), t.flags & 8 || t(), t.flags &= -2);
278
278
  }
279
- N = null, F = 0;
279
+ O = null, D = 0;
280
280
  }
281
281
  }
282
- const D = (i) => i.id == null ? i.flags & 2 ? -1 : 1 / 0 : i.id;
282
+ const B = (i) => i.id == null ? i.flags & 2 ? -1 : 1 / 0 : i.id;
283
283
  function Ae(i) {
284
284
  process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map());
285
- const e = process.env.NODE_ENV !== "production" ? (t) => Le(i, t) : we;
285
+ const e = process.env.NODE_ENV !== "production" ? (t) => Le(i, t) : ve;
286
286
  try {
287
- for (A = 0; A < S.length; A++) {
288
- const t = S[A];
287
+ for (N = 0; N < _.length; N++) {
288
+ const t = _[N];
289
289
  if (t && !(t.flags & 8)) {
290
290
  if (process.env.NODE_ENV !== "production" && e(t))
291
291
  continue;
@@ -297,11 +297,11 @@ function Ae(i) {
297
297
  }
298
298
  }
299
299
  } finally {
300
- for (; A < S.length; A++) {
301
- const t = S[A];
300
+ for (; N < _.length; N++) {
301
+ const t = _[N];
302
302
  t && (t.flags &= -2);
303
303
  }
304
- A = -1, S.length = 0, rt(i), re = null, (S.length || P.length) && Ae(i);
304
+ N = -1, _.length = 0, rt(i), re = null, (_.length || z.length) && Ae(i);
305
305
  }
306
306
  }
307
307
  function Le(i, e) {
@@ -357,7 +357,7 @@ function ct(i, e) {
357
357
  });
358
358
  }
359
359
  function pe(i, e) {
360
- z(i, e);
360
+ W(i, e);
361
361
  for (const t in i)
362
362
  t !== "__file" && !(t in e) && delete i[t];
363
363
  }
@@ -372,100 +372,100 @@ function ie(i) {
372
372
  }
373
373
  };
374
374
  }
375
- let H, j = [];
376
- function Ie(i, e) {
375
+ let q, j = [];
376
+ function Me(i, e) {
377
377
  var t, s;
378
- H = i, H ? (H.enabled = !0, j.forEach(({ event: n, args: o }) => H.emit(n, ...o)), j = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
378
+ q = i, q ? (q.enabled = !0, j.forEach(({ event: n, args: o }) => q.emit(n, ...o)), j = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
379
379
  window.HTMLElement && // also exclude jsdom
380
380
  // eslint-disable-next-line no-restricted-syntax
381
381
  !((s = (t = window.navigator) == null ? void 0 : t.userAgent) != null && s.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((o) => {
382
- Ie(o, e);
382
+ Me(o, e);
383
383
  }), setTimeout(() => {
384
- H || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, j = []);
384
+ q || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, j = []);
385
385
  }, 3e3)) : j = [];
386
386
  }
387
- let I = null, dt = null;
387
+ let T = null, dt = null;
388
388
  function ut(i, e) {
389
- if (process.env.NODE_ENV !== "production" && (!L || L.isMounted) && _("provide() can only be used inside setup()."), L) {
390
- let t = L.provides;
391
- const s = L.parent && L.parent.provides;
392
- s === t && (t = L.provides = Object.create(s)), t[i] = e;
389
+ if (process.env.NODE_ENV !== "production" && (!I || I.isMounted) && M("provide() can only be used inside setup()."), I) {
390
+ let t = I.provides;
391
+ const s = I.parent && I.parent.provides;
392
+ s === t && (t = I.provides = Object.create(s)), t[i] = e;
393
393
  }
394
394
  }
395
395
  function ft(i, e, t = !1) {
396
- const s = Mt();
397
- if (s || vt) {
396
+ const s = Nt();
397
+ if (s || xt) {
398
398
  let n = s ? s.parent == null || s.ce ? s.vnode.appContext && s.vnode.appContext.provides : s.parent.provides : void 0;
399
399
  if (n && i in n)
400
400
  return n[i];
401
401
  if (arguments.length > 1)
402
- return t && M(e) ? e.call(s && s.proxy) : e;
403
- process.env.NODE_ENV !== "production" && _(`injection "${String(i)}" not found.`);
404
- } else process.env.NODE_ENV !== "production" && _("inject() can only be used inside setup() or functional components.");
402
+ return t && R(e) ? e.call(s && s.proxy) : e;
403
+ process.env.NODE_ENV !== "production" && M(`injection "${String(i)}" not found.`);
404
+ } else process.env.NODE_ENV !== "production" && M("inject() can only be used inside setup() or functional components.");
405
405
  }
406
406
  const mt = (i) => i.__isTeleport;
407
- function Me(i, e) {
408
- i.shapeFlag & 6 && i.component ? (i.transition = e, Me(i.component.subTree, e)) : i.shapeFlag & 128 ? (i.ssContent.transition = e.clone(i.ssContent), i.ssFallback.transition = e.clone(i.ssFallback)) : i.transition = e;
407
+ function Ne(i, e) {
408
+ i.shapeFlag & 6 && i.component ? (i.transition = e, Ne(i.component.subTree, e)) : i.shapeFlag & 128 ? (i.ssContent.transition = e.clone(i.ssContent), i.ssFallback.transition = e.clone(i.ssFallback)) : i.transition = e;
409
409
  }
410
410
  // @__NO_SIDE_EFFECTS__
411
411
  function ht(i, e) {
412
- return M(i) ? (
412
+ return R(i) ? (
413
413
  // #8236: extend call and options.name access are considered side-effects
414
414
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
415
- z({ name: i.name }, e, { setup: i })
415
+ W({ name: i.name }, e, { setup: i })
416
416
  ) : i;
417
417
  }
418
418
  Q().requestIdleCallback;
419
419
  Q().cancelIdleCallback;
420
420
  const pt = (i) => !!i.type.__asyncLoader, gt = /* @__PURE__ */ Symbol.for("v-ndc");
421
421
  function bt(i, e, t = {}, s, n) {
422
- if (I.ce || I.parent && pt(I.parent) && I.parent.ce) {
423
- const h = Object.keys(t).length > 0;
422
+ if (T.ce || T.parent && pt(T.parent) && T.parent.ce) {
423
+ const m = Object.keys(t).length > 0;
424
424
  return ge(), be(
425
- q,
425
+ U,
426
426
  null,
427
427
  [fe("slot", t, s)],
428
- h ? -2 : 64
428
+ m ? -2 : 64
429
429
  );
430
430
  }
431
431
  let o = i[e];
432
- process.env.NODE_ENV !== "production" && o && o.length > 1 && (_(
432
+ process.env.NODE_ENV !== "production" && o && o.length > 1 && (M(
433
433
  "SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."
434
434
  ), o = () => []), o && o._c && (o._d = !1), ge();
435
- const a = o && Ne(o(t)), r = t.key || // slot content array of a dynamic conditional slot may have a branch
435
+ const a = o && Ie(o(t)), r = t.key || // slot content array of a dynamic conditional slot may have a branch
436
436
  // key attached in the `createSlots` helper, respect that
437
- a && a.key, c = be(
438
- q,
437
+ a && a.key, l = be(
438
+ U,
439
439
  {
440
- key: (r && !xe(r) ? r : `_${e}`) + // #7256 force differentiate fallback content from actual content
440
+ key: (r && !we(r) ? r : `_${e}`) + // #7256 force differentiate fallback content from actual content
441
441
  (!a && s ? "_fb" : "")
442
442
  },
443
443
  a || [],
444
444
  a && i._ === 1 ? 64 : -2
445
445
  );
446
- return c.scopeId && (c.slotScopeIds = [c.scopeId + "-s"]), o && o._c && (o._d = !0), c;
446
+ return l.scopeId && (l.slotScopeIds = [l.scopeId + "-s"]), o && o._c && (o._d = !0), l;
447
447
  }
448
- function Ne(i) {
449
- return i.some((e) => Oe(e) ? !(e.type === Te || e.type === q && !Ne(e.children)) : !0) ? i : null;
448
+ function Ie(i) {
449
+ return i.some((e) => Oe(e) ? !(e.type === Re || e.type === U && !Ie(e.children)) : !0) ? i : null;
450
450
  }
451
451
  const yt = {};
452
- process.env.NODE_ENV !== "production" && (yt.ownKeys = (i) => (_(
452
+ process.env.NODE_ENV !== "production" && (yt.ownKeys = (i) => (M(
453
453
  "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
454
454
  ), Reflect.ownKeys(i)));
455
- let vt = null;
456
- const wt = {}, Re = (i) => Object.getPrototypeOf(i) === wt, xt = (i) => i.__isSuspense, q = /* @__PURE__ */ Symbol.for("v-fgt"), Ct = /* @__PURE__ */ Symbol.for("v-txt"), Te = /* @__PURE__ */ Symbol.for("v-cmt"), Y = [];
457
- let k = null;
455
+ let xt = null;
456
+ const vt = {}, Te = (i) => Object.getPrototypeOf(i) === vt, wt = (i) => i.__isSuspense, U = /* @__PURE__ */ Symbol.for("v-fgt"), Ct = /* @__PURE__ */ Symbol.for("v-txt"), Re = /* @__PURE__ */ Symbol.for("v-cmt"), Y = [];
457
+ let A = null;
458
458
  function ge(i = !1) {
459
- Y.push(k = i ? null : []);
459
+ Y.push(A = i ? null : []);
460
460
  }
461
- function St() {
462
- Y.pop(), k = Y[Y.length - 1] || null;
461
+ function kt() {
462
+ Y.pop(), A = Y[Y.length - 1] || null;
463
463
  }
464
- function kt(i) {
465
- return i.dynamicChildren = k || ze, St(), k && k.push(i), i;
464
+ function St(i) {
465
+ return i.dynamicChildren = A || ze, kt(), A && A.push(i), i;
466
466
  }
467
467
  function be(i, e, t, s, n) {
468
- return kt(
468
+ return St(
469
469
  fe(
470
470
  i,
471
471
  e,
@@ -485,9 +485,9 @@ const Et = (...i) => Fe(
485
485
  ref: i,
486
486
  ref_key: e,
487
487
  ref_for: t
488
- }) => (typeof i == "number" && (i = "" + i), i != null ? R(i) || de(i) || M(i) ? { i: I, r: i, k: e, f: !!t } : i : null);
489
- function _t(i, e = null, t = null, s = 0, n = null, o = i === q ? 0 : 1, a = !1, r = !1) {
490
- const c = {
488
+ }) => (typeof i == "number" && (i = "" + i), i != null ? $(i) || de(i) || R(i) ? { i: T, r: i, k: e, f: !!t } : i : null);
489
+ function _t(i, e = null, t = null, s = 0, n = null, o = i === U ? 0 : 1, a = !1, r = !1) {
490
+ const l = {
491
491
  __v_isVNode: !0,
492
492
  __v_skip: !0,
493
493
  type: i,
@@ -514,36 +514,36 @@ function _t(i, e = null, t = null, s = 0, n = null, o = i === q ? 0 : 1, a = !1,
514
514
  dynamicProps: n,
515
515
  dynamicChildren: null,
516
516
  appContext: null,
517
- ctx: I
517
+ ctx: T
518
518
  };
519
- return r ? (me(c, t), o & 128 && i.normalize(c)) : t && (c.shapeFlag |= R(t) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && _("VNode created with invalid key (NaN). VNode type:", c.type), // avoid a block node from tracking itself
519
+ return r ? (me(l, t), o & 128 && i.normalize(l)) : t && (l.shapeFlag |= $(t) ? 8 : 16), process.env.NODE_ENV !== "production" && l.key !== l.key && M("VNode created with invalid key (NaN). VNode type:", l.type), // avoid a block node from tracking itself
520
520
  !a && // has current parent block
521
- k && // presence of a patch flag indicates this node needs patching on updates.
521
+ A && // presence of a patch flag indicates this node needs patching on updates.
522
522
  // component nodes also should always be patched, because even if the
523
523
  // component doesn't need to update, it needs to persist the instance on to
524
524
  // the next vnode so that it can be properly unmounted later.
525
- (c.patchFlag > 0 || o & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
525
+ (l.patchFlag > 0 || o & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
526
526
  // vnode should not be considered dynamic due to handler caching.
527
- c.patchFlag !== 32 && k.push(c), c;
527
+ l.patchFlag !== 32 && A.push(l), l;
528
528
  }
529
529
  const fe = process.env.NODE_ENV !== "production" ? Et : Fe;
530
530
  function Fe(i, e = null, t = null, s = 0, n = null, o = !1) {
531
- if ((!i || i === gt) && (process.env.NODE_ENV !== "production" && !i && _(`Invalid vnode type when creating vnode: ${i}.`), i = Te), Oe(i)) {
531
+ if ((!i || i === gt) && (process.env.NODE_ENV !== "production" && !i && M(`Invalid vnode type when creating vnode: ${i}.`), i = Re), Oe(i)) {
532
532
  const r = X(
533
533
  i,
534
534
  e,
535
535
  !0
536
536
  /* mergeRef: true */
537
537
  );
538
- return t && me(r, t), !o && k && (r.shapeFlag & 6 ? k[k.indexOf(i)] = r : k.push(r)), r.patchFlag = -2, r;
538
+ return t && me(r, t), !o && A && (r.shapeFlag & 6 ? A[A.indexOf(i)] = r : A.push(r)), r.patchFlag = -2, r;
539
539
  }
540
540
  if (De(i) && (i = i.__vccOpts), e) {
541
541
  e = At(e);
542
- let { class: r, style: c } = e;
543
- r && !R(r) && (e.class = ce(r)), T(c) && (oe(c) && !E(c) && (c = z({}, c)), e.style = le(c));
542
+ let { class: r, style: l } = e;
543
+ r && !$(r) && (e.class = ce(r)), F(l) && (oe(l) && !L(l) && (l = W({}, l)), e.style = le(l));
544
544
  }
545
- const a = R(i) ? 1 : xt(i) ? 128 : mt(i) ? 64 : T(i) ? 4 : M(i) ? 2 : 0;
546
- return process.env.NODE_ENV !== "production" && a & 4 && oe(i) && (i = O(i), _(
545
+ const a = $(i) ? 1 : wt(i) ? 128 : mt(i) ? 64 : F(i) ? 4 : R(i) ? 2 : 0;
546
+ return process.env.NODE_ENV !== "production" && a & 4 && oe(i) && (i = H(i), M(
547
547
  "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
548
548
  `
549
549
  Component that was made reactive: `,
@@ -560,24 +560,24 @@ Component that was made reactive: `,
560
560
  );
561
561
  }
562
562
  function At(i) {
563
- return i ? oe(i) || Re(i) ? z({}, i) : i : null;
563
+ return i ? oe(i) || Te(i) ? W({}, i) : i : null;
564
564
  }
565
565
  function X(i, e, t = !1, s = !1) {
566
- const { props: n, ref: o, patchFlag: a, children: r, transition: c } = i, h = e ? It(n || {}, e) : n, d = {
566
+ const { props: n, ref: o, patchFlag: a, children: r, transition: l } = i, m = e ? Mt(n || {}, e) : n, d = {
567
567
  __v_isVNode: !0,
568
568
  __v_skip: !0,
569
569
  type: i.type,
570
- props: h,
571
- key: h && $e(h),
570
+ props: m,
571
+ key: m && $e(m),
572
572
  ref: e && e.ref ? (
573
573
  // #2078 in the case of <component :is="vnode" ref="extra"/>
574
574
  // if the vnode itself already has a ref, cloneVNode will need to merge
575
575
  // the refs so the single vnode can be set on multiple refs
576
- t && o ? E(o) ? o.concat(G(e)) : [o, G(e)] : G(e)
576
+ t && o ? L(o) ? o.concat(G(e)) : [o, G(e)] : G(e)
577
577
  ) : o,
578
578
  scopeId: i.scopeId,
579
579
  slotScopeIds: i.slotScopeIds,
580
- children: process.env.NODE_ENV !== "production" && a === -1 && E(r) ? r.map(He) : r,
580
+ children: process.env.NODE_ENV !== "production" && a === -1 && L(r) ? r.map(He) : r,
581
581
  target: i.target,
582
582
  targetStart: i.targetStart,
583
583
  targetAnchor: i.targetAnchor,
@@ -587,12 +587,12 @@ function X(i, e, t = !1, s = !1) {
587
587
  // existing patch flag to be reliable and need to add the FULL_PROPS flag.
588
588
  // note: preserve flag for fragments since they use the flag for children
589
589
  // fast paths only.
590
- patchFlag: e && i.type !== q ? a === -1 ? 16 : a | 16 : a,
590
+ patchFlag: e && i.type !== U ? a === -1 ? 16 : a | 16 : a,
591
591
  dynamicProps: i.dynamicProps,
592
592
  dynamicChildren: i.dynamicChildren,
593
593
  appContext: i.appContext,
594
594
  dirs: i.dirs,
595
- transition: c,
595
+ transition: l,
596
596
  // These should technically only be non-null on mounted VNodes. However,
597
597
  // they *should* be copied for kept-alive vnodes. So we just always copy
598
598
  // them since them being non-null during a mount doesn't affect the logic as
@@ -607,14 +607,14 @@ function X(i, e, t = !1, s = !1) {
607
607
  ctx: i.ctx,
608
608
  ce: i.ce
609
609
  };
610
- return c && s && Me(
610
+ return l && s && Ne(
611
611
  d,
612
- c.clone(d)
612
+ l.clone(d)
613
613
  ), d;
614
614
  }
615
615
  function He(i) {
616
616
  const e = X(i);
617
- return E(i.children) && (e.children = i.children.map(He)), e;
617
+ return L(i.children) && (e.children = i.children.map(He)), e;
618
618
  }
619
619
  function Lt(i = " ", e = 0) {
620
620
  return fe(Ct, null, i, e);
@@ -624,7 +624,7 @@ function me(i, e) {
624
624
  const { shapeFlag: s } = i;
625
625
  if (e == null)
626
626
  e = null;
627
- else if (E(e))
627
+ else if (L(e))
628
628
  t = 16;
629
629
  else if (typeof e == "object")
630
630
  if (s & 65) {
@@ -632,11 +632,11 @@ function me(i, e) {
632
632
  n && (n._c && (n._d = !1), me(i, n()), n._c && (n._d = !0));
633
633
  return;
634
634
  } else
635
- t = 32, !e._ && !Re(e) && (e._ctx = I);
636
- else M(e) ? (e = { default: e, _ctx: I }, t = 32) : (e = String(e), s & 64 ? (t = 16, e = [Lt(e)]) : t = 8);
635
+ t = 32, !e._ && !Te(e) && (e._ctx = T);
636
+ else R(e) ? (e = { default: e, _ctx: T }, t = 32) : (e = String(e), s & 64 ? (t = 16, e = [Lt(e)]) : t = 8);
637
637
  i.children = e, i.shapeFlag |= t;
638
638
  }
639
- function It(...i) {
639
+ function Mt(...i) {
640
640
  const e = {};
641
641
  for (let t = 0; t < i.length; t++) {
642
642
  const s = i[t];
@@ -647,13 +647,13 @@ function It(...i) {
647
647
  e.style = le([e.style, s.style]);
648
648
  else if (Be(n)) {
649
649
  const o = e[n], a = s[n];
650
- a && o !== a && !(E(o) && o.includes(a)) && (e[n] = o ? [].concat(o, a) : a);
650
+ a && o !== a && !(L(o) && o.includes(a)) && (e[n] = o ? [].concat(o, a) : a);
651
651
  } else n !== "" && (e[n] = s[n]);
652
652
  }
653
653
  return e;
654
654
  }
655
- let L = null;
656
- const Mt = () => L || I;
655
+ let I = null;
656
+ const Nt = () => I || T;
657
657
  {
658
658
  const i = Q(), e = (t, s) => {
659
659
  let n;
@@ -663,16 +663,16 @@ const Mt = () => L || I;
663
663
  };
664
664
  e(
665
665
  "__VUE_INSTANCE_SETTERS__",
666
- (t) => L = t
666
+ (t) => I = t
667
667
  ), e(
668
668
  "__VUE_SSR_SETTERS__",
669
669
  (t) => t
670
670
  );
671
671
  }
672
672
  process.env.NODE_ENV;
673
- const Nt = /(?:^|[-_])\w/g, Rt = (i) => i.replace(Nt, (e) => e.toUpperCase()).replace(/[-_]/g, "");
673
+ const It = /(?:^|[-_])\w/g, Tt = (i) => i.replace(It, (e) => e.toUpperCase()).replace(/[-_]/g, "");
674
674
  function Pe(i, e = !0) {
675
- return M(i) ? i.displayName || i.name : i.name || e && i.__name;
675
+ return R(i) ? i.displayName || i.name : i.name || e && i.__name;
676
676
  }
677
677
  function Ve(i, e, t = !1) {
678
678
  let s = Pe(e);
@@ -690,72 +690,72 @@ function Ve(i, e, t = !1) {
690
690
  i.parent.type.components
691
691
  ) || n(i.appContext.components);
692
692
  }
693
- return s ? Rt(s) : t ? "App" : "Anonymous";
693
+ return s ? Tt(s) : t ? "App" : "Anonymous";
694
694
  }
695
695
  function De(i) {
696
- return M(i) && "__vccOpts" in i;
696
+ return R(i) && "__vccOpts" in i;
697
697
  }
698
- function Tt() {
698
+ function Rt() {
699
699
  if (process.env.NODE_ENV === "production" || typeof window > "u")
700
700
  return;
701
701
  const i = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, t = { style: "color:#f5222d" }, s = { style: "color:#eb2f96" }, n = {
702
702
  __vue_custom_formatter: !0,
703
- header(l) {
704
- if (!T(l))
703
+ header(c) {
704
+ if (!F(c))
705
705
  return null;
706
- if (l.__isVue)
706
+ if (c.__isVue)
707
707
  return ["div", i, "VueInstance"];
708
- if (de(l)) {
709
- const f = l.value;
708
+ if (de(c)) {
709
+ const u = c.value;
710
710
  return [
711
711
  "div",
712
712
  {},
713
- ["span", i, d(l)],
713
+ ["span", i, d(c)],
714
714
  "<",
715
- r(f),
715
+ r(u),
716
716
  ">"
717
717
  ];
718
718
  } else {
719
- if (Ce(l))
719
+ if (Ce(c))
720
720
  return [
721
721
  "div",
722
722
  {},
723
- ["span", i, Z(l) ? "ShallowReactive" : "Reactive"],
723
+ ["span", i, Z(c) ? "ShallowReactive" : "Reactive"],
724
724
  "<",
725
- r(l),
726
- `>${ne(l) ? " (readonly)" : ""}`
725
+ r(c),
726
+ `>${ne(c) ? " (readonly)" : ""}`
727
727
  ];
728
- if (ne(l))
728
+ if (ne(c))
729
729
  return [
730
730
  "div",
731
731
  {},
732
- ["span", i, Z(l) ? "ShallowReadonly" : "Readonly"],
732
+ ["span", i, Z(c) ? "ShallowReadonly" : "Readonly"],
733
733
  "<",
734
- r(l),
734
+ r(c),
735
735
  ">"
736
736
  ];
737
737
  }
738
738
  return null;
739
739
  },
740
- hasBody(l) {
741
- return l && l.__isVue;
740
+ hasBody(c) {
741
+ return c && c.__isVue;
742
742
  },
743
- body(l) {
744
- if (l && l.__isVue)
743
+ body(c) {
744
+ if (c && c.__isVue)
745
745
  return [
746
746
  "div",
747
747
  {},
748
- ...o(l.$)
748
+ ...o(c.$)
749
749
  ];
750
750
  }
751
751
  };
752
- function o(l) {
753
- const f = [];
754
- l.type.props && l.props && f.push(a("props", O(l.props))), l.setupState !== se && f.push(a("setup", l.setupState)), l.data !== se && f.push(a("data", O(l.data)));
755
- const m = c(l, "computed");
756
- m && f.push(a("computed", m));
757
- const b = c(l, "inject");
758
- return b && f.push(a("injected", b)), f.push([
752
+ function o(c) {
753
+ const u = [];
754
+ c.type.props && c.props && u.push(a("props", H(c.props))), c.setupState !== se && u.push(a("setup", c.setupState)), c.data !== se && u.push(a("data", H(c.data)));
755
+ const y = l(c, "computed");
756
+ y && u.push(a("computed", y));
757
+ const f = l(c, "inject");
758
+ return f && u.push(a("injected", f)), u.push([
759
759
  "div",
760
760
  {},
761
761
  [
@@ -765,11 +765,11 @@ function Tt() {
765
765
  },
766
766
  "$ (internal): "
767
767
  ],
768
- ["object", { object: l }]
769
- ]), f;
768
+ ["object", { object: c }]
769
+ ]), u;
770
770
  }
771
- function a(l, f) {
772
- return f = z({}, f), Object.keys(f).length ? [
771
+ function a(c, u) {
772
+ return u = W({}, u), Object.keys(u).length ? [
773
773
  "div",
774
774
  { style: "line-height:1.25em;margin-bottom:0.6em" },
775
775
  [
@@ -777,41 +777,41 @@ function Tt() {
777
777
  {
778
778
  style: "color:#476582"
779
779
  },
780
- l
780
+ c
781
781
  ],
782
782
  [
783
783
  "div",
784
784
  {
785
785
  style: "padding-left:1.25em"
786
786
  },
787
- ...Object.keys(f).map((m) => [
787
+ ...Object.keys(u).map((y) => [
788
788
  "div",
789
789
  {},
790
- ["span", s, m + ": "],
791
- r(f[m], !1)
790
+ ["span", s, y + ": "],
791
+ r(u[y], !1)
792
792
  ])
793
793
  ]
794
794
  ] : ["span", {}];
795
795
  }
796
- function r(l, f = !0) {
797
- return typeof l == "number" ? ["span", e, l] : typeof l == "string" ? ["span", t, JSON.stringify(l)] : typeof l == "boolean" ? ["span", s, l] : T(l) ? ["object", { object: f ? O(l) : l }] : ["span", t, String(l)];
796
+ function r(c, u = !0) {
797
+ return typeof c == "number" ? ["span", e, c] : typeof c == "string" ? ["span", t, JSON.stringify(c)] : typeof c == "boolean" ? ["span", s, c] : F(c) ? ["object", { object: u ? H(c) : c }] : ["span", t, String(c)];
798
798
  }
799
- function c(l, f) {
800
- const m = l.type;
801
- if (M(m))
799
+ function l(c, u) {
800
+ const y = c.type;
801
+ if (R(y))
802
802
  return;
803
- const b = {};
804
- for (const u in l.ctx)
805
- h(m, u, f) && (b[u] = l.ctx[u]);
806
- return b;
807
- }
808
- function h(l, f, m) {
809
- const b = l[m];
810
- if (E(b) && b.includes(f) || T(b) && f in b || l.extends && h(l.extends, f, m) || l.mixins && l.mixins.some((u) => h(u, f, m)))
803
+ const f = {};
804
+ for (const h in c.ctx)
805
+ m(y, h, u) && (f[h] = c.ctx[h]);
806
+ return f;
807
+ }
808
+ function m(c, u, y) {
809
+ const f = c[y];
810
+ if (L(f) && f.includes(u) || F(f) && u in f || c.extends && m(c.extends, u, y) || c.mixins && c.mixins.some((h) => m(h, u, y)))
811
811
  return !0;
812
812
  }
813
- function d(l) {
814
- return Z(l) ? "ShallowRef" : l.effect ? "ComputedRef" : "Ref";
813
+ function d(c) {
814
+ return Z(c) ? "ShallowRef" : c.effect ? "ComputedRef" : "Ref";
815
815
  }
816
816
  window.devtoolsFormatters ? window.devtoolsFormatters.push(n) : window.devtoolsFormatters = [n];
817
817
  }
@@ -824,7 +824,7 @@ process.env.NODE_ENV;
824
824
  * @license MIT
825
825
  **/
826
826
  function Ot() {
827
- Tt();
827
+ Rt();
828
828
  }
829
829
  process.env.NODE_ENV !== "production" && Ot();
830
830
  class ye {
@@ -887,16 +887,16 @@ class $t {
887
887
  }
888
888
  /** Execute a command by matching input */
889
889
  async executeCommand(e) {
890
- if (typeof e == "object" && e !== null) {
890
+ if (Array.isArray(e) && (e = e.join(", ")), typeof e == "object" && e !== null) {
891
891
  if (this.isStructured(e)) {
892
- const c = String(e.commandId), h = e.params ?? {}, d = this.getCommandById(c);
892
+ const l = String(e.commandId), m = e.params ?? {}, d = this.getCommandById(l);
893
893
  if (!d) return { message: "That command is not available.", type: "error" };
894
- const l = this.sanitizeParamsForCommand(d, h), m = (d.parameters ?? []).filter((b) => b.required).filter((b) => l[b.name] == null || l[b.name] === "");
895
- return m.length > 0 ? (this.context = { commandId: this.getCommandIdentifier(d), params: l }, {
894
+ const c = this.sanitizeParamsForCommand(d, m), y = (d.parameters ?? []).filter((f) => f.required).filter((f) => c[f.name] == null || c[f.name] === "");
895
+ return y.length > 0 ? (this.context = { commandId: this.getCommandIdentifier(d), params: c }, {
896
896
  message: `Please provide the required details for "${d.command}".`,
897
897
  type: "form",
898
- fields: m
899
- }) : d.critical ? (this.pendingConfirmation = { commandId: this.getCommandIdentifier(d), params: l }, this.buildConfirmResponse(d)) : this.safeRunAction(d, l);
898
+ fields: y
899
+ }) : d.critical ? (this.pendingConfirmation = { commandId: this.getCommandIdentifier(d), params: c }, this.buildConfirmResponse(d)) : this.safeRunAction(d, c);
900
900
  }
901
901
  if (!this.context)
902
902
  return { message: "Session expired or invalid context.", type: "error" };
@@ -923,8 +923,8 @@ class $t {
923
923
  if (["yes", "y", "confirm", "ok", "okay"].includes(o)) {
924
924
  const { commandId: a, params: r } = this.pendingConfirmation;
925
925
  this.pendingConfirmation = null;
926
- const c = this.getCommandById(a);
927
- return c ? this.safeRunAction(c, r) : { message: "That action is no longer available.", type: "error" };
926
+ const l = this.getCommandById(a);
927
+ return l ? this.safeRunAction(l, r) : { message: "That action is no longer available.", type: "error" };
928
928
  }
929
929
  return ["no", "n", "cancel", "stop"].includes(o) ? (this.pendingConfirmation = null, { message: "Cancelled.", type: "success" }) : {
930
930
  message: "Please confirm: Yes or No.",
@@ -966,12 +966,12 @@ class $t {
966
966
  return { message: "I'm not sure what you mean.", type: "error" };
967
967
  if (t.macro)
968
968
  return this.safeRunAction(t, {});
969
- const s = e.params ?? {}, n = this.sanitizeParamsForCommand(t, s), o = t.allowAiParamExtraction === !1 ? {} : n, r = (t.parameters ?? []).filter((h) => h.required).filter((h) => o[h.name] == null || o[h.name] === "");
969
+ const s = e.params ?? {}, n = this.sanitizeParamsForCommand(t, s), o = t.allowAiParamExtraction === !1 ? {} : n, r = (t.parameters ?? []).filter((m) => m.required).filter((m) => o[m.name] == null || o[m.name] === "");
970
970
  if (e.incomplete || r.length > 0) {
971
971
  if (this.context = { commandId: this.getCommandIdentifier(t), params: o }, !(t.collectRequiredViaForm !== !1) && this.shouldAskSingleQuestion(r)) {
972
- const l = r.map((f) => f.name).join(" and ");
972
+ const c = r.map((u) => u.name).join(" and ");
973
973
  return {
974
- message: e.message || `Please provide ${l}.`,
974
+ message: e.message || `Please provide ${c}.`,
975
975
  type: "question"
976
976
  };
977
977
  }
@@ -986,8 +986,8 @@ class $t {
986
986
  commandId: this.getCommandIdentifier(t),
987
987
  params: o
988
988
  }, this.buildConfirmResponse(t);
989
- const c = await t.action(o);
990
- return this.normalizeResponse(c);
989
+ const l = await t.action(o);
990
+ return this.normalizeResponse(l);
991
991
  }
992
992
  return e.type === "ambiguous" && e.options && e.options.length ? {
993
993
  message: e.message || "Did you mean one of these?",
@@ -1045,15 +1045,15 @@ class $t {
1045
1045
  delete s[n.name];
1046
1046
  continue;
1047
1047
  }
1048
- if (Array.isArray(n.options) && n.options.length > 0 && !n.options.some((c) => String(c.value) === String(a))) {
1048
+ if (Array.isArray(n.options) && n.options.length > 0 && !n.options.some((l) => String(l.value) === String(a))) {
1049
1049
  delete s[n.name];
1050
1050
  continue;
1051
1051
  }
1052
1052
  s[n.name] = a;
1053
1053
  }
1054
1054
  if (n.type === "file") {
1055
- const a = s[n.name], r = a && typeof a == "object" && typeof a.name == "string" && typeof a.size == "number", c = typeof a == "string" && /^data:[^;]+;base64,/.test(a);
1056
- (n.delivery ?? "file") === "base64" ? !c && !r && delete s[n.name] : r || delete s[n.name];
1055
+ const a = s[n.name], r = a && typeof a == "object" && typeof a.name == "string" && typeof a.size == "number", l = typeof a == "string" && /^data:[^;]+;base64,/.test(a);
1056
+ (n.delivery ?? "file") === "base64" ? !l && !r && delete s[n.name] : r || delete s[n.name];
1057
1057
  }
1058
1058
  }
1059
1059
  return s;
@@ -1081,18 +1081,18 @@ class $t {
1081
1081
  async tryDeterministicMatch(e) {
1082
1082
  const t = [];
1083
1083
  for (const r of this.commands.values()) {
1084
- let c = 0;
1085
- const h = r.command.toLowerCase();
1086
- e.includes(h) && (c += 5);
1084
+ let l = 0;
1085
+ const m = r.command.toLowerCase();
1086
+ e.includes(m) && (l += 5);
1087
1087
  const d = r.keywords ?? [];
1088
- for (const l of d) {
1089
- const f = l.toLowerCase().trim();
1090
- f && (e === f ? c += 4 : e.includes(f) && (c += 3));
1088
+ for (const c of d) {
1089
+ const u = c.toLowerCase().trim();
1090
+ u && (e === u ? l += 4 : e.includes(u) && (l += 3));
1091
1091
  }
1092
- c > 0 && t.push({ cmd: r, score: c });
1092
+ l > 0 && t.push({ cmd: r, score: l });
1093
1093
  }
1094
1094
  if (t.length === 0) return null;
1095
- t.sort((r, c) => c.score - r.score);
1095
+ t.sort((r, l) => l.score - r.score);
1096
1096
  const s = t[0].score, n = t.filter((r) => r.score === s).slice(0, 3);
1097
1097
  if (n.length > 1)
1098
1098
  return {
@@ -1209,7 +1209,7 @@ class Ft {
1209
1209
  return this.fallbackMessage;
1210
1210
  }
1211
1211
  }
1212
- const ve = () => {
1212
+ const xe = () => {
1213
1213
  if (typeof window > "u") return null;
1214
1214
  const i = window;
1215
1215
  return i.SpeechRecognition ?? i.webkitSpeechRecognition ?? null;
@@ -1227,7 +1227,7 @@ class Ht {
1227
1227
  }, this.onTTSEnd = () => {
1228
1228
  this.ttsSpeaking = !1, this.isListening && this.restartAllowed ? this.safeRestart() : this.emitStatus(this.isListening ? "listening" : "idle");
1229
1229
  };
1230
- const s = ve();
1230
+ const s = xe();
1231
1231
  if (s) {
1232
1232
  this.recognition = new s(), this.recognition.lang = e, this.recognition.interimResults = t.interimResults ?? !0, this.recognition.continuous = t.continuous ?? !0, this.recognition.onresult = (o) => this.handleResult(o, t), this.recognition.onend = () => this.handleEnd(), this.recognition.onstart = () => {
1233
1233
  this.log("recognition onstart"), this.engineActive = !0, this.hadResultThisSession = !1, this.restartTimer && (clearTimeout(this.restartTimer), this.restartTimer = null), this.backoffMs = 250, this.isListening && !this.ttsSpeaking && this.emitStatus("listening");
@@ -1259,7 +1259,7 @@ class Ht {
1259
1259
  }
1260
1260
  /** Check if SpeechRecognition is available */
1261
1261
  isSupported() {
1262
- return ve() !== null;
1262
+ return xe() !== null;
1263
1263
  }
1264
1264
  /** Allow consumers (wrappers) to observe status changes */
1265
1265
  onStatusChange(e) {
@@ -1298,10 +1298,10 @@ class Ht {
1298
1298
  if (!this.resultCallback) return;
1299
1299
  const s = t.confidenceThreshold ?? 0.6;
1300
1300
  for (let a = e.resultIndex; a < e.results.length; a++) {
1301
- const r = e.results[a], c = r && r[0], h = ((o = (n = c == null ? void 0 : c.transcript) == null ? void 0 : n.trim) == null ? void 0 : o.call(n)) || "", d = (c == null ? void 0 : c.confidence) ?? 0;
1302
- if (h && !(!r.isFinal && t.interimResults === !1) && !(r.isFinal && d < s))
1301
+ const r = e.results[a], l = r && r[0], m = ((o = (n = l == null ? void 0 : l.transcript) == null ? void 0 : n.trim) == null ? void 0 : o.call(n)) || "", d = (l == null ? void 0 : l.confidence) ?? 0;
1302
+ if (m && !(!r.isFinal && t.interimResults === !1) && !(r.isFinal && d < s))
1303
1303
  try {
1304
- this.hadResultThisSession = !0, this.resultCallback(h, !!r.isFinal);
1304
+ this.hadResultThisSession = !0, this.resultCallback(m, !!r.isFinal);
1305
1305
  } catch {
1306
1306
  this.error("VoiceProcessor: result callback error");
1307
1307
  }
@@ -1568,11 +1568,11 @@ class Bt {
1568
1568
  this.container = document.createElement("div"), this.container.id = "foisit-overlay-container", this.container.className = "foisit-overlay-container", document.body.appendChild(this.container), ((s = this.config.floatingButton) == null ? void 0 : s.visible) !== !1 && this.renderFloatingButton(), this.renderChatWindow(), this.config.enableGestureActivation && (this.gestureHandler = new ae(), this.gestureHandler.setupTripleTapListener(() => this.toggle()));
1569
1569
  }
1570
1570
  renderFloatingButton() {
1571
- var n, o, a, r, c, h;
1571
+ var n, o, a, r, l, m;
1572
1572
  const e = document.createElement("button");
1573
1573
  e.innerHTML = ((n = this.config.floatingButton) == null ? void 0 : n.customHtml) || "🎙️";
1574
- const t = ((a = (o = this.config.floatingButton) == null ? void 0 : o.position) == null ? void 0 : a.bottom) || "20px", s = ((c = (r = this.config.floatingButton) == null ? void 0 : r.position) == null ? void 0 : c.right) || "20px";
1575
- e.className = "foisit-floating-btn", e.style.bottom = t, e.style.right = s, e.onclick = () => this.toggle(), e.onmouseenter = () => e.style.transform = "scale(1.05)", e.onmouseleave = () => e.style.transform = "scale(1)", (h = this.container) == null || h.appendChild(e);
1574
+ const t = ((a = (o = this.config.floatingButton) == null ? void 0 : o.position) == null ? void 0 : a.bottom) || "20px", s = ((l = (r = this.config.floatingButton) == null ? void 0 : r.position) == null ? void 0 : l.right) || "20px";
1575
+ e.className = "foisit-floating-btn", e.style.bottom = t, e.style.right = s, e.onclick = () => this.toggle(), e.onmouseenter = () => e.style.transform = "scale(1.05)", e.onmouseleave = () => e.style.transform = "scale(1)", (m = this.container) == null || m.appendChild(e);
1576
1576
  }
1577
1577
  renderChatWindow() {
1578
1578
  var o;
@@ -1588,8 +1588,8 @@ class Bt {
1588
1588
  n.className = "foisit-input-area", this.input = document.createElement("input"), this.input.placeholder = this.config.inputPlaceholder || "Type a command...", this.input.className = "foisit-input", this.input.addEventListener("keydown", (a) => {
1589
1589
  var r;
1590
1590
  if (a.key === "Enter" && ((r = this.input) != null && r.value.trim())) {
1591
- const c = this.input.value.trim();
1592
- this.input.value = "", this.onSubmit && this.onSubmit(c);
1591
+ const l = this.input.value.trim();
1592
+ this.input.value = "", this.onSubmit && this.onSubmit(l);
1593
1593
  }
1594
1594
  }), n.appendChild(this.input), this.chatWindow.appendChild(e), this.chatWindow.appendChild(this.messagesContainer), this.chatWindow.appendChild(n), (o = this.container) == null || o.appendChild(this.chatWindow);
1595
1595
  }
@@ -1619,194 +1619,260 @@ class Bt {
1619
1619
  const n = (e || "").length || 0, o = Math.max(120, 700 - Math.min(600, Math.floor(n * 6)));
1620
1620
  s.style.opacity = "0", s.style.transform = "translateY(8px)", s.style.transition = "none", this.messagesContainer.appendChild(s), this.animateMessageEntrance(s, o), this.scrollToBottom();
1621
1621
  }
1622
- addOptions(e) {
1622
+ addOptions(e, t) {
1623
1623
  if (!this.messagesContainer) return;
1624
- const t = document.createElement("div");
1625
- t.className = "foisit-options-container", e.forEach((s) => {
1626
- const n = document.createElement("button");
1627
- n.textContent = s.label, n.className = "foisit-option-chip", n.setAttribute("type", "button"), n.setAttribute("aria-label", s.label);
1628
- const o = () => {
1629
- if (s.commandId) {
1630
- this.onSubmit && this.onSubmit({ commandId: s.commandId });
1631
- return;
1632
- }
1633
- const a = s && typeof s.value == "string" && s.value.trim() ? s.value : s.label;
1634
- this.onSubmit && this.onSubmit(a);
1635
- };
1636
- n.onclick = o, n.onkeydown = (a) => {
1637
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), o());
1638
- }, t.appendChild(n);
1639
- }), this.messagesContainer.appendChild(t), this.scrollToBottom();
1624
+ const s = (t == null ? void 0 : t.allowMultiple) === !0, n = document.createElement("div");
1625
+ if (n.className = "foisit-options-container", !s)
1626
+ e.forEach((o) => {
1627
+ const a = document.createElement("button");
1628
+ a.textContent = o.label, a.className = "foisit-option-chip", a.setAttribute("type", "button"), a.setAttribute("aria-label", o.label);
1629
+ const r = () => {
1630
+ if (o.commandId) {
1631
+ this.onSubmit && this.onSubmit({ commandId: o.commandId });
1632
+ return;
1633
+ }
1634
+ const l = o && typeof o.value == "string" && o.value.trim() ? o.value : o.label;
1635
+ this.onSubmit && this.onSubmit(l);
1636
+ };
1637
+ a.onclick = r, a.onkeydown = (l) => {
1638
+ (l.key === "Enter" || l.key === " ") && (l.preventDefault(), r());
1639
+ }, n.appendChild(a);
1640
+ });
1641
+ else {
1642
+ const o = /* @__PURE__ */ new Set();
1643
+ e.forEach((r) => {
1644
+ const l = document.createElement("button");
1645
+ l.textContent = r.label, l.className = "foisit-option-chip", l.setAttribute("type", "button"), l.setAttribute("aria-label", r.label);
1646
+ const m = r && typeof r.value == "string" && r.value.trim() ? r.value : r.label;
1647
+ l.onclick = () => {
1648
+ o.has(m) ? (o.delete(m), l.classList.remove("selected")) : (o.add(m), l.classList.add("selected"));
1649
+ }, l.onkeydown = (d) => {
1650
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), l.click());
1651
+ }, n.appendChild(l);
1652
+ });
1653
+ const a = document.createElement("button");
1654
+ a.type = "button", a.className = "foisit-option-chip foisit-confirm", a.textContent = (t == null ? void 0 : t.confirmLabel) || "Submit", a.onclick = () => {
1655
+ const r = Array.from(o);
1656
+ this.onSubmit && this.onSubmit(r);
1657
+ }, n.appendChild(a);
1658
+ }
1659
+ this.messagesContainer.appendChild(n), this.scrollToBottom();
1640
1660
  }
1641
1661
  addForm(e, t, s) {
1642
1662
  if (!this.messagesContainer) return;
1643
1663
  this.addMessage(e, "system");
1644
1664
  const n = document.createElement("form");
1645
1665
  n.className = "foisit-form";
1646
- const o = [], a = (d, l) => {
1647
- const f = document.createElement("div");
1648
- return f.className = "foisit-form-label", f.innerHTML = d + (l ? ' <span class="foisit-req-star">*</span>' : ""), f;
1666
+ const o = [], a = (d, c) => {
1667
+ const u = document.createElement("div");
1668
+ return u.className = "foisit-form-label", u.innerHTML = d + (c ? ' <span class="foisit-req-star">*</span>' : ""), u;
1649
1669
  }, r = () => {
1650
1670
  const d = document.createElement("div");
1651
1671
  return d.className = "foisit-form-error", d.style.display = "none", d;
1652
1672
  };
1653
1673
  (t ?? []).forEach((d) => {
1654
- const l = document.createElement("div");
1655
- l.className = "foisit-form-group";
1656
- const f = d.description || d.name;
1657
- l.appendChild(a(f, d.required));
1658
- let m;
1674
+ const c = document.createElement("div");
1675
+ c.className = "foisit-form-group";
1676
+ const u = d.label || d.description || d.name;
1677
+ c.appendChild(a(u, d.required));
1678
+ let y;
1659
1679
  if (d.type === "select") {
1660
- const u = document.createElement("select");
1661
- u.className = "foisit-form-input";
1662
- const v = document.createElement("option");
1663
- v.value = "", v.textContent = "Select...", u.appendChild(v);
1664
- const x = (p) => {
1665
- (p ?? []).forEach((C) => {
1666
- const y = document.createElement("option");
1667
- y.value = String(C.value ?? C.label ?? ""), y.textContent = String(C.label ?? C.value ?? ""), u.appendChild(y);
1680
+ const h = d;
1681
+ if (h.multiple) {
1682
+ const b = document.createElement("div");
1683
+ b.className = "foisit-multiselect-container";
1684
+ const g = (k) => {
1685
+ k.forEach((p) => {
1686
+ const S = document.createElement("label");
1687
+ S.className = "foisit-multiselect-label";
1688
+ const v = document.createElement("input");
1689
+ v.type = "checkbox", v.value = String(p.value ?? p.label ?? ""), v.className = "foisit-form-checkbox", S.appendChild(v), S.appendChild(document.createTextNode(" " + String(p.label ?? p.value ?? ""))), b.appendChild(S), b.appendChild(document.createElement("br"));
1690
+ });
1691
+ };
1692
+ if (Array.isArray(h.options) && h.options.length)
1693
+ g(h.options);
1694
+ else if (typeof h.getOptions == "function") {
1695
+ const k = document.createElement("div");
1696
+ k.textContent = "Loading...", b.appendChild(k);
1697
+ const p = h.getOptions;
1698
+ Promise.resolve().then(() => p()).then((S) => {
1699
+ b.innerHTML = "", g(S);
1700
+ }).catch(() => {
1701
+ b.innerHTML = "";
1702
+ const S = document.createElement("div");
1703
+ S.textContent = "Error loading options", b.appendChild(S);
1704
+ });
1705
+ }
1706
+ y = b, o.push({ name: d.name, type: d.type, el: y, required: d.required, multiple: !0 }), c.appendChild(y);
1707
+ const w = r();
1708
+ c.appendChild(w), n.appendChild(c);
1709
+ return;
1710
+ }
1711
+ const x = document.createElement("select");
1712
+ x.className = "foisit-form-input";
1713
+ const E = document.createElement("option");
1714
+ E.value = "", E.textContent = "Select...", x.appendChild(E);
1715
+ const C = (b) => {
1716
+ (b ?? []).forEach((g) => {
1717
+ const w = document.createElement("option");
1718
+ w.value = String(g.value ?? g.label ?? ""), w.textContent = String(g.label ?? g.value ?? ""), x.appendChild(w);
1668
1719
  });
1669
1720
  };
1670
1721
  if (Array.isArray(d.options) && d.options.length)
1671
- x(d.options);
1722
+ C(d.options);
1672
1723
  else if (typeof d.getOptions == "function") {
1673
- const p = d.getOptions, C = document.createElement("option");
1674
- C.value = "", C.textContent = "Loading...", u.appendChild(C), Promise.resolve().then(() => p()).then((y) => {
1675
- for (; u.options.length > 1; ) u.remove(1);
1676
- x(y);
1724
+ const b = d.getOptions, g = document.createElement("option");
1725
+ g.value = "", g.textContent = "Loading...", x.appendChild(g), Promise.resolve().then(() => b()).then((w) => {
1726
+ for (; x.options.length > 1; ) x.remove(1);
1727
+ C(w);
1677
1728
  }).catch(() => {
1678
- for (; u.options.length > 1; ) u.remove(1);
1679
- const y = document.createElement("option");
1680
- y.value = "", y.textContent = "Error loading options", u.appendChild(y);
1729
+ for (; x.options.length > 1; ) x.remove(1);
1730
+ const w = document.createElement("option");
1731
+ w.value = "", w.textContent = "Error loading options", x.appendChild(w);
1681
1732
  });
1682
1733
  }
1683
- d.defaultValue != null && (u.value = String(d.defaultValue)), m = u;
1734
+ d.defaultValue != null && (x.value = String(d.defaultValue)), y = x;
1684
1735
  } else if (d.type === "file") {
1685
- const u = d, v = document.createElement("input");
1686
- v.className = "foisit-form-input", v.type = "file", u.accept && Array.isArray(u.accept) && (v.accept = u.accept.join(",")), u.multiple && (v.multiple = !0), u.capture && (u.capture === !0 ? v.setAttribute("capture", "") : v.setAttribute("capture", String(u.capture))), v.addEventListener("change", async () => {
1687
- const x = Array.from(v.files || []), p = b;
1688
- if (p.style.display = "none", p.textContent = "", x.length === 0) return;
1689
- const C = u.maxFiles ?? (u.multiple ? 10 : 1);
1690
- if (x.length > C) {
1691
- p.textContent = `Please select at most ${C} file(s).`, p.style.display = "block";
1736
+ const h = d, x = document.createElement("input");
1737
+ x.className = "foisit-form-input", x.type = "file", h.accept && Array.isArray(h.accept) && (x.accept = h.accept.join(",")), h.multiple && (x.multiple = !0), h.capture && (h.capture === !0 ? x.setAttribute("capture", "") : x.setAttribute("capture", String(h.capture))), x.addEventListener("change", async () => {
1738
+ const E = Array.from(x.files || []), C = f;
1739
+ if (C.style.display = "none", C.textContent = "", E.length === 0) return;
1740
+ const b = h.maxFiles ?? (h.multiple ? 10 : 1);
1741
+ if (E.length > b) {
1742
+ C.textContent = `Please select at most ${b} file(s).`, C.style.display = "block";
1692
1743
  return;
1693
1744
  }
1694
- const y = u.maxSizeBytes ?? 1 / 0, g = x.reduce((w, B) => w + B.size, 0);
1695
- if (x.some((w) => w.size > y)) {
1696
- p.textContent = `One or more files exceed the maximum size of ${Math.round(
1697
- y / 1024
1698
- )} KB.`, p.style.display = "block";
1745
+ const g = h.maxSizeBytes ?? 1 / 0, w = E.reduce((p, S) => p + S.size, 0);
1746
+ if (E.some((p) => p.size > g)) {
1747
+ C.textContent = `One or more files exceed the maximum size of ${Math.round(
1748
+ g / 1024
1749
+ )} KB.`, C.style.display = "block";
1699
1750
  return;
1700
1751
  }
1701
- const V = u.maxTotalBytes ?? 1 / 0;
1702
- if (g > V) {
1703
- p.textContent = `Total selected files exceed the maximum of ${Math.round(
1704
- V / 1024
1705
- )} KB.`, p.style.display = "block";
1752
+ const k = h.maxTotalBytes ?? 1 / 0;
1753
+ if (w > k) {
1754
+ C.textContent = `Total selected files exceed the maximum of ${Math.round(
1755
+ k / 1024
1756
+ )} KB.`, C.style.display = "block";
1706
1757
  return;
1707
1758
  }
1708
- if (u.accept && Array.isArray(u.accept)) {
1709
- const w = u.accept;
1710
- if (!x.every((U) => U.type ? w.some(
1711
- (W) => W.startsWith(".") ? U.name.toLowerCase().endsWith(W.toLowerCase()) : U.type === W || U.type.startsWith(W.split("/")[0] + "/")
1759
+ if (h.accept && Array.isArray(h.accept)) {
1760
+ const p = h.accept;
1761
+ if (!E.every((v) => v.type ? p.some(
1762
+ (V) => V.startsWith(".") ? v.name.toLowerCase().endsWith(V.toLowerCase()) : v.type === V || v.type.startsWith(V.split("/")[0] + "/")
1712
1763
  ) : !0)) {
1713
- p.textContent = "One or more files have an unsupported type.", p.style.display = "block";
1764
+ C.textContent = "One or more files have an unsupported type.", C.style.display = "block";
1714
1765
  return;
1715
1766
  }
1716
1767
  }
1717
- }), m = v;
1768
+ }), y = x;
1718
1769
  } else {
1719
- const u = document.createElement("input");
1720
- u.className = "foisit-form-input", d.type === "string" && (u.placeholder = d.placeholder || "Type here..."), d.type === "number" ? (u.type = "number", typeof d.min == "number" && (u.min = String(d.min)), typeof d.max == "number" && (u.max = String(d.max)), typeof d.step == "number" && (u.step = String(d.step)), d.defaultValue != null && (u.value = String(d.defaultValue))) : d.type === "date" ? (u.type = "date", typeof d.min == "string" && (u.min = d.min), typeof d.max == "string" && (u.max = d.max), d.defaultValue != null && (u.value = String(d.defaultValue))) : (u.type = "text", d.defaultValue != null && (u.value = String(d.defaultValue))), m = u;
1770
+ const h = document.createElement("input");
1771
+ h.className = "foisit-form-input", d.type === "string" && (h.placeholder = d.placeholder || "Type here..."), d.type === "number" ? (h.type = "number", typeof d.min == "number" && (h.min = String(d.min)), typeof d.max == "number" && (h.max = String(d.max)), typeof d.step == "number" && (h.step = String(d.step)), d.defaultValue != null && (h.value = String(d.defaultValue))) : d.type === "date" ? (h.type = "date", typeof d.min == "string" && (h.min = d.min), typeof d.max == "string" && (h.max = d.max), d.defaultValue != null && (h.value = String(d.defaultValue))) : (h.type = "text", d.defaultValue != null && (h.value = String(d.defaultValue))), y = h;
1721
1772
  }
1722
- const b = r();
1723
- l.appendChild(m), l.appendChild(b), o.push({
1773
+ const f = r();
1774
+ c.appendChild(y), c.appendChild(f), o.push({
1724
1775
  name: d.name,
1725
1776
  type: d.type,
1726
- el: m,
1777
+ el: y,
1727
1778
  required: d.required
1728
- }), n.appendChild(l);
1779
+ }), n.appendChild(c);
1729
1780
  });
1730
- const c = document.createElement("div");
1731
- c.className = "foisit-form-actions";
1732
- const h = document.createElement("button");
1733
- h.type = "submit", h.textContent = "Submit", h.className = "foisit-option-chip", h.style.fontWeight = "600", c.appendChild(h), n.appendChild(c), n.onsubmit = async (d) => {
1781
+ const l = document.createElement("div");
1782
+ l.className = "foisit-form-actions";
1783
+ const m = document.createElement("button");
1784
+ m.type = "submit", m.textContent = "Submit", m.className = "foisit-option-chip", m.style.fontWeight = "600", l.appendChild(m), n.appendChild(l), n.onsubmit = async (d) => {
1785
+ var y;
1734
1786
  d.preventDefault();
1735
- const l = {};
1736
- let f = !1;
1737
- n.querySelectorAll(".foisit-form-error").forEach((m) => {
1738
- m.style.display = "none", m.textContent = "";
1739
- }), n.querySelectorAll(".foisit-form-input").forEach((m) => {
1740
- m.classList.remove("foisit-error-border");
1787
+ const c = {};
1788
+ let u = !1;
1789
+ n.querySelectorAll(".foisit-form-error").forEach((f) => {
1790
+ f.style.display = "none", f.textContent = "";
1791
+ }), n.querySelectorAll(".foisit-form-input").forEach((f) => {
1792
+ f.classList.remove("foisit-error-border");
1741
1793
  });
1742
- for (const m of o) {
1743
- if (m.type === "file") {
1744
- const x = m.el.parentElement, p = x == null ? void 0 : x.querySelector(
1794
+ for (const f of o) {
1795
+ if (f.multiple) {
1796
+ let b = [];
1797
+ if (f.el instanceof HTMLSelectElement ? b = Array.from(f.el.selectedOptions).map((g) => g.value) : b = Array.from(
1798
+ f.el.querySelectorAll("input[type=checkbox]:checked")
1799
+ ).map((w) => w.value), f.required && b.length === 0) {
1800
+ u = !0, f.el.classList.add("foisit-error-border");
1801
+ const g = (y = f.el.parentElement) == null ? void 0 : y.querySelector(
1802
+ ".foisit-form-error"
1803
+ );
1804
+ g && (g.textContent = "This field is required", g.style.display = "block");
1805
+ }
1806
+ b.length > 0 && (c[f.name] = b);
1807
+ continue;
1808
+ }
1809
+ if (f.type === "file") {
1810
+ const b = f.el.parentElement, g = b == null ? void 0 : b.querySelector(
1745
1811
  ".foisit-form-error"
1746
- ), C = m.el, y = Array.from(C.files || []);
1747
- if (m.required && y.length === 0) {
1748
- f = !0, C.classList.add("foisit-error-border"), p && (p.textContent = "This file is required", p.style.display = "block");
1812
+ ), w = f.el, k = Array.from(w.files || []);
1813
+ if (f.required && k.length === 0) {
1814
+ u = !0, w.classList.add("foisit-error-border"), g && (g.textContent = "This file is required", g.style.display = "block");
1749
1815
  continue;
1750
1816
  }
1751
- if (y.length === 0) continue;
1752
- const g = (t ?? []).find((w) => w.name === m.name), V = (g == null ? void 0 : g.delivery) ?? "file";
1753
- if (g != null && g.maxWidth || g != null && g.maxHeight)
1817
+ if (k.length === 0) continue;
1818
+ const p = (t ?? []).find((v) => v.name === f.name), S = (p == null ? void 0 : p.delivery) ?? "file";
1819
+ if (p != null && p.maxWidth || p != null && p.maxHeight)
1754
1820
  try {
1755
- const w = await this.getImageDimensions(y[0]);
1756
- if (g.maxWidth && w.width > g.maxWidth) {
1757
- f = !0, p && (p.textContent = `Image width must be ≤ ${g.maxWidth}px`, p.style.display = "block");
1821
+ const v = await this.getImageDimensions(k[0]);
1822
+ if (p.maxWidth && v.width > p.maxWidth) {
1823
+ u = !0, g && (g.textContent = `Image width must be ≤ ${p.maxWidth}px`, g.style.display = "block");
1758
1824
  continue;
1759
1825
  }
1760
- if (g.maxHeight && w.height > g.maxHeight) {
1761
- f = !0, p && (p.textContent = `Image height must be ≤ ${g.maxHeight}px`, p.style.display = "block");
1826
+ if (p.maxHeight && v.height > p.maxHeight) {
1827
+ u = !0, g && (g.textContent = `Image height must be ≤ ${p.maxHeight}px`, g.style.display = "block");
1762
1828
  continue;
1763
1829
  }
1764
1830
  } catch {
1765
1831
  }
1766
- if (g != null && g.maxDurationSec)
1832
+ if (p != null && p.maxDurationSec)
1767
1833
  try {
1768
- const w = await this.getMediaDuration(y[0]);
1769
- if (w && w > g.maxDurationSec) {
1770
- f = !0, p && (p.textContent = `Media duration must be ≤ ${g.maxDurationSec}s`, p.style.display = "block");
1834
+ const v = await this.getMediaDuration(k[0]);
1835
+ if (v && v > p.maxDurationSec) {
1836
+ u = !0, g && (g.textContent = `Media duration must be ≤ ${p.maxDurationSec}s`, g.style.display = "block");
1771
1837
  continue;
1772
1838
  }
1773
1839
  } catch {
1774
1840
  }
1775
- if (V === "file")
1776
- l[m.name] = g != null && g.multiple ? y : y[0];
1777
- else if (V === "base64")
1841
+ if (S === "file")
1842
+ c[f.name] = p != null && p.multiple ? k : k[0];
1843
+ else if (S === "base64")
1778
1844
  try {
1779
- const w = await Promise.all(
1780
- y.map((B) => this.readFileAsDataURL(B))
1845
+ const v = await Promise.all(
1846
+ k.map((V) => this.readFileAsDataURL(V))
1781
1847
  );
1782
- l[m.name] = g != null && g.multiple ? w : w[0];
1848
+ c[f.name] = p != null && p.multiple ? v : v[0];
1783
1849
  } catch {
1784
- f = !0, p && (p.textContent = "Failed to encode file(s) to base64.", p.style.display = "block");
1850
+ u = !0, g && (g.textContent = "Failed to encode file(s) to base64.", g.style.display = "block");
1785
1851
  continue;
1786
1852
  }
1787
1853
  continue;
1788
1854
  }
1789
- const b = (m.el.value ?? "").toString().trim(), u = m.el.parentElement, v = u == null ? void 0 : u.querySelector(
1855
+ const x = (f.el.value ?? "").toString().trim(), E = f.el.parentElement, C = E == null ? void 0 : E.querySelector(
1790
1856
  ".foisit-form-error"
1791
1857
  );
1792
- if (m.required && (b == null || b === "")) {
1793
- f = !0, m.el.classList.add("foisit-error-border"), v && (v.textContent = "This field is required", v.style.display = "block");
1858
+ if (f.required && (x == null || x === "")) {
1859
+ u = !0, f.el.classList.add("foisit-error-border"), C && (C.textContent = "This field is required", C.style.display = "block");
1794
1860
  continue;
1795
1861
  }
1796
- if (b !== "")
1797
- if (m.type === "number") {
1798
- const x = Number(b);
1799
- Number.isNaN(x) || (l[m.name] = x);
1862
+ if (x !== "")
1863
+ if (f.type === "number") {
1864
+ const b = Number(x);
1865
+ Number.isNaN(b) || (c[f.name] = b);
1800
1866
  } else
1801
- l[m.name] = b;
1867
+ c[f.name] = x;
1802
1868
  }
1803
- if (f) {
1869
+ if (u) {
1804
1870
  n.classList.add("foisit-shake"), setTimeout(() => n.classList.remove("foisit-shake"), 400);
1805
1871
  return;
1806
1872
  }
1807
- h.disabled = !0, h.style.opacity = "0.6", o.forEach((m) => {
1808
- m.el.disabled = !0;
1809
- }), s(l);
1873
+ m.disabled = !0, m.style.opacity = "0.6", o.forEach((f) => {
1874
+ f.el.disabled = !0;
1875
+ }), s(c);
1810
1876
  }, this.messagesContainer.appendChild(n), this.scrollToBottom();
1811
1877
  }
1812
1878
  showLoading() {
@@ -1852,9 +1918,9 @@ class Bt {
1852
1918
  t.scrollTop = n;
1853
1919
  return;
1854
1920
  }
1855
- const o = n - s, a = performance.now(), r = (c) => {
1856
- const h = Math.min(1, (c - a) / e), d = 1 - Math.pow(1 - h, 3);
1857
- t.scrollTop = Math.round(s + o * d), h < 1 && requestAnimationFrame(r);
1921
+ const o = n - s, a = performance.now(), r = (l) => {
1922
+ const m = Math.min(1, (l - a) / e), d = 1 - Math.pow(1 - m, 3);
1923
+ t.scrollTop = Math.round(s + o * d), m < 1 && requestAnimationFrame(r);
1858
1924
  };
1859
1925
  requestAnimationFrame(r);
1860
1926
  }
@@ -1928,8 +1994,8 @@ class Bt {
1928
1994
  n.preload = "metadata", n.onloadedmetadata = () => {
1929
1995
  if (o) return;
1930
1996
  o = !0, clearTimeout(a);
1931
- const c = n.duration || 0;
1932
- URL.revokeObjectURL(s), t(c);
1997
+ const l = n.duration || 0;
1998
+ URL.revokeObjectURL(s), t(l);
1933
1999
  }, n.onerror = () => {
1934
2000
  o || (o = !0, clearTimeout(a), URL.revokeObjectURL(s), t(0));
1935
2001
  }, n.src = s;
@@ -1944,12 +2010,12 @@ class Bt {
1944
2010
  e.id = "foisit-overlay-styles";
1945
2011
  const t = this.config.theme || "glass", s = this.config.themeColors || {};
1946
2012
  if (t === "solid") {
1947
- const n = s.background || "#1a1a2e", o = s.text || "#ffffff", a = s.accent || "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", r = s.userBubbleBg || "rgba(102, 126, 234, 0.2)", c = s.systemBubbleBg || "rgba(255, 255, 255, 0.08)", h = s.border || "rgba(255, 255, 255, 0.1)";
2013
+ const n = s.background || "#1a1a2e", o = s.text || "#ffffff", a = s.accent || "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", r = s.checkboxAccent || "#667eea", l = s.checkboxBorder || "rgba(255,255,255,0.16)", m = s.checkboxCheck || "#ffffff", d = s.userBubbleBg || "rgba(102, 126, 234, 0.2)", c = s.systemBubbleBg || "rgba(255, 255, 255, 0.08)", u = s.border || "rgba(255, 255, 255, 0.1)";
1948
2014
  e.textContent = `
1949
2015
  :root {
1950
2016
  /* SOLID THEME - Custom Colors */
1951
2017
  --foisit-bg: ${n};
1952
- --foisit-border: 1px solid ${h};
2018
+ --foisit-border: 1px solid ${u};
1953
2019
  --foisit-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
1954
2020
  --foisit-text: ${o};
1955
2021
  --foisit-accent: ${a};
@@ -1960,12 +2026,18 @@ class Bt {
1960
2026
  --foisit-input-placeholder: ${o}99;
1961
2027
 
1962
2028
  /* Bubbles */
1963
- --foisit-bubble-user-bg: ${r};
2029
+ --foisit-bubble-user-bg: ${d};
1964
2030
  --foisit-bubble-user-text: ${o};
1965
2031
 
1966
2032
  --foisit-bubble-sys-bg: ${c};
1967
2033
  --foisit-bubble-sys-text: ${o}ee;
1968
2034
 
2035
+ /* Checkbox accent color for custom-styled checkboxes */
2036
+ --foisit-checkbox-accent: ${r};
2037
+ /* Checkbox border and checkmark colors */
2038
+ --foisit-checkbox-border: ${l};
2039
+ --foisit-checkbox-check: ${m};
2040
+
1969
2041
  /* Form Colors */
1970
2042
  --foisit-req-star: #f87171;
1971
2043
  --foisit-error-text: #fca5a5;
@@ -1998,6 +2070,9 @@ class Bt {
1998
2070
  --foisit-req-star: #ef4444; /* Red asterisk */
1999
2071
  --foisit-error-text: #dc2626;
2000
2072
  --foisit-error-border: #fca5a5;
2073
+ --foisit-checkbox-accent: #667eea;
2074
+ --foisit-checkbox-border: rgba(0,0,0,0.18);
2075
+ --foisit-checkbox-check: #ffffff;
2001
2076
  }
2002
2077
 
2003
2078
  @media (prefers-color-scheme: dark) {
@@ -2024,6 +2099,8 @@ class Bt {
2024
2099
  --foisit-req-star: #f87171;
2025
2100
  --foisit-error-text: #fca5a5;
2026
2101
  --foisit-error-border: #f87171;
2102
+ --foisit-checkbox-border: rgba(255,255,255,0.16);
2103
+ --foisit-checkbox-check: #ffffff;
2027
2104
  }
2028
2105
  }
2029
2106
  `;
@@ -2209,6 +2286,60 @@ class Bt {
2209
2286
  .foisit-option-chip:hover {
2210
2287
  background: rgba(127,127,127,0.15);
2211
2288
  }
2289
+ .foisit-option-chip.selected {
2290
+ background: rgba(127,127,127,0.25);
2291
+ }
2292
+
2293
+ .foisit-multiselect-container {
2294
+ display: flex;
2295
+ flex-direction: column;
2296
+ gap: 6px;
2297
+ margin-top: 6px;
2298
+ }
2299
+ .foisit-multiselect-label {
2300
+ font-size: 13px;
2301
+ color: var(--foisit-text);
2302
+ display: flex;
2303
+ align-items: center;
2304
+ gap: 10px;
2305
+ }
2306
+ .foisit-form-checkbox {
2307
+ margin-right: 8px;
2308
+ width: 18px;
2309
+ height: 18px;
2310
+ -webkit-appearance: none;
2311
+ appearance: none;
2312
+ border: 1.5px solid var(--foisit-checkbox-border);
2313
+ border-radius: 4px;
2314
+ display: inline-block;
2315
+ position: relative;
2316
+ vertical-align: middle;
2317
+ background: transparent;
2318
+ transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
2319
+ }
2320
+ .foisit-form-checkbox:focus {
2321
+ box-shadow: 0 0 0 5px rgba(100,150,255,0.12);
2322
+ outline: none;
2323
+ }
2324
+ .foisit-form-checkbox:checked {
2325
+ background: var(--foisit-checkbox-accent);
2326
+ border-color: var(--foisit-checkbox-accent);
2327
+ }
2328
+ .foisit-form-checkbox:checked::after {
2329
+ content: '';
2330
+ position: absolute;
2331
+ left: 5px;
2332
+ top: 3px;
2333
+ width: 5px;
2334
+ height: 9px;
2335
+ border: solid var(--foisit-checkbox-check);
2336
+ border-width: 0 2px 2px 0;
2337
+ transform: rotate(45deg);
2338
+ }
2339
+ .foisit-form-checkbox:disabled {
2340
+ opacity: 0.5;
2341
+ cursor: not-allowed;
2342
+ }
2212
2343
 
2213
2344
  /* Form Styling */
2214
2345
  .foisit-form {
@@ -2401,6 +2532,10 @@ class Ut {
2401
2532
  async (t) => {
2402
2533
  if (typeof t == "string")
2403
2534
  this.overlayManager.addMessage(t, "user");
2535
+ else if (Array.isArray(t))
2536
+ t.forEach(
2537
+ (s) => this.overlayManager.addMessage(String(s), "user")
2538
+ );
2404
2539
  else if (t && typeof t == "object") {
2405
2540
  const s = this.extractUserLabel(t);
2406
2541
  s && this.overlayManager.addMessage(s, "user");
@@ -2540,6 +2675,10 @@ class Ut {
2540
2675
  async (s) => {
2541
2676
  if (typeof s == "string")
2542
2677
  this.overlayManager.addMessage(s, "user");
2678
+ else if (Array.isArray(s))
2679
+ s.forEach(
2680
+ (n) => this.overlayManager.addMessage(String(n), "user")
2681
+ );
2543
2682
  else if (s && typeof s == "object") {
2544
2683
  const n = this.extractUserLabel(s);
2545
2684
  n && this.overlayManager.addMessage(n, "user");