@8wave/ai-elements 0.71.0 → 0.73.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.
Files changed (39) hide show
  1. package/dist/_chunks/{PkToolShowSources-CK3lqqoU.js → PkToolShowSources-B2rf94fU.js} +12 -3
  2. package/dist/_chunks/PkToolShowSources-B2rf94fU.js.map +1 -0
  3. package/dist/ai-elements.es.js +125 -359
  4. package/dist/ai-elements.es.js.map +1 -1
  5. package/dist-vue/PkChatbot.js +1 -1
  6. package/dist-vue/PkChatbotMessages.js +1 -1
  7. package/dist-vue/PkChatbotViewChat.js +1 -1
  8. package/dist-vue/PkChatbotViewConversations.js +1 -1
  9. package/dist-vue/PkChatbotViewProfile.js +1 -1
  10. package/dist-vue/_chunks/{PkChatbot-CkxgCXC4.js → PkChatbot-D5_ytfqS.js} +5 -5
  11. package/dist-vue/_chunks/{PkChatbot-CkxgCXC4.js.map → PkChatbot-D5_ytfqS.js.map} +1 -1
  12. package/dist-vue/_chunks/{PkChatbotMessages-B5EK-qDo.js → PkChatbotMessages-CMLqkhmb.js} +2 -2
  13. package/dist-vue/_chunks/{PkChatbotMessages-B5EK-qDo.js.map → PkChatbotMessages-CMLqkhmb.js.map} +1 -1
  14. package/dist-vue/_chunks/{PkChatbotViewChat-C4haTRtG.js → PkChatbotViewChat-wLCypxNG.js} +4 -4
  15. package/dist-vue/_chunks/{PkChatbotViewChat-C4haTRtG.js.map → PkChatbotViewChat-wLCypxNG.js.map} +1 -1
  16. package/dist-vue/_chunks/{PkChatbotViewConversations--vd3MWYy.js → PkChatbotViewConversations-B5qBiqo4.js} +2 -2
  17. package/dist-vue/_chunks/{PkChatbotViewConversations--vd3MWYy.js.map → PkChatbotViewConversations-B5qBiqo4.js.map} +1 -1
  18. package/dist-vue/_chunks/{PkChatbotViewProfile-Cafl_Jf8.js → PkChatbotViewProfile-CXmmVXrD.js} +2 -2
  19. package/dist-vue/_chunks/{PkChatbotViewProfile-Cafl_Jf8.js.map → PkChatbotViewProfile-CXmmVXrD.js.map} +1 -1
  20. package/dist-vue/_chunks/{PkToolShowSources-BXeGRm4D.js → PkToolShowSources-D5cBZxwQ.js} +12 -3
  21. package/dist-vue/_chunks/PkToolShowSources-D5cBZxwQ.js.map +1 -0
  22. package/dist-vue/_chunks/{createChatbotApiClient-OA7JscBS.js → createChatbotApiClient-2ynLWELM.js} +2 -2
  23. package/dist-vue/_chunks/createChatbotApiClient-2ynLWELM.js.map +1 -0
  24. package/dist-vue/_chunks/{useChatbotStore-BNGyIqjI.js → useChatbotStore-Im8Xjwte.js} +269 -269
  25. package/dist-vue/_chunks/{useChatbotStore-BNGyIqjI.js.map → useChatbotStore-Im8Xjwte.js.map} +1 -1
  26. package/dist-vue/api.js +1 -1
  27. package/dist-vue/composables.js +2 -2
  28. package/dist-vue/index.js +2956 -2714
  29. package/dist-vue/index.js.map +1 -1
  30. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +2 -3553
  31. package/dist-vue/packages/models/src/schema/Agent.d.ts +5 -5
  32. package/dist-vue/packages/models/src/schema/AgentChatStatistics.d.ts +160 -0
  33. package/dist-vue/packages/models/src/schema/Document.d.ts +18 -0
  34. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +1 -1
  35. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -2
  36. package/package.json +2 -2
  37. package/dist/_chunks/PkToolShowSources-CK3lqqoU.js.map +0 -1
  38. package/dist-vue/_chunks/PkToolShowSources-BXeGRm4D.js.map +0 -1
  39. package/dist-vue/_chunks/createChatbotApiClient-OA7JscBS.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-D9KsE1-l.js";
2
- import { t } from "./createChatbotApiClient-OA7JscBS.js";
2
+ import { t } from "./createChatbotApiClient-2ynLWELM.js";
3
3
  import { C as n, S as r, _ as i, a, b as o, c as s, d as c, g as l, i as u, m as d, n as f, o as p, p as m, r as h, s as g, u as ee, v as _, y as v } from "./schemas-sa2dDEGb.js";
4
4
  import { _ as te, g as ne, h as re, s as ie } from "./src-EtGd6cRz.js";
5
5
  import { a as y, i as b, n as x, r as S, t as C } from "./ZodError-Ca0wCsGp.js";
@@ -23,30 +23,30 @@ var me = "vercel.ai.error", he = Symbol.for(me), ge, _e, O = class e extends (_e
23
23
  function ve(e) {
24
24
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
25
25
  }
26
- var k = "AI_InvalidArgumentError", ye = `vercel.ai.error.${k}`, be = Symbol.for(ye), xe, Se, Ce = class extends (Se = O, xe = be, Se) {
26
+ var ye = "AI_InvalidArgumentError", be = `vercel.ai.error.${ye}`, xe = Symbol.for(be), Se, Ce, we = class extends (Ce = O, Se = xe, Ce) {
27
27
  constructor({ message: e, cause: t, argument: n }) {
28
28
  super({
29
- name: k,
29
+ name: ye,
30
30
  message: e,
31
31
  cause: t
32
- }), this[xe] = !0, this.argument = n;
32
+ }), this[Se] = !0, this.argument = n;
33
33
  }
34
34
  static isInstance(e) {
35
- return O.hasMarker(e, ye);
35
+ return O.hasMarker(e, be);
36
36
  }
37
- }, we = "AI_JSONParseError", Te = `vercel.ai.error.${we}`, Ee = Symbol.for(Te), A, De, Oe = class extends (De = O, A = Ee, De) {
37
+ }, Te = "AI_JSONParseError", Ee = `vercel.ai.error.${Te}`, De = Symbol.for(Ee), k, Oe, ke = class extends (Oe = O, k = De, Oe) {
38
38
  constructor({ text: e, cause: t }) {
39
39
  super({
40
- name: we,
40
+ name: Te,
41
41
  message: `JSON parsing failed: Text: ${e}.
42
42
  Error message: ${ve(t)}`,
43
43
  cause: t
44
- }), this[A] = !0, this.text = e;
44
+ }), this[k] = !0, this.text = e;
45
45
  }
46
46
  static isInstance(e) {
47
- return O.hasMarker(e, Te);
47
+ return O.hasMarker(e, Ee);
48
48
  }
49
- }, ke = "AI_TypeValidationError", Ae = `vercel.ai.error.${ke}`, je = Symbol.for(Ae), Me, Ne, j = class e extends (Ne = O, Me = je, Ne) {
49
+ }, Ae = "AI_TypeValidationError", je = `vercel.ai.error.${Ae}`, Me = Symbol.for(je), Ne, Pe, A = class e extends (Pe = O, Ne = Me, Pe) {
50
50
  constructor({ value: e, cause: t, context: n }) {
51
51
  let r = "Type validation failed";
52
52
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -55,14 +55,14 @@ Error message: ${ve(t)}`,
55
55
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
56
56
  }
57
57
  super({
58
- name: ke,
58
+ name: Ae,
59
59
  message: `${r}: Value: ${JSON.stringify(e)}.
60
60
  Error message: ${ve(t)}`,
61
61
  cause: t
62
- }), this[Me] = !0, this.value = e, this.context = n;
62
+ }), this[Ne] = !0, this.value = e, this.context = n;
63
63
  }
64
64
  static isInstance(e) {
65
- return O.hasMarker(e, Ae);
65
+ return O.hasMarker(e, je);
66
66
  }
67
67
  static wrap({ value: t, cause: n, context: r }) {
68
68
  return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
@@ -71,7 +71,7 @@ Error message: ${ve(t)}`,
71
71
  context: r
72
72
  });
73
73
  }
