@multiplayer-app/ai-agent-react 0.1.0-beta.98 → 0.1.0-beta.99

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,7 +1,7 @@
1
1
  import { z as B } from "zod";
2
2
  import { jsx as C, Fragment as en, jsxs as oe } from "react/jsx-runtime";
3
3
  import * as ee from "react";
4
- import rr, { forwardRef as co, createElement as id, useMemo as lt, useState as et, useEffect as $e, useLayoutEffect as uo, memo as Rt, useCallback as Qe, useRef as Fe, createContext as Zd, useContext as Xd, useImperativeHandle as E7, isValidElement as x5 } from "react";
4
+ import rr, { forwardRef as co, createElement as id, useMemo as lt, useState as et, useEffect as $e, useLayoutEffect as uo, memo as Rt, useCallback as Ye, useRef as ze, createContext as Zd, useContext as Xd, useImperativeHandle as E7, isValidElement as x5 } from "react";
5
5
  import { useInfiniteQuery as Qd, useQuery as fr, useQueryClient as E5, useMutation as Gh, QueryClient as M7, QueryClientProvider as S7 } from "@tanstack/react-query";
6
6
  import { create as N7, useStore as A7 } from "zustand";
7
7
  import { nanoid as At } from "nanoid";
@@ -106,6 +106,8 @@ const C7 = B.object({
106
106
  includeTitle: B.boolean().optional(),
107
107
  name: B.string().optional()
108
108
  }).optional(),
109
+ // getMetadata is a function, stripped by Zod and re-attached in AgentRuntime.
110
+ chatMetadata: B.object({}).optional(),
109
111
  defaultContextKey: B.string().optional(),
110
112
  messagesPageSize: B.number().int().positive().max(200).optional(),
111
113
  translations: B.object({
@@ -221,10 +223,10 @@ var qi;
221
223
  (function(e) {
222
224
  e.Asc = "asc", e.Desc = "desc";
223
225
  })(qi || (qi = {}));
224
- var Ye;
226
+ var Ze;
225
227
  (function(e) {
226
228
  e.System = "system", e.User = "user", e.Assistant = "assistant", e.Tool = "tool", e.Reasoning = "reasoning", e.Error = "error";
227
- })(Ye || (Ye = {}));
229
+ })(Ze || (Ze = {}));
228
230
  var kt;
