inline-chat-kit 0.56.0 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  import e, { createContext as t, createElement as n, forwardRef as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
3
3
  import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
4
4
  import { AnimatePresence as y, LayoutGroup as b, MotionConfig as x, animate as S, motion as C, useAnimationControls as w, useMotionValue as T, useReducedMotion as E } from "motion/react";
5
- import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as ee, ChevronRight as N, Copy as P, CornerDownLeft as F, File as te, FileText as I, Film as L, Highlighter as ne, Image as re, Link2 as R, Maximize2 as ie, MessageCircle as ae, Mic as oe, Minimize2 as se, Moon as ce, MoreHorizontal as le, Music as ue, Palette as de, Paperclip as fe, Pencil as z, Plus as pe, RotateCcw as me, Save as he, Share as ge, Square as _e, Sun as ve, TextCursor as ye, ThumbsDown as be, ThumbsUp as xe, Trash2 as Se, TriangleAlert as Ce, X as we } from "lucide-react";
5
+ import { ArrowDown as D, ArrowLeft as O, Bookmark as k, Brain as A, Check as j, ChevronDown as M, ChevronLeft as ee, ChevronRight as N, Copy as P, CornerDownLeft as F, File as te, FileText as I, Film as ne, Highlighter as re, Image as ie, Link2 as L, Maximize2 as ae, MessageCircle as oe, Mic as se, Minimize2 as R, Moon as ce, MoreHorizontal as le, Music as ue, Palette as de, Paperclip as fe, Pencil as z, Plus as pe, RotateCcw as me, Save as he, Share as ge, Square as _e, Sun as ve, TextCursor as ye, ThumbsDown as be, ThumbsUp as xe, Trash2 as Se, TriangleAlert as Ce, X as we } from "lucide-react";
6
6
  var B = {
7
7
  btn: "ick-btn-ZW5E",
8
8
  xs: "ick-xs-rDs4",
@@ -269,7 +269,7 @@ function je(e) {
269
269
  var Me = (e) => !!e.url && (e.type ?? "").startsWith("image/"), Ne = (e) => e.replace(/["\\]/g, encodeURIComponent);
270
270
  function Pe({ type: e }) {
271
271
  let t = (e ?? "").split("/")[0];
272
- return _(t === "image" ? re : t === "video" ? L : t === "audio" ? ue : e === "application/pdf" || t === "text" ? I : te, {
272
+ return _(t === "image" ? ie : t === "video" ? ne : t === "audio" ? ue : e === "application/pdf" || t === "text" ? I : te, {
273
273
  size: 16,
274
274
  "aria-hidden": !0
275
275
  });
@@ -371,7 +371,7 @@ function Le({ mode: e, color: t = "currentColor", duration: n = .22, size: r = 1
371
371
  strokeWidth: 1.8,
372
372
  strokeLinecap: "round",
373
373
  strokeLinejoin: "round"
374
- }) : e === "mic" ? /* @__PURE__ */ _(oe, {
374
+ }) : e === "mic" ? /* @__PURE__ */ _(se, {
375
375
  size: r,
376
376
  color: t,
377
377
  strokeWidth: 1.8,
@@ -549,7 +549,7 @@ function ze() {
549
549
  {
550
550
  id: "connectors",
551
551
  label: e.connectors,
552
- icon: /* @__PURE__ */ _(R, {
552
+ icon: /* @__PURE__ */ _(L, {
553
553
  size: 16,
554
554
  "aria-hidden": !0
555
555
  })
@@ -945,7 +945,7 @@ var nt = .9, rt = {
945
945
  let r = document.createTextNode(e);
946
946
  return n.insertNode(r), n.setStartAfter(r), n.collapse(!0), t.removeAllRanges(), t.addRange(n), !1;
947
947
  }, ot = r(function({ state: e, value: t, onChange: n, onSubmit: r, onStop: i, onAdd: a, attachments: s, onAttach: d, onRemoveAttachment: f, accept: h = "image/*", multiple: T = !1, onTranscribe: E, onCopy: D, onEdit: O, onCancelEdit: k, isEditing: A = !1, placeholder: j, menu: M, labels: ee, animationConfig: N, style: P }, F) {
948
- let te = l(), I = U("input", ee), L = U("voice"), ne = j ?? I.placeholder, re = M !== !1, R = p(null), ie = p(null), ae = p(null), oe = p(0), se = p(!1), ce = p(null), [le, ue] = m(!1), [de, fe] = m(!1), [z, me] = m(!1), [he, ge] = m(!0), [_e, ve] = m(!1), [ye, be] = m(!1), [xe, Se] = m(!1), Ce = p(0), B = p(!1), Te = p(0), Ee = p(!1), H = p(null);
948
+ let te = l(), I = U("input", ee), ne = U("voice"), re = j ?? I.placeholder, ie = M !== !1, L = p(null), ae = p(null), oe = p(null), se = p(0), R = p(!1), ce = p(null), [le, ue] = m(!1), [de, fe] = m(!1), [z, me] = m(!1), [he, ge] = m(!0), [_e, ve] = m(!1), [ye, be] = m(!1), [xe, Se] = m(!1), Ce = p(0), B = p(!1), Te = p(0), Ee = p(!1), H = p(null);
949
949
  c(() => () => {
950
950
  H.current && clearTimeout(H.current);
951
951
  }, []);
@@ -991,9 +991,9 @@ var nt = .9, rt = {
991
991
  Me((t) => (ze(t.find((t) => t.id === e)?.url), t.filter((t) => t.id !== e)));
992
992
  }, [f, ze]);
993
993
  u(F, () => ({
994
- focus: (e) => R.current?.focus(e),
994
+ focus: (e) => L.current?.focus(e),
995
995
  setValue: (e) => {
996
- let t = R.current;
996
+ let t = L.current;
997
997
  t && (t.textContent = e, $e(t)), n(e);
998
998
  },
999
999
  getValue: () => t
@@ -1001,7 +1001,7 @@ var nt = .9, rt = {
1001
1001
  let Ue = p(null), We = p(null), Ge = p(null);
1002
1002
  c(() => {
1003
1003
  if (!E) return;
1004
- let e = R.current;
1004
+ let e = L.current;
1005
1005
  if (!e) return;
1006
1006
  let t = () => {
1007
1007
  let t = window.getSelection();
@@ -1012,23 +1012,23 @@ var nt = .9, rt = {
1012
1012
  let G = Qe({
1013
1013
  onTranscribe: E,
1014
1014
  onTranscript: o((e) => {
1015
- let t = We.current, r = R.current;
1015
+ let t = We.current, r = L.current;
1016
1016
  if (!t || !r) return;
1017
1017
  let i = t.base.slice(0, t.at) + e + t.base.slice(t.at);
1018
1018
  r.textContent = i, tt(r, t.at + e.length), n(i);
1019
1019
  }, [n]),
1020
1020
  onDone: () => {
1021
- We.current = null, R.current?.focus();
1021
+ We.current = null, L.current?.focus();
1022
1022
  },
1023
1023
  meterRef: Ue,
1024
- labels: L
1024
+ labels: ne
1025
1025
  }), K = e === "responding" || e === "resting", Ke = K, q = t.trim().length > 0 || Ne.length > 0, qe = (e === "typing" || e === "idle") && q, Je = e === "responding", Ye = e === "resting" && le, Xe = Ye, Ze = e === "resting" && ye, rt = G.state === "listening" || G.state === "requesting" || G.state === "transcribing", ot = !!E && G.supported && !A, st = qe || Je, J = N, ct = J ? {
1026
1026
  type: "spring",
1027
1027
  stiffness: J.bubble.stiffness,
1028
1028
  damping: J.bubble.damping,
1029
1029
  mass: J.bubble.mass
1030
1030
  } : it, lt = o(() => {
1031
- let e = ie.current, t = ae.current;
1031
+ let e = ae.current, t = oe.current;
1032
1032
  if (!e || !t) return;
1033
1033
  if (!(e.scrollHeight > e.clientHeight)) {
1034
1034
  t.removeAttribute("data-fade");
@@ -1038,11 +1038,11 @@ var nt = .9, rt = {
1038
1038
  !n && !r ? t.dataset.fade = "both" : n ? r ? t.removeAttribute("data-fade") : t.dataset.fade = "bottom" : t.dataset.fade = "top";
1039
1039
  }, []);
1040
1040
  c(() => {
1041
- let e = ie.current;
1041
+ let e = ae.current;
1042
1042
  if (e) return e.addEventListener("scroll", lt, { passive: !0 }), () => e.removeEventListener("scroll", lt);
1043
1043
  }, [lt]), c(() => {
1044
1044
  let e = requestAnimationFrame(() => {
1045
- let e = ie.current;
1045
+ let e = ae.current;
1046
1046
  e && !Ke && (e.scrollTop = e.scrollHeight), lt();
1047
1047
  });
1048
1048
  return () => cancelAnimationFrame(e);
@@ -1051,19 +1051,19 @@ var nt = .9, rt = {
1051
1051
  Ke,
1052
1052
  lt
1053
1053
  ]), c(() => {
1054
- (e === "idle" || e === "typing") && R.current?.focus({ preventScroll: !0 });
1054
+ (e === "idle" || e === "typing") && L.current?.focus({ preventScroll: !0 });
1055
1055
  }, [e]), c(() => {
1056
- let e = R.current;
1056
+ let e = L.current;
1057
1057
  e && (Ce.current = e.scrollHeight || 17);
1058
1058
  }, []), c(() => {
1059
- let e = R.current, t = ce.current;
1059
+ let e = L.current, t = ce.current;
1060
1060
  !e || !Ce.current || requestAnimationFrame(() => {
1061
- let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (ie.current?.scrollHeight ?? 0) > Ce.current + 2, a = ke.current;
1061
+ let n = t ? t.offsetWidth : 0, r = e.clientWidth - 16, i = (ae.current?.scrollHeight ?? 0) > Ce.current + 2, a = ke.current;
1062
1062
  B.current ? !(i || n >= r - 2) && n < Te.current * (a?.wrap?.exitThreshold ?? .75) && (B.current = !1, Ee.current = !1, me(!1), ge(!0), H.current &&= (clearTimeout(H.current), null)) : (Te.current = r, (i || n >= Te.current * (a?.wrap?.nearThreshold ?? .92)) && (B.current = !0, Ee.current = !0, ge(!1)));
1063
1063
  });
1064
1064
  }, [t]), c(() => {
1065
1065
  if (!K) return;
1066
- let e = ie.current;
1066
+ let e = ae.current;
1067
1067
  if (!e || e.scrollTop === 0) return;
1068
1068
  let t = e.scrollTop;
1069
1069
  S(t, 0, {
@@ -1079,7 +1079,7 @@ var nt = .9, rt = {
1079
1079
  K ? Se(!1) : (ve(!1), be(!1));
1080
1080
  }, [K]), c(() => {
1081
1081
  if (!K) return;
1082
- let e = ae.current;
1082
+ let e = oe.current;
1083
1083
  e && (ye && !_e ? e.dataset.fade = "bottom" : e.removeAttribute("data-fade"));
1084
1084
  }, [
1085
1085
  K,
@@ -1089,8 +1089,8 @@ var nt = .9, rt = {
1089
1089
  let t = Oe.current;
1090
1090
  if (Oe.current = e, t !== "responding" || e !== "resting") return;
1091
1091
  requestAnimationFrame(() => {
1092
- let e = ie.current;
1093
- e && (oe.current = e.scrollHeight, be(e.scrollHeight > 241), lt());
1092
+ let e = ae.current;
1093
+ e && (se.current = e.scrollHeight, be(e.scrollHeight > 241), lt());
1094
1094
  }), fe(!0);
1095
1095
  let n = ke.current;
1096
1096
  De.start({
@@ -1122,8 +1122,8 @@ var nt = .9, rt = {
1122
1122
  lt
1123
1123
  ]);
1124
1124
  let ut = o(() => {
1125
- let e = R.current;
1126
- e && (se.current = !0, n(e.textContent ?? ""));
1125
+ let e = L.current;
1126
+ e && (R.current = !0, n(e.textContent ?? ""));
1127
1127
  }, [n]), dt = o((e) => {
1128
1128
  e.preventDefault(), at(e.clipboardData.getData("text/plain")) || ut();
1129
1129
  }, [ut]), ft = o((e) => {
@@ -1134,10 +1134,10 @@ var nt = .9, rt = {
1134
1134
  ut
1135
1135
  ]);
1136
1136
  return c(() => {
1137
- let e = R.current;
1137
+ let e = L.current;
1138
1138
  if (e) {
1139
- if (se.current) {
1140
- se.current = !1;
1139
+ if (R.current) {
1140
+ R.current = !1;
1141
1141
  return;
1142
1142
  }
1143
1143
  e.textContent !== t && (e.textContent = t, document.activeElement === e && $e(e));
@@ -1178,7 +1178,7 @@ var nt = .9, rt = {
1178
1178
  },
1179
1179
  transition: ct,
1180
1180
  animate: De,
1181
- onClick: () => R.current?.focus(),
1181
+ onClick: () => L.current?.focus(),
1182
1182
  children: [
1183
1183
  /* @__PURE__ */ _("input", {
1184
1184
  type: "file",
@@ -1246,14 +1246,14 @@ var nt = .9, rt = {
1246
1246
  children: t
1247
1247
  }),
1248
1248
  /* @__PURE__ */ _("div", {
1249
- ref: ae,
1249
+ ref: oe,
1250
1250
  className: W.editorClip,
1251
1251
  style: { flexBasis: z ? "100%" : void 0 },
1252
1252
  children: /* @__PURE__ */ _(C.div, {
1253
- ref: ie,
1253
+ ref: ae,
1254
1254
  className: `${W.editorWrap} ${K ? W.editorWrapGlass : ""}`,
1255
1255
  layout: "position",
1256
- animate: K && ye ? { maxHeight: _e ? oe.current : 240 } : void 0,
1256
+ animate: K && ye ? { maxHeight: _e ? se.current : 240 } : void 0,
1257
1257
  transition: {
1258
1258
  ...ct,
1259
1259
  maxHeight: {
@@ -1264,7 +1264,7 @@ var nt = .9, rt = {
1264
1264
  }
1265
1265
  },
1266
1266
  children: /* @__PURE__ */ _("div", {
1267
- ref: R,
1267
+ ref: L,
1268
1268
  className: W.editor,
1269
1269
  contentEditable: Ke ? "false" : "plaintext-only",
1270
1270
  suppressContentEditableWarning: !0,
@@ -1274,8 +1274,8 @@ var nt = .9, rt = {
1274
1274
  spellCheck: !1,
1275
1275
  role: "textbox",
1276
1276
  "aria-multiline": "true",
1277
- "aria-label": ne,
1278
- "data-placeholder": Ke ? "" : ne
1277
+ "aria-label": re,
1278
+ "data-placeholder": Ke ? "" : re
1279
1279
  })
1280
1280
  })
1281
1281
  }),
@@ -1365,7 +1365,7 @@ var nt = .9, rt = {
1365
1365
  ge(!0), H.current = null;
1366
1366
  }, ke.current?.wrap?.slideInDelay ?? 120));
1367
1367
  },
1368
- children: [!K && he && (re || A) && /* @__PURE__ */ _(C.div, {
1368
+ children: [!K && he && (ie || A) && /* @__PURE__ */ _(C.div, {
1369
1369
  initial: {
1370
1370
  opacity: 0,
1371
1371
  scale: nt,
@@ -1448,7 +1448,7 @@ var nt = .9, rt = {
1448
1448
  height: "100%"
1449
1449
  }
1450
1450
  })
1451
- }, "cancel-btn") : re && !xe ? /* @__PURE__ */ _(C.div, {
1451
+ }, "cancel-btn") : ie && !xe ? /* @__PURE__ */ _(C.div, {
1452
1452
  initial: {
1453
1453
  opacity: 0,
1454
1454
  scale: .5
@@ -1584,7 +1584,7 @@ var nt = .9, rt = {
1584
1584
  ot && (G.state === "denied" || G.state === "failed") && /* @__PURE__ */ _("p", {
1585
1585
  className: W.voiceNote,
1586
1586
  "data-tone": G.state,
1587
- children: G.state === "denied" ? I.microphoneBlockedHelp : G.error ?? L.couldNotOpen
1587
+ children: G.state === "denied" ? I.microphoneBlockedHelp : G.error ?? ne.couldNotOpen
1588
1588
  })
1589
1589
  ]
1590
1590
  })
@@ -1876,7 +1876,7 @@ var Y = {
1876
1876
  };
1877
1877
  return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
1878
1878
  }, [b]);
1879
- let te = x !== !1 && M, I = te ? u.filter((e) => e.pinned) : u, L = te ? u.filter((e) => !e.pinned) : [], ne = r ? `h${r}` : "span";
1879
+ let te = x !== !1 && M, I = te ? u.filter((e) => e.pinned) : u, ne = te ? u.filter((e) => !e.pinned) : [], re = r ? `h${r}` : "span";
1880
1880
  return /* @__PURE__ */ v(S ? "header" : "div", {
1881
1881
  ref: F,
1882
1882
  className: [
@@ -1916,7 +1916,7 @@ var Y = {
1916
1916
  }),
1917
1917
  (e || t) && /* @__PURE__ */ v("div", {
1918
1918
  className: Y.titles,
1919
- children: [e && /* @__PURE__ */ _(ne, {
1919
+ children: [e && /* @__PURE__ */ _(re, {
1920
1920
  className: [Y.title, i ? Y.truncate : ""].filter(Boolean).join(" "),
1921
1921
  title: typeof e == "string" && i ? e : void 0,
1922
1922
  children: e
@@ -1934,8 +1934,8 @@ var Y = {
1934
1934
  action: e,
1935
1935
  size: h
1936
1936
  }, e.id)),
1937
- L.length > 0 && /* @__PURE__ */ _(Tt, {
1938
- actions: L,
1937
+ ne.length > 0 && /* @__PURE__ */ _(Tt, {
1938
+ actions: ne,
1939
1939
  size: h,
1940
1940
  label: A
1941
1941
  })
@@ -4070,28 +4070,28 @@ var xr = {
4070
4070
  }), t.trim();
4071
4071
  };
4072
4072
  function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onReplyInThread: a, sources: s, onSelectSource: u }) {
4073
- let d = U("highlighter"), h = p(null), [g, b] = m([]), [S, w] = m([]), [T, E] = m(null), [D, O] = m(!1), [k, A] = m(null), [j, M] = m(0), ee = p(null), N = p(null), [P, F] = m(null), [te, I] = m(null), L = o((e) => {
4073
+ let d = U("highlighter"), h = p(null), [g, b] = m([]), [S, w] = m([]), [T, E] = m(null), [D, O] = m(!1), [k, A] = m(null), [j, M] = m(0), ee = p(null), N = p(null), [P, F] = m(null), [te, I] = m(null), ne = o((e) => {
4074
4074
  e.viaKeyboard && (N.current = document.activeElement), M(0), A(e);
4075
- }, []), ne = o((e = "none") => {
4075
+ }, []), re = o((e = "none") => {
4076
4076
  let t = N.current;
4077
4077
  N.current = null, A(null), e !== "none" && (e === "restore" && t?.isConnected ? t.focus() : h.current?.focus());
4078
4078
  }, []);
4079
4079
  c(() => {
4080
4080
  let e = (e) => {
4081
- k && h.current && !h.current.contains(e.target) && ne();
4081
+ k && h.current && !h.current.contains(e.target) && re();
4082
4082
  };
4083
4083
  return window.addEventListener("pointerdown", e), () => window.removeEventListener("pointerdown", e);
4084
- }, [k, ne]);
4085
- let re = f(() => vr(t), [t]), R = re.tokens, ie = p(S), oe = p(i), se = p(k);
4084
+ }, [k, re]);
4085
+ let ie = f(() => vr(t), [t]), L = ie.tokens, ae = p(S), se = p(i), R = p(k);
4086
4086
  c(() => {
4087
- ie.current = S, oe.current = i, se.current = k;
4087
+ ae.current = S, se.current = i, R.current = k;
4088
4088
  });
4089
4089
  let ce = f(() => [...g.map((e) => ({
4090
4090
  id: e.id,
4091
4091
  d: wr(e.points),
4092
4092
  kind: "path",
4093
4093
  item: e,
4094
- text: Dr(e.highlightedIndices, R)
4094
+ text: Dr(e.highlightedIndices, L)
4095
4095
  })), ...S.map((e) => ({
4096
4096
  id: e.id,
4097
4097
  d: kr(e.rects),
@@ -4101,10 +4101,10 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4101
4101
  }))], [
4102
4102
  g,
4103
4103
  S,
4104
- R
4104
+ L
4105
4105
  ]), le = (e, t = !1) => {
4106
4106
  let n = e.kind === "path" ? Tr(e.item.points) : Er(e.item.rects);
4107
- L({
4107
+ ne({
4108
4108
  x: n.x,
4109
4109
  y: n.y,
4110
4110
  pathId: e.id,
@@ -4117,7 +4117,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4117
4117
  let a = /* @__PURE__ */ new Set();
4118
4118
  r.querySelectorAll("span[data-index]").forEach((t) => {
4119
4119
  e.intersectsNode(t) && a.add(parseInt(t.getAttribute("data-index"), 10));
4120
- }), oe.current?.(i);
4120
+ }), se.current?.(i);
4121
4121
  let o = r.getBoundingClientRect(), s = Array.from(e.getClientRects()).map((e) => ({
4122
4122
  x: e.left - o.left,
4123
4123
  y: e.top - o.top,
@@ -4146,17 +4146,17 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4146
4146
  highlightedIndices: a
4147
4147
  }]);
4148
4148
  let d = Er(l);
4149
- L({
4149
+ ne({
4150
4150
  x: d.x,
4151
4151
  y: d.y,
4152
4152
  pathId: u,
4153
4153
  kind: "selection",
4154
4154
  viaKeyboard: n
4155
4155
  });
4156
- }, [L]);
4156
+ }, [ne]);
4157
4157
  c(() => {
4158
4158
  let e = (e) => {
4159
- if (se.current) return;
4159
+ if (R.current) return;
4160
4160
  let t = h.current;
4161
4161
  if (!t) return;
4162
4162
  let n = window.getSelection();
@@ -4173,7 +4173,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4173
4173
  }, [ue]);
4174
4174
  let [de, fe] = m(r);
4175
4175
  de !== r && (fe(r), A(null));
4176
- let z = f(() => R.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [R]), [pe, me] = m(null), [he, ge] = m(null), _e = l(), ve = f(() => pe === null || he === null ? null : {
4176
+ let z = f(() => L.map((e, t) => e.trim() ? t : -1).filter((e) => e >= 0), [L]), [pe, me] = m(null), [he, ge] = m(null), _e = l(), ve = f(() => pe === null || he === null ? null : {
4177
4177
  from: Math.min(he, pe),
4178
4178
  to: Math.max(he, pe)
4179
4179
  }, [pe, he]), ye = () => {
@@ -4186,7 +4186,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4186
4186
  let r = document.createRange();
4187
4187
  r.setStartBefore(t), r.setEndAfter(n);
4188
4188
  let i = "";
4189
- for (let e = ve.from; e <= ve.to; e++) i += R[e];
4189
+ for (let e = ve.from; e <= ve.to; e++) i += L[e];
4190
4190
  ue(r, i, !0), ye();
4191
4191
  }, xe = () => [...ee.current?.querySelectorAll("[role=\"menuitem\"]") ?? []];
4192
4192
  c(() => {
@@ -4227,7 +4227,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4227
4227
  case "End": return n(z[z.length - 1]);
4228
4228
  case "Enter":
4229
4229
  case " ": return ve ? (e.preventDefault(), be()) : void 0;
4230
- case "Escape": return !k && pe === null ? void 0 : (e.preventDefault(), ne("restore"), ye());
4230
+ case "Escape": return !k && pe === null ? void 0 : (e.preventDefault(), re("restore"), ye());
4231
4231
  default: return;
4232
4232
  }
4233
4233
  }, B = (e, t, n) => {
@@ -4238,7 +4238,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4238
4238
  }
4239
4239
  }, Te = (e) => {
4240
4240
  if (k) {
4241
- ne();
4241
+ re();
4242
4242
  return;
4243
4243
  }
4244
4244
  if (r === "precise" || e.button !== 0 && e.pointerType === "mouse") return;
@@ -4253,7 +4253,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4253
4253
  }],
4254
4254
  highlightedIndices: /* @__PURE__ */ new Set()
4255
4255
  };
4256
- E(s), ne(), B(e.clientX, e.clientY, s.highlightedIndices);
4256
+ E(s), re(), B(e.clientX, e.clientY, s.highlightedIndices);
4257
4257
  }, Ee = (e) => {
4258
4258
  if (r === "precise" || !T) return;
4259
4259
  let t = h.current.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, a = n - i * Cr;
@@ -4273,23 +4273,23 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4273
4273
  if (r !== "precise" && (O(!1), T)) {
4274
4274
  if (e.currentTarget.releasePointerCapture(e.pointerId), b((e) => [...e, T]), T.highlightedIndices.size > 0) {
4275
4275
  let e = Tr(T.points);
4276
- L({
4276
+ ne({
4277
4277
  x: e.x,
4278
4278
  y: e.y,
4279
4279
  pathId: T.id,
4280
4280
  kind: "path"
4281
4281
  });
4282
4282
  }
4283
- i && T.highlightedIndices.size > 0 && i(Dr(T.highlightedIndices, R)), E(null);
4283
+ i && T.highlightedIndices.size > 0 && i(Dr(T.highlightedIndices, L)), E(null);
4284
4284
  }
4285
4285
  }, De = (e) => {
4286
4286
  r !== "precise" && (O(!1), T && (e.currentTarget.releasePointerCapture(e.pointerId), E(null)));
4287
4287
  }, Oe = (e) => {
4288
4288
  let t = g.find((t) => t.id === e);
4289
- return t ? Dr(t.highlightedIndices, R) : "";
4289
+ return t ? Dr(t.highlightedIndices, L) : "";
4290
4290
  }, ke = (e) => {
4291
4291
  let t = k?.viaKeyboard;
4292
- k?.kind === "selection" ? w((t) => t.filter((t) => t.id !== e)) : b((t) => t.filter((t) => t.id !== e)), ne(t ? "container" : "none");
4292
+ k?.kind === "selection" ? w((t) => t.filter((t) => t.id !== e)) : b((t) => t.filter((t) => t.id !== e)), re(t ? "container" : "none");
4293
4293
  }, je = () => {
4294
4294
  let e = k?.viaKeyboard;
4295
4295
  if (k && a) {
@@ -4308,9 +4308,9 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4308
4308
  t && a(e, t.getBoundingClientRect());
4309
4309
  }
4310
4310
  }
4311
- ne(e ? "restore" : "none");
4311
+ re(e ? "restore" : "none");
4312
4312
  }, Me = (e) => {
4313
- let t = R[e], n = !1;
4313
+ let t = L[e], n = !1;
4314
4314
  k && (n = (k.kind === "path" ? g.find((e) => e.id === k.pathId) : S.find((e) => e.id === k.pathId))?.highlightedIndices?.has(e) ?? !1);
4315
4315
  let r = !1;
4316
4316
  return P && (r = (g.find((e) => e.id === P) ?? S.find((e) => e.id === P))?.highlightedIndices?.has(e) ?? !1), /* @__PURE__ */ _("span", {
@@ -4379,7 +4379,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4379
4379
  /* @__PURE__ */ _("div", {
4380
4380
  className: xr.tokens,
4381
4381
  "data-focus": !!k || void 0,
4382
- children: Ne(re.nodes)
4382
+ children: Ne(ie.nodes)
4383
4383
  }),
4384
4384
  /* @__PURE__ */ _("svg", {
4385
4385
  className: xr.canvas,
@@ -4434,7 +4434,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4434
4434
  "aria-label": d.menu,
4435
4435
  onKeyDown: Ce,
4436
4436
  onBlur: (e) => {
4437
- e.currentTarget.contains(e.relatedTarget) || ne();
4437
+ e.currentTarget.contains(e.relatedTarget) || re();
4438
4438
  },
4439
4439
  initial: { opacity: 0 },
4440
4440
  animate: {
@@ -4479,7 +4479,7 @@ function Ar({ text: t, selectionMode: r = "marker", onHighlightComplete: i, onRe
4479
4479
  variant: "primary",
4480
4480
  role: "menuitem",
4481
4481
  tabIndex: j === 0 ? 0 : -1,
4482
- icon: /* @__PURE__ */ _(ae, { size: 14 }),
4482
+ icon: /* @__PURE__ */ _(oe, { size: 14 }),
4483
4483
  onClick: (e) => {
4484
4484
  e.stopPropagation(), je();
4485
4485
  },
@@ -4533,15 +4533,15 @@ var jr = {
4533
4533
  actions: "ick-actions-CWq8"
4534
4534
  }, Mr = (e) => {
4535
4535
  navigator.clipboard?.writeText(e);
4536
- }, Nr = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: o = null, onOpenArtifact: s, entranceDelay: c = 0, selectionMode: l = "marker", questionAlign: u = "end", onDraft: d, onSubmit: f, onStop: p, onEdit: m, onCancelEdit: h, onCopy: g = Mr, onHighlight: y, onReplyInThread: b, onRegenerate: x, onShowVersion: S, onFeedback: w, feedback: T = null, answerActions: E = !0, onAnswerQuestion: D, onEditQuestion: O, onDecideApproval: k, renderPart: A, composerMenu: j, labels: M, className: ee, onTranscribe: N }) {
4537
- let P = q(), F = P ? 0 : -16, te = e.parts ?? [], I = te.find((e) => e.kind === "sources")?.sources, L = /* @__PURE__ */ v(C.article, {
4536
+ }, Nr = a(function({ turn: e, isActiveInput: t = !1, inputRef: n = null, placeholder: r, animationConfig: i, foldMotion: a, openArtifactId: o = null, onOpenArtifact: s, onArtifactChange: c, entranceDelay: l = 0, selectionMode: u = "marker", questionAlign: d = "end", onDraft: f, onSubmit: p, onStop: m, onEdit: h, onCancelEdit: g, onCopy: y = Mr, onHighlight: b, onReplyInThread: x, onRegenerate: S, onShowVersion: w, onFeedback: T, feedback: E = null, answerActions: D = !0, onAnswerQuestion: O, onEditQuestion: k, onDecideApproval: A, renderPart: j, composerMenu: M, labels: ee, className: N, onTranscribe: P }) {
4537
+ let F = q(), te = F ? 0 : -16, I = e.parts ?? [], ne = I.find((e) => e.kind === "sources")?.sources, re = /* @__PURE__ */ v(C.article, {
4538
4538
  id: `turn-${e.id}`,
4539
- className: [jr.turn, ee ?? ""].filter(Boolean).join(" "),
4539
+ className: [jr.turn, N ?? ""].filter(Boolean).join(" "),
4540
4540
  "data-active-input": t || void 0,
4541
4541
  "aria-busy": e.state === "responding" || void 0,
4542
4542
  initial: {
4543
4543
  opacity: 0,
4544
- y: F
4544
+ y: te
4545
4545
  },
4546
4546
  animate: {
4547
4547
  opacity: 1,
@@ -4549,43 +4549,43 @@ var jr = {
4549
4549
  },
4550
4550
  exit: {
4551
4551
  opacity: 0,
4552
- y: F
4552
+ y: te
4553
4553
  },
4554
4554
  transition: {
4555
- duration: P ? .15 : .4,
4555
+ duration: F ? .15 : .4,
4556
4556
  ease: [
4557
4557
  .22,
4558
4558
  1,
4559
4559
  .36,
4560
4560
  1
4561
4561
  ],
4562
- delay: c
4562
+ delay: l
4563
4563
  },
4564
4564
  children: [/* @__PURE__ */ _("div", {
4565
4565
  className: jr.question,
4566
- "data-align": u,
4566
+ "data-align": d,
4567
4567
  children: /* @__PURE__ */ _(ot, {
4568
4568
  ref: n,
4569
- style: u === "stretch" ? { width: "100%" } : void 0,
4569
+ style: d === "stretch" ? { width: "100%" } : void 0,
4570
4570
  state: e.state,
4571
4571
  value: e.user,
4572
- onChange: (t) => d?.(e.id, t),
4573
- onSubmit: (t, n) => f?.(e.id, t, n),
4572
+ onChange: (t) => f?.(e.id, t),
4573
+ onSubmit: (t, n) => p?.(e.id, t, n),
4574
4574
  attachments: e.attachments,
4575
- onStop: p,
4576
- onTranscribe: N,
4577
- onCopy: g,
4578
- onEdit: () => m?.(e.id),
4579
- onCancelEdit: () => h?.(e.id),
4575
+ onStop: m,
4576
+ onTranscribe: P,
4577
+ onCopy: y,
4578
+ onEdit: () => h?.(e.id),
4579
+ onCancelEdit: () => g?.(e.id),
4580
4580
  isEditing: e.ai.length > 0 && e.state === "typing",
4581
4581
  animationConfig: i,
4582
4582
  placeholder: r,
4583
- menu: j
4583
+ menu: M
4584
4584
  })
4585
4585
  }), /* @__PURE__ */ v("div", {
4586
4586
  className: jr.body,
4587
4587
  children: [
4588
- te.map((t) => {
4588
+ I.map((t) => {
4589
4589
  switch (t.kind) {
4590
4590
  case "reasoning": return /* @__PURE__ */ _(Vt, {
4591
4591
  state: t.state,
@@ -4621,7 +4621,7 @@ var jr = {
4621
4621
  description: t.description,
4622
4622
  decision: t.decision ?? null,
4623
4623
  choices: t.choices,
4624
- onDecide: (n) => k?.(e.id, t.id, n),
4624
+ onDecide: (n) => A?.(e.id, t.id, n),
4625
4625
  children: t.tool && /* @__PURE__ */ _(cn, {
4626
4626
  name: t.tool.name,
4627
4627
  state: "pending",
@@ -4653,11 +4653,15 @@ var jr = {
4653
4653
  collapsible: t.collapsible,
4654
4654
  readOnly: t.readOnly,
4655
4655
  foldMotion: a,
4656
- onCommit: (n, r) => D?.(e.id, t.id, n, r),
4657
- onEdit: (n) => O?.(e.id, t.id, n)
4656
+ onCommit: (n, r) => O?.(e.id, t.id, n, r),
4657
+ onEdit: (n) => k?.(e.id, t.id, n)
4658
4658
  }, t.id);
4659
4659
  case "custom": {
4660
- let n = A?.(t, { turnId: e.id });
4660
+ let n = j?.(t, {
4661
+ turnId: e.id,
4662
+ openArtifact: (t) => c ? c(t) : s?.(e.id, t),
4663
+ closeArtifact: () => c?.(null)
4664
+ });
4661
4665
  return n == null || n === !1 ? null : /* @__PURE__ */ _("div", {
4662
4666
  className: jr.custom,
4663
4667
  "data-part": "custom",
@@ -4667,7 +4671,7 @@ var jr = {
4667
4671
  }
4668
4672
  }
4669
4673
  }),
4670
- e.state === "responding" && !e.ai && te.length === 0 && /* @__PURE__ */ _("div", {
4674
+ e.state === "responding" && !e.ai && I.length === 0 && /* @__PURE__ */ _("div", {
4671
4675
  className: jr.answer,
4672
4676
  children: /* @__PURE__ */ _(Mt, {})
4673
4677
  }),
@@ -4675,32 +4679,32 @@ var jr = {
4675
4679
  className: jr.answer,
4676
4680
  children: [/* @__PURE__ */ _(Ar, {
4677
4681
  text: e.ai,
4678
- selectionMode: l,
4679
- sources: I,
4680
- onHighlightComplete: (t) => y?.(e.id, t),
4681
- onReplyInThread: b
4682
- }), E && e.state === "resting" && /* @__PURE__ */ v("div", {
4682
+ selectionMode: u,
4683
+ sources: ne,
4684
+ onHighlightComplete: (t) => b?.(e.id, t),
4685
+ onReplyInThread: x
4686
+ }), D && e.state === "resting" && /* @__PURE__ */ v("div", {
4683
4687
  className: jr.actions,
4684
4688
  children: [/* @__PURE__ */ _(At, {
4685
4689
  total: e.versions?.length ?? 0,
4686
4690
  index: e.versionIndex ?? 0,
4687
- onSelect: (t) => S?.(e.id, t)
4691
+ onSelect: (t) => w?.(e.id, t)
4688
4692
  }), /* @__PURE__ */ _(Ot, {
4689
4693
  text: e.ai,
4690
- onCopy: g,
4691
- onRegenerate: x ? () => x(e.id) : void 0,
4692
- onFeedback: w ? (t) => w(e.id, t) : void 0,
4693
- feedback: T
4694
+ onCopy: y,
4695
+ onRegenerate: S ? () => S(e.id) : void 0,
4696
+ onFeedback: T ? (t) => T(e.id, t) : void 0,
4697
+ feedback: E
4694
4698
  })]
4695
4699
  })]
4696
4700
  })
4697
4701
  ]
4698
4702
  })]
4699
4703
  });
4700
- return M ? /* @__PURE__ */ _(ke, {
4701
- labels: M,
4702
- children: L
4703
- }) : L;
4704
+ return ee ? /* @__PURE__ */ _(ke, {
4705
+ labels: ee,
4706
+ children: re
4707
+ }) : re;
4704
4708
  }, (e, t) => {
4705
4709
  let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
4706
4710
  for (let r of n) {
@@ -4833,7 +4837,7 @@ function Br({ title: e, meta: t, children: n, onClose: r, modal: i = !1, expande
4833
4837
  o && !i && /* @__PURE__ */ _(V, {
4834
4838
  variant: "ghost",
4835
4839
  size: "s",
4836
- icon: _(a ? se : ie, {
4840
+ icon: _(a ? R : ae, {
4837
4841
  size: 15,
4838
4842
  "aria-hidden": !0
4839
4843
  }),
@@ -4881,8 +4885,8 @@ function Vr() {
4881
4885
  var Hr = {
4882
4886
  layout: "ick-layout-nC6G",
4883
4887
  chat: "ick-chat-OTXm",
4884
- slot: "ick-slot-O--R",
4885
4888
  card: "ick-card-Iddg",
4889
+ slot: "ick-slot-O--R",
4886
4890
  scrim: "ick-scrim-11Pp"
4887
4891
  }, Ur = 760, Wr = {
4888
4892
  closed: {
@@ -4957,10 +4961,10 @@ var Hr = {
4957
4961
  ...Jr
4958
4962
  }
4959
4963
  });
4960
- function Xr({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
4961
- let a = p(null), [s, l] = m(!1), [u, d] = m(!1), h = o(() => d((e) => !e), []), g = E(), [b, x, S] = f(() => {
4962
- let e = s ? Kr : Wr, t = s ? void 0 : Gr;
4963
- return g ? [
4964
+ function Xr({ children: e, pane: t, onDismiss: n, surface: r = "flush", className: i, ...a }) {
4965
+ let s = p(null), [l, u] = m(!1), [d, h] = m(!1), g = o(() => h((e) => !e), []), b = E(), [x, S, w] = f(() => {
4966
+ let e = l ? Kr : Wr, t = l ? void 0 : Gr;
4967
+ return b ? [
4964
4968
  Yr(e),
4965
4969
  t && Yr(t),
4966
4970
  Yr(qr)
@@ -4969,49 +4973,50 @@ function Xr({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
4969
4973
  t,
4970
4974
  qr
4971
4975
  ];
4972
- }, [g, s]);
4976
+ }, [b, l]);
4973
4977
  c(() => {
4974
- let e = a.current;
4978
+ let e = s.current;
4975
4979
  if (!e || typeof ResizeObserver > "u") return;
4976
4980
  let t = new ResizeObserver(([e]) => {
4977
- l(e.contentRect.width <= Ur);
4981
+ u(e.contentRect.width <= Ur);
4978
4982
  });
4979
4983
  return t.observe(e), () => t.disconnect();
4980
4984
  }, []);
4981
- let w = t?.({
4982
- narrow: s,
4983
- expanded: u,
4984
- toggleExpanded: h
4985
+ let T = t?.({
4986
+ narrow: l,
4987
+ expanded: d,
4988
+ toggleExpanded: g
4985
4989
  });
4986
4990
  return /* @__PURE__ */ v("div", {
4987
- ref: a,
4988
- className: [Hr.layout, r ?? ""].filter(Boolean).join(" "),
4989
- "data-pane": w ? "" : void 0,
4990
- ...i,
4991
+ ref: s,
4992
+ className: [Hr.layout, i ?? ""].filter(Boolean).join(" "),
4993
+ "data-pane": T ? "" : void 0,
4994
+ "data-surface": r === "panes" ? "panes" : void 0,
4995
+ ...a,
4991
4996
  children: [/* @__PURE__ */ _("div", {
4992
4997
  className: Hr.chat,
4993
4998
  children: e
4994
4999
  }), /* @__PURE__ */ v(y, {
4995
5000
  initial: !1,
4996
- children: [w && s && n && /* @__PURE__ */ _(C.div, {
5001
+ children: [T && l && n && /* @__PURE__ */ _(C.div, {
4997
5002
  className: Hr.scrim,
4998
- variants: S,
5003
+ variants: w,
4999
5004
  initial: "closed",
5000
5005
  animate: "open",
5001
5006
  exit: "closed",
5002
5007
  "aria-hidden": !0,
5003
5008
  onClick: n
5004
- }, "scrim"), w && /* @__PURE__ */ _(C.div, {
5009
+ }, "scrim"), T && /* @__PURE__ */ _(C.div, {
5005
5010
  className: Hr.slot,
5006
- variants: b,
5011
+ variants: x,
5007
5012
  initial: "closed",
5008
5013
  animate: "open",
5009
5014
  exit: "closed",
5010
5015
  children: /* @__PURE__ */ _(C.div, {
5011
5016
  className: Hr.card,
5012
- "data-expanded": u && !s || void 0,
5013
- variants: x,
5014
- ...s && n ? {
5017
+ "data-expanded": d && !l || void 0,
5018
+ variants: S,
5019
+ ...l && n ? {
5015
5020
  drag: "y",
5016
5021
  dragConstraints: {
5017
5022
  top: 0,
@@ -5026,9 +5031,9 @@ function Xr({ children: e, pane: t, onDismiss: n, className: r, ...i }) {
5026
5031
  (t.offset.y > 120 || t.velocity.y > 600) && n();
5027
5032
  }
5028
5033
  } : {},
5029
- children: w
5034
+ children: T
5030
5035
  })
5031
- }, s ? "sheet" : "beside")]
5036
+ }, l ? "sheet" : "beside")]
5032
5037
  })]
5033
5038
  });
5034
5039
  }
@@ -5176,7 +5181,7 @@ var Qr = {
5176
5181
  f,
5177
5182
  y,
5178
5183
  N
5179
- ]), L = f && !E;
5184
+ ]), ne = f && !E;
5180
5185
  return /* @__PURE__ */ v("div", {
5181
5186
  className: [Qr.root, h ?? ""].filter(Boolean).join(" "),
5182
5187
  children: [/* @__PURE__ */ _("div", {
@@ -5192,9 +5197,9 @@ var Qr = {
5192
5197
  }), s && /* @__PURE__ */ _("button", {
5193
5198
  type: "button",
5194
5199
  className: Qr.jump,
5195
- "data-shown": L || void 0,
5196
- tabIndex: L ? 0 : -1,
5197
- "aria-hidden": !L || void 0,
5200
+ "data-shown": ne || void 0,
5201
+ tabIndex: ne ? 0 : -1,
5202
+ "aria-hidden": !ne || void 0,
5198
5203
  onClick: () => te(!0),
5199
5204
  "aria-label": C,
5200
5205
  children: /* @__PURE__ */ _(D, {
@@ -5700,6 +5705,7 @@ function vi(e) {
5700
5705
  }
5701
5706
  var $ = {
5702
5707
  page: "ick-page-NK01",
5708
+ paned: "ick-paned-MM8c",
5703
5709
  feed: "ick-feed-XqZl",
5704
5710
  topBlur: "ick-topBlur-69Dl",
5705
5711
  bottomBlur: "ick-bottomBlur-MXmb",
@@ -5718,75 +5724,90 @@ var $ = {
5718
5724
  marks: "ick-marks-gwsN",
5719
5725
  mark: "ick-mark-QkpW"
5720
5726
  }, yi = () => "";
5721
- function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !0, composerMenu: a, onTranscribe: s, onThreadReply: l, title: u, backHref: d, backLabel: h, actions: b, placeholder: x, empty: S, contextTotal: w, contextBase: T = 0, artifact: E, theme: D, onThemeChange: O, cursor: A = !1, selectionToggle: j = !1, anchorOffset: M = 100, endOffset: ee = 120, animationConfig: N, foldMotion: P, feedDelay: F = 0, onAnswerQuestion: te, onEditQuestion: I, onDecideApproval: L, className: re }) {
5722
- let R = U("experience", r?.experience), ie = u ?? R.title, [ae, oe] = m([]), [se, le] = m(!1), [ue, de] = m(null), [fe, z] = m("marker"), pe = p(null), me = D !== void 0, [he, _e] = m(null), be = me ? D : he, [xe, Se] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
5727
+ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !0, composerMenu: a, onTranscribe: s, onThreadReply: l, title: u, backHref: d, backLabel: h, actions: b, placeholder: x, empty: S, contextTotal: w, contextBase: T = 0, artifact: E, openArtifactId: D, onOpenArtifactChange: O, pane: A = "inline", surface: j = "flush", theme: M, onThemeChange: ee, cursor: N = !1, selectionToggle: P = !1, anchorOffset: F = 100, endOffset: te = 120, animationConfig: I, foldMotion: ne, feedDelay: ie = 0, onAnswerQuestion: L, onEditQuestion: ae, onDecideApproval: oe, className: se }) {
5728
+ let R = U("experience", r?.experience), le = u ?? R.title, [ue, de] = m([]), [fe, z] = m(!1), [pe, me] = m(null), [he, _e] = m("marker"), be = p(null), xe = M !== void 0, [Se, Ce] = m(null), we = xe ? M : Se, [B, Te] = m(() => typeof window < "u" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches);
5723
5729
  c(() => {
5724
- let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => Se(e.matches);
5730
+ let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => Te(e.matches);
5725
5731
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
5726
5732
  }, []);
5727
- let Ce = be ?? (xe ? "dark" : "light");
5728
- vi(be);
5729
- let we = o((e) => {
5730
- me || _e(e), O?.(e);
5731
- }, [me, O]), B = ht({
5733
+ let Ee = we ?? (B ? "dark" : "light");
5734
+ vi(we);
5735
+ let V = o((e) => {
5736
+ xe || Ce(e), ee?.(e);
5737
+ }, [xe, ee]), H = ht({
5732
5738
  onSend: e ?? yi,
5733
5739
  announcements: { responding: R.responding }
5734
- }), { turns: Te, setDraft: Ee, submit: V, showVersion: H, stop: De, beginEdit: Oe, cancelEdit: je, updatePart: Me } = t ?? B, [Ne, Pe] = m(null), Fe = o((e, t, n) => {
5735
- Pe(e), V(e, t, n);
5736
- }, [V]), Ie = Ne ? Te.find((e) => e.id === Ne) ?? null : null, Le = Ie && Ie.state !== "resting" ? Ne : null, W = o((e) => {
5737
- Pe(e), V(e);
5738
- }, [V]), Re = Te.length === 1 && !Te[0].user && !Te[0].ai, ze = T + Math.round(Te.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), Be = w !== void 0 && ze >= w, Ve = p(!1);
5740
+ }), { turns: De, setDraft: Oe, submit: je, showVersion: Me, stop: Ne, beginEdit: Pe, cancelEdit: Fe, updatePart: Ie } = t ?? H, [Le, W] = m(null), Re = o((e, t, n) => {
5741
+ W(e), je(e, t, n);
5742
+ }, [je]), ze = Le ? De.find((e) => e.id === Le) ?? null : null, Be = ze && ze.state !== "resting" ? Le : null, Ve = o((e) => {
5743
+ W(e), je(e);
5744
+ }, [je]), He = De.length === 1 && !De[0].user && !De[0].ai, Ue = T + Math.round(De.reduce((e, t) => e + t.user.length + t.ai.length + JSON.stringify(t.parts ?? []).length, 0) / 4), We = w !== void 0 && Ue >= w, Ge = p(!1);
5739
5745
  c(() => {
5740
- if (!Be) {
5741
- Ve.current = !1;
5746
+ if (!We) {
5747
+ Ge.current = !1;
5742
5748
  return;
5743
5749
  }
5744
- Ve.current || (Ve.current = !0, G(R.windowFull));
5745
- }, [Be, R.windowFull]);
5746
- let He = Zr(), [Ue, We] = m({}), Ge = o((e, t) => {
5747
- We((n) => ({
5750
+ Ge.current || (Ge.current = !0, G(R.windowFull));
5751
+ }, [We, R.windowFull]);
5752
+ let K = Zr(), Ke = D !== void 0, q = Ke ? D : K.openId, qe = p({
5753
+ openArtifactId: q,
5754
+ artifactHeld: Ke,
5755
+ onOpenArtifactChange: O
5756
+ });
5757
+ c(() => {
5758
+ qe.current = {
5759
+ openArtifactId: q,
5760
+ artifactHeld: Ke,
5761
+ onOpenArtifactChange: O
5762
+ };
5763
+ });
5764
+ let Je = K.open, Ye = K.close, Xe = o((e) => {
5765
+ let { artifactHeld: t, onOpenArtifactChange: n } = qe.current;
5766
+ t || (e === null ? Ye() : Je(e)), n?.(e);
5767
+ }, [Je, Ye]), Ze = o(() => Xe(null), [Xe]), [Qe, $e] = m({}), et = o((e, t) => {
5768
+ $e((n) => ({
5748
5769
  ...n,
5749
5770
  [e]: t
5750
5771
  }));
5751
- }, []), K = Te.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? ie, Ke = o((e, t) => {
5752
- t.trim().length > 0 && oe((n) => [...n, {
5772
+ }, []), tt = De.find((e) => e.state !== "idle" && e.state !== "typing" && e.user.trim())?.user.trim() ?? le, nt = o((e, t) => {
5773
+ t.trim().length > 0 && de((n) => [...n, {
5753
5774
  turnId: e,
5754
5775
  text: t.trim()
5755
5776
  }]);
5756
- }, []), q = He.toggle, qe = o((e, t) => q(t), [q]), Je = o((e, t) => {
5757
- de({
5777
+ }, []), rt = o((e, t) => Xe(qe.current.openArtifactId === t ? null : t), [Xe]), it = o((e, t) => {
5778
+ me({
5758
5779
  text: e,
5759
5780
  rect: t
5760
5781
  });
5761
- }, []), Ye = f(() => te ? (e, t, n, r) => te(Me, e, t, n, r) : void 0, [te, Me]), Xe = f(() => I ? (e, t, n) => I(Me, e, t, n) : void 0, [I, Me]), Ze = f(() => L ? (e, t, n) => L(Me, e, t, n) : void 0, [L, Me]), [Qe, $e] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
5782
+ }, []), at = f(() => L ? (e, t, n, r) => L(Ie, e, t, n, r) : void 0, [L, Ie]), ot = f(() => ae ? (e, t, n) => ae(Ie, e, t, n) : void 0, [ae, Ie]), st = f(() => oe ? (e, t, n) => oe(Ie, e, t, n) : void 0, [oe, Ie]), [J, ct] = m(() => typeof window > "u" || !window.matchMedia || window.matchMedia("(pointer: fine)").matches);
5762
5783
  c(() => {
5763
- if (!A) return;
5764
- let e = window.matchMedia("(pointer: fine)"), t = () => $e(e.matches);
5784
+ if (!N) return;
5785
+ let e = window.matchMedia("(pointer: fine)"), t = () => ct(e.matches);
5765
5786
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
5766
- }, [A]);
5767
- let et = (e) => i === !0 || Array.isArray(i) && i.includes(e), tt = [
5768
- ...ae.length > 0 ? [{
5787
+ }, [N]);
5788
+ let lt = (e) => i === !0 || Array.isArray(i) && i.includes(e), ut = [
5789
+ ...ue.length > 0 ? [{
5769
5790
  id: "bookmarks",
5770
5791
  label: R.savedHighlights,
5771
5792
  icon: /* @__PURE__ */ _(k, {
5772
5793
  size: 16,
5773
5794
  "aria-hidden": !0
5774
5795
  }),
5775
- count: ae.length,
5796
+ count: ue.length,
5776
5797
  pinned: !0,
5777
- onClick: () => le(!0)
5798
+ onClick: () => z(!0)
5778
5799
  }] : [],
5779
- ...et("theme") ? [{
5800
+ ...lt("theme") ? [{
5780
5801
  id: "theme",
5781
- label: Ce === "dark" ? R.themeToLight : R.themeToDark,
5782
- icon: _(Ce === "dark" ? ve : ce, {
5802
+ label: Ee === "dark" ? R.themeToLight : R.themeToDark,
5803
+ icon: _(Ee === "dark" ? ve : ce, {
5783
5804
  size: 16,
5784
5805
  "aria-hidden": !0
5785
5806
  }),
5786
- active: Ce === "dark",
5787
- onClick: () => we(Ce === "dark" ? "light" : "dark")
5807
+ active: Ee === "dark",
5808
+ onClick: () => V(Ee === "dark" ? "light" : "dark")
5788
5809
  }] : [],
5789
- ...et("share") ? [{
5810
+ ...lt("share") ? [{
5790
5811
  id: "share",
5791
5812
  label: R.share,
5792
5813
  icon: /* @__PURE__ */ _(ge, {
@@ -5794,23 +5815,24 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
5794
5815
  "aria-hidden": !0
5795
5816
  }),
5796
5817
  onClick: () => navigator.share?.({
5797
- title: K,
5818
+ title: tt,
5798
5819
  url: window.location.href
5799
5820
  })
5800
5821
  }] : [],
5801
5822
  ...b ?? []
5802
- ], nt = He.openId ? E?.(He.openId) : null, rt = /* @__PURE__ */ v(C.div, {
5823
+ ], dt = A === "inline" && q ? E?.(q) : null, ft = /* @__PURE__ */ v(C.div, {
5803
5824
  className: [
5804
5825
  $.page,
5826
+ j === "panes" ? $.paned : "",
5805
5827
  "ick-chat-page",
5806
- re
5828
+ se
5807
5829
  ].filter(Boolean).join(" "),
5808
- style: { "--ick-experience-anchor": `${M}px` },
5830
+ style: { "--ick-experience-anchor": `${F}px` },
5809
5831
  initial: { opacity: 0 },
5810
5832
  animate: {
5811
- opacity: ue || se ? .4 : 1,
5812
- filter: ue || se ? "blur(3px)" : "blur(0px)",
5813
- scale: ue || se ? .9 : 1
5833
+ opacity: pe || fe ? .4 : 1,
5834
+ filter: pe || fe ? "blur(3px)" : "blur(0px)",
5835
+ scale: pe || fe ? .9 : 1
5814
5836
  },
5815
5837
  transition: {
5816
5838
  type: "spring",
@@ -5819,37 +5841,37 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
5819
5841
  mass: .9
5820
5842
  },
5821
5843
  onAnimationComplete: () => {
5822
- document.activeElement && document.activeElement !== document.body || pe.current?.focus();
5844
+ document.activeElement && document.activeElement !== document.body || be.current?.focus();
5823
5845
  },
5824
5846
  children: [
5825
5847
  /* @__PURE__ */ _("div", { className: $.topBlur }),
5826
5848
  /* @__PURE__ */ v(Ct, {
5827
5849
  className: `${$.header} ick-chat-header`,
5828
- title: K,
5850
+ title: tt,
5829
5851
  backHref: d,
5830
5852
  backLabel: h,
5831
5853
  elevateOnScroll: !1,
5832
5854
  collapseActionsAt: 480,
5833
- actions: tt,
5855
+ actions: ut,
5834
5856
  children: [w !== void 0 && /* @__PURE__ */ _(Rr, {
5835
5857
  className: $.context,
5836
- used: ze,
5858
+ used: Ue,
5837
5859
  total: w
5838
- }), j && /* @__PURE__ */ v("div", {
5860
+ }), P && /* @__PURE__ */ v("div", {
5839
5861
  className: $.selectMode,
5840
5862
  role: "group",
5841
5863
  "aria-label": R.selectionMode,
5842
5864
  children: [/* @__PURE__ */ _("button", {
5843
5865
  type: "button",
5844
- "data-active": fe === "marker",
5845
- onClick: () => z("marker"),
5866
+ "data-active": he === "marker",
5867
+ onClick: () => _e("marker"),
5846
5868
  "aria-label": R.marker,
5847
5869
  title: R.marker,
5848
- children: /* @__PURE__ */ _(ne, { size: 16 })
5870
+ children: /* @__PURE__ */ _(re, { size: 16 })
5849
5871
  }), /* @__PURE__ */ _("button", {
5850
5872
  type: "button",
5851
- "data-active": fe === "precise",
5852
- onClick: () => z("precise"),
5873
+ "data-active": he === "precise",
5874
+ onClick: () => _e("precise"),
5853
5875
  "aria-label": R.precise,
5854
5876
  title: R.precise,
5855
5877
  children: /* @__PURE__ */ _(ye, { size: 16 })
@@ -5858,52 +5880,53 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
5858
5880
  }),
5859
5881
  /* @__PURE__ */ v(ai, {
5860
5882
  viewportClassName: `${$.feed} ick-chat-feed`,
5861
- anchorId: Le ? `turn-${Le}` : void 0,
5862
- anchorOffset: M,
5863
- endOffset: ee,
5883
+ anchorId: Be ? `turn-${Be}` : void 0,
5884
+ anchorOffset: F,
5885
+ endOffset: te,
5864
5886
  children: [
5865
- Re && S && /* @__PURE__ */ _(si, {
5887
+ He && S && /* @__PURE__ */ _(si, {
5866
5888
  className: $.opening,
5867
5889
  title: S.title,
5868
5890
  description: S.description,
5869
5891
  suggestions: S.suggestions,
5870
- onSuggestion: (e) => Fe(Te[0].id, e)
5892
+ onSuggestion: (e) => Re(De[0].id, e)
5871
5893
  }),
5872
- /* @__PURE__ */ _(y, { children: Te.map((e, t) => {
5873
- let r = t === Te.length - 1 && (e.state === "idle" || e.state === "typing");
5894
+ /* @__PURE__ */ _(y, { children: De.map((e, t) => {
5895
+ let r = t === De.length - 1 && (e.state === "idle" || e.state === "typing");
5874
5896
  return /* @__PURE__ */ _(Nr, {
5875
5897
  turn: e,
5876
- questionAlign: Re && t === 0 ? "stretch" : "end",
5877
- className: Re && t === 0 ? $.opening : void 0,
5898
+ questionAlign: He && t === 0 ? "stretch" : "end",
5899
+ className: He && t === 0 ? $.opening : void 0,
5878
5900
  onTranscribe: s,
5879
5901
  isActiveInput: r,
5880
- inputRef: r ? pe : null,
5881
- entranceDelay: t === 0 ? F : 0,
5882
- selectionMode: fe,
5883
- animationConfig: N,
5884
- foldMotion: P,
5885
- openArtifactId: He.openId,
5886
- onOpenArtifact: qe,
5902
+ inputRef: r ? be : null,
5903
+ entranceDelay: t === 0 ? ie : 0,
5904
+ selectionMode: he,
5905
+ animationConfig: I,
5906
+ foldMotion: ne,
5907
+ openArtifactId: q,
5908
+ onOpenArtifact: rt,
5909
+ onArtifactChange: Xe,
5887
5910
  placeholder: x,
5888
- onDraft: Ee,
5889
- onSubmit: Fe,
5890
- onRegenerate: W,
5891
- onShowVersion: H,
5892
- onFeedback: Ge,
5893
- feedback: Ue[e.id] ?? null,
5894
- onStop: De,
5895
- onEdit: Oe,
5896
- onCancelEdit: je,
5897
- onHighlight: Ke,
5898
- onReplyInThread: l ? Je : void 0,
5899
- onAnswerQuestion: Ye,
5900
- onEditQuestion: Xe,
5901
- onDecideApproval: Ze,
5911
+ onDraft: Oe,
5912
+ onSubmit: Re,
5913
+ onRegenerate: Ve,
5914
+ onShowVersion: Me,
5915
+ onFeedback: et,
5916
+ feedback: Qe[e.id] ?? null,
5917
+ onStop: Ne,
5918
+ onEdit: Pe,
5919
+ onCancelEdit: Fe,
5920
+ onHighlight: nt,
5921
+ onReplyInThread: l ? it : void 0,
5922
+ onAnswerQuestion: at,
5923
+ onEditQuestion: ot,
5924
+ onDecideApproval: st,
5902
5925
  renderPart: n,
5903
5926
  composerMenu: a
5904
5927
  }, e.id);
5905
5928
  }) }),
5906
- Be && /* @__PURE__ */ _(zn, { children: R.windowFull })
5929
+ We && /* @__PURE__ */ _(zn, { children: R.windowFull })
5907
5930
  ]
5908
5931
  }),
5909
5932
  /* @__PURE__ */ _("div", { className: $.bottomBlur })
@@ -5912,27 +5935,28 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
5912
5935
  return /* @__PURE__ */ v(ke, {
5913
5936
  labels: r,
5914
5937
  children: [
5915
- A && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), Qe && /* @__PURE__ */ _(_i, {})] }),
5938
+ N && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: "@media (pointer: fine) { * { cursor: none !important; } }" } }), J && /* @__PURE__ */ _(_i, {})] }),
5916
5939
  /* @__PURE__ */ _(Xr, {
5917
5940
  className: $.workspace,
5918
- onDismiss: He.close,
5919
- pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => nt ? /* @__PURE__ */ _(Br, {
5920
- title: nt.title,
5921
- meta: nt.meta,
5941
+ surface: j,
5942
+ onDismiss: Ze,
5943
+ pane: ({ narrow: e, expanded: t, toggleExpanded: n }) => dt ? /* @__PURE__ */ _(Br, {
5944
+ title: dt.title,
5945
+ meta: dt.meta,
5922
5946
  modal: e,
5923
5947
  expanded: t,
5924
5948
  onToggleExpanded: n,
5925
- onClose: He.close,
5926
- children: nt.children
5949
+ onClose: Ze,
5950
+ children: dt.children
5927
5951
  }) : null,
5928
- children: rt
5952
+ children: ft
5929
5953
  }),
5930
- /* @__PURE__ */ _(y, { children: se && /* @__PURE__ */ _(C.div, {
5954
+ /* @__PURE__ */ _(y, { children: fe && /* @__PURE__ */ _(C.div, {
5931
5955
  className: $.scrim,
5932
5956
  initial: { opacity: 0 },
5933
5957
  animate: { opacity: 1 },
5934
5958
  exit: { opacity: 0 },
5935
- onClick: () => le(!1),
5959
+ onClick: () => z(!1),
5936
5960
  children: /* @__PURE__ */ v(C.div, {
5937
5961
  className: $.sheet,
5938
5962
  role: "dialog",
@@ -5957,21 +5981,21 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
5957
5981
  children: R.highlights
5958
5982
  }), /* @__PURE__ */ _("button", {
5959
5983
  className: $.close,
5960
- onClick: () => le(!1),
5984
+ onClick: () => z(!1),
5961
5985
  children: R.close
5962
5986
  })]
5963
- }), Array.from(new Set(ae.map((e) => e.turnId))).map((e, t) => /* @__PURE__ */ v("div", {
5987
+ }), Array.from(new Set(ue.map((e) => e.turnId))).map((e, t) => /* @__PURE__ */ v("div", {
5964
5988
  className: $.group,
5965
5989
  children: [/* @__PURE__ */ _("h3", {
5966
5990
  className: $.groupTitle,
5967
5991
  children: Ae(R.paragraph, { index: t + 1 })
5968
5992
  }), /* @__PURE__ */ _("div", {
5969
5993
  className: $.marks,
5970
- children: ae.filter((t) => t.turnId === e).map((t, n) => /* @__PURE__ */ _("button", {
5994
+ children: ue.filter((t) => t.turnId === e).map((t, n) => /* @__PURE__ */ _("button", {
5971
5995
  type: "button",
5972
5996
  className: $.mark,
5973
5997
  onClick: () => {
5974
- le(!1), setTimeout(() => {
5998
+ z(!1), setTimeout(() => {
5975
5999
  let t = document.getElementById(`turn-${e}`), n = document.querySelector(".ick-chat-feed"), r = document.querySelector(".ick-chat-header");
5976
6000
  if (t && n) {
5977
6001
  let e = r ? r.offsetHeight : 80;
@@ -5991,9 +6015,9 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
5991
6015
  }, e))]
5992
6016
  })
5993
6017
  }) }),
5994
- /* @__PURE__ */ _(y, { children: ue && l && /* @__PURE__ */ _(gi, {
5995
- activeReply: ue,
5996
- onClose: () => de(null),
6018
+ /* @__PURE__ */ _(y, { children: pe && l && /* @__PURE__ */ _(gi, {
6019
+ activeReply: pe,
6020
+ onClose: () => me(null),
5997
6021
  onSendMessage: l
5998
6022
  }, "thread-popup") })
5999
6023
  ]
@@ -6002,4 +6026,4 @@ function bi({ onSend: e, chat: t, renderPart: n, labels: r, headerActions: i = !
6002
6026
  //#endregion
6003
6027
  export { De as $, fn as A, _t as B, Sn as C, vn as D, bn as E, Vt as F, Qe as G, st as H, Mt as I, Re as J, G as K, At as L, tn as M, qt as N, gn as O, Qt as P, ke as Q, Ot as R, Cn as S, Tn as T, ot as U, ht as V, rt as W, Fe as X, Le as Y, je as Z, Ln as _, si as a, jn as b, Xr as c, Nr as d, V as et, Ar as f, Fn as g, zn as h, gi as i, cn as j, mn as k, Br as l, Un as m, vi as n, ai as o, br as p, Be as q, _i as r, Zr as s, bi as t, Rr as u, In as v, wn as w, xn as x, Nn as y, Ct as z };
6004
6028
 
6005
- //# sourceMappingURL=ChatExperience-DCta8bv3.js.map
6029
+ //# sourceMappingURL=ChatExperience-Bawy_cnn.js.map