@8wave/ai-elements 0.104.0 → 0.105.0-beta.1

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 (125) hide show
  1. package/dist/_chunks/{Agent-DG4nPG72.js → Agent-VhugusRf.js} +2 -2
  2. package/dist/_chunks/Agent-VhugusRf.js.map +1 -0
  3. package/dist/_chunks/{Document-DXkvvAnt.js → Document-DjNrISX1.js} +2 -2
  4. package/dist/_chunks/{Document-DXkvvAnt.js.map → Document-DjNrISX1.js.map} +1 -1
  5. package/dist/_chunks/{Media-3Mo4NRj7.js → Media-hjgDyEMr.js} +2 -2
  6. package/dist/_chunks/Media-hjgDyEMr.js.map +1 -0
  7. package/dist/_chunks/{PkStreamingMarkdown-YKd9F3xU.js → PkStreamingMarkdown-B4eMb97I.js} +2 -2
  8. package/dist/_chunks/{PkStreamingMarkdown-YKd9F3xU.js.map → PkStreamingMarkdown-B4eMb97I.js.map} +1 -1
  9. package/dist/_chunks/{PkToolRequestGeolocation-sf6LpUN_.js → PkToolRequestGeolocation-Bp-D2nDb.js} +3 -3
  10. package/{dist-vue/_chunks/PkToolRequestGeolocation-BdX5DzEN.js.map → dist/_chunks/PkToolRequestGeolocation-Bp-D2nDb.js.map} +1 -1
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-BB8mlQit.js → PkToolRequestOAuthConnection-CjjyDj9A.js} +3 -3
  12. package/dist/_chunks/{PkToolRequestOAuthConnection-BB8mlQit.js.map → PkToolRequestOAuthConnection-CjjyDj9A.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowArtifact-54saXXCe.js → PkToolShowArtifact-Dl8f7Q7q.js} +2 -2
  14. package/dist/_chunks/{PkToolShowArtifact-54saXXCe.js.map → PkToolShowArtifact-Dl8f7Q7q.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowCalendarEvent-B_HPVUDk.js → PkToolShowCalendarEvent-B_QmZrlZ.js} +2 -2
  16. package/dist/_chunks/{PkToolShowCalendarEvent-B_HPVUDk.js.map → PkToolShowCalendarEvent-B_QmZrlZ.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowContactForm-BtcNCixq.js → PkToolShowContactForm-CXE0485W.js} +14 -14
  18. package/dist/_chunks/{PkToolShowContactForm-BtcNCixq.js.map → PkToolShowContactForm-CXE0485W.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowDiagram-cA64c2_N.js → PkToolShowDiagram-D-TyCkCB.js} +2 -2
  20. package/dist/_chunks/{PkToolShowDiagram-cA64c2_N.js.map → PkToolShowDiagram-D-TyCkCB.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowForm-DdBAG0Qs.js → PkToolShowForm-BzaibKAz.js} +101 -115
  22. package/dist/_chunks/PkToolShowForm-BzaibKAz.js.map +1 -0
  23. package/dist/_chunks/{PkToolShowSources-0qudS-bu.js → PkToolShowSources-CoTIoupP.js} +3 -3
  24. package/dist/_chunks/{PkToolShowSources-0qudS-bu.js.map → PkToolShowSources-CoTIoupP.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowSuggestedReply-B2IB6ioR.js → PkToolShowSuggestedReply-DA2Bi7k4.js} +2 -2
  26. package/dist/_chunks/{PkToolShowSuggestedReply-B2IB6ioR.js.map → PkToolShowSuggestedReply-DA2Bi7k4.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowWeather-Bl3Yoscl.js → PkToolShowWeather-ChDHtOLz.js} +2 -2
  28. package/dist/_chunks/{PkToolShowWeather-Bl3Yoscl.js.map → PkToolShowWeather-ChDHtOLz.js.map} +1 -1
  29. package/dist/_chunks/{browser-DuzNfJq0.js → browser-BXy4OnXA.js} +804 -779
  30. package/dist/_chunks/browser-BXy4OnXA.js.map +1 -0
  31. package/dist/_chunks/index.es-CnpsLhp_.js +1006 -0
  32. package/dist/_chunks/index.es-CnpsLhp_.js.map +1 -0
  33. package/dist/_chunks/utils-DtJdKlnF.js +185 -0
  34. package/dist/_chunks/utils-DtJdKlnF.js.map +1 -0
  35. package/dist/_chunks/{vue-i18n-_ouwlDGE.js → vue-i18n-C3J36GV4.js} +2 -2
  36. package/dist/_chunks/{vue-i18n-_ouwlDGE.js.map → vue-i18n-C3J36GV4.js.map} +1 -1
  37. package/dist/_chunks/{web-DnPxEADy.js → web-CzR5jWfC.js} +46 -45
  38. package/dist/_chunks/{web-DnPxEADy.js.map → web-CzR5jWfC.js.map} +1 -1
  39. package/dist/ai-elements.es.js +2100 -2159
  40. package/dist/ai-elements.es.js.map +1 -1
  41. package/dist-vue/PkChatbot.js +1 -1
  42. package/dist-vue/PkChatbotMessages.js +1 -1
  43. package/dist-vue/PkChatbotStepPayload.js +1 -1
  44. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  45. package/dist-vue/PkChatbotSteps.js +1 -1
  46. package/dist-vue/PkChatbotViewChat.js +1 -1
  47. package/dist-vue/PkChatbotViewConversations.js +1 -1
  48. package/dist-vue/PkChatbotViewFiles.js +1 -1
  49. package/dist-vue/PkChatbotViewProfile.js +1 -1
  50. package/dist-vue/_chunks/{Agent-gCuDMxHN.js → Agent-CpIgGdU4.js} +2 -2
  51. package/dist-vue/_chunks/Agent-CpIgGdU4.js.map +1 -0
  52. package/dist-vue/_chunks/{Document-iH61Cw06.js → Document-CiaGPYTR.js} +2 -2
  53. package/dist-vue/_chunks/{Document-iH61Cw06.js.map → Document-CiaGPYTR.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkChatbot-Bg9oercD.js → PkChatbot-xmjKbljL.js} +7 -7
  55. package/dist-vue/_chunks/{PkChatbot-Bg9oercD.js.map → PkChatbot-xmjKbljL.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkChatbotMessages-DUQxuYaG.js → PkChatbotMessages-tHQ2JQrb.js} +75 -75
  57. package/dist-vue/_chunks/{PkChatbotMessages-DUQxuYaG.js.map → PkChatbotMessages-tHQ2JQrb.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-hCmy4XG9.js → PkChatbotStepPayload-BtsnkJIV.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-hCmy4XG9.js.map → PkChatbotStepPayload-BtsnkJIV.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-B0WU0HcD.js → PkChatbotStepToolDetail-CCa95eBO.js} +116 -101
  61. package/dist-vue/_chunks/PkChatbotStepToolDetail-CCa95eBO.js.map +1 -0
  62. package/dist-vue/_chunks/PkChatbotSteps-CPBzs7Gi.js +180 -0
  63. package/dist-vue/_chunks/PkChatbotSteps-CPBzs7Gi.js.map +1 -0
  64. package/dist-vue/_chunks/{PkChatbotViewChat-YwjWNoqf.js → PkChatbotViewChat-CdiPjQLq.js} +6 -6
  65. package/dist-vue/_chunks/{PkChatbotViewChat-YwjWNoqf.js.map → PkChatbotViewChat-CdiPjQLq.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-vo57eSwy.js → PkChatbotViewConversations-BP-NJvlK.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-vo57eSwy.js.map → PkChatbotViewConversations-BP-NJvlK.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotViewFiles-DDPugn7F.js → PkChatbotViewFiles-DRUVmxU5.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-DDPugn7F.js.map → PkChatbotViewFiles-DRUVmxU5.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotViewProfile-Dww5KI21.js → PkChatbotViewProfile-ywvIs6N5.js} +2 -2
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-Dww5KI21.js.map → PkChatbotViewProfile-ywvIs6N5.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkToolRequestGeolocation-BdX5DzEN.js → PkToolRequestGeolocation-BdIyXoPQ.js} +2 -2
  73. package/{dist/_chunks/PkToolRequestGeolocation-sf6LpUN_.js.map → dist-vue/_chunks/PkToolRequestGeolocation-BdIyXoPQ.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BUmnRgMi.js → PkToolRequestOAuthConnection-Dnch7xAB.js} +2 -2
  75. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BUmnRgMi.js.map → PkToolRequestOAuthConnection-Dnch7xAB.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkToolShowDiagram-YMo-iVWr.js → PkToolShowDiagram-DgLxNNp7.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolShowDiagram-YMo-iVWr.js.map → PkToolShowDiagram-DgLxNNp7.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolShowForm-D2n2rA6J.js → PkToolShowForm-6eLi6Wr0.js} +103 -117
  79. package/dist-vue/_chunks/PkToolShowForm-6eLi6Wr0.js.map +1 -0
  80. package/dist-vue/_chunks/{PkToolShowSources-DUAsrrzC.js → PkToolShowSources-DTJgvDiB.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowSources-DUAsrrzC.js.map → PkToolShowSources-DTJgvDiB.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm28RIJF.js → PkToolShowSuggestedReply-D9RY2h6Z.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm28RIJF.js.map → PkToolShowSuggestedReply-D9RY2h6Z.js.map} +1 -1
  84. package/dist-vue/_chunks/{createChatbotApiClient-CAX-3-oK.js → createChatbotApiClient-12eL7hul.js} +2 -2
  85. package/dist-vue/_chunks/{createChatbotApiClient-CAX-3-oK.js.map → createChatbotApiClient-12eL7hul.js.map} +1 -1
  86. package/dist-vue/_chunks/{useChatbotStore-Rj18hAUf.js → useChatbotStore-Chtzi5jc.js} +1086 -1016
  87. package/dist-vue/_chunks/useChatbotStore-Chtzi5jc.js.map +1 -0
  88. package/dist-vue/_chunks/{utils-B0jsOUqd.js → utils-DKNWwMTQ.js} +46 -23
  89. package/dist-vue/_chunks/utils-DKNWwMTQ.js.map +1 -0
  90. package/dist-vue/_chunks/{web-DnPxEADy.js → web-CzR5jWfC.js} +46 -45
  91. package/dist-vue/_chunks/{web-DnPxEADy.js.map → web-CzR5jWfC.js.map} +1 -1
  92. package/dist-vue/api.js +1 -1
  93. package/dist-vue/composables.js +3 -3
  94. package/dist-vue/index.js +259 -259
  95. package/dist-vue/index.js.map +1 -1
  96. package/dist-vue/locales.js +10 -4
  97. package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +1 -1
  98. package/dist-vue/packages/components/src/chat/constants.d.ts +12 -0
  99. package/dist-vue/packages/components/src/chat/utils.d.ts +37 -0
  100. package/dist-vue/packages/models/src/schema/Agent.d.ts +24 -16
  101. package/dist-vue/packages/models/src/schema/AgentChatStatistics.d.ts +1 -1
  102. package/dist-vue/packages/models/src/schema/Chat.d.ts +9 -9
  103. package/dist-vue/packages/models/src/schema/Document.d.ts +6 -6
  104. package/dist-vue/packages/models/src/schema/DocumentFolder.d.ts +0 -1
  105. package/dist-vue/packages/models/src/schema/McpServer.d.ts +2 -2
  106. package/dist-vue/packages/models/src/schema/Member.d.ts +2 -2
  107. package/dist-vue/packages/models/src/schema/Organization.d.ts +4 -4
  108. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +29 -29
  109. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +20 -20
  110. package/dist-vue/packages/models/src/schema/User.d.ts +6 -6
  111. package/dist-vue/packages/models/src/schema/constants.d.ts +2 -0
  112. package/package.json +10 -5
  113. package/dist/_chunks/Agent-DG4nPG72.js.map +0 -1
  114. package/dist/_chunks/Media-3Mo4NRj7.js.map +0 -1
  115. package/dist/_chunks/PkToolShowForm-DdBAG0Qs.js.map +0 -1
  116. package/dist/_chunks/browser-DuzNfJq0.js.map +0 -1
  117. package/dist/_chunks/index.es-DXx8DNKf.js +0 -2986
  118. package/dist/_chunks/index.es-DXx8DNKf.js.map +0 -1
  119. package/dist-vue/_chunks/Agent-gCuDMxHN.js.map +0 -1
  120. package/dist-vue/_chunks/PkChatbotStepToolDetail-B0WU0HcD.js.map +0 -1
  121. package/dist-vue/_chunks/PkChatbotSteps-BrvTsAeZ.js +0 -177
  122. package/dist-vue/_chunks/PkChatbotSteps-BrvTsAeZ.js.map +0 -1
  123. package/dist-vue/_chunks/PkToolShowForm-D2n2rA6J.js.map +0 -1
  124. package/dist-vue/_chunks/useChatbotStore-Rj18hAUf.js.map +0 -1
  125. package/dist-vue/_chunks/utils-B0jsOUqd.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { C as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, v as g, w as _, y as ee } from "./schemas-U769m8P5.js";
2
- import { E as te } from "./Agent-gCuDMxHN.js";
3
- import { r as ne, t as re } from "./createChatbotApiClient-CAX-3-oK.js";
2
+ import { E as te } from "./Agent-CpIgGdU4.js";
3
+ import { r as ne, t as re } from "./createChatbotApiClient-12eL7hul.js";
4
4
  import { t as ie } from "./src-C2w8W_tC.js";
5
5
  import { n as ae } from "./message-RohfrdWS.js";
6
6
  import { t as oe } from "./useSafeLocalStorage-BneNcUZ9.js";
@@ -73,30 +73,30 @@ var ve = "vercel.ai.error", ye = Symbol.for(ve), x, S, C = class e extends (S =
73
73
  function be(e) {
74
74
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
75
75
  }
76
- var xe = "AI_InvalidArgumentError", Se = `vercel.ai.error.${xe}`, w = Symbol.for(Se), Ce, we, T = class extends (we = C, Ce = w, we) {
76
+ var xe = "AI_InvalidArgumentError", Se = `vercel.ai.error.${xe}`, w = Symbol.for(Se), T, Ce, E = class extends (Ce = C, T = w, Ce) {
77
77
  constructor({ message: e, cause: t, argument: n }) {
78
78
  super({
79
79
  name: xe,
80
80
  message: e,
81
81
  cause: t
82
- }), this[Ce] = !0, this.argument = n;
82
+ }), this[T] = !0, this.argument = n;
83
83
  }
84
84
  static isInstance(e) {
85
85
  return C.hasMarker(e, Se);
86
86
  }
87
- }, Te = "AI_JSONParseError", Ee = `vercel.ai.error.${Te}`, De = Symbol.for(Ee), Oe, ke, E = class extends (ke = C, Oe = De, ke) {
87
+ }, we = "AI_JSONParseError", Te = `vercel.ai.error.${we}`, Ee = Symbol.for(Te), De, Oe, D = class extends (Oe = C, De = Ee, Oe) {
88
88
  constructor({ text: e, cause: t }) {
89
89
  super({
90
- name: Te,
90
+ name: we,
91
91
  message: `JSON parsing failed: Text: ${e}.
92
92
  Error message: ${be(t)}`,
93
93
  cause: t
94
- }), this[Oe] = !0, this.text = e;
94
+ }), this[De] = !0, this.text = e;
95
95
  }
96
96
  static isInstance(e) {
97
- return C.hasMarker(e, Ee);
97
+ return C.hasMarker(e, Te);
98
98
  }
99
- }, Ae = "AI_TypeValidationError", D = `vercel.ai.error.${Ae}`, je = Symbol.for(D), Me, O, k = class e extends (O = C, Me = je, O) {
99
+ }, ke = "AI_TypeValidationError", O = `vercel.ai.error.${ke}`, Ae = Symbol.for(O), je, k, A = class e extends (k = C, je = Ae, k) {
100
100
  constructor({ value: e, cause: t, context: n }) {
101
101
  let r = "Type validation failed";
102
102
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -105,14 +105,14 @@ Error message: ${be(t)}`,
105
105
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
106
106
  }
107
107
  super({
108
- name: Ae,
108
+ name: ke,
109
109
  message: `${r}: Value: ${JSON.stringify(e)}.
110
110
  Error message: ${be(t)}`,
111
111
  cause: t
112
- }), this[Me] = !0, this.value = e, this.context = n;
112
+ }), this[je] = !0, this.value = e, this.context = n;
113
113
  }
114
114
  static isInstance(e) {
115
- return C.hasMarker(e, D);
115
+ return C.hasMarker(e, O);
116
116
  }
117
117
  static wrap({ value: t, cause: n, context: r }) {
118
118
  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({
@@ -121,15 +121,15 @@ Error message: ${be(t)}`,
121
121
  context: r
122
122
  });
123
123
  }