229
231
  (function(e) {
230
232
  e.File = "file", e.Link = "link", e.Artifact = "artifact", e.Context = "context";
@@ -949,7 +951,7 @@ class Zo {
949
951
  const n = await xt.getMessages(t);
950
952
  if (!n.length)
951
953
  return;
952
- const r = n.filter((a) => a.role !== Ye.Error);
954
+ const r = n.filter((a) => a.role !== Ze.Error);
953
955
  r.length !== n.length && await xt.saveMessages(t, r);
954
956
  }
955
957
  async appendErrorMessage(t, n) {
@@ -957,7 +959,7 @@ class Zo {
957
959
  id: At(),
958
960
  chat: t,
959
961
  content: n,
960
- role: Ye.Error,
962
+ role: Ze.Error,
961
963
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
962
964
  reasoning: "",
963
965
  toolCalls: [],
@@ -1007,7 +1009,7 @@ class Zo {
1007
1009
  }
1008
1010
  toOpenAIMessage(t) {
1009
1011
  return {
1010
- role: t.role === Ye.Reasoning ? Ye.Assistant : t.role,
1012
+ role: t.role === Ze.Reasoning ? Ze.Assistant : t.role,
1011
1013
  content: t.content
1012
1014
  };
1013
1015
  }
@@ -1074,7 +1076,7 @@ class Zo {
1074
1076
  const r = await xt.getMessages(n.id), a = {
1075
1077
  id: At(),
1076
1078
  chat: n.id,
1077
- role: Ye.User,
1079
+ role: Ze.User,
1078
1080
  content: t.content,
1079
1081
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1080
1082
  attachments: t.attachments ?? [],
@@ -1085,7 +1087,7 @@ class Zo {
1085
1087
  const o = await this.callModel(i, t.model, t.contextKey), s = {
1086
1088
  id: At(),
1087
1089
  chat: n.id,
1088
- role: Ye.Assistant,
1090
+ role: Ze.Assistant,
1089
1091
  content: o,
1090
1092
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1091
1093
  reasoning: "",
@@ -1107,7 +1109,7 @@ class Zo {
1107
1109
  const s = {
1108
1110
  id: At(),
1109
1111
  chat: i.id,
1110
- role: Ye.User,
1112
+ role: Ze.User,
1111
1113
  content: t.content,
1112
1114
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1113
1115
  attachments: t.attachments
@@ -1150,7 +1152,7 @@ class Zo {
1150
1152
  const w = {
1151
1153
  id: At(),
1152
1154
  chat: i.id,
1153
- role: Ye.Assistant,
1155
+ role: Ze.Assistant,
1154
1156
  content: "",
1155
1157
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
1156
1158
  };
@@ -29897,8 +29899,8 @@ function pp(e, t) {
29897
29899
  Array.from(N).every((fe) => !Nr(K, fe)))
29898
29900
  return;
29899
29901
  if (Ct(D) && Q) {
29900
- const fe = Hn(D), ke = mn(D), Ce = /auto|scroll/, Pe = fe || Ce.test(ke.overflowX), ot = fe || Ce.test(ke.overflowY), We = Pe && D.clientWidth > 0 && D.scrollWidth > D.clientWidth, re = ot && D.clientHeight > 0 && D.scrollHeight > D.clientHeight, Se = ke.direction === "rtl", He = re && (Se ? W.offsetX <= D.offsetWidth - D.clientWidth : W.offsetX > D.clientWidth), Ze = We && W.offsetY > D.clientHeight;
29901
- if (He || Ze)
29902
+ const fe = Hn(D), ke = mn(D), Ce = /auto|scroll/, qe = fe || Ce.test(ke.overflowX), ot = fe || Ce.test(ke.overflowY), We = qe && D.clientWidth > 0 && D.scrollWidth > D.clientWidth, re = ot && D.clientHeight > 0 && D.scrollHeight > D.clientHeight, Se = ke.direction === "rtl", He = re && (Se ? W.offsetX <= D.offsetWidth - D.clientWidth : W.offsetX > D.clientWidth), Xe = We && W.offsetY > D.clientHeight;
29903
+ if (He || Xe)
29902
29904
  return;
29903
29905
  }
29904
29906
  const J = (R = i.current.floatingContext) == null ? void 0 : R.nodeId, O = f && ka(f.nodesRef.current, J).some((fe) => {
@@ -30287,7 +30289,7 @@ function t7e(e, t) {
30287
30289
  }, [e, E]);
30288
30290
  const R = Qt(() => {
30289
30291
  l(D.current === -1 ? null : D.current);
30290
- }), H = U6e(a.domReference), V = ee.useRef(w), D = ee.useRef(d ?? -1), j = ee.useRef(null), N = ee.useRef(!0), K = ee.useRef(R), J = ee.useRef(!!a.floating), O = ee.useRef(n), le = ee.useRef(!1), fe = ee.useRef(!1), ke = Bn(v), Ce = Bn(n), Pe = Bn(z), ot = Bn(d), [We, re] = ee.useState(), [Se, He] = ee.useState(), Ze = Qt(() => {
30292
+ }), H = U6e(a.domReference), V = ee.useRef(w), D = ee.useRef(d ?? -1), j = ee.useRef(null), N = ee.useRef(!0), K = ee.useRef(R), J = ee.useRef(!!a.floating), O = ee.useRef(n), le = ee.useRef(!1), fe = ee.useRef(!1), ke = Bn(v), Ce = Bn(n), qe = Bn(z), ot = Bn(d), [We, re] = ee.useState(), [Se, He] = ee.useState(), Xe = Qt(() => {
30291
30293
  function ce(q) {
30292
30294
  if (f) {
30293
30295
  var Z;
@@ -30298,13 +30300,13 @@ function t7e(e, t) {
30298
30300
  preventScroll: !0
30299
30301
  });
30300
30302
  }
30301
- const Me = o.current[D.current], be = fe.current;
30302
- Me && ce(Me), (le.current ? (q) => q() : requestAnimationFrame)(() => {
30303
- const q = o.current[D.current] || Me;
30303
+ const we = o.current[D.current], be = fe.current;
30304
+ we && ce(we), (le.current ? (q) => q() : requestAnimationFrame)(() => {
30305
+ const q = o.current[D.current] || we;
30304
30306
  if (!q)
30305
30307
  return;
30306
- Me || ce(q);
30307
- const Z = Pe.current;
30308
+ we || ce(q);
30309
+ const Z = qe.current;
30308
30310
  Z && ve && (be || !N.current) && (q.scrollIntoView == null || q.scrollIntoView(typeof Z == "boolean" ? {
30309
30311
  block: "nearest",
30310
30312
  inline: "nearest"
@@ -30318,28 +30320,28 @@ function t7e(e, t) {
30318
30320
  if (s == null) {
30319
30321
  if (le.current = !1, ot.current != null)
30320
30322
  return;
30321
- if (J.current && (D.current = -1, Ze()), (!O.current || !J.current) && V.current && (j.current != null || V.current === !0 && j.current == null)) {
30323
+ if (J.current && (D.current = -1, Xe()), (!O.current || !J.current) && V.current && (j.current != null || V.current === !0 && j.current == null)) {
30322
30324
  let ce = 0;
30323
- const Me = () => {
30324
- o.current[0] == null ? (ce < 2 && (ce ? requestAnimationFrame : queueMicrotask)(Me), ce++) : (D.current = j.current == null || cs(j.current, E, g) || h ? es(o, ke.current) : i2(o, ke.current), j.current = null, R());
30325
+ const we = () => {
30326
+ o.current[0] == null ? (ce < 2 && (ce ? requestAnimationFrame : queueMicrotask)(we), ce++) : (D.current = j.current == null || cs(j.current, E, g) || h ? es(o, ke.current) : i2(o, ke.current), j.current = null, R());
30325
30327
  };
30326
- Me();
30328
+ we();
30327
30329
  }
30328
30330
  } else
30329
- va(o, s) || (D.current = s, Ze(), fe.current = !1);
30330
- }, [u, n, a.floating, s, ot, h, o, E, g, R, Ze, ke]), Et(() => {
30331
+ va(o, s) || (D.current = s, Xe(), fe.current = !1);
30332
+ }, [u, n, a.floating, s, ot, h, o, E, g, R, Xe, ke]), Et(() => {
30331
30333
  var ce;
30332
30334
  if (!u || a.floating || !W || f || !J.current)
30333
30335
  return;
30334
- const Me = W.nodesRef.current, be = (ce = Me.find((Z) => Z.id === Q)) == null || (ce = ce.context) == null ? void 0 : ce.elements.floating, qe = Na(_n(a.floating)), q = Me.some((Z) => Z.context && Nr(Z.context.elements.floating, qe));
30336
+ const we = W.nodesRef.current, be = (ce = we.find((Z) => Z.id === Q)) == null || (ce = ce.context) == null ? void 0 : ce.elements.floating, Be = Na(_n(a.floating)), q = we.some((Z) => Z.context && Nr(Z.context.elements.floating, Be));
30335
30337
  be && !q && N.current && be.focus({
30336
30338
  preventScroll: !0
30337
30339
  });
30338
30340
  }, [u, a.floating, W, Q, f]), Et(() => {
30339
30341
  if (!u || !W || !f || Q)
30340
30342
  return;
30341
- function ce(Me) {
30342
- He(Me.id), P && (P.current = Me);
30343
+ function ce(we) {
30344
+ He(we.id), P && (P.current = we);
30343
30345
  }
30344
30346
  return W.events.on("virtualfocus", ce), () => {
30345
30347
  W.events.off("virtualfocus", ce);
@@ -30353,36 +30355,36 @@ function t7e(e, t) {
30353
30355
  function ce(be) {
30354
30356
  if (!Ce.current)
30355
30357
  return;
30356
- const qe = o.current.indexOf(be);
30357
- qe !== -1 && D.current !== qe && (D.current = qe, R());
30358
+ const Be = o.current.indexOf(be);
30359
+ Be !== -1 && D.current !== Be && (D.current = Be, R());
30358
30360
  }
30359
30361
  return {
30360
30362
  onFocus(be) {
30361
30363
  let {
30362
- currentTarget: qe
30364
+ currentTarget: Be
30363
30365
  } = be;
30364
- le.current = !0, ce(qe);
30366
+ le.current = !0, ce(Be);
30365
30367
  },
30366
30368
  onClick: (be) => {
30367
30369
  let {
30368
- currentTarget: qe
30370
+ currentTarget: Be
30369
30371
  } = be;
30370
- return qe.focus({
30372
+ return Be.focus({
30371
30373
  preventScroll: !0
30372
30374
  });
30373
30375
  },
30374
30376
  // Safari
30375
30377
  onMouseMove(be) {
30376
30378
  let {
30377
- currentTarget: qe
30379
+ currentTarget: Be
30378
30380
  } = be;
30379
- le.current = !0, fe.current = !1, _ && ce(qe);
30381
+ le.current = !0, fe.current = !1, _ && ce(Be);
30380
30382
  },
30381
30383
  onPointerLeave(be) {
30382
30384
  let {
30383
- pointerType: qe
30385
+ pointerType: Be
30384
30386
  } = be;
30385
- if (!(!N.current || qe === "touch") && (le.current = !0, !!_ && (D.current = -1, R(), !f))) {
30387
+ if (!(!N.current || Be === "touch") && (le.current = !0, !!_ && (D.current = -1, R(), !f))) {
30386
30388
  var q;
30387
30389
  (q = Y.current) == null || q.focus({
30388
30390
  preventScroll: !0
@@ -30392,7 +30394,7 @@ function t7e(e, t) {
30392
30394
  };
30393
30395
  }, [Ce, Y, _, o, R, f]), Ke = ee.useCallback(() => {
30394
30396
  var ce;
30395
- return S ?? (W == null || (ce = W.nodesRef.current.find((Me) => Me.id === Q)) == null || (ce = ce.context) == null || (ce = ce.dataRef) == null ? void 0 : ce.current.orientation);
30397
+ return S ?? (W == null || (ce = W.nodesRef.current.find((we) => we.id === Q)) == null || (ce = ce.context) == null || (ce = ce.dataRef) == null ? void 0 : ce.current.orientation);
30396
30398
  }, [Q, W, S]), de = Qt((ce) => {
30397
30399
  if (N.current = !1, le.current = !0, ce.which === 229 || !Ce.current && ce.currentTarget === Y.current)
30398
30400
  return;
@@ -30400,14 +30402,14 @@ function t7e(e, t) {
30400
30402
  ri(ce.key, Ke()) || an(ce), r(!1, ce.nativeEvent, "list-navigation"), Ct(a.domReference) && (f ? W?.events.emit("virtualfocus", a.domReference) : a.domReference.focus());
30401
30403
  return;
30402
30404
  }
30403
- const Me = D.current, be = es(o, v), qe = i2(o, v);
30404
- if (H || (ce.key === "Home" && (an(ce), D.current = be, R()), ce.key === "End" && (an(ce), D.current = qe, R())), x > 1) {
30405
+ const we = D.current, be = es(o, v), Be = i2(o, v);
30406
+ if (H || (ce.key === "Home" && (an(ce), D.current = be, R()), ce.key === "End" && (an(ce), D.current = Be, R())), x > 1) {
30405
30407
  const q = T || Array.from({
30406
30408
  length: o.current.length
30407
30409
  }, () => ({
30408
30410
  width: 1,
30409
30411
  height: 1
30410
- })), Z = e8e(q, x, L), te = Z.findIndex((Le) => Le != null && !Ti(o, Le, v)), pe = Z.reduce((Le, wt, St) => wt != null && !Ti(o, wt, v) ? St : Le, -1), Ee = Z[J6e({
30412
+ })), Z = e8e(q, x, L), te = Z.findIndex((Le) => Le != null && !Ti(o, Le, v)), pe = Z.reduce((Le, wt, St) => wt != null && !Ti(o, wt, v) ? St : Le, -1), Me = Z[J6e({
30411
30413
  current: Z.map((Le) => Le != null ? o.current[Le] : null)
30412
30414
  }, {
30413
30415
  event: ce,
@@ -30421,7 +30423,7 @@ function t7e(e, t) {
30421
30423
  minIndex: te,
30422
30424
  maxIndex: pe,
30423
30425
  prevIndex: t8e(
30424
- D.current > qe ? be : D.current,
30426
+ D.current > Be ? be : D.current,
30425
30427
  q,
30426
30428
  Z,
30427
30429
  x,
@@ -30432,33 +30434,33 @@ function t7e(e, t) {
30432
30434
  ),
30433
30435
  stopEvent: !0
30434
30436
  })];
30435
- if (Ee != null && (D.current = Ee, R()), E === "both")
30437
+ if (Me != null && (D.current = Me, R()), E === "both")
30436
30438
  return;
30437
30439
  }
30438
30440
  if (ri(ce.key, E)) {
30439
30441
  if (an(ce), n && !f && Na(ce.currentTarget.ownerDocument) === ce.currentTarget) {
30440
- D.current = cs(ce.key, E, g) ? be : qe, R();
30442
+ D.current = cs(ce.key, E, g) ? be : Be, R();
30441
30443
  return;
30442
30444
  }
30443
- cs(ce.key, E, g) ? m ? D.current = Me >= qe ? p && Me !== o.current.length ? -1 : be : Nt(o, {
30444
- startingIndex: Me,
30445
+ cs(ce.key, E, g) ? m ? D.current = we >= Be ? p && we !== o.current.length ? -1 : be : Nt(o, {
30446
+ startingIndex: we,
30445
30447
  disabledIndices: v
30446
- }) : D.current = Math.min(qe, Nt(o, {
30447
- startingIndex: Me,
30448
+ }) : D.current = Math.min(Be, Nt(o, {
30449
+ startingIndex: we,
30448
30450
  disabledIndices: v
30449
- })) : m ? D.current = Me <= be ? p && Me !== -1 ? o.current.length : qe : Nt(o, {
30450
- startingIndex: Me,
30451
+ })) : m ? D.current = we <= be ? p && we !== -1 ? o.current.length : Be : Nt(o, {
30452
+ startingIndex: we,
30451
30453
  decrement: !0,
30452
30454
  disabledIndices: v
30453
30455
  }) : D.current = Math.max(be, Nt(o, {
30454
- startingIndex: Me,
30456
+ startingIndex: we,
30455
30457
  decrement: !0,
30456
30458
  disabledIndices: v
30457
30459
  })), va(o, D.current) && (D.current = -1), R();
30458
30460
  }
30459
30461
  }), tt = ee.useMemo(() => f && n && Ae && {
30460
30462
  "aria-activedescendant": Se || We
30461
- }, [f, n, Ae, Se, We]), Xe = ee.useMemo(() => ({
30463
+ }, [f, n, Ae, Se, We]), Qe = ee.useMemo(() => ({
30462
30464
  "aria-orientation": E === "both" ? void 0 : E,
30463
30465
  ...H ? {} : tt,
30464
30466
  onKeyDown: de,
@@ -30469,14 +30471,14 @@ function t7e(e, t) {
30469
30471
  function ce(be) {
30470
30472
  w === "auto" && G6e(be.nativeEvent) && (V.current = !0);
30471
30473
  }
30472
- function Me(be) {
30474
+ function we(be) {
30473
30475
  V.current = w, w === "auto" && W6e(be.nativeEvent) && (V.current = !0);
30474
30476
  }
30475
30477
  return {
30476
30478
  ...tt,
30477
30479
  onKeyDown(be) {
30478
30480
  N.current = !1;
30479
- const qe = be.key.startsWith("Arrow"), q = ["Home", "End"].includes(be.key), Z = qe || q, te = x2(be.key, E, g), pe = E2(be.key, E, g, x), Ee = x2(be.key, Ke(), g), Le = ri(be.key, E), wt = (h ? Ee : Le) || be.key === "Enter" || be.key.trim() === "";
30481
+ const Be = be.key.startsWith("Arrow"), q = ["Home", "End"].includes(be.key), Z = Be || q, te = x2(be.key, E, g), pe = E2(be.key, E, g, x), Me = x2(be.key, Ke(), g), Le = ri(be.key, E), wt = (h ? Me : Le) || be.key === "Enter" || be.key.trim() === "";
30480
30482
  if (f && n) {
30481
30483
  const _t = W?.nodesRef.current.find((qt) => qt.parentId == null), Ot = W && _t ? V6e(W.nodesRef.current, _t.id) : null;
30482
30484
  if (Z && Ot && P) {
@@ -30497,13 +30499,13 @@ function t7e(e, t) {
30497
30499
  }
30498
30500
  return de(be);
30499
30501
  }
30500
- if (!(!n && !b && qe)) {
30502
+ if (!(!n && !b && Be)) {
30501
30503
  if (wt) {
30502
30504
  const _t = ri(be.key, Ke());
30503
30505
  j.current = h && _t ? null : be.key;
30504
30506
  }
30505
30507
  if (h) {
30506
- Ee && (an(be), n ? (D.current = es(o, ke.current), R()) : r(!0, be.nativeEvent, "list-navigation"));
30508
+ Me && (an(be), n ? (D.current = es(o, ke.current), R()) : r(!0, be.nativeEvent, "list-navigation"));
30507
30509
  return;
30508
30510
  }
30509
30511
  Le && (d != null && (D.current = d), an(be), !n && b ? r(!0, be.nativeEvent, "list-navigation") : de(be), n && R());
@@ -30512,17 +30514,17 @@ function t7e(e, t) {
30512
30514
  onFocus() {
30513
30515
  n && !f && (D.current = -1, R());
30514
30516
  },
30515
- onPointerDown: Me,
30516
- onPointerEnter: Me,
30517
+ onPointerDown: we,
30518
+ onPointerEnter: we,
30517
30519
  onMouseDown: ce,
30518
30520
  onClick: ce
30519
30521
  };
30520
30522
  }, [We, tt, x, de, ke, w, o, h, R, r, n, b, E, Ke, g, d, W, f, P]);
30521
30523
  return ee.useMemo(() => u ? {
30522
30524
  reference: je,
30523
- floating: Xe,
30525
+ floating: Qe,
30524
30526
  item: ve
30525
- } : {}, [u, je, Xe, ve]);
30527
+ } : {}, [u, je, Qe, ve]);
30526
30528
  }
30527
30529
  const n7e = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
30528
30530
  function fp(e, t) {
@@ -30675,12 +30677,12 @@ const An = ({
30675
30677
  }
30676
30678
  }, "aria-label": "Copy message", size: "sm" }) });
30677
30679
  }, yn = () => {
30678
- const e = Ue();
30680
+ const e = Pe();
30679
30681
  return { ...od, ...e.config.translations ?? {} };
30680
30682
  }, M2 = 300, d3 = Rt(({ field: e, isExpanded: t, canApply: n, onToggleExpand: r, onApply: a }) => {
30681
- const i = yn(), o = e.value.length > M2, s = o && !t ? `${e.value.slice(0, M2)}...` : e.value, l = Qe(() => {
30683
+ const i = yn(), o = e.value.length > M2, s = o && !t ? `${e.value.slice(0, M2)}...` : e.value, l = Ye(() => {
30682
30684
  r(e.name);
30683
- }, [e.name, r]), u = Qe(() => {
30685
+ }, [e.name, r]), u = Ye(() => {
30684
30686
  a(e);
30685
30687
  }, [e, a]);
30686
30688
  return /* @__PURE__ */ oe("div", { className: "mp-agent-form-proposal-row", children: [
@@ -30733,7 +30735,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
30733
30735
  data: [],
30734
30736
  cursor: { total: 0, skip: 0, limit: e }
30735
30737
  }), CVe = (e) => {
30736
- const t = Ue(), {
30738
+ const t = Pe(), {
30737
30739
  groupId: n,
30738
30740
  parentId: r,
30739
30741
  sourceType: a,
@@ -30776,7 +30778,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
30776
30778
  gcTime: ja
30777
30779
  });
30778
30780
  }, RVe = (e) => {
30779
- const t = Ue(), {
30781
+ const t = Pe(), {
30780
30782
  groupId: n,
30781
30783
  parentId: r,
30782
30784
  sourceType: a,
@@ -30820,7 +30822,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
30820
30822
  hasPreviousPage: i > 1
30821
30823
  };
30822
30824
  }, IVe = (e) => {
30823
- const t = Ue();
30825
+ const t = Pe();
30824
30826
  return fr({
30825
30827
  queryKey: on.detail(e),
30826
30828
  queryFn: async () => !e || !t.transport.getActivity ? null : t.transport.getActivity(e),
@@ -30829,7 +30831,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
30829
30831
  gcTime: ja
30830
30832
  });
30831
30833
  }, OVe = (e) => {
30832
- const t = Ue(), { enabled: n = !0, ...r } = e ?? {};
30834
+ const t = Pe(), { enabled: n = !0, ...r } = e ?? {};
30833
30835
  return fr({
30834
30836
  queryKey: on.summary(r),
30835
30837
  queryFn: async () => t.transport.getActivitySummary ? t.transport.getActivitySummary(r) : [],
@@ -30838,7 +30840,7 @@ const Va = 30 * 1e3, ja = 5 * 60 * 1e3, p3 = 20, on = {
30838
30840
  gcTime: ja
30839
30841
  });
30840
30842
  }, LVe = (e) => {
30841
- const t = Ue(), { enabled: n = !0, groupId: r, parentId: a, from: i, to: o, tenant: s, ownerId: l } = e ?? {}, u = i instanceof Date ? i.toISOString() : i, d = o instanceof Date ? o.toISOString() : o;
30843
+ const t = Pe(), { enabled: n = !0, groupId: r, parentId: a, from: i, to: o, tenant: s, ownerId: l } = e ?? {}, u = i instanceof Date ? i.toISOString() : i, d = o instanceof Date ? o.toISOString() : o;
30842
30844
  return fr({
30843
30845
  queryKey: on.sourceTypes({ groupId: r, parentId: a, from: u, to: d, tenant: s, ownerId: l }),
30844
30846
  queryFn: async () => t.transport.listActivitySourceTypes ? t.transport.listActivitySourceTypes({
@@ -30871,7 +30873,7 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
30871
30873
  infinite: (e) => [...ar.infinites(), e],
30872
30874
  detail: (e) => [...ar.all, "detail", e]
30873
30875
  }, r7e = (e) => e?.pages.flatMap((t) => t.data) ?? [], y3 = (e) => {
30874
- const t = Ue(), n = t.config.user?.id ?? na(), r = t.config.appId, {
30876
+ const t = Pe(), n = t.config.user?.id ?? na(), r = t.config.appId, {
30875
30877
  pageSize: a = yp,
30876
30878
  sortOrder: i = "desc",
30877
30879
  sortField: o = "updatedAt",
@@ -30898,7 +30900,7 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
30898
30900
  gcTime: g3
30899
30901
  });
30900
30902
  }, a7e = y3, DVe = (e) => {
30901
- const t = Ue(), n = t.config.user?.id ?? na(), r = t.config.appId, {
30903
+ const t = Pe(), n = t.config.user?.id ?? na(), r = t.config.appId, {
30902
30904
  page: a,
30903
30905
  pageSize: i = yp,
30904
30906
  sortOrder: o = "desc",
@@ -30937,16 +30939,16 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
30937
30939
  }
30938
30940
  }, [t.data, n]), t;
30939
30941
  }, $Ve = (e = {}, t = []) => {
30940
- const { threshold: n = 50, scrollOnMount: r = !0, observeMutations: a = !0 } = e, i = Fe(null), o = Fe(null), [s, l] = et(!0), u = Fe(!1), d = Fe(!1), p = Fe(), m = Qe(() => {
30942
+ const { threshold: n = 50, scrollOnMount: r = !0, observeMutations: a = !0 } = e, i = ze(null), o = ze(null), [s, l] = et(!0), u = ze(!1), d = ze(!1), p = ze(), m = Ye(() => {
30941
30943
  const f = i.current;
30942
30944
  if (!f)
30943
30945
  return !1;
30944
30946
  const { scrollTop: w, scrollHeight: _, clientHeight: b } = f;
30945
30947
  return _ - w - b <= n;
30946
- }, [n]), h = Qe(() => {
30948
+ }, [n]), h = Ye(() => {
30947
30949
  const f = i.current, w = o.current;
30948
30950
  !f || !w || w.scrollIntoView({ behavior: "auto", block: "end" });
30949
- }, []), g = Qe(() => {
30951
+ }, []), g = Ye(() => {
30950
30952
  const f = m();
30951
30953
  l(f), f && (u.current = !1);
30952
30954
  }, [m]);
@@ -31014,7 +31016,7 @@ const f3 = 30 * 1e3, g3 = 5 * 60 * 1e3, yp = 20, ar = {
31014
31016
  checkIsNearBottom: m
31015
31017
  };
31016
31018
  }, i7e = () => {
31017
- const e = Ue();
31019
+ const e = Pe();
31018
31020
  return fr({
31019
31021
  queryKey: ["mp-agents", "models"],
31020
31022
  queryFn: async () => e.transport.listModels ? await e.transport.listModels() : [],
@@ -31035,7 +31037,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31035
31037
  pageContextDismissed: !1,
31036
31038
  status: "idle"
31037
31039
  /* Idle */
31038
- }), ze = (e, t) => e.chatState[t] ?? k3(), o7e = (e) => N7()((t, n) => ({
31040
+ }), Fe = (e, t) => e.chatState[t] ?? k3(), o7e = (e) => N7()((t, n) => ({
31039
31041
  contextKey: e,
31040
31042
  activeChatId: void 0,
31041
31043
  draftChatKey: `draft-${At()}`,
@@ -31071,7 +31073,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31071
31073
  };
31072
31074
  }),
31073
31075
  upsertChatState: (r, a) => t((i) => {
31074
- const o = ze(i, r), s = typeof a == "function" ? a(o) : a, l = { ...o, ...s };
31076
+ const o = Fe(i, r), s = typeof a == "function" ? a(o) : a, l = { ...o, ...s };
31075
31077
  return {
31076
31078
  chatState: { ...i.chatState, [r]: l }
31077
31079
  };
@@ -31101,7 +31103,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31101
31103
  };
31102
31104
  }),
31103
31105
  pushReasoning: (r, a) => t((i) => {
31104
- const o = ze(i, r);
31106
+ const o = Fe(i, r);
31105
31107
  return {
31106
31108
  chatState: {
31107
31109
  ...i.chatState,
@@ -31110,7 +31112,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31110
31112
  };
31111
31113
  }),
31112
31114
  setArtifacts: (r, a) => t((i) => {
31113
- const o = ze(i, r);
31115
+ const o = Fe(i, r);
31114
31116
  return {
31115
31117
  chatState: {
31116
31118
  ...i.chatState,
@@ -31125,7 +31127,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31125
31127
  }
31126
31128
  })),
31127
31129
  setComposerDraft: (r, a) => t((i) => {
31128
- const o = ze(i, r);
31130
+ const o = Fe(i, r);
31129
31131
  return {
31130
31132
  chatState: {
31131
31133
  ...i.chatState,
@@ -31137,7 +31139,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31137
31139
  };
31138
31140
  }),
31139
31141
  setComposerValue: (r, a) => t((i) => {
31140
- const o = ze(i, r);
31142
+ const o = Fe(i, r);
31141
31143
  return {
31142
31144
  chatState: {
31143
31145
  ...i.chatState,
@@ -31149,7 +31151,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31149
31151
  };
31150
31152
  }),
31151
31153
  addComposerAttachments: (r, a) => t((i) => {
31152
- const o = ze(i, r), s = o.composerDraft.attachments ?? [];
31154
+ const o = Fe(i, r), s = o.composerDraft.attachments ?? [];
31153
31155
  if (!a || a.length === 0)
31154
31156
  return i;
31155
31157
  const l = s.find(ai), u = a.find(ai);
@@ -31181,7 +31183,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31181
31183
  };
31182
31184
  }),
31183
31185
  removeComposerAttachment: (r, a) => t((i) => {
31184
- const o = ze(i, r);
31186
+ const o = Fe(i, r);
31185
31187
  return {
31186
31188
  chatState: {
31187
31189
  ...i.chatState,
@@ -31196,7 +31198,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31196
31198
  };
31197
31199
  }),
31198
31200
  clearComposerDraft: (r) => t((a) => {
31199
- const i = ze(a, r);
31201
+ const i = Fe(a, r);
31200
31202
  return {
31201
31203
  chatState: {
31202
31204
  ...a.chatState,
@@ -31208,7 +31210,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31208
31210
  };
31209
31211
  }),
31210
31212
  setComposerError: (r, a) => t((i) => {
31211
- const o = ze(i, r);
31213
+ const o = Fe(i, r);
31212
31214
  return {
31213
31215
  chatState: {
31214
31216
  ...i.chatState,
@@ -31217,7 +31219,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31217
31219
  };
31218
31220
  }),
31219
31221
  setPageContextDismissed: (r, a) => t((i) => {
31220
- const o = ze(i, r);
31222
+ const o = Fe(i, r);
31221
31223
  return {
31222
31224
  chatState: {
31223
31225
  ...i.chatState,
@@ -31226,7 +31228,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31226
31228
  };
31227
31229
  }),
31228
31230
  setChatStatus: (r, a) => t((i) => {
31229
- const o = ze(i, r);
31231
+ const o = Fe(i, r);
31230
31232
  return {
31231
31233
  chatState: {
31232
31234
  ...i.chatState,
@@ -31235,7 +31237,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31235
31237
  };
31236
31238
  }),
31237
31239
  setPendingAssistant: (r, a) => t((i) => {
31238
- const o = ze(i, r);
31240
+ const o = Fe(i, r);
31239
31241
  return {
31240
31242
  chatState: {
31241
31243
  ...i.chatState,
@@ -31244,7 +31246,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31244
31246
  };
31245
31247
  }),
31246
31248
  commitPendingAssistant: (r) => t((a) => {
31247
- const i = ze(a, r), o = i.pendingAssistant;
31249
+ const i = Fe(a, r), o = i.pendingAssistant;
31248
31250
  if (!o)
31249
31251
  return a;
31250
31252
  if (!a.chats[r])
@@ -31272,7 +31274,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31272
31274
  };
31273
31275
  }),
31274
31276
  enqueueQueuedMessage: (r, a, i) => t((o) => {
31275
- const s = ze(o, r), l = {
31277
+ const s = Fe(o, r), l = {
31276
31278
  id: At(),
31277
31279
  content: a,
31278
31280
  ...i && i.length > 0 ? { attachments: i } : {},
@@ -31286,7 +31288,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31286
31288
  };
31287
31289
  }),
31288
31290
  removeQueuedMessage: (r, a) => t((i) => {
31289
- const o = ze(i, r);
31291
+ const o = Fe(i, r);
31290
31292
  if (o.messageQueue.length === 0)
31291
31293
  return i;
31292
31294
  const s = o.messageQueue.filter((l) => l.id !== a);
@@ -31297,7 +31299,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31297
31299
  moveChatKeyState: (r, a) => t((i) => {
31298
31300
  if (r === a)
31299
31301
  return i;
31300
- const o = ze(i, r), s = ze(i, a);
31302
+ const o = Fe(i, r), s = Fe(i, a);
31301
31303
  if (!(o.messageQueue.length > 0 || !!o.pendingAssistant || o.status !== "idle" || o.composerDraft.value.length > 0 || o.composerDraft.attachments.length > 0 || !!o.composerError))
31302
31304
  return i;
31303
31305
  const u = o.composerDraft.value.length > 0 || o.composerDraft.attachments.length > 0, d = s.composerDraft.value.length > 0 || s.composerDraft.attachments.length > 0, p = {
@@ -31320,11 +31322,11 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31320
31322
  };
31321
31323
  }),
31322
31324
  appendSystemMessage: (r, a) => t((i) => {
31323
- const o = ze(i, r), s = {
31325
+ const o = Fe(i, r), s = {
31324
31326
  id: At(),
31325
31327
  chat: r,
31326
31328
  content: a,
31327
- role: Ye.System,
31329
+ role: Ze.System,
31328
31330
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
31329
31331
  };
31330
31332
  return {
@@ -31335,8 +31337,8 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31335
31337
  };
31336
31338
  }),
31337
31339
  upsertToolCall: (r, a) => t((i) => {
31338
- const o = ze(i, r), s = [...o.messages], l = s.findIndex(
31339
- (u) => u.role === Ye.Tool && u.toolCalls?.some((d) => d.id === a.id)
31340
+ const o = Fe(i, r), s = [...o.messages], l = s.findIndex(
31341
+ (u) => u.role === Ze.Tool && u.toolCalls?.some((d) => d.id === a.id)
31340
31342
  );
31341
31343
  if (l >= 0) {
31342
31344
  const u = s[l], d = (u.toolCalls ?? []).map((p) => p.id === a.id ? a : p);
@@ -31350,7 +31352,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31350
31352
  content: "",
31351
31353
  chat: r,
31352
31354
  toolCalls: [a],
31353
- role: Ye.Tool,
31355
+ role: Ze.Tool,
31354
31356
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
31355
31357
  });
31356
31358
  return {
@@ -31365,13 +31367,13 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31365
31367
  isChatHistoryOpen: !r.isChatHistoryOpen
31366
31368
  })),
31367
31369
  setChatMessages: (r, a) => t((i) => {
31368
- const o = ze(i, r), s = o.messages ?? [], l = typeof a == "function" ? a(s) : a;
31370
+ const o = Fe(i, r), s = o.messages ?? [], l = typeof a == "function" ? a(s) : a;
31369
31371
  return {
31370
31372
  chatState: { ...i.chatState, [r]: { ...o, messages: l } }
31371
31373
  };
31372
31374
  }),
31373
31375
  appendMessagesToChat: (r, a) => t((i) => {
31374
- const o = ze(i, r);
31376
+ const o = Fe(i, r);
31375
31377
  if (a.length === 0)
31376
31378
  return i;
31377
31379
  const s = new Set(a.map((d) => d.id)), u = [...o.messages.filter((d) => !s.has(d.id)), ...a].sort((d, p) => d.createdAt.localeCompare(p.createdAt));
@@ -31383,7 +31385,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31383
31385
  };
31384
31386
  })
31385
31387
  })), s7e = () => {
31386
- const e = ge((s) => s.activeChatId ?? s.draftChatKey), t = ge((s) => ze(s, e).composerDraft), n = ge((s) => s.setComposerValue), r = ge((s) => s.setComposerDraft), a = ge((s) => s.clearComposerDraft), i = ge((s) => s.addComposerAttachments), o = ge((s) => s.removeComposerAttachment);
31388
+ const e = ge((s) => s.activeChatId ?? s.draftChatKey), t = ge((s) => Fe(s, e).composerDraft), n = ge((s) => s.setComposerValue), r = ge((s) => s.setComposerDraft), a = ge((s) => s.clearComposerDraft), i = ge((s) => s.addComposerAttachments), o = ge((s) => s.removeComposerAttachment);
31387
31389
  return {
31388
31390
  chatKey: e,
31389
31391
  draft: t,
@@ -31394,7 +31396,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31394
31396
  removeAttachment: (s) => o(e, s)
31395
31397
  };
31396
31398
  }, l7e = (e) => {
31397
- const t = Ue();
31399
+ const t = Pe();
31398
31400
  return fr({
31399
31401
  queryKey: ["mp-agents", "configurations", e ?? "all"],
31400
31402
  queryFn: async () => t.transport.listAgentConfigurations ? t.transport.listAgentConfigurations(e) : [],
@@ -31402,13 +31404,18 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31402
31404
  refetchOnWindowFocus: !1
31403
31405
  });
31404
31406
  }, zVe = (e, t = []) => {
31405
- const n = Ue(), r = Fe(e), a = Qe(e, t);
31407
+ const n = Pe(), r = ze(e), a = Ye(e, t);
31406
31408
  r.current = a;
31407
- const i = Qe((o) => r.current(o), []);
31409
+ const i = Ye((o) => r.current(o), []);
31408
31410
  $e(() => n.registerPageContextProvider(i), [n, i]);
31411
+ }, FVe = (e, t = []) => {
31412
+ const n = Pe(), r = ze(e), a = Ye(e, t);
31413
+ r.current = a;
31414
+ const i = Ye((o) => r.current(o), []);
31415
+ $e(() => n.registerChatMetadataProvider(i), [n, i]);
31409
31416
  }, c7e = (e) => {
31410
- const t = Ue();
31411
- return Qe(
31417
+ const t = Pe();
31418
+ return Ye(
31412
31419
  (r) => {
31413
31420
  t.events.dispatchEvent(
31414
31421
  new CustomEvent(e, {
@@ -31419,15 +31426,15 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31419
31426
  [t, e]
31420
31427
  );
31421
31428
  }, u7e = (e, t, n = [], r) => {
31422
- const a = Ue(), i = Fe(t), o = Qe(t, n);
31429
+ const a = Pe(), i = ze(t), o = Ye(t, n);
31423
31430
  i.current = o;
31424
- const s = Qe((u) => {
31431
+ const s = Ye((u) => {
31425
31432
  i.current(u);
31426
31433
  }, []), l = typeof r == "boolean" ? r : r?.capture;
31427
31434
  $e(() => (a.events.addEventListener(e, s, r), () => {
31428
31435
  a.events.removeEventListener(e, s, l);
31429
31436
  }), [a, e, s, l]);
31430
- }, FVe = ({ formId: e, onApply: t, enabled: n = !0 }) => {
31437
+ }, PVe = ({ formId: e, onApply: t, enabled: n = !0 }) => {
31431
31438
  u7e(
31432
31439
  D5,
31433
31440
  (r) => {
@@ -31436,7 +31443,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31436
31443
  [n, e, t]
31437
31444
  );
31438
31445
  }, d7e = ["mp-agents", "configurations"], p7e = () => {
31439
- const e = Ue(), t = E5(), n = () => t.invalidateQueries({
31446
+ const e = Pe(), t = E5(), n = () => t.invalidateQueries({
31440
31447
  queryKey: d7e
31441
31448
  }), r = Gh({
31442
31449
  mutationFn: async ({ agentName: i, input: o }) => {
@@ -31458,7 +31465,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31458
31465
  upsertBatch: a
31459
31466
  };
31460
31467
  }, h7e = () => {
31461
- const e = Ue(), t = ge((s) => s.activeChatId), n = ge((s) => s.upsertChat), r = ge((s) => s.setActiveChat), a = ge((s) => s.setChatStatus), o = fr({
31468
+ const e = Pe(), t = ge((s) => s.activeChatId), n = ge((s) => s.upsertChat), r = ge((s) => s.setActiveChat), a = ge((s) => s.setChatStatus), o = fr({
31462
31469
  queryKey: ["mp-agents", "chat", t],
31463
31470
  queryFn: () => e.transport.getChat(t),
31464
31471
  enabled: !!t,
@@ -31471,7 +31478,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31471
31478
  o.isError && t && r(void 0);
31472
31479
  }, [o.isError, t, r]), o;
31473
31480
  }, m7e = 20, v3 = (e) => {
31474
- const t = Ue(), n = t.config.messagesPageSize ?? m7e, r = ge((o) => o.setChatMessages), a = ge((o) => !!(e && o.chats[e])), i = Qd({
31481
+ const t = Pe(), n = t.config.messagesPageSize ?? m7e, r = ge((o) => o.setChatMessages), a = ge((o) => !!(e && o.chats[e])), i = Qd({
31475
31482
  queryKey: ["mp-agents", "messages", e, n],
31476
31483
  queryFn: async ({ pageParam: o }) => {
31477
31484
  if (!e || !t.transport.getMessages)
@@ -31496,7 +31503,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31496
31503
  });
31497
31504
  }, [e, i.data, r]), i;
31498
31505
  }, _3 = () => {
31499
- const e = Ue(), t = e.config.user?.id ?? na(), n = ge((u) => u.activeChatId), r = ge((u) => u.removeChat), a = ge((u) => u.setActiveChat), [i, o] = et(/* @__PURE__ */ new Set()), s = Qe(
31506
+ const e = Pe(), t = e.config.user?.id ?? na(), n = ge((u) => u.activeChatId), r = ge((u) => u.removeChat), a = ge((u) => u.setActiveChat), [i, o] = et(/* @__PURE__ */ new Set()), s = Ye(
31500
31507
  async (u) => {
31501
31508
  o((d) => new Set(d).add(u));
31502
31509
  try {
@@ -31509,7 +31516,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31509
31516
  }
31510
31517
  },
31511
31518
  [n, r, e.queryClient, e.transport, a, t]
31512
- ), l = Qe((u) => i.has(u), [i]);
31519
+ ), l = Ye((u) => i.has(u), [i]);
31513
31520
  return { deleteChat: s, isDeleting: l };
31514
31521
  }, f7e = (e) => {
31515
31522
  if (e == null)
@@ -31545,7 +31552,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31545
31552
  applyAllButtonText: n,
31546
31553
  showStatus: r = !0
31547
31554
  }) => {
31548
- const a = Ue(), i = c7e(D5), o = yn(), s = lt(() => g7e(e), [e]), [l, u] = et(/* @__PURE__ */ new Set()), d = lt(() => {
31555
+ const a = Pe(), i = c7e(D5), o = yn(), s = lt(() => g7e(e), [e]), [l, u] = et(/* @__PURE__ */ new Set()), d = lt(() => {
31549
31556
  const x = (e.output ?? {})?._mp?.lastAction, z = typeof x?.action == "string" ? x.action : void 0, P = typeof x?.at == "string" ? x.at : void 0;
31550
31557
  return { action: z, at: P };
31551
31558
  }, [e.output]), p = lt(() => d.action === "apply", [d.action]), m = lt(() => d.action === "reject", [d.action]), h = lt(
@@ -31556,7 +31563,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31556
31563
  () => e.status === Mt.Succeeded && !!s.formId && s.fields.length > 0 && !p && !m,
31557
31564
  [e.status, s.formId, s.fields.length, p, m]
31558
31565
  );
31559
- const g = Qe(
31566
+ const g = Ye(
31560
31567
  async (E) => {
31561
31568
  s.formId && a.transport.recordToolCallAction && await a.transport.recordToolCallAction(
31562
31569
  t,
@@ -31575,7 +31582,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31575
31582
  );
31576
31583
  },
31577
31584
  [s.formId, s.formName, t, e.id, a.transport]
31578
- ), f = Qe(
31585
+ ), f = Ye(
31579
31586
  async (E) => {
31580
31587
  if (s.formId) {
31581
31588
  i({
@@ -31594,7 +31601,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31594
31601
  },
31595
31602
  [s.formId, s.formName, t, e.id, i, g]
31596
31603
  );
31597
- Qe(async () => {
31604
+ Ye(async () => {
31598
31605
  if (s.formId)
31599
31606
  try {
31600
31607
  await g({ action: "reject", fields: s.fields });
@@ -31602,7 +31609,7 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31602
31609
  return;
31603
31610
  }
31604
31611
  }, [s.formId, s.fields, g]);
31605
- const w = Qe((E) => {
31612
+ const w = Ye((E) => {
31606
31613
  u((S) => {
31607
31614
  if (S.has(E)) {
31608
31615
  if (S.size === 1)
@@ -31614,12 +31621,12 @@ const Ca = (e) => e === Kr.Streaming || e === Kr.Processing || e === Kr.WaitingF
31614
31621
  return x.add(E), x;
31615
31622
  }
31616
31623
  });
31617
- }, []), _ = Qe(
31624
+ }, []), _ = Ye(
31618
31625
  (E) => {
31619
31626
  f([E]);
31620
31627
  },
31621
31628
  [f]
31622
- ), b = Qe(() => {
31629
+ ), b = Ye(() => {
31623
31630
  f(s.fields);
31624
31631
  }, [f, s.fields]), v = s.formName ? `${o.formProposalHeaderPrefix} ${s.formName}` : `${o.formProposalHeaderPrefix} ${s.formId}`;
31625
31632
  return e.status === Mt.Failed && e.error ? /* @__PURE__ */ C("div", { className: "mp-agent-tool-body", children: /* @__PURE__ */ C("div", { className: "mp-agent-tool-simple-message", children: o.formProposalFailed }) }) : e.status !== Mt.Succeeded ? /* @__PURE__ */ C("div", { className: "mp-agent-tool-simple-message", children: o.formProposalPreparing }) : !s.formId || s.fields.length === 0 ? /* @__PURE__ */ C("div", { className: "mp-agent-tool-simple-message", children: o.formProposalNone }) : /* @__PURE__ */ oe("div", { className: "mp-agent-tool-body", children: [
@@ -31779,6 +31786,8 @@ class w7e {
31779
31786
  tools: t.tools,
31780
31787
  // Preserve optional pageContext hooks which are functions and can't be validated by Zod
31781
31788
  pageContext: t.pageContext ? { ...n.pageContext, ...t.pageContext } : n.pageContext,
31789
+ // getMetadata is a function stripped by Zod; re-attach from rawConfig.
31790
+ chatMetadata: t.chatMetadata ? { ...n.chatMetadata, ...t.chatMetadata } : n.chatMetadata,
31782
31791
  // Merge user translations with defaults
31783
31792
  translations: t.translations ? { ...od, ...t.translations } : od,
31784
31793
  // Preserve onError callback from transport config (stripped by Zod since it's a function)
@@ -31811,6 +31820,7 @@ class w7e {
31811
31820
  toolRendererMap = /* @__PURE__ */ new Map();
31812
31821
  storeRef;
31813
31822
  pageContextProviders = /* @__PURE__ */ new Set();
31823
+ chatMetadataProviders = /* @__PURE__ */ new Set();
31814
31824
  createTransport(t) {
31815
31825
  return t.mode === "proxy" ? new jr(t) : new Zo(t);
31816
31826
  }
@@ -31920,6 +31930,41 @@ class w7e {
31920
31930
  this.pageContextProviders.delete(t);
31921
31931
  };
31922
31932
  }
31933
+ /**
31934
+ * Register a provider contributing chat-level metadata, merged into a new
31935
+ * chat's `metadata` at creation time. Intended to be called by route/page
31936
+ * components (via the `useChatMetadata` hook).
31937
+ *
31938
+ * The returned cleanup function MUST be called (on unmount) to avoid leaks.
31939
+ */
31940
+ registerChatMetadataProvider(t) {
31941
+ return this.chatMetadataProviders.add(t), () => {
31942
+ this.chatMetadataProviders.delete(t);
31943
+ };
31944
+ }
31945
+ /**
31946
+ * Resolve the metadata to persist on a newly created chat by merging the
31947
+ * config-level `chatMetadata.getMetadata` hook with all registered providers.
31948
+ * Returns undefined when nothing contributed (so callers can omit the field).
31949
+ */
31950
+ getChatMetadata(t) {
31951
+ const n = {};
31952
+ let r = !1;
31953
+ const a = (o) => {
31954
+ o && typeof o == "object" && (Object.assign(n, o), r = !0);
31955
+ }, i = this.config.chatMetadata?.getMetadata;
31956
+ if (i)
31957
+ try {
31958
+ a(i(t));
31959
+ } catch {
31960
+ }
31961
+ for (const o of this.chatMetadataProviders)
31962
+ try {
31963
+ a(o(t));
31964
+ } catch {
31965
+ }
31966
+ return r ? n : void 0;
31967
+ }
31923
31968
  getPageContextInput() {
31924
31969
  if (typeof window > "u")
31925
31970
  return {};
@@ -33328,10 +33373,10 @@ const k_e = [
33328
33373
  "removeListener"
33329
33374
  // used by the Node.js EventEmitter
33330
33375
  ], v_e = 5;
33331
- var Be;
33376
+ var Ue;
33332
33377
  (function(e) {
33333
33378
  e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
33334
- })(Be || (Be = {}));
33379
+ })(Ue || (Ue = {}));
33335
33380
  class __e {
33336
33381
  /**
33337
33382
  * Encoder constructor
@@ -33348,8 +33393,8 @@ class __e {
33348
33393
  * @param {Object} obj - packet object
33349
33394
  */
33350
33395
  encode(t) {
33351
- return (t.type === Be.EVENT || t.type === Be.ACK) && Oi(t) ? this.encodeAsBinary({
33352
- type: t.type === Be.EVENT ? Be.BINARY_EVENT : Be.BINARY_ACK,
33396
+ return (t.type === Ue.EVENT || t.type === Ue.ACK) && Oi(t) ? this.encodeAsBinary({
33397
+ type: t.type === Ue.EVENT ? Ue.BINARY_EVENT : Ue.BINARY_ACK,
33353
33398
  nsp: t.nsp,
33354
33399
  data: t.data,
33355
33400
  id: t.id
@@ -33360,7 +33405,7 @@ class __e {
33360
33405
  */
33361
33406
  encodeAsString(t) {
33362
33407
  let n = "" + t.type;
33363
- return (t.type === Be.BINARY_EVENT || t.type === Be.BINARY_ACK) && (n += t.attachments + "-"), t.nsp && t.nsp !== "/" && (n += t.nsp + ","), t.id != null && (n += t.id), t.data != null && (n += JSON.stringify(t.data, this.replacer)), n;
33408
+ return (t.type === Ue.BINARY_EVENT || t.type === Ue.BINARY_ACK) && (n += t.attachments + "-"), t.nsp && t.nsp !== "/" && (n += t.nsp + ","), t.id != null && (n += t.id), t.data != null && (n += JSON.stringify(t.data, this.replacer)), n;
33364
33409
  }
33365
33410
  /**
33366
33411
  * Encode packet as 'buffer sequence' by removing blobs, and
@@ -33395,8 +33440,8 @@ class xp extends ft {
33395
33440
  if (this.reconstructor)
33396
33441
  throw new Error("got plaintext data when reconstructing a packet");
33397
33442
  n = this.decodeString(t);
33398
- const r = n.type === Be.BINARY_EVENT;
33399
- r || n.type === Be.BINARY_ACK ? (n.type = r ? Be.EVENT : Be.ACK, this.reconstructor = new w_e(n), n.attachments === 0 && super.emitReserved("decoded", n)) : super.emitReserved("decoded", n);
33443
+ const r = n.type === Ue.BINARY_EVENT;
33444
+ r || n.type === Ue.BINARY_ACK ? (n.type = r ? Ue.EVENT : Ue.ACK, this.reconstructor = new w_e(n), n.attachments === 0 && super.emitReserved("decoded", n)) : super.emitReserved("decoded", n);
33400
33445
  } else if (wp(t) || t.base64)
33401
33446
  if (this.reconstructor)
33402
33447
  n = this.reconstructor.takeBinaryData(t), n && (this.reconstructor = null, super.emitReserved("decoded", n));
@@ -33416,9 +33461,9 @@ class xp extends ft {
33416
33461
  const r = {
33417
33462
  type: Number(t.charAt(0))
33418
33463
  };
33419
- if (Be[r.type] === void 0)
33464
+ if (Ue[r.type] === void 0)
33420
33465
  throw new Error("unknown packet type " + r.type);
33421
- if (r.type === Be.BINARY_EVENT || r.type === Be.BINARY_ACK) {
33466
+ if (r.type === Ue.BINARY_EVENT || r.type === Ue.BINARY_ACK) {
33422
33467
  const i = n + 1;
33423
33468
  for (; t.charAt(++n) !== "-" && n != t.length; )
33424
33469
  ;
@@ -33466,17 +33511,17 @@ class xp extends ft {
33466
33511
  }
33467
33512
  static isPayloadValid(t, n) {
33468
33513
  switch (t) {
33469
- case Be.CONNECT:
33514
+ case Ue.CONNECT:
33470
33515
  return L2(n);
33471
- case Be.DISCONNECT:
33516
+ case Ue.DISCONNECT:
33472
33517
  return n === void 0;
33473
- case Be.CONNECT_ERROR:
33518
+ case Ue.CONNECT_ERROR:
33474
33519
  return typeof n == "string" || L2(n);
33475
- case Be.EVENT:
33476
- case Be.BINARY_EVENT:
33520
+ case Ue.EVENT:
33521
+ case Ue.BINARY_EVENT:
33477
33522
  return Array.isArray(n) && (typeof n[0] == "number" || typeof n[0] == "string" && k_e.indexOf(n[0]) === -1);
33478
- case Be.ACK:
33479
- case Be.BINARY_ACK:
33523
+ case Ue.ACK:
33524
+ case Ue.BINARY_ACK:
33480
33525
  return Array.isArray(n);
33481
33526
  }
33482
33527
  }
@@ -33518,7 +33563,7 @@ const x_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
33518
33563
  Decoder: xp,
33519
33564
  Encoder: __e,
33520
33565
  get PacketType() {
33521
- return Be;
33566
+ return Ue;
33522
33567
  },
33523
33568
  protocol: v_e
33524
33569
  }, Symbol.toStringTag, { value: "Module" }));
@@ -33657,7 +33702,7 @@ class q3 extends ft {
33657
33702
  if (n.unshift(t), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
33658
33703
  return this._addToQueue(n), this;
33659
33704
  const o = {
33660
- type: Be.EVENT,
33705
+ type: Ue.EVENT,
33661
33706
  data: n
33662
33707
  };
33663
33708
  if (o.options = {}, o.options.compress = this.flags.compress !== !1, typeof n[n.length - 1] == "function") {
@@ -33765,7 +33810,7 @@ class q3 extends ft {
33765
33810
  */
33766
33811
  _sendConnectPacket(t) {
33767
33812
  this.packet({
33768
- type: Be.CONNECT,
33813
+ type: Ue.CONNECT,
33769
33814
  data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, t) : t
33770
33815
  });
33771
33816
  }
@@ -33811,21 +33856,21 @@ class q3 extends ft {
33811
33856
  onpacket(t) {
33812
33857
  if (t.nsp === this.nsp)
33813
33858
  switch (t.type) {
33814
- case Be.CONNECT:
33859
+ case Ue.CONNECT:
33815
33860
  t.data && t.data.sid ? this.onconnect(t.data.sid, t.data.pid) : this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
33816
33861
  break;
33817
- case Be.EVENT:
33818
- case Be.BINARY_EVENT:
33862
+ case Ue.EVENT:
33863
+ case Ue.BINARY_EVENT:
33819
33864
  this.onevent(t);
33820
33865
  break;
33821
- case Be.ACK:
33822
- case Be.BINARY_ACK:
33866
+ case Ue.ACK:
33867
+ case Ue.BINARY_ACK:
33823
33868
  this.onack(t);
33824
33869
  break;
33825
- case Be.DISCONNECT:
33870
+ case Ue.DISCONNECT:
33826
33871
  this.ondisconnect();
33827
33872
  break;
33828
- case Be.CONNECT_ERROR:
33873
+ case Ue.CONNECT_ERROR:
33829
33874
  this.destroy();
33830
33875
  const r = new Error(t.data.message);
33831
33876
  r.data = t.data.data, this.emitReserved("connect_error", r);
@@ -33860,7 +33905,7 @@ class q3 extends ft {
33860
33905
  let r = !1;
33861
33906
  return function(...a) {
33862
33907
  r || (r = !0, n.packet({
33863
- type: Be.ACK,
33908
+ type: Ue.ACK,
33864
33909
  id: t,
33865
33910
  data: a
33866
33911
  }));
@@ -33929,7 +33974,7 @@ class q3 extends ft {
33929
33974
  * @return self
33930
33975
  */
33931
33976
  disconnect() {
33932
- return this.connected && this.packet({ type: Be.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
33977
+ return this.connected && this.packet({ type: Ue.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
33933
33978
  }
33934
33979
  /**
33935
33980
  * Alias for {@link disconnect()}.
@@ -34403,7 +34448,7 @@ Object.assign(Li, {
34403
34448
  connect: Li
34404
34449
  });
34405
34450
  const M_e = Zd(null), S_e = ({ children: e }) => {
34406
- const t = Ue(), n = ge((_) => _.upsertChat), r = ge((_) => _.upsertChatState), a = ge((_) => _.contextKey), i = ge((_) => _.activeChatId), o = lt(() => t.config.user?.id ?? na(), [t.config.user?.id]), s = t.config.transport, [l, u] = et(null), [d, p] = et(void 0), m = Fe(a), h = Fe(n), g = Fe(r), f = Fe(void 0);
34451
+ const t = Pe(), n = ge((_) => _.upsertChat), r = ge((_) => _.upsertChatState), a = ge((_) => _.contextKey), i = ge((_) => _.activeChatId), o = lt(() => t.config.user?.id ?? na(), [t.config.user?.id]), s = t.config.transport, [l, u] = et(null), [d, p] = et(void 0), m = ze(a), h = ze(n), g = ze(r), f = ze(void 0);
34407
34452
  $e(() => {
34408
34453
  m.current = a, h.current = n, g.current = r;
34409
34454
  }, [a, n, r]), $e(() => {
@@ -34430,14 +34475,14 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34430
34475
  }, W = (V) => {
34431
34476
  if (V.contextKey === m.current) {
34432
34477
  h.current(V);
34433
- const D = t.store.getState(), j = ze(D, V.id);
34478
+ const D = t.store.getState(), j = Fe(D, V.id);
34434
34479
  g.current(V.id, {
34435
34480
  ...j,
34436
34481
  status: Ca(V.status)
34437
34482
  });
34438
34483
  }
34439
34484
  }, R = (V) => {
34440
- const D = t.store.getState(), j = ze(D, V.chat), N = j.messages.findIndex((K) => K.id === V.id);
34485
+ const D = t.store.getState(), j = Fe(D, V.chat), N = j.messages.findIndex((K) => K.id === V.id);
34441
34486
  if (N >= 0) {
34442
34487
  const K = [...j.messages];
34443
34488
  K[N] = V, g.current(V.chat, {
@@ -34452,7 +34497,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34452
34497
  });
34453
34498
  }, H = (V) => {
34454
34499
  h.current(V);
34455
- const D = t.store.getState(), j = ze(D, V.id);
34500
+ const D = t.store.getState(), j = Fe(D, V.id);
34456
34501
  g.current(V.id, {
34457
34502
  ...j,
34458
34503
  status: Ca(V.status)
@@ -34481,8 +34526,8 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34481
34526
  }, [l, i]);
34482
34527
  const w = lt(() => ({ socket: l, socketId: d }), [l, d]);
34483
34528
  return /* @__PURE__ */ C(M_e.Provider, { value: w, children: e });
34484
- }, Ep = Zd(null), qVe = ({ config: e, children: t }) => {
34485
- const n = Fe();
34529
+ }, Ep = Zd(null), BVe = ({ config: e, children: t }) => {
34530
+ const n = ze();
34486
34531
  n.current || (n.current = new w7e(e));
34487
34532
  const [, r] = et(0);
34488
34533
  $e(() => {
@@ -34491,7 +34536,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34491
34536
  o.events.removeEventListener("runtime:transport-config-changed", s);
34492
34537
  };
34493
34538
  }, []);
34494
- const a = Fe();
34539
+ const a = ze();
34495
34540
  if (!a.current) {
34496
34541
  const o = n.current.defaultContextKey ?? n.current.config.contextKeys[0]?.key ?? "default";
34497
34542
  a.current = o7e(o), n.current.attachStore(a.current);
@@ -34516,7 +34561,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34516
34561
  R7e(u, l);
34517
34562
  });
34518
34563
  }, []), /* @__PURE__ */ C(Ep.Provider, { value: i, children: /* @__PURE__ */ C(S7, { client: i.runtime.queryClient, children: /* @__PURE__ */ C(M7e, { value: i.runtime.config.theme, children: /* @__PURE__ */ C(S_e, { children: t }) }) }) });
34519
- }, Ue = () => {
34564
+ }, Pe = () => {
34520
34565
  const e = Xd(Ep);
34521
34566
  if (!e)
34522
34567
  throw new Error("useAgentRuntime must be used inside <AgentProvider />");
@@ -34532,7 +34577,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34532
34577
  multiUser: n = !1,
34533
34578
  participantIds: r = []
34534
34579
  }) => {
34535
- const a = Ue(), {
34580
+ const a = Pe(), {
34536
34581
  composer: i,
34537
34582
  contextKey: o,
34538
34583
  activeChatId: s,
@@ -34551,7 +34596,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34551
34596
  commitPendingAssistant: E,
34552
34597
  setPageContextDismissed: S
34553
34598
  } = ge((j) => {
34554
- const N = j.activeChatId ?? j.draftChatKey, K = ze(j, N);
34599
+ const N = j.activeChatId ?? j.draftChatKey, K = Fe(j, N);
34555
34600
  return {
34556
34601
  composer: j.composer,
34557
34602
  contextKey: j.contextKey,
@@ -34571,9 +34616,9 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34571
34616
  commitPendingAssistant: j.commitPendingAssistant,
34572
34617
  setPageContextDismissed: j.setPageContextDismissed
34573
34618
  };
34574
- }), x = Qe((j) => !j || j.length === 0 ? !1 : j.some(
34619
+ }), x = Ye((j) => !j || j.length === 0 ? !1 : j.some(
34575
34620
  (N) => N.type === kt.Context && N?.metadata?.kind === "pageContext"
34576
- ), []), z = Fe(!1), P = Fe(!1), T = Fe(void 0), L = Fe(/* @__PURE__ */ new Set()), U = s ?? l, Y = Qe(
34621
+ ), []), z = ze(!1), P = ze(!1), T = ze(void 0), L = ze(/* @__PURE__ */ new Set()), U = s ?? l, Y = Ye(
34577
34622
  async (j, N) => {
34578
34623
  if (!a.transport.generateTitle)
34579
34624
  return;
@@ -34591,7 +34636,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34591
34636
  return J;
34592
34637
  },
34593
34638
  [a.transport, a.config.features?.titleGeneration, o]
34594
- ), Q = Qe(
34639
+ ), Q = Ye(
34595
34640
  async (j, N = []) => {
34596
34641
  const K = a.config.user?.id ?? "guest", J = !s, O = s ?? l, le = { current: O };
34597
34642
  T.current = O;
@@ -34601,17 +34646,19 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34601
34646
  if (J) {
34602
34647
  const ce = await Y(j, K);
34603
34648
  ce && ce.trim().length > 0 && (ke = { ...ke ?? {}, title: ce });
34649
+ const we = a.getChatMetadata({ contextKey: o });
34650
+ we && (ke = { ...ke ?? {}, ...we });
34604
34651
  }
34605
- const Ce = a.store.getState(), Pe = s ? Ce.chats[s] : void 0, We = (s ? Ce.chatState[s] : void 0)?.messages ?? [], re = N.filter((ce) => B3(ce) ? !A_e(We, ce) : !0), Se = Pe?.model, He = i.model !== Se;
34606
- let Ze, Ae = !1;
34607
- He ? (Ze = i.model, Ae = !0) : Se ? (Ze = Se, Ae = !1) : (Ze = void 0, Ae = !1);
34652
+ const Ce = a.store.getState(), qe = s ? Ce.chats[s] : void 0, We = (s ? Ce.chatState[s] : void 0)?.messages ?? [], re = N.filter((ce) => B3(ce) ? !A_e(We, ce) : !0), Se = qe?.model, He = i.model !== Se;
34653
+ let Xe, Ae = !1;
34654
+ He ? (Xe = i.model, Ae = !0) : Se ? (Xe = Se, Ae = !1) : (Xe = void 0, Ae = !1);
34608
34655
  const ve = T_e(j), Ke = {
34609
34656
  userId: K,
34610
34657
  content: j,
34611
34658
  metadata: ke,
34612
34659
  contextKey: o,
34613
34660
  ...J ? {} : { chatId: s },
34614
- ...Ae ? { model: Ze ?? "" } : {},
34661
+ ...Ae ? { model: Xe ?? "" } : {},
34615
34662
  ...re.length > 0 ? { attachments: re } : {},
34616
34663
  ...n ? {
34617
34664
  mentions: ve,
@@ -34623,11 +34670,11 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34623
34670
  _(le.current, void 0);
34624
34671
  }, tt = (ce) => {
34625
34672
  if (ce?.name === "AbortError") {
34626
- const Me = T.current ?? le.current;
34627
- return L.current.has(Me) ? (E(le.current), L.current.delete(Me)) : (de(), t.current?.setDraft(fe)), { type: "aborted" };
34673
+ const we = T.current ?? le.current;
34674
+ return L.current.has(we) ? (E(le.current), L.current.delete(we)) : (de(), t.current?.setDraft(fe)), { type: "aborted" };
34628
34675
  }
34629
34676
  throw ce;
34630
- }, Xe = async () => {
34677
+ }, Qe = async () => {
34631
34678
  m(le.current, bt.Sending);
34632
34679
  try {
34633
34680
  if (!a.transport.sendMultiUserMessage)
@@ -34638,7 +34685,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34638
34685
  return tt(ce);
34639
34686
  }
34640
34687
  }, je = async () => {
34641
- let ce = `pending-${Date.now()}`, Me = "", be;
34688
+ let ce = `pending-${Date.now()}`, we = "", be;
34642
34689
  m(le.current, bt.Streaming), _(le.current, {
34643
34690
  id: ce,
34644
34691
  content: "",
@@ -34646,35 +34693,35 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34646
34693
  toolCalls: [],
34647
34694
  attachments: [],
34648
34695
  chat: s || "",
34649
- role: Ye.Assistant,
34696
+ role: Ze.Assistant,
34650
34697
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
34651
34698
  });
34652
34699
  try {
34653
- let qe = s;
34700
+ let Be = s;
34654
34701
  const q = (te) => {
34655
34702
  if (te.type === un.Chat && te.chat) {
34656
- p(te.chat), qe = te.chat.id, J && (T.current = te.chat.id, f(le.current, te.chat.id), le.current = te.chat.id, h(te.chat.id));
34703
+ p(te.chat), Be = te.chat.id, J && (T.current = te.chat.id, f(le.current, te.chat.id), le.current = te.chat.id, h(te.chat.id));
34657
34704
  return;
34658
34705
  }
34659
34706
  if (te.type === un.Reasoning && te.reasoning) {
34660
- Me += te.reasoning, be = { ...be ?? {
34707
+ we += te.reasoning, be = { ...be ?? {
34661
34708
  id: ce,
34662
- chat: qe,
34663
- role: Ye.Assistant,
34709
+ chat: Be,
34710
+ role: Ze.Assistant,
34664
34711
  content: "",
34665
34712
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
34666
- }, reasoning: Me }, _(le.current, be);
34713
+ }, reasoning: we }, _(le.current, be);
34667
34714
  return;
34668
34715
  }
34669
34716
  if (te.type === un.Error && te.error)
34670
34717
  throw new Error(te.error);
34671
- if (te.message && te.message.role === Ye.User) {
34718
+ if (te.message && te.message.role === Ze.User) {
34672
34719
  v(te.message.chat, [te.message]);
34673
34720
  return;
34674
34721
  }
34675
34722
  te.message && (ce = te.message.id, be = {
34676
34723
  ...te.message,
34677
- reasoning: Me || te.message.reasoning
34724
+ reasoning: we || te.message.reasoning
34678
34725
  }, _(le.current, be)), te.done && (be && v(le.current, [be]), m(le.current, bt.Idle), de());
34679
34726
  }, Z = await a.transport.streamMessage(
34680
34727
  Ke,
@@ -34683,24 +34730,24 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34683
34730
  );
34684
34731
  if (Z) {
34685
34732
  const te = Z.messages.map(
34686
- (Le) => be && Le.id === be.id && Le.role === Ye.Assistant ? { ...Le, reasoning: Me } : Le
34733
+ (Le) => be && Le.id === be.id && Le.role === Ze.Assistant ? { ...Le, reasoning: we } : Le
34687
34734
  );
34688
34735
  v(Z.id, te);
34689
34736
  const pe = a.store.getState();
34690
34737
  return (pe.activeChatId ?? pe.draftChatKey) === le.current && h(Z.id), de(), { type: "success" };
34691
34738
  }
34692
34739
  return de(), { type: "success" };
34693
- } catch (qe) {
34694
- return tt(qe);
34740
+ } catch (Be) {
34741
+ return tt(Be);
34695
34742
  }
34696
34743
  };
34697
34744
  try {
34698
- const ce = await (n ? Xe() : je());
34745
+ const ce = await (n ? Qe() : je());
34699
34746
  return ce.type === "success" && (z.current = !1), ce;
34700
34747
  } catch (ce) {
34701
34748
  de();
34702
- const Me = ce?.chat;
34703
- Me && (p(Me), h(Me.id));
34749
+ const we = ce?.chat;
34750
+ we && (p(we), h(we.id));
34704
34751
  const be = ce instanceof Error ? ce : new Error("Failed to send message");
34705
34752
  return g(le.current, be.message || "Failed to send message"), m(le.current, bt.Idle), t.current?.setDraft(fe), z.current = !1, { type: "error", error: be };
34706
34753
  } finally {
@@ -34727,7 +34774,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34727
34774
  t,
34728
34775
  g
34729
34776
  ]
34730
- ), W = Qe(async () => {
34777
+ ), W = Ye(async () => {
34731
34778
  if (d !== bt.Idle || P.current || !u.length || z.current)
34732
34779
  return;
34733
34780
  const j = u[0];
@@ -34741,7 +34788,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34741
34788
  $e(() => {
34742
34789
  W();
34743
34790
  }, [W]);
34744
- const R = Qe(
34791
+ const R = Ye(
34745
34792
  async (j) => {
34746
34793
  if (P.current)
34747
34794
  return;
@@ -34756,7 +34803,7 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34756
34803
  }
34757
34804
  },
34758
34805
  [u, U, w, Q]
34759
- ), H = Qe(
34806
+ ), H = Ye(
34760
34807
  async (j) => {
34761
34808
  const K = t.current.getDraft().attachments;
34762
34809
  if (!n && d !== bt.Idle) {
@@ -34775,11 +34822,11 @@ const M_e = Zd(null), S_e = ({ children: e }) => {
34775
34822
  x,
34776
34823
  S
34777
34824
  ]
34778
- ), V = Qe(() => {
34825
+ ), V = Ye(() => {
34779
34826
  z.current = !0;
34780
34827
  const j = T.current ?? U;
34781
34828
  L.current.add(j), a.transport.cancelStream?.(j), E(j), m(j, bt.Idle);
34782
- }, [U, a.transport, E, m]), D = Qe(
34829
+ }, [U, a.transport, E, m]), D = Ye(
34783
34830
  async (j) => {
34784
34831
  d === bt.Streaming && V(), await R(j);
34785
34832
  },
@@ -34926,7 +34973,7 @@ const U3 = (e, t) => {
34926
34973
  return /* @__PURE__ */ C(A5, { size: 12 });
34927
34974
  }
34928
34975
  }, L_e = ({ attachments: e }) => {
34929
- const { config: t } = Ue();
34976
+ const { config: t } = Pe();
34930
34977
  return !e || e.length === 0 ? null : /* @__PURE__ */ C("div", { className: "mp-agent-message-attachments", "aria-label": "Message attachments", children: e.map((n, r) => {
34931
34978
  const a = /* @__PURE__ */ oe(en, { children: [
34932
34979
  /* @__PURE__ */ C("span", { className: "mp-agent-message-attachment-icon", children: U3(n, t.contextAttachmentIcons) }),
@@ -34946,7 +34993,7 @@ const U3 = (e, t) => {
34946
34993
  ) : /* @__PURE__ */ C("span", { className: "mp-agent-message-attachment", title: n.mimeType ?? n.name, children: a }, n.id || r);
34947
34994
  }) });
34948
34995
  }, D_e = ({ attachments: e, onRemove: t, uploadProgress: n, uploadErrors: r }) => {
34949
- const a = yn(), { config: i } = Ue();
34996
+ const a = yn(), { config: i } = Pe();
34950
34997
  return !e || e.length === 0 ? null : /* @__PURE__ */ C("div", { className: "mp-agent-composer-attachments", "aria-label": a.attachments, children: e.map((o) => {
34951
34998
  const s = n?.get(o.id), l = r?.get(o.name), u = o.metadata?.size || o.size, d = u ? ` (${Mp(u)})` : "";
34952
34999
  return /* @__PURE__ */ oe(
@@ -35144,7 +35191,7 @@ const V_e = ({
35144
35191
  searchPlaceholder: u = "Search...",
35145
35192
  searchFilter: d
35146
35193
  }) => {
35147
- const [p, m] = et(!1), [h, g] = et(null), [f, w] = et(""), _ = Fe([]), b = Fe(null), { refs: v, floatingStyles: E, context: S, isPositioned: x } = hp({
35194
+ const [p, m] = et(!1), [h, g] = et(null), [f, w] = et(""), _ = ze([]), b = ze(null), { refs: v, floatingStyles: E, context: S, isPositioned: x } = hp({
35148
35195
  open: p,
35149
35196
  onOpenChange: m,
35150
35197
  placement: s,
@@ -35289,7 +35336,7 @@ const V_e = ({
35289
35336
  )
35290
35337
  ] });
35291
35338
  }, j_e = Rt(() => {
35292
- const e = Ue(), t = ge((p) => p.composer), n = ge((p) => p.contextKey), r = ge((p) => p.setComposerOptions), a = e.config.models, { data: i, isLoading: o } = i7e(), s = lt(() => {
35339
+ const e = Pe(), t = ge((p) => p.composer), n = ge((p) => p.contextKey), r = ge((p) => p.setComposerOptions), a = e.config.models, { data: i, isLoading: o } = i7e(), s = lt(() => {
35293
35340
  const p = i && i.length > 0 ? i : a;
35294
35341
  return M3(p, e.config.transport).filter((h) => !h.contexts?.length || h.contexts.includes(n));
35295
35342
  }, [i, a, e.config.transport, n]), l = lt(() => {
@@ -35298,7 +35345,7 @@ const V_e = ({
35298
35345
  }, [s]), u = lt(
35299
35346
  () => t.model !== void 0 ? t.model : ma,
35300
35347
  [t.model]
35301
- ), d = Qe(
35348
+ ), d = Ye(
35302
35349
  (p) => {
35303
35350
  p === ma ? (r({ model: void 0 }), T2(e.config.transport, ma)) : (r({ model: p }), T2(e.config.transport, p));
35304
35351
  },
@@ -35425,7 +35472,7 @@ function Y_e(e) {
35425
35472
  });
35426
35473
  }
35427
35474
  const Z_e = () => {
35428
- const e = yn(), t = Ue(), n = ge((l) => l.contextKey), { data: r, isLoading: a, isError: i } = l7e(n), o = lt(() => Y_e(r ?? []), [r]), s = !!t.transport.upsertAgentPreferences && !!t.transport.upsertAgentPreferencesBatch;
35475
+ const e = yn(), t = Pe(), n = ge((l) => l.contextKey), { data: r, isLoading: a, isError: i } = l7e(n), o = lt(() => Y_e(r ?? []), [r]), s = !!t.transport.upsertAgentPreferences && !!t.transport.upsertAgentPreferencesBatch;
35429
35476
  return a ? /* @__PURE__ */ C(en, { children: e.agentSettingsLoading }) : i ? /* @__PURE__ */ C(en, { children: e.agentSettingsError }) : /* @__PURE__ */ C(K_e, { preferences: o, disabled: !s });
35430
35477
  }, X_e = () => {
35431
35478
  const [e, t] = et(!1), n = yn(), { refs: r, floatingStyles: a, context: i, isPositioned: o } = hp({
@@ -35472,7 +35519,7 @@ const Z_e = () => {
35472
35519
  ] });
35473
35520
  }, Q_e = co(
35474
35521
  ({ autoFocus: e, activeChatId: t, status: n, onStop: r, onSubmit: a }, i) => {
35475
- const o = yn(), s = Ue(), l = Fe(null), u = Fe(null), d = ge((re) => re.activeChatId ?? re.draftChatKey), p = ge((re) => ze(re, d).composerDraft), m = ge((re) => ze(re, d).composerError), h = ge((re) => ze(re, d).pageContextDismissed), g = ge((re) => re.setComposerValue), f = ge((re) => re.setComposerDraft), w = ge((re) => re.clearComposerDraft), _ = ge((re) => re.setComposerError), b = ge((re) => re.addComposerAttachments), v = ge((re) => re.removeComposerAttachment), E = ge((re) => re.setPageContextDismissed), S = p.value, x = p.attachments, [z, P] = et(/* @__PURE__ */ new Map()), [T, L] = et(/* @__PURE__ */ new Map()), U = Fe(S), Y = Fe(x), Q = Fe(h), W = s.config.features?.pageContextAttachments !== !1, R = s.config.composerAttachmentActions, H = (re) => re.type === kt.Context && re?.metadata?.kind === "pageContext", V = x.some(H), D = () => {
35522
+ const o = yn(), s = Pe(), l = ze(null), u = ze(null), d = ge((re) => re.activeChatId ?? re.draftChatKey), p = ge((re) => Fe(re, d).composerDraft), m = ge((re) => Fe(re, d).composerError), h = ge((re) => Fe(re, d).pageContextDismissed), g = ge((re) => re.setComposerValue), f = ge((re) => re.setComposerDraft), w = ge((re) => re.clearComposerDraft), _ = ge((re) => re.setComposerError), b = ge((re) => re.addComposerAttachments), v = ge((re) => re.removeComposerAttachment), E = ge((re) => re.setPageContextDismissed), S = p.value, x = p.attachments, [z, P] = et(/* @__PURE__ */ new Map()), [T, L] = et(/* @__PURE__ */ new Map()), U = ze(S), Y = ze(x), Q = ze(h), W = s.config.features?.pageContextAttachments !== !1, R = s.config.composerAttachmentActions, H = (re) => re.type === kt.Context && re?.metadata?.kind === "pageContext", V = x.some(H), D = () => {
35476
35523
  if (W)
35477
35524
  return s.buildPageContextAttachment();
35478
35525
  };
@@ -35498,7 +35545,7 @@ const Z_e = () => {
35498
35545
  const He = D();
35499
35546
  if (!He)
35500
35547
  return;
35501
- const Ze = { ...He, id: Se.id }, Ae = re.map((ve) => ve.id === Se.id ? Ze : ve);
35548
+ const Xe = { ...He, id: Se.id }, Ae = re.map((ve) => ve.id === Se.id ? Xe : ve);
35502
35549
  f(d, { value: U.current, attachments: Ae });
35503
35550
  });
35504
35551
  }, [W, d, f]), E7(i, () => ({
@@ -35520,12 +35567,12 @@ const Z_e = () => {
35520
35567
  const j = async (re) => {
35521
35568
  if (!re || re.length === 0)
35522
35569
  return;
35523
- const Se = Array.from(re), He = O_e(), Ze = I_e(Se, x, He);
35524
- if (Ze) {
35570
+ const Se = Array.from(re), He = O_e(), Xe = I_e(Se, x, He);
35571
+ if (Xe) {
35525
35572
  L((Ae) => {
35526
35573
  const ve = new Map(Ae);
35527
35574
  return Se.forEach((Ke) => {
35528
- ve.set(Ke.name, Ze.message);
35575
+ ve.set(Ke.name, Xe.message);
35529
35576
  }), ve;
35530
35577
  });
35531
35578
  return;
@@ -35549,15 +35596,15 @@ const Z_e = () => {
35549
35596
  userId: s.config.user?.id,
35550
35597
  onProgress: (de) => {
35551
35598
  P((tt) => {
35552
- const Xe = new Map(tt);
35553
- return Xe.set(de.fileId, de), Xe;
35599
+ const Qe = new Map(tt);
35600
+ return Qe.set(de.fileId, de), Qe;
35554
35601
  });
35555
35602
  }
35556
35603
  });
35557
35604
  b(d, Ke), setTimeout(() => {
35558
35605
  P((de) => {
35559
35606
  const tt = new Map(de);
35560
- return Ke.forEach((Xe) => tt.delete(Xe.id)), tt;
35607
+ return Ke.forEach((Qe) => tt.delete(Qe.id)), tt;
35561
35608
  });
35562
35609
  }, 2e3);
35563
35610
  } catch (Ae) {
@@ -35577,13 +35624,13 @@ const Z_e = () => {
35577
35624
  return !1;
35578
35625
  if (x.some((Ae) => Ae.type === kt.Link && Ae.url === Se))
35579
35626
  return !0;
35580
- const He = z_e(Se), Ze = {
35627
+ const He = z_e(Se), Xe = {
35581
35628
  id: At(),
35582
35629
  url: Se,
35583
35630
  name: He,
35584
35631
  type: kt.Link
35585
35632
  };
35586
- return b(d, [Ze]), !0;
35633
+ return b(d, [Xe]), !0;
35587
35634
  }, J = async (re) => {
35588
35635
  await j(re.target.files), re.target.value = "";
35589
35636
  }, O = (re) => {
@@ -35595,7 +35642,7 @@ const Z_e = () => {
35595
35642
  const re = v7e(), Se = re?.selectedText ?? window.getSelection?.()?.toString()?.trim() ?? "";
35596
35643
  if (!Se)
35597
35644
  return !1;
35598
- const He = window.location?.href, Ze = Se.slice(0, 20), Ae = Se.length > 20 ? Ze + "..." : Se, ve = bp({
35645
+ const He = window.location?.href, Xe = Se.slice(0, 20), Ae = Se.length > 20 ? Xe + "..." : Se, ve = bp({
35599
35646
  kind: "webSnippet",
35600
35647
  url: He,
35601
35648
  title: Ae,
@@ -35612,7 +35659,7 @@ const Z_e = () => {
35612
35659
  re.key === "Enter" && !re.shiftKey && (re.preventDefault(), fe(re));
35613
35660
  }, Ce = (re) => {
35614
35661
  m && _(d, void 0), g(d, re.target.value);
35615
- }, Pe = (re) => {
35662
+ }, qe = (re) => {
35616
35663
  if (re.nativeEvent.shiftKey)
35617
35664
  return;
35618
35665
  const Se = re.clipboardData?.getData("text/plain") ?? "";
@@ -35644,7 +35691,7 @@ const Z_e = () => {
35644
35691
  placeholder: t ? o.followUp : o.newChat,
35645
35692
  onChange: Ce,
35646
35693
  onKeyDown: ke,
35647
- onPaste: Pe
35694
+ onPaste: qe
35648
35695
  }
35649
35696
  )
35650
35697
  ] }),
@@ -35723,7 +35770,7 @@ const Z_e = () => {
35723
35770
  ] });
35724
35771
  }
35725
35772
  ), J_e = ({ autoFocus: e, multiUser: t = !1, participantIds: n }) => {
35726
- const r = Fe({
35773
+ const r = ze({
35727
35774
  setValue: () => {
35728
35775
  },
35729
35776
  getDraft: () => ({ value: "", attachments: [] }),
@@ -36397,7 +36444,7 @@ function dwe(e) {
36397
36444
  });
36398
36445
  }
36399
36446
  const V3 = Rt(() => {
36400
- const e = ge((n) => n.activeChatId ?? n.draftChatKey), t = ge((n) => ze(n, e).composerError);
36447
+ const e = ge((n) => n.activeChatId ?? n.draftChatKey), t = ge((n) => Fe(n, e).composerError);
36401
36448
  return t ? /* @__PURE__ */ C("div", { className: "mp-agent-composer-error", children: t }) : null;
36402
36449
  });
36403
36450
  V3.displayName = "ComposerError";
@@ -36426,7 +36473,7 @@ const pwe = (e, t) => {
36426
36473
  return "[unserializable]";
36427
36474
  }
36428
36475
  }
36429
- }, H2 = ({ call: e }) => Ue().config.debug ? /* @__PURE__ */ oe("details", { className: "mp-agent-tool-debug-details", children: [
36476
+ }, H2 = ({ call: e }) => Pe().config.debug ? /* @__PURE__ */ oe("details", { className: "mp-agent-tool-debug-details", children: [
36430
36477
  /* @__PURE__ */ C("summary", { className: "mp-agent-tool-debug-summary", children: "Details" }),
36431
36478
  /* @__PURE__ */ oe("div", { className: "mp-agent-tool-debug-body", children: [
36432
36479
  /* @__PURE__ */ oe("div", { className: "mp-agent-tool-debug-row", children: [
@@ -36451,7 +36498,7 @@ const pwe = (e, t) => {
36451
36498
  ] })
36452
36499
  ] })
36453
36500
  ] }) : null, V2 = ({ call: e, isExpandable: t = !1, isExpanded: n = !1, onToggleExpand: r }) => {
36454
- const a = Ue(), i = Fe(!1), o = e.status === Mt.Succeeded || e.status === Mt.Failed, s = t || a.config.debug && !o, l = s || t;
36501
+ const a = Pe(), i = ze(!1), o = e.status === Mt.Succeeded || e.status === Mt.Failed, s = t || a.config.debug && !o, l = s || t;
36455
36502
  if ($e(() => {
36456
36503
  !t || o || n || i.current || (i.current = !0, r?.());
36457
36504
  }, [t, o, n, r]), !l)
@@ -36581,7 +36628,7 @@ const j3 = ({ call: e }) => {
36581
36628
  /* @__PURE__ */ C("div", { className: "mp-agent-tool-approval-actions", children: /* @__PURE__ */ C("button", { className: "mp-agent-tool-approve-button", onClick: m, disabled: n, children: n ? "Submitting..." : "Submit response" }) })
36582
36629
  ] }) : /* @__PURE__ */ C("div", { className: "mp-agent-tool-user-action-form", children: /* @__PURE__ */ C("div", { className: "mp-agent-tool-input-error", children: "Invalid user action input schema in tool call." }) });
36583
36630
  }, gwe = ({ call: e, messageId: t, chatId: n, onApprovalSent: r }) => {
36584
- const a = Ue(), i = a.tools.get(e.name)?.label ?? e.name, o = ge((U) => U.appendMessagesToChat), s = ge((U) => U.setChatMessages), l = ge((U) => U.setChatStatus), u = ge((U) => U.setPendingAssistant), [d, p] = et(!1), [m, h] = et(!1), [g, f] = et(!1), [w, _] = et(JSON.stringify(e.input ?? {}, null, 2)), [b, v] = et(void 0), E = a.config.user?.id ?? "guest", S = e.requiresUserAction;
36631
+ const a = Pe(), i = a.tools.get(e.name)?.label ?? e.name, o = ge((U) => U.appendMessagesToChat), s = ge((U) => U.setChatMessages), l = ge((U) => U.setChatStatus), u = ge((U) => U.setPendingAssistant), [d, p] = et(!1), [m, h] = et(!1), [g, f] = et(!1), [w, _] = et(JSON.stringify(e.input ?? {}, null, 2)), [b, v] = et(void 0), E = a.config.user?.id ?? "guest", S = e.requiresUserAction;
36585
36632
  $e(() => {
36586
36633
  m || (_(JSON.stringify(e.input ?? {}, null, 2)), v(void 0));
36587
36634
  }, [e.id, e.input, m]);
@@ -36624,7 +36671,7 @@ const j3 = ({ call: e }) => {
36624
36671
  p(!0), T({ approved: U, ...Y ? { userResponse: Y } : {} }), l(n, bt.Streaming), u(n, {
36625
36672
  id: `pending-approval-${e.id}`,
36626
36673
  chat: n,
36627
- role: Ye.Assistant,
36674
+ role: Ze.Assistant,
36628
36675
  content: "",
36629
36676
  reasoning: "",
36630
36677
  toolCalls: [],
@@ -36735,7 +36782,7 @@ const j3 = ({ call: e }) => {
36735
36782
  ] })
36736
36783
  ] });
36737
36784
  }, j2 = ({ call: e, messageId: t, chatId: n }) => {
36738
- const r = Ue(), a = ge((p) => p.upsertChat), i = ge((p) => p.setChatStatus), o = r.config.debug && !!e.approvalId, s = e.requiresConfirmation && e.approvalId || o, l = s && e.approved === void 0, u = s && e.approved !== void 0, d = async () => {
36785
+ const r = Pe(), a = ge((p) => p.upsertChat), i = ge((p) => p.setChatStatus), o = r.config.debug && !!e.approvalId, s = e.requiresConfirmation && e.approvalId || o, l = s && e.approved === void 0, u = s && e.approved !== void 0, d = async () => {
36739
36786
  try {
36740
36787
  const p = await r.transport.getChat(n);
36741
36788
  a(p), i(n, Ca(p.status));
@@ -36748,11 +36795,11 @@ const j3 = ({ call: e }) => {
36748
36795
  u && /* @__PURE__ */ C(j3, { call: e })
36749
36796
  ] });
36750
36797
  }, G2 = ({ chatId: e, isExpanded: t }) => {
36751
- const n = Ue(), r = ge((l) => ze(l, e).messages), a = ge((l) => ze(l, e).pendingAssistant), i = ge((l) => l.chats[e]?.contextKey ?? l.contextKey), o = v3(e), s = lt(() => {
36798
+ const n = Pe(), r = ge((l) => Fe(l, e).messages), a = ge((l) => Fe(l, e).pendingAssistant), i = ge((l) => l.chats[e]?.contextKey ?? l.contextKey), o = v3(e), s = lt(() => {
36752
36799
  const l = [...r].sort((d, p) => d.createdAt.localeCompare(p.createdAt));
36753
36800
  if (n.config.debug)
36754
36801
  return l;
36755
- const u = l.findIndex((d) => d.role === Ye.User);
36802
+ const u = l.findIndex((d) => d.role === Ze.User);
36756
36803
  return u === -1 ? l : l.filter((d, p) => p !== u);
36757
36804
  }, [r, n.config.debug]);
36758
36805
  return /* @__PURE__ */ C("div", { className: "mp-agent-subagent-preview", children: t && /* @__PURE__ */ C("div", { className: "mp-agent-subagent-preview-body", children: s.length === 0 && !a ? /* @__PURE__ */ C("div", { className: "mp-agent-subagent-preview-empty", children: o.isLoading ? "Loading subagent chat..." : "Subagent chat started." }) : /* @__PURE__ */ oe(en, { children: [
@@ -36760,7 +36807,7 @@ const j3 = ({ call: e }) => {
36760
36807
  a && /* @__PURE__ */ C(lo, { message: a, contextKey: i, isStreaming: !0 })
36761
36808
  ] }) }) });
36762
36809
  }, G3 = ({ call: e, contextKey: t, messageId: n, chatId: r }) => {
36763
- const a = Ue(), i = e.subagentChatId || (typeof e.input?.subagentChatId == "string" ? e.input.subagentChatId : void 0), [o, s] = et(!1), l = lt(() => a.getToolRenderer(e), [a, e]);
36810
+ const a = Pe(), i = e.subagentChatId || (typeof e.input?.subagentChatId == "string" ? e.input.subagentChatId : void 0), [o, s] = et(!1), l = lt(() => a.getToolRenderer(e), [a, e]);
36764
36811
  if (!l) {
36765
36812
  const u = !!(e.requiresConfirmation && e.approvalId);
36766
36813
  return !!i || a.config.debug || u ? /* @__PURE__ */ oe("div", { className: "mp-agent-tool-panel", children: [
@@ -36796,17 +36843,17 @@ const j3 = ({ call: e }) => {
36796
36843
  }, ywe = (e) => {
36797
36844
  const t = e.sender?.displayName || e.sender?.id || e.agentName;
36798
36845
  if (!t)
36799
- return e.role === Ye.User ? "You" : "AI";
36846
+ return e.role === Ze.User ? "You" : "AI";
36800
36847
  const n = t.split(/\s+/).filter(Boolean);
36801
36848
  return n.length >= 2 ? `${n[0][0]}${n[1][0]}`.toUpperCase() : t.slice(0, 2).toUpperCase();
36802
36849
  }, W3 = Rt(({ message: e, isGrouped: t }) => {
36803
36850
  if (t)
36804
36851
  return /* @__PURE__ */ C("div", { className: "mp-agent-message-avatar-spacer" });
36805
- const n = e.role === Ye.User;
36852
+ const n = e.role === Ze.User;
36806
36853
  return /* @__PURE__ */ C("div", { className: `mp-agent-message-avatar ${n ? "mp-agent-message-avatar-user" : ""}`, children: e.sender?.avatarUrl ? /* @__PURE__ */ C("img", { className: "mp-agent-message-avatar-image", src: e.sender.avatarUrl, alt: "" }) : /* @__PURE__ */ C("div", { className: "mp-agent-message-avatar-icon", children: ywe(e) }) });
36807
36854
  });
36808
36855
  W3.displayName = "MessageAvatar";
36809
- const bwe = (e) => e ? new Date(e).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "", kwe = (e) => e.sender?.displayName ? e.sender.displayName : e.sender?.id && e.sender.id !== "guest" ? e.sender.id : e.agentName ? e.agentName : e.role === Ye.User ? "You" : "Assistant", K3 = Rt(({ message: e, isGrouped: t }) => {
36856
+ const bwe = (e) => e ? new Date(e).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "", kwe = (e) => e.sender?.displayName ? e.sender.displayName : e.sender?.id && e.sender.id !== "guest" ? e.sender.id : e.agentName ? e.agentName : e.role === Ze.User ? "You" : "Assistant", K3 = Rt(({ message: e, isGrouped: t }) => {
36810
36857
  if (t)
36811
36858
  return null;
36812
36859
  const n = kwe(e);
@@ -40663,14 +40710,14 @@ function kEe(e, t, n) {
40663
40710
  ) : K(W);
40664
40711
  function K(ke) {
40665
40712
  return Ce;
40666
- function Ce(Pe) {
40667
- const ot = Pe !== null && ke[Pe], We = Pe !== null && ke.null, re = [
40713
+ function Ce(qe) {
40714
+ const ot = qe !== null && ke[qe], We = qe !== null && ke.null, re = [
40668
40715
  // To do: add more extension tests.
40669
40716
  /* c8 ignore next 2 */
40670
40717
  ...Array.isArray(ot) ? ot : ot ? [ot] : [],
40671
40718
  ...Array.isArray(We) ? We : We ? [We] : []
40672
40719
  ];
40673
- return J(re)(Pe);
40720
+ return J(re)(qe);
40674
40721
  }
40675
40722
  }
40676
40723
  function J(ke) {
@@ -40678,7 +40725,7 @@ function kEe(e, t, n) {
40678
40725
  }
40679
40726
  function O(ke) {
40680
40727
  return Ce;
40681
- function Ce(Pe) {
40728
+ function Ce(qe) {
40682
40729
  return N = T(), j = ke, ke.partial || (u.currentConstruct = ke), ke.name && u.parser.constructs.disable.null.includes(ke.name) ? fe() : ke.tokenize.call(
40683
40730
  // If we do have fields, create an object w/ `context` as its
40684
40731
  // prototype.
@@ -40687,7 +40734,7 @@ function kEe(e, t, n) {
40687
40734
  l,
40688
40735
  le,
40689
40736
  fe
40690
- )(Pe);
40737
+ )(qe);
40691
40738
  }
40692
40739
  }
40693
40740
  function le(ke) {
@@ -40876,7 +40923,7 @@ function TEe(e) {
40876
40923
  definitionDestinationString: o,
40877
40924
  definitionLabelString: o,
40878
40925
  definitionTitleString: o,
40879
- emphasis: i(Ze),
40926
+ emphasis: i(Xe),
40880
40927
  hardBreakEscape: i(ve),
40881
40928
  hardBreakTrailing: i(ve),
40882
40929
  htmlFlow: i(Ke, o),
@@ -40888,23 +40935,23 @@ function TEe(e) {
40888
40935
  link: i(tt),
40889
40936
  listItem: i(je),
40890
40937
  listItemValue: m,
40891
- listOrdered: i(Xe, p),
40892
- listUnordered: i(Xe),
40938
+ listOrdered: i(Qe, p),
40939
+ listUnordered: i(Qe),
40893
40940
  paragraph: i(ce),
40894
40941
  reference: O,
40895
40942
  referenceString: o,
40896
40943
  resourceDestinationString: o,
40897
40944
  resourceTitleString: o,
40898
40945
  setextHeading: i(Ae),
40899
- strong: i(Me),
40900
- thematicBreak: i(qe)
40946
+ strong: i(we),
40947
+ thematicBreak: i(Be)
40901
40948
  },
40902
40949
  exit: {
40903
40950
  atxHeading: l(),
40904
40951
  atxHeadingSequence: S,
40905
40952
  autolink: l(),
40906
40953
  autolinkEmail: ot,
40907
- autolinkProtocol: Pe,
40954
+ autolinkProtocol: qe,
40908
40955
  blockQuote: l(),
40909
40956
  characterEscapeValue: L,
40910
40957
  characterReferenceMarkerHexadecimal: fe,
@@ -40969,20 +41016,20 @@ function TEe(e) {
40969
41016
  resume: d,
40970
41017
  data: n
40971
41018
  }, pe = [];
40972
- let Ee = -1;
40973
- for (; ++Ee < q.length; )
40974
- if (q[Ee][1].type === "listOrdered" || q[Ee][1].type === "listUnordered")
40975
- if (q[Ee][0] === "enter")
40976
- pe.push(Ee);
41019
+ let Me = -1;
41020
+ for (; ++Me < q.length; )
41021
+ if (q[Me][1].type === "listOrdered" || q[Me][1].type === "listUnordered")
41022
+ if (q[Me][0] === "enter")
41023
+ pe.push(Me);
40977
41024
  else {
40978
41025
  const Le = pe.pop();
40979
- Ee = a(q, Le, Ee);
41026
+ Me = a(q, Le, Me);
40980
41027
  }
40981
- for (Ee = -1; ++Ee < q.length; ) {
40982
- const Le = t[q[Ee][0]];
40983
- wv.call(Le, q[Ee][1].type) && Le[q[Ee][1].type].call(Object.assign({
40984
- sliceSerialize: q[Ee][2].sliceSerialize
40985
- }, te), q[Ee][1]);
41028
+ for (Me = -1; ++Me < q.length; ) {
41029
+ const Le = t[q[Me][0]];
41030
+ wv.call(Le, q[Me][1].type) && Le[q[Me][1].type].call(Object.assign({
41031
+ sliceSerialize: q[Me][2].sliceSerialize
41032
+ }, te), q[Me][1]);
40986
41033
  }
40987
41034
  if (te.tokenStack.length > 0) {
40988
41035
  const Le = te.tokenStack[te.tokenStack.length - 1];
@@ -40999,23 +41046,23 @@ function TEe(e) {
40999
41046
  column: 1,
41000
41047
  offset: 0
41001
41048
  })
41002
- }, Ee = -1; ++Ee < t.transforms.length; )
41003
- Z = t.transforms[Ee](Z) || Z;
41049
+ }, Me = -1; ++Me < t.transforms.length; )
41050
+ Z = t.transforms[Me](Z) || Z;
41004
41051
  return Z;
41005
41052
  }
41006
41053
  function a(q, Z, te) {
41007
- let pe = Z - 1, Ee = -1, Le = !1, wt, St, Qn, Jn;
41054
+ let pe = Z - 1, Me = -1, Le = !1, wt, St, Qn, Jn;
41008
41055
  for (; ++pe <= te; ) {
41009
41056
  const _t = q[pe];
41010
41057
  switch (_t[1].type) {
41011
41058
  case "listUnordered":
41012
41059
  case "listOrdered":
41013
41060
  case "blockQuote": {
41014
- _t[0] === "enter" ? Ee++ : Ee--, Jn = void 0;
41061
+ _t[0] === "enter" ? Me++ : Me--, Jn = void 0;
41015
41062
  break;
41016
41063
  }
41017
41064
  case "lineEndingBlank": {
41018
- _t[0] === "enter" && (wt && !Jn && !Ee && !Qn && (Qn = pe), Jn = void 0);
41065
+ _t[0] === "enter" && (wt && !Jn && !Me && !Qn && (Qn = pe), Jn = void 0);
41019
41066
  break;
41020
41067
  }
41021
41068
  case "linePrefix":
@@ -41027,7 +41074,7 @@ function TEe(e) {
41027
41074
  default:
41028
41075
  Jn = void 0;
41029
41076
  }
41030
- if (!Ee && _t[0] === "enter" && _t[1].type === "listItemPrefix" || Ee === -1 && _t[0] === "exit" && (_t[1].type === "listUnordered" || _t[1].type === "listOrdered")) {
41077
+ if (!Me && _t[0] === "enter" && _t[1].type === "listItemPrefix" || Me === -1 && _t[0] === "exit" && (_t[1].type === "listUnordered" || _t[1].type === "listOrdered")) {
41031
41078
  if (wt) {
41032
41079
  let Ot = pe;
41033
41080
  for (St = void 0; Ot--; ) {
@@ -41243,14 +41290,14 @@ function TEe(e) {
41243
41290
  const Z = this.sliceSerialize(q), te = this.data.characterReferenceType;
41244
41291
  let pe;
41245
41292
  te ? (pe = pv(Z, te === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : pe = Oa(Z);
41246
- const Ee = this.stack[this.stack.length - 1];
41247
- Ee.value += pe;
41293
+ const Me = this.stack[this.stack.length - 1];
41294
+ Me.value += pe;
41248
41295
  }
41249
41296
  function Ce(q) {
41250
41297
  const Z = this.stack.pop();
41251
41298
  Z.position.end = er(q.end);
41252
41299
  }
41253
- function Pe(q) {
41300
+ function qe(q) {
41254
41301
  L.call(this, q);
41255
41302
  const Z = this.stack[this.stack.length - 1];
41256
41303
  Z.url = this.sliceSerialize(q);
@@ -41289,7 +41336,7 @@ function TEe(e) {
41289
41336
  url: ""
41290
41337
  };
41291
41338
  }
41292
- function Ze() {
41339
+ function Xe() {
41293
41340
  return {
41294
41341
  type: "emphasis",
41295
41342
  children: []
@@ -41330,7 +41377,7 @@ function TEe(e) {
41330
41377
  children: []
41331
41378
  };
41332
41379
  }
41333
- function Xe(q) {
41380
+ function Qe(q) {
41334
41381
  return {
41335
41382
  type: "list",
41336
41383
  ordered: q.type === "listOrdered",
@@ -41353,7 +41400,7 @@ function TEe(e) {
41353
41400
  children: []
41354
41401
  };
41355
41402
  }
41356
- function Me() {
41403
+ function we() {
41357
41404
  return {
41358
41405
  type: "strong",
41359
41406
  children: []
@@ -41365,7 +41412,7 @@ function TEe(e) {
41365
41412
  value: ""
41366
41413
  };
41367
41414
  }
41368
- function qe() {
41415
+ function Be() {
41369
41416
  return {
41370
41417
  type: "thematicBreak"
41371
41418
  };
@@ -46067,7 +46114,7 @@ class tr {
46067
46114
  return this.size >= 2;
46068
46115
  }
46069
46116
  }
46070
- var Hp = 0, Ji = 1, Xr = 2, Vn = 3, Da = 4, dn = 5, Jr = 6, Ft = 7, Sn = [new tr(Hp, 0, !1), new tr(Ji, 0, !0), new tr(Xr, 1, !1), new tr(Vn, 1, !0), new tr(Da, 2, !1), new tr(dn, 2, !0), new tr(Jr, 3, !1), new tr(Ft, 3, !0)], EAe = [Da, dn, Da, dn, Jr, Ft, Jr, Ft], MAe = [dn, dn, dn, dn, Ft, Ft, Ft, Ft], SAe = [Xr, Vn, Da, dn, Jr, Ft, Jr, Ft], NAe = [Vn, Vn, dn, dn, Ft, Ft, Ft, Ft], AAe = [Ji, Ji, Vn, Vn, dn, dn, Ft, Ft], TAe = [Hp, Ji, Xr, Vn, Xr, Vn, Xr, Vn], xe = {
46117
+ var Hp = 0, Ji = 1, Xr = 2, Vn = 3, Da = 4, dn = 5, Jr = 6, Ft = 7, Sn = [new tr(Hp, 0, !1), new tr(Ji, 0, !0), new tr(Xr, 1, !1), new tr(Vn, 1, !0), new tr(Da, 2, !1), new tr(dn, 2, !0), new tr(Jr, 3, !1), new tr(Ft, 3, !0)], EAe = [Da, dn, Da, dn, Jr, Ft, Jr, Ft], MAe = [dn, dn, dn, dn, Ft, Ft, Ft, Ft], SAe = [Xr, Vn, Da, dn, Jr, Ft, Jr, Ft], NAe = [Vn, Vn, dn, dn, Ft, Ft, Ft, Ft], AAe = [Ji, Ji, Vn, Vn, dn, dn, Ft, Ft], TAe = [Hp, Ji, Xr, Vn, Xr, Vn, Xr, Vn], Ee = {
46071
46118
  DISPLAY: Sn[Hp],
46072
46119
  TEXT: Sn[Xr],
46073
46120
  SCRIPT: Sn[Da],
@@ -49345,7 +49392,7 @@ function y(e, t, n, r, a, i) {
49345
49392
  replace: r
49346
49393
  }, i && r && (it[e][r] = it[e][a]);
49347
49394
  }
49348
- var k = "math", ne = "text", M = "main", $ = "ams", ct = "accent-token", ye = "bin", Pt = "close", oa = "inner", we = "mathord", yt = "op-token", tn = "open", Do = "punct", F = "rel", Xn = "spacing", G = "textord";
49395
+ var k = "math", ne = "text", M = "main", $ = "ams", ct = "accent-token", ye = "bin", Pt = "close", oa = "inner", xe = "mathord", yt = "op-token", tn = "open", Do = "punct", F = "rel", Xn = "spacing", G = "textord";
49349
49396
  y(k, M, F, "≡", "\\equiv", !0);
49350
49397
  y(k, M, F, "≺", "\\prec", !0);
49351
49398
  y(k, M, F, "≻", "\\succ", !0);
@@ -49710,36 +49757,36 @@ y(k, M, G, "⊤", "\\top");
49710
49757
  y(k, M, G, "⊥", "\\bot");
49711
49758
  y(k, M, G, "∅", "\\emptyset");
49712
49759
  y(k, $, G, "∅", "\\varnothing");
49713
- y(k, M, we, "α", "\\alpha", !0);
49714
- y(k, M, we, "β", "\\beta", !0);
49715
- y(k, M, we, "γ", "\\gamma", !0);
49716
- y(k, M, we, "δ", "\\delta", !0);
49717
- y(k, M, we, "ϵ", "\\epsilon", !0);
49718
- y(k, M, we, "ζ", "\\zeta", !0);
49719
- y(k, M, we, "η", "\\eta", !0);
49720
- y(k, M, we, "θ", "\\theta", !0);
49721
- y(k, M, we, "ι", "\\iota", !0);
49722
- y(k, M, we, "κ", "\\kappa", !0);
49723
- y(k, M, we, "λ", "\\lambda", !0);
49724
- y(k, M, we, "μ", "\\mu", !0);
49725
- y(k, M, we, "ν", "\\nu", !0);
49726
- y(k, M, we, "ξ", "\\xi", !0);
49727
- y(k, M, we, "ο", "\\omicron", !0);
49728
- y(k, M, we, "π", "\\pi", !0);
49729
- y(k, M, we, "ρ", "\\rho", !0);
49730
- y(k, M, we, "σ", "\\sigma", !0);
49731
- y(k, M, we, "τ", "\\tau", !0);
49732
- y(k, M, we, "υ", "\\upsilon", !0);
49733
- y(k, M, we, "ϕ", "\\phi", !0);
49734
- y(k, M, we, "χ", "\\chi", !0);
49735
- y(k, M, we, "ψ", "\\psi", !0);
49736
- y(k, M, we, "ω", "\\omega", !0);
49737
- y(k, M, we, "ε", "\\varepsilon", !0);
49738
- y(k, M, we, "ϑ", "\\vartheta", !0);
49739
- y(k, M, we, "ϖ", "\\varpi", !0);
49740
- y(k, M, we, "ϱ", "\\varrho", !0);
49741
- y(k, M, we, "ς", "\\varsigma", !0);
49742
- y(k, M, we, "φ", "\\varphi", !0);
49760
+ y(k, M, xe, "α", "\\alpha", !0);
49761
+ y(k, M, xe, "β", "\\beta", !0);
49762
+ y(k, M, xe, "γ", "\\gamma", !0);
49763
+ y(k, M, xe, "δ", "\\delta", !0);
49764
+ y(k, M, xe, "ϵ", "\\epsilon", !0);
49765
+ y(k, M, xe, "ζ", "\\zeta", !0);
49766
+ y(k, M, xe, "η", "\\eta", !0);
49767
+ y(k, M, xe, "θ", "\\theta", !0);
49768
+ y(k, M, xe, "ι", "\\iota", !0);
49769
+ y(k, M, xe, "κ", "\\kappa", !0);
49770
+ y(k, M, xe, "λ", "\\lambda", !0);
49771
+ y(k, M, xe, "μ", "\\mu", !0);
49772
+ y(k, M, xe, "ν", "\\nu", !0);
49773
+ y(k, M, xe, "ξ", "\\xi", !0);
49774
+ y(k, M, xe, "ο", "\\omicron", !0);
49775
+ y(k, M, xe, "π", "\\pi", !0);
49776
+ y(k, M, xe, "ρ", "\\rho", !0);
49777
+ y(k, M, xe, "σ", "\\sigma", !0);
49778
+ y(k, M, xe, "τ", "\\tau", !0);
49779
+ y(k, M, xe, "υ", "\\upsilon", !0);
49780
+ y(k, M, xe, "ϕ", "\\phi", !0);
49781
+ y(k, M, xe, "χ", "\\chi", !0);
49782
+ y(k, M, xe, "ψ", "\\psi", !0);
49783
+ y(k, M, xe, "ω", "\\omega", !0);
49784
+ y(k, M, xe, "ε", "\\varepsilon", !0);
49785
+ y(k, M, xe, "ϑ", "\\vartheta", !0);
49786
+ y(k, M, xe, "ϖ", "\\varpi", !0);
49787
+ y(k, M, xe, "ϱ", "\\varrho", !0);
49788
+ y(k, M, xe, "ς", "\\varsigma", !0);
49789
+ y(k, M, xe, "φ", "\\varphi", !0);
49743
49790
  y(k, M, ye, "∗", "*", !0);
49744
49791
  y(k, M, ye, "+", "+");
49745
49792
  y(k, M, ye, "−", "-", !0);
@@ -49890,8 +49937,8 @@ y(k, M, ct, "^", "\\hat");
49890
49937
  y(k, M, ct, "⃗", "\\vec");
49891
49938
  y(k, M, ct, "˙", "\\dot");
49892
49939
  y(k, M, ct, "˚", "\\mathring");
49893
- y(k, M, we, "", "\\@imath");
49894
- y(k, M, we, "", "\\@jmath");
49940
+ y(k, M, xe, "", "\\@imath");
49941
+ y(k, M, xe, "", "\\@jmath");
49895
49942
  y(k, M, G, "ı", "ı");
49896
49943
  y(k, M, G, "ȷ", "ȷ");
49897
49944
  y(ne, M, G, "ı", "\\i", !0);
@@ -49956,7 +50003,7 @@ for (var Rs = 0; Rs < Xm.length; Rs++) {
49956
50003
  var eo = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
49957
50004
  for (var Is = 0; Is < eo.length; Is++) {
49958
50005
  var pi = eo.charAt(Is);
49959
- y(k, M, we, pi, pi), y(ne, M, G, pi, pi);
50006
+ y(k, M, xe, pi, pi), y(ne, M, G, pi, pi);
49960
50007
  }
49961
50008
  y(k, $, G, "C", "ℂ");
49962
50009
  y(ne, $, G, "C", "ℂ");
@@ -49972,24 +50019,24 @@ y(k, $, G, "R", "ℝ");
49972
50019
  y(ne, $, G, "R", "ℝ");
49973
50020
  y(k, $, G, "Z", "ℤ");
49974
50021
  y(ne, $, G, "Z", "ℤ");
49975
- y(k, M, we, "h", "ℎ");
49976
- y(ne, M, we, "h", "ℎ");
50022
+ y(k, M, xe, "h", "ℎ");
50023
+ y(ne, M, xe, "h", "ℎ");
49977
50024
  var Ne = "";
49978
50025
  for (var Lt = 0; Lt < eo.length; Lt++) {
49979
50026
  var pt = eo.charAt(Lt);
49980
- Ne = String.fromCharCode(55349, 56320 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56372 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56424 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56580 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56684 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56736 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56788 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56840 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56944 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Lt < 26 && (Ne = String.fromCharCode(55349, 56632 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56476 + Lt), y(k, M, we, pt, Ne), y(ne, M, G, pt, Ne));
50027
+ Ne = String.fromCharCode(55349, 56320 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56372 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56424 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56580 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56684 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56736 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56788 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56840 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56944 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Lt < 26 && (Ne = String.fromCharCode(55349, 56632 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne), Ne = String.fromCharCode(55349, 56476 + Lt), y(k, M, xe, pt, Ne), y(ne, M, G, pt, Ne));
49981
50028
  }
49982
50029
  Ne = "𝕜";
49983
- y(k, M, we, "k", Ne);
50030
+ y(k, M, xe, "k", Ne);
49984
50031
  y(ne, M, G, "k", Ne);
49985
50032
  for (var vr = 0; vr < 10; vr++) {
49986
50033
  var nr = vr.toString();
49987
- Ne = String.fromCharCode(55349, 57294 + vr), y(k, M, we, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57314 + vr), y(k, M, we, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57324 + vr), y(k, M, we, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57334 + vr), y(k, M, we, nr, Ne), y(ne, M, G, nr, Ne);
50034
+ Ne = String.fromCharCode(55349, 57294 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57314 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57324 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne), Ne = String.fromCharCode(55349, 57334 + vr), y(k, M, xe, nr, Ne), y(ne, M, G, nr, Ne);
49988
50035
  }
49989
50036
  var $d = "ÐÞþ";
49990
50037
  for (var Os = 0; Os < $d.length; Os++) {
49991
50038
  var hi = $d.charAt(Os);
49992
- y(k, M, we, hi, hi), y(ne, M, G, hi, hi);
50039
+ y(k, M, xe, hi, hi), y(ne, M, G, hi, hi);
49993
50040
  }
49994
50041
  var mi = [
49995
50042
  ["mathbf", "textbf", "Main-Bold"],
@@ -50486,10 +50533,10 @@ var ro = function(t) {
50486
50533
  }, ht = function(t) {
50487
50534
  return t.type === "ordgroup" ? t.body : [t];
50488
50535
  }, Kn = X.makeSpan, dTe = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], pTe = ["rightmost", "mrel", "mclose", "mpunct"], hTe = {
50489
- display: xe.DISPLAY,
50490
- text: xe.TEXT,
50491
- script: xe.SCRIPT,
50492
- scriptscript: xe.SCRIPTSCRIPT
50536
+ display: Ee.DISPLAY,
50537
+ text: Ee.TEXT,
50538
+ script: Ee.SCRIPT,
50539
+ scriptscript: Ee.SCRIPTSCRIPT
50493
50540
  }, mTe = {
50494
50541
  mord: "mord",
50495
50542
  mop: "mop",
@@ -50811,7 +50858,7 @@ function tf(e, t, n, r, a) {
50811
50858
  }
50812
50859
  var y6 = function(t) {
50813
50860
  return new qn({
50814
- style: t.displayMode ? xe.DISPLAY : xe.TEXT,
50861
+ style: t.displayMode ? Ee.DISPLAY : Ee.TEXT,
50815
50862
  maxSize: t.maxSize,
50816
50863
  minRuleThickness: t.minRuleThickness
50817
50864
  });
@@ -51869,8 +51916,8 @@ var ga = function(t, n, r) {
51869
51916
  }, OTe = function(t, n, r, a) {
51870
51917
  return X.makeSymbol(t, "Size" + n + "-Regular", r, a);
51871
51918
  }, N6 = function(t, n, r, a, i, o) {
51872
- var s = OTe(t, n, i, a), l = Xp(X.makeSpan(["delimsizing", "size" + n], [s], a), xe.TEXT, a, o);
51873
- return r && S6(l, a, xe.TEXT), l;
51919
+ var s = OTe(t, n, i, a), l = Xp(X.makeSpan(["delimsizing", "size" + n], [s], a), Ee.TEXT, a, o);
51920
+ return r && S6(l, a, Ee.TEXT), l;
51874
51921
  }, Ls = function(t, n, r) {
51875
51922
  var a;
51876
51923
  n === "Size1-Regular" ? a = "delim-size1" : a = "delim-size4";
@@ -51928,12 +51975,12 @@ var ga = function(t, n, r) {
51928
51975
  }
51929
51976
  Y.push(bi), Y.push(Ls(s, h, i));
51930
51977
  }
51931
- var O = a.havingBaseStyle(xe.TEXT), le = X.makeVList({
51978
+ var O = a.havingBaseStyle(Ee.TEXT), le = X.makeVList({
51932
51979
  positionType: "bottom",
51933
51980
  positionData: U,
51934
51981
  children: Y
51935
51982
  }, O);
51936
- return Xp(X.makeSpan(["delimsizing", "mult"], [le], O), xe.TEXT, a, o);
51983
+ return Xp(X.makeSpan(["delimsizing", "mult"], [le], O), Ee.TEXT, a, o);
51937
51984
  }, $s = 80, zs = 0.08, Fs = function(t, n, r, a, i) {
51938
51985
  var o = FAe(t, a, r), s = new hr(t, o), l = new Wn([s], {
51939
51986
  // Note: 1000:1 ratio of viewBox to document em width.
@@ -51962,13 +52009,13 @@ var ga = function(t, n, r) {
51962
52009
  throw new ie("Illegal delimiter: '" + t + "'");
51963
52010
  }, PTe = [{
51964
52011
  type: "small",
51965
- style: xe.SCRIPTSCRIPT
52012
+ style: Ee.SCRIPTSCRIPT
51966
52013
  }, {
51967
52014
  type: "small",
51968
- style: xe.SCRIPT
52015
+ style: Ee.SCRIPT
51969
52016
  }, {
51970
52017
  type: "small",
51971
- style: xe.TEXT
52018
+ style: Ee.TEXT
51972
52019
  }, {
51973
52020
  type: "large",
51974
52021
  size: 1
@@ -51983,24 +52030,24 @@ var ga = function(t, n, r) {
51983
52030
  size: 4
51984
52031
  }], qTe = [{
51985
52032
  type: "small",
51986
- style: xe.SCRIPTSCRIPT
52033
+ style: Ee.SCRIPTSCRIPT
51987
52034
  }, {
51988
52035
  type: "small",
51989
- style: xe.SCRIPT
52036
+ style: Ee.SCRIPT
51990
52037
  }, {
51991
52038
  type: "small",
51992
- style: xe.TEXT
52039
+ style: Ee.TEXT
51993
52040
  }, {
51994
52041
  type: "stack"
51995
52042
  }], R6 = [{
51996
52043
  type: "small",
51997
- style: xe.SCRIPTSCRIPT
52044
+ style: Ee.SCRIPTSCRIPT
51998
52045
  }, {
51999
52046
  type: "small",
52000
- style: xe.SCRIPT
52047
+ style: Ee.SCRIPT
52001
52048
  }, {
52002
52049
  type: "small",
52003
- style: xe.TEXT
52050
+ style: Ee.TEXT
52004
52051
  }, {
52005
52052
  type: "large",
52006
52053
  size: 1
@@ -52620,7 +52667,7 @@ var $n = function(t, n) {
52620
52667
  // User override.
52621
52668
  ), p = 1 / n.fontMetrics().ptPerEm, m = 5 * p;
52622
52669
  if (t.colSeparationType && t.colSeparationType === "small") {
52623
- var h = n.havingStyle(xe.SCRIPT).sizeMultiplier;
52670
+ var h = n.havingStyle(Ee.SCRIPT).sizeMultiplier;
52624
52671
  m = 0.2778 * (h / n.sizeMultiplier);
52625
52672
  }
52626
52673
  var g = t.colSeparationType === "CD" ? dt({
@@ -52675,36 +52722,36 @@ var $n = function(t, n) {
52675
52722
  if (!(a >= s)) {
52676
52723
  var Ce = void 0;
52677
52724
  (a > 0 || t.hskipBeforeAndAfter) && (Ce = _e.deflt(J.pregap, m), Ce !== 0 && (R = X.makeSpan(["arraycolsep"], []), R.style.width = ue(Ce), W.push(R)));
52678
- var Pe = [];
52725
+ var qe = [];
52679
52726
  for (r = 0; r < i; ++r) {
52680
52727
  var ot = l[r], We = ot[a];
52681
52728
  if (We) {
52682
52729
  var re = ot.pos - Y;
52683
- We.depth = ot.depth, We.height = ot.height, Pe.push({
52730
+ We.depth = ot.depth, We.height = ot.height, qe.push({
52684
52731
  type: "elem",
52685
52732
  elem: We,
52686
52733
  shift: re
52687
52734
  });
52688
52735
  }
52689
52736
  }
52690
- Pe = X.makeVList({
52737
+ qe = X.makeVList({
52691
52738
  positionType: "individualShift",
52692
- children: Pe
52693
- }, n), Pe = X.makeSpan(["col-align-" + (J.align || "c")], [Pe]), W.push(Pe), (a < s - 1 || t.hskipBeforeAndAfter) && (Ce = _e.deflt(J.postgap, m), Ce !== 0 && (R = X.makeSpan(["arraycolsep"], []), R.style.width = ue(Ce), W.push(R)));
52739
+ children: qe
52740
+ }, n), qe = X.makeSpan(["col-align-" + (J.align || "c")], [qe]), W.push(qe), (a < s - 1 || t.hskipBeforeAndAfter) && (Ce = _e.deflt(J.postgap, m), Ce !== 0 && (R = X.makeSpan(["arraycolsep"], []), R.style.width = ue(Ce), W.push(R)));
52694
52741
  }
52695
52742
  }
52696
52743
  if (l = X.makeSpan(["mtable"], W), u.length > 0) {
52697
- for (var Se = X.makeLineSpan("hline", n, d), He = X.makeLineSpan("hdashline", n, d), Ze = [{
52744
+ for (var Se = X.makeLineSpan("hline", n, d), He = X.makeLineSpan("hdashline", n, d), Xe = [{
52698
52745
  type: "elem",
52699
52746
  elem: l,
52700
52747
  shift: 0
52701
52748
  }]; u.length > 0; ) {
52702
52749
  var Ae = u.pop(), ve = Ae.pos - Y;
52703
- Ae.isDashed ? Ze.push({
52750
+ Ae.isDashed ? Xe.push({
52704
52751
  type: "elem",
52705
52752
  elem: He,
52706
52753
  shift: ve
52707
- }) : Ze.push({
52754
+ }) : Xe.push({
52708
52755
  type: "elem",
52709
52756
  elem: Se,
52710
52757
  shift: ve
@@ -52712,7 +52759,7 @@ var $n = function(t, n) {
52712
52759
  }
52713
52760
  l = X.makeVList({
52714
52761
  positionType: "individualShift",
52715
- children: Ze
52762
+ children: Xe
52716
52763
  }, n);
52717
52764
  }
52718
52765
  if (V.length === 0)
@@ -53207,7 +53254,7 @@ me({
53207
53254
  });
53208
53255
  var P6 = (e, t) => {
53209
53256
  var n = t;
53210
- return e === "display" ? n = n.id >= xe.SCRIPT.id ? n.text() : xe.DISPLAY : e === "text" && n.size === xe.DISPLAY.size ? n = xe.TEXT : e === "script" ? n = xe.SCRIPT : e === "scriptscript" && (n = xe.SCRIPTSCRIPT), n;
53257
+ return e === "display" ? n = n.id >= Ee.SCRIPT.id ? n.text() : Ee.DISPLAY : e === "text" && n.size === Ee.DISPLAY.size ? n = Ee.TEXT : e === "script" ? n = Ee.SCRIPT : e === "scriptscript" && (n = Ee.SCRIPTSCRIPT), n;
53211
53258
  }, nh = (e, t) => {
53212
53259
  var n = P6(e.size, t.style), r = n.fracNum(), a = n.fracDen(), i;
53213
53260
  i = t.havingStyle(r);
@@ -53220,7 +53267,7 @@ var P6 = (e, t) => {
53220
53267
  var u = Ge(e.denom, i, t), d, p, m;
53221
53268
  e.hasBarLine ? (e.barSize ? (p = dt(e.barSize, t), d = X.makeLineSpan("frac-line", t, p)) : d = X.makeLineSpan("frac-line", t), p = d.height, m = d.height) : (d = null, p = 0, m = t.fontMetrics().defaultRuleThickness);
53222
53269
  var h, g, f;
53223
- n.size === xe.DISPLAY.size || e.size === "display" ? (h = t.fontMetrics().num1, p > 0 ? g = 3 * m : g = 7 * m, f = t.fontMetrics().denom1) : (p > 0 ? (h = t.fontMetrics().num2, g = m) : (h = t.fontMetrics().num3, g = 3 * m), f = t.fontMetrics().denom2);
53270
+ n.size === Ee.DISPLAY.size || e.size === "display" ? (h = t.fontMetrics().num1, p > 0 ? g = 3 * m : g = 7 * m, f = t.fontMetrics().denom1) : (p > 0 ? (h = t.fontMetrics().num2, g = m) : (h = t.fontMetrics().num3, g = 3 * m), f = t.fontMetrics().denom2);
53224
53271
  var w;
53225
53272
  if (d) {
53226
53273
  var b = t.fontMetrics().axisHeight;
@@ -53259,7 +53306,7 @@ var P6 = (e, t) => {
53259
53306
  }
53260
53307
  i = t.havingStyle(n), w.height *= i.sizeMultiplier / t.sizeMultiplier, w.depth *= i.sizeMultiplier / t.sizeMultiplier;
53261
53308
  var E;
53262
- n.size === xe.DISPLAY.size ? E = t.fontMetrics().delim1 : n.size === xe.SCRIPTSCRIPT.size ? E = t.havingStyle(xe.SCRIPT).fontMetrics().delim2 : E = t.fontMetrics().delim2;
53309
+ n.size === Ee.DISPLAY.size ? E = t.fontMetrics().delim1 : n.size === Ee.SCRIPTSCRIPT.size ? E = t.havingStyle(Ee.SCRIPT).fontMetrics().delim2 : E = t.fontMetrics().delim2;
53263
53310
  var S, x;
53264
53311
  return e.leftDelim == null ? S = $a(t, ["mopen"]) : S = jn.customSizedDelim(e.leftDelim, E, !0, t.havingStyle(n), e.mode, ["mopen"]), e.continued ? x = X.makeSpan([]) : e.rightDelim == null ? x = $a(t, ["mclose"]) : x = jn.customSizedDelim(e.rightDelim, E, !0, t.havingStyle(n), e.mode, ["mclose"]), X.makeSpan(["mord"].concat(i.sizingClasses(t)), [S, X.makeSpan(["mfrac"], [w]), x], t);
53265
53312
  }, rh = (e, t) => {
@@ -53273,7 +53320,7 @@ var P6 = (e, t) => {
53273
53320
  var a = P6(e.size, t.style);
53274
53321
  if (a.size !== t.style.size) {
53275
53322
  n = new ae.MathNode("mstyle", [n]);
53276
- var i = a.size === xe.DISPLAY.size ? "true" : "false";
53323
+ var i = a.size === Ee.DISPLAY.size ? "true" : "false";
53277
53324
  n.setAttribute("displaystyle", i), n.setAttribute("scriptlevel", "0");
53278
53325
  }
53279
53326
  if (e.leftDelim != null || e.rightDelim != null) {
@@ -53523,7 +53570,7 @@ me({
53523
53570
  var q6 = (e, t) => {
53524
53571
  var n = t.style, r, a;
53525
53572
  e.type === "supsub" ? (r = e.sup ? Ge(e.sup, t.havingStyle(n.sup()), t) : Ge(e.sub, t.havingStyle(n.sub()), t), a = Ie(e.base, "horizBrace")) : a = Ie(e, "horizBrace");
53526
- var i = Ge(a.base, t.havingBaseStyle(xe.DISPLAY)), o = Yn.svgSpan(a, t), s;
53573
+ var i = Ge(a.base, t.havingBaseStyle(Ee.DISPLAY)), o = Yn.svgSpan(a, t), s;
53527
53574
  if (a.isOver ? (s = X.makeVList({
53528
53575
  positionType: "firstBaseline",
53529
53576
  children: [{
@@ -53998,13 +54045,13 @@ me({
53998
54045
  });
53999
54046
  var pf = (e, t) => {
54000
54047
  switch (t.style.size) {
54001
- case xe.DISPLAY.size:
54048
+ case Ee.DISPLAY.size:
54002
54049
  return e.display;
54003
- case xe.TEXT.size:
54050
+ case Ee.TEXT.size:
54004
54051
  return e.text;
54005
- case xe.SCRIPT.size:
54052
+ case Ee.SCRIPT.size:
54006
54053
  return e.script;
54007
- case xe.SCRIPTSCRIPT.size:
54054
+ case Ee.SCRIPTSCRIPT.size:
54008
54055
  return e.scriptscript;
54009
54056
  default:
54010
54057
  return e.text;
@@ -54139,7 +54186,7 @@ var B6 = (e, t, n, r, a, i, o) => {
54139
54186
  var n, r, a = !1, i;
54140
54187
  e.type === "supsub" ? (n = e.sup, r = e.sub, i = Ie(e.base, "op"), a = !0) : i = Ie(e, "op");
54141
54188
  var o = t.style, s = !1;
54142
- o.size === xe.DISPLAY.size && i.symbol && !_e.contains(U6, i.name) && (s = !0);
54189
+ o.size === Ee.DISPLAY.size && i.symbol && !_e.contains(U6, i.name) && (s = !0);
54143
54190
  var l;
54144
54191
  if (i.symbol) {
54145
54192
  var u = s ? "Size2-Regular" : "Size1-Regular", d = "";
@@ -54733,7 +54780,7 @@ me({
54733
54780
  var n = Ge(e.body, t.havingCrampedStyle());
54734
54781
  n.height === 0 && (n.height = t.fontMetrics().xHeight), n = X.wrapFragment(n, t);
54735
54782
  var r = t.fontMetrics(), a = r.defaultRuleThickness, i = a;
54736
- t.style.id < xe.TEXT.id && (i = t.fontMetrics().xHeight);
54783
+ t.style.id < Ee.TEXT.id && (i = t.fontMetrics().xHeight);
54737
54784
  var o = a + i / 4, s = n.height + n.depth + o + a, {
54738
54785
  span: l,
54739
54786
  ruleWidth: u,
@@ -54760,7 +54807,7 @@ me({
54760
54807
  }]
54761
54808
  }, t);
54762
54809
  if (e.index) {
54763
- var g = t.havingStyle(xe.SCRIPTSCRIPT), f = Ge(e.index, g, t), w = 0.6 * (h.height - h.depth), _ = X.makeVList({
54810
+ var g = t.havingStyle(Ee.SCRIPTSCRIPT), f = Ge(e.index, g, t), w = 0.6 * (h.height - h.depth), _ = X.makeVList({
54764
54811
  positionType: "shift",
54765
54812
  positionData: -w,
54766
54813
  children: [{
@@ -54781,10 +54828,10 @@ me({
54781
54828
  }
54782
54829
  });
54783
54830
  var mf = {
54784
- display: xe.DISPLAY,
54785
- text: xe.TEXT,
54786
- script: xe.SCRIPT,
54787
- scriptscript: xe.SCRIPTSCRIPT
54831
+ display: Ee.DISPLAY,
54832
+ text: Ee.TEXT,
54833
+ script: Ee.SCRIPT,
54834
+ scriptscript: Ee.SCRIPTSCRIPT
54788
54835
  };
54789
54836
  me({
54790
54837
  type: "styling",
@@ -54827,10 +54874,10 @@ var ZTe = function(t, n) {
54827
54874
  var r = t.base;
54828
54875
  if (r)
54829
54876
  if (r.type === "op") {
54830
- var a = r.limits && (n.style.size === xe.DISPLAY.size || r.alwaysHandleSupSub);
54877
+ var a = r.limits && (n.style.size === Ee.DISPLAY.size || r.alwaysHandleSupSub);
54831
54878
  return a ? sa : null;
54832
54879
  } else if (r.type === "operatorname") {
54833
- var i = r.alwaysHandleSupSub && (n.style.size === xe.DISPLAY.size || r.limits);
54880
+ var i = r.alwaysHandleSupSub && (n.style.size === Ee.DISPLAY.size || r.limits);
54834
54881
  return i ? H6 : null;
54835
54882
  } else {
54836
54883
  if (r.type === "accent")
@@ -54864,7 +54911,7 @@ Cr({
54864
54911
  l = Ge(i, g, t), m || (p = o.depth + g.fontMetrics().subDrop * g.sizeMultiplier / t.sizeMultiplier);
54865
54912
  }
54866
54913
  var f;
54867
- t.style === xe.DISPLAY ? f = u.sup1 : t.style.cramped ? f = u.sup3 : f = u.sup2;
54914
+ t.style === Ee.DISPLAY ? f = u.sup1 : t.style.cramped ? f = u.sup3 : f = u.sup2;
54868
54915
  var w = t.sizeMultiplier, _ = ue(0.5 / u.ptPerEm / w), b = null;
54869
54916
  if (l) {
54870
54917
  var v = e.base && e.base.type === "op" && e.base.name && (e.base.name === "\\oiint" || e.base.name === "\\oiiint");
@@ -54934,14 +54981,14 @@ Cr({
54934
54981
  else if (e.sub)
54935
54982
  if (e.sup) {
54936
54983
  var u = e.base;
54937
- u && u.type === "op" && u.limits && t.style === xe.DISPLAY || u && u.type === "operatorname" && u.alwaysHandleSupSub && (t.style === xe.DISPLAY || u.limits) ? o = "munderover" : o = "msubsup";
54984
+ u && u.type === "op" && u.limits && t.style === Ee.DISPLAY || u && u.type === "operatorname" && u.alwaysHandleSupSub && (t.style === Ee.DISPLAY || u.limits) ? o = "munderover" : o = "msubsup";
54938
54985
  } else {
54939
54986
  var l = e.base;
54940
- l && l.type === "op" && l.limits && (t.style === xe.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || t.style === xe.DISPLAY) ? o = "munder" : o = "msub";
54987
+ l && l.type === "op" && l.limits && (t.style === Ee.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || t.style === Ee.DISPLAY) ? o = "munder" : o = "msub";
54941
54988
  }
54942
54989
  else {
54943
54990
  var s = e.base;
54944
- s && s.type === "op" && s.limits && (t.style === xe.DISPLAY || s.alwaysHandleSupSub) || s && s.type === "operatorname" && s.alwaysHandleSupSub && (s.limits || t.style === xe.DISPLAY) ? o = "mover" : o = "msup";
54991
+ s && s.type === "op" && s.limits && (t.style === Ee.DISPLAY || s.alwaysHandleSupSub) || s && s.type === "operatorname" && s.alwaysHandleSupSub && (s.limits || t.style === Ee.DISPLAY) ? o = "mover" : o = "msup";
54945
54992
  }
54946
54993
  return new ae.MathNode(o, i);
54947
54994
  }
@@ -70057,7 +70104,7 @@ function oOe(e) {
70057
70104
  match: En
70058
70105
  }
70059
70106
  ]
70060
- }, Pe = {
70107
+ }, qe = {
70061
70108
  begin: /\(/,
70062
70109
  end: /\)/,
70063
70110
  keywords: u,
@@ -70086,7 +70133,7 @@ function oOe(e) {
70086
70133
  },
70087
70134
  contains: [
70088
70135
  ke,
70089
- Pe,
70136
+ qe,
70090
70137
  t
70091
70138
  ],
70092
70139
  illegal: [
@@ -70101,7 +70148,7 @@ function oOe(e) {
70101
70148
  className: { 1: "keyword" },
70102
70149
  contains: [
70103
70150
  ke,
70104
- Pe,
70151
+ qe,
70105
70152
  t
70106
70153
  ],
70107
70154
  illegal: /\[|%/
@@ -70144,7 +70191,7 @@ function oOe(e) {
70144
70191
  3: "keyword",
70145
70192
  5: "title.function"
70146
70193
  }
70147
- }, Ze = {
70194
+ }, Xe = {
70148
70195
  match: [
70149
70196
  /class\b/,
70150
70197
  /\s+/,
@@ -70215,7 +70262,7 @@ function oOe(e) {
70215
70262
  ot,
70216
70263
  We,
70217
70264
  He,
70218
- Ze,
70265
+ Xe,
70219
70266
  Ae,
70220
70267
  re,
70221
70268
  Se,
@@ -72352,7 +72399,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72352
72399
  }
72353
72400
  function J() {
72354
72401
  if (!de.keywords) {
72355
- Xe.addText(je);
72402
+ Qe.addText(je);
72356
72403
  return;
72357
72404
  }
72358
72405
  let q = 0;
@@ -72360,10 +72407,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72360
72407
  let Z = de.keywordPatternRe.exec(je), te = "";
72361
72408
  for (; Z; ) {
72362
72409
  te += je.substring(q, Z.index);
72363
- const pe = Ae.case_insensitive ? Z[0].toLowerCase() : Z[0], Ee = K(de, pe);
72364
- if (Ee) {
72365
- const [Le, wt] = Ee;
72366
- if (Xe.addText(te), te = "", N[pe] = (N[pe] || 0) + 1, N[pe] <= iLe && (ce += wt), Le.startsWith("_"))
72410
+ const pe = Ae.case_insensitive ? Z[0].toLowerCase() : Z[0], Me = K(de, pe);
72411
+ if (Me) {
72412
+ const [Le, wt] = Me;
72413
+ if (Qe.addText(te), te = "", N[pe] = (N[pe] || 0) + 1, N[pe] <= iLe && (ce += wt), Le.startsWith("_"))
72367
72414
  te += Z[0];
72368
72415
  else {
72369
72416
  const St = Ae.classNameAliases[Le] || Le;
@@ -72373,7 +72420,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72373
72420
  te += Z[0];
72374
72421
  q = de.keywordPatternRe.lastIndex, Z = de.keywordPatternRe.exec(je);
72375
72422
  }
72376
- te += je.substring(q), Xe.addText(te);
72423
+ te += je.substring(q), Qe.addText(te);
72377
72424
  }
72378
72425
  function O() {
72379
72426
  if (je === "")
@@ -72381,20 +72428,20 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72381
72428
  let q = null;
72382
72429
  if (typeof de.subLanguage == "string") {
72383
72430
  if (!t[de.subLanguage]) {
72384
- Xe.addText(je);
72431
+ Qe.addText(je);
72385
72432
  return;
72386
72433
  }
72387
72434
  q = p(de.subLanguage, je, !0, tt[de.subLanguage]), tt[de.subLanguage] = /** @type {CompiledMode} */
72388
72435
  q._top;
72389
72436
  } else
72390
72437
  q = h(je, de.subLanguage.length ? de.subLanguage : null);
72391
- de.relevance > 0 && (ce += q.relevance), Xe.__addSublanguage(q._emitter, q.language);
72438
+ de.relevance > 0 && (ce += q.relevance), Qe.__addSublanguage(q._emitter, q.language);
72392
72439
  }
72393
72440
  function le() {
72394
72441
  de.subLanguage != null ? O() : J(), je = "";
72395
72442
  }
72396
72443
  function fe(q, Z) {
72397
- q !== "" && (Xe.startScope(Z), Xe.addText(q), Xe.endScope());
72444
+ q !== "" && (Qe.startScope(Z), Qe.addText(q), Qe.endScope());
72398
72445
  }
72399
72446
  function ke(q, Z) {
72400
72447
  let te = 1;
@@ -72404,19 +72451,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72404
72451
  te++;
72405
72452
  continue;
72406
72453
  }
72407
- const Ee = Ae.classNameAliases[q[te]] || q[te], Le = Z[te];
72408
- Ee ? fe(Le, Ee) : (je = Le, J(), je = ""), te++;
72454
+ const Me = Ae.classNameAliases[q[te]] || q[te], Le = Z[te];
72455
+ Me ? fe(Le, Me) : (je = Le, J(), je = ""), te++;
72409
72456
  }
72410
72457
  }
72411
72458
  function Ce(q, Z) {
72412
- return q.scope && typeof q.scope == "string" && Xe.openNode(Ae.classNameAliases[q.scope] || q.scope), q.beginScope && (q.beginScope._wrap ? (fe(je, Ae.classNameAliases[q.beginScope._wrap] || q.beginScope._wrap), je = "") : q.beginScope._multi && (ke(q.beginScope, Z), je = "")), de = Object.create(q, { parent: { value: de } }), de;
72459
+ return q.scope && typeof q.scope == "string" && Qe.openNode(Ae.classNameAliases[q.scope] || q.scope), q.beginScope && (q.beginScope._wrap ? (fe(je, Ae.classNameAliases[q.beginScope._wrap] || q.beginScope._wrap), je = "") : q.beginScope._multi && (ke(q.beginScope, Z), je = "")), de = Object.create(q, { parent: { value: de } }), de;
72413
72460
  }
72414
- function Pe(q, Z, te) {
72461
+ function qe(q, Z, te) {
72415
72462
  let pe = _Oe(q.endRe, te);
72416
72463
  if (pe) {
72417
72464
  if (q["on:end"]) {
72418
- const Ee = new Gf(q);
72419
- q["on:end"](Z, Ee), Ee.isMatchIgnored && (pe = !1);
72465
+ const Me = new Gf(q);
72466
+ q["on:end"](Z, Me), Me.isMatchIgnored && (pe = !1);
72420
72467
  }
72421
72468
  if (pe) {
72422
72469
  for (; q.endsParent && q.parent; )
@@ -72425,37 +72472,37 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72425
72472
  }
72426
72473
  }
72427
72474
  if (q.endsWithParent)
72428
- return Pe(q.parent, Z, te);
72475
+ return qe(q.parent, Z, te);
72429
72476
  }
72430
72477
  function ot(q) {
72431
- return de.matcher.regexIndex === 0 ? (je += q[0], 1) : (qe = !0, 0);
72478
+ return de.matcher.regexIndex === 0 ? (je += q[0], 1) : (Be = !0, 0);
72432
72479
  }
72433
72480
  function We(q) {
72434
- const Z = q[0], te = q.rule, pe = new Gf(te), Ee = [te.__beforeBegin, te["on:begin"]];
72435
- for (const Le of Ee)
72481
+ const Z = q[0], te = q.rule, pe = new Gf(te), Me = [te.__beforeBegin, te["on:begin"]];
72482
+ for (const Le of Me)
72436
72483
  if (Le && (Le(q, pe), pe.isMatchIgnored))
72437
72484
  return ot(Z);
72438
72485
  return te.skip ? je += Z : (te.excludeBegin && (je += Z), le(), !te.returnBegin && !te.excludeBegin && (je = Z)), Ce(te, q), te.returnBegin ? 0 : Z.length;
72439
72486
  }
72440
72487
  function re(q) {
72441
- const Z = q[0], te = V.substring(q.index), pe = Pe(de, q, te);
72488
+ const Z = q[0], te = V.substring(q.index), pe = qe(de, q, te);
72442
72489
  if (!pe)
72443
72490
  return Qf;
72444
- const Ee = de;
72445
- de.endScope && de.endScope._wrap ? (le(), fe(Z, de.endScope._wrap)) : de.endScope && de.endScope._multi ? (le(), ke(de.endScope, q)) : Ee.skip ? je += Z : (Ee.returnEnd || Ee.excludeEnd || (je += Z), le(), Ee.excludeEnd && (je = Z));
72491
+ const Me = de;
72492
+ de.endScope && de.endScope._wrap ? (le(), fe(Z, de.endScope._wrap)) : de.endScope && de.endScope._multi ? (le(), ke(de.endScope, q)) : Me.skip ? je += Z : (Me.returnEnd || Me.excludeEnd || (je += Z), le(), Me.excludeEnd && (je = Z));
72446
72493
  do
72447
- de.scope && Xe.closeNode(), !de.skip && !de.subLanguage && (ce += de.relevance), de = de.parent;
72494
+ de.scope && Qe.closeNode(), !de.skip && !de.subLanguage && (ce += de.relevance), de = de.parent;
72448
72495
  while (de !== pe.parent);
72449
- return pe.starts && Ce(pe.starts, q), Ee.returnEnd ? 0 : Z.length;
72496
+ return pe.starts && Ce(pe.starts, q), Me.returnEnd ? 0 : Z.length;
72450
72497
  }
72451
72498
  function Se() {
72452
72499
  const q = [];
72453
72500
  for (let Z = de; Z !== Ae; Z = Z.parent)
72454
72501
  Z.scope && q.unshift(Z.scope);
72455
- q.forEach((Z) => Xe.openNode(Z));
72502
+ q.forEach((Z) => Qe.openNode(Z));
72456
72503
  }
72457
72504
  let He = {};
72458
- function Ze(q, Z) {
72505
+ function Xe(q, Z) {
72459
72506
  const te = Z && Z[0];
72460
72507
  if (je += q, te == null)
72461
72508
  return le(), 0;
@@ -72488,29 +72535,29 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72488
72535
  throw Mr(i.replace("{}", H)), new Error('Unknown language: "' + H + '"');
72489
72536
  const ve = tLe(Ae);
72490
72537
  let Ke = "", de = j || ve;
72491
- const tt = {}, Xe = new s.__emitter(s);
72538
+ const tt = {}, Qe = new s.__emitter(s);
72492
72539
  Se();
72493
- let je = "", ce = 0, Me = 0, be = 0, qe = !1;
72540
+ let je = "", ce = 0, we = 0, be = 0, Be = !1;
72494
72541
  try {
72495
72542
  if (Ae.__emitTokens)
72496
- Ae.__emitTokens(V, Xe);
72543
+ Ae.__emitTokens(V, Qe);
72497
72544
  else {
72498
72545
  for (de.matcher.considerAll(); ; ) {
72499
- be++, qe ? qe = !1 : de.matcher.considerAll(), de.matcher.lastIndex = Me;
72546
+ be++, Be ? Be = !1 : de.matcher.considerAll(), de.matcher.lastIndex = we;
72500
72547
  const q = de.matcher.exec(V);
72501
72548
  if (!q)
72502
72549
  break;
72503
- const Z = V.substring(Me, q.index), te = Ze(Z, q);
72504
- Me = q.index + te;
72550
+ const Z = V.substring(we, q.index), te = Xe(Z, q);
72551
+ we = q.index + te;
72505
72552
  }
72506
- Ze(V.substring(Me));
72553
+ Xe(V.substring(we));
72507
72554
  }
72508
- return Xe.finalize(), Ke = Xe.toHTML(), {
72555
+ return Qe.finalize(), Ke = Qe.toHTML(), {
72509
72556
  language: H,
72510
72557
  value: Ke,
72511
72558
  relevance: ce,
72512
72559
  illegal: !1,
72513
- _emitter: Xe,
72560
+ _emitter: Qe,
72514
72561
  _top: de
72515
72562
  };
72516
72563
  } catch (q) {
@@ -72522,12 +72569,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72522
72569
  relevance: 0,
72523
72570
  _illegalBy: {
72524
72571
  message: q.message,
72525
- index: Me,
72526
- context: V.slice(Me - 100, Me + 100),
72572
+ index: we,
72573
+ context: V.slice(we - 100, we + 100),
72527
72574
  mode: q.mode,
72528
72575
  resultSoFar: Ke
72529
72576
  },
72530
- _emitter: Xe
72577
+ _emitter: Qe
72531
72578
  };
72532
72579
  if (a)
72533
72580
  return {
@@ -72536,7 +72583,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), N = H, j = V), D ===
72536
72583
  illegal: !1,
72537
72584
  relevance: 0,
72538
72585
  errorRaised: q,
72539
- _emitter: Xe,
72586
+ _emitter: Qe,
72540
72587
  _top: de
72541
72588
  };
72542
72589
  throw q;
@@ -73418,9 +73465,9 @@ function zLe(e, t) {
73418
73465
  defaultCodeValue: fe
73419
73466
  });
73420
73467
  ke.language === null && (ke.value = fe);
73421
- var Ce = ke.value.length + v, Pe = LLe(ke, z, U, f, _, v, Ce, x, T);
73468
+ var Ce = ke.value.length + v, qe = LLe(ke, z, U, f, _, v, Ce, x, T);
73422
73469
  return /* @__PURE__ */ rr.createElement(W, le, /* @__PURE__ */ rr.createElement(H, p, !_ && K, Y({
73423
- rows: Pe,
73470
+ rows: qe,
73424
73471
  stylesheet: s,
73425
73472
  useInlineStyles: h
73426
73473
  })));
@@ -74960,10 +75007,10 @@ var l7 = { exports: {} };
74960
75007
  K--, N = b.slice(j, le), J.index -= j;
74961
75008
  } else if (J = u(V, 0, N, Q), !J)
74962
75009
  continue;
74963
- var ke = J.index, Ce = J[0], Pe = N.slice(0, ke), ot = N.slice(ke + Ce.length), We = j + N.length;
75010
+ var ke = J.index, Ce = J[0], qe = N.slice(0, ke), ot = N.slice(ke + Ce.length), We = j + N.length;
74964
75011
  z && We > z.reach && (z.reach = We);
74965
75012
  var re = D.prev;
74966
- Pe && (re = m(v, re, Pe), j += Pe.length), h(v, re, K);
75013
+ qe && (re = m(v, re, qe), j += qe.length), h(v, re, K);
74967
75014
  var Se = new l(P, Y ? s.tokenize(Ce, Y) : Ce, R, Ce);
74968
75015
  if (D = m(v, re, Se), ot && m(v, D, ot), K > 1) {
74969
75016
  var He = {
@@ -96326,7 +96373,7 @@ const YHe = {
96326
96373
  );
96327
96374
  k7.displayName = "CodeContent";
96328
96375
  const v7 = Rt(({ lang: e = "text", codeChildren: t, allowExecution: n = !1 }) => {
96329
- const { colorMode: r } = S7e(), a = Yd(t).replace(/\n$/, ""), i = r === "light" ? HHe : UHe, { truncated: o, isTruncated: s, totalLines: l } = lt(() => KHe(a), [a]), [u, d] = et(!1), p = Qe(() => d((g) => !g), []), m = u ? a : o, h = lt(() => WHe(m), [m]);
96376
+ const { colorMode: r } = S7e(), a = Yd(t).replace(/\n$/, ""), i = r === "light" ? HHe : UHe, { truncated: o, isTruncated: s, totalLines: l } = lt(() => KHe(a), [a]), [u, d] = et(!1), p = Ye(() => d((g) => !g), []), m = u ? a : o, h = lt(() => WHe(m), [m]);
96330
96377
  return /* @__PURE__ */ oe("div", { className: "mp-agent-code-block-wrapper", children: [
96331
96378
  /* @__PURE__ */ oe("div", { className: "mp-agent-code-block-header", children: [
96332
96379
  /* @__PURE__ */ C("span", { className: "mp-agent-code-block-language", children: e }),
@@ -96415,10 +96462,10 @@ const ZHe = (e) => x5(e) ? e.key?.startsWith("code-") ?? !1 : !1, XHe = Rt(({ cl
96415
96462
  ));
96416
96463
  Uh.displayName = "MarkdownMessage";
96417
96464
  const iVe = ({ content: e, role: t }) => {
96418
- const n = t === Ye.User, r = t === Ye.Error, a = t === Ye.Reasoning;
96465
+ const n = t === Ze.User, r = t === Ze.Error, a = t === Ze.Reasoning;
96419
96466
  return n ? /* @__PURE__ */ C("p", { style: { margin: 0, whiteSpace: "pre-wrap" }, children: e }) : r ? /* @__PURE__ */ C("p", { style: { margin: 0, whiteSpace: "pre-wrap" }, children: e }) : a ? /* @__PURE__ */ C("pre", { style: { margin: 0, fontSize: "13px", opacity: 0.8 }, children: e }) : /* @__PURE__ */ C(Uh, { text: e });
96420
96467
  }, oVe = ({ text: e, isReasoning: t }) => t ? null : /* @__PURE__ */ C("div", { className: "mp-agent-message-actions", children: /* @__PURE__ */ C(gp, { text: e }) }), _7 = ({ message: e, showParticipantChrome: t = !1 }) => {
96421
- const n = e.role === Ye.User, r = e.role === Ye.Error, a = e.role === Ye.Reasoning, i = !!e.content, o = (e.attachments?.length ?? 0) > 0, s = t && !!(e.sender || e.agentName);
96468
+ const n = e.role === Ze.User, r = e.role === Ze.Error, a = e.role === Ze.Reasoning, i = !!e.content, o = (e.attachments?.length ?? 0) > 0, s = t && !!(e.sender || e.agentName);
96422
96469
  return /* @__PURE__ */ oe(
96423
96470
  "div",
96424
96471
  {
@@ -96445,7 +96492,7 @@ const iVe = ({ content: e, role: t }) => {
96445
96492
  }
96446
96493
  );
96447
96494
  }, Hh = Rt(({ reasoning: e, isStreaming: t }) => {
96448
- const [n, r] = et(!0), a = Fe(null);
96495
+ const [n, r] = et(!0), a = ze(null);
96449
96496
  return $e(() => {
96450
96497
  if (n)
96451
96498
  return;
@@ -96516,8 +96563,8 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96516
96563
  isStreaming: n,
96517
96564
  showParticipantChrome: r = !1
96518
96565
  }) => {
96519
- const i = Ue().config.features?.reasoning !== !1;
96520
- if (e.role === Ye.Assistant && (e.parts?.length ?? 0) > 0)
96566
+ const i = Pe().config.features?.reasoning !== !1;
96567
+ if (e.role === Ze.Assistant && (e.parts?.length ?? 0) > 0)
96521
96568
  return /* @__PURE__ */ C(
96522
96569
  lVe,
96523
96570
  {
@@ -96528,7 +96575,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96528
96575
  showParticipantChrome: r
96529
96576
  }
96530
96577
  );
96531
- const o = i && e.role === Ye.Assistant && !!e.reasoning, s = e.role === Ye.Assistant && typeof e.content == "string" && e.content.trim().length > 0, l = !!(n && !o && !s), u = typeof e.content == "string" && e.content.trim().length > 0 || (e.attachments?.length ?? 0) > 0, d = sVe(e.toolCalls ?? []);
96578
+ const o = i && e.role === Ze.Assistant && !!e.reasoning, s = e.role === Ze.Assistant && typeof e.content == "string" && e.content.trim().length > 0, l = !!(n && !o && !s), u = typeof e.content == "string" && e.content.trim().length > 0 || (e.attachments?.length ?? 0) > 0, d = sVe(e.toolCalls ?? []);
96532
96579
  return /* @__PURE__ */ oe("div", { className: "mp-agent-message-group", children: [
96533
96580
  o && /* @__PURE__ */ C(Hh, { reasoning: e.reasoning, isStreaming: n }),
96534
96581
  l && /* @__PURE__ */ C(w7, {}),
@@ -96549,15 +96596,15 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96549
96596
  return t ? e.chatState[t]?.messages ?? w5 : w5;
96550
96597
  }, pVe = ({ showParticipantChrome: e = !1 }) => {
96551
96598
  const t = yn(), n = ge((S) => S.contextKey), r = ge((S) => S.draftChatKey), a = ge((S) => S.activeChatId), i = ge(dVe), o = a ?? r, s = v3(a), l = ge(
96552
- (S) => ze(S, o).pendingAssistant?.content?.length
96553
- ), u = ge((S) => ze(S, o).pendingAssistant?.id), d = ge((S) => ze(S, o).status), p = d === bt.Sending || d === bt.Streaming, m = Fe(null), h = Fe(!0), g = Fe(!1), f = Fe(!1), w = Fe(null), _ = dwe({
96599
+ (S) => Fe(S, o).pendingAssistant?.content?.length
96600
+ ), u = ge((S) => Fe(S, o).pendingAssistant?.id), d = ge((S) => Fe(S, o).status), p = d === bt.Sending || d === bt.Streaming, m = ze(null), h = ze(!0), g = ze(!1), f = ze(!1), w = ze(null), _ = dwe({
96554
96601
  count: i.length,
96555
96602
  getScrollElement: () => m.current,
96556
96603
  estimateSize: () => uVe,
96557
96604
  overscan: 8,
96558
96605
  gap: 16,
96559
96606
  getItemKey: (S) => i[S]?.id ?? S
96560
- }), b = _.getVirtualItems(), v = Qe(() => {
96607
+ }), b = _.getVirtualItems(), v = Ye(() => {
96561
96608
  const S = m.current;
96562
96609
  S && (S.scrollTop = S.scrollHeight);
96563
96610
  }, []);
@@ -96644,7 +96691,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96644
96691
  contextKey: t,
96645
96692
  showParticipantChrome: n
96646
96693
  }) => {
96647
- const r = ge((s) => ze(s, e)), a = r.pendingAssistant, i = r.status;
96694
+ const r = ge((s) => Fe(s, e)), a = r.pendingAssistant, i = r.status;
96648
96695
  if (!a)
96649
96696
  return null;
96650
96697
  const o = i === bt.Sending || i === bt.Streaming;
@@ -96660,7 +96707,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96660
96707
  );
96661
96708
  }
96662
96709
  ), mVe = ({ onClose: e, agentLogo: t }) => {
96663
- const n = yn(), a = Ue().config.features?.historySidebar !== !1, i = ge((u) => u.isChatHistoryOpen), o = ge((u) => u.setChatHistoryOpen), s = ge((u) => u.setActiveChat), l = () => {
96710
+ const n = yn(), a = Pe().config.features?.historySidebar !== !1, i = ge((u) => u.isChatHistoryOpen), o = ge((u) => u.setChatHistoryOpen), s = ge((u) => u.setActiveChat), l = () => {
96664
96711
  s(void 0);
96665
96712
  };
96666
96713
  return /* @__PURE__ */ oe("div", { className: "mp-agent-agent-controls", children: [
@@ -96686,7 +96733,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96686
96733
  isFetchingNextPage: n,
96687
96734
  itemRenderer: r
96688
96735
  } = {}) => {
96689
- const a = yn(), { deleteChat: i, isDeleting: o } = _3(), s = ge((h) => h.chats), l = ge((h) => h.activeChatId), u = ge((h) => h.setActiveChat), d = Fe(null), p = Fe(null), m = lt(
96736
+ const a = yn(), { deleteChat: i, isDeleting: o } = _3(), s = ge((h) => h.chats), l = ge((h) => h.activeChatId), u = ge((h) => h.setActiveChat), d = ze(null), p = ze(null), m = lt(
96690
96737
  () => Object.values(s).filter((h) => h.sessionKind !== Bi.SUBAGENT).sort((h, g) => h.updatedAt === g.updatedAt ? 0 : h.updatedAt < g.updatedAt ? 1 : -1),
96691
96738
  [s]
96692
96739
  );
@@ -96753,7 +96800,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96753
96800
  ] })
96754
96801
  ] });
96755
96802
  }, gVe = ({ loadChats: e = !0, multiUser: t = !1 }) => {
96756
- const n = Ue(), r = ge((o) => o.isChatHistoryOpen), a = n.config.features?.historySidebar !== !1, i = b3({ enabled: e && a, multiUser: t });
96803
+ const n = Pe(), r = ge((o) => o.isChatHistoryOpen), a = n.config.features?.historySidebar !== !1, i = b3({ enabled: e && a, multiUser: t });
96757
96804
  return !a || !r ? null : /* @__PURE__ */ C("div", { className: "mp-agent-chat-history-panel", children: /* @__PURE__ */ C(
96758
96805
  fVe,
96759
96806
  {
@@ -96774,7 +96821,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96774
96821
  loadChats: i = !0,
96775
96822
  restoreLastActiveChat: o = !0
96776
96823
  }) => {
96777
- const s = yn(), l = Ue(), u = ge((g) => g.activeChatId), d = ge((g) => g.setActiveChat), { isLoading: p } = h7e(), { isLoading: m, error: h } = b3({ enabled: i, multiUser: r });
96824
+ const s = yn(), l = Pe(), u = ge((g) => g.activeChatId), d = ge((g) => g.setActiveChat), { isLoading: p } = h7e(), { isLoading: m, error: h } = b3({ enabled: i, multiUser: r });
96778
96825
  return uo(() => {
96779
96826
  if (!o)
96780
96827
  return;
@@ -96788,7 +96835,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96788
96835
  /* @__PURE__ */ C(J_e, { onToolSelected: e, multiUser: r, participantIds: a })
96789
96836
  ] })
96790
96837
  ] });
96791
- }, VVe = (e) => /* @__PURE__ */ C(bVe, { ...e, multiUser: !0 }), jVe = ({
96838
+ }, jVe = (e) => /* @__PURE__ */ C(bVe, { ...e, multiUser: !0 }), GVe = ({
96792
96839
  enabled: e = !0,
96793
96840
  className: t,
96794
96841
  pageSize: n = yp,
@@ -96798,7 +96845,7 @@ const w7 = () => /* @__PURE__ */ oe("span", { className: "mp-agent-message-typin
96798
96845
  const i = yn(), o = E5(), { deleteChat: s, isDeleting: l } = _3(), u = ge((v) => v.upsertChat), d = ge((v) => v.activeChatId), p = ge((v) => v.setActiveChat), m = y3({ enabled: e, multiUser: !0, pageSize: n }), h = lt(
96799
96846
  () => r7e(m.data).filter((v) => v.sessionKind !== Bi.SUBAGENT),
96800
96847
  [m.data]
96801
- ), g = Fe(null), f = Fe(null);
96848
+ ), g = ze(null), f = ze(null);
96802
96849
  $e(() => {
96803
96850
  const v = g.current, E = f.current, { fetchNextPage: S, hasNextPage: x, isFetchingNextPage: z } = m;
96804
96851
  if (!v || !E || !S || !x)
@@ -96888,7 +96935,7 @@ export {
96888
96935
  mVe as AgentControls,
96889
96936
  K_e as AgentPreferencesPanel,
96890
96937
  Yh as AgentProcessStatus,
96891
- qVe as AgentProvider,
96938
+ BVe as AgentProvider,
96892
96939
  w7e as AgentRuntime,
96893
96940
  Bi as AgentSessionKind,
96894
96941
  Kr as AgentStatus,
@@ -96915,10 +96962,10 @@ export {
96915
96962
  iVe as MessageContent,
96916
96963
  K3 as MessageHeader,
96917
96964
  pVe as MessageList,
96918
- Ye as MessageRole,
96965
+ Ze as MessageRole,
96919
96966
  w7 as MessageTypingAnimation,
96920
- jVe as MultiUserChatList,
96921
- VVe as MultiUserChatWindow,
96967
+ GVe as MultiUserChatList,
96968
+ jVe as MultiUserChatWindow,
96922
96969
  Hh as ReasoningPanel,
96923
96970
  AVe as SendMessagePayloadSchema,
96924
96971
  ld as SocketIOConfig,
@@ -96944,11 +96991,12 @@ export {
96944
96991
  OVe as useActivitySummary,
96945
96992
  l7e as useAgentConfigurations,
96946
96993
  p7e as useAgentPreferences,
96947
- Ue as useAgentRuntime,
96994
+ Pe as useAgentRuntime,
96948
96995
  ge as useAgentStore,
96949
96996
  S7e as useAgentTheme,
96950
96997
  $Ve as useAutoScroll,
96951
96998
  b3 as useChatBootstrap,
96999
+ FVe as useChatMetadata,
96952
97000
  a7e as useChats,
96953
97001
  y3 as useChatsInfiniteList,
96954
97002
  DVe as useChatsList,
@@ -96958,7 +97006,7 @@ export {
96958
97006
  v3 as useMessagesInfinite,
96959
97007
  i7e as useModels,
96960
97008
  zVe as usePageContext,
96961
- FVe as useProposeFormValues,
97009
+ PVe as useProposeFormValues,
96962
97010
  c7e as useRuntimeEventEmitter,
96963
97011
  u7e as useRuntimeEventListener,
96964
97012
  yn as useTranslations