74
- }, M = (e, t) => {
74
+ }, j = (e, t) => {
75
75
  let n;
76
76
  switch (e.code) {
77
77
  case x.invalid_type:
@@ -125,13 +125,13 @@ Error message: ${ve(t)}`,
125
125
  default: n = t.defaultError, y.assertNever(e);
126
126
  }
127
127
  return { message: n };
128
- }, Pe = M;
129
- function Fe() {
130
- return Pe;
128
+ }, Fe = j;
129
+ function Ie() {
130
+ return Fe;
131
131
  }
132
132
  //#endregion
133
133
  //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.js
134
- var Ie = (e) => {
134
+ var Le = (e) => {
135
135
  let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
136
136
  ...i,
137
137
  path: a
@@ -152,8 +152,8 @@ var Ie = (e) => {
152
152
  message: s
153
153
  };
154
154
  };
155
- function N(e, t) {
156
- let n = Fe(), r = Ie({
155
+ function M(e, t) {
156
+ let n = Ie(), r = Le({
157
157
  issueData: t,
158
158
  data: e.data,
159
159
  path: e.path,
@@ -161,12 +161,12 @@ function N(e, t) {
161
161
  e.common.contextualErrorMap,
162
162
  e.schemaErrorMap,
163
163
  n,
164
- n === M ? void 0 : M
164
+ n === j ? void 0 : j
165
165
  ].filter((e) => !!e)
166
166
  });
167
167
  e.common.issues.push(r);
168
168
  }
169
- var P = class e {
169
+ var N = class e {
170
170
  constructor() {
171
171
  this.value = "valid";
172
172
  }
@@ -179,7 +179,7 @@ var P = class e {
179
179
  static mergeArray(e, t) {
180
180
  let n = [];
181
181
  for (let r of t) {
182
- if (r.status === "aborted") return F;
182
+ if (r.status === "aborted") return P;
183
183
  r.status === "dirty" && e.dirty(), n.push(r.value);
184
184
  }
185
185
  return {
@@ -202,7 +202,7 @@ var P = class e {
202
202
  let n = {};
203
203
  for (let r of t) {
204
204
  let { key: t, value: i } = r;
205
- if (t.status === "aborted" || i.status === "aborted") return F;
205
+ if (t.status === "aborted" || i.status === "aborted") return P;
206
206
  t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
207
207
  }
208
208
  return {
@@ -210,13 +210,13 @@ var P = class e {
210
210
  value: n
211
211
  };
212
212
  }
213
- }, F = Object.freeze({ status: "aborted" }), Le = (e) => ({
213
+ }, P = Object.freeze({ status: "aborted" }), Re = (e) => ({
214
214
  status: "dirty",
215
215
  value: e
216
- }), I = (e) => ({
216
+ }), F = (e) => ({
217
217
  status: "valid",
218
218
  value: e
219
- }), Re = (e) => e.status === "aborted", ze = (e) => e.status === "dirty", Be = (e) => e.status === "valid", Ve = (e) => typeof Promise < "u" && e instanceof Promise, L;
219
+ }), ze = (e) => e.status === "aborted", Be = (e) => e.status === "dirty", I = (e) => e.status === "valid", Ve = (e) => typeof Promise < "u" && e instanceof Promise, L;
220
220
  (function(e) {
221
221
  e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
222
222
  })(L ||= {});
@@ -230,7 +230,7 @@ var R = class {
230
230
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
231
231
  }
232
232
  }, He = (e, t) => {
233
- if (Be(t)) return {
233
+ if (I(t)) return {
234
234
  success: !0,
235
235
  data: t.value
236
236
  };
@@ -278,7 +278,7 @@ var B = class {
278
278
  }
279
279
  _processInputParams(e) {
280
280
  return {
281
- status: new P(),
281
+ status: new N(),
282
282
  ctx: {
283
283
  common: e.parent.common,
284
284
  data: e.data,
@@ -340,7 +340,7 @@ var B = class {
340
340
  path: [],
341
341
  parent: t
342
342
  });
343
- return Be(n) ? { value: n.value } : { issues: t.common.issues };
343
+ return I(n) ? { value: n.value } : { issues: t.common.issues };
344
344
  } catch (e) {
345
345
  e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
346
346
  issues: [],
@@ -351,7 +351,7 @@ var B = class {
351
351
  data: e,
352
352
  path: [],
353
353
  parent: t
354
- }).then((e) => Be(e) ? { value: e.value } : { issues: t.common.issues });
354
+ }).then((e) => I(e) ? { value: e.value } : { issues: t.common.issues });
355
355
  }
356
356
  async parseAsync(e, t) {
357
357
  let n = await this.safeParseAsync(e, t);
@@ -521,14 +521,14 @@ var pt = class e extends B {
521
521
  _parse(e) {
522
522
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== S.string) {
523
523
  let t = this._getOrReturnCtx(e);
524
- return N(t, {
524
+ return M(t, {
525
525
  code: x.invalid_type,
526
526
  expected: S.string,
527
527
  received: t.parsedType
528
- }), F;
528
+ }), P;
529
529
  }
530
- let t = new P(), n;
531
- for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), N(n, {
530
+ let t = new N(), n;
531
+ for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), M(n, {
532
532
  code: x.too_small,
533
533
  minimum: r.value,
534
534
  type: "string",
@@ -536,7 +536,7 @@ var pt = class e extends B {
536
536
  exact: !1,
537
537
  message: r.message
538
538
  }), t.dirty());
539
- else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), N(n, {
539
+ else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), M(n, {
540
540
  code: x.too_big,
541
541
  maximum: r.value,
542
542
  type: "string",
@@ -546,14 +546,14 @@ var pt = class e extends B {
546
546
  }), t.dirty());
547
547
  else if (r.kind === "length") {
548
548
  let i = e.data.length > r.value, a = e.data.length < r.value;
549
- (i || a) && (n = this._getOrReturnCtx(e, n), i ? N(n, {
549
+ (i || a) && (n = this._getOrReturnCtx(e, n), i ? M(n, {
550
550
  code: x.too_big,
551
551
  maximum: r.value,
552
552
  type: "string",
553
553
  inclusive: !0,
554
554
  exact: !0,
555
555
  message: r.message
556
- }) : a && N(n, {
556
+ }) : a && M(n, {
557
557
  code: x.too_small,
558
558
  minimum: r.value,
559
559
  type: "string",
@@ -561,37 +561,37 @@ var pt = class e extends B {
561
561
  exact: !0,
562
562
  message: r.message
563
563
  }), t.dirty());
564
- } else if (r.kind === "email") Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
564
+ } else if (r.kind === "email") Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
565
565
  validation: "email",
566
566
  code: x.invalid_string,
567
567
  message: r.message
568
568
  }), t.dirty());
569
- else if (r.kind === "emoji") Qe ||= new RegExp(Ze, "u"), Qe.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
569
+ else if (r.kind === "emoji") Qe ||= new RegExp(Ze, "u"), Qe.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
570
570
  validation: "emoji",
571
571
  code: x.invalid_string,
572
572
  message: r.message
573
573
  }), t.dirty());
574
- else if (r.kind === "uuid") Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
574
+ else if (r.kind === "uuid") Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
575
575
  validation: "uuid",
576
576
  code: x.invalid_string,
577
577
  message: r.message
578
578
  }), t.dirty());
579
- else if (r.kind === "nanoid") qe.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
579
+ else if (r.kind === "nanoid") qe.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
580
580
  validation: "nanoid",
581
581
  code: x.invalid_string,
582
582
  message: r.message
583
583
  }), t.dirty());
584
- else if (r.kind === "cuid") Ue.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
584
+ else if (r.kind === "cuid") Ue.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
585
585
  validation: "cuid",
586
586
  code: x.invalid_string,
587
587
  message: r.message
588
588
  }), t.dirty());
589
- else if (r.kind === "cuid2") We.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
589
+ else if (r.kind === "cuid2") We.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
590
590
  validation: "cuid2",
591
591
  code: x.invalid_string,
592
592
  message: r.message
593
593
  }), t.dirty());
594
- else if (r.kind === "ulid") Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
594
+ else if (r.kind === "ulid") Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
595
595
  validation: "ulid",
596
596
  code: x.invalid_string,
597
597
  message: r.message
@@ -599,64 +599,64 @@ var pt = class e extends B {
599
599
  else if (r.kind === "url") try {
600
600
  new URL(e.data);
601
601
  } catch {
602
- n = this._getOrReturnCtx(e, n), N(n, {
602
+ n = this._getOrReturnCtx(e, n), M(n, {
603
603
  validation: "url",
604
604
  code: x.invalid_string,
605
605
  message: r.message
606
606
  }), t.dirty();
607
607
  }
608
- else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
608
+ else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
609
609
  validation: "regex",
610
610
  code: x.invalid_string,
611
611
  message: r.message
612
- }), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), N(n, {
612
+ }), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), M(n, {
613
613
  code: x.invalid_string,
614
614
  validation: {
615
615
  includes: r.value,
616
616
  position: r.position
617
617
  },
618
618
  message: r.message
619
- }), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), N(n, {
619
+ }), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), M(n, {
620
620
  code: x.invalid_string,
621
621
  validation: { startsWith: r.value },
622
622
  message: r.message
623
- }), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), N(n, {
623
+ }), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), M(n, {
624
624
  code: x.invalid_string,
625
625
  validation: { endsWith: r.value },
626
626
  message: r.message
627
- }), t.dirty()) : r.kind === "datetime" ? lt(r).test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
627
+ }), t.dirty()) : r.kind === "datetime" ? lt(r).test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
628
628
  code: x.invalid_string,
629
629
  validation: "datetime",
630
630
  message: r.message
631
- }), t.dirty()) : r.kind === "date" ? ot.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
631
+ }), t.dirty()) : r.kind === "date" ? ot.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
632
632
  code: x.invalid_string,
633
633
  validation: "date",
634
634
  message: r.message
635
- }), t.dirty()) : r.kind === "time" ? ct(r).test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
635
+ }), t.dirty()) : r.kind === "time" ? ct(r).test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
636
636
  code: x.invalid_string,
637
637
  validation: "time",
638
638
  message: r.message
639
- }), t.dirty()) : r.kind === "duration" ? Ye.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
639
+ }), t.dirty()) : r.kind === "duration" ? Ye.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
640
640
  validation: "duration",
641
641
  code: x.invalid_string,
642
642
  message: r.message
643
- }), t.dirty()) : r.kind === "ip" ? ut(e.data, r.version) || (n = this._getOrReturnCtx(e, n), N(n, {
643
+ }), t.dirty()) : r.kind === "ip" ? ut(e.data, r.version) || (n = this._getOrReturnCtx(e, n), M(n, {
644
644
  validation: "ip",
645
645
  code: x.invalid_string,
646
646
  message: r.message
647
- }), t.dirty()) : r.kind === "jwt" ? dt(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), N(n, {
647
+ }), t.dirty()) : r.kind === "jwt" ? dt(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), M(n, {
648
648
  validation: "jwt",
649
649
  code: x.invalid_string,
650
650
  message: r.message
651
- }), t.dirty()) : r.kind === "cidr" ? ft(e.data, r.version) || (n = this._getOrReturnCtx(e, n), N(n, {
651
+ }), t.dirty()) : r.kind === "cidr" ? ft(e.data, r.version) || (n = this._getOrReturnCtx(e, n), M(n, {
652
652
  validation: "cidr",
653
653
  code: x.invalid_string,
654
654
  message: r.message
655
- }), t.dirty()) : r.kind === "base64" ? rt.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
655
+ }), t.dirty()) : r.kind === "base64" ? rt.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
656
656
  validation: "base64",
657
657
  code: x.invalid_string,
658
658
  message: r.message
659
- }), t.dirty()) : r.kind === "base64url" ? it.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
659
+ }), t.dirty()) : r.kind === "base64url" ? it.test(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
660
660
  validation: "base64url",
661
661
  code: x.invalid_string,
662
662
  message: r.message
@@ -942,37 +942,37 @@ var ht = class e extends B {
942
942
  _parse(e) {
943
943
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== S.number) {
944
944
  let t = this._getOrReturnCtx(e);
945
- return N(t, {
945
+ return M(t, {
946
946
  code: x.invalid_type,
947
947
  expected: S.number,
948
948
  received: t.parsedType
949
- }), F;
949
+ }), P;
950
950
  }
951
- let t, n = new P();
952
- for (let r of this._def.checks) r.kind === "int" ? y.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), N(t, {
951
+ let t, n = new N();
952
+ for (let r of this._def.checks) r.kind === "int" ? y.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), M(t, {
953
953
  code: x.invalid_type,
954
954
  expected: "integer",
955
955
  received: "float",
956
956
  message: r.message
957
- }), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
957
+ }), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), M(t, {
958
958
  code: x.too_small,
959
959
  minimum: r.value,
960
960
  type: "number",
961
961
  inclusive: r.inclusive,
962
962
  exact: !1,
963
963
  message: r.message
964
- }), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
964
+ }), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), M(t, {
965
965
  code: x.too_big,
966
966
  maximum: r.value,
967
967
  type: "number",
968
968
  inclusive: r.inclusive,
969
969
  exact: !1,
970
970
  message: r.message
971
- }), n.dirty()) : r.kind === "multipleOf" ? mt(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), N(t, {
971
+ }), n.dirty()) : r.kind === "multipleOf" ? mt(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), M(t, {
972
972
  code: x.not_multiple_of,
973
973
  multipleOf: r.value,
974
974
  message: r.message
975
- }), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), N(t, {
975
+ }), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), M(t, {
976
976
  code: x.not_finite,
977
977
  message: r.message
978
978
  }), n.dirty()) : y.assertNever(r);
@@ -1111,20 +1111,20 @@ var gt = class e extends B {
1111
1111
  return this._getInvalidInput(e);
1112
1112
  }
1113
1113
  if (this._getType(e) !== S.bigint) return this._getInvalidInput(e);
1114
- let t, n = new P();
1115
- for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
1114
+ let t, n = new N();
1115
+ for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), M(t, {
1116
1116
  code: x.too_small,
1117
1117
  type: "bigint",
1118
1118
  minimum: r.value,
1119
1119
  inclusive: r.inclusive,
1120
1120
  message: r.message
1121
- }), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
1121
+ }), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), M(t, {
1122
1122
  code: x.too_big,
1123
1123
  type: "bigint",
1124
1124
  maximum: r.value,
1125
1125
  inclusive: r.inclusive,
1126
1126
  message: r.message
1127
- }), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), N(t, {
1127
+ }), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), M(t, {
1128
1128
  code: x.not_multiple_of,
1129
1129
  multipleOf: r.value,
1130
1130
  message: r.message
@@ -1136,11 +1136,11 @@ var gt = class e extends B {
1136
1136
  }
1137
1137
  _getInvalidInput(e) {
1138
1138
  let t = this._getOrReturnCtx(e);
1139
- return N(t, {
1139
+ return M(t, {
1140
1140
  code: x.invalid_type,
1141
1141
  expected: S.bigint,
1142
1142
  received: t.parsedType
1143
- }), F;
1143
+ }), P;
1144
1144
  }
1145
1145
  gte(e, t) {
1146
1146
  return this.setLimit("min", e, !0, L.toString(t));
@@ -1231,13 +1231,13 @@ var _t = class extends B {
1231
1231
  _parse(e) {
1232
1232
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== S.boolean) {
1233
1233
  let t = this._getOrReturnCtx(e);
1234
- return N(t, {
1234
+ return M(t, {
1235
1235
  code: x.invalid_type,
1236
1236
  expected: S.boolean,
1237
1237
  received: t.parsedType
1238
- }), F;
1238
+ }), P;
1239
1239
  }
1240
- return I(e.data);
1240
+ return F(e.data);
1241
1241
  }
1242
1242
  };
1243
1243
  _t.create = (e) => new _t({
@@ -1249,22 +1249,22 @@ var vt = class e extends B {
1249
1249
  _parse(e) {
1250
1250
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== S.date) {
1251
1251
  let t = this._getOrReturnCtx(e);
1252
- return N(t, {
1252
+ return M(t, {
1253
1253
  code: x.invalid_type,
1254
1254
  expected: S.date,
1255
1255
  received: t.parsedType
1256
- }), F;
1256
+ }), P;
1257
1257
  }
1258
- if (Number.isNaN(e.data.getTime())) return N(this._getOrReturnCtx(e), { code: x.invalid_date }), F;
1259
- let t = new P(), n;
1260
- for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), N(n, {
1258
+ if (Number.isNaN(e.data.getTime())) return M(this._getOrReturnCtx(e), { code: x.invalid_date }), P;
1259
+ let t = new N(), n;
1260
+ for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), M(n, {
1261
1261
  code: x.too_small,
1262
1262
  message: r.message,
1263
1263
  inclusive: !0,
1264
1264
  exact: !1,
1265
1265
  minimum: r.value,
1266
1266
  type: "date"
1267
- }), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), N(n, {
1267
+ }), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), M(n, {
1268
1268
  code: x.too_big,
1269
1269
  message: r.message,
1270
1270
  inclusive: !0,
@@ -1318,13 +1318,13 @@ var yt = class extends B {
1318
1318
  _parse(e) {
1319
1319
  if (this._getType(e) !== S.symbol) {
1320
1320
  let t = this._getOrReturnCtx(e);
1321
- return N(t, {
1321
+ return M(t, {
1322
1322
  code: x.invalid_type,
1323
1323
  expected: S.symbol,
1324
1324
  received: t.parsedType
1325
- }), F;
1325
+ }), P;
1326
1326
  }
1327
- return I(e.data);
1327
+ return F(e.data);
1328
1328
  }
1329
1329
  };
1330
1330
  yt.create = (e) => new yt({
@@ -1335,13 +1335,13 @@ var bt = class extends B {
1335
1335
  _parse(e) {
1336
1336
  if (this._getType(e) !== S.undefined) {
1337
1337
  let t = this._getOrReturnCtx(e);
1338
- return N(t, {
1338
+ return M(t, {
1339
1339
  code: x.invalid_type,
1340
1340
  expected: S.undefined,
1341
1341
  received: t.parsedType
1342
- }), F;
1342
+ }), P;
1343
1343
  }
1344
- return I(e.data);
1344
+ return F(e.data);
1345
1345
  }
1346
1346
  };
1347
1347
  bt.create = (e) => new bt({
@@ -1352,13 +1352,13 @@ var xt = class extends B {
1352
1352
  _parse(e) {
1353
1353
  if (this._getType(e) !== S.null) {
1354
1354
  let t = this._getOrReturnCtx(e);
1355
- return N(t, {
1355
+ return M(t, {
1356
1356
  code: x.invalid_type,
1357
1357
  expected: S.null,
1358
1358
  received: t.parsedType
1359
- }), F;
1359
+ }), P;
1360
1360
  }
1361
- return I(e.data);
1361
+ return F(e.data);
1362
1362
  }
1363
1363
  };
1364
1364
  xt.create = (e) => new xt({
@@ -1370,7 +1370,7 @@ var St = class extends B {
1370
1370
  super(...arguments), this._any = !0;
1371
1371
  }
1372
1372
  _parse(e) {
1373
- return I(e.data);
1373
+ return F(e.data);
1374
1374
  }
1375
1375
  };
1376
1376
  St.create = (e) => new St({
@@ -1382,7 +1382,7 @@ var Ct = class extends B {
1382
1382
  super(...arguments), this._unknown = !0;
1383
1383
  }
1384
1384
  _parse(e) {
1385
- return I(e.data);
1385
+ return F(e.data);
1386
1386
  }
1387
1387
  };
1388
1388
  Ct.create = (e) => new Ct({
@@ -1392,11 +1392,11 @@ Ct.create = (e) => new Ct({
1392
1392
  var V = class extends B {
1393
1393
  _parse(e) {
1394
1394
  let t = this._getOrReturnCtx(e);
1395
- return N(t, {
1395
+ return M(t, {
1396
1396
  code: x.invalid_type,
1397
1397
  expected: S.never,
1398
1398
  received: t.parsedType
1399
- }), F;
1399
+ }), P;
1400
1400
  }
1401
1401
  };
1402
1402
  V.create = (e) => new V({
@@ -1407,13 +1407,13 @@ var wt = class extends B {
1407
1407
  _parse(e) {
1408
1408
  if (this._getType(e) !== S.undefined) {
1409
1409
  let t = this._getOrReturnCtx(e);
1410
- return N(t, {
1410
+ return M(t, {
1411
1411
  code: x.invalid_type,
1412
1412
  expected: S.void,
1413
1413
  received: t.parsedType
1414
- }), F;
1414
+ }), P;
1415
1415
  }
1416
- return I(e.data);
1416
+ return F(e.data);
1417
1417
  }
1418
1418
  };
1419
1419
  wt.create = (e) => new wt({
@@ -1423,14 +1423,14 @@ wt.create = (e) => new wt({
1423
1423
  var Tt = class e extends B {
1424
1424
  _parse(e) {
1425
1425
  let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
1426
- if (t.parsedType !== S.array) return N(t, {
1426
+ if (t.parsedType !== S.array) return M(t, {
1427
1427
  code: x.invalid_type,
1428
1428
  expected: S.array,
1429
1429
  received: t.parsedType
1430
- }), F;
1430
+ }), P;
1431
1431
  if (r.exactLength !== null) {
1432
1432
  let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
1433
- (e || i) && (N(t, {
1433
+ (e || i) && (M(t, {
1434
1434
  code: e ? x.too_big : x.too_small,
1435
1435
  minimum: i ? r.exactLength.value : void 0,
1436
1436
  maximum: e ? r.exactLength.value : void 0,
@@ -1440,23 +1440,23 @@ var Tt = class e extends B {
1440
1440
  message: r.exactLength.message
1441
1441
  }), n.dirty());
1442
1442
  }
1443
- if (r.minLength !== null && t.data.length < r.minLength.value && (N(t, {
1443
+ if (r.minLength !== null && t.data.length < r.minLength.value && (M(t, {
1444
1444
  code: x.too_small,
1445
1445
  minimum: r.minLength.value,
1446
1446
  type: "array",
1447
1447
  inclusive: !0,
1448
1448
  exact: !1,
1449
1449
  message: r.minLength.message
1450
- }), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (N(t, {
1450
+ }), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (M(t, {
1451
1451
  code: x.too_big,
1452
1452
  maximum: r.maxLength.value,
1453
1453
  type: "array",
1454
1454
  inclusive: !0,
1455
1455
  exact: !1,
1456
1456
  message: r.maxLength.message
1457
- }), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new R(t, e, t.path, n)))).then((e) => P.mergeArray(n, e));
1457
+ }), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new R(t, e, t.path, n)))).then((e) => N.mergeArray(n, e));
1458
1458
  let i = [...t.data].map((e, n) => r.type._parseSync(new R(t, e, t.path, n)));
1459
- return P.mergeArray(n, i);
1459
+ return N.mergeArray(n, i);
1460
1460
  }
1461
1461
  get element() {
1462
1462
  return this._def.type;
@@ -1535,11 +1535,11 @@ var H = class e extends B {
1535
1535
  _parse(e) {
1536
1536
  if (this._getType(e) !== S.object) {
1537
1537
  let t = this._getOrReturnCtx(e);
1538
- return N(t, {
1538
+ return M(t, {
1539
1539
  code: x.invalid_type,
1540
1540
  expected: S.object,
1541
1541
  received: t.parsedType
1542
- }), F;
1542
+ }), P;
1543
1543
  }
1544
1544
  let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
1545
1545
  if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
@@ -1567,7 +1567,7 @@ var H = class e extends B {
1567
1567
  value: n.data[e]
1568
1568
  }
1569
1569
  });
1570
- else if (e === "strict") a.length > 0 && (N(n, {
1570
+ else if (e === "strict") a.length > 0 && (M(n, {
1571
1571
  code: x.unrecognized_keys,
1572
1572
  keys: a
1573
1573
  }), t.dirty());
@@ -1597,7 +1597,7 @@ var H = class e extends B {
1597
1597
  });
1598
1598
  }
1599
1599
  return e;
1600
- }).then((e) => P.mergeObjectSync(t, e)) : P.mergeObjectSync(t, o);
1600
+ }).then((e) => N.mergeObjectSync(t, e)) : N.mergeObjectSync(t, o);
1601
1601
  }
1602
1602
  get shape() {
1603
1603
  return this._def.shape();
@@ -1726,10 +1726,10 @@ var Dt = class extends B {
1726
1726
  for (let t of e) if (t.result.status === "valid") return t.result;
1727
1727
  for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
1728
1728
  let n = e.map((e) => new C(e.ctx.common.issues));
1729
- return N(t, {
1729
+ return M(t, {
1730
1730
  code: x.invalid_union,
1731
1731
  unionErrors: n
1732
- }), F;
1732
+ }), P;
1733
1733
  }
1734
1734
  if (t.common.async) return Promise.all(n.map(async (e) => {
1735
1735
  let n = {
@@ -1772,10 +1772,10 @@ var Dt = class extends B {
1772
1772
  }
1773
1773
  if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
1774
1774
  let i = r.map((e) => new C(e));
1775
- return N(t, {
1775
+ return M(t, {
1776
1776
  code: x.invalid_union,
1777
1777
  unionErrors: i
1778
- }), F;
1778
+ }), P;
1779
1779
  }
1780
1780
  }
1781
1781
  get options() {
@@ -1790,11 +1790,11 @@ Dt.create = (e, t) => new Dt({
1790
1790
  var U = (e) => e instanceof It ? U(e.schema) : e instanceof W ? U(e.innerType()) : e instanceof Lt ? [e.value] : e instanceof zt ? e.options : e instanceof Bt ? y.objectValues(e.enum) : e instanceof Ut ? U(e._def.innerType) : e instanceof bt ? [void 0] : e instanceof xt ? [null] : e instanceof G ? [void 0, ...U(e.unwrap())] : e instanceof Ht ? [null, ...U(e.unwrap())] : e instanceof Kt || e instanceof Jt ? U(e.unwrap()) : e instanceof Wt ? U(e._def.innerType) : [], Ot = class e extends B {
1791
1791
  _parse(e) {
1792
1792
  let { ctx: t } = this._processInputParams(e);
1793
- if (t.parsedType !== S.object) return N(t, {
1793
+ if (t.parsedType !== S.object) return M(t, {
1794
1794
  code: x.invalid_type,
1795
1795
  expected: S.object,
1796
1796
  received: t.parsedType
1797
- }), F;
1797
+ }), P;
1798
1798
  let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
1799
1799
  return i ? t.common.async ? i._parseAsync({
1800
1800
  data: t.data,
@@ -1804,11 +1804,11 @@ var U = (e) => e instanceof It ? U(e.schema) : e instanceof W ? U(e.innerType())
1804
1804
  data: t.data,
1805
1805
  path: t.path,
1806
1806
  parent: t
1807
- }) : (N(t, {
1807
+ }) : (M(t, {
1808
1808
  code: x.invalid_union_discriminator,
1809
1809
  options: Array.from(this.optionsMap.keys()),
1810
1810
  path: [n]
1811
- }), F);
1811
+ }), P);
1812
1812
  }
1813
1813
  get discriminator() {
1814
1814
  return this._def.discriminator;
@@ -1879,12 +1879,12 @@ function kt(e, t) {
1879
1879
  var At = class extends B {
1880
1880
  _parse(e) {
1881
1881
  let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
1882
- if (Re(e) || Re(r)) return F;
1882
+ if (ze(e) || ze(r)) return P;
1883
1883
  let i = kt(e.value, r.value);
1884
- return i.valid ? ((ze(e) || ze(r)) && t.dirty(), {
1884
+ return i.valid ? ((Be(e) || Be(r)) && t.dirty(), {
1885
1885
  status: t.value,
1886
1886
  value: i.data
1887
- }) : (N(n, { code: x.invalid_intersection_types }), F);
1887
+ }) : (M(n, { code: x.invalid_intersection_types }), P);
1888
1888
  };
1889
1889
  return n.common.async ? Promise.all([this._def.left._parseAsync({
1890
1890
  data: n.data,
@@ -1914,19 +1914,19 @@ At.create = (e, t, n) => new At({
1914
1914
  var jt = class e extends B {
1915
1915
  _parse(e) {
1916
1916
  let { status: t, ctx: n } = this._processInputParams(e);
1917
- if (n.parsedType !== S.array) return N(n, {
1917
+ if (n.parsedType !== S.array) return M(n, {
1918
1918
  code: x.invalid_type,
1919
1919
  expected: S.array,
1920
1920
  received: n.parsedType
1921
- }), F;
1922
- if (n.data.length < this._def.items.length) return N(n, {
1921
+ }), P;
1922
+ if (n.data.length < this._def.items.length) return M(n, {
1923
1923
  code: x.too_small,
1924
1924
  minimum: this._def.items.length,
1925
1925
  inclusive: !0,
1926
1926
  exact: !1,
1927
1927
  type: "array"
1928
- }), F;
1929
- !this._def.rest && n.data.length > this._def.items.length && (N(n, {
1928
+ }), P;
1929
+ !this._def.rest && n.data.length > this._def.items.length && (M(n, {
1930
1930
  code: x.too_big,
1931
1931
  maximum: this._def.items.length,
1932
1932
  inclusive: !0,
@@ -1937,7 +1937,7 @@ var jt = class e extends B {
1937
1937
  let r = this._def.items[t] || this._def.rest;
1938
1938
  return r ? r._parse(new R(n, e, n.path, t)) : null;
1939
1939
  }).filter((e) => !!e);
1940
- return n.common.async ? Promise.all(r).then((e) => P.mergeArray(t, e)) : P.mergeArray(t, r);
1940
+ return n.common.async ? Promise.all(r).then((e) => N.mergeArray(t, e)) : N.mergeArray(t, r);
1941
1941
  }
1942
1942
  get items() {
1943
1943
  return this._def.items;
@@ -1967,18 +1967,18 @@ var Mt = class e extends B {
1967
1967
  }
1968
1968
  _parse(e) {
1969
1969
  let { status: t, ctx: n } = this._processInputParams(e);
1970
- if (n.parsedType !== S.object) return N(n, {
1970
+ if (n.parsedType !== S.object) return M(n, {
1971
1971
  code: x.invalid_type,
1972
1972
  expected: S.object,
1973
1973
  received: n.parsedType
1974
- }), F;
1974
+ }), P;
1975
1975
  let r = [], i = this._def.keyType, a = this._def.valueType;
1976
1976
  for (let e in n.data) r.push({
1977
1977
  key: i._parse(new R(n, e, n.path, e)),
1978
1978
  value: a._parse(new R(n, n.data[e], n.path, e)),
1979
1979
  alwaysSet: e in n.data
1980
1980
  });
1981
- return n.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
1981
+ return n.common.async ? N.mergeObjectAsync(t, r) : N.mergeObjectSync(t, r);
1982
1982
  }
1983
1983
  get element() {
1984
1984
  return this._def.valueType;
@@ -2005,11 +2005,11 @@ var Mt = class e extends B {
2005
2005
  }
2006
2006
  _parse(e) {
2007
2007
  let { status: t, ctx: n } = this._processInputParams(e);
2008
- if (n.parsedType !== S.map) return N(n, {
2008
+ if (n.parsedType !== S.map) return M(n, {
2009
2009
  code: x.invalid_type,
2010
2010
  expected: S.map,
2011
2011
  received: n.parsedType
2012
- }), F;
2012
+ }), P;
2013
2013
  let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
2014
2014
  key: r._parse(new R(n, e, n.path, [a, "key"])),
2015
2015
  value: i._parse(new R(n, t, n.path, [a, "value"]))
@@ -2019,7 +2019,7 @@ var Mt = class e extends B {
2019
2019
  return Promise.resolve().then(async () => {
2020
2020
  for (let n of a) {
2021
2021
  let r = await n.key, i = await n.value;
2022
- if (r.status === "aborted" || i.status === "aborted") return F;
2022
+ if (r.status === "aborted" || i.status === "aborted") return P;
2023
2023
  (r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
2024
2024
  }
2025
2025
  return {
@@ -2031,7 +2031,7 @@ var Mt = class e extends B {
2031
2031
  let e = /* @__PURE__ */ new Map();
2032
2032
  for (let n of a) {
2033
2033
  let r = n.key, i = n.value;
2034
- if (r.status === "aborted" || i.status === "aborted") return F;
2034
+ if (r.status === "aborted" || i.status === "aborted") return P;
2035
2035
  (r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
2036
2036
  }
2037
2037
  return {
@@ -2050,20 +2050,20 @@ Nt.create = (e, t, n) => new Nt({
2050
2050
  var Pt = class e extends B {
2051
2051
  _parse(e) {
2052
2052
  let { status: t, ctx: n } = this._processInputParams(e);
2053
- if (n.parsedType !== S.set) return N(n, {
2053
+ if (n.parsedType !== S.set) return M(n, {
2054
2054
  code: x.invalid_type,
2055
2055
  expected: S.set,
2056
2056
  received: n.parsedType
2057
- }), F;
2057
+ }), P;
2058
2058
  let r = this._def;
2059
- r.minSize !== null && n.data.size < r.minSize.value && (N(n, {
2059
+ r.minSize !== null && n.data.size < r.minSize.value && (M(n, {
2060
2060
  code: x.too_small,
2061
2061
  minimum: r.minSize.value,
2062
2062
  type: "set",
2063
2063
  inclusive: !0,
2064
2064
  exact: !1,
2065
2065
  message: r.minSize.message
2066
- }), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (N(n, {
2066
+ }), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (M(n, {
2067
2067
  code: x.too_big,
2068
2068
  maximum: r.maxSize.value,
2069
2069
  type: "set",
@@ -2075,7 +2075,7 @@ var Pt = class e extends B {
2075
2075
  function a(e) {
2076
2076
  let n = /* @__PURE__ */ new Set();
2077
2077
  for (let r of e) {
2078
- if (r.status === "aborted") return F;
2078
+ if (r.status === "aborted") return P;
2079
2079
  r.status === "dirty" && t.dirty(), n.add(r.value);
2080
2080
  }
2081
2081
  return {
@@ -2124,20 +2124,20 @@ var Ft = class e extends B {
2124
2124
  }
2125
2125
  _parse(e) {
2126
2126
  let { ctx: t } = this._processInputParams(e);
2127
- if (t.parsedType !== S.function) return N(t, {
2127
+ if (t.parsedType !== S.function) return M(t, {
2128
2128
  code: x.invalid_type,
2129
2129
  expected: S.function,
2130
2130
  received: t.parsedType
2131
- }), F;
2131
+ }), P;
2132
2132
  function n(e, n) {
2133
- return Ie({
2133
+ return Le({
2134
2134
  data: e,
2135
2135
  path: t.path,
2136
2136
  errorMaps: [
2137
2137
  t.common.contextualErrorMap,
2138
2138
  t.schemaErrorMap,
2139
- Fe(),
2140
- M
2139
+ Ie(),
2140
+ j
2141
2141
  ].filter((e) => !!e),
2142
2142
  issueData: {
2143
2143
  code: x.invalid_arguments,
@@ -2146,14 +2146,14 @@ var Ft = class e extends B {
2146
2146
  });
2147
2147
  }
2148
2148
  function r(e, n) {
2149
- return Ie({
2149
+ return Le({
2150
2150
  data: e,
2151
2151
  path: t.path,
2152
2152
  errorMaps: [
2153
2153
  t.common.contextualErrorMap,
2154
2154
  t.schemaErrorMap,
2155
- Fe(),
2156
- M
2155
+ Ie(),
2156
+ j
2157
2157
  ].filter((e) => !!e),
2158
2158
  issueData: {
2159
2159
  code: x.invalid_return_type,
@@ -2164,7 +2164,7 @@ var Ft = class e extends B {
2164
2164
  let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
2165
2165
  if (this._def.returns instanceof Vt) {
2166
2166
  let e = this;
2167
- return I(async function(...t) {
2167
+ return F(async function(...t) {
2168
2168
  let o = new C([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
2169
2169
  throw o.addIssue(n(t, e)), o;
2170
2170
  }), c = await Reflect.apply(a, this, s);
@@ -2174,7 +2174,7 @@ var Ft = class e extends B {
2174
2174
  });
2175
2175
  } else {
2176
2176
  let e = this;
2177
- return I(function(...t) {
2177
+ return F(function(...t) {
2178
2178
  let o = e._def.args.safeParse(t, i);
2179
2179
  if (!o.success) throw new C([n(t, o.error)]);
2180
2180
  let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
@@ -2237,11 +2237,11 @@ var Lt = class extends B {
2237
2237
  _parse(e) {
2238
2238
  if (e.data !== this._def.value) {
2239
2239
  let t = this._getOrReturnCtx(e);
2240
- return N(t, {
2240
+ return M(t, {
2241
2241
  received: t.data,
2242
2242
  code: x.invalid_literal,
2243
2243
  expected: this._def.value
2244
- }), F;
2244
+ }), P;
2245
2245
  }
2246
2246
  return {
2247
2247
  status: "valid",
@@ -2268,21 +2268,21 @@ var zt = class e extends B {
2268
2268
  _parse(e) {
2269
2269
  if (typeof e.data != "string") {
2270
2270
  let t = this._getOrReturnCtx(e), n = this._def.values;
2271
- return N(t, {
2271
+ return M(t, {
2272
2272
  expected: y.joinValues(n),
2273
2273
  received: t.parsedType,
2274
2274
  code: x.invalid_type
2275
- }), F;
2275
+ }), P;
2276
2276
  }
2277
2277
  if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
2278
2278
  let t = this._getOrReturnCtx(e), n = this._def.values;
2279
- return N(t, {
2279
+ return M(t, {
2280
2280
  received: t.data,
2281
2281
  code: x.invalid_enum_value,
2282
2282
  options: n
2283
- }), F;
2283
+ }), P;
2284
2284
  }
2285
- return I(e.data);
2285
+ return F(e.data);
2286
2286
  }
2287
2287
  get options() {
2288
2288
  return this._def.values;
@@ -2321,21 +2321,21 @@ var Bt = class extends B {
2321
2321
  let t = y.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2322
2322
  if (n.parsedType !== S.string && n.parsedType !== S.number) {
2323
2323
  let e = y.objectValues(t);
2324
- return N(n, {
2324
+ return M(n, {
2325
2325
  expected: y.joinValues(e),
2326
2326
  received: n.parsedType,
2327
2327
  code: x.invalid_type
2328
- }), F;
2328
+ }), P;
2329
2329
  }
2330
2330
  if (this._cache ||= new Set(y.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
2331
2331
  let e = y.objectValues(t);
2332
- return N(n, {
2332
+ return M(n, {
2333
2333
  received: n.data,
2334
2334
  code: x.invalid_enum_value,
2335
2335
  options: e
2336
- }), F;
2336
+ }), P;
2337
2337
  }
2338
- return I(e.data);
2338
+ return F(e.data);
2339
2339
  }
2340
2340
  get enum() {
2341
2341
  return this._def.values;
@@ -2352,11 +2352,11 @@ var Vt = class extends B {
2352
2352
  }
2353
2353
  _parse(e) {
2354
2354
  let { ctx: t } = this._processInputParams(e);
2355
- return t.parsedType !== S.promise && t.common.async === !1 ? (N(t, {
2355
+ return t.parsedType !== S.promise && t.common.async === !1 ? (M(t, {
2356
2356
  code: x.invalid_type,
2357
2357
  expected: S.promise,
2358
2358
  received: t.parsedType
2359
- }), F) : I((t.parsedType === S.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
2359
+ }), P) : F((t.parsedType === S.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
2360
2360
  path: t.path,
2361
2361
  errorMap: t.common.contextualErrorMap
2362
2362
  })));
@@ -2377,7 +2377,7 @@ var W = class extends B {
2377
2377
  _parse(e) {
2378
2378
  let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
2379
2379
  addIssue: (e) => {
2380
- N(n, e), e.fatal ? t.abort() : t.dirty();
2380
+ M(n, e), e.fatal ? t.abort() : t.dirty();
2381
2381
  },
2382
2382
  get path() {
2383
2383
  return n.path;
@@ -2386,22 +2386,22 @@ var W = class extends B {
2386
2386
  if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
2387
2387
  let e = r.transform(n.data, i);
2388
2388
  if (n.common.async) return Promise.resolve(e).then(async (e) => {
2389
- if (t.value === "aborted") return F;
2389
+ if (t.value === "aborted") return P;
2390
2390
  let r = await this._def.schema._parseAsync({
2391
2391
  data: e,
2392
2392
  path: n.path,
2393
2393
  parent: n
2394
2394
  });
2395
- return r.status === "aborted" ? F : r.status === "dirty" || t.value === "dirty" ? Le(r.value) : r;
2395
+ return r.status === "aborted" ? P : r.status === "dirty" || t.value === "dirty" ? Re(r.value) : r;
2396
2396
  });
2397
2397
  {
2398
- if (t.value === "aborted") return F;
2398
+ if (t.value === "aborted") return P;
2399
2399
  let r = this._def.schema._parseSync({
2400
2400
  data: e,
2401
2401
  path: n.path,
2402
2402
  parent: n
2403
2403
  });
2404
- return r.status === "aborted" ? F : r.status === "dirty" || t.value === "dirty" ? Le(r.value) : r;
2404
+ return r.status === "aborted" ? P : r.status === "dirty" || t.value === "dirty" ? Re(r.value) : r;
2405
2405
  }
2406
2406
  }
2407
2407
  if (r.type === "refinement") {
@@ -2417,7 +2417,7 @@ var W = class extends B {
2417
2417
  path: n.path,
2418
2418
  parent: n
2419
2419
  });
2420
- return r.status === "aborted" ? F : (r.status === "dirty" && t.dirty(), e(r.value), {
2420
+ return r.status === "aborted" ? P : (r.status === "dirty" && t.dirty(), e(r.value), {
2421
2421
  status: t.value,
2422
2422
  value: r.value
2423
2423
  });
@@ -2425,7 +2425,7 @@ var W = class extends B {
2425
2425
  data: n.data,
2426
2426
  path: n.path,
2427
2427
  parent: n
2428
- }).then((n) => n.status === "aborted" ? F : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
2428
+ }).then((n) => n.status === "aborted" ? P : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
2429
2429
  status: t.value,
2430
2430
  value: n.value
2431
2431
  }))));
@@ -2436,7 +2436,7 @@ var W = class extends B {
2436
2436
  path: n.path,
2437
2437
  parent: n
2438
2438
  });
2439
- if (!Be(e)) return F;
2439
+ if (!I(e)) return P;
2440
2440
  let a = r.transform(e.value, i);
2441
2441
  if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2442
2442
  return {
@@ -2447,10 +2447,10 @@ var W = class extends B {
2447
2447
  data: n.data,
2448
2448
  path: n.path,
2449
2449
  parent: n
2450
- }).then((e) => Be(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
2450
+ }).then((e) => I(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
2451
2451
  status: t.value,
2452
2452
  value: e
2453
- })) : F);
2453
+ })) : P);
2454
2454
  y.assertNever(r);
2455
2455
  }
2456
2456
  };
@@ -2470,7 +2470,7 @@ W.create = (e, t, n) => new W({
2470
2470
  });
2471
2471
  var G = class extends B {
2472
2472
  _parse(e) {
2473
- return this._getType(e) === S.undefined ? I(void 0) : this._def.innerType._parse(e);
2473
+ return this._getType(e) === S.undefined ? F(void 0) : this._def.innerType._parse(e);
2474
2474
  }
2475
2475
  unwrap() {
2476
2476
  return this._def.innerType;
@@ -2483,7 +2483,7 @@ G.create = (e, t) => new G({
2483
2483
  });
2484
2484
  var Ht = class extends B {
2485
2485
  _parse(e) {
2486
- return this._getType(e) === S.null ? I(null) : this._def.innerType._parse(e);
2486
+ return this._getType(e) === S.null ? F(null) : this._def.innerType._parse(e);
2487
2487
  }
2488
2488
  unwrap() {
2489
2489
  return this._def.innerType;
@@ -2558,11 +2558,11 @@ var Gt = class extends B {
2558
2558
  _parse(e) {
2559
2559
  if (this._getType(e) !== S.nan) {
2560
2560
  let t = this._getOrReturnCtx(e);
2561
- return N(t, {
2561
+ return M(t, {
2562
2562
  code: x.invalid_type,
2563
2563
  expected: S.nan,
2564
2564
  received: t.parsedType
2565
- }), F;
2565
+ }), P;
2566
2566
  }
2567
2567
  return {
2568
2568
  status: "valid",
@@ -2595,7 +2595,7 @@ var Kt = class extends B {
2595
2595
  path: n.path,
2596
2596
  parent: n
2597
2597
  });
2598
- return e.status === "aborted" ? F : e.status === "dirty" ? (t.dirty(), Le(e.value)) : this._def.out._parseAsync({
2598
+ return e.status === "aborted" ? P : e.status === "dirty" ? (t.dirty(), Re(e.value)) : this._def.out._parseAsync({
2599
2599
  data: e.value,
2600
2600
  path: n.path,
2601
2601
  parent: n
@@ -2607,7 +2607,7 @@ var Kt = class extends B {
2607
2607
  path: n.path,
2608
2608
  parent: n
2609
2609
  });
2610
- return e.status === "aborted" ? F : e.status === "dirty" ? (t.dirty(), {
2610
+ return e.status === "aborted" ? P : e.status === "dirty" ? (t.dirty(), {
2611
2611
  status: "dirty",
2612
2612
  value: e.value
2613
2613
  }) : this._def.out._parseSync({
@@ -2626,7 +2626,7 @@ var Kt = class extends B {
2626
2626
  }
2627
2627
  }, Jt = class extends B {
2628
2628
  _parse(e) {
2629
- let t = this._def.innerType._parse(e), n = (e) => (Be(e) && (e.value = Object.freeze(e.value)), e);
2629
+ let t = this._def.innerType._parse(e), n = (e) => (I(e) && (e.value = Object.freeze(e.value)), e);
2630
2630
  return Ve(t) ? t.then((e) => n(e)) : n(t);
2631
2631
  }
2632
2632
  unwrap() {
@@ -2763,7 +2763,7 @@ var $t = class extends TransformStream {
2763
2763
  return r.join("");
2764
2764
  };
2765
2765
  if (e == null) return i;
2766
- if (n.includes(r)) throw new Ce({
2766
+ if (n.includes(r)) throw new we({
2767
2767
  argument: "separator",
2768
2768
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
2769
2769
  });
@@ -3601,7 +3601,7 @@ function pr(e) {
3601
3601
  value: n.value
3602
3602
  } : {
3603
3603
  success: !1,
3604
- error: new j({
3604
+ error: new A({
3605
3605
  value: t,
3606
3606
  cause: n.issues
3607
3607
  })
@@ -3650,7 +3650,7 @@ async function vr({ value: e, schema: t, context: n }) {
3650
3650
  schema: t,
3651
3651
  context: n
3652
3652
  });
3653
- if (!r.success) throw j.wrap({
3653
+ if (!r.success) throw A.wrap({
3654
3654
  value: e,
3655
3655
  cause: r.error,
3656
3656
  context: n
@@ -3672,7 +3672,7 @@ async function yr({ value: e, schema: t, context: n }) {
3672
3672
  rawValue: e
3673
3673
  } : {
3674
3674
  success: !1,
3675
- error: j.wrap({
3675
+ error: A.wrap({
3676
3676
  value: e,
3677
3677
  cause: t.error,
3678
3678
  context: n
@@ -3682,7 +3682,7 @@ async function yr({ value: e, schema: t, context: n }) {
3682
3682
  } catch (t) {
3683
3683
  return {
3684
3684
  success: !1,
3685
- error: j.wrap({
3685
+ error: A.wrap({
3686
3686
  value: e,
3687
3687
  cause: t,
3688
3688
  context: n
@@ -3705,7 +3705,7 @@ async function br({ text: e, schema: t }) {
3705
3705
  } catch (t) {
3706
3706
  return {
3707
3707
  success: !1,
3708
- error: Oe.isInstance(t) ? t : new Oe({
3708
+ error: ke.isInstance(t) ? t : new ke({
3709
3709
  text: e,
3710
3710
  cause: t
3711
3711
  }),
@@ -4250,7 +4250,7 @@ var Yr = () => ({
4250
4250
  let i = n.value;
4251
4251
  if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new kr({
4252
4252
  message: "No object generated: response did not match schema.",
4253
- cause: new j({
4253
+ cause: new A({
4254
4254
  value: i,
4255
4255
  cause: "response must be an object with an elements array"
4256
4256
  }),
@@ -4333,7 +4333,7 @@ var Yr = () => ({
4333
4333
  let i = r.value;
4334
4334
  if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new kr({
4335
4335
  message: "No object generated: response did not match schema.",
4336
- cause: new j({
4336
+ cause: new A({
4337
4337
  value: i,
4338
4338
  cause: "response must be an object that contains a choice value."
4339
4339
  }),
@@ -5881,8 +5881,8 @@ function $i(e) {
5881
5881
  }), _e = w(() => {
5882
5882
  let e = d.value?.messagePlaceholder;
5883
5883
  return e?.[i.value] ? e[i.value] : r("placeholder.askAnything") ? n("placeholder.askAnything") : "";
5884
- }), O = T([]), ve = T("chat"), k = T([]), ye = T(), be = T(!1), xe = T(!1), Se = T(), Ce = T(!1), we = T(!1), Te = T(), Ee = T(""), A = T([]);
5885
- async function De(e) {
5884
+ }), O = T([]), ve = T("chat"), ye = T([]), be = T(), xe = T(!1), Se = T(!1), Ce = T(), we = T(!1), Te = T(!1), Ee = T(), De = T(""), k = T([]);
5885
+ async function Oe(e) {
5886
5886
  if (b.value) {
5887
5887
  O.value = [];
5888
5888
  return;
@@ -5893,7 +5893,7 @@ function $i(e) {
5893
5893
  O.value = [];
5894
5894
  }
5895
5895
  }
5896
- async function Oe(e, t) {
5896
+ async function ke(e, t) {
5897
5897
  if (b.value) {
5898
5898
  D.value.messages = [];
5899
5899
  return;
@@ -5905,62 +5905,62 @@ function $i(e) {
5905
5905
  D.value.messages = [];
5906
5906
  }
5907
5907
  }
5908
- async function ke(e) {
5908
+ async function Ae(e) {
5909
5909
  try {
5910
- k.value = await E.value.getMessageFeedbacks(e);
5910
+ ye.value = await E.value.getMessageFeedbacks(e);
5911
5911
  } catch {
5912
- k.value = [];
5912
+ ye.value = [];
5913
5913
  }
5914
5914
  }
5915
- function Ae(e) {
5916
- let t = k.value.findIndex((t) => t.messageId === e.messageId);
5917
- t >= 0 ? k.value[t] = e : k.value.push(e);
5918
- }
5919
5915
  function je(e) {
5916
+ let t = ye.value.findIndex((t) => t.messageId === e.messageId);
5917
+ t >= 0 ? ye.value[t] = e : ye.value.push(e);
5918
+ }
5919
+ function Me(e) {
5920
5920
  let t = ge.value, n = t.findIndex((t) => t.id === e.id), r = ie(e) ?? "";
5921
5921
  return {
5922
5922
  userQuestion: ie(t.slice(0, n).reverse().find((e) => e.role === "user") ?? e) ?? "",
5923
5923
  assistantMessage: r
5924
5924
  };
5925
5925
  }
5926
- async function Me(e, t) {
5926
+ async function Ne(e, t) {
5927
5927
  await Promise.all([
5928
- Oe(e, t),
5929
- De(e),
5930
- ke(t)
5928
+ ke(e, t),
5929
+ Oe(e),
5930
+ Ae(t)
5931
5931
  ]), de.value || te((e, t) => E.value.reverseGeocode(e, t, i.value)).then((e) => {
5932
5932
  e && (de.value = e);
5933
5933
  });
5934
5934
  }
5935
- async function Ne() {
5936
- let e = Ee.value.trim(), t = A.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
5935
+ async function Pe() {
5936
+ let e = De.value.trim(), t = k.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
5937
5937
  type: "file",
5938
5938
  mediaType: e.mediaSource.mimeType,
5939
5939
  url: e.localUrl,
5940
5940
  filename: e.mediaSource.name,
5941
5941
  providerMetadata: { "8bot": { media: e.mediaSource } }
5942
5942
  }));
5943
- b.value && ge.value.length > 0 && await Pe();
5943
+ b.value && ge.value.length > 0 && await Fe();
5944
5944
  let n = D.value.sendMessage;
5945
5945
  n({
5946
5946
  text: e,
5947
5947
  files: t.length > 0 ? t : void 0
5948
- }), Ee.value = "", M();
5948
+ }), De.value = "", j();
5949
5949
  }
5950
- async function j() {
5950
+ async function A() {
5951
5951
  return D.value.stop();
5952
5952
  }
5953
- function M(e = !1) {
5954
- for (let t of A.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
5955
- A.value = [];
5953
+ function j(e = !1) {
5954
+ for (let t of k.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
5955
+ k.value = [];
5956
5956
  }
5957
- async function Pe() {
5958
- return await j(), C.value = Ei(), D.value.clearError(), oe.value = void 0, se.value = !1, M(!0), Be("chat"), C.value;
5957
+ async function Fe() {
5958
+ return await A(), C.value = Ei(), D.value.clearError(), oe.value = void 0, se.value = !1, j(!0), I("chat"), C.value;
5959
5959
  }
5960
- async function Fe(e) {
5961
- D.value.status !== "ready" && await j(), await D.value.regenerate(e);
5960
+ async function Ie(e) {
5961
+ D.value.status !== "ready" && await A(), await D.value.regenerate(e);
5962
5962
  }
5963
- function Ie(e) {
5963
+ function Le(e) {
5964
5964
  if (e.tool === "requestGeolocation") {
5965
5965
  let t = e.output;
5966
5966
  "latitude" in t && (de.value = {
@@ -5972,33 +5972,33 @@ function $i(e) {
5972
5972
  }
5973
5973
  D.value.addToolOutput(e);
5974
5974
  }
5975
- async function N(e) {
5975
+ async function M(e) {
5976
5976
  let t = Ei(), n = {
5977
5977
  id: t,
5978
5978
  file: e,
5979
5979
  localUrl: URL.createObjectURL(e),
5980
5980
  state: "uploading"
5981
5981
  };
5982
- A.value = [...A.value, n];
5982
+ k.value = [...k.value, n];
5983
5983
  try {
5984
5984
  let n = await E.value.uploadMedia(s.value, C.value, e);
5985
- A.value = A.value.map((e) => e.id === t ? {
5985
+ k.value = k.value.map((e) => e.id === t ? {
5986
5986
  ...e,
5987
5987
  state: "done",
5988
5988
  mediaSource: n
5989
5989
  } : e);
5990
5990
  } catch (e) {
5991
5991
  let n = e instanceof Error ? e.message : "Upload failed";
5992
- A.value = A.value.map((e) => e.id === t ? {
5992
+ k.value = k.value.map((e) => e.id === t ? {
5993
5993
  ...e,
5994
5994
  state: "error",
5995
5995
  error: n
5996
5996
  } : e);
5997
5997
  }
5998
5998
  }
5999
- async function P(e, t) {
6000
- let { userQuestion: n, assistantMessage: r } = je(e);
6001
- Ae(await E.value.submitMessageFeedback({
5999
+ async function N(e, t) {
6000
+ let { userQuestion: n, assistantMessage: r } = Me(e);
6001
+ je(await E.value.submitMessageFeedback({
6002
6002
  messageId: e.id,
6003
6003
  chatId: C.value,
6004
6004
  agentId: s.value,
@@ -6007,47 +6007,47 @@ function $i(e) {
6007
6007
  assistantMessage: r
6008
6008
  }));
6009
6009
  }
6010
- async function F(e) {
6011
- await P(e, "upvote");
6010
+ async function P(e) {
6011
+ await N(e, "upvote");
6012
6012
  }
6013
- async function Le(e) {
6014
- await P(e, "downvote");
6013
+ async function Re(e) {
6014
+ await N(e, "downvote");
6015
6015
  }
6016
- function I(e) {
6017
- xe.value = !1, Se.value = void 0, ye.value = e;
6016
+ function F(e) {
6017
+ Se.value = !1, Ce.value = void 0, be.value = e;
6018
6018
  }
6019
- async function Re(e) {
6020
- if (ye.value) try {
6021
- be.value = !0, xe.value = !1, Se.value = void 0;
6022
- let { userQuestion: t, assistantMessage: n } = je(ye.value);
6023
- Ae(await E.value.submitMessageFeedback({
6024
- messageId: ye.value.id,
6019
+ async function ze(e) {
6020
+ if (be.value) try {
6021
+ xe.value = !0, Se.value = !1, Ce.value = void 0;
6022
+ let { userQuestion: t, assistantMessage: n } = Me(be.value);
6023
+ je(await E.value.submitMessageFeedback({
6024
+ messageId: be.value.id,
6025
6025
  chatId: C.value,
6026
6026
  agentId: s.value,
6027
6027
  userQuestion: t,
6028
6028
  assistantMessage: n,
6029
6029
  comment: e
6030
- })), xe.value = !0, await ke(C.value);
6030
+ })), Se.value = !0, await Ae(C.value);
6031
6031
  } catch {
6032
- Se.value = r("message.feedbackSubmitError") ? n("message.feedbackSubmitError") : "Failed to submit feedback";
6032
+ Ce.value = r("message.feedbackSubmitError") ? n("message.feedbackSubmitError") : "Failed to submit feedback";
6033
6033
  } finally {
6034
- be.value = !1;
6034
+ xe.value = !1;
6035
6035
  }
6036
6036
  }
6037
- async function ze(e) {
6037
+ async function Be(e) {
6038
6038
  try {
6039
- we.value = !0, Ce.value = !1, Te.value = void 0, await E.value.submitLead({
6039
+ Te.value = !0, we.value = !1, Ee.value = void 0, await E.value.submitLead({
6040
6040
  agentId: s.value,
6041
6041
  chatId: C.value,
6042
6042
  ...e
6043
- }), Ce.value = !0;
6043
+ }), we.value = !0;
6044
6044
  } catch {
6045
- Te.value = r("message.leadSubmitError") ? n("message.leadSubmitError") : "Failed to submit lead";
6045
+ Ee.value = r("message.leadSubmitError") ? n("message.leadSubmitError") : "Failed to submit lead";
6046
6046
  } finally {
6047
- we.value = !1;
6047
+ Te.value = !1;
6048
6048
  }
6049
6049
  }
6050
- function Be(e) {
6050
+ function I(e) {
6051
6051
  ve.value = e;
6052
6052
  }
6053
6053
  return {
@@ -6072,40 +6072,40 @@ function $i(e) {
6072
6072
  chat: D,
6073
6073
  messages: ge,
6074
6074
  conversations: O,
6075
- input: Ee,
6076
- pendingAttachments: A,
6075
+ input: De,
6076
+ pendingAttachments: k,
6077
6077
  localChatId: C,
6078
6078
  isConversationBlocked: se,
6079
6079
  inputMessagePlaceholder: _e,
6080
6080
  chatError: oe,
6081
6081
  activeView: ve,
6082
- messageFeedbacks: k,
6083
- feedbackDialogMessage: ye,
6084
- isFeedbackSubmitting: be,
6085
- isFeedbackSubmitted: xe,
6086
- feedbackSubmitError: Se,
6087
- isLeadSubmitted: Ce,
6088
- isLoadingSubmitLead: we,
6089
- submitLeadError: Te,
6090
- initialize: Me,
6091
- loadConversations: De,
6092
- handleSubmit: Ne,
6093
- stopGeneration: j,
6094
- startNewChat: Pe,
6095
- regenerate: Fe,
6096
- addToolOutput: Ie,
6097
- handleFileSelect: N,
6098
- clearPendingAttachments: M,
6099
- onUpvote: F,
6100
- onDownvote: Le,
6101
- onFeedback: I,
6102
- onFeedbackSubmit: Re,
6103
- onLeadSubmit: ze,
6104
- navigate: Be
6082
+ messageFeedbacks: ye,
6083
+ feedbackDialogMessage: be,
6084
+ isFeedbackSubmitting: xe,
6085
+ isFeedbackSubmitted: Se,
6086
+ feedbackSubmitError: Ce,
6087
+ isLeadSubmitted: we,
6088
+ isLoadingSubmitLead: Te,
6089
+ submitLeadError: Ee,
6090
+ initialize: Ne,
6091
+ loadConversations: Oe,
6092
+ handleSubmit: Pe,
6093
+ stopGeneration: A,
6094
+ startNewChat: Fe,
6095
+ regenerate: Ie,
6096
+ addToolOutput: Le,
6097
+ handleFileSelect: M,
6098
+ clearPendingAttachments: j,
6099
+ onUpvote: P,
6100
+ onDownvote: Re,
6101
+ onFeedback: F,
6102
+ onFeedbackSubmit: ze,
6103
+ onLeadSubmit: Be,
6104
+ navigate: I
6105
6105
  };
6106
6106
  })();
6107
6107
  }
6108
6108
  //#endregion
6109
- export { K as a, Oe as c, $t as i, j as l, Xi as n, O as o, Ei as r, Ce as s, $i as t };
6109
+ export { K as i, Xi as n, Ei as r, $i as t };
6110
6110
 
6111
- //# sourceMappingURL=useChatbotStore-BNGyIqjI.js.map
6111
+ //# sourceMappingURL=useChatbotStore-Im8Xjwte.js.map