@rpcbase/agents-sdk 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { l as e, o as t, r as n, s as r, u as i } from "./chunk-BO2N2NFS-C0c-iJhV.js";
1
+ import { l as e, o as t, r as n, s as r, u as i } from "./chunk-BO2N2NFS-BXeXbvYU.js";
2
2
  import { i as a, n as o, r as s, s as c, t as l } from "./message-visibility-zTseZa3P.js";
3
3
  import { a as u, i as d, r as f, s as p } from "./models-Bvdwv_p7.js";
4
4
  import { a as m, i as h, n as g, r as _, t as v } from "./openai-reasoning-CmTuRHwM.js";
@@ -55120,16 +55120,47 @@ function VR({ status: e }) {
55120
55120
  };
55121
55121
  }
55122
55122
  //#endregion
55123
+ //#region src/lib/reasoning-parts.ts
55124
+ function HR(e, t) {
55125
+ let n = [];
55126
+ for (let r = 0; r < t.length; r++) {
55127
+ let i = t[r];
55128
+ if (i.type !== "reasoning") {
55129
+ n.push({
55130
+ part: i,
55131
+ key: `message-${e}-part-${r}`
55132
+ });
55133
+ continue;
55134
+ }
55135
+ let a = [i.text ?? ""], o = i.state === "streaming", s = i.providerMetadata, c = r + 1;
55136
+ for (; c < t.length;) {
55137
+ let e = t[c];
55138
+ if (e.type !== "reasoning") break;
55139
+ a.push(e.text ?? ""), o ||= e.state === "streaming", s = e.providerMetadata ?? s, c++;
55140
+ }
55141
+ n.push({
55142
+ part: {
55143
+ ...i,
55144
+ text: a.filter((e) => e.length > 0).join("\n\n"),
55145
+ state: o ? "streaming" : "done",
55146
+ providerMetadata: s
55147
+ },
55148
+ key: `message-${e}-reasoning-${r}`
55149
+ }), r = c - 1;
55150
+ }
55151
+ return n;
55152
+ }
55153
+ //#endregion
55123
55154
  //#region src/lib/tool-approval-decisions.ts
55124
- var HR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), UR = (e) => typeof e == "object" && !!e && !Array.isArray(e), WR = (e) => {
55155
+ var UR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), WR = (e) => typeof e == "object" && !!e && !Array.isArray(e), GR = (e) => {
55125
55156
  let t = /* @__PURE__ */ new Map();
55126
55157
  for (let n of e) {
55127
55158
  if (n.type !== "data-tool-approval-decision") continue;
55128
55159
  let e = n.data;
55129
- UR(e) && typeof e.toolCallId == "string" && typeof e.reason == "string" && e.reason.trim() && t.set(e.toolCallId, e.reason.trim());
55160
+ WR(e) && typeof e.toolCallId == "string" && typeof e.reason == "string" && e.reason.trim() && t.set(e.toolCallId, e.reason.trim());
55130
55161
  }
55131
55162
  return t.size === 0 ? e : e.map((e) => {
55132
- if (!HR(e)) return e;
55163
+ if (!UR(e)) return e;
55133
55164
  let n = e, r = n.toolCallId ? t.get(n.toolCallId) : void 0;
55134
55165
  return !r || !n.approval || n.approval.reason ? e : {
55135
55166
  ...e,
@@ -55139,7 +55170,7 @@ var HR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), UR = (e
55139
55170
  }
55140
55171
  };
55141
55172
  });
55142
- }, GR = he("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
55173
+ }, KR = he("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
55143
55174
  variants: { variant: {
55144
55175
  default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
55145
55176
  secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -55148,15 +55179,15 @@ var HR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), UR = (e
55148
55179
  } },
55149
55180
  defaultVariants: { variant: "default" }
55150
55181
  });