124
- }, Ne = class extends Error {
124
+ }, Me = class extends Error {
125
125
  constructor(e, t) {
126
126
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
127
127
  }
128
- }, Pe = 10, Fe = 13, A = 32;
129
- function Ie(e) {}
130
- function Le(e) {
128
+ }, Ne = 10, Pe = 13, j = 32;
129
+ function Fe(e) {}
130
+ function Ie(e) {
131
131
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
132
- let { onEvent: t = Ie, onError: n = Ie, onRetry: r = Ie, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
132
+ let { onEvent: t = Fe, onError: n = Fe, onRetry: r = Fe, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
133
133
  function m(e) {
134
134
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
135
135
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -148,7 +148,7 @@ function Le(e) {
148
148
  n !== "" && (o.push(n), s = n.length), h();
149
149
  }
150
150
  function h() {
151
- a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Ne(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
151
+ a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Me(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
152
152
  }
153
153
  function g(e) {
154
154
  let n = 0;
@@ -164,9 +164,9 @@ function Le(e) {
164
164
  continue;
165
165
  }
166
166
  let i = e.charCodeAt(n);
167
- if (j(e, n, i)) {
168
- let i = e.charCodeAt(n + 5) === A ? n + 6 : n + 5, a = e.slice(i, r);
169
- if (d === 0 && e.charCodeAt(r + 1) === Pe) {
167
+ if (M(e, n, i)) {
168
+ let i = e.charCodeAt(n + 5) === j ? n + 6 : n + 5, a = e.slice(i, r);
169
+ if (d === 0 && e.charCodeAt(r + 1) === Ne) {
170
170
  t({
171
171
  id: l,
172
172
  event: f,
@@ -176,7 +176,7 @@ function Le(e) {
176
176
  }
177
177
  u = d === 0 ? a : `${u}
178
178
  ${a}`, d++;
179
- } else M(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === A ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
179
+ } else N(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === j ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
180
180
  n = r + 1, r = e.indexOf("\n", n);
181
181
  }
182
182
  return e.slice(n);
@@ -184,7 +184,7 @@ ${a}`, d++;
184
184
  for (; n < e.length;) {
185
185
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
186
186
  if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
187
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Fe && e.charCodeAt(n) === Pe && n++;
187
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Pe && e.charCodeAt(n) === Ne && n++;
188
188
  }
189
189
  return e.slice(n);
190
190
  }
@@ -194,25 +194,25 @@ ${a}`, d++;
194
194
  return;
195
195
  }
196
196
  let r = e.charCodeAt(t);
197
- if (j(e, t, r)) {
198
- let r = e.charCodeAt(t + 5) === A ? t + 6 : t + 5, i = e.slice(r, n);
197
+ if (M(e, t, r)) {
198
+ let r = e.charCodeAt(t + 5) === j ? t + 6 : t + 5, i = e.slice(r, n);
199
199
  u = d === 0 ? i : `${u}
200
200
  ${i}`, d++;
201
201
  return;
202
202
  }
203
- if (M(e, t, r)) {
204
- f = e.slice(e.charCodeAt(t + 6) === A ? t + 7 : t + 6, n) || void 0;
203
+ if (N(e, t, r)) {
204
+ f = e.slice(e.charCodeAt(t + 6) === j ? t + 7 : t + 6, n) || void 0;
205
205
  return;
206
206
  }
207
207
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
208
- let r = e.slice(e.charCodeAt(t + 3) === A ? t + 4 : t + 3, n);
208
+ let r = e.slice(e.charCodeAt(t + 3) === j ? t + 4 : t + 3, n);
209
209
  l = r.includes("\0") ? void 0 : r;
210
210
  return;
211
211
  }
212
212
  if (r === 58) {
213
213
  if (i) {
214
214
  let r = e.slice(t, n);
215
- i(r.slice(e.charCodeAt(t + 1) === A ? 2 : 1));
215
+ i(r.slice(e.charCodeAt(t + 1) === j ? 2 : 1));
216
216
  }
217
217
  return;
218
218
  }
@@ -221,7 +221,7 @@ ${i}`, d++;
221
221
  ee(a, "", a);
222
222
  return;
223
223
  }
224
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === A ? 2 : 1;
224
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === j ? 2 : 1;
225
225
  ee(s, a.slice(o + c), a);
226
226
  }
227
227
  function ee(e, t, i) {
@@ -237,13 +237,13 @@ ${t}`, d++;
237
237
  l = t.includes("\0") ? void 0 : t;
238
238
  break;
239
239
  case "retry":
240
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Ne(`Invalid \`retry\` value: "${t}"`, {
240
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Me(`Invalid \`retry\` value: "${t}"`, {
241
241
  type: "invalid-retry",
242
242
  value: t,
243
243
  line: i
244
244
  }));
245
245
  break;
246
- default: n(new Ne(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
246
+ default: n(new Me(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
247
247
  type: "unknown-field",
248
248
  field: e,
249
249
  value: t,
@@ -270,20 +270,20 @@ ${t}`, d++;
270
270
  reset: ne
271
271
  };
272
272
  }
273
- function j(e, t, n) {
273
+ function M(e, t, n) {
274
274
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
275
275
  }
276
- function M(e, t, n) {
276
+ function N(e, t, n) {
277
277
  return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
278
278
  }
279
279
  //#endregion
280
280
  //#region ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
281
- var N = class extends TransformStream {
281
+ var P = class extends TransformStream {
282
282
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
283
283
  let i;
284
284
  super({
285
285
  start(a) {
286
- i = Le({
286
+ i = Ie({
287
287
  onEvent: (e) => {
288
288
  a.enqueue(e);
289
289
  },
@@ -302,8 +302,8 @@ var N = class extends TransformStream {
302
302
  }
303
303
  };
304
304
  new TextDecoder();
305
- var { btoa: Re, atob: ze } = globalThis;
306
- function P(e) {
305
+ var { btoa: Le, atob: Re } = globalThis;
306
+ function F(e) {
307
307
  if (e == null) return {};
308
308
  let t = {};
309
309
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -315,35 +315,35 @@ function P(e) {
315
315
  }
316
316
  return t;
317
317
  }
318
- var Be = globalThis.fetch;
319
- Ve(Be);
320
- function Ve(e) {
318
+ var ze = globalThis.fetch;
319
+ Be(ze);
320
+ function Be(e) {
321
321
  if (typeof e != "function") return !1;
322
322
  let t = Function.prototype.toString.call(e);
323
323
  return t.includes("internal/deps/undici") || t.includes("lazy loading of undici");
324
324
  }
325
- var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
325
+ var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
326
326
  let i = () => {
327
327
  let e = n.length, r = Array(t);
328
328
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
329
329
  return r.join("");
330
330
  };
331
331
  if (e == null) return i;
332
- if (n.includes(r)) throw new T({
332
+ if (n.includes(r)) throw new E({
333
333
  argument: "separator",
334
334
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
335
335
  });
336
336
  return () => `${e}${r}${i()}`;
337
- }, I = F();
338
- function He(e) {
337
+ }, L = I();
338
+ function Ve(e) {
339
339
  return globalThis.Buffer?.isBuffer(e) ?? !1;
340
340
  }
341
- var Ue = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, We = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
342
- function Ge(e) {
341
+ var He = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Ue = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
342
+ function We(e) {
343
343
  let t = JSON.parse(e);
344
- return typeof t != "object" || !t || Ue.test(e) === !1 && We.test(e) === !1 ? t : Ke(t);
344
+ return typeof t != "object" || !t || He.test(e) === !1 && Ue.test(e) === !1 ? t : Ge(t);
345
345
  }
346
- function Ke(e) {
346
+ function Ge(e) {
347
347
  let t = [e];
348
348
  for (; t.length;) {
349
349
  let e = t;
@@ -358,35 +358,35 @@ function Ke(e) {
358
358
  }
359
359
  return e;
360
360
  }
361
- function qe(e) {
361
+ function Ke(e) {
362
362
  let { stackTraceLimit: t } = Error;
363
363
  try {
364
364
  Error.stackTraceLimit = 0;
365
365
  } catch {
366
- return Ge(e);
366
+ return We(e);
367
367
  }
368
368
  try {
369
- return Ge(e);
369
+ return We(e);
370
370
  } finally {
371
371
  Error.stackTraceLimit = t;
372
372
  }
373
373
  }
374
- function Je(e) {
374
+ function qe(e) {
375
375
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
376
376
  let { additionalProperties: t } = e;
377
- e.additionalProperties = t != null && typeof t != "boolean" && L(t);
377
+ e.additionalProperties = t != null && typeof t != "boolean" && R(t);
378
378
  let { properties: n } = e;
379
- if (n != null) for (let e of Object.keys(n)) n[e] = L(n[e]);
379
+ if (n != null) for (let e of Object.keys(n)) n[e] = R(n[e]);
380
380
  }
381
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(L) : L(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(L)), e.allOf != null && (e.allOf = e.allOf.map(L)), e.oneOf != null && (e.oneOf = e.oneOf.map(L));
381
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(R) : R(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(R)), e.allOf != null && (e.allOf = e.allOf.map(R)), e.oneOf != null && (e.oneOf = e.oneOf.map(R));
382
382
  let { definitions: t } = e;
383
- if (t != null) for (let e of Object.keys(t)) t[e] = L(t[e]);
383
+ if (t != null) for (let e of Object.keys(t)) t[e] = R(t[e]);
384
384
  return e;
385
385
  }
386
- function L(e) {
387
- return typeof e == "boolean" ? e : Je(e);
386
+ function R(e) {
387
+ return typeof e == "boolean" ? e : qe(e);
388
388
  }
389
- var Ye = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), Xe = {
389
+ var Je = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), Ye = {
390
390
  name: void 0,
391
391
  $refStrategy: "root",
392
392
  basePath: ["#"],
@@ -406,24 +406,24 @@ var Ye = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
406
406
  emailStrategy: "format:email",
407
407
  base64Strategy: "contentEncoding:base64",
408
408
  nameStrategy: "ref"
409
- }, Ze = (e) => typeof e == "string" ? {
410
- ...Xe,
409
+ }, Xe = (e) => typeof e == "string" ? {
410
+ ...Ye,
411
411
  name: e
412
412
  } : {
413
- ...Xe,
413
+ ...Ye,
414
414
  ...e
415
415
  };
416
- function R() {
416
+ function z() {
417
417
  return {};
418
418
  }
419
- function Qe(e, t) {
419
+ function Ze(e, t) {
420
420
  let n = { type: "array" };
421
- return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = U(e.type._def, {
421
+ return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = W(e.type._def, {
422
422
  ...t,
423
423
  currentPath: [...t.currentPath, "items"]
424
424
  })), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
425
425
  }
426
- function $e(e) {
426
+ function Qe(e) {
427
427
  let t = {
428
428
  type: "integer",
429
429
  format: "int64"
@@ -440,16 +440,16 @@ function $e(e) {
440
440
  }
441
441
  return t;
442
442
  }
443
- function et() {
443
+ function $e() {
444
444
  return { type: "boolean" };
445
445
  }
446
- function tt(e, t) {
447
- return U(e.type._def, t);
446
+ function et(e, t) {
447
+ return W(e.type._def, t);
448
448
  }
449
- var nt = (e, t) => U(e.innerType._def, t);
450
- function rt(e, t, n) {
449
+ var tt = (e, t) => W(e.innerType._def, t);
450
+ function nt(e, t, n) {
451
451
  let r = n ?? t.dateStrategy;
452
- if (Array.isArray(r)) return { anyOf: r.map((n) => rt(e, t, n)) };
452
+ if (Array.isArray(r)) return { anyOf: r.map((n) => nt(e, t, n)) };
453
453
  switch (r) {
454
454
  case "string":
455
455
  case "format:date-time": return {
@@ -460,10 +460,10 @@ function rt(e, t, n) {
460
460
  type: "string",
461
461
  format: "date"
462
462
  };
463
- case "integer": return it(e);
463
+ case "integer": return rt(e);
464
464
  }
465
465
  }
466
- var it = (e) => {
466
+ var rt = (e) => {
467
467
  let t = {
468
468
  type: "integer",
469
469
  format: "unix-time"
@@ -476,31 +476,31 @@ var it = (e) => {
476
476
  }
477
477
  return t;
478
478
  };
479
- function at(e, t) {
479
+ function it(e, t) {
480
480
  return {
481
- ...U(e.innerType._def, t),
481
+ ...W(e.innerType._def, t),
482
482
  default: e.defaultValue()
483
483
  };
484
484
  }
485
- function ot(e, t) {
486
- return t.effectStrategy === "input" ? U(e.schema._def, t) : R();
485
+ function at(e, t) {
486
+ return t.effectStrategy === "input" ? W(e.schema._def, t) : z();
487
487
  }
488
- function st(e) {
488
+ function ot(e) {
489
489
  return {
490
490
  type: "string",
491
491
  enum: Array.from(e.values)
492
492
  };
493
493
  }
494
- var ct = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
495
- function z(e, t) {
496
- let n = [U(e.left._def, {
494
+ var st = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
495
+ function B(e, t) {
496
+ let n = [W(e.left._def, {
497
497
  ...t,
498
498
  currentPath: [
499
499
  ...t.currentPath,
500
500
  "allOf",
501
501
  "0"
502
502
  ]
503
- }), U(e.right._def, {
503
+ }), W(e.right._def, {
504
504
  ...t,
505
505
  currentPath: [
506
506
  ...t.currentPath,
@@ -509,7 +509,7 @@ function z(e, t) {
509
509
  ]
510
510
  })].filter((e) => !!e), r = [];
511
511
  return n.forEach((e) => {
512
- if (ct(e)) r.push(...e.allOf);
512
+ if (st(e)) r.push(...e.allOf);
513
513
  else {
514
514
  let t = e;
515
515
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -520,19 +520,19 @@ function z(e, t) {
520
520
  }
521
521
  }), r.length ? { allOf: r } : void 0;
522
522
  }
523
- function lt(e) {
523
+ function ct(e) {
524
524
  let t = typeof e.value;
525
525
  return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
526
526
  type: t === "bigint" ? "integer" : t,
527
527
  const: e.value
528
528
  };
529
529
  }
530
- var ut = void 0, B = {
530
+ var lt = void 0, V = {
531
531
  cuid: /^[cC][^\s-]{8,}$/,
532
532
  cuid2: /^[0-9a-z]+$/,
533
533
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
534
534
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
535
- emoji: () => (ut === void 0 && (ut = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), ut),
535
+ emoji: () => (lt === void 0 && (lt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), lt),
536
536
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
537
537
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
538
538
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
@@ -543,7 +543,7 @@ var ut = void 0, B = {
543
543
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
544
544
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
545
545
  };
546
- function dt(e, t) {
546
+ function ut(e, t) {
547
547
  let n = { type: "string" };
548
548
  if (e.checks) for (let r of e.checks) switch (r.kind) {
549
549
  case "min":
@@ -555,108 +555,108 @@ function dt(e, t) {
555
555
  case "email":
556
556
  switch (t.emailStrategy) {
557
557
  case "format:email":
558
- V(n, "email", r.message, t);
558
+ H(n, "email", r.message, t);
559
559
  break;
560
560
  case "format:idn-email":
561
- V(n, "idn-email", r.message, t);
561
+ H(n, "idn-email", r.message, t);
562
562
  break;
563
- case "pattern:zod": H(n, B.email, r.message, t);
563
+ case "pattern:zod": U(n, V.email, r.message, t);
564
564
  }
565
565
  break;
566
566
  case "url":
567
- V(n, "uri", r.message, t);
567
+ H(n, "uri", r.message, t);
568
568
  break;
569
569
  case "uuid":
570
- V(n, "uuid", r.message, t);
570
+ H(n, "uuid", r.message, t);
571
571
  break;
572
572
  case "regex":
573
- H(n, r.regex, r.message, t);
573
+ U(n, r.regex, r.message, t);
574
574
  break;
575
575
  case "cuid":
576
- H(n, B.cuid, r.message, t);
576
+ U(n, V.cuid, r.message, t);
577
577
  break;
578
578
  case "cuid2":
579
- H(n, B.cuid2, r.message, t);
579
+ U(n, V.cuid2, r.message, t);
580
580
  break;
581
581
  case "startsWith":
582
- H(n, RegExp(`^${ft(r.value, t)}`), r.message, t);
582
+ U(n, RegExp(`^${dt(r.value, t)}`), r.message, t);
583
583
  break;
584
584
  case "endsWith":
585
- H(n, RegExp(`${ft(r.value, t)}$`), r.message, t);
585
+ U(n, RegExp(`${dt(r.value, t)}$`), r.message, t);
586
586
  break;
587
587
  case "datetime":
588
- V(n, "date-time", r.message, t);
588
+ H(n, "date-time", r.message, t);
589
589
  break;
590
590
  case "date":
591
- V(n, "date", r.message, t);
591
+ H(n, "date", r.message, t);
592
592
  break;
593
593
  case "time":
594
- V(n, "time", r.message, t);
594
+ H(n, "time", r.message, t);
595
595
  break;
596
596
  case "duration":
597
- V(n, "duration", r.message, t);
597
+ H(n, "duration", r.message, t);
598
598
  break;
599
599
  case "length":
600
600
  n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
601
601
  break;
602
602
  case "includes":
603
- H(n, RegExp(ft(r.value, t)), r.message, t);
603
+ U(n, RegExp(dt(r.value, t)), r.message, t);
604
604
  break;
605
605
  case "ip":
606
- r.version !== "v6" && V(n, "ipv4", r.message, t), r.version !== "v4" && V(n, "ipv6", r.message, t);
606
+ r.version !== "v6" && H(n, "ipv4", r.message, t), r.version !== "v4" && H(n, "ipv6", r.message, t);
607
607
  break;
608
608
  case "base64url":
609
- H(n, B.base64url, r.message, t);
609
+ U(n, V.base64url, r.message, t);
610
610
  break;
611
611
  case "jwt":
612
- H(n, B.jwt, r.message, t);
612
+ U(n, V.jwt, r.message, t);
613
613
  break;
614
614
  case "cidr":
615
- r.version !== "v6" && H(n, B.ipv4Cidr, r.message, t), r.version !== "v4" && H(n, B.ipv6Cidr, r.message, t);
615
+ r.version !== "v6" && U(n, V.ipv4Cidr, r.message, t), r.version !== "v4" && U(n, V.ipv6Cidr, r.message, t);
616
616
  break;
617
617
  case "emoji":
618
- H(n, B.emoji(), r.message, t);
618
+ U(n, V.emoji(), r.message, t);
619
619
  break;
620
620
  case "ulid":
621
- H(n, B.ulid, r.message, t);
621
+ U(n, V.ulid, r.message, t);
622
622
  break;
623
623
  case "base64":
624
624
  switch (t.base64Strategy) {
625
625
  case "format:binary":
626
- V(n, "binary", r.message, t);
626
+ H(n, "binary", r.message, t);
627
627
  break;
628
628
  case "contentEncoding:base64":
629
629
  n.contentEncoding = "base64";
630
630
  break;
631
- case "pattern:zod": H(n, B.base64, r.message, t);
631
+ case "pattern:zod": U(n, V.base64, r.message, t);
632
632
  }
633
633
  break;
634
- case "nanoid": H(n, B.nanoid, r.message, t);
634
+ case "nanoid": U(n, V.nanoid, r.message, t);
635
635
  }
636
636
  return n;
637
637
  }
638
- function ft(e, t) {
639
- return t.patternStrategy === "escape" ? mt(e) : e;
638
+ function dt(e, t) {
639
+ return t.patternStrategy === "escape" ? pt(e) : e;
640
640
  }
641
- var pt = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
642
- function mt(e) {
641
+ var ft = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
642
+ function pt(e) {
643
643
  let t = "";
644
- for (let n = 0; n < e.length; n++) pt.has(e[n]) || (t += "\\"), t += e[n];
644
+ for (let n = 0; n < e.length; n++) ft.has(e[n]) || (t += "\\"), t += e[n];
645
645
  return t;
646
646
  }
647
- function V(e, t, n, r) {
647
+ function H(e, t, n, r) {
648
648
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
649
649
  format: t,
650
650
  ...n && r.errorMessages && { errorMessage: { format: n } }
651
651
  })) : e.format = t;
652
652
  }
653
- function H(e, t, n, r) {
653
+ function U(e, t, n, r) {
654
654
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
655
- pattern: ht(t, r),
655
+ pattern: mt(t, r),
656
656
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
657
- })) : e.pattern = ht(t, r);
657
+ })) : e.pattern = mt(t, r);
658
658
  }
659
- function ht(e, t) {
659
+ function mt(e, t) {
660
660
  if (!t.applyRegexFlags || !e.flags) return e.source;
661
661
  let n = {
662
662
  i: e.flags.includes("i"),
@@ -704,16 +704,16 @@ function ht(e, t) {
704
704
  }
705
705
  return i;
706
706
  }
707
- function gt(e, t) {
707
+ function ht(e, t) {
708
708
  let n = {
709
709
  type: "object",
710
- additionalProperties: U(e.valueType._def, {
710
+ additionalProperties: W(e.valueType._def, {
711
711
  ...t,
712
712
  currentPath: [...t.currentPath, "additionalProperties"]
713
713
  }) ?? t.allowedAdditionalProperties
714
714
  };
715
715
  if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
716
- let { type: r, ...i } = dt(e.keyType._def, t);
716
+ let { type: r, ...i } = ut(e.keyType._def, t);
717
717
  return {
718
718
  ...n,
719
719
  propertyNames: i
@@ -724,7 +724,7 @@ function gt(e, t) {
724
724
  propertyNames: { enum: e.keyType._def.values }
725
725
  };
726
726
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
727
- let { type: r, ...i } = tt(e.keyType._def, t);
727
+ let { type: r, ...i } = et(e.keyType._def, t);
728
728
  return {
729
729
  ...n,
730
730
  propertyNames: i
@@ -732,13 +732,13 @@ function gt(e, t) {
732
732
  }
733
733
  return n;
734
734
  }
735
- function _t(e, t) {
736
- return t.mapStrategy === "record" ? gt(e, t) : {
735
+ function gt(e, t) {
736
+ return t.mapStrategy === "record" ? ht(e, t) : {
737
737
  type: "array",
738
738
  maxItems: 125,
739
739
  items: {
740
740
  type: "array",
741
- items: [U(e.keyType._def, {
741
+ items: [W(e.keyType._def, {
742
742
  ...t,
743
743
  currentPath: [
744
744
  ...t.currentPath,
@@ -746,7 +746,7 @@ function _t(e, t) {
746
746
  "items",
747
747
  "0"
748
748
  ]
749
- }) || R(), U(e.valueType._def, {
749
+ }) || z(), W(e.valueType._def, {
750
750
  ...t,
751
751
  currentPath: [
752
752
  ...t.currentPath,
@@ -754,37 +754,37 @@ function _t(e, t) {
754
754
  "items",
755
755
  "1"
756
756
  ]
757
- }) || R()],
757
+ }) || z()],
758
758
  minItems: 2,
759
759
  maxItems: 2
760
760
  }
761
761
  };
762
762
  }
763
- function vt(e) {
763
+ function _t(e) {
764
764
  let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
765
765
  return {
766
766
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
767
767
  enum: n
768
768
  };
769
769
  }
770
- function yt() {
771
- return { not: R() };
770
+ function vt() {
771
+ return { not: z() };
772
772
  }
773
- function bt() {
773
+ function yt() {
774
774
  return { type: "null" };
775
775
  }
776
- var xt = {
776
+ var bt = {
777
777
  ZodString: "string",
778
778
  ZodNumber: "number",
779
779
  ZodBigInt: "integer",
780
780
  ZodBoolean: "boolean",
781
781
  ZodNull: "null"
782
782
  };
783
- function St(e, t) {
783
+ function xt(e, t) {
784
784
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
785
- if (n.every((e) => e._def.typeName in xt && (!e._def.checks || !e._def.checks.length))) {
785
+ if (n.every((e) => e._def.typeName in bt && (!e._def.checks || !e._def.checks.length))) {
786
786
  let e = n.reduce((e, t) => {
787
- let n = xt[t._def.typeName];
787
+ let n = bt[t._def.typeName];
788
788
  return n && !e.includes(n) ? [...e, n] : e;
789
789
  }, []);
790
790
  return { type: e.length > 1 ? e : e[0] };
@@ -812,10 +812,10 @@ function St(e, t) {
812
812
  type: "string",
813
813
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
814
814
  };
815
- return Ct(e, t);
815
+ return St(e, t);
816
816
  }
817
- var Ct = (e, t) => {
818
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => U(e._def, {
817
+ var St = (e, t) => {
818
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => W(e._def, {
819
819
  ...t,
820
820
  currentPath: [
821
821
  ...t.currentPath,
@@ -825,15 +825,15 @@ var Ct = (e, t) => {
825
825
  })).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
826
826
  return n.length ? { anyOf: n } : void 0;
827
827
  };
828
- function wt(e, t) {
828
+ function Ct(e, t) {
829
829
  if ([
830
830
  "ZodString",
831
831
  "ZodNumber",
832
832
  "ZodBigInt",
833
833
  "ZodBoolean",
834
834
  "ZodNull"
835
- ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [xt[e.innerType._def.typeName], "null"] };
836
- let n = U(e.innerType._def, {
835
+ ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [bt[e.innerType._def.typeName], "null"] };
836
+ let n = W(e.innerType._def, {
837
837
  ...t,
838
838
  currentPath: [
839
839
  ...t.currentPath,
@@ -843,7 +843,7 @@ function wt(e, t) {
843
843
  });
844
844
  return n && { anyOf: [n, { type: "null" }] };
845
845
  }
846
- function Tt(e) {
846
+ function wt(e) {
847
847
  let t = { type: "number" };
848
848
  if (!e.checks) return t;
849
849
  for (let n of e.checks) switch (n.kind) {
@@ -860,7 +860,7 @@ function Tt(e) {
860
860
  }
861
861
  return t;
862
862
  }
863
- function Et(e, t) {
863
+ function Tt(e, t) {
864
864
  let n = {
865
865
  type: "object",
866
866
  properties: {}
@@ -868,7 +868,7 @@ function Et(e, t) {
868
868
  for (let e in i) {
869
869
  let a = i[e];
870
870
  if (a === void 0 || a._def === void 0) continue;
871
- let o = Ot(a), s = U(a._def, {
871
+ let o = Dt(a), s = W(a._def, {
872
872
  ...t,
873
873
  currentPath: [
874
874
  ...t.currentPath,
@@ -884,11 +884,11 @@ function Et(e, t) {
884
884
  s !== void 0 && (n.properties[e] = s, o || r.push(e));
885
885
  }
886
886
  r.length && (n.required = r);
887
- let a = Dt(e, t);
887
+ let a = Et(e, t);
888
888
  return a !== void 0 && (n.additionalProperties = a), n;
889
889
  }
890
- function Dt(e, t) {
891
- if (e.catchall._def.typeName !== "ZodNever") return U(e.catchall._def, {
890
+ function Et(e, t) {
891
+ if (e.catchall._def.typeName !== "ZodNever") return W(e.catchall._def, {
892
892
  ...t,
893
893
  currentPath: [...t.currentPath, "additionalProperties"]
894
894
  });
@@ -898,16 +898,16 @@ function Dt(e, t) {
898
898
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
899
899
  }
900
900
  }
901
- function Ot(e) {
901
+ function Dt(e) {
902
902
  try {
903
903
  return e.isOptional();
904
904
  } catch {
905
905
  return !0;
906
906
  }
907
907
  }
908
- var kt = (e, t) => {
909
- if (t.currentPath.toString() === t.propertyPath?.toString()) return U(e.innerType._def, t);
910
- let n = U(e.innerType._def, {
908
+ var Ot = (e, t) => {
909
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return W(e.innerType._def, t);
910
+ let n = W(e.innerType._def, {
911
911
  ...t,
912
912
  currentPath: [
913
913
  ...t.currentPath,
@@ -915,11 +915,11 @@ var kt = (e, t) => {
915
915
  "1"
916
916
  ]
917
917
  });
918
- return n ? { anyOf: [{ not: R() }, n] } : R();
919
- }, At = (e, t) => {
920
- if (t.pipeStrategy === "input") return U(e.in._def, t);
921
- if (t.pipeStrategy === "output") return U(e.out._def, t);
922
- let n = U(e.in._def, {
918
+ return n ? { anyOf: [{ not: z() }, n] } : z();
919
+ }, kt = (e, t) => {
920
+ if (t.pipeStrategy === "input") return W(e.in._def, t);
921
+ if (t.pipeStrategy === "output") return W(e.out._def, t);
922
+ let n = W(e.in._def, {
923
923
  ...t,
924
924
  currentPath: [
925
925
  ...t.currentPath,
@@ -927,7 +927,7 @@ var kt = (e, t) => {
927
927
  "0"
928
928
  ]
929
929
  });
930
- return { allOf: [n, U(e.out._def, {
930
+ return { allOf: [n, W(e.out._def, {
931
931
  ...t,
932
932
  currentPath: [
933
933
  ...t.currentPath,
@@ -936,25 +936,25 @@ var kt = (e, t) => {
936
936
  ]
937
937
  })].filter((e) => e !== void 0) };
938
938
  };
939
- function jt(e, t) {
940
- return U(e.type._def, t);
939
+ function At(e, t) {
940
+ return W(e.type._def, t);
941
941
  }
942
- function Mt(e, t) {
942
+ function jt(e, t) {
943
943
  let n = {
944
944
  type: "array",
945
945
  uniqueItems: !0,
946
- items: U(e.valueType._def, {
946
+ items: W(e.valueType._def, {
947
947
  ...t,
948
948
  currentPath: [...t.currentPath, "items"]
949
949
  })
950
950
  };
951
951
  return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
952
952
  }
953
- function Nt(e, t) {
953
+ function Mt(e, t) {
954
954
  return e.rest ? {
955
955
  type: "array",
956
956
  minItems: e.items.length,
957
- items: e.items.map((e, n) => U(e._def, {
957
+ items: e.items.map((e, n) => W(e._def, {
958
958
  ...t,
959
959
  currentPath: [
960
960
  ...t.currentPath,
@@ -962,7 +962,7 @@ function Nt(e, t) {
962
962
  `${n}`
963
963
  ]
964
964
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
965
- additionalItems: U(e.rest._def, {
965
+ additionalItems: W(e.rest._def, {
966
966
  ...t,
967
967
  currentPath: [...t.currentPath, "additionalItems"]
968
968
  })
@@ -970,7 +970,7 @@ function Nt(e, t) {
970
970
  type: "array",
971
971
  minItems: e.items.length,
972
972
  maxItems: e.items.length,
973
- items: e.items.map((e, n) => U(e._def, {
973
+ items: e.items.map((e, n) => W(e._def, {
974
974
  ...t,
975
975
  currentPath: [
976
976
  ...t.currentPath,
@@ -980,65 +980,65 @@ function Nt(e, t) {
980
980
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
981
981
  };
982
982
  }
983
- function Pt() {
984
- return { not: R() };
983
+ function Nt() {
984
+ return { not: z() };
985
985
  }
986
- function Ft() {
987
- return R();
986
+ function Pt() {
987
+ return z();
988
988
  }
989
- var It = (e, t) => U(e.innerType._def, t), Lt = (e, t, n) => {
989
+ var Ft = (e, t) => W(e.innerType._def, t), It = (e, t, n) => {
990
990
  switch (t) {
991
- case "ZodString": return dt(e, n);
992
- case "ZodNumber": return Tt(e);
993
- case "ZodObject": return Et(e, n);
994
- case "ZodBigInt": return $e(e);
995
- case "ZodBoolean": return et();
996
- case "ZodDate": return rt(e, n);
997
- case "ZodUndefined": return Pt();
998
- case "ZodNull": return bt();
999
- case "ZodArray": return Qe(e, n);
991
+ case "ZodString": return ut(e, n);
992
+ case "ZodNumber": return wt(e);
993
+ case "ZodObject": return Tt(e, n);
994
+ case "ZodBigInt": return Qe(e);
995
+ case "ZodBoolean": return $e();
996
+ case "ZodDate": return nt(e, n);
997
+ case "ZodUndefined": return Nt();
998
+ case "ZodNull": return yt();
999
+ case "ZodArray": return Ze(e, n);
1000
1000
  case "ZodUnion":
1001
- case "ZodDiscriminatedUnion": return St(e, n);
1002
- case "ZodIntersection": return z(e, n);
1003
- case "ZodTuple": return Nt(e, n);
1004
- case "ZodRecord": return gt(e, n);
1005
- case "ZodLiteral": return lt(e);
1006
- case "ZodEnum": return st(e);
1007
- case "ZodNativeEnum": return vt(e);
1008
- case "ZodNullable": return wt(e, n);
1009
- case "ZodOptional": return kt(e, n);
1010
- case "ZodMap": return _t(e, n);
1011
- case "ZodSet": return Mt(e, n);
1001
+ case "ZodDiscriminatedUnion": return xt(e, n);
1002
+ case "ZodIntersection": return B(e, n);
1003
+ case "ZodTuple": return Mt(e, n);
1004
+ case "ZodRecord": return ht(e, n);
1005
+ case "ZodLiteral": return ct(e);
1006
+ case "ZodEnum": return ot(e);
1007
+ case "ZodNativeEnum": return _t(e);
1008
+ case "ZodNullable": return Ct(e, n);
1009
+ case "ZodOptional": return Ot(e, n);
1010
+ case "ZodMap": return gt(e, n);
1011
+ case "ZodSet": return jt(e, n);
1012
1012
  case "ZodLazy": return () => e.getter()._def;
1013
- case "ZodPromise": return jt(e, n);
1013
+ case "ZodPromise": return At(e, n);
1014
1014
  case "ZodNaN":
1015
- case "ZodNever": return yt();
1016
- case "ZodEffects": return ot(e, n);
1017
- case "ZodAny": return R();
1018
- case "ZodUnknown": return Ft();
1019
- case "ZodDefault": return at(e, n);
1020
- case "ZodBranded": return tt(e, n);
1021
- case "ZodReadonly": return It(e, n);
1022
- case "ZodCatch": return nt(e, n);
1023
- case "ZodPipeline": return At(e, n);
1015
+ case "ZodNever": return vt();
1016
+ case "ZodEffects": return at(e, n);
1017
+ case "ZodAny": return z();
1018
+ case "ZodUnknown": return Pt();
1019
+ case "ZodDefault": return it(e, n);
1020
+ case "ZodBranded": return et(e, n);
1021
+ case "ZodReadonly": return Ft(e, n);
1022
+ case "ZodCatch": return tt(e, n);
1023
+ case "ZodPipeline": return kt(e, n);
1024
1024
  case "ZodFunction":
1025
1025
  case "ZodVoid":
1026
1026
  case "ZodSymbol": return;
1027
1027
  default: return /* @__PURE__ */ ((e) => void 0)(t);
1028
1028
  }
1029
- }, Rt = (e, t) => {
1029
+ }, Lt = (e, t) => {
1030
1030
  let n = 0;
1031
1031
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
1032
1032
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
1033
1033
  };
1034
- function U(e, t, n = !1) {
1034
+ function W(e, t, n = !1) {
1035
1035
  let r = t.seen.get(e);
1036
1036
  if (t.override) {
1037
1037
  let i = t.override?.call(t, e, t, r, n);
1038
- if (i !== Ye) return i;
1038
+ if (i !== Je) return i;
1039
1039
  }
1040
1040
  if (r && !n) {
1041
- let e = zt(r, t);
1041
+ let e = Rt(r, t);
1042
1042
  if (e !== void 0) return e;
1043
1043
  }
1044
1044
  let i = {
@@ -1047,22 +1047,22 @@ function U(e, t, n = !1) {
1047
1047
  jsonSchema: void 0
1048
1048
  };
1049
1049
  t.seen.set(e, i);
1050
- let a = Lt(e, e.typeName, t), o = typeof a == "function" ? U(a(), t) : a;
1051
- if (o && Bt(e, t, o), t.postProcess) {
1050
+ let a = It(e, e.typeName, t), o = typeof a == "function" ? W(a(), t) : a;
1051
+ if (o && zt(e, t, o), t.postProcess) {
1052
1052
  let n = t.postProcess(o, e, t);
1053
1053
  return i.jsonSchema = o, n;
1054
1054
  }
1055
1055
  return i.jsonSchema = o, o;
1056
1056
  }
1057
- var zt = (e, t) => {
1057
+ var Rt = (e, t) => {
1058
1058
  switch (t.$refStrategy) {
1059
1059
  case "root": return { $ref: e.path.join("/") };
1060
- case "relative": return { $ref: Rt(t.currentPath, e.path) };
1060
+ case "relative": return { $ref: Lt(t.currentPath, e.path) };
1061
1061
  case "none":
1062
- case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), R()) : t.$refStrategy === "seen" ? R() : void 0;
1062
+ case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), z()) : t.$refStrategy === "seen" ? z() : void 0;
1063
1063
  }
1064
- }, Bt = (e, t, n) => (e.description && (n.description = e.description), n), Vt = (e) => {
1065
- let t = Ze(e), n = t.name === void 0 ? t.basePath : [
1064
+ }, zt = (e, t, n) => (e.description && (n.description = e.description), n), Bt = (e) => {
1065
+ let t = Xe(e), n = t.name === void 0 ? t.basePath : [
1066
1066
  ...t.basePath,
1067
1067
  t.definitionPath,
1068
1068
  t.name
@@ -1081,25 +1081,25 @@ var zt = (e, t) => {
1081
1081
  jsonSchema: void 0
1082
1082
  }]))
1083
1083
  };
1084
- }, Ht = (e, t) => {
1085
- let n = Vt(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1084
+ }, Vt = (e, t) => {
1085
+ let n = Bt(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1086
1086
  ...e,
1087
- [t]: U(r._def, {
1087
+ [t]: W(r._def, {
1088
1088
  ...n,
1089
1089
  currentPath: [
1090
1090
  ...n.basePath,
1091
1091
  n.definitionPath,
1092
1092
  t
1093
1093
  ]
1094
- }, !0) ?? R()
1095
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = U(e._def, i === void 0 ? n : {
1094
+ }, !0) ?? z()
1095
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = W(e._def, i === void 0 ? n : {
1096
1096
  ...n,
1097
1097
  currentPath: [
1098
1098
  ...n.basePath,
1099
1099
  n.definitionPath,
1100
1100
  i
1101
1101
  ]
1102
- }, !1) ?? R(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1102
+ }, !1) ?? z(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1103
1103
  o !== void 0 && (a.title = o);
1104
1104
  let s = i === void 0 ? r ? {
1105
1105
  ...a,
@@ -1116,14 +1116,14 @@ var zt = (e, t) => {
1116
1116
  }
1117
1117
  };
1118
1118
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1119
- }, Ut = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1120
- function Wt(e) {
1119
+ }, Ht = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1120
+ function Ut(e) {
1121
1121
  let t;
1122
1122
  return () => (t ??= e(), t);
1123
1123
  }
1124
- function Gt(e, { validate: t } = {}) {
1124
+ function Wt(e, { validate: t } = {}) {
1125
1125
  return {
1126
- [Ut]: !0,
1126
+ [Ht]: !0,
1127
1127
  _type: void 0,
1128
1128
  get jsonSchema() {
1129
1129
  return typeof e == "function" && (e = e()), e;
@@ -1131,20 +1131,20 @@ function Gt(e, { validate: t } = {}) {
1131
1131
  validate: t
1132
1132
  };
1133
1133
  }
1134
- function Kt(e) {
1135
- return typeof e == "object" && !!e && Ut in e && e[Ut] === !0 && "jsonSchema" in e && "validate" in e;
1134
+ function Gt(e) {
1135
+ return typeof e == "object" && !!e && Ht in e && e[Ht] === !0 && "jsonSchema" in e && "validate" in e;
1136
1136
  }
1137
- function qt(e) {
1138
- return e == null ? Gt({
1137
+ function Kt(e) {
1138
+ return e == null ? Wt({
1139
1139
  type: "object",
1140
1140
  properties: {},
1141
1141
  additionalProperties: !1
1142
- }) : Kt(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? $t(e) : Jt(e) : e();
1142
+ }) : Gt(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? Qt(e) : qt(e) : e();
1143
1143
  }
1144
- function Jt(e) {
1145
- return Gt(() => {
1146
- if (!Yt(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1147
- return Je(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1144
+ function qt(e) {
1145
+ return Wt(() => {
1146
+ if (!Jt(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1147
+ return qe(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1148
1148
  }, { validate: async (t) => {
1149
1149
  let n = await e["~standard"].validate(t);
1150
1150
  return "value" in n ? {
@@ -1152,19 +1152,19 @@ function Jt(e) {
1152
1152
  value: n.value
1153
1153
  } : {
1154
1154
  success: !1,
1155
- error: new k({
1155
+ error: new A({
1156
1156
  value: t,
1157
1157
  cause: n.issues
1158
1158
  })
1159
1159
  };
1160
1160
  } });
1161
1161
  }
1162
- function Yt(e) {
1162
+ function Jt(e) {
1163
1163
  return e["~standard"].jsonSchema != null;
1164
1164
  }
1165
- function Xt(e, t) {
1165
+ function Yt(e, t) {
1166
1166
  let n = t?.useReferences ?? !1;
1167
- return Gt(() => Ht(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1167
+ return Wt(() => Vt(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1168
1168
  let n = await e.safeParseAsync(t);
1169
1169
  return n.success ? {
1170
1170
  success: !0,
@@ -1175,9 +1175,9 @@ function Xt(e, t) {
1175
1175
  };
1176
1176
  } });
1177
1177
  }
1178
- function Zt(t, n) {
1178
+ function Xt(t, n) {
1179
1179
  let r = n?.useReferences ?? !1;
1180
- return Gt(() => Je(_(t, {
1180
+ return Wt(() => qe(_(t, {
1181
1181
  target: "draft-7",
1182
1182
  io: "input",
1183
1183
  reused: r ? "ref" : "inline"
@@ -1192,27 +1192,27 @@ function Zt(t, n) {
1192
1192
  };
1193
1193
  } });
1194
1194
  }
1195
- function Qt(e) {
1195
+ function Zt(e) {
1196
1196
  return "_zod" in e;
1197
1197
  }
1198
- function $t(e, t) {
1199
- return Qt(e) ? Zt(e, t) : Xt(e, t);
1198
+ function Qt(e, t) {
1199
+ return Zt(e) ? Xt(e, t) : Yt(e, t);
1200
1200
  }
1201
- async function en({ value: e, schema: t, context: n }) {
1202
- let r = await tn({
1201
+ async function $t({ value: e, schema: t, context: n }) {
1202
+ let r = await en({
1203
1203
  value: e,
1204
1204
  schema: t,
1205
1205
  context: n
1206
1206
  });
1207
- if (!r.success) throw k.wrap({
1207
+ if (!r.success) throw A.wrap({
1208
1208
  value: e,
1209
1209
  cause: r.error,
1210
1210
  context: n
1211
1211
  });
1212
1212
  return r.value;
1213
1213
  }
1214
- async function tn({ value: e, schema: t, context: n }) {
1215
- let r = qt(t);
1214
+ async function en({ value: e, schema: t, context: n }) {
1215
+ let r = Kt(t);
1216
1216
  try {
1217
1217
  if (r.validate == null) return {
1218
1218
  success: !0,
@@ -1226,7 +1226,7 @@ async function tn({ value: e, schema: t, context: n }) {
1226
1226
  rawValue: e
1227
1227
  } : {
1228
1228
  success: !1,
1229
- error: k.wrap({
1229
+ error: A.wrap({
1230
1230
  value: e,
1231
1231
  cause: t.error,
1232
1232
  context: n
@@ -1236,7 +1236,7 @@ async function tn({ value: e, schema: t, context: n }) {
1236
1236
  } catch (t) {
1237
1237
  return {
1238
1238
  success: !1,
1239
- error: k.wrap({
1239
+ error: A.wrap({
1240
1240
  value: e,
1241
1241
  cause: t,
1242
1242
  context: n
@@ -1245,21 +1245,21 @@ async function tn({ value: e, schema: t, context: n }) {
1245
1245
  };
1246
1246
  }
1247
1247
  }
1248
- async function W({ text: e, schema: t }) {
1248
+ async function G({ text: e, schema: t }) {
1249
1249
  try {
1250
- let n = qe(e);
1250
+ let n = Ke(e);
1251
1251
  return t == null ? {
1252
1252
  success: !0,
1253
1253
  value: n,
1254
1254
  rawValue: n
1255
- } : await tn({
1255
+ } : await en({
1256
1256
  value: n,
1257
1257
  schema: t
1258
1258
  });
1259
1259
  } catch (t) {
1260
1260
  return {
1261
1261
  success: !1,
1262
- error: E.isInstance(t) ? t : new E({
1262
+ error: D.isInstance(t) ? t : new D({
1263
1263
  text: e,
1264
1264
  cause: t
1265
1265
  }),
@@ -1267,46 +1267,56 @@ async function W({ text: e, schema: t }) {
1267
1267
  };
1268
1268
  }
1269
1269
  }
1270
- function nn({ stream: e, schema: t }) {
1271
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new N()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1272
- e !== "[DONE]" && n.enqueue(await W({
1270
+ function tn({ stream: e, schema: t }) {
1271
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new P()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1272
+ e !== "[DONE]" && n.enqueue(await G({
1273
1273
  text: e,
1274
1274
  schema: t
1275
1275
  }));
1276
1276
  } }));
1277
1277
  }
1278
- async function G(e) {
1278
+ async function K(e) {
1279
1279
  return typeof e == "function" && (e = e()), Promise.resolve(e);
1280
1280
  }
1281
1281
  new TextDecoder();
1282
- var rn = Object.defineProperty, an = (e, t) => {
1283
- for (var n in t) rn(e, n, {
1282
+ var nn = Object.defineProperty, rn = (e, t) => {
1283
+ for (var n in t) nn(e, n, {
1284
1284
  get: t[n],
1285
1285
  enumerable: !0
1286
1286
  });
1287
- }, on = "AI_NoObjectGeneratedError", sn = `vercel.ai.error.${on}`, cn = Symbol.for(sn), ln, un, K = class extends (un = C, ln = cn, un) {
1287
+ }, an = "AI_InvalidArgumentError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = C, cn = sn, ln) {
1288
+ constructor({ parameter: e, value: t, message: n }) {
1289
+ super({
1290
+ name: an,
1291
+ message: `Invalid argument for parameter ${e}: ${n}`
1292
+ }), this[cn] = !0, this.parameter = e, this.value = t;
1293
+ }
1294
+ static isInstance(e) {
1295
+ return C.hasMarker(e, on);
1296
+ }
1297
+ }, dn = "AI_NoObjectGeneratedError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, q = class extends (hn = C, mn = pn, hn) {
1288
1298
  constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
1289
1299
  super({
1290
- name: on,
1300
+ name: dn,
1291
1301
  message: e,
1292
1302
  cause: t
1293
- }), this[ln] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1303
+ }), this[mn] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1294
1304
  }
1295
1305
  static isInstance(e) {
1296
- return C.hasMarker(e, sn);
1306
+ return C.hasMarker(e, fn);
1297
1307
  }
1298
- }, dn = "AI_UIMessageStreamError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, q = class extends (hn = C, mn = pn, hn) {
1308
+ }, gn = "AI_UIMessageStreamError", _n = `vercel.ai.error.${gn}`, vn = Symbol.for(_n), yn, bn, J = class extends (bn = C, yn = vn, bn) {
1299
1309
  constructor({ chunkType: e, chunkId: t, message: n }) {
1300
1310
  super({
1301
- name: dn,
1311
+ name: gn,
1302
1312
  message: n
1303
- }), this[mn] = !0, this.chunkType = e, this.chunkId = t;
1313
+ }), this[yn] = !0, this.chunkType = e, this.chunkId = t;
1304
1314
  }
1305
1315
  static isInstance(e) {
1306
- return C.hasMarker(e, fn);
1316
+ return C.hasMarker(e, _n);
1307
1317
  }
1308
1318
  };
1309
- function gn(e, t) {
1319
+ function xn(e, t) {
1310
1320
  if (e === void 0 && t === void 0) return;
1311
1321
  if (e === void 0) return t;
1312
1322
  if (t === void 0) return e;
@@ -1315,11 +1325,11 @@ function gn(e, t) {
1315
1325
  let i = t[r];
1316
1326
  if (i === void 0) continue;
1317
1327
  let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
1318
- n[r] = o && s ? gn(a, i) : i;
1328
+ n[r] = o && s ? xn(a, i) : i;
1319
1329
  }
1320
1330
  return n;
1321
1331
  }
1322
- var J = {
1332
+ var Y = {
1323
1333
  array: n,
1324
1334
  boolean: p,
1325
1335
  custom: i,
@@ -1337,239 +1347,239 @@ var J = {
1337
1347
  string: g,
1338
1348
  union: ee,
1339
1349
  unknown: r
1340
- }, Y = J.lazy(() => J.union([
1341
- J.null(),
1342
- J.string(),
1343
- J.number(),
1344
- J.boolean(),
1345
- J.record(J.string(), Y.optional()),
1346
- J.array(Y)
1347
- ])), X = J.record(J.string(), J.record(J.string(), Y.optional())), _n = J.union([
1348
- J.string(),
1349
- J.instanceof(Uint8Array),
1350
- J.instanceof(ArrayBuffer),
1351
- J.custom(He, { message: "Must be a Buffer" })
1352
- ]), vn = J.record(J.string(), J.string()), yn = J.object({
1353
- type: J.literal("text"),
1354
- text: J.string(),
1355
- providerOptions: X.optional()
1356
- }), bn = J.object({
1357
- type: J.literal("image"),
1358
- image: J.union([
1359
- _n,
1360
- J.instanceof(URL),
1361
- vn
1350
+ }, X = Y.lazy(() => Y.union([
1351
+ Y.null(),
1352
+ Y.string(),
1353
+ Y.number(),
1354
+ Y.boolean(),
1355
+ Y.record(Y.string(), X.optional()),
1356
+ Y.array(X)
1357
+ ])), Z = Y.record(Y.string(), Y.record(Y.string(), X.optional())), Sn = Y.union([
1358
+ Y.string(),
1359
+ Y.instanceof(Uint8Array),
1360
+ Y.instanceof(ArrayBuffer),
1361
+ Y.custom(Ve, { message: "Must be a Buffer" })
1362
+ ]), Cn = Y.record(Y.string(), Y.string()), wn = Y.object({
1363
+ type: Y.literal("text"),
1364
+ text: Y.string(),
1365
+ providerOptions: Z.optional()
1366
+ }), Tn = Y.object({
1367
+ type: Y.literal("image"),
1368
+ image: Y.union([
1369
+ Sn,
1370
+ Y.instanceof(URL),
1371
+ Cn
1362
1372
  ]),
1363
- mediaType: J.string().optional(),
1364
- providerOptions: X.optional()
1365
- }), xn = J.discriminatedUnion("type", [
1366
- J.object({
1367
- type: J.literal("data"),
1368
- data: _n
1373
+ mediaType: Y.string().optional(),
1374
+ providerOptions: Z.optional()
1375
+ }), En = Y.discriminatedUnion("type", [
1376
+ Y.object({
1377
+ type: Y.literal("data"),
1378
+ data: Sn
1369
1379
  }),
1370
- J.object({
1371
- type: J.literal("url"),
1372
- url: J.instanceof(URL)
1380
+ Y.object({
1381
+ type: Y.literal("url"),
1382
+ url: Y.instanceof(URL)
1373
1383
  }),
1374
- J.object({
1375
- type: J.literal("reference"),
1376
- reference: vn
1384
+ Y.object({
1385
+ type: Y.literal("reference"),
1386
+ reference: Cn
1377
1387
  }),
1378
- J.object({
1379
- type: J.literal("text"),
1380
- text: J.string()
1388
+ Y.object({
1389
+ type: Y.literal("text"),
1390
+ text: Y.string()
1381
1391
  })
1382
- ]), Sn = J.discriminatedUnion("type", [J.object({
1383
- type: J.literal("data"),
1384
- data: _n
1385
- }), J.object({
1386
- type: J.literal("url"),
1387
- url: J.instanceof(URL)
1388
- })]), Cn = J.object({
1389
- type: J.literal("file"),
1390
- data: J.union([
1391
- xn,
1392
- _n,
1393
- J.instanceof(URL),
1394
- vn
1392
+ ]), Dn = Y.discriminatedUnion("type", [Y.object({
1393
+ type: Y.literal("data"),
1394
+ data: Sn
1395
+ }), Y.object({
1396
+ type: Y.literal("url"),
1397
+ url: Y.instanceof(URL)
1398
+ })]), On = Y.object({
1399
+ type: Y.literal("file"),
1400
+ data: Y.union([
1401
+ En,
1402
+ Sn,
1403
+ Y.instanceof(URL),
1404
+ Cn
1395
1405
  ]),
1396
- filename: J.string().optional(),
1397
- mediaType: J.string(),
1398
- providerOptions: X.optional()
1399
- }), wn = J.object({
1400
- type: J.literal("reasoning"),
1401
- text: J.string(),
1402
- providerOptions: X.optional()
1403
- }), Tn = J.object({
1404
- type: J.literal("custom"),
1405
- kind: J.string().transform((e) => e),
1406
- providerOptions: X.optional()
1407
- }), En = J.object({
1408
- type: J.literal("reasoning-file"),
1409
- data: J.union([
1406
+ filename: Y.string().optional(),
1407
+ mediaType: Y.string(),
1408
+ providerOptions: Z.optional()
1409
+ }), kn = Y.object({
1410
+ type: Y.literal("reasoning"),
1411
+ text: Y.string(),
1412
+ providerOptions: Z.optional()
1413
+ }), An = Y.object({
1414
+ type: Y.literal("custom"),
1415
+ kind: Y.string().transform((e) => e),
1416
+ providerOptions: Z.optional()
1417
+ }), jn = Y.object({
1418
+ type: Y.literal("reasoning-file"),
1419
+ data: Y.union([
1420
+ Dn,
1410
1421
  Sn,
1411
- _n,
1412
- J.instanceof(URL)
1422
+ Y.instanceof(URL)
1413
1423
  ]),
1414
- mediaType: J.string(),
1415
- providerOptions: X.optional()
1416
- }), Dn = J.object({
1417
- type: J.literal("tool-call"),
1418
- toolCallId: J.string(),
1419
- toolName: J.string(),
1420
- input: J.unknown(),
1421
- providerOptions: X.optional(),
1422
- providerExecuted: J.boolean().optional()
1423
- }), On = J.discriminatedUnion("type", [
1424
- J.object({
1425
- type: J.literal("text"),
1426
- value: J.string(),
1427
- providerOptions: X.optional()
1424
+ mediaType: Y.string(),
1425
+ providerOptions: Z.optional()
1426
+ }), Mn = Y.object({
1427
+ type: Y.literal("tool-call"),
1428
+ toolCallId: Y.string(),
1429
+ toolName: Y.string(),
1430
+ input: Y.unknown(),
1431
+ providerOptions: Z.optional(),
1432
+ providerExecuted: Y.boolean().optional()
1433
+ }), Nn = Y.discriminatedUnion("type", [
1434
+ Y.object({
1435
+ type: Y.literal("text"),
1436
+ value: Y.string(),
1437
+ providerOptions: Z.optional()
1428
1438
  }),
1429
- J.object({
1430
- type: J.literal("json"),
1431
- value: Y,
1432
- providerOptions: X.optional()
1439
+ Y.object({
1440
+ type: Y.literal("json"),
1441
+ value: X,
1442
+ providerOptions: Z.optional()
1433
1443
  }),
1434
- J.object({
1435
- type: J.literal("execution-denied"),
1436
- reason: J.string().optional(),
1437
- providerOptions: X.optional()
1444
+ Y.object({
1445
+ type: Y.literal("execution-denied"),
1446
+ reason: Y.string().optional(),
1447
+ providerOptions: Z.optional()
1438
1448
  }),
1439
- J.object({
1440
- type: J.literal("error-text"),
1441
- value: J.string(),
1442
- providerOptions: X.optional()
1449
+ Y.object({
1450
+ type: Y.literal("error-text"),
1451
+ value: Y.string(),
1452
+ providerOptions: Z.optional()
1443
1453
  }),
1444
- J.object({
1445
- type: J.literal("error-json"),
1446
- value: Y,
1447
- providerOptions: X.optional()
1454
+ Y.object({
1455
+ type: Y.literal("error-json"),
1456
+ value: X,
1457
+ providerOptions: Z.optional()
1448
1458
  }),
1449
- J.object({
1450
- type: J.literal("content"),
1451
- value: J.array(J.union([
1452
- J.object({
1453
- type: J.literal("text"),
1454
- text: J.string(),
1455
- providerOptions: X.optional()
1459
+ Y.object({
1460
+ type: Y.literal("content"),
1461
+ value: Y.array(Y.union([
1462
+ Y.object({
1463
+ type: Y.literal("text"),
1464
+ text: Y.string(),
1465
+ providerOptions: Z.optional()
1456
1466
  }),
1457
- J.object({
1458
- type: J.literal("file"),
1459
- data: xn,
1460
- mediaType: J.string(),
1461
- filename: J.string().optional(),
1462
- providerOptions: X.optional()
1467
+ Y.object({
1468
+ type: Y.literal("file"),
1469
+ data: En,
1470
+ mediaType: Y.string(),
1471
+ filename: Y.string().optional(),
1472
+ providerOptions: Z.optional()
1463
1473
  }),
1464
- J.object({
1465
- type: J.literal("file-data"),
1466
- data: J.string(),
1467
- mediaType: J.string(),
1468
- filename: J.string().optional(),
1469
- providerOptions: X.optional()
1474
+ Y.object({
1475
+ type: Y.literal("file-data"),
1476
+ data: Y.string(),
1477
+ mediaType: Y.string(),
1478
+ filename: Y.string().optional(),
1479
+ providerOptions: Z.optional()
1470
1480
  }),
1471
- J.object({
1472
- type: J.literal("file-url"),
1473
- url: J.string(),
1474
- mediaType: J.string().optional(),
1475
- providerOptions: X.optional()
1481
+ Y.object({
1482
+ type: Y.literal("file-url"),
1483
+ url: Y.string(),
1484
+ mediaType: Y.string().optional(),
1485
+ providerOptions: Z.optional()
1476
1486
  }),
1477
- J.object({
1478
- type: J.literal("file-id"),
1479
- fileId: J.union([J.string(), J.record(J.string(), J.string())]),
1480
- providerOptions: X.optional()
1487
+ Y.object({
1488
+ type: Y.literal("file-id"),
1489
+ fileId: Y.union([Y.string(), Y.record(Y.string(), Y.string())]),
1490
+ providerOptions: Z.optional()
1481
1491
  }),
1482
- J.object({
1483
- type: J.literal("file-reference"),
1484
- providerReference: J.record(J.string(), J.string()),
1485
- providerOptions: X.optional()
1492
+ Y.object({
1493
+ type: Y.literal("file-reference"),
1494
+ providerReference: Y.record(Y.string(), Y.string()),
1495
+ providerOptions: Z.optional()
1486
1496
  }),
1487
- J.object({
1488
- type: J.literal("image-data"),
1489
- data: J.string(),
1490
- mediaType: J.string(),
1491
- providerOptions: X.optional()
1497
+ Y.object({
1498
+ type: Y.literal("image-data"),
1499
+ data: Y.string(),
1500
+ mediaType: Y.string(),
1501
+ providerOptions: Z.optional()
1492
1502
  }),
1493
- J.object({
1494
- type: J.literal("image-url"),
1495
- url: J.string(),
1496
- providerOptions: X.optional()
1503
+ Y.object({
1504
+ type: Y.literal("image-url"),
1505
+ url: Y.string(),
1506
+ providerOptions: Z.optional()
1497
1507
  }),
1498
- J.object({
1499
- type: J.literal("image-file-id"),
1500
- fileId: J.union([J.string(), J.record(J.string(), J.string())]),
1501
- providerOptions: X.optional()
1508
+ Y.object({
1509
+ type: Y.literal("image-file-id"),
1510
+ fileId: Y.union([Y.string(), Y.record(Y.string(), Y.string())]),
1511
+ providerOptions: Z.optional()
1502
1512
  }),
1503
- J.object({
1504
- type: J.literal("image-file-reference"),
1505
- providerReference: J.record(J.string(), J.string()),
1506
- providerOptions: X.optional()
1513
+ Y.object({
1514
+ type: Y.literal("image-file-reference"),
1515
+ providerReference: Y.record(Y.string(), Y.string()),
1516
+ providerOptions: Z.optional()
1507
1517
  }),
1508
- J.object({
1509
- type: J.literal("custom"),
1510
- providerOptions: X.optional()
1518
+ Y.object({
1519
+ type: Y.literal("custom"),
1520
+ providerOptions: Z.optional()
1511
1521
  })
1512
1522
  ]))
1513
1523
  })
1514
- ]), kn = J.object({
1515
- type: J.literal("tool-result"),
1516
- toolCallId: J.string(),
1517
- toolName: J.string(),
1518
- output: On,
1519
- providerOptions: X.optional()
1520
- }), An = J.object({
1521
- type: J.literal("tool-approval-request"),
1522
- approvalId: J.string(),
1523
- toolCallId: J.string(),
1524
- reason: J.string().optional()
1525
- }), jn = J.object({
1526
- type: J.literal("tool-approval-response"),
1527
- approvalId: J.string(),
1528
- approved: J.boolean(),
1529
- reason: J.string().optional()
1530
- }), Mn = J.object({
1531
- role: J.literal("system"),
1532
- content: J.string(),
1533
- providerOptions: X.optional()
1534
- }), Nn = J.object({
1535
- role: J.literal("user"),
1536
- content: J.union([J.string(), J.array(J.union([
1537
- yn,
1538
- bn,
1539
- Cn
1540
- ]))]),
1541
- providerOptions: X.optional()
1542
- }), Pn = J.object({
1543
- role: J.literal("assistant"),
1544
- content: J.union([J.string(), J.array(J.union([
1545
- yn,
1524
+ ]), Pn = Y.object({
1525
+ type: Y.literal("tool-result"),
1526
+ toolCallId: Y.string(),
1527
+ toolName: Y.string(),
1528
+ output: Nn,
1529
+ providerOptions: Z.optional()
1530
+ }), Fn = Y.object({
1531
+ type: Y.literal("tool-approval-request"),
1532
+ approvalId: Y.string(),
1533
+ toolCallId: Y.string(),
1534
+ reason: Y.string().optional()
1535
+ }), In = Y.object({
1536
+ type: Y.literal("tool-approval-response"),
1537
+ approvalId: Y.string(),
1538
+ approved: Y.boolean(),
1539
+ reason: Y.string().optional()
1540
+ }), Ln = Y.object({
1541
+ role: Y.literal("system"),
1542
+ content: Y.string(),
1543
+ providerOptions: Z.optional()
1544
+ }), Rn = Y.object({
1545
+ role: Y.literal("user"),
1546
+ content: Y.union([Y.string(), Y.array(Y.union([
1547
+ wn,
1546
1548
  Tn,
1547
- Cn,
1549
+ On
1550
+ ]))]),
1551
+ providerOptions: Z.optional()
1552
+ }), zn = Y.object({
1553
+ role: Y.literal("assistant"),
1554
+ content: Y.union([Y.string(), Y.array(Y.union([
1548
1555
  wn,
1549
- En,
1550
- Dn,
1556
+ An,
1557
+ On,
1551
1558
  kn,
1552
- An
1559
+ jn,
1560
+ Mn,
1561
+ Pn,
1562
+ Fn
1553
1563
  ]))]),
1554
- providerOptions: X.optional()
1555
- }), Fn = J.object({
1556
- role: J.literal("tool"),
1557
- content: J.array(J.union([kn, jn])),
1558
- providerOptions: X.optional()
1564
+ providerOptions: Z.optional()
1565
+ }), Bn = Y.object({
1566
+ role: Y.literal("tool"),
1567
+ content: Y.array(Y.union([Pn, In])),
1568
+ providerOptions: Z.optional()
1559
1569
  });
1560
- J.union([
1561
- Mn,
1562
- Nn,
1563
- Pn,
1564
- Fn
1565
- ]), an({}, {
1566
- array: () => Bn,
1567
- choice: () => Vn,
1568
- json: () => Hn,
1569
- object: () => zn,
1570
- text: () => Rn
1570
+ Y.union([
1571
+ Ln,
1572
+ Rn,
1573
+ zn,
1574
+ Bn
1575
+ ]), rn({}, {
1576
+ array: () => Gn,
1577
+ choice: () => Jn,
1578
+ json: () => Yn,
1579
+ object: () => Wn,
1580
+ text: () => Un
1571
1581
  });
1572
- function In(e) {
1582
+ function Vn(e) {
1573
1583
  let t = ["ROOT"], n = -1, r = null, i = 0;
1574
1584
  function a(e) {
1575
1585
  return e >= "0" && e <= "9" || e >= "A" && e <= "F" || e >= "a" && e <= "f";
@@ -1751,16 +1761,16 @@ function In(e) {
1751
1761
  }
1752
1762
  return l;
1753
1763
  }
1754
- async function Ln(e) {
1764
+ async function Hn(e) {
1755
1765
  if (e === void 0) return {
1756
1766
  value: void 0,
1757
1767
  state: "undefined-input"
1758
1768
  };
1759
- let t = await W({ text: e });
1769
+ let t = await G({ text: e });
1760
1770
  return t.success ? {
1761
1771
  value: t.value,
1762
1772
  state: "successful-parse"
1763
- } : (t = await W({ text: In(e) }), t.success ? {
1773
+ } : (t = await G({ text: Vn(e) }), t.success ? {
1764
1774
  value: t.value,
1765
1775
  state: "repaired-parse"
1766
1776
  } : {
@@ -1768,7 +1778,7 @@ async function Ln(e) {
1768
1778
  state: "failed-parse"
1769
1779
  });
1770
1780
  }
1771
- var Rn = () => ({
1781
+ var Un = () => ({
1772
1782
  name: "text",
1773
1783
  responseFormat: Promise.resolve({ type: "text" }),
1774
1784
  async parseCompleteOutput({ text: e }) {
@@ -1778,19 +1788,19 @@ var Rn = () => ({
1778
1788
  return { partial: e };
1779
1789
  },
1780
1790
  createElementStreamTransform() {}
1781
- }), zn = ({ schema: e, name: t, description: n }) => {
1782
- let r = qt(e);
1791
+ }), Wn = ({ schema: e, name: t, description: n }) => {
1792
+ let r = Kt(e);
1783
1793
  return {
1784
1794
  name: "object",
1785
- responseFormat: G(r.jsonSchema).then((e) => ({
1795
+ responseFormat: K(r.jsonSchema).then((e) => ({
1786
1796
  type: "json",
1787
1797
  schema: e,
1788
1798
  ...t != null && { name: t },
1789
1799
  ...n != null && { description: n }
1790
1800
  })),
1791
1801
  async parseCompleteOutput({ text: e }, t) {
1792
- let n = await W({ text: e });
1793
- if (!n.success) throw new K({
1802
+ let n = await G({ text: e });
1803
+ if (!n.success) throw new q({
1794
1804
  message: "No object generated: could not parse the response.",
1795
1805
  cause: n.error,
1796
1806
  text: e,
@@ -1798,11 +1808,11 @@ var Rn = () => ({
1798
1808
  usage: t.usage,
1799
1809
  finishReason: t.finishReason
1800
1810
  });
1801
- let i = await tn({
1811
+ let i = await en({
1802
1812
  value: n.value,
1803
1813
  schema: r
1804
1814
  });
1805
- if (!i.success) throw new K({
1815
+ if (!i.success) throw new q({
1806
1816
  message: "No object generated: response did not match schema.",
1807
1817
  cause: i.error,
1808
1818
  text: e,
@@ -1813,7 +1823,7 @@ var Rn = () => ({
1813
1823
  return i.value;
1814
1824
  },
1815
1825
  async parsePartialOutput({ text: e }) {
1816
- let t = await Ln(e);
1826
+ let t = await Hn(e);
1817
1827
  switch (t.state) {
1818
1828
  case "failed-parse":
1819
1829
  case "undefined-input": return;
@@ -1823,72 +1833,98 @@ var Rn = () => ({
1823
1833
  },
1824
1834
  createElementStreamTransform() {}
1825
1835
  };
1826
- }, Bn = ({ element: e, name: t, description: n }) => {
1827
- let r = qt(e);
1836
+ }, Gn = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1837
+ if (Kn({
1838
+ name: "minItems",
1839
+ value: t
1840
+ }), Kn({
1841
+ name: "maxItems",
1842
+ value: n
1843
+ }), t != null && n != null && t > n) throw new un({
1844
+ parameter: "minItems",
1845
+ value: t,
1846
+ message: "minItems must be less than or equal to maxItems"
1847
+ });
1848
+ let a = Kt(e);
1828
1849
  return {
1829
1850
  name: "array",
1830
- responseFormat: G(r.jsonSchema).then((e) => {
1831
- let { $schema: r, definitions: i, $defs: a, ...o } = e;
1851
+ responseFormat: K(a.jsonSchema).then((e) => {
1852
+ let { $schema: a, definitions: o, $defs: s, ...c } = e;
1832
1853
  return {
1833
1854
  type: "json",
1834
1855
  schema: {
1835
1856
  $schema: "http://json-schema.org/draft-07/schema#",
1836
- ...i != null && { definitions: i },
1837
- ...a != null && { $defs: a },
1857
+ ...o != null && { definitions: o },
1858
+ ...s != null && { $defs: s },
1838
1859
  type: "object",
1839
1860
  properties: { elements: {
1840
1861
  type: "array",
1841
- items: o
1862
+ items: c,
1863
+ ...t != null && { minItems: t },
1864
+ ...n != null && { maxItems: n }
1842
1865
  } },
1843
1866
  required: ["elements"],
1844
1867
  additionalProperties: !1
1845
1868
  },
1846
- ...t != null && { name: t },
1847
- ...n != null && { description: n }
1869
+ ...r != null && { name: r },
1870
+ ...i != null && { description: i }
1848
1871
  };
1849
1872
  }),
1850
- async parseCompleteOutput({ text: e }, t) {
1851
- let n = await W({ text: e });
1852
- if (!n.success) throw new K({
1873
+ async parseCompleteOutput({ text: e }, r) {
1874
+ let i = await G({ text: e });
1875
+ if (!i.success) throw new q({
1853
1876
  message: "No object generated: could not parse the response.",
1854
- cause: n.error,
1877
+ cause: i.error,
1855
1878
  text: e,
1856
- response: t.response,
1857
- usage: t.usage,
1858
- finishReason: t.finishReason
1879
+ response: r.response,
1880
+ usage: r.usage,
1881
+ finishReason: r.finishReason
1859
1882
  });
1860
- let i = n.value;
1861
- if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new K({
1883
+ let o = i.value;
1884
+ if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new q({
1862
1885
  message: "No object generated: response did not match schema.",
1863
- cause: new k({
1864
- value: i,
1886
+ cause: new A({
1887
+ value: o,
1865
1888
  cause: "response must be an object with an elements array"
1866
1889
  }),
1867
1890
  text: e,
1868
- response: t.response,
1869
- usage: t.usage,
1870
- finishReason: t.finishReason
1891
+ response: r.response,
1892
+ usage: r.usage,
1893
+ finishReason: r.finishReason
1871
1894
  });
1872
- let a = [];
1873
- for (let n of i.elements) {
1874
- let i = await tn({
1875
- value: n,
1876
- schema: r
1895
+ let s = qn({
1896
+ value: o.elements,
1897
+ minItems: t,
1898
+ maxItems: n
1899
+ });
1900
+ if (s != null) throw new q({
1901
+ message: "No object generated: response did not match schema.",
1902
+ cause: s,
1903
+ text: e,
1904
+ response: r.response,
1905
+ usage: r.usage,
1906
+ finishReason: r.finishReason
1907
+ });
1908
+ let c = [];
1909
+ for (let t of o.elements) {
1910
+ let n = await en({
1911
+ value: t,
1912
+ schema: a
1877
1913
  });
1878
- if (!i.success) throw new K({
1914
+ if (!n.success) throw new q({
1879
1915
  message: "No object generated: response did not match schema.",
1880
- cause: i.error,
1916
+ cause: n.error,
1881
1917
  text: e,
1882
- response: t.response,
1883
- usage: t.usage,
1884
- finishReason: t.finishReason
1918
+ response: r.response,
1919
+ usage: r.usage,
1920
+ finishReason: r.finishReason
1885
1921
  });
1886
- a.push(i.value);
1922
+ c.push(n.value);
1887
1923
  }
1888
- return a;
1924
+ return c;
1889
1925
  },
1890
1926
  async parsePartialOutput({ text: e }) {
1891
- let t = await Ln(e);
1927
+ let t = await Hn(e);
1892
1928
  switch (t.state) {
1893
1929
  case "failed-parse":
1894
1930
  case "undefined-input": return;
@@ -1896,26 +1932,60 @@ var Rn = () => ({
1896
1932
  case "successful-parse": {
1897
1933
  let e = t.value;
1898
1934
  if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
1899
- let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, i = [];
1935
+ let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, r = [];
1900
1936
  for (let e of n) {
1901
- let t = await tn({
1937
+ let t = await en({
1902
1938
  value: e,
1903
- schema: r
1939
+ schema: a
1904
1940
  });
1905
- t.success && i.push(t.value);
1941
+ t.success && r.push(t.value);
1906
1942
  }
1907
- return { partial: i };
1943
+ return { partial: r };
1908
1944
  }
1909
1945
  }
1910
1946
  },
1911
1947
  createElementStreamTransform() {
1912
1948
  let e = 0;
1913
- return new TransformStream({ transform({ partialOutput: t }, n) {
1914
- if (t != null) for (; e < t.length; e++) n.enqueue(t[e]);
1949
+ return new TransformStream({ transform({ partialOutput: t }, r) {
1950
+ if (t != null) for (; e < t.length; e++) {
1951
+ if (n != null && e >= n) {
1952
+ r.error(qn({
1953
+ value: t,
1954
+ maxItems: n
1955
+ }));
1956
+ return;
1957
+ }
1958
+ r.enqueue(t[e]);
1959
+ }
1915
1960
  } });
1916
1961
  }
1917
1962
  };
1918
- }, Vn = ({ options: e, name: t, description: n }) => ({
1963
+ };
1964
+ function Kn({ name: e, value: t }) {
1965
+ if (t != null) {
1966
+ if (!Number.isInteger(t)) throw new un({
1967
+ parameter: e,
1968
+ value: t,
1969
+ message: `${e} must be an integer`
1970
+ });
1971
+ if (t < 0) throw new un({
1972
+ parameter: e,
1973
+ value: t,
1974
+ message: `${e} must be greater than or equal to 0`
1975
+ });
1976
+ }
1977
+ }
1978
+ function qn({ value: e, minItems: t, maxItems: n }) {
1979
+ if (t != null && e.length < t) return new A({
1980
+ value: e,
1981
+ cause: `elements array must contain at least ${t} items`
1982
+ });
1983
+ if (n != null && e.length > n) return new A({
1984
+ value: e,
1985
+ cause: `elements array must contain at most ${n} items`
1986
+ });
1987
+ }
1988
+ var Jn = ({ options: e, name: t, description: n }) => ({
1919
1989
  name: "choice",
1920
1990
  responseFormat: Promise.resolve({
1921
1991
  type: "json",
@@ -1933,8 +2003,8 @@ var Rn = () => ({
1933
2003
  ...n != null && { description: n }
1934
2004
  }),
1935
2005
  async parseCompleteOutput({ text: t }, n) {
1936
- let r = await W({ text: t });
1937
- if (!r.success) throw new K({
2006
+ let r = await G({ text: t });
2007
+ if (!r.success) throw new q({
1938
2008
  message: "No object generated: could not parse the response.",
1939
2009
  cause: r.error,
1940
2010
  text: t,
@@ -1943,9 +2013,9 @@ var Rn = () => ({
1943
2013
  finishReason: n.finishReason
1944
2014
  });
1945
2015
  let i = r.value;
1946
- if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new K({
2016
+ if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new q({
1947
2017
  message: "No object generated: response did not match schema.",
1948
- cause: new k({
2018
+ cause: new A({
1949
2019
  value: i,
1950
2020
  cause: "response must be an object that contains a choice value."
1951
2021
  }),
@@ -1957,7 +2027,7 @@ var Rn = () => ({
1957
2027
  return i.result;
1958
2028
  },
1959
2029
  async parsePartialOutput({ text: t }) {
1960
- let n = await Ln(t);
2030
+ let n = await Hn(t);
1961
2031
  switch (n.state) {
1962
2032
  case "failed-parse":
1963
2033
  case "undefined-input": return;
@@ -1971,7 +2041,7 @@ var Rn = () => ({
1971
2041
  }
1972
2042
  },
1973
2043
  createElementStreamTransform() {}
1974
- }), Hn = ({ name: e, description: t } = {}) => ({
2044
+ }), Yn = ({ name: e, description: t } = {}) => ({
1975
2045
  name: "json",
1976
2046
  responseFormat: Promise.resolve({
1977
2047
  type: "json",
@@ -1979,8 +2049,8 @@ var Rn = () => ({
1979
2049
  ...t != null && { description: t }
1980
2050
  }),
1981
2051
  async parseCompleteOutput({ text: e }, t) {
1982
- let n = await W({ text: e });
1983
- if (!n.success) throw new K({
2052
+ let n = await G({ text: e });
2053
+ if (!n.success) throw new q({
1984
2054
  message: "No object generated: could not parse the response.",
1985
2055
  cause: n.error,
1986
2056
  text: e,
@@ -1991,7 +2061,7 @@ var Rn = () => ({
1991
2061
  return n.value;
1992
2062
  },
1993
2063
  async parsePartialOutput({ text: e }) {
1994
- let t = await Ln(e);
2064
+ let t = await Hn(e);
1995
2065
  switch (t.state) {
1996
2066
  case "failed-parse":
1997
2067
  case "undefined-input": return;
@@ -2001,177 +2071,177 @@ var Rn = () => ({
2001
2071
  },
2002
2072
  createElementStreamTransform() {}
2003
2073
  });
2004
- new TextEncoder(), new TextEncoder(), F({
2074
+ new TextEncoder(), new TextEncoder(), I({
2005
2075
  prefix: "aitxt",
2006
2076
  size: 24
2007
- }), F({
2077
+ }), I({
2008
2078
  prefix: "call",
2009
2079
  size: 24
2010
2080
  }), TransformStream;
2011
- var Un = J.record(J.string(), Y.optional()), Wn = Wt(() => $t(J.union([
2012
- J.looseObject({
2013
- type: J.literal("text-start"),
2014
- id: J.string(),
2015
- providerMetadata: X.optional()
2081
+ var Xn = Y.record(Y.string(), X.optional()), Zn = Ut(() => Qt(Y.union([
2082
+ Y.looseObject({
2083
+ type: Y.literal("text-start"),
2084
+ id: Y.string(),
2085
+ providerMetadata: Z.optional()
2016
2086
  }),
2017
- J.looseObject({
2018
- type: J.literal("text-delta"),
2019
- id: J.string(),
2020
- delta: J.string(),
2021
- providerMetadata: X.optional()
2087
+ Y.looseObject({
2088
+ type: Y.literal("text-delta"),
2089
+ id: Y.string(),
2090
+ delta: Y.string(),
2091
+ providerMetadata: Z.optional()
2022
2092
  }),
2023
- J.looseObject({
2024
- type: J.literal("text-end"),
2025
- id: J.string(),
2026
- providerMetadata: X.optional()
2093
+ Y.looseObject({
2094
+ type: Y.literal("text-end"),
2095
+ id: Y.string(),
2096
+ providerMetadata: Z.optional()
2027
2097
  }),
2028
- J.looseObject({
2029
- type: J.literal("error"),
2030
- errorText: J.string()
2098
+ Y.looseObject({
2099
+ type: Y.literal("error"),
2100
+ errorText: Y.string()
2031
2101
  }),
2032
- J.looseObject({
2033
- type: J.literal("tool-input-start"),
2034
- toolCallId: J.string(),
2035
- toolName: J.string(),
2036
- providerExecuted: J.boolean().optional(),
2037
- providerMetadata: X.optional(),
2038
- toolMetadata: Un.optional(),
2039
- dynamic: J.boolean().optional(),
2040
- title: J.string().optional()
2102
+ Y.looseObject({
2103
+ type: Y.literal("tool-input-start"),
2104
+ toolCallId: Y.string(),
2105
+ toolName: Y.string(),
2106
+ providerExecuted: Y.boolean().optional(),
2107
+ providerMetadata: Z.optional(),
2108
+ toolMetadata: Xn.optional(),
2109
+ dynamic: Y.boolean().optional(),
2110
+ title: Y.string().optional()
2041
2111
  }),
2042
- J.looseObject({
2043
- type: J.literal("tool-input-delta"),
2044
- toolCallId: J.string(),
2045
- inputTextDelta: J.string()
2112
+ Y.looseObject({
2113
+ type: Y.literal("tool-input-delta"),
2114
+ toolCallId: Y.string(),
2115
+ inputTextDelta: Y.string()
2046
2116
  }),
2047
- J.looseObject({
2048
- type: J.literal("tool-input-available"),
2049
- toolCallId: J.string(),
2050
- toolName: J.string(),
2051
- input: J.unknown(),
2052
- providerExecuted: J.boolean().optional(),
2053
- providerMetadata: X.optional(),
2054
- toolMetadata: Un.optional(),
2055
- dynamic: J.boolean().optional(),
2056
- title: J.string().optional()
2117
+ Y.looseObject({
2118
+ type: Y.literal("tool-input-available"),
2119
+ toolCallId: Y.string(),
2120
+ toolName: Y.string(),
2121
+ input: Y.unknown(),
2122
+ providerExecuted: Y.boolean().optional(),
2123
+ providerMetadata: Z.optional(),
2124
+ toolMetadata: Xn.optional(),
2125
+ dynamic: Y.boolean().optional(),
2126
+ title: Y.string().optional()
2057
2127
  }),
2058
- J.looseObject({
2059
- type: J.literal("tool-input-error"),
2060
- toolCallId: J.string(),
2061
- toolName: J.string(),
2062
- input: J.unknown(),
2063
- providerExecuted: J.boolean().optional(),
2064
- providerMetadata: X.optional(),
2065
- toolMetadata: Un.optional(),
2066
- dynamic: J.boolean().optional(),
2067
- errorText: J.string(),
2068
- title: J.string().optional()
2128
+ Y.looseObject({
2129
+ type: Y.literal("tool-input-error"),
2130
+ toolCallId: Y.string(),
2131
+ toolName: Y.string(),
2132
+ input: Y.unknown(),
2133
+ providerExecuted: Y.boolean().optional(),
2134
+ providerMetadata: Z.optional(),
2135
+ toolMetadata: Xn.optional(),
2136
+ dynamic: Y.boolean().optional(),
2137
+ errorText: Y.string(),
2138
+ title: Y.string().optional()
2069
2139
  }),
2070
- J.looseObject({
2071
- type: J.literal("tool-approval-request"),
2072
- approvalId: J.string(),
2073
- toolCallId: J.string(),
2074
- approvalDescriptor: J.unknown().optional(),
2075
- reason: J.string().optional(),
2076
- isAutomatic: J.boolean().optional(),
2077
- signature: J.string().optional()
2140
+ Y.looseObject({
2141
+ type: Y.literal("tool-approval-request"),
2142
+ approvalId: Y.string(),
2143
+ toolCallId: Y.string(),
2144
+ approvalDescriptor: Y.unknown().optional(),
2145
+ reason: Y.string().optional(),
2146
+ isAutomatic: Y.boolean().optional(),
2147
+ signature: Y.string().optional()
2078
2148
  }),
2079
- J.looseObject({
2080
- type: J.literal("tool-approval-response"),
2081
- approvalId: J.string(),
2082
- approved: J.boolean(),
2083
- reason: J.string().optional(),
2084
- providerExecuted: J.boolean().optional(),
2085
- providerMetadata: X.optional()
2149
+ Y.looseObject({
2150
+ type: Y.literal("tool-approval-response"),
2151
+ approvalId: Y.string(),
2152
+ approved: Y.boolean(),
2153
+ reason: Y.string().optional(),
2154
+ providerExecuted: Y.boolean().optional(),
2155
+ providerMetadata: Z.optional()
2086
2156
  }),
2087
- J.looseObject({
2088
- type: J.literal("tool-output-available"),
2089
- toolCallId: J.string(),
2090
- output: J.unknown(),
2091
- providerExecuted: J.boolean().optional(),
2092
- providerMetadata: X.optional(),
2093
- toolMetadata: Un.optional(),
2094
- dynamic: J.boolean().optional(),
2095
- preliminary: J.boolean().optional()
2157
+ Y.looseObject({
2158
+ type: Y.literal("tool-output-available"),
2159
+ toolCallId: Y.string(),
2160
+ output: Y.unknown(),
2161
+ providerExecuted: Y.boolean().optional(),
2162
+ providerMetadata: Z.optional(),
2163
+ toolMetadata: Xn.optional(),
2164
+ dynamic: Y.boolean().optional(),
2165
+ preliminary: Y.boolean().optional()
2096
2166
  }),
2097
- J.looseObject({
2098
- type: J.literal("tool-output-error"),
2099
- toolCallId: J.string(),
2100
- errorText: J.string(),
2101
- providerExecuted: J.boolean().optional(),
2102
- providerMetadata: X.optional(),
2103
- toolMetadata: Un.optional(),
2104
- dynamic: J.boolean().optional()
2167
+ Y.looseObject({
2168
+ type: Y.literal("tool-output-error"),
2169
+ toolCallId: Y.string(),
2170
+ errorText: Y.string(),
2171
+ providerExecuted: Y.boolean().optional(),
2172
+ providerMetadata: Z.optional(),
2173
+ toolMetadata: Xn.optional(),
2174
+ dynamic: Y.boolean().optional()
2105
2175
  }),
2106
- J.looseObject({
2107
- type: J.literal("tool-output-denied"),
2108
- toolCallId: J.string()
2176
+ Y.looseObject({
2177
+ type: Y.literal("tool-output-denied"),
2178
+ toolCallId: Y.string()
2109
2179
  }),
2110
- J.looseObject({
2111
- type: J.literal("reasoning-start"),
2112
- id: J.string(),
2113
- providerMetadata: X.optional()
2180
+ Y.looseObject({
2181
+ type: Y.literal("reasoning-start"),
2182
+ id: Y.string(),
2183
+ providerMetadata: Z.optional()
2114
2184
  }),
2115
- J.looseObject({
2116
- type: J.literal("reasoning-delta"),
2117
- id: J.string(),
2118
- delta: J.string(),
2119
- providerMetadata: X.optional()
2185
+ Y.looseObject({
2186
+ type: Y.literal("reasoning-delta"),
2187
+ id: Y.string(),
2188
+ delta: Y.string(),
2189
+ providerMetadata: Z.optional()
2120
2190
  }),
2121
- J.looseObject({
2122
- type: J.literal("reasoning-end"),
2123
- id: J.string(),
2124
- providerMetadata: X.optional()
2191
+ Y.looseObject({
2192
+ type: Y.literal("reasoning-end"),
2193
+ id: Y.string(),
2194
+ providerMetadata: Z.optional()
2125
2195
  }),
2126
- J.looseObject({
2127
- type: J.literal("custom"),
2128
- kind: J.string().transform((e) => e),
2129
- providerMetadata: X.optional()
2196
+ Y.looseObject({
2197
+ type: Y.literal("custom"),
2198
+ kind: Y.string().transform((e) => e),
2199
+ providerMetadata: Z.optional()
2130
2200
  }),
2131
- J.looseObject({
2132
- type: J.literal("source-url"),
2133
- sourceId: J.string(),
2134
- url: J.string(),
2135
- title: J.string().optional(),
2136
- providerMetadata: X.optional()
2201
+ Y.looseObject({
2202
+ type: Y.literal("source-url"),
2203
+ sourceId: Y.string(),
2204
+ url: Y.string(),
2205
+ title: Y.string().optional(),
2206
+ providerMetadata: Z.optional()
2137
2207
  }),
2138
- J.looseObject({
2139
- type: J.literal("source-document"),
2140
- sourceId: J.string(),
2141
- mediaType: J.string(),
2142
- title: J.string(),
2143
- filename: J.string().optional(),
2144
- providerMetadata: X.optional()
2208
+ Y.looseObject({
2209
+ type: Y.literal("source-document"),
2210
+ sourceId: Y.string(),
2211
+ mediaType: Y.string(),
2212
+ title: Y.string(),
2213
+ filename: Y.string().optional(),
2214
+ providerMetadata: Z.optional()
2145
2215
  }),
2146
- J.looseObject({
2147
- type: J.literal("file"),
2148
- url: J.string(),
2149
- mediaType: J.string(),
2150
- providerMetadata: X.optional()
2216
+ Y.looseObject({
2217
+ type: Y.literal("file"),
2218
+ url: Y.string(),
2219
+ mediaType: Y.string(),
2220
+ providerMetadata: Z.optional()
2151
2221
  }),
2152
- J.looseObject({
2153
- type: J.literal("reasoning-file"),
2154
- url: J.string(),
2155
- mediaType: J.string(),
2156
- providerMetadata: X.optional()
2222
+ Y.looseObject({
2223
+ type: Y.literal("reasoning-file"),
2224
+ url: Y.string(),
2225
+ mediaType: Y.string(),
2226
+ providerMetadata: Z.optional()
2157
2227
  }),
2158
- J.looseObject({
2159
- type: J.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2160
- id: J.string().optional(),
2161
- data: J.unknown(),
2162
- transient: J.boolean().optional()
2228
+ Y.looseObject({
2229
+ type: Y.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2230
+ id: Y.string().optional(),
2231
+ data: Y.unknown(),
2232
+ transient: Y.boolean().optional()
2163
2233
  }),
2164
- J.looseObject({ type: J.literal("start-step") }),
2165
- J.looseObject({ type: J.literal("finish-step") }),
2166
- J.looseObject({ type: J.literal("reset-step") }),
2167
- J.looseObject({
2168
- type: J.literal("start"),
2169
- messageId: J.string().optional(),
2170
- messageMetadata: J.unknown().optional()
2234
+ Y.looseObject({ type: Y.literal("start-step") }),
2235
+ Y.looseObject({ type: Y.literal("finish-step") }),
2236
+ Y.looseObject({ type: Y.literal("reset-step") }),
2237
+ Y.looseObject({
2238
+ type: Y.literal("start"),
2239
+ messageId: Y.string().optional(),
2240
+ messageMetadata: Y.unknown().optional()
2171
2241
  }),
2172
- J.looseObject({
2173
- type: J.literal("finish"),
2174
- finishReason: J.enum([
2242
+ Y.looseObject({
2243
+ type: Y.literal("finish"),
2244
+ finishReason: Y.enum([
2175
2245
  "stop",
2176
2246
  "length",
2177
2247
  "content-filter",
@@ -2179,36 +2249,36 @@ var Un = J.record(J.string(), Y.optional()), Wn = Wt(() => $t(J.union([
2179
2249
  "error",
2180
2250
  "other"
2181
2251
  ]).optional(),
2182
- messageMetadata: J.unknown().optional()
2252
+ messageMetadata: Y.unknown().optional()
2183
2253
  }),
2184
- J.looseObject({
2185
- type: J.literal("abort"),
2186
- reason: J.string().optional()
2254
+ Y.looseObject({
2255
+ type: Y.literal("abort"),
2256
+ reason: Y.string().optional()
2187
2257
  }),
2188
- J.looseObject({
2189
- type: J.literal("message-metadata"),
2190
- messageMetadata: J.unknown()
2258
+ Y.looseObject({
2259
+ type: Y.literal("message-metadata"),
2260
+ messageMetadata: Y.unknown()
2191
2261
  })
2192
2262
  ])));
2193
- function Gn(e) {
2263
+ function Qn(e) {
2194
2264
  return e.type.startsWith("data-");
2195
2265
  }
2196
- function Kn() {
2266
+ function $n() {
2197
2267
  return /* @__PURE__ */ Object.create(null);
2198
2268
  }
2199
- function qn(e) {
2269
+ function er(e) {
2200
2270
  return e.type.startsWith("tool-");
2201
2271
  }
2202
- function Jn(e) {
2272
+ function tr(e) {
2203
2273
  return e.type === "dynamic-tool";
2204
2274
  }
2205
- function Z(e) {
2206
- return qn(e) || Jn(e);
2275
+ function Q(e) {
2276
+ return er(e) || tr(e);
2207
2277
  }
2208
- function Yn(e) {
2278
+ function nr(e) {
2209
2279
  return e.type.split("-").slice(1).join("-");
2210
2280
  }
2211
- function Xn({ lastMessage: e, messageId: t }) {
2281
+ function rr({ lastMessage: e, messageId: t }) {
2212
2282
  return {
2213
2283
  message: e?.role === "assistant" ? e : {
2214
2284
  id: t,
@@ -2216,12 +2286,12 @@ function Xn({ lastMessage: e, messageId: t }) {
2216
2286
  role: "assistant",
2217
2287
  parts: []
2218
2288
  },
2219
- activeTextParts: Kn(),
2220
- activeReasoningParts: Kn(),
2221
- partialToolCalls: Kn()
2289
+ activeTextParts: $n(),
2290
+ activeReasoningParts: $n(),
2291
+ partialToolCalls: $n()
2222
2292
  };
2223
2293
  }
2224
- function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2294
+ function ir({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2225
2295
  return e.pipeThrough(new TransformStream({ async transform(e, s) {
2226
2296
  await r(async ({ state: r, write: c }) => {
2227
2297
  function l() {
@@ -2230,7 +2300,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2230
2300
  return e.slice(t + 1);
2231
2301
  }
2232
2302
  function u() {
2233
- return l().filter(Z);
2303
+ return l().filter(Q);
2234
2304
  }
2235
2305
  function d(e) {
2236
2306
  let t = u().find((t) => t.toolCallId === e);
@@ -2238,13 +2308,13 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2238
2308
  let n = r.message.parts;
2239
2309
  for (let r = n.length - 1; r >= 0; r--) {
2240
2310
  let i = n[r];
2241
- if (Z(i) && i.toolCallId === e) {
2311
+ if (Q(i) && i.toolCallId === e) {
2242
2312
  t = i;
2243
2313
  break;
2244
2314
  }
2245
2315
  }
2246
2316
  }
2247
- if (t == null) throw new q({
2317
+ if (t == null) throw new J({
2248
2318
  chunkType: "tool-invocation",
2249
2319
  chunkId: e,
2250
2320
  message: `No tool invocation found for tool call ID "${e}".`
@@ -2252,8 +2322,8 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2252
2322
  return t;
2253
2323
  }
2254
2324
  function f(e) {
2255
- let t = r.message.parts.filter(Z).find((t) => t.approval?.id === e);
2256
- if (t == null) throw new q({
2325
+ let t = r.message.parts.filter(Q).find((t) => t.approval?.id === e);
2326
+ if (t == null) throw new J({
2257
2327
  chunkType: "tool-approval-response",
2258
2328
  chunkId: e,
2259
2329
  message: `No tool invocation found for approval ID "${e}".`
@@ -2261,7 +2331,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2261
2331
  return t;
2262
2332
  }
2263
2333
  function p(e, t) {
2264
- let n = t ?? l().find((t) => qn(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2334
+ let n = t ?? l().find((t) => er(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2265
2335
  if (n != null) {
2266
2336
  n.state = e.state, a.input = i.input, a.output = i.output, a.errorText = i.errorText, a.rawInput = i.rawInput, a.preliminary = i.preliminary, e.title !== void 0 && (a.title = e.title), e.toolMetadata !== void 0 && (a.toolMetadata = e.toolMetadata), a.providerExecuted = i.providerExecuted ?? n.providerExecuted;
2267
2337
  let t = i.providerMetadata;
@@ -2316,8 +2386,8 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2316
2386
  }
2317
2387
  async function h(e) {
2318
2388
  if (e != null) {
2319
- let n = r.message.metadata == null ? e : gn(r.message.metadata, e);
2320
- t != null && await en({
2389
+ let n = r.message.metadata == null ? e : xn(r.message.metadata, e);
2390
+ t != null && await $t({
2321
2391
  value: n,
2322
2392
  schema: t,
2323
2393
  context: {
@@ -2340,7 +2410,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2340
2410
  }
2341
2411
  case "text-delta": {
2342
2412
  let t = r.activeTextParts[e.id];
2343
- if (t == null) throw new q({
2413
+ if (t == null) throw new J({
2344
2414
  chunkType: "text-delta",
2345
2415
  chunkId: e.id,
2346
2416
  message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
@@ -2350,7 +2420,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2350
2420
  }
2351
2421
  case "text-end": {
2352
2422
  let t = r.activeTextParts[e.id];
2353
- if (t == null) throw new q({
2423
+ if (t == null) throw new J({
2354
2424
  chunkType: "text-end",
2355
2425
  chunkId: e.id,
2356
2426
  message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
@@ -2380,7 +2450,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2380
2450
  }
2381
2451
  case "reasoning-delta": {
2382
2452
  let t = r.activeReasoningParts[e.id];
2383
- if (t == null) throw new q({
2453
+ if (t == null) throw new J({
2384
2454
  chunkType: "reasoning-delta",
2385
2455
  chunkId: e.id,
2386
2456
  message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
@@ -2390,7 +2460,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2390
2460
  }
2391
2461
  case "reasoning-end": {
2392
2462
  let t = r.activeReasoningParts[e.id];
2393
- if (t == null) throw new q({
2463
+ if (t == null) throw new J({
2394
2464
  chunkType: "reasoning-end",
2395
2465
  chunkId: e.id,
2396
2466
  message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
@@ -2427,7 +2497,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2427
2497
  }), c();
2428
2498
  break;
2429
2499
  case "tool-input-start": {
2430
- let t = l().filter(qn);
2500
+ let t = l().filter(er);
2431
2501
  r.partialToolCalls[e.toolCallId] = {
2432
2502
  text: "",
2433
2503
  toolName: e.toolName,
@@ -2458,13 +2528,13 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2458
2528
  }
2459
2529
  case "tool-input-delta": {
2460
2530
  let t = r.partialToolCalls[e.toolCallId];
2461
- if (t == null) throw new q({
2531
+ if (t == null) throw new J({
2462
2532
  chunkType: "tool-input-delta",
2463
2533
  chunkId: e.toolCallId,
2464
2534
  message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
2465
2535
  });
2466
2536
  t.text += e.inputTextDelta;
2467
- let { value: n } = await Ln(t.text);
2537
+ let { value: n } = await Hn(t.text);
2468
2538
  t.dynamic ? m({
2469
2539
  toolCallId: e.toolCallId,
2470
2540
  toolName: t.toolName,
@@ -2504,7 +2574,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2504
2574
  }), c(), a && !e.providerExecuted && await a({ toolCall: e });
2505
2575
  break;
2506
2576
  case "tool-input-error": {
2507
- let t = l().filter(Z).find((t) => t.toolCallId === e.toolCallId);
2577
+ let t = l().filter(Q).find((t) => t.toolCallId === e.toolCallId);
2508
2578
  (t == null ? e.dynamic : t.type === "dynamic-tool") ? m({
2509
2579
  toolCallId: e.toolCallId,
2510
2580
  toolName: e.toolName,
@@ -2568,7 +2638,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2568
2638
  toolMetadata: t.toolMetadata
2569
2639
  }, t) : p({
2570
2640
  toolCallId: e.toolCallId,
2571
- toolName: Yn(t),
2641
+ toolName: nr(t),
2572
2642
  state: "output-available",
2573
2643
  input: t.input,
2574
2644
  output: e.output,
@@ -2594,7 +2664,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2594
2664
  toolMetadata: t.toolMetadata
2595
2665
  }, t) : p({
2596
2666
  toolCallId: e.toolCallId,
2597
- toolName: Yn(t),
2667
+ toolName: nr(t),
2598
2668
  state: "output-error",
2599
2669
  input: t.input,
2600
2670
  rawInput: t.rawInput,
@@ -2612,7 +2682,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2612
2682
  case "finish-step": break;
2613
2683
  case "reset-step": {
2614
2684
  let e = l();
2615
- r.activeTextParts = Kn(), r.activeReasoningParts = Kn(), r.partialToolCalls = Kn(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2685
+ r.activeTextParts = $n(), r.activeReasoningParts = $n(), r.partialToolCalls = $n(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2616
2686
  break;
2617
2687
  }
2618
2688
  case "start":
@@ -2627,10 +2697,10 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2627
2697
  case "error":
2628
2698
  i?.(Error(e.errorText));
2629
2699
  break;
2630
- default: if (Gn(e)) {
2700
+ default: if (Qn(e)) {
2631
2701
  if (n?.[e.type] != null) {
2632
2702
  let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
2633
- await en({
2703
+ await $t({
2634
2704
  value: e.data,
2635
2705
  schema: n[e.type],
2636
2706
  context: {
@@ -2653,7 +2723,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2653
2723
  });
2654
2724
  } }));
2655
2725
  }
2656
- async function Qn({ stream: e, onError: t, abortSignal: n }) {
2726
+ async function ar({ stream: e, onError: t, abortSignal: n }) {
2657
2727
  let r = e.getReader(), i = () => {
2658
2728
  r.cancel().catch(() => {});
2659
2729
  };
@@ -2669,29 +2739,29 @@ async function Qn({ stream: e, onError: t, abortSignal: n }) {
2669
2739
  n?.removeEventListener("abort", i), r.releaseLock();
2670
2740
  }
2671
2741
  }
2672
- F({
2742
+ I({
2673
2743
  prefix: "aitxt",
2674
2744
  size: 24
2675
- }), F({
2745
+ }), I({
2676
2746
  prefix: "call",
2677
2747
  size: 24
2678
- }), F({
2748
+ }), I({
2679
2749
  prefix: "aitxt",
2680
2750
  size: 24
2681
- }), F({
2751
+ }), I({
2682
2752
  prefix: "call",
2683
2753
  size: 24
2684
- }), J.record(J.string(), Y.optional()), J.record(J.string(), J.string()), F({
2754
+ }), Y.record(Y.string(), X.optional()), Y.record(Y.string(), Y.string()), I({
2685
2755
  prefix: "call",
2686
2756
  size: 24
2687
- }), F({
2757
+ }), I({
2688
2758
  prefix: "call",
2689
2759
  size: 24
2690
- }), new TextEncoder(), F({
2760
+ }), new TextEncoder(), I({
2691
2761
  prefix: "aiobj",
2692
2762
  size: 24
2693
2763
  });
2694
- var $n = class {
2764
+ var or = class {
2695
2765
  constructor() {
2696
2766
  this.queue = [], this.isProcessing = !1;
2697
2767
  }
@@ -2713,14 +2783,14 @@ var $n = class {
2713
2783
  });
2714
2784
  }
2715
2785
  };
2716
- F({
2786
+ I({
2717
2787
  prefix: "aiobj",
2718
2788
  size: 24
2719
- }), F({
2789
+ }), I({
2720
2790
  prefix: "call",
2721
2791
  size: 24
2722
2792
  });
2723
- async function er(e) {
2793
+ async function sr(e) {
2724
2794
  if (e == null) return [];
2725
2795
  if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw Error("FileList is not supported in the current environment");
2726
2796
  return Promise.all(Array.from(e).map(async (e) => {
@@ -2738,14 +2808,14 @@ async function er(e) {
2738
2808
  };
2739
2809
  }));
2740
2810
  }
2741
- var tr = class {
2811
+ var cr = class {
2742
2812
  constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
2743
2813
  this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
2744
2814
  }
2745
2815
  async sendMessages({ abortSignal: e, ...t }) {
2746
- let n = await G(this.body), r = await G(this.headers), i = await G(this.credentials), a = {
2747
- ...P(r),
2748
- ...P(t.headers)
2816
+ let n = await K(this.body), r = await K(this.headers), i = await K(this.credentials), a = {
2817
+ ...F(r),
2818
+ ...F(t.headers)
2749
2819
  }, o = await this.prepareSendMessagesRequest?.call(this, {
2750
2820
  api: this.api,
2751
2821
  id: t.chatId,
@@ -2759,7 +2829,7 @@ var tr = class {
2759
2829
  requestMetadata: t.metadata,
2760
2830
  trigger: t.trigger,
2761
2831
  messageId: t.messageId
2762
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : P(o.headers), l = o?.body === void 0 ? {
2832
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : F(o.headers), l = o?.body === void 0 ? {
2763
2833
  ...n,
2764
2834
  ...t.body,
2765
2835
  id: t.chatId,
@@ -2776,14 +2846,14 @@ var tr = class {
2776
2846
  credentials: u,
2777
2847
  signal: e
2778
2848
  });
2779
- if (!d.ok) throw Error(await d.text() ?? "Failed to fetch the chat response.");
2849
+ if (!d.ok) throw Error(await d.text() || "Failed to fetch the chat response.");
2780
2850
  if (!d.body) throw Error("The response body is empty.");
2781
2851
  return this.processResponseStream(d.body);
2782
2852
  }
2783
2853
  async reconnectToStream(e) {
2784
- let t = await G(this.body), n = await G(this.headers), r = await G(this.credentials), i = {
2785
- ...P(n),
2786
- ...P(e.headers)
2854
+ let t = await K(this.body), n = await K(this.headers), r = await K(this.credentials), i = {
2855
+ ...F(n),
2856
+ ...F(e.headers)
2787
2857
  }, a = await this.prepareReconnectToStreamRequest?.call(this, {
2788
2858
  api: this.api,
2789
2859
  id: e.chatId,
@@ -2794,33 +2864,33 @@ var tr = class {
2794
2864
  headers: i,
2795
2865
  credentials: r,
2796
2866
  requestMetadata: e.metadata
2797
- }), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i : P(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2867
+ }), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i : F(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2798
2868
  method: "GET",
2799
2869
  headers: s,
2800
2870
  credentials: c,
2801
2871
  signal: e.abortSignal
2802
2872
  });
2803
2873
  if (l.status === 204) return null;
2804
- if (!l.ok) throw Error(await l.text() ?? "Failed to fetch the chat response.");
2874
+ if (!l.ok) throw Error(await l.text() || "Failed to fetch the chat response.");
2805
2875
  if (!l.body) throw Error("The response body is empty.");
2806
2876
  return this.processResponseStream(l.body);
2807
2877
  }
2808
- }, nr = class extends tr {
2878
+ }, lr = class extends cr {
2809
2879
  constructor(e = {}) {
2810
2880
  super(e);
2811
2881
  }
2812
2882
  processResponseStream(e) {
2813
- return nn({
2883
+ return tn({
2814
2884
  stream: e,
2815
- schema: Wn
2885
+ schema: Zn
2816
2886
  }).pipeThrough(new TransformStream({ async transform(e, t) {
2817
2887
  if (!e.success) throw e.error;
2818
2888
  t.enqueue(e.value);
2819
2889
  } }));
2820
2890
  }
2821
- }, rr = class {
2822
- constructor({ generateId: e = I, id: t = e(), transport: n = new nr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
2823
- this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new $n(), this.sendMessage = async (e, t) => {
2891
+ }, ur = class {
2892
+ constructor({ generateId: e = L, id: t = e(), transport: n = new lr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
2893
+ this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new or(), this.sendMessage = async (e, t) => {
2824
2894
  if (e == null) {
2825
2895
  await this.makeRequest({
2826
2896
  trigger: "submit-message",
@@ -2835,7 +2905,7 @@ var tr = class {
2835
2905
  this.pendingMessagePreparations.add(t);
2836
2906
  let r;
2837
2907
  try {
2838
- r = Array.isArray(e.files) ? e.files : await er(e.files);
2908
+ r = Array.isArray(e.files) ? e.files : await sr(e.files);
2839
2909
  } finally {
2840
2910
  this.pendingMessagePreparations.delete(t);
2841
2911
  }
@@ -2850,8 +2920,8 @@ var tr = class {
2850
2920
  if (t === -1) throw Error(`message with id ${e.messageId} not found`);
2851
2921
  if (this.state.messages[t].role !== "user") throw Error(`message with id ${e.messageId} is not a user message`);
2852
2922
  this.state.messages = this.state.messages.slice(0, t + 1), this.state.replaceMessage(t, {
2853
- ...n,
2854
2923
  id: e.messageId,
2924
+ ...n,
2855
2925
  role: n.role ?? "user",
2856
2926
  metadata: e.metadata
2857
2927
  });
@@ -2882,7 +2952,7 @@ var tr = class {
2882
2952
  }, this.clearError = () => {
2883
2953
  this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
2884
2954
  }, this.addToolApprovalResponse = async ({ id: e, approved: t, reason: n, options: r }) => this.jobExecutor.run(async () => {
2885
- let i = this.state.messages, a = i[i.length - 1], o = (r) => Z(r) && r.state === "approval-requested" && r.approval.id === e ? {
2955
+ let i = this.state.messages, a = i[i.length - 1], o = (r) => Q(r) && r.state === "approval-requested" && r.approval.id === e ? {
2886
2956
  ...r,
2887
2957
  state: "approval-responded",
2888
2958
  approval: {
@@ -2903,7 +2973,7 @@ var tr = class {
2903
2973
  });
2904
2974
  });
2905
2975
  }), this.addToolOutput = async ({ state: e = "output-available", toolCallId: t, output: n, errorText: r, options: i }) => this.jobExecutor.run(async () => {
2906
- let a = this.state.messages, o = a[a.length - 1], s = (i) => Z(i) && i.toolCallId === t ? {
2976
+ let a = this.state.messages, o = a[a.length - 1], s = (i) => Q(i) && i.toolCallId === t ? {
2907
2977
  ...i,
2908
2978
  state: e,
2909
2979
  output: n,
@@ -2991,7 +3061,7 @@ var tr = class {
2991
3061
  let f = this.lastMessage, p = !1, m = !1, h = !1, g;
2992
3062
  try {
2993
3063
  let a = {
2994
- state: Xn({
3064
+ state: rr({
2995
3065
  lastMessage: e === "resume-stream" || e === "regenerate-message" ? void 0 : this.state.snapshot(f),
2996
3066
  messageId: this.generateId()
2997
3067
  }),
@@ -3010,8 +3080,8 @@ var tr = class {
3010
3080
  body: r,
3011
3081
  trigger: e,
3012
3082
  messageId: i
3013
- }), await Qn({
3014
- stream: Zn({
3083
+ }), await ar({
3084
+ stream: ir({
3015
3085
  stream: o,
3016
3086
  onToolCall: this.onToolCall,
3017
3087
  onData: this.onData,
@@ -3063,39 +3133,39 @@ var tr = class {
3063
3133
  });
3064
3134
  }
3065
3135
  };
3066
- function ir({ messages: e }) {
3136
+ function dr({ messages: e }) {
3067
3137
  let t = e[e.length - 1];
3068
3138
  if (!t || t.role !== "assistant") return !1;
3069
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(Z);
3139
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(Q);
3070
3140
  return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
3071
3141
  }
3072
3142
  //#endregion
3073
3143
  //#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/lib/hash.js
3074
- var ar = /* @__PURE__ */ new WeakMap(), or = 0;
3075
- function sr(e) {
3144
+ var fr = /* @__PURE__ */ new WeakMap(), pr = 0;
3145
+ function mr(e) {
3076
3146
  if (!e.length) return "";
3077
3147
  for (var t = "arg", n = 0; n < e.length; ++n) {
3078
3148
  var r = void 0;
3079
- e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) : ar.has(e[n]) ? r = ar.get(e[n]) : (r = or, ar.set(e[n], or++)), t += "@" + r;
3149
+ e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) : fr.has(e[n]) ? r = fr.get(e[n]) : (r = pr, fr.set(e[n], pr++)), t += "@" + r;
3080
3150
  }
3081
3151
  return t;
3082
3152
  }
3083
3153
  //#endregion
3084
3154
  //#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/cache/index.js
3085
- function cr(e) {
3155
+ function hr(e) {
3086
3156
  if (typeof e == "function") try {
3087
3157
  e = e();
3088
3158
  } catch {
3089
3159
  e = "";
3090
3160
  }
3091
- return e = Array.isArray(e) ? sr(e) : String(e || ""), e;
3161
+ return e = Array.isArray(e) ? mr(e) : String(e || ""), e;
3092
3162
  }
3093
- var lr = function() {
3163
+ var gr = function() {
3094
3164
  function e(e) {
3095
3165
  e === void 0 && (e = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = e;
3096
3166
  }
3097
3167
  return e.prototype.serializeKey = function(e) {
3098
- return cr(e);
3168
+ return hr(e);
3099
3169
  }, e.prototype.get = function(e) {
3100
3170
  var t = this.serializeKey(e);
3101
3171
  return this.items.get(t);
@@ -3117,26 +3187,26 @@ var lr = function() {
3117
3187
  }();
3118
3188
  //#endregion
3119
3189
  //#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/lib/web-preset.js
3120
- function ur() {
3190
+ function _r() {
3121
3191
  return navigator.onLine === void 0 || navigator.onLine;
3122
3192
  }
3123
- function dr() {
3193
+ function vr() {
3124
3194
  return typeof document < "u" && document.visibilityState !== void 0 ? document.visibilityState !== "hidden" : !0;
3125
3195
  }
3126
- var fr = {
3127
- isOnline: ur,
3128
- isDocumentVisible: dr,
3196
+ var yr = {
3197
+ isOnline: _r,
3198
+ isDocumentVisible: vr,
3129
3199
  fetcher: function(e) {
3130
3200
  return fetch(e).then(function(e) {
3131
3201
  return e.json();
3132
3202
  });
3133
3203
  }
3134
- }, Q = function() {
3135
- return Q = Object.assign || function(e) {
3204
+ }, $ = function() {
3205
+ return $ = Object.assign || function(e) {
3136
3206
  for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
3137
3207
  return e;
3138
- }, Q.apply(this, arguments);
3139
- }, pr = function(e, t, n, r) {
3208
+ }, $.apply(this, arguments);
3209
+ }, br = function(e, t, n, r) {
3140
3210
  function i(e) {
3141
3211
  return e instanceof n ? e : new n(function(t) {
3142
3212
  t(e);
@@ -3162,7 +3232,7 @@ var fr = {
3162
3232
  }
3163
3233
  c((r = r.apply(e, t || [])).next());
3164
3234
  });
3165
- }, $ = function(e, t) {
3235
+ }, xr = function(e, t) {
3166
3236
  var n = {
3167
3237
  label: 0,
3168
3238
  sent: function() {
@@ -3235,7 +3305,7 @@ var fr = {
3235
3305
  done: !0
3236
3306
  };
3237
3307
  }
3238
- }, mr = function(e, t) {
3308
+ }, Sr = function(e, t) {
3239
3309
  var n = typeof Symbol == "function" && e[Symbol.iterator];
3240
3310
  if (!n) return e;
3241
3311
  var r = n.call(e), i, a = [], o;
@@ -3251,11 +3321,11 @@ var fr = {
3251
3321
  }
3252
3322
  }
3253
3323
  return a;
3254
- }, hr = function(e, t, n) {
3324
+ }, Cr = function(e, t, n) {
3255
3325
  if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
3256
3326
  return e.concat(a || Array.prototype.slice.call(t));
3257
- }, gr = new lr(), _r = new lr(), vr = new lr(), yr = {
3258
- cache: gr,
3327
+ }, wr = new gr(), Tr = new gr(), Er = new gr(), Dr = {
3328
+ cache: wr,
3259
3329
  refreshInterval: 0,
3260
3330
  ttl: 0,
3261
3331
  serverTTL: 1e3,
@@ -3265,15 +3335,15 @@ var fr = {
3265
3335
  shouldRetryOnError: !0,
3266
3336
  errorRetryInterval: 5e3,
3267
3337
  errorRetryCount: 5,
3268
- fetcher: fr.fetcher,
3269
- isOnline: fr.isOnline,
3270
- isDocumentVisible: fr.isDocumentVisible
3338
+ fetcher: yr.fetcher,
3339
+ isOnline: yr.isOnline,
3340
+ isDocumentVisible: yr.isDocumentVisible
3271
3341
  };
3272
- function br(e, t, n) {
3273
- var r = _r.get(e);
3274
- r ? r.data.push(t) : _r.set(e, [t], n > 0 ? n + 5e3 : n);
3342
+ function Or(e, t, n) {
3343
+ var r = Tr.get(e);
3344
+ r ? r.data.push(t) : Tr.set(e, [t], n > 0 ? n + 5e3 : n);
3275
3345
  }
3276
- function xr(e, t, n) {
3346
+ function kr(e, t, n) {
3277
3347
  if (n.isDocumentVisible() && !(n.errorRetryCount !== void 0 && t > n.errorRetryCount)) {
3278
3348
  var r = Math.min(t || 0, n.errorRetryCount), i = r * n.errorRetryInterval;
3279
3349
  setTimeout(function() {
@@ -3284,17 +3354,17 @@ function xr(e, t, n) {
3284
3354
  }, i);
3285
3355
  }
3286
3356
  }
3287
- function Sr(e) {
3357
+ function Ar(e) {
3288
3358
  var t = e.shouldRetry, n = t === void 0 ? void 0 : t, r = e.error;
3289
- return typeof n == "function" ? n(r) : typeof n == "boolean" ? n : yr.shouldRetryOnError;
3359
+ return typeof n == "function" ? n(r) : typeof n == "boolean" ? n : Dr.shouldRetryOnError;
3290
3360
  }
3291
- var Cr = function(e, t, n, r) {
3292
- return n === void 0 && (n = gr), r === void 0 && (r = yr.ttl), pr(void 0, void 0, void 0, function() {
3361
+ var jr = function(e, t, n, r) {
3362
+ return n === void 0 && (n = wr), r === void 0 && (r = Dr.ttl), br(void 0, void 0, void 0, function() {
3293
3363
  var i, a, o, s, c, l, u;
3294
- return $(this, function(d) {
3364
+ return xr(this, function(d) {
3295
3365
  switch (d.label) {
3296
3366
  case 0:
3297
- if (!Tr(t)) return [3, 5];
3367
+ if (!Nr(t)) return [3, 5];
3298
3368
  d.label = 1;
3299
3369
  case 1: return d.trys.push([
3300
3370
  1,
@@ -3316,7 +3386,7 @@ var Cr = function(e, t, n, r) {
3316
3386
  } catch (e) {
3317
3387
  console.error("swrv(mutate): failed to set cache", e);
3318
3388
  }
3319
- return l = _r.get(e), l && l.data.length && (u = l.data.filter(function(t) {
3389
+ return l = Tr.get(e), l && l.data.length && (u = l.data.filter(function(t) {
3320
3390
  return t.key === e;
3321
3391
  }), u.forEach(function(e, t) {
3322
3392
  c.data !== void 0 && (e.data = c.data), e.error = c.error, e.isValidating = c.isValidating, e.isLoading = c.isValidating, t !== u.length - 1 && delete u[t];
@@ -3325,12 +3395,12 @@ var Cr = function(e, t, n, r) {
3325
3395
  });
3326
3396
  });
3327
3397
  };
3328
- function wr() {
3398
+ function Mr() {
3329
3399
  for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
3330
- var r, i, a = Q({}, yr), o = !1, s = !1;
3400
+ var r, i, a = $({}, Dr), o = !1, s = !1;
3331
3401
  if (!se()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
3332
3402
  var c = typeof window > "u" || typeof document > "u";
3333
- t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = Q(Q({}, a), t[2]));
3403
+ t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = $($({}, a), t[2]));
3334
3404
  var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : y(r);
3335
3405
  i === void 0 && (i = a.fetcher);
3336
3406
  var d = null;
@@ -3342,32 +3412,32 @@ function wr() {
3342
3412
  key: null
3343
3413
  });
3344
3414
  var f = function(t, n) {
3345
- return pr(e, void 0, void 0, function() {
3415
+ return br(e, void 0, void 0, function() {
3346
3416
  var e, r, s, c, p, m, h, g = this;
3347
- return $(this, function(_) {
3417
+ return xr(this, function(_) {
3348
3418
  switch (_.label) {
3349
3419
  case 0: return e = d.data === void 0, r = u.value, r ? (s = a.cache.get(r), c = s && s.data, d.isValidating = !0, d.isLoading = !c, c && (d.data = c.data, d.error = c.error), p = t || i, !p || !a.isDocumentVisible() && !e || n?.forceRevalidate !== void 0 && !n?.forceRevalidate || s && (m = !!(Date.now() - s.createdAt >= a.dedupingInterval || n?.forceRevalidate), !m) ? (d.isValidating = !1, d.isLoading = !1, [2]) : (h = function() {
3350
- return pr(g, void 0, void 0, function() {
3420
+ return br(g, void 0, void 0, function() {
3351
3421
  var e, t, i, s, c, u;
3352
- return $(this, function(m) {
3422
+ return xr(this, function(m) {
3353
3423
  switch (m.label) {
3354
- case 0: return e = vr.get(r), e ? [3, 2] : (t = Array.isArray(r) ? r : [r], i = p.apply(void 0, hr([], mr(t), !1)), vr.set(r, i, a.dedupingInterval), [4, Cr(r, i, a.cache, l)]);
3424
+ case 0: return e = Er.get(r), e ? [3, 2] : (t = Array.isArray(r) ? r : [r], i = p.apply(void 0, Cr([], Sr(t), !1)), Er.set(r, i, a.dedupingInterval), [4, jr(r, i, a.cache, l)]);
3355
3425
  case 1: return m.sent(), [3, 4];
3356
- case 2: return [4, Cr(r, e.data, a.cache, l)];
3426
+ case 2: return [4, jr(r, e.data, a.cache, l)];
3357
3427
  case 3: m.sent(), m.label = 4;
3358
- case 4: return d.isValidating = !1, d.isLoading = !1, vr.delete(r), d.error !== void 0 && (s = Sr({
3428
+ case 4: return d.isValidating = !1, d.isLoading = !1, Er.delete(r), d.error !== void 0 && (s = Ar({
3359
3429
  shouldRetry: a.shouldRetryOnError,
3360
3430
  error: d.error
3361
- }), c = Sr({
3431
+ }), c = Ar({
3362
3432
  shouldRetry: !n || n.shouldRetryOnError,
3363
3433
  error: d.error
3364
- }), u = !o && s && c, u && xr(f, n ? n.errorRetryCount : 1, a)), [2];
3434
+ }), u = !o && s && c, u && kr(f, n ? n.errorRetryCount : 1, a)), [2];
3365
3435
  }
3366
3436
  });
3367
3437
  });
3368
3438
  }, c && a.revalidateDebounce ? (setTimeout(function() {
3369
- return pr(g, void 0, void 0, function() {
3370
- return $(this, function(e) {
3439
+ return br(g, void 0, void 0, function() {
3440
+ return xr(this, function(e) {
3371
3441
  switch (e.label) {
3372
3442
  case 0: return o ? [3, 2] : [4, h()];
3373
3443
  case 1: e.sent(), e.label = 2;
@@ -3383,16 +3453,16 @@ function wr() {
3383
3453
  });
3384
3454
  });
3385
3455
  }, p = function() {
3386
- return pr(e, void 0, void 0, function() {
3387
- return $(this, function(e) {
3456
+ return br(e, void 0, void 0, function() {
3457
+ return xr(this, function(e) {
3388
3458
  return [2, f(null, { shouldRetryOnError: !1 })];
3389
3459
  });
3390
3460
  });
3391
3461
  }, m = null;
3392
3462
  if (!c) {
3393
3463
  var h = function() {
3394
- return pr(e, void 0, void 0, function() {
3395
- return $(this, function(e) {
3464
+ return br(e, void 0, void 0, function() {
3465
+ return xr(this, function(e) {
3396
3466
  switch (e.label) {
3397
3467
  case 0: return !d.error && a.isOnline() ? [4, f()] : [3, 2];
3398
3468
  case 1: return e.sent(), [3, 3];
@@ -3406,28 +3476,28 @@ function wr() {
3406
3476
  }
3407
3477
  le(function() {
3408
3478
  o = !0, m &&= (clearTimeout(m), null), !c && a.revalidateOnFocus && (document.removeEventListener("visibilitychange", p, !1), window.removeEventListener("focus", p, !1));
3409
- var e = _r.get(u.value);
3479
+ var e = Tr.get(u.value);
3410
3480
  e && (e.data = e.data.filter(function(e) {
3411
3481
  return e !== d;
3412
3482
  }));
3413
3483
  });
3414
3484
  try {
3415
3485
  fe(u, function(e) {
3416
- ce(u) || (u.value = e), d.key = e, d.isValidating = !!e, br(u.value, d, l), !c && !s && u.value && f(), s = !1;
3486
+ ce(u) || (u.value = e), d.key = e, d.isValidating = !!e, Or(u.value, d, l), !c && !s && u.value && f(), s = !1;
3417
3487
  }, { immediate: !0 });
3418
3488
  } catch {}
3419
- return Q(Q({}, de(d)), { mutate: function(e, t) {
3420
- return f(e, Q(Q({}, t), { forceRevalidate: !0 }));
3489
+ return $($({}, de(d)), { mutate: function(e, t) {
3490
+ return f(e, $($({}, t), { forceRevalidate: !0 }));
3421
3491
  } });
3422
3492
  }
3423
- function Tr(e) {
3493
+ function Nr(e) {
3424
3494
  return typeof e == "object" && !!e && typeof e.then == "function";
3425
3495
  }
3426
3496
  //#endregion
3427
3497
  //#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/index.js
3428
- var Er = wr;
3429
- Er.default, Er.default;
3430
- var Dr = class {
3498
+ var Pr = Mr;
3499
+ Pr.default, Pr.default;
3500
+ var Fr = class {
3431
3501
  constructor(e) {
3432
3502
  this.statusRef = y("ready"), this.errorRef = y(void 0), this.pushMessage = (e) => {
3433
3503
  this.messagesRef.value = [...this.messagesRef.value, e];
@@ -3455,33 +3525,33 @@ var Dr = class {
3455
3525
  set error(e) {
3456
3526
  this.errorRef.value = e;
3457
3527
  }
3458
- }, Or = class extends rr {
3528
+ }, Ir = class extends ur {
3459
3529
  constructor({ messages: e, ...t }) {
3460
3530
  super({
3461
3531
  ...t,
3462
- state: new Dr(e)
3532
+ state: new Fr(e)
3463
3533
  });
3464
3534
  }
3465
- }, kr = "voice-", Ar = (e) => e.replace(/\s+/g, " ").trim().toLowerCase(), jr = (e) => Ar(e.parts.filter((e) => e.type === "text").map((e) => "text" in e ? e.text : "").join(" ")), Mr = 8, Nr = (e, t) => {
3535
+ }, Lr = "voice-", Rr = (e) => e.replace(/\s+/g, " ").trim().toLowerCase(), zr = (e) => Rr(e.parts.filter((e) => e.type === "text").map((e) => "text" in e ? e.text : "").join(" ")), Br = 8, Vr = (e, t) => {
3466
3536
  let n = e.filter((e) => e.role === "user").map((e) => ({
3467
- text: jr(e),
3537
+ text: zr(e),
3468
3538
  taken: !1
3469
3539
  }));
3470
3540
  return t.filter((e) => {
3471
3541
  if (!e.id.startsWith("voice-") || e.role !== "user") return !1;
3472
- let t = jr(e), r = n.find((e) => !e.taken && e.text.length > 0 && (e.text === t || e.text.length >= Mr && t.endsWith(e.text)));
3542
+ let t = zr(e), r = n.find((e) => !e.taken && e.text.length > 0 && (e.text === t || e.text.length >= Br && t.endsWith(e.text)));
3473
3543
  return !r || (r.taken = !0, !1);
3474
3544
  });
3475
- }, Pr = (e) => {
3545
+ }, Hr = (e) => {
3476
3546
  let t = e.type ?? "";
3477
3547
  return t === "dynamic-tool" ? e.toolName ?? "" : t.startsWith("tool-") ? t.slice(5) : "";
3478
- }, Fr = ({ messages: e }) => {
3548
+ }, Ur = ({ messages: e }) => {
3479
3549
  let t = e[e.length - 1];
3480
3550
  if (!t || t.role !== "assistant") return !1;
3481
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && te(Pr(e)));
3551
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && te(Hr(e)));
3482
3552
  return r.length > 0 && r.every((e) => ne.has(e.state ?? ""));
3483
3553
  };
3484
- function Ir(e) {
3554
+ function Wr(e) {
3485
3555
  return b(`chatbot-${e}`, () => {
3486
3556
  let { t, te: n, locale: r } = me({ useScope: "global" }), i = y(""), a = y(), o = y(e), s = y(), c = y(), l = y(), u = y(), d = y(), f = y(), p = y(), m = y(), h = y(), g = y(), _ = y(), ee = y(), te = y(), ne = y(), se = y(), ce = y(), le = y(!1), ue = he(), de = v(() => {
3487
3557
  let e = u.value?.theme;
@@ -3492,7 +3562,7 @@ function Ir(e) {
3492
3562
  "feedback"
3493
3563
  ].includes(e)) : g.value), ye = oe(v(() => `${o.value}-chatId`), null);
3494
3564
  pe(() => {
3495
- ye.value ||= I();
3565
+ ye.value ||= L();
3496
3566
  });
3497
3567
  let x = v({
3498
3568
  get: () => ye.value,
@@ -3510,8 +3580,8 @@ function Ir(e) {
3510
3580
  }
3511
3581
  function Se(e) {
3512
3582
  if (xe(e)) {
3513
- let e = T.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? ae(t) : void 0;
3514
- x.value = I(), T.value.clearError(), S.value = void 0, n && T.value.sendMessage({ text: n });
3583
+ let e = E.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? ae(t) : void 0;
3584
+ x.value = L(), E.value.clearError(), S.value = void 0, n && E.value.sendMessage({ text: n });
3515
3585
  return;
3516
3586
  }
3517
3587
  ie.error(e), S.value = e, be.value && (C.value = !0);
@@ -3520,12 +3590,12 @@ function Ir(e) {
3520
3590
  baseUrl: i.value,
3521
3591
  basePath: a.value,
3522
3592
  headers: () => p.value
3523
- })), Ce = y(null), we = () => ({
3593
+ })), T = y(null), Ce = () => ({
3524
3594
  ...ge(),
3525
- ...Ce.value ?? {}
3526
- }), T = v(() => new Or({
3595
+ ...T.value ?? {}
3596
+ }), E = v(() => new Ir({
3527
3597
  id: x.value,
3528
- transport: new nr({
3598
+ transport: new lr({
3529
3599
  api: w.value.getChatEndpoint(o.value, b.value ? "reasoning" : "chat"),
3530
3600
  prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
3531
3601
  id: t,
@@ -3541,7 +3611,7 @@ function Ir(e) {
3541
3611
  reasoning: d.value?.reasoning,
3542
3612
  webSearch: f.value?.webSearch,
3543
3613
  smoothStream: u.value?.smoothStream,
3544
- deviceContext: we(),
3614
+ deviceContext: Ce(),
3545
3615
  externalContext: se.value,
3546
3616
  disabledTools: f.value?.disabled,
3547
3617
  fallbackModels: te.value,
@@ -3550,23 +3620,23 @@ function Ir(e) {
3550
3620
  credentials: "include",
3551
3621
  headers: () => p.value ?? {}
3552
3622
  }),
3553
- sendAutomaticallyWhen: (e) => Fr(e) || ir(e),
3623
+ sendAutomaticallyWhen: (e) => Ur(e) || dr(e),
3554
3624
  onError: Se,
3555
3625
  onFinish: () => {
3556
3626
  let e = x.value;
3557
- !b.value && !E.value.some((t) => t.id === e) && ze(o.value);
3627
+ !b.value && !D.value.some((t) => t.id === e) && Re(o.value);
3558
3628
  }
3559
- })), Te = v(() => {
3629
+ })), we = v(() => {
3560
3630
  let e = u.value?.initialMessage;
3561
3631
  return e?.[r.value] ? e[r.value] : n("message.defaultAgentWelcome") ? t("message.defaultAgentWelcome") : "";
3562
- }), Ee = I(), De = v(() => ({
3563
- id: Ee,
3632
+ }), Te = L(), Ee = v(() => ({
3633
+ id: Te,
3564
3634
  role: "assistant",
3565
3635
  parts: [{
3566
3636
  type: "text",
3567
- text: Te.value
3637
+ text: we.value
3568
3638
  }]
3569
- })), Oe = v(() => {
3639
+ })), De = v(() => {
3570
3640
  let e = (e) => e.map((e) => e.role !== "user" || !e.parts.some((e) => e.type === "file") ? e : {
3571
3641
  ...e,
3572
3642
  parts: e.parts.map((e) => {
@@ -3585,202 +3655,202 @@ function Ir(e) {
3585
3655
  };
3586
3656
  })
3587
3657
  });
3588
- return b.value ? e(T.value.messages) : !le.value && T.value.messages?.[0]?.role !== "assistant" ? [De.value, ...e(T.value.messages)] : e(T.value.messages);
3589
- }), ke = v(() => {
3658
+ return b.value ? e(E.value.messages) : !le.value && E.value.messages?.[0]?.role !== "assistant" ? [Ee.value, ...e(E.value.messages)] : e(E.value.messages);
3659
+ }), Oe = v(() => {
3590
3660
  let e = u.value?.messagePlaceholder;
3591
3661
  return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
3592
- }), E = y([]), Ae = y(!1), D = y([]), je = y(!1), Me = y("chat"), O = y([]), k = y(), Ne = y(!1), Pe = y(!1), Fe = y(), A = y(!1), Ie = y(!1), Le = y(), j = y(""), M = y([]), N = y(""), Re = y(0);
3593
- async function ze(e) {
3662
+ }), D = y([]), ke = y(!1), O = y([]), Ae = y(!1), je = y("chat"), k = y([]), A = y(), Me = y(!1), Ne = y(!1), Pe = y(), j = y(!1), Fe = y(!1), Ie = y(), M = y(""), N = y([]), P = y(""), Le = y(0);
3663
+ async function Re(e) {
3594
3664
  if (b.value) {
3595
- E.value = [];
3665
+ D.value = [];
3596
3666
  return;
3597
3667
  }
3598
- Ae.value = !0;
3668
+ ke.value = !0;
3599
3669
  try {
3600
- E.value = await w.value.getConversations(e, l.value);
3670
+ D.value = await w.value.getConversations(e, l.value);
3601
3671
  } catch {
3602
- E.value = [];
3672
+ D.value = [];
3603
3673
  } finally {
3604
- Ae.value = !1;
3674
+ ke.value = !1;
3605
3675
  }
3606
3676
  }
3607
- async function P() {
3677
+ async function F() {
3608
3678
  let e = x.value;
3609
3679
  if (!e) {
3610
- D.value = [];
3680
+ O.value = [];
3611
3681
  return;
3612
3682
  }
3613
- je.value = !0;
3683
+ Ae.value = !0;
3614
3684
  try {
3615
- D.value = await w.value.getChatFiles(e);
3685
+ O.value = await w.value.getChatFiles(e);
3616
3686
  } catch {
3617
- D.value = [];
3687
+ O.value = [];
3618
3688
  } finally {
3619
- je.value = !1;
3689
+ Ae.value = !1;
3620
3690
  }
3621
3691
  }
3622
- function Be(e, t = !1) {
3692
+ function ze(e, t = !1) {
3623
3693
  return w.value.getChatFileDownloadUrl(e, t);
3624
3694
  }
3625
- function Ve(e) {
3695
+ function Be(e) {
3626
3696
  return w.value.getChatFilePreviewUrl(e);
3627
3697
  }
3628
- async function F(e) {
3629
- await w.value.deleteChatFile(e), D.value = D.value.filter((t) => t.documentId !== e);
3698
+ async function I(e) {
3699
+ await w.value.deleteChatFile(e), O.value = O.value.filter((t) => t.documentId !== e);
3630
3700
  }
3631
- async function He(e, t) {
3701
+ async function Ve(e, t) {
3632
3702
  if (!b.value) try {
3633
3703
  let n = await w.value.getChat(e, t);
3634
- if (t !== x.value || T.value.status !== "ready" || T.value.messages.length > 0) return;
3635
- n && (T.value.messages = n.messages, C.value = n.blocked ?? !1);
3704
+ if (t !== x.value || E.value.status !== "ready" || E.value.messages.length > 0) return;
3705
+ n && (E.value.messages = n.messages, C.value = n.blocked ?? !1);
3636
3706
  } catch {}
3637
3707
  }
3638
- let Ue = () => {
3639
- let e = T.value.status;
3708
+ let He = () => {
3709
+ let e = E.value.status;
3640
3710
  return e === "submitted" || e === "streaming";
3641
- }, We = 0, Ge = 0;
3642
- async function Ke() {
3643
- if (b.value || Ue()) return "indeterminate";
3644
- let e = x.value, t = We += 1;
3711
+ }, Ue = 0, We = 0;
3712
+ async function Ge() {
3713
+ if (b.value || He()) return "indeterminate";
3714
+ let e = x.value, t = Ue += 1;
3645
3715
  try {
3646
3716
  let n = await w.value.getChat(o.value, e);
3647
- if (!n || e !== x.value || Ue() || t <= Ge) return "indeterminate";
3648
- Ge = t;
3649
- let r = n.messages, i = Nr(r, T.value.messages);
3650
- return T.value.messages = [...r, ...i], C.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
3717
+ if (!n || e !== x.value || He() || t <= We) return "indeterminate";
3718
+ We = t;
3719
+ let r = n.messages, i = Vr(r, E.value.messages);
3720
+ return E.value.messages = [...r, ...i], C.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
3651
3721
  } catch {}
3652
3722
  return "indeterminate";
3653
3723
  }
3654
- function qe(e) {
3655
- T.value.messages = [...T.value.messages, e];
3724
+ function Ke(e) {
3725
+ E.value.messages = [...E.value.messages, e];
3656
3726
  }
3657
- async function Je(e) {
3727
+ async function qe(e) {
3658
3728
  try {
3659
- O.value = await w.value.getMessageFeedbacks(e);
3729
+ k.value = await w.value.getMessageFeedbacks(e);
3660
3730
  } catch {
3661
- O.value = [];
3731
+ k.value = [];
3662
3732
  }
3663
3733
  }
3664
- function L(e) {
3665
- let t = O.value.findIndex((t) => t.messageId === e.messageId);
3666
- t >= 0 ? O.value[t] = e : O.value.push(e);
3734
+ function R(e) {
3735
+ let t = k.value.findIndex((t) => t.messageId === e.messageId);
3736
+ t >= 0 ? k.value[t] = e : k.value.push(e);
3667
3737
  }
3668
- function Ye(e) {
3669
- let t = Oe.value, n = t.findIndex((t) => t.id === e.id), r = ae(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
3738
+ function Je(e) {
3739
+ let t = De.value, n = t.findIndex((t) => t.id === e.id), r = ae(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
3670
3740
  return {
3671
3741
  userQuestion: ae(i ?? e) ?? "",
3672
3742
  assistantMessage: r
3673
3743
  };
3674
3744
  }
3675
- async function Xe(e, t) {
3745
+ async function Ye(e, t) {
3676
3746
  await Promise.all([
3677
- He(e, t),
3678
- ze(e),
3679
- Je(t)
3680
- ]), Ce.value || _e((e, t) => w.value.reverseGeocode(e, t, r.value)).then((e) => {
3681
- e && (Ce.value = e);
3747
+ Ve(e, t),
3748
+ Re(e),
3749
+ qe(t)
3750
+ ]), T.value || _e((e, t) => w.value.reverseGeocode(e, t, r.value)).then((e) => {
3751
+ e && (T.value = e);
3682
3752
  });
3683
3753
  }
3684
- async function Ze() {
3685
- let e = j.value.trim(), t = M.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
3754
+ async function Xe() {
3755
+ let e = M.value.trim(), t = N.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
3686
3756
  type: "file",
3687
3757
  mediaType: e.mediaSource.mimeType,
3688
3758
  url: e.localUrl,
3689
3759
  filename: e.mediaSource.name,
3690
3760
  providerMetadata: { "8bot": { media: e.mediaSource } }
3691
3761
  }));
3692
- b.value && Oe.value.length > 0 && await et(), N.value = e, Re.value = T.value.messages.length;
3693
- let n = T.value.sendMessage;
3762
+ b.value && De.value.length > 0 && await $e(), P.value = e, Le.value = E.value.messages.length;
3763
+ let n = E.value.sendMessage;
3694
3764
  n({
3695
3765
  text: e,
3696
3766
  files: t.length > 0 ? t : void 0
3697
- }), j.value = "", $e();
3767
+ }), M.value = "", Qe();
3698
3768
  }
3699
- function R(e) {
3769
+ function z(e) {
3700
3770
  let t = e.trim();
3701
3771
  if (!t) return;
3702
- if (T.value.status !== "ready") {
3772
+ if (E.value.status !== "ready") {
3703
3773
  ie.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
3704
3774
  return;
3705
3775
  }
3706
- let n = T.value.sendMessage;
3776
+ let n = E.value.sendMessage;
3707
3777
  n({ text: t });
3708
3778
  }
3709
- async function Qe() {
3710
- let e = N.value.length > 0;
3711
- await T.value.stop(), e && (j.value = N.value, T.value.messages = T.value.messages.slice(0, Re.value), N.value = "");
3779
+ async function Ze() {
3780
+ let e = P.value.length > 0;
3781
+ await E.value.stop(), e && (M.value = P.value, E.value.messages = E.value.messages.slice(0, Le.value), P.value = "");
3712
3782
  }
3713
- fe(() => T.value.status, (e) => {
3714
- e === "ready" && N.value.length > 0 && (N.value = "");
3783
+ fe(() => E.value.status, (e) => {
3784
+ e === "ready" && P.value.length > 0 && (P.value = "");
3715
3785
  });
3716
- function $e(e = !1) {
3717
- for (let t of M.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
3718
- M.value = [], z.value = null;
3786
+ function Qe(e = !1) {
3787
+ for (let t of N.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
3788
+ N.value = [], B.value = null;
3719
3789
  }
3720
- async function et() {
3721
- return N.value = "", await Qe(), x.value = I(), T.value.clearError(), S.value = void 0, C.value = !1, $e(!0), gt("chat"), x.value;
3790
+ async function $e() {
3791
+ return P.value = "", await Ze(), x.value = L(), E.value.clearError(), S.value = void 0, C.value = !1, Qe(!0), ht("chat"), x.value;
3722
3792
  }
3723
- async function tt(e) {
3724
- T.value.status !== "ready" && (N.value = "", await Qe()), await T.value.regenerate(e);
3793
+ async function et(e) {
3794
+ E.value.status !== "ready" && (P.value = "", await Ze()), await E.value.regenerate(e);
3725
3795
  }
3726
- function nt(e) {
3796
+ function tt(e) {
3727
3797
  if (e.tool === "requestGeolocation") {
3728
3798
  let t = e.output;
3729
- "latitude" in t && (Ce.value = {
3799
+ "latitude" in t && (T.value = {
3730
3800
  geolocationLatitude: t.latitude,
3731
3801
  geolocationLongitude: t.longitude,
3732
3802
  geolocationAccuracy: t.accuracy,
3733
3803
  geolocationCity: t.city
3734
3804
  });
3735
3805
  }
3736
- T.value.addToolOutput(e);
3806
+ E.value.addToolOutput(e);
3737
3807
  }
3738
- function rt(e) {
3739
- T.value.addToolApprovalResponse(e);
3808
+ function nt(e) {
3809
+ E.value.addToolApprovalResponse(e);
3740
3810
  }
3741
- let it = v(() => T.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), at = v(() => _.value?.maxFilesPerMessage ?? 5), ot = v(() => _.value?.maxFilesPerChat ?? 20), st = v(() => Math.max(0, Math.min(at.value - M.value.length, ot.value - it.value - M.value.length))), ct = v(() => st.value <= 0), z = y(null), lt = () => {
3742
- z.value = null;
3811
+ let rt = v(() => E.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), it = v(() => _.value?.maxFilesPerMessage ?? 5), at = v(() => _.value?.maxFilesPerChat ?? 20), ot = v(() => Math.max(0, Math.min(it.value - N.value.length, at.value - rt.value - N.value.length))), st = v(() => ot.value <= 0), B = y(null), ct = () => {
3812
+ B.value = null;
3743
3813
  };
3744
- fe(ct, (e) => {
3745
- e || (z.value = null);
3814
+ fe(st, (e) => {
3815
+ e || (B.value = null);
3746
3816
  });
3747
- async function ut(e) {
3748
- if (ct.value) {
3749
- z.value = ot.value - it.value - M.value.length <= at.value - M.value.length ? {
3817
+ async function lt(e) {
3818
+ if (st.value) {
3819
+ B.value = at.value - rt.value - N.value.length <= it.value - N.value.length ? {
3750
3820
  reason: "per-chat",
3751
- max: ot.value
3821
+ max: at.value
3752
3822
  } : {
3753
3823
  reason: "per-message",
3754
- max: at.value
3824
+ max: it.value
3755
3825
  };
3756
3826
  return;
3757
3827
  }
3758
- let t = I(), n = {
3828
+ let t = L(), n = {
3759
3829
  id: t,
3760
3830
  file: e,
3761
3831
  localUrl: URL.createObjectURL(e),
3762
3832
  state: "uploading"
3763
3833
  };
3764
- M.value = [...M.value, n];
3834
+ N.value = [...N.value, n];
3765
3835
  try {
3766
3836
  let n = await w.value.uploadMedia(o.value, x.value, e);
3767
- M.value = M.value.map((e) => e.id === t ? {
3837
+ N.value = N.value.map((e) => e.id === t ? {
3768
3838
  ...e,
3769
3839
  state: "done",
3770
3840
  mediaSource: n
3771
3841
  } : e);
3772
3842
  } catch (e) {
3773
3843
  let n = e instanceof Error ? e.message : "Upload failed";
3774
- M.value = M.value.map((e) => e.id === t ? {
3844
+ N.value = N.value.map((e) => e.id === t ? {
3775
3845
  ...e,
3776
3846
  state: "error",
3777
3847
  error: n
3778
3848
  } : e);
3779
3849
  }
3780
3850
  }
3781
- async function B(e, t) {
3782
- let { userQuestion: n, assistantMessage: r } = Ye(e);
3783
- L(await w.value.submitMessageFeedback({
3851
+ async function V(e, t) {
3852
+ let { userQuestion: n, assistantMessage: r } = Je(e);
3853
+ R(await w.value.submitMessageFeedback({
3784
3854
  messageId: e.id,
3785
3855
  chatId: x.value,
3786
3856
  agentId: o.value,
@@ -3789,75 +3859,75 @@ function Ir(e) {
3789
3859
  assistantMessage: r
3790
3860
  }));
3791
3861
  }
3792
- async function dt(e) {
3793
- await B(e, "upvote");
3862
+ async function ut(e) {
3863
+ await V(e, "upvote");
3794
3864
  }
3795
- async function ft(e) {
3796
- await B(e, "downvote");
3865
+ async function dt(e) {
3866
+ await V(e, "downvote");
3797
3867
  }
3798
- function pt(e) {
3799
- Pe.value = !1, Fe.value = void 0, k.value = e;
3868
+ function ft(e) {
3869
+ Ne.value = !1, Pe.value = void 0, A.value = e;
3800
3870
  }
3801
- async function mt(e) {
3802
- if (k.value) try {
3803
- Ne.value = !0, Pe.value = !1, Fe.value = void 0;
3804
- let { userQuestion: t, assistantMessage: n } = Ye(k.value);
3805
- L(await w.value.submitMessageFeedback({
3806
- messageId: k.value.id,
3871
+ async function pt(e) {
3872
+ if (A.value) try {
3873
+ Me.value = !0, Ne.value = !1, Pe.value = void 0;
3874
+ let { userQuestion: t, assistantMessage: n } = Je(A.value);
3875
+ R(await w.value.submitMessageFeedback({
3876
+ messageId: A.value.id,
3807
3877
  chatId: x.value,
3808
3878
  agentId: o.value,
3809
3879
  userQuestion: t,
3810
3880
  assistantMessage: n,
3811
3881
  comment: e
3812
- })), Pe.value = !0, await Je(x.value);
3882
+ })), Ne.value = !0, await qe(x.value);
3813
3883
  } catch {
3814
- Fe.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
3884
+ Pe.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
3815
3885
  } finally {
3816
- Ne.value = !1;
3886
+ Me.value = !1;
3817
3887
  }
3818
3888
  }
3819
- async function V(e) {
3889
+ async function H(e) {
3820
3890
  try {
3821
- Ie.value = !0, A.value = !1, Le.value = void 0, await w.value.submitLead({
3891
+ Fe.value = !0, j.value = !1, Ie.value = void 0, await w.value.submitLead({
3822
3892
  agentId: o.value,
3823
3893
  chatId: x.value,
3824
3894
  ...e
3825
- }), A.value = !0;
3895
+ }), j.value = !0;
3826
3896
  } catch {
3827
- Le.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
3897
+ Ie.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
3828
3898
  } finally {
3829
- Ie.value = !1;
3899
+ Fe.value = !1;
3830
3900
  }
3831
3901
  }
3832
- async function H(e, t) {
3902
+ async function U(e, t) {
3833
3903
  let n = await w.value.updateChatTitle(o.value, e, t);
3834
- E.value = E.value.map((t) => t.id === e ? {
3904
+ D.value = D.value.map((t) => t.id === e ? {
3835
3905
  ...t,
3836
3906
  title: n.title
3837
3907
  } : t);
3838
3908
  }
3839
- async function ht(e) {
3840
- await w.value.deleteChat(o.value, e), E.value = E.value.filter((t) => t.id !== e), x.value === e && await et();
3909
+ async function mt(e) {
3910
+ await w.value.deleteChat(o.value, e), D.value = D.value.filter((t) => t.id !== e), x.value === e && await $e();
3841
3911
  }
3842
- function gt(e) {
3843
- Me.value = e;
3912
+ function ht(e) {
3913
+ je.value = e;
3844
3914
  }
3845
- let _t;
3846
- function vt(e) {
3915
+ let gt;
3916
+ function _t(e) {
3847
3917
  let t = () => w.value.getChat(o.value, e).then((e) => e !== null);
3848
3918
  return t().catch(() => t().catch(() => !1));
3849
3919
  }
3850
3920
  return fe(l, async (e) => {
3851
- if (!e || e === _t) return;
3852
- let t = _t;
3853
- if (_t = e, t === void 0) return;
3854
- let n = x.value, r = !b.value && await vt(n);
3921
+ if (!e || e === gt) return;
3922
+ let t = gt;
3923
+ if (gt = e, t === void 0) return;
3924
+ let n = x.value, r = !b.value && await _t(n);
3855
3925
  if (l.value === e && x.value === n) {
3856
3926
  if (r) {
3857
- ze(o.value);
3927
+ Re(o.value);
3858
3928
  return;
3859
3929
  }
3860
- E.value = [], O.value = [], D.value = [], await et(), j.value = "";
3930
+ D.value = [], k.value = [], O.value = [], await $e(), M.value = "";
3861
3931
  }
3862
3932
  }), {
3863
3933
  apiClient: w,
@@ -3883,60 +3953,60 @@ function Ir(e) {
3883
3953
  systemTheme: ce,
3884
3954
  hideWelcomeMessage: le,
3885
3955
  isDark: de,
3886
- chat: T,
3887
- messages: Oe,
3888
- conversations: E,
3889
- isLoadingConversations: Ae,
3890
- chatFiles: D,
3891
- isLoadingChatFiles: je,
3892
- input: j,
3893
- pendingAttachments: M,
3894
- isAttachmentLimitReached: ct,
3895
- fileLimitError: z,
3956
+ chat: E,
3957
+ messages: De,
3958
+ conversations: D,
3959
+ isLoadingConversations: ke,
3960
+ chatFiles: O,
3961
+ isLoadingChatFiles: Ae,
3962
+ input: M,
3963
+ pendingAttachments: N,
3964
+ isAttachmentLimitReached: st,
3965
+ fileLimitError: B,
3896
3966
  localChatId: x,
3897
3967
  isConversationBlocked: C,
3898
- inputMessagePlaceholder: ke,
3968
+ inputMessagePlaceholder: Oe,
3899
3969
  chatError: S,
3900
- activeView: Me,
3901
- messageFeedbacks: O,
3902
- feedbackDialogMessage: k,
3903
- isFeedbackSubmitting: Ne,
3904
- isFeedbackSubmitted: Pe,
3905
- feedbackSubmitError: Fe,
3906
- isLeadSubmitted: A,
3907
- isLoadingSubmitLead: Ie,
3908
- submitLeadError: Le,
3909
- buildDeviceContext: we,
3910
- initialize: Xe,
3911
- loadConversations: ze,
3912
- loadChatFiles: P,
3913
- refreshMessages: Ke,
3914
- appendMessage: qe,
3915
- getChatFileUrl: Be,
3916
- getChatFilePreviewUrl: Ve,
3917
- deleteChatFile: F,
3918
- handleSubmit: Ze,
3919
- sendMessage: R,
3920
- stopGeneration: Qe,
3921
- startNewChat: et,
3922
- regenerate: tt,
3923
- addToolOutput: nt,
3924
- addToolApprovalResponse: rt,
3925
- handleFileSelect: ut,
3926
- clearFileLimitError: lt,
3927
- clearPendingAttachments: $e,
3928
- onUpvote: dt,
3929
- onDownvote: ft,
3930
- onFeedback: pt,
3931
- onFeedbackSubmit: mt,
3932
- onLeadSubmit: V,
3933
- navigate: gt,
3934
- renameChatTitle: H,
3935
- deleteChat: ht
3970
+ activeView: je,
3971
+ messageFeedbacks: k,
3972
+ feedbackDialogMessage: A,
3973
+ isFeedbackSubmitting: Me,
3974
+ isFeedbackSubmitted: Ne,
3975
+ feedbackSubmitError: Pe,
3976
+ isLeadSubmitted: j,
3977
+ isLoadingSubmitLead: Fe,
3978
+ submitLeadError: Ie,
3979
+ buildDeviceContext: Ce,
3980
+ initialize: Ye,
3981
+ loadConversations: Re,
3982
+ loadChatFiles: F,
3983
+ refreshMessages: Ge,
3984
+ appendMessage: Ke,
3985
+ getChatFileUrl: ze,
3986
+ getChatFilePreviewUrl: Be,
3987
+ deleteChatFile: I,
3988
+ handleSubmit: Xe,
3989
+ sendMessage: z,
3990
+ stopGeneration: Ze,
3991
+ startNewChat: $e,
3992
+ regenerate: et,
3993
+ addToolOutput: tt,
3994
+ addToolApprovalResponse: nt,
3995
+ handleFileSelect: lt,
3996
+ clearFileLimitError: ct,
3997
+ clearPendingAttachments: Qe,
3998
+ onUpvote: ut,
3999
+ onDownvote: dt,
4000
+ onFeedback: ft,
4001
+ onFeedbackSubmit: pt,
4002
+ onLeadSubmit: H,
4003
+ navigate: ht,
4004
+ renameChatTitle: U,
4005
+ deleteChat: mt
3936
4006
  };
3937
4007
  })();
3938
4008
  }
3939
4009
  //#endregion
3940
- export { I as a, nr as i, Ir as n, Or as r, kr as t };
4010
+ export { L as a, lr as i, Wr as n, Ir as r, Lr as t };
3941
4011
 
3942
- //# sourceMappingURL=useChatbotStore-Rj18hAUf.js.map
4012
+ //# sourceMappingURL=useChatbotStore-Chtzi5jc.js.map