55151
- function KR({ className: e, variant: t, ...n }) {
55182
+ function qR({ className: e, variant: t, ...n }) {
55152
55183
  return /* @__PURE__ */ V("div", {
55153
- className: U(GR({ variant: t }), e),
55184
+ className: U(KR({ variant: t }), e),
55154
55185
  ...n
55155
55186
  });
55156
55187
  }
55157
55188
  //#endregion
55158
55189
  //#region ../../node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs
55159
- function qR(e) {
55190
+ function JR(e) {
55160
55191
  let { open: t, defaultOpen: n, onOpenChange: r, disabled: i } = e, [a, o] = R_({
55161
55192
  controlled: t,
55162
55193
  default: n,
@@ -55190,28 +55221,28 @@ function qR(e) {
55190
55221
  }
55191
55222
  //#endregion
55192
55223
  //#region ../../node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs
55193
- var JR = /* @__PURE__ */ y.createContext(void 0);
55194
- process.env.NODE_ENV !== "production" && (JR.displayName = "CollapsibleRootContext");
55195
- function YR() {
55196
- let e = y.useContext(JR);
55224
+ var YR = /* @__PURE__ */ y.createContext(void 0);
55225
+ process.env.NODE_ENV !== "production" && (YR.displayName = "CollapsibleRootContext");
55226
+ function XR() {
55227
+ let e = y.useContext(YR);
55197
55228
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(15) : "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.");
55198
55229
  return e;
55199
55230
  }
55200
55231
  //#endregion
55201
55232
  //#region ../../node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs
55202
- var XR = function(e) {
55233
+ var ZR = function(e) {
55203
55234
  return e.open = "data-open", e.closed = "data-closed", e[e.startingStyle = Yd.startingStyle] = "startingStyle", e[e.endingStyle = Yd.endingStyle] = "endingStyle", e;
55204
- }({}), ZR = /* @__PURE__ */ function(e) {
55235
+ }({}), QR = /* @__PURE__ */ function(e) {
55205
55236
  return e.panelOpen = "data-panel-open", e;
55206
- }({}), QR = { [XR.open]: "" }, $R = { [XR.closed]: "" }, ez = { open(e) {
55207
- return e ? { [ZR.panelOpen]: "" } : null;
55208
- } }, tz = {
55237
+ }({}), $R = { [ZR.open]: "" }, ez = { [ZR.closed]: "" }, tz = { open(e) {
55238
+ return e ? { [QR.panelOpen]: "" } : null;
55239
+ } }, nz = {
55209
55240
  open(e) {
55210
- return e ? QR : $R;
55241
+ return e ? $R : ez;
55211
55242
  },
55212
55243
  ...Qd
55213
- }, nz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55214
- let { render: n, className: r, defaultOpen: i = !1, disabled: a = !1, onOpenChange: o, open: s, style: c, ...l } = e, u = J(o), d = qR({
55244
+ }, rz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55245
+ let { render: n, className: r, defaultOpen: i = !1, disabled: a = !1, onOpenChange: o, open: s, style: c, ...l } = e, u = J(o), d = JR({
55215
55246
  open: s,
55216
55247
  defaultOpen: i,
55217
55248
  onOpenChange: u,
@@ -55236,21 +55267,21 @@ var XR = function(e) {
55236
55267
  state: f,
55237
55268
  ref: t,
55238
55269
  props: l,
55239
- stateAttributesMapping: tz
55270
+ stateAttributesMapping: nz
55240
55271
  });
55241
- return /* @__PURE__ */ V(JR.Provider, {
55272
+ return /* @__PURE__ */ V(YR.Provider, {
55242
55273
  value: p,
55243
55274
  children: m
55244
55275
  });
55245
55276
  });
55246
- process.env.NODE_ENV !== "production" && (nz.displayName = "CollapsibleRoot");
55277
+ process.env.NODE_ENV !== "production" && (rz.displayName = "CollapsibleRoot");
55247
55278
  //#endregion
55248
55279
  //#region ../../node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs
55249
- var rz = {
55250
- ...ez,
55280
+ var iz = {
55281
+ ...tz,
55251
55282
  ...Qd
55252
- }, iz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55253
- let { panelId: n, open: r, handleTrigger: i, state: a, disabled: o } = YR(), { className: s, disabled: c = o, render: l, nativeButton: u = !0, style: d, ...f } = e, { getButtonProps: p, buttonRef: m } = Ep({
55283
+ }, az = /* @__PURE__ */ y.forwardRef(function(e, t) {
55284
+ let { panelId: n, open: r, handleTrigger: i, state: a, disabled: o } = XR(), { className: s, disabled: c = o, render: l, nativeButton: u = !0, style: d, ...f } = e, { getButtonProps: p, buttonRef: m } = Ep({
55254
55285
  disabled: c,
55255
55286
  focusableWhenDisabled: !0,
55256
55287
  native: u
@@ -55267,18 +55298,18 @@ var rz = {
55267
55298
  f,
55268
55299
  p
55269
55300
  ],
55270
- stateAttributesMapping: rz
55301
+ stateAttributesMapping: iz
55271
55302
  });
55272
55303
  });
55273
- process.env.NODE_ENV !== "production" && (iz.displayName = "CollapsibleTrigger");
55304
+ process.env.NODE_ENV !== "production" && (az.displayName = "CollapsibleTrigger");
55274
55305
  //#endregion
55275
55306
  //#region ../../node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs
55276
- var az = {
55307
+ var oz = {
55277
55308
  height: void 0,
55278
55309
  width: void 0
55279
55310
  };
55280
- function oz(e) {
55281
- let { externalRef: t, hiddenUntilFound: n, id: r, keepMounted: i, mounted: a, onOpenChange: o, open: s, setMounted: c, setOpen: l, transitionStatus: u } = e, d = y.useRef(null), f = y.useRef(null), [p, m] = y.useState(az), h = y.useRef(az), g = y.useRef(!1), _ = y.useRef(s), v = y.useRef(!1), [b, x] = y.useState(!1), S = y.useRef(null), C = So(t, d), w = Oo({
55311
+ function sz(e) {
55312
+ let { externalRef: t, hiddenUntilFound: n, id: r, keepMounted: i, mounted: a, onOpenChange: o, open: s, setMounted: c, setOpen: l, transitionStatus: u } = e, d = y.useRef(null), f = y.useRef(null), [p, m] = y.useState(oz), h = y.useRef(oz), g = y.useRef(!1), _ = y.useRef(s), v = y.useRef(!1), [b, x] = y.useState(!1), S = y.useRef(null), C = So(t, d), w = Oo({
55282
55313
  mounted: a,
55283
55314
  open: s
55284
55315
  }), T = $d(d, !1, !1), E = !s && !a, D = b ? "idle" : u, O = s && (_.current || v.current), k = !s && a && f.current === "css-animation" && p.height === void 0 && p.width === void 0 ? h.current : p, A = n && E && f.current !== "css-animation", j = J((e, t = !0) => {
@@ -55300,37 +55331,37 @@ function oz(e) {
55300
55331
  let e = d.current;
55301
55332
  if (!e) return;
55302
55333
  !s && S.current && M();
55303
- let t = cz(e, O);
55334
+ let t = lz(e, O);
55304
55335
  if (f.current = t, s && u === "idle" && _.current && t === "css-animation") {
55305
- h.current = sz(e);
55336
+ h.current = cz(e);
55306
55337
  return;
55307
55338
  }
55308
55339
  if (s && u === "starting") {
55309
55340
  let n = g.current;
55310
55341
  if (g.current = !1, t === "none") {
55311
- j(sz(e)), x(!0);
55342
+ j(cz(e)), x(!0);
55312
55343
  return;
55313
55344
  }
55314
55345
  if (t === "css-transition") {
55315
- let t = dz(e);
55316
- return j(sz(e)), n ? (N(uz(e, "transition-duration", "0s")), x(!0), t) : t;
55346
+ let t = fz(e);
55347
+ return j(cz(e)), n ? (N(dz(e, "transition-duration", "0s")), x(!0), t) : t;
55317
55348
  }
55318
55349
  if (t === "css-animation") {
55319
- if (j(sz(e)), !n) {
55320
- uz(e, "animation-name", "none")();
55350
+ if (j(cz(e)), !n) {
55351
+ dz(e, "animation-name", "none")();
55321
55352
  return;
55322
55353
  }
55323
- let t = uz(e, "animation-name", "none"), r = uz(e, "animation-duration", "0s");
55354
+ let t = dz(e, "animation-name", "none"), r = dz(e, "animation-duration", "0s");
55324
55355
  t(), N(r), x(!0);
55325
55356
  return;
55326
55357
  }
55327
55358
  }
55328
55359
  if (!s && a && (u === "idle" || u === "starting")) {
55329
55360
  if (_.current = !1, v.current = !1, t === "none") {
55330
- j(az, !1), c(!1);
55361
+ j(oz, !1), c(!1);
55331
55362
  return;
55332
55363
  }
55333
- j(sz(e));
55364
+ j(cz(e));
55334
55365
  return;
55335
55366
  }
55336
55367
  if (u !== "ending") return;
@@ -55338,12 +55369,12 @@ function oz(e) {
55338
55369
  c(!1);
55339
55370
  return;
55340
55371
  }
55341
- let n = sz(e);
55372
+ let n = cz(e);
55342
55373
  if (!((n.height ?? 0) > 0 || (n.width ?? 0) > 0)) {
55343
55374
  c(!1);
55344
55375
  return;
55345
55376
  }
55346
- j(n), t === "css-animation" && uz(e, "animation-name", "none")();
55377
+ j(n), t === "css-animation" && dz(e, "animation-name", "none")();
55347
55378
  }, [
55348
55379
  a,
55349
55380
  s,
@@ -55358,13 +55389,13 @@ function oz(e) {
55358
55389
  open: !0,
55359
55390
  ref: d,
55360
55391
  onComplete() {
55361
- s && j(az, !1);
55392
+ s && j(oz, !1);
55362
55393
  }
55363
55394
  }), y.useEffect(() => {
55364
55395
  if (s || !a || D !== "ending" || !d.current) return;
55365
55396
  let e = new AbortController(), t = -1;
55366
55397
  function n() {
55367
- w.current.open || (c(!1), j(az, !1));
55398
+ w.current.open || (c(!1), j(oz, !1));
55368
55399
  }
55369
55400
  return t = pa.request(() => {
55370
55401
  e.signal.aborted || T(n, e.signal);
@@ -55395,7 +55426,7 @@ function oz(e) {
55395
55426
  return {
55396
55427
  height: k.height,
55397
55428
  props: {
55398
- ...A ? { [XR.startingStyle]: "" } : void 0,
55429
+ ...A ? { [ZR.startingStyle]: "" } : void 0,
55399
55430
  hidden: E,
55400
55431
  id: r
55401
55432
  },
@@ -55406,20 +55437,20 @@ function oz(e) {
55406
55437
  width: k.width
55407
55438
  };
55408
55439
  }
55409
- function sz(e) {
55440
+ function cz(e) {
55410
55441
  return {
55411
55442
  height: e.scrollHeight,
55412
55443
  width: e.scrollWidth
55413
55444
  };
55414
55445
  }
55415
- function cz(e, t = !1) {
55416
- let n = vi(e).getComputedStyle(e), r = (n.animationName.split(",").map((e) => e.trim()).some((e) => e !== "" && e !== "none") || t) && lz(n.animationDuration), i = lz(n.transitionDuration);
55446
+ function lz(e, t = !1) {
55447
+ let n = vi(e).getComputedStyle(e), r = (n.animationName.split(",").map((e) => e.trim()).some((e) => e !== "" && e !== "none") || t) && uz(n.animationDuration), i = uz(n.transitionDuration);
55417
55448
  return r && i ? (process.env.NODE_ENV !== "production" && yc("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.", "Only one of either animation type should be used."), "css-transition") : i ? "css-transition" : r ? "css-animation" : "none";
55418
55449
  }
55419
- function lz(e) {
55450
+ function uz(e) {
55420
55451
  return e.split(",").map((e) => e.trim()).some((e) => e !== "" && Number.parseFloat(e) > 0);
55421
55452
  }
55422
- function uz(e, t, n) {
55453
+ function dz(e, t, n) {
55423
55454
  let r = e.style.getPropertyValue(t), i = e.style.getPropertyPriority(t);
55424
55455
  return e.style.setProperty(t, n), () => {
55425
55456
  if (r === "") {
@@ -55429,7 +55460,7 @@ function uz(e, t, n) {
55429
55460
  e.style.setProperty(t, r, i);
55430
55461
  };
55431
55462
  }
55432
- function dz(e) {
55463
+ function fz(e) {
55433
55464
  let t = {
55434
55465
  "justify-content": e.style.justifyContent,
55435
55466
  "align-items": e.style.alignItems,
@@ -55455,20 +55486,20 @@ function dz(e) {
55455
55486
  }
55456
55487
  //#endregion
55457
55488
  //#region ../../node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs
55458
- var fz = /* @__PURE__ */ function(e) {
55489
+ var pz = /* @__PURE__ */ function(e) {
55459
55490
  return e.collapsiblePanelHeight = "--collapsible-panel-height", e.collapsiblePanelWidth = "--collapsible-panel-width", e;
55460
- }({}), pz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55491
+ }({}), mz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55461
55492
  let { className: n, hiddenUntilFound: r, keepMounted: i, render: a, id: o, style: s, ...c } = e;
55462
55493
  process.env.NODE_ENV !== "production" && K(() => {
55463
55494
  r && i === !1 && yc("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.");
55464
55495
  }, [r, i]);
55465
- let { mounted: l, onOpenChange: u, open: d, panelId: f, setMounted: p, setPanelIdState: m, setOpen: h, state: g, transitionStatus: _ } = YR(), v = r ?? !1, y = i ?? !1;
55496
+ let { mounted: l, onOpenChange: u, open: d, panelId: f, setMounted: p, setPanelIdState: m, setOpen: h, state: g, transitionStatus: _ } = XR(), v = r ?? !1, y = i ?? !1;
55466
55497
  K(() => {
55467
55498
  if (o) return m(o), () => {
55468
55499
  m(void 0);
55469
55500
  };
55470
55501
  }, [o, m]);
55471
- let { height: b, props: x, ref: S, shouldPreventOpenAnimation: C, shouldRender: w, transitionStatus: T, width: E } = oz({
55502
+ let { height: b, props: x, ref: S, shouldPreventOpenAnimation: C, shouldRender: w, transitionStatus: T, width: E } = sz({
55472
55503
  externalRef: t,
55473
55504
  hiddenUntilFound: v,
55474
55505
  id: f,
@@ -55491,45 +55522,45 @@ var fz = /* @__PURE__ */ function(e) {
55491
55522
  props: [
55492
55523
  x,
55493
55524
  { style: {
55494
- [fz.collapsiblePanelHeight]: b === void 0 ? "auto" : `${b}px`,
55495
- [fz.collapsiblePanelWidth]: E === void 0 ? "auto" : `${E}px`
55525
+ [pz.collapsiblePanelHeight]: b === void 0 ? "auto" : `${b}px`,
55526
+ [pz.collapsiblePanelWidth]: E === void 0 ? "auto" : `${E}px`
55496
55527
  } },
55497
55528
  c,
55498
55529
  O ? { style: O } : void 0,
55499
55530
  C ? { style: { animationName: "none" } } : void 0
55500
55531
  ],
55501
- stateAttributesMapping: tz
55532
+ stateAttributesMapping: nz
55502
55533
  });
55503
55534
  return w ? k : null;
55504
55535
  });
55505
- process.env.NODE_ENV !== "production" && (pz.displayName = "CollapsiblePanel");
55536
+ process.env.NODE_ENV !== "production" && (mz.displayName = "CollapsiblePanel");
55506
55537
  //#endregion
55507
55538
  //#region src/components/ui/collapsible.tsx
55508
- var mz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(nz, {
55539
+ var hz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(rz, {
55509
55540
  render: um(e, t),
55510
55541
  ref: r,
55511
55542
  ...n,
55512
55543
  children: t
55513
55544
  }));
55514
- mz.displayName = "Collapsible";
55515
- var hz = y.forwardRef(({ className: e, asChild: t = !1, children: n, ...r }, i) => /* @__PURE__ */ V(iz, {
55545
+ hz.displayName = "Collapsible";
55546
+ var gz = y.forwardRef(({ className: e, asChild: t = !1, children: n, ...r }, i) => /* @__PURE__ */ V(az, {
55516
55547
  className: U("cursor-pointer disabled:cursor-not-allowed", e),
55517
55548
  render: um(t, n),
55518
55549
  ref: i,
55519
55550
  ...r,
55520
55551
  children: n
55521
55552
  }));
55522
- hz.displayName = "CollapsibleTrigger";
55523
- var gz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(pz, {
55553
+ gz.displayName = "CollapsibleTrigger";
55554
+ var _z = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(mz, {
55524
55555
  render: um(e, t),
55525
55556
  ref: r,
55526
55557
  ...n,
55527
55558
  children: t
55528
55559
  }));
55529
- gz.displayName = "CollapsibleContent";
55560
+ _z.displayName = "CollapsibleContent";
55530
55561
  //#endregion
55531
55562
  //#region src/components/ai-elements/code-block.tsx
55532
- var _z = w({ code: "" }), vz = {
55563
+ var vz = w({ code: "" }), yz = {
55533
55564
  name: "line-numbers",
55534
55565
  line(e, t) {
55535
55566
  e.children.unshift({
@@ -55550,8 +55581,8 @@ var _z = w({ code: "" }), vz = {
55550
55581
  });
55551
55582
  }
55552
55583
  };
55553
- async function yz(e, t, n = !1) {
55554
- let r = n ? [vz] : [];
55584
+ async function bz(e, t, n = !1) {
55585
+ let r = n ? [yz] : [];
55555
55586
  return await Promise.all([Je(e, {
55556
55587
  lang: t,
55557
55588
  theme: "one-light",
@@ -55562,11 +55593,11 @@ async function yz(e, t, n = !1) {
55562
55593
  transformers: r
55563
55594
  })]);
55564
55595
  }
55565
- var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, children: i, ...a }) => {
55596
+ var xz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, children: i, ...a }) => {
55566
55597
  let [o, s] = z(""), [c, l] = z("");
55567
55598
  j(() => {
55568
55599
  let r = !1;
55569
- return s(""), l(""), yz(e, t, n).then(([e, t]) => {
55600
+ return s(""), l(""), bz(e, t, n).then(([e, t]) => {
55570
55601
  r || (s(e), l(t));
55571
55602
  }), () => {
55572
55603
  r = !0;
@@ -55577,7 +55608,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55577
55608
  n
55578
55609
  ]);
55579
55610
  let u = o.length > 0 && c.length > 0;
55580
- return /* @__PURE__ */ V(_z.Provider, {
55611
+ return /* @__PURE__ */ V(vz.Provider, {
55581
55612
  value: { code: e },
55582
55613
  children: /* @__PURE__ */ V("div", {
55583
55614
  className: U("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", r),
@@ -55600,10 +55631,10 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55600
55631
  })
55601
55632
  })
55602
55633
  });
55603
- }, xz = ({ className: e, ...t }) => /* @__PURE__ */ V(mz, {
55634
+ }, Sz = ({ className: e, ...t }) => /* @__PURE__ */ V(hz, {
55604
55635
  className: U("group not-prose w-full rounded-md border", e),
55605
55636
  ...t
55606
- }), Sz = {
55637
+ }), Cz = {
55607
55638
  "approval-requested": "Awaiting Approval",
55608
55639
  "approval-responded": "Responded",
55609
55640
  "input-available": "Running",
@@ -55611,7 +55642,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55611
55642
  "output-available": "Completed",
55612
55643
  "output-denied": "Denied",
55613
55644
  "output-error": "Error"
55614
- }, Cz = {
55645
+ }, wz = {
55615
55646
  "approval-requested": /* @__PURE__ */ V(vh, { className: "size-4 text-muted-foreground" }),
55616
55647
  "approval-responded": /* @__PURE__ */ V(hh, { className: "size-4 text-foreground" }),
55617
55648
  "input-available": /* @__PURE__ */ V(bh, { className: "size-4 animate-spin" }),
@@ -55619,13 +55650,13 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55619
55650
  "output-available": /* @__PURE__ */ V(hh, { className: "size-4 text-foreground" }),
55620
55651
  "output-denied": /* @__PURE__ */ V(gh, { className: "size-4 text-muted-foreground" }),
55621
55652
  "output-error": /* @__PURE__ */ V(gh, { className: "size-4 text-destructive" })
55622
- }, wz = (e, t) => t?.isAutomatic && t.approved === !0 ? "Auto-approved" : e === "approval-responded" && t?.approved === !0 ? "Approved" : Sz[e], Tz = (e, t) => /* @__PURE__ */ H(KR, {
55653
+ }, Tz = (e, t) => t?.isAutomatic && t.approved === !0 ? "Auto-approved" : e === "approval-responded" && t?.approved === !0 ? "Approved" : Cz[e], Ez = (e, t) => /* @__PURE__ */ H(qR, {
55623
55654
  className: "gap-1.5 rounded-full text-xs",
55624
55655
  variant: "secondary",
55625
- children: [Cz[e], wz(e, t)]
55626
- }), Ez = ({ className: e, title: t, type: n, state: r, toolName: i, approval: a, ...o }) => {
55656
+ children: [wz[e], Tz(e, t)]
55657
+ }), Dz = ({ className: e, title: t, type: n, state: r, toolName: i, approval: a, ...o }) => {
55627
55658
  let s = n === "dynamic-tool" ? i : n.split("-").slice(1).join("-");
55628
- return /* @__PURE__ */ H(hz, {
55659
+ return /* @__PURE__ */ H(gz, {
55629
55660
  className: U("flex w-full items-center justify-between gap-4 p-3", e),
55630
55661
  ...o,
55631
55662
  children: [/* @__PURE__ */ H("div", {
@@ -55636,15 +55667,15 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55636
55667
  className: "font-medium text-sm",
55637
55668
  children: t ?? s
55638
55669
  }),
55639
- Tz(r, a)
55670
+ Ez(r, a)
55640
55671
  ]
55641
55672
  }), /* @__PURE__ */ V(fh, { className: "size-4 text-muted-foreground group-data-open:rotate-180" })]
55642
55673
  });
55643
- }, Dz = ({ className: e, ...t }) => /* @__PURE__ */ V(gz, {
55674
+ }, Oz = ({ className: e, ...t }) => /* @__PURE__ */ V(_z, {
55644
55675
  className: U("space-y-4 p-4 text-popover-foreground outline-none", e),
55645
55676
  ...t
55646
- }), Oz = 5, kz = ({ className: e, input: t, ...n }) => {
55647
- let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length > Oz && !r;
55677
+ }), kz = 5, Az = ({ className: e, input: t, ...n }) => {
55678
+ let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length > kz && !r;
55648
55679
  return /* @__PURE__ */ H("div", {
55649
55680
  className: U("space-y-2 overflow-hidden", e),
55650
55681
  ...n,
@@ -55653,7 +55684,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55653
55684
  children: "Parameters"
55654
55685
  }), /* @__PURE__ */ H("div", {
55655
55686
  className: "relative rounded-md bg-muted/50",
55656
- children: [/* @__PURE__ */ V(bz, {
55687
+ children: [/* @__PURE__ */ V(xz, {
55657
55688
  className: U("transition-[max-height] duration-200", o && "max-h-[8.25rem]"),
55658
55689
  code: a,
55659
55690
  language: "json"
@@ -55668,13 +55699,13 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55668
55699
  })] })]
55669
55700
  })]
55670
55701
  });
55671
- }, Az = ({ className: e, output: t, errorText: n, ...r }) => {
55702
+ }, jz = ({ className: e, output: t, errorText: n, ...r }) => {
55672
55703
  if (!(t || n)) return null;
55673
55704
  let i = /* @__PURE__ */ V("div", { children: t });
55674
- return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(bz, {
55705
+ return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(xz, {
55675
55706
  code: JSON.stringify(t, null, 2),
55676
55707
  language: "json"
55677
- }) : typeof t == "string" && (i = /* @__PURE__ */ V(bz, {
55708
+ }) : typeof t == "string" && (i = /* @__PURE__ */ V(xz, {
55678
55709
  code: t,
55679
55710
  language: "json"
55680
55711
  })), /* @__PURE__ */ H("div", {
@@ -55688,7 +55719,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55688
55719
  children: [n && /* @__PURE__ */ V("div", { children: n }), i]
55689
55720
  })]
55690
55721
  });
55691
- }, jz = (e, t) => {
55722
+ }, Mz = (e, t) => {
55692
55723
  switch (e) {
55693
55724
  case "create": return t === "present" ? "Creating" : "Created";
55694
55725
  case "update": return t === "present" ? "Updating" : "Updated";
@@ -55696,7 +55727,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55696
55727
  default: return null;
55697
55728
  }
55698
55729
  };
55699
- function Mz({ type: e, result: t, isReadonly: n }) {
55730
+ function Nz({ type: e, result: t, isReadonly: n }) {
55700
55731
  let { setArtifact: r } = DS();
55701
55732
  return /* @__PURE__ */ H("button", {
55702
55733
  className: "flex w-fit cursor-pointer flex-row items-center gap-2 rounded-xl border bg-background px-3 py-2",
@@ -55727,12 +55758,12 @@ function Mz({ type: e, result: t, isReadonly: n }) {
55727
55758
  children: e === "create" ? /* @__PURE__ */ V(ct, {}) : e === "update" ? /* @__PURE__ */ V(ut, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(ht, {}) : null
55728
55759
  }), /* @__PURE__ */ V("div", {
55729
55760
  className: "text-left",
55730
- children: `${jz(e, "past")} "${t.title}"`
55761
+ children: `${Mz(e, "past")} "${t.title}"`
55731
55762
  })]
55732
55763
  });
55733
55764
  }
55734
- var Nz = O(Mz, () => !0);
55735
- function Pz({ type: e, args: t, isReadonly: n }) {
55765
+ var Pz = O(Nz, () => !0);
55766
+ function Fz({ type: e, args: t, isReadonly: n }) {
55736
55767
  let { setArtifact: r } = DS();
55737
55768
  return /* @__PURE__ */ H("button", {
55738
55769
  className: "flex w-fit cursor-pointer flex-row items-start justify-between gap-3 rounded-xl border px-3 py-2",
@@ -55761,7 +55792,7 @@ function Pz({ type: e, args: t, isReadonly: n }) {
55761
55792
  children: e === "create" ? /* @__PURE__ */ V(ct, {}) : e === "update" ? /* @__PURE__ */ V(ut, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(ht, {}) : null
55762
55793
  }), /* @__PURE__ */ V("div", {
55763
55794
  className: "text-left",
55764
- children: `${jz(e, "present")} ${e === "create" && "title" in t && t.title ? `"${t.title}"` : e === "update" && "description" in t ? `"${t.description}"` : e === "request-suggestions" ? "for document" : ""}`
55795
+ children: `${Mz(e, "present")} ${e === "create" && "title" in t && t.title ? `"${t.title}"` : e === "update" && "description" in t ? `"${t.description}"` : e === "request-suggestions" ? "for document" : ""}`
55765
55796
  })]
55766
55797
  }), /* @__PURE__ */ V("div", {
55767
55798
  className: "mt-1 animate-spin",
@@ -55769,10 +55800,10 @@ function Pz({ type: e, args: t, isReadonly: n }) {
55769
55800
  })]
55770
55801
  });
55771
55802
  }
55772
- O(Pz, () => !0);
55803
+ O(Fz, () => !0);
55773
55804
  //#endregion
55774
55805
  //#region src/components/document-preview.tsx
55775
- function Fz({ isReadonly: e, result: t, args: n }) {
55806
+ function Iz({ isReadonly: e, result: t, args: n }) {
55776
55807
  let { artifact: r, setArtifact: i } = DS(), { data: a, isLoading: o } = FR(t?.id ?? "", !!t?.id), s = L(() => a?.[0], [a]), c = R(null);
55777
55808
  if (j(() => {
55778
55809
  let e = c.current?.getBoundingClientRect();
@@ -55789,7 +55820,7 @@ function Fz({ isReadonly: e, result: t, args: n }) {
55789
55820
  let e = t?.kind ?? n?.kind ?? r.kind, i = t?.title ?? n?.title ?? r.title;
55790
55821
  return /* @__PURE__ */ H("div", {
55791
55822
  className: "w-full max-w-[450px]",
55792
- children: [i ? /* @__PURE__ */ V(Rz, {
55823
+ children: [i ? /* @__PURE__ */ V(zz, {
55793
55824
  isStreaming: !0,
55794
55825
  kind: e,
55795
55826
  title: i
@@ -55816,21 +55847,21 @@ function Fz({ isReadonly: e, result: t, args: n }) {
55816
55847
  return l ? /* @__PURE__ */ H("div", {
55817
55848
  className: "relative w-full max-w-[450px] cursor-pointer",
55818
55849
  children: [
55819
- /* @__PURE__ */ V(Lz, {
55850
+ /* @__PURE__ */ V(Rz, {
55820
55851
  hitboxRef: c,
55821
55852
  result: t,
55822
55853
  setArtifact: i
55823
55854
  }),
55824
- /* @__PURE__ */ V(Rz, {
55855
+ /* @__PURE__ */ V(zz, {
55825
55856
  isStreaming: r.status === "streaming",
55826
55857
  kind: l.kind,
55827
55858
  title: l.title
55828
55859
  }),
55829
- /* @__PURE__ */ V(zz, { document: l })
55860
+ /* @__PURE__ */ V(Bz, { document: l })
55830
55861
  ]
55831
- }) : /* @__PURE__ */ V(Iz, { artifactKind: r.kind });
55862
+ }) : /* @__PURE__ */ V(Lz, { artifactKind: r.kind });
55832
55863
  }
55833
- var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55864
+ var Lz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55834
55865
  className: "w-full max-w-[450px]",
55835
55866
  children: [/* @__PURE__ */ H("div", {
55836
55867
  className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
@@ -55845,7 +55876,7 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55845
55876
  className: "h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 bg-muted p-6",
55846
55877
  children: /* @__PURE__ */ V(uR, {})
55847
55878
  })]
55848
- }), Lz = O(({ hitboxRef: e, result: t, setArtifact: n }) => {
55879
+ }), Rz = O(({ hitboxRef: e, result: t, setArtifact: n }) => {
55849
55880
  let r = k((e) => {
55850
55881
  let r = e.currentTarget.getBoundingClientRect();
55851
55882
  n((e) => ({
@@ -55876,7 +55907,7 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55876
55907
  })
55877
55908
  })
55878
55909
  });
55879
- }, (e, t) => !!ye(e.result, t.result)), Rz = O(({ title: e, kind: t, isStreaming: n }) => /* @__PURE__ */ H("div", {
55910
+ }, (e, t) => !!ye(e.result, t.result)), zz = O(({ title: e, kind: t, isStreaming: n }) => /* @__PURE__ */ H("div", {
55880
55911
  className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
55881
55912
  children: [/* @__PURE__ */ H("div", {
55882
55913
  className: "flex flex-row items-center gap-2.5",
@@ -55891,7 +55922,7 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55891
55922
  children: e
55892
55923
  })]
55893
55924
  }), /* @__PURE__ */ V("div", { className: "w-8" })]
55894
- }), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)), zz = ({ document: e }) => {
55925
+ }), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)), Bz = ({ document: e }) => {
55895
55926
  let { artifact: t } = DS(), n = U("h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 dark:bg-muted", {
55896
55927
  "p-4 sm:px-10 sm:py-10": e.kind === "text",
55897
55928
  "p-0": e.kind === "code"
@@ -55936,16 +55967,16 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55936
55967
  e.kind === "code" && /* @__PURE__ */ V("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-muted to-transparent dark:from-muted" })
55937
55968
  ]
55938
55969
  });
55939
- }, Bz = /* @__PURE__ */ y.createContext(void 0);
55940
- process.env.NODE_ENV !== "production" && (Bz.displayName = "AvatarRootContext");
55941
- function Vz() {
55942
- let e = y.useContext(Bz);
55970
+ }, Vz = /* @__PURE__ */ y.createContext(void 0);
55971
+ process.env.NODE_ENV !== "production" && (Vz.displayName = "AvatarRootContext");
55972
+ function Hz() {
55973
+ let e = y.useContext(Vz);
55943
55974
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(13) : "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.");
55944
55975
  return e;
55945
55976
  }
55946
55977
  //#endregion
55947
55978
  //#region ../../node_modules/@base-ui/react/avatar/root/stateAttributesMapping.mjs
55948
- var Hz = { imageLoadingStatus: () => null }, Uz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55979
+ var Uz = { imageLoadingStatus: () => null }, Wz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55949
55980
  let { className: n, render: r, style: i, ...a } = e, [o, s] = y.useState("idle"), c = { imageLoadingStatus: o }, l = y.useMemo(() => ({
55950
55981
  imageLoadingStatus: o,
55951
55982
  setImageLoadingStatus: s
@@ -55953,17 +55984,17 @@ var Hz = { imageLoadingStatus: () => null }, Uz = /* @__PURE__ */ y.forwardRef(f
55953
55984
  state: c,
55954
55985
  ref: t,
55955
55986
  props: a,
55956
- stateAttributesMapping: Hz
55987
+ stateAttributesMapping: Uz
55957
55988
  });
55958
- return /* @__PURE__ */ V(Bz.Provider, {
55989
+ return /* @__PURE__ */ V(Vz.Provider, {
55959
55990
  value: l,
55960
55991
  children: u
55961
55992
  });
55962
55993
  });
55963
- process.env.NODE_ENV !== "production" && (Uz.displayName = "AvatarRoot");
55994
+ process.env.NODE_ENV !== "production" && (Wz.displayName = "AvatarRoot");
55964
55995
  //#endregion
55965
55996
  //#region ../../node_modules/@base-ui/react/avatar/image/useImageLoadingStatus.mjs
55966
- function Wz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
55997
+ function Gz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
55967
55998
  let [a, o] = y.useState("idle");
55968
55999
  return K(() => {
55969
56000
  if (!e && !i) return o("error"), ha;
@@ -55983,11 +56014,11 @@ function Wz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
55983
56014
  }
55984
56015
  //#endregion
55985
56016
  //#region ../../node_modules/@base-ui/react/avatar/image/AvatarImage.mjs
55986
- var Gz = {
55987
- ...Hz,
56017
+ var Kz = {
56018
+ ...Uz,
55988
56019
  ...Qd
55989
- }, Kz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55990
- let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } = Vz(), c = Wz(o.src, o), l = c === "loaded", { mounted: u, transitionStatus: d, setMounted: f } = Jd(l), p = y.useRef(null), m = J((e) => {
56020
+ }, qz = /* @__PURE__ */ y.forwardRef(function(e, t) {
56021
+ let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } = Hz(), c = Gz(o.src, o), l = c === "loaded", { mounted: u, transitionStatus: d, setMounted: f } = Jd(l), p = y.useRef(null), m = J((e) => {
55991
56022
  i?.(e), s(e);
55992
56023
  });
55993
56024
  K(() => {
@@ -56006,54 +56037,54 @@ var Gz = {
56006
56037
  },
56007
56038
  ref: [t, p],
56008
56039
  props: o,
56009
- stateAttributesMapping: Gz,
56040
+ stateAttributesMapping: Kz,
56010
56041
  enabled: u
56011
56042
  });
56012
56043
  return u ? h : null;
56013
56044
  });
56014
- process.env.NODE_ENV !== "production" && (Kz.displayName = "AvatarImage");
56045
+ process.env.NODE_ENV !== "production" && (qz.displayName = "AvatarImage");
56015
56046
  //#endregion
56016
56047
  //#region ../../node_modules/@base-ui/react/avatar/fallback/AvatarFallback.mjs
56017
- var qz = /* @__PURE__ */ y.forwardRef(function(e, t) {
56018
- let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } = Vz(), [c, l] = y.useState(i === void 0), u = la();
56048
+ var Jz = /* @__PURE__ */ y.forwardRef(function(e, t) {
56049
+ let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } = Hz(), [c, l] = y.useState(i === void 0), u = la();
56019
56050
  return y.useEffect(() => (i === void 0 ? l(!0) : u.start(i, () => l(!0)), u.clear), [u, i]), Rc("span", e, {
56020
56051
  state: { imageLoadingStatus: s },
56021
56052
  ref: t,
56022
56053
  props: o,
56023
- stateAttributesMapping: Hz,
56054
+ stateAttributesMapping: Uz,
56024
56055
  enabled: s !== "loaded" && (i === void 0 || c)
56025
56056
  });
56026
56057
  });
56027
- process.env.NODE_ENV !== "production" && (qz.displayName = "AvatarFallback");
56058
+ process.env.NODE_ENV !== "production" && (Jz.displayName = "AvatarFallback");
56028
56059
  //#endregion
56029
56060
  //#region src/components/ui/avatar.tsx
56030
- var Jz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Uz, {
56061
+ var Yz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Wz, {
56031
56062
  ref: n,
56032
56063
  className: U("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", e),
56033
56064
  ...t
56034
56065
  }));
56035
- Jz.displayName = "Avatar";
56036
- var Yz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Kz, {
56066
+ Yz.displayName = "Avatar";
56067
+ var Xz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(qz, {
56037
56068
  ref: n,
56038
56069
  className: U("aspect-square h-full w-full", e),
56039
56070
  ...t
56040
56071
  }));
56041
- Yz.displayName = "AvatarImage";
56042
- var Xz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(qz, {
56072
+ Xz.displayName = "AvatarImage";
56073
+ var Zz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Jz, {
56043
56074
  ref: n,
56044
56075
  className: U("flex h-full w-full items-center justify-center rounded-full bg-muted", e),
56045
56076
  ...t
56046
56077
  }));
56047
- Xz.displayName = "AvatarFallback";
56048
- var Zz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
56078
+ Zz.displayName = "AvatarFallback";
56079
+ var Qz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
56049
56080
  className: U("flex flex-col gap-2 overflow-hidden rounded-lg px-4 py-3 text-foreground text-sm", "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground", "group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground", "is-user:dark", t),
56050
56081
  ...n,
56051
56082
  children: e
56052
- }), Qz = ({ className: e, children: t, ...n }) => /* @__PURE__ */ V("div", {
56083
+ }), $z = ({ className: e, children: t, ...n }) => /* @__PURE__ */ V("div", {
56053
56084
  className: U("flex items-center gap-1", e),
56054
56085
  ...n,
56055
56086
  children: t
56056
- }), $z = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "sm", ...o }) => {
56087
+ }), eB = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "sm", ...o }) => {
56057
56088
  let s = /* @__PURE__ */ H(Im, {
56058
56089
  className: U("relative size-9 p-1.5 text-muted-foreground hover:text-foreground", r),
56059
56090
  size: a,
@@ -56072,7 +56103,7 @@ var Zz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
56072
56103
  };
56073
56104
  //#endregion
56074
56105
  //#region src/components/message-actions.tsx
56075
- function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56106
+ function tB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56076
56107
  let [a, o] = qP(), [s, c] = z();
56077
56108
  j(() => {
56078
56109
  c(void 0);
@@ -56086,31 +56117,31 @@ function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56086
56117
  }
56087
56118
  await o(u), le.success("Copied to clipboard!");
56088
56119
  };
56089
- return t.role === "user" ? /* @__PURE__ */ V(Qz, {
56120
+ return t.role === "user" ? /* @__PURE__ */ V($z, {
56090
56121
  className: "-mr-0.5 justify-end",
56091
56122
  children: /* @__PURE__ */ H("div", {
56092
56123
  className: "relative",
56093
- children: [i && /* @__PURE__ */ V($z, {
56124
+ children: [i && /* @__PURE__ */ V(eB, {
56094
56125
  className: "-left-10 absolute top-0 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/message:opacity-100",
56095
56126
  "data-testid": "message-edit-button",
56096
56127
  onClick: () => i("edit"),
56097
56128
  tooltip: "Edit",
56098
56129
  children: /* @__PURE__ */ V(ut, {})
56099
- }), /* @__PURE__ */ V($z, {
56130
+ }), /* @__PURE__ */ V(eB, {
56100
56131
  onClick: d,
56101
56132
  tooltip: "Copy",
56102
56133
  children: /* @__PURE__ */ V(St, {})
56103
56134
  })]
56104
56135
  })
56105
- }) : /* @__PURE__ */ H(Qz, {
56136
+ }) : /* @__PURE__ */ H($z, {
56106
56137
  className: "-ml-0.5",
56107
56138
  children: [
56108
- /* @__PURE__ */ V($z, {
56139
+ /* @__PURE__ */ V(eB, {
56109
56140
  onClick: d,
56110
56141
  tooltip: "Copy",
56111
56142
  children: /* @__PURE__ */ V(St, {})
56112
56143
  }),
56113
- /* @__PURE__ */ V($z, {
56144
+ /* @__PURE__ */ V(eB, {
56114
56145
  "data-testid": "message-upvote",
56115
56146
  disabled: l?.isUpvoted,
56116
56147
  onClick: () => {
@@ -56138,7 +56169,7 @@ function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56138
56169
  tooltip: "Upvote Response",
56139
56170
  children: /* @__PURE__ */ V(Ct, {})
56140
56171
  }),
56141
- /* @__PURE__ */ V($z, {
56172
+ /* @__PURE__ */ V(eB, {
56142
56173
  "data-testid": "message-downvote",
56143
56174
  disabled: l && !l.isUpvoted,
56144
56175
  onClick: () => {
@@ -56169,15 +56200,15 @@ function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56169
56200
  ]
56170
56201
  });
56171
56202
  }
56172
- var tB = O(eB, (e, t) => !(!ye(e.vote, t.vote) || e.isLoading !== t.isLoading)), nB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("textarea", {
56203
+ var nB = O(tB, (e, t) => !(!ye(e.vote, t.vote) || e.isLoading !== t.isLoading)), rB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("textarea", {
56173
56204
  className: U("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
56174
56205
  ref: n,
56175
56206
  ...t
56176
56207
  }));
56177
- nB.displayName = "Textarea";
56208
+ rB.displayName = "Textarea";
56178
56209
  //#endregion
56179
56210
  //#region src/components/message-editor.tsx
56180
- function rB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56211
+ function iB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56181
56212
  let [i, a] = z(!1), [o, s] = z(Pm(e)), c = R(null), l = k(() => {
56182
56213
  c.current && (c.current.style.height = "auto", c.current.style.height = `${c.current.scrollHeight + 2}px`);
56183
56214
  }, []);
@@ -56189,7 +56220,7 @@ function rB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56189
56220
  };
56190
56221
  return /* @__PURE__ */ H("div", {
56191
56222
  className: "flex w-full flex-col gap-2",
56192
- children: [/* @__PURE__ */ V(nB, {
56223
+ children: [/* @__PURE__ */ V(rB, {
56193
56224
  className: "w-full resize-none overflow-hidden rounded-xl bg-transparent text-base! outline-hidden",
56194
56225
  "data-testid": "message-editor",
56195
56226
  onChange: u,
@@ -56236,7 +56267,7 @@ function rB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56236
56267
  }
56237
56268
  //#endregion
56238
56269
  //#region src/hooks/use-controllable-state.ts
56239
- function iB({ prop: e, defaultProp: t, onChange: n }) {
56270
+ function aB({ prop: e, defaultProp: t, onChange: n }) {
56240
56271
  let [r, i] = y.useState(t), a = e !== void 0, o = a ? e : r;
56241
56272
  return [o, y.useCallback((e) => {
56242
56273
  let t = typeof e == "function" ? e(o) : e;
@@ -56249,33 +56280,33 @@ function iB({ prop: e, defaultProp: t, onChange: n }) {
56249
56280
  }
56250
56281
  //#endregion
56251
56282
  //#region src/components/elements/reasoning.tsx
56252
- var aB = w(null), oB = () => {
56253
- let e = A(aB);
56283
+ var oB = w(null), sB = () => {
56284
+ let e = A(oB);
56254
56285
  if (!e) throw Error("Reasoning components must be used within Reasoning");
56255
56286
  return e;
56256
- }, sB = 1e3, cB = O(({ className: e, isStreaming: t = !1, open: n, defaultOpen: r = !0, onOpenChange: i, duration: a, children: o, ...s }) => {
56257
- let [c, l] = iB({
56287
+ }, cB = 1e3, lB = O(({ className: e, isStreaming: t = !1, open: n, defaultOpen: r = !0, onOpenChange: i, duration: a, children: o, ...s }) => {
56288
+ let [c, l] = aB({
56258
56289
  prop: n,
56259
56290
  defaultProp: r,
56260
56291
  onChange: i
56261
- }), [u, d] = iB({
56292
+ }), [u, d] = aB({
56262
56293
  prop: a,
56263
56294
  defaultProp: void 0
56264
56295
  }), [f, p] = z(null);
56265
56296
  return j(() => {
56266
- t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) / sB)), p(null));
56297
+ t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) / cB)), p(null));
56267
56298
  }, [
56268
56299
  t,
56269
56300
  f,
56270
56301
  d
56271
- ]), /* @__PURE__ */ V(aB.Provider, {
56302
+ ]), /* @__PURE__ */ V(oB.Provider, {
56272
56303
  value: {
56273
56304
  isStreaming: t,
56274
56305
  isOpen: c,
56275
56306
  setIsOpen: l,
56276
56307
  duration: u
56277
56308
  },
56278
- children: /* @__PURE__ */ V(mz, {
56309
+ children: /* @__PURE__ */ V(hz, {
56279
56310
  className: U("not-prose", e),
56280
56311
  onOpenChange: (e) => {
56281
56312
  l(e);
@@ -56285,22 +56316,22 @@ var aB = w(null), oB = () => {
56285
56316
  children: o
56286
56317
  })
56287
56318
  });
56288
- }), lB = O(({ className: e, children: t, ...n }) => {
56289
- let { isStreaming: r, isOpen: i, duration: a } = oB();
56290
- return /* @__PURE__ */ V(hz, {
56319
+ }), uB = O(({ className: e, children: t, ...n }) => {
56320
+ let { isStreaming: r, isOpen: i, duration: a } = sB();
56321
+ return /* @__PURE__ */ V(gz, {
56291
56322
  className: U("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
56292
56323
  ...n,
56293
56324
  children: t ?? /* @__PURE__ */ H(ce, { children: [
56294
56325
  /* @__PURE__ */ V(uh, { className: "size-3" }),
56295
- r ? /* @__PURE__ */ V("span", { children: "Reasoning…" }) : a === void 0 ? /* @__PURE__ */ V("span", { children: "Reasoning" }) : /* @__PURE__ */ H("span", { children: [
56296
- "Reasoning · ",
56326
+ r ? /* @__PURE__ */ V("span", { children: "Reasoning summary…" }) : a === void 0 ? /* @__PURE__ */ V("span", { children: "Reasoning summary" }) : /* @__PURE__ */ H("span", { children: [
56327
+ "Reasoning summary · ",
56297
56328
  a,
56298
56329
  "s"
56299
56330
  ] }),
56300
56331
  /* @__PURE__ */ V(fh, { className: U("size-2.5", i ? "rotate-180" : "rotate-0") })
56301
56332
  ] })
56302
56333
  });
56303
- }), uB = O(({ className: e, children: t, ...n }) => /* @__PURE__ */ V(gz, {
56334
+ }), dB = O(({ className: e, children: t, ...n }) => /* @__PURE__ */ V(_z, {
56304
56335
  className: U("mt-1.5 text-sm text-muted-foreground leading-relaxed outline-hidden", e),
56305
56336
  ...n,
56306
56337
  children: /* @__PURE__ */ V("div", {
@@ -56311,11 +56342,11 @@ var aB = w(null), oB = () => {
56311
56342
  })
56312
56343
  })
56313
56344
  }));
56314
- cB.displayName = "Reasoning", lB.displayName = "ReasoningTrigger", uB.displayName = "ReasoningContent";
56345
+ lB.displayName = "Reasoning", uB.displayName = "ReasoningTrigger", dB.displayName = "ReasoningContent";
56315
56346
  //#endregion
56316
56347
  //#region src/components/message-reasoning.tsx
56317
- var dB = 300;
56318
- function fB({ isStreaming: e, reasoning: t }) {
56348
+ var fB = 300;
56349
+ function pB({ isStreaming: e, reasoning: t }) {
56319
56350
  let [n, r] = z(!1), i = t.trim().length > 0, a = R(null), o = R(e);
56320
56351
  j(() => {
56321
56352
  if (a.current !== null && (window.clearTimeout(a.current), a.current = null), e) {
@@ -56325,7 +56356,7 @@ function fB({ isStreaming: e, reasoning: t }) {
56325
56356
  let t = o.current;
56326
56357
  if (o.current = !1, !(!t || !i || !n)) return a.current = window.setTimeout(() => {
56327
56358
  a.current = null, r(!1);
56328
- }, dB), () => {
56359
+ }, fB), () => {
56329
56360
  a.current !== null && (window.clearTimeout(a.current), a.current = null);
56330
56361
  };
56331
56362
  }, [
@@ -56336,17 +56367,17 @@ function fB({ isStreaming: e, reasoning: t }) {
56336
56367
  let s = (e) => {
56337
56368
  e && a.current !== null && (window.clearTimeout(a.current), a.current = null), r(e);
56338
56369
  };
56339
- return /* @__PURE__ */ H(cB, {
56370
+ return /* @__PURE__ */ H(lB, {
56340
56371
  "data-testid": "message-reasoning",
56341
56372
  isStreaming: e,
56342
56373
  onOpenChange: s,
56343
56374
  open: n,
56344
- children: [/* @__PURE__ */ V(lB, {}), /* @__PURE__ */ V(uB, { children: i || e ? t : "Reasoning summary unavailable." })]
56375
+ children: [/* @__PURE__ */ V(uB, {}), /* @__PURE__ */ V(dB, { children: i || e ? t : "Reasoning summary unavailable." })]
56345
56376
  });
56346
56377
  }
56347
56378
  //#endregion
56348
56379
  //#region src/components/preview-attachment.tsx
56349
- var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56380
+ var mB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56350
56381
  let { name: r, url: i, contentType: a } = e;
56351
56382
  return /* @__PURE__ */ H("div", {
56352
56383
  className: "group relative size-16 overflow-hidden rounded-lg border bg-muted",
@@ -56380,7 +56411,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56380
56411
  })
56381
56412
  ]
56382
56413
  });
56383
- }, mB = ({ size: e = 40 }) => /* @__PURE__ */ H("svg", {
56414
+ }, hB = ({ size: e = 40 }) => /* @__PURE__ */ H("svg", {
56384
56415
  fill: "none",
56385
56416
  height: e,
56386
56417
  viewBox: "0 0 24 24",
@@ -56457,7 +56488,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56457
56488
  y2: "4.22"
56458
56489
  })
56459
56490
  ]
56460
- }), hB = ({ size: e = 40 }) => /* @__PURE__ */ V("svg", {
56491
+ }), gB = ({ size: e = 40 }) => /* @__PURE__ */ V("svg", {
56461
56492
  fill: "none",
56462
56493
  height: e,
56463
56494
  viewBox: "0 0 24 24",
@@ -56466,7 +56497,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56466
56497
  d: "M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z",
56467
56498
  fill: "currentColor"
56468
56499
  })
56469
- }), gB = ({ size: e = 24 }) => /* @__PURE__ */ V("svg", {
56500
+ }), _B = ({ size: e = 24 }) => /* @__PURE__ */ V("svg", {
56470
56501
  fill: "none",
56471
56502
  height: e,
56472
56503
  viewBox: "0 0 24 24",
@@ -56477,7 +56508,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56477
56508
  stroke: "currentColor",
56478
56509
  strokeWidth: "2"
56479
56510
  })
56480
- }), _B = {
56511
+ }), vB = {
56481
56512
  latitude: 37.763283,
56482
56513
  longitude: -122.41286,
56483
56514
  generationtime_ms: .027894974,
@@ -56633,10 +56664,10 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56633
56664
  ]
56634
56665
  }
56635
56666
  };
56636
- function vB(e) {
56667
+ function yB(e) {
56637
56668
  return Math.ceil(e);
56638
56669
  }
56639
- function yB({ weatherAtLocation: e = _B }) {
56670
+ function bB({ weatherAtLocation: e = vB }) {
56640
56671
  let t = Math.max(...e.hourly.temperature_2m.slice(0, 24)), n = Math.min(...e.hourly.temperature_2m.slice(0, 24)), r = ui(new Date(e.current.time), {
56641
56672
  start: new Date(e.daily.sunrise[0]),
56642
56673
  end: new Date(e.daily.sunset[0])
@@ -56669,10 +56700,10 @@ function yB({ weatherAtLocation: e = _B }) {
56669
56700
  className: "flex items-center gap-3",
56670
56701
  children: [/* @__PURE__ */ V("div", {
56671
56702
  className: "text-primary-foreground/90",
56672
- children: V(r ? mB : hB, { size: 32 })
56703
+ children: V(r ? hB : gB, { size: 32 })
56673
56704
  }), /* @__PURE__ */ H("div", {
56674
56705
  className: "font-light text-3xl text-primary-foreground",
56675
- children: [vB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
56706
+ children: [yB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
56676
56707
  className: "text-lg text-primary-foreground/80",
56677
56708
  children: e.current_units.temperature_2m
56678
56709
  })]
@@ -56683,14 +56714,14 @@ function yB({ weatherAtLocation: e = _B }) {
56683
56714
  className: "font-medium text-primary-foreground/90 text-xs",
56684
56715
  children: [
56685
56716
  "H: ",
56686
- vB(t),
56717
+ yB(t),
56687
56718
  "°"
56688
56719
  ]
56689
56720
  }), /* @__PURE__ */ H("div", {
56690
56721
  className: "text-primary-foreground/70 text-xs",
56691
56722
  children: [
56692
56723
  "L: ",
56693
- vB(n),
56724
+ yB(n),
56694
56725
  "°"
56695
56726
  ]
56696
56727
  })]
@@ -56714,11 +56745,11 @@ function yB({ weatherAtLocation: e = _B }) {
56714
56745
  }),
56715
56746
  /* @__PURE__ */ V("div", {
56716
56747
  className: "text-primary-foreground/60",
56717
- children: /* @__PURE__ */ V(gB, { size: 16 })
56748
+ children: /* @__PURE__ */ V(_B, { size: 16 })
56718
56749
  }),
56719
56750
  /* @__PURE__ */ H("div", {
56720
56751
  className: "font-medium text-primary-foreground text-xs",
56721
- children: [vB(l[t]), "°"]
56752
+ children: [yB(l[t]), "°"]
56722
56753
  })
56723
56754
  ]
56724
56755
  }, e);
@@ -56743,7 +56774,7 @@ function yB({ weatherAtLocation: e = _B }) {
56743
56774
  }
56744
56775
  //#endregion
56745
56776
  //#region src/components/message.tsx
56746
- function bB(e) {
56777
+ function xB(e) {
56747
56778
  if (typeof e != "string") return e;
56748
56779
  try {
56749
56780
  return JSON.parse(e);
@@ -56751,8 +56782,8 @@ function bB(e) {
56751
56782
  return e;
56752
56783
  }
56753
56784
  }
56754
- var xB = (e) => typeof e == "object" && !!e, SB = (e) => !xB(e) || typeof e.error != "string" ? null : e.error.trim() || null;
56755
- function CB(e) {
56785
+ var SB = (e) => typeof e == "object" && !!e, CB = (e) => !SB(e) || typeof e.error != "string" ? null : e.error.trim() || null;
56786
+ function wB(e) {
56756
56787
  if (typeof e != "string") return null;
56757
56788
  let t = new Date(e);
56758
56789
  return Number.isNaN(t.getTime()) ? null : {
@@ -56767,14 +56798,14 @@ function CB(e) {
56767
56798
  }).format(t)
56768
56799
  };
56769
56800
  }
56770
- function wB({ approval: e, className: t }) {
56801
+ function TB({ approval: e, className: t }) {
56771
56802
  return e?.reason ? /* @__PURE__ */ V("div", {
56772
56803
  className: U(t, e.isAutomatic && "line-clamp-2"),
56773
56804
  title: e.isAutomatic ? e.reason : void 0,
56774
56805
  children: /* @__PURE__ */ V("span", { children: e.reason })
56775
56806
  }) : null;
56776
56807
  }
56777
- function TB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
56808
+ function EB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
56778
56809
  return /* @__PURE__ */ H("div", {
56779
56810
  className: "flex items-center justify-end gap-2 px-4 py-3",
56780
56811
  children: [/* @__PURE__ */ V(Im, {
@@ -56802,46 +56833,18 @@ function TB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
56802
56833
  })]
56803
56834
  });
56804
56835
  }
56805
- var EB = new Set([
56836
+ var DB = new Set([
56806
56837
  "text",
56807
56838
  "code",
56808
56839
  "image",
56809
56840
  "sheet"
56810
- ]), DB = new Set([
56841
+ ]), OB = new Set([
56811
56842
  "tool-createDocument",
56812
56843
  "tool-updateDocument",
56813
56844
  "tool-editDocument",
56814
56845
  "tool-requestSuggestions"
56815
- ]), OB = (e) => DB.has(e), kB = (e) => !(!xB(e) || !("id" in e || "title" in e || "kind" in e || "content" in e) || "id" in e && typeof e.id != "string" || "title" in e && typeof e.title != "string" || "kind" in e && (typeof e.kind != "string" || !EB.has(e.kind)) || "content" in e && typeof e.content != "string");
56816
- function AB(e, t) {
56817
- let n = [];
56818
- for (let r = 0; r < t.length; r++) {
56819
- let i = t[r];
56820
- if (i.type !== "reasoning") {
56821
- n.push({
56822
- part: i,
56823
- key: `message-${e}-part-${r}`
56824
- });
56825
- continue;
56826
- }
56827
- let a = i.text ?? "", o = r + 1;
56828
- for (; o < t.length;) {
56829
- let e = t[o];
56830
- if (e.type !== "reasoning") break;
56831
- a += e.text ?? "", o++;
56832
- }
56833
- n.push({
56834
- part: {
56835
- ...i,
56836
- text: a
56837
- },
56838
- key: `message-${e}-reasoning-${r}`
56839
- }), r = o - 1;
56840
- }
56841
- return n;
56842
- }
56843
- var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoading: i, renderMessagePart: s, setMessages: c, regenerate: l, isReadonly: u, requiresScrollPadding: d }) => {
56844
- let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ = AB(n.id, WR(n.parts)), v = CB(n.metadata?.createdAt);
56846
+ ]), kB = (e) => OB.has(e), AB = (e) => !(!SB(e) || !("id" in e || "title" in e || "kind" in e || "content" in e) || "id" in e && typeof e.id != "string" || "title" in e && typeof e.title != "string" || "kind" in e && (typeof e.kind != "string" || !DB.has(e.kind)) || "content" in e && typeof e.content != "string"), jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoading: i, renderMessagePart: s, setMessages: c, regenerate: l, isReadonly: u, requiresScrollPadding: d }) => {
56847
+ let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ = HR(n.id, GR(n.parts)), v = wB(n.metadata?.createdAt);
56845
56848
  return st(), /* @__PURE__ */ V("div", {
56846
56849
  className: "group/message fade-in w-full animate-in duration-200",
56847
56850
  "data-role": n.role,
@@ -56864,7 +56867,7 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56864
56867
  g.length > 0 && /* @__PURE__ */ V("div", {
56865
56868
  className: "flex flex-row justify-end gap-2",
56866
56869
  "data-testid": "message-attachments",
56867
- children: g.map((e) => /* @__PURE__ */ V(pB, { attachment: {
56870
+ children: g.map((e) => /* @__PURE__ */ V(mB, { attachment: {
56868
56871
  name: e.filename ?? "file",
56869
56872
  contentType: e.mediaType,
56870
56873
  url: e.url
@@ -56878,12 +56881,12 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56878
56881
  part: t
56879
56882
  });
56880
56883
  if (m !== void 0) return /* @__PURE__ */ V(C, { children: m }, r);
56881
- if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(fB, {
56884
+ if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(pB, {
56882
56885
  isStreaming: t.state === "streaming",
56883
56886
  reasoning: t.text ?? ""
56884
56887
  }, r);
56885
56888
  if (d === "text") {
56886
- if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(Zz, {
56889
+ if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(Qz, {
56887
56890
  className: U({
56888
56891
  "wrap-break-word w-fit rounded-2xl bg-primary px-3 py-2 text-left text-primary-foreground": n.role === "user",
56889
56892
  "bg-transparent px-0 py-0 text-left": n.role === "assistant"
@@ -56895,7 +56898,7 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56895
56898
  className: "flex w-full flex-row items-start gap-3",
56896
56899
  children: [/* @__PURE__ */ V("div", { className: "size-8" }), /* @__PURE__ */ V("div", {
56897
56900
  className: "min-w-0 flex-1",
56898
- children: /* @__PURE__ */ V(rB, {
56901
+ children: /* @__PURE__ */ V(iB, {
56899
56902
  message: n,
56900
56903
  regenerate: l,
56901
56904
  setMessages: c,
@@ -56905,83 +56908,83 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56905
56908
  }, r);
56906
56909
  }
56907
56910
  if (d === "tool-getWeather") {
56908
- let { toolCallId: n, state: r } = t, i = t.approval?.id, a = t.approval, o = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1, s = "w-[min(100%,450px)]", c = SB(t.output);
56911
+ let { toolCallId: n, state: r } = t, i = t.approval?.id, a = t.approval, o = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1, s = "w-[min(100%,450px)]", c = CB(t.output);
56909
56912
  return r === "output-available" ? c ? /* @__PURE__ */ V("div", {
56910
56913
  className: s,
56911
- children: /* @__PURE__ */ H(xz, {
56914
+ children: /* @__PURE__ */ H(Sz, {
56912
56915
  className: "w-full",
56913
56916
  defaultOpen: !0,
56914
- children: [/* @__PURE__ */ V(Ez, {
56917
+ children: [/* @__PURE__ */ V(Dz, {
56915
56918
  approval: a,
56916
56919
  state: "output-error",
56917
56920
  type: "tool-getWeather"
56918
- }), /* @__PURE__ */ V(Dz, { children: /* @__PURE__ */ V(Az, {
56921
+ }), /* @__PURE__ */ V(Oz, { children: /* @__PURE__ */ V(jz, {
56919
56922
  errorText: c,
56920
56923
  output: null
56921
56924
  }) })]
56922
56925
  })
56923
56926
  }, n) : /* @__PURE__ */ V("div", {
56924
56927
  className: s,
56925
- children: /* @__PURE__ */ V(yB, { weatherAtLocation: t.output })
56928
+ children: /* @__PURE__ */ V(bB, { weatherAtLocation: t.output })
56926
56929
  }, n) : r === "output-error" ? /* @__PURE__ */ V("div", {
56927
56930
  className: s,
56928
- children: /* @__PURE__ */ H(xz, {
56931
+ children: /* @__PURE__ */ H(Sz, {
56929
56932
  className: "w-full",
56930
56933
  defaultOpen: !0,
56931
- children: [/* @__PURE__ */ V(Ez, {
56934
+ children: [/* @__PURE__ */ V(Dz, {
56932
56935
  approval: a,
56933
56936
  state: r,
56934
56937
  type: "tool-getWeather"
56935
- }), /* @__PURE__ */ V(Dz, { children: /* @__PURE__ */ V(Az, {
56938
+ }), /* @__PURE__ */ V(Oz, { children: /* @__PURE__ */ V(jz, {
56936
56939
  errorText: t.errorText,
56937
56940
  output: null
56938
56941
  }) })]
56939
56942
  })
56940
56943
  }, n) : o ? /* @__PURE__ */ V("div", {
56941
56944
  className: s,
56942
- children: /* @__PURE__ */ H(xz, {
56945
+ children: /* @__PURE__ */ H(Sz, {
56943
56946
  className: "w-full",
56944
56947
  defaultOpen: !0,
56945
- children: [/* @__PURE__ */ V(Ez, {
56948
+ children: [/* @__PURE__ */ V(Dz, {
56946
56949
  approval: a,
56947
56950
  state: "output-denied",
56948
56951
  type: "tool-getWeather"
56949
- }), /* @__PURE__ */ V(Dz, { children: /* @__PURE__ */ V("div", {
56952
+ }), /* @__PURE__ */ V(Oz, { children: /* @__PURE__ */ V("div", {
56950
56953
  className: "px-4 py-3 text-muted-foreground text-sm",
56951
56954
  children: "Weather lookup was denied."
56952
56955
  }) })]
56953
56956
  })
56954
56957
  }, n) : r === "approval-responded" ? /* @__PURE__ */ V("div", {
56955
56958
  className: s,
56956
- children: /* @__PURE__ */ H(xz, {
56959
+ children: /* @__PURE__ */ H(Sz, {
56957
56960
  className: "w-full",
56958
56961
  defaultOpen: !0,
56959
- children: [/* @__PURE__ */ V(Ez, {
56962
+ children: [/* @__PURE__ */ V(Dz, {
56960
56963
  approval: a,
56961
56964
  state: r,
56962
56965
  type: "tool-getWeather"
56963
- }), /* @__PURE__ */ H(Dz, { children: [/* @__PURE__ */ V(kz, { input: t.input }), /* @__PURE__ */ V(wB, {
56966
+ }), /* @__PURE__ */ H(Oz, { children: [/* @__PURE__ */ V(Az, { input: t.input }), /* @__PURE__ */ V(TB, {
56964
56967
  approval: a,
56965
56968
  className: "text-muted-foreground text-sm"
56966
56969
  })] })]
56967
56970
  })
56968
56971
  }, n) : /* @__PURE__ */ V("div", {
56969
56972
  className: s,
56970
- children: /* @__PURE__ */ H(xz, {
56973
+ children: /* @__PURE__ */ H(Sz, {
56971
56974
  className: "w-full",
56972
56975
  defaultOpen: !0,
56973
- children: [/* @__PURE__ */ V(Ez, {
56976
+ children: [/* @__PURE__ */ V(Dz, {
56974
56977
  approval: a,
56975
56978
  state: r,
56976
56979
  type: "tool-getWeather"
56977
- }), /* @__PURE__ */ H(Dz, { children: [
56978
- (r === "input-available" || r === "approval-requested") && /* @__PURE__ */ V(kz, { input: t.input }),
56979
- r === "approval-requested" && i && !a?.isAutomatic && /* @__PURE__ */ V(TB, {
56980
+ }), /* @__PURE__ */ H(Oz, { children: [
56981
+ (r === "input-available" || r === "approval-requested") && /* @__PURE__ */ V(Az, { input: t.input }),
56982
+ r === "approval-requested" && i && !a?.isAutomatic && /* @__PURE__ */ V(EB, {
56980
56983
  addToolApprovalResponse: e,
56981
56984
  approvalId: i,
56982
56985
  denyReason: "User denied weather lookup"
56983
56986
  }),
56984
- /* @__PURE__ */ V(wB, {
56987
+ /* @__PURE__ */ V(TB, {
56985
56988
  approval: a,
56986
56989
  className: "border-t pt-3 text-muted-foreground text-sm"
56987
56990
  })
@@ -56989,27 +56992,27 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56989
56992
  })
56990
56993
  }, n);
56991
56994
  }
56992
- if (OB(d)) {
56995
+ if (kB(d)) {
56993
56996
  let n = t, { approval: i } = n, a = n.state, o = a === "output-denied" || a === "approval-responded" && i?.approved === !1;
56994
56997
  if (a === "approval-requested" || a === "approval-responded" || a === "output-denied") {
56995
56998
  let t = n.toolCallId ?? r;
56996
56999
  return /* @__PURE__ */ V("div", {
56997
57000
  className: "w-[min(100%,450px)]",
56998
- children: /* @__PURE__ */ H(xz, {
57001
+ children: /* @__PURE__ */ H(Sz, {
56999
57002
  className: "w-full",
57000
57003
  defaultOpen: !0,
57001
- children: [/* @__PURE__ */ V(Ez, {
57004
+ children: [/* @__PURE__ */ V(Dz, {
57002
57005
  approval: i,
57003
57006
  state: o ? "output-denied" : a,
57004
57007
  type: d
57005
- }), /* @__PURE__ */ H(Dz, { children: [
57006
- n.input !== void 0 && /* @__PURE__ */ V(kz, { input: bB(n.input) }),
57007
- a === "approval-requested" && i && !i.isAutomatic && /* @__PURE__ */ V(TB, {
57008
+ }), /* @__PURE__ */ H(Oz, { children: [
57009
+ n.input !== void 0 && /* @__PURE__ */ V(Az, { input: xB(n.input) }),
57010
+ a === "approval-requested" && i && !i.isAutomatic && /* @__PURE__ */ V(EB, {
57008
57011
  addToolApprovalResponse: e,
57009
57012
  approvalId: i.id,
57010
57013
  denyReason: "User denied tool call"
57011
57014
  }),
57012
- /* @__PURE__ */ V(wB, {
57015
+ /* @__PURE__ */ V(TB, {
57013
57016
  approval: i,
57014
57017
  className: "text-muted-foreground text-sm"
57015
57018
  }),
@@ -57023,23 +57026,23 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57023
57026
  }
57024
57027
  }
57025
57028
  if (d === "tool-createDocument") {
57026
- let { toolCallId: e } = t, n = t.output, r = kB(n) ? n : void 0;
57027
- return xB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57029
+ let { toolCallId: e } = t, n = t.output, r = AB(n) ? n : void 0;
57030
+ return SB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57028
57031
  className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
57029
57032
  children: ["Error creating document: ", String(n.error)]
57030
- }, e) : /* @__PURE__ */ V(Fz, {
57033
+ }, e) : /* @__PURE__ */ V(Iz, {
57031
57034
  isReadonly: u,
57032
57035
  result: r
57033
57036
  }, e);
57034
57037
  }
57035
57038
  if (d === "tool-updateDocument") {
57036
- let { toolCallId: e } = t, n = t.output, r = kB(n) ? n : void 0;
57037
- return xB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57039
+ let { toolCallId: e } = t, n = t.output, r = AB(n) ? n : void 0;
57040
+ return SB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57038
57041
  className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
57039
57042
  children: ["Error updating document: ", String(n.error)]
57040
57043
  }, e) : /* @__PURE__ */ V("div", {
57041
57044
  className: "relative",
57042
- children: /* @__PURE__ */ V(Fz, {
57045
+ children: /* @__PURE__ */ V(Iz, {
57043
57046
  args: r ? {
57044
57047
  ...r,
57045
57048
  isUpdate: !0
@@ -57050,13 +57053,13 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57050
57053
  }, e);
57051
57054
  }
57052
57055
  if (d === "tool-editDocument") {
57053
- let { toolCallId: e } = t, n = t.output, r = kB(n) ? n : void 0;
57054
- return xB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57056
+ let { toolCallId: e } = t, n = t.output, r = AB(n) ? n : void 0;
57057
+ return SB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57055
57058
  className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
57056
57059
  children: ["Error editing document: ", String(n.error)]
57057
57060
  }, e) : /* @__PURE__ */ V("div", {
57058
57061
  className: "relative",
57059
- children: /* @__PURE__ */ V(Fz, {
57062
+ children: /* @__PURE__ */ V(Iz, {
57060
57063
  args: r ? {
57061
57064
  ...r,
57062
57065
  isUpdate: !0
@@ -57068,17 +57071,17 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57068
57071
  }
57069
57072
  if (d === "tool-requestSuggestions") {
57070
57073
  let { toolCallId: e, state: n } = t;
57071
- return /* @__PURE__ */ H(xz, {
57074
+ return /* @__PURE__ */ H(Sz, {
57072
57075
  defaultOpen: !0,
57073
- children: [/* @__PURE__ */ V(Ez, {
57076
+ children: [/* @__PURE__ */ V(Dz, {
57074
57077
  state: n,
57075
57078
  type: "tool-requestSuggestions"
57076
- }), /* @__PURE__ */ H(Dz, { children: [n === "input-available" && /* @__PURE__ */ V(kz, { input: t.input }), n === "output-available" && /* @__PURE__ */ V(Az, {
57079
+ }), /* @__PURE__ */ H(Oz, { children: [n === "input-available" && /* @__PURE__ */ V(Az, { input: t.input }), n === "output-available" && /* @__PURE__ */ V(jz, {
57077
57080
  errorText: void 0,
57078
- output: xB(t.output) && "error" in t.output ? /* @__PURE__ */ H("div", {
57081
+ output: SB(t.output) && "error" in t.output ? /* @__PURE__ */ H("div", {
57079
57082
  className: "rounded border p-2 text-destructive",
57080
57083
  children: ["Error: ", String(t.output.error)]
57081
- }) : /* @__PURE__ */ V(Nz, {
57084
+ }) : /* @__PURE__ */ V(Pz, {
57082
57085
  isReadonly: u,
57083
57086
  result: t.output,
57084
57087
  type: "request-suggestions"
@@ -57090,28 +57093,28 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57090
57093
  let n = t, i = n.toolCallId ?? r, a = n.state, o = n.approval?.id, s = typeof n.title == "string" ? n.title : void 0, c = typeof n.toolName == "string" ? n.toolName : "tool", l = n.state === "output-denied" || n.state === "approval-responded" && n.approval?.approved === !1;
57091
57094
  return /* @__PURE__ */ V("div", {
57092
57095
  className: "w-[min(100%,450px)]",
57093
- children: /* @__PURE__ */ H(xz, {
57096
+ children: /* @__PURE__ */ H(Sz, {
57094
57097
  className: "w-full",
57095
57098
  defaultOpen: !0,
57096
- children: [d === "dynamic-tool" ? /* @__PURE__ */ V(Ez, {
57099
+ children: [d === "dynamic-tool" ? /* @__PURE__ */ V(Dz, {
57097
57100
  approval: n.approval,
57098
57101
  state: l ? "output-denied" : a,
57099
57102
  title: s,
57100
57103
  toolName: c,
57101
57104
  type: "dynamic-tool"
57102
- }) : /* @__PURE__ */ V(Ez, {
57105
+ }) : /* @__PURE__ */ V(Dz, {
57103
57106
  approval: n.approval,
57104
57107
  state: l ? "output-denied" : a,
57105
57108
  title: s,
57106
57109
  type: d
57107
- }), /* @__PURE__ */ H(Dz, { children: [
57108
- n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(kz, { input: bB(n.input) }),
57109
- n.state === "approval-requested" && o && !n.approval?.isAutomatic && /* @__PURE__ */ V(TB, {
57110
+ }), /* @__PURE__ */ H(Oz, { children: [
57111
+ n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(Az, { input: xB(n.input) }),
57112
+ n.state === "approval-requested" && o && !n.approval?.isAutomatic && /* @__PURE__ */ V(EB, {
57110
57113
  addToolApprovalResponse: e,
57111
57114
  approvalId: o,
57112
57115
  denyReason: "User denied tool call"
57113
57116
  }),
57114
- /* @__PURE__ */ V(wB, {
57117
+ /* @__PURE__ */ V(TB, {
57115
57118
  approval: n.approval,
57116
57119
  className: "border-t pt-3 text-muted-foreground text-sm"
57117
57120
  }),
@@ -57119,9 +57122,9 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57119
57122
  className: "border-t px-4 py-3 text-muted-foreground text-sm",
57120
57123
  children: "This tool call was denied."
57121
57124
  }),
57122
- !l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(Az, {
57125
+ !l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(jz, {
57123
57126
  errorText: n.errorText,
57124
- output: n.output === void 0 ? null : bB(n.output)
57127
+ output: n.output === void 0 ? null : xB(n.output)
57125
57128
  })
57126
57129
  ] })]
57127
57130
  })
@@ -57131,7 +57134,7 @@ var jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57131
57134
  }),
57132
57135
  !u || v && f === "view" ? /* @__PURE__ */ H("div", {
57133
57136
  className: U("flex items-center gap-1", { "justify-end": n.role === "user" }),
57134
- children: [u ? null : /* @__PURE__ */ V(tB, {
57137
+ children: [u ? null : /* @__PURE__ */ V(nB, {
57135
57138
  chatId: t,
57136
57139
  isLoading: i,
57137
57140
  message: n,
@@ -59809,7 +59812,7 @@ var HU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
59809
59812
  o.defaultValue,
59810
59813
  d
59811
59814
  ]);
59812
- let f = /* @__PURE__ */ V(nB, {
59815
+ let f = /* @__PURE__ */ V(rB, {
59813
59816
  className: U("w-full resize-none rounded-none border-none p-3 shadow-none outline-hidden ring-0", i || a ? "field-sizing-fixed" : "field-sizing-fixed min-h-[calc(1lh+1.5rem)] overflow-y-hidden", "bg-transparent dark:bg-transparent", "focus-visible:ring-0", t),
59814
59817
  name: "message",
59815
59818
  onChange: (t) => {
@@ -60116,12 +60119,12 @@ function iW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60116
60119
  (a.length > 0 || N.length > 0) && /* @__PURE__ */ H("div", {
60117
60120
  className: "flex flex-row items-end gap-2 overflow-x-scroll",
60118
60121
  "data-testid": "attachments-preview",
60119
- children: [a.map((e) => /* @__PURE__ */ V(pB, {
60122
+ children: [a.map((e) => /* @__PURE__ */ V(mB, {
60120
60123
  attachment: e,
60121
60124
  onRemove: () => {
60122
60125
  o((t) => t.filter((t) => t.url !== e.url)), M.current && (M.current.value = "");
60123
60126
  }
60124
- }, e.url)), N.map((e) => /* @__PURE__ */ V(pB, {
60127
+ }, e.url)), N.map((e) => /* @__PURE__ */ V(mB, {
60125
60128
  attachment: {
60126
60129
  url: "",
60127
60130
  name: e,