@deepagents/react-input 7.1.1 → 7.1.2

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.
package/dist/browser.js CHANGED
@@ -2,8 +2,8 @@ import { serializeMentionPromptLink as e, serializePersistedPromptLink as t, ser
2
2
  import { c as i } from "react/compiler-runtime";
3
3
  import { Button as a } from "@base-ui/react/button";
4
4
  import { EditorContent as o, useEditor as s } from "@tiptap/react";
5
- import { Children as c, Fragment as l, createContext as u, isValidElement as d, use as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
6
- import { cn as _ } from "@deepagents/react-shadcn";
5
+ import { cn as c } from "cn";
6
+ import { Children as l, Fragment as u, createContext as d, isValidElement as f, use as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
7
7
  import { Package as v, X as y } from "lucide-react";
8
8
  import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
9
9
  import { escapeRegExp as C } from "lodash-es";
@@ -13,9 +13,9 @@ import { Slice as ee } from "@tiptap/pm/model";
13
13
  import { Plugin as te, TextSelection as k } from "@tiptap/pm/state";
14
14
  import ne from "@tiptap/starter-kit";
15
15
  //#region src/lib/ComposerContext.ts
16
- var re = u(null);
16
+ var re = d(null);
17
17
  function A(e) {
18
- let t = f(re);
18
+ let t = p(re);
19
19
  if (!t) throw Error(`${e} must be used inside Composer.Root.`);
20
20
  return t;
21
21
  }
@@ -39,30 +39,30 @@ function ie(e) {
39
39
  function ae(e) {
40
40
  let t = i(23), n, r;
41
41
  t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
42
- let { state: a, attachedImages: o } = A("Composer.Attachments"), s = a.imageAttachments, c, l, u, d, f, p;
42
+ let { state: a, attachedImages: o } = A("Composer.Attachments"), s = a.imageAttachments, l, u, d, f, p, m;
43
43
  if (t[3] !== o || t[4] !== n || t[5] !== r || t[6] !== a.imageAttachments) {
44
- p = Symbol.for("react.early_return_sentinel");
44
+ m = Symbol.for("react.early_return_sentinel");
45
45
  bb0: {
46
46
  let e;
47
47
  t[13] === o ? e = t[14] : (e = (e) => o.has(e.id), t[13] = o, t[14] = e);
48
48
  let i = s.filter(e);
49
49
  if (i.length === 0) {
50
- p = null;
50
+ m = null;
51
51
  break bb0;
52
52
  }
53
- c = "list", l = "Attached files", t[15] === n ? u = t[16] : (u = _("flex flex-wrap gap-2", n), t[15] = n, t[16] = u), d = r, f = i.map(j);
53
+ l = "list", u = "Attached files", t[15] === n ? d = t[16] : (d = c("flex flex-wrap gap-2", n), t[15] = n, t[16] = d), f = r, p = i.map(j);
54
54
  }
55
- t[3] = o, t[4] = n, t[5] = r, t[6] = a.imageAttachments, t[7] = c, t[8] = l, t[9] = u, t[10] = d, t[11] = f, t[12] = p;
56
- } else c = t[7], l = t[8], u = t[9], d = t[10], f = t[11], p = t[12];
57
- if (p !== Symbol.for("react.early_return_sentinel")) return p;
58
- let m;
59
- return t[17] !== c || t[18] !== l || t[19] !== u || t[20] !== d || t[21] !== f ? (m = /* @__PURE__ */ x("div", {
60
- role: c,
61
- "aria-label": l,
62
- className: u,
63
- ...d,
64
- children: f
65
- }), t[17] = c, t[18] = l, t[19] = u, t[20] = d, t[21] = f, t[22] = m) : m = t[22], m;
55
+ t[3] = o, t[4] = n, t[5] = r, t[6] = a.imageAttachments, t[7] = l, t[8] = u, t[9] = d, t[10] = f, t[11] = p, t[12] = m;
56
+ } else l = t[7], u = t[8], d = t[9], f = t[10], p = t[11], m = t[12];
57
+ if (m !== Symbol.for("react.early_return_sentinel")) return m;
58
+ let h;
59
+ return t[17] !== l || t[18] !== u || t[19] !== d || t[20] !== f || t[21] !== p ? (h = /* @__PURE__ */ x("div", {
60
+ role: l,
61
+ "aria-label": u,
62
+ className: d,
63
+ ...f,
64
+ children: p
65
+ }), t[17] = l, t[18] = u, t[19] = d, t[20] = f, t[21] = p, t[22] = h) : h = t[22], h;
66
66
  }
67
67
  function j(e) {
68
68
  return /* @__PURE__ */ x(M, { attachment: e }, e.id);
@@ -108,14 +108,14 @@ function M(e) {
108
108
  }), t[15] = p, t[16] = _, t[17] = v) : v = t[17], v;
109
109
  }
110
110
  function N(e) {
111
- let t = i(3), [n, r] = g(null), a, o;
111
+ let t = i(3), [n, r] = _(null), a, o;
112
112
  return t[0] === e ? (a = t[1], o = t[2]) : (a = () => {
113
113
  let t = URL.createObjectURL(e);
114
114
  return r(t), () => URL.revokeObjectURL(t);
115
- }, o = [e], t[0] = e, t[1] = a, t[2] = o), p(a, o), n;
115
+ }, o = [e], t[0] = e, t[1] = a, t[2] = o), m(a, o), n;
116
116
  }
117
117
  function P(e) {
118
- let t = i(5), { placeholder: n, file: r } = e, a = N(r), [o, s] = g(null), c;
118
+ let t = i(5), { placeholder: n, file: r } = e, a = N(r), [o, s] = _(null), c;
119
119
  return t[0] !== o || t[1] !== r || t[2] !== a || t[3] !== n ? (c = a === null ? null : a === o ? /* @__PURE__ */ x(L, {
120
120
  placeholder: n,
121
121
  file: r,
@@ -129,7 +129,7 @@ function P(e) {
129
129
  }), t[0] = o, t[1] = r, t[2] = a, t[3] = n, t[4] = c) : c = t[4], c;
130
130
  }
131
131
  function F(e) {
132
- let t = i(11), { placeholder: n, file: r } = e, a = N(r), [o, s] = g(null), c = a ?? void 0, l;
132
+ let t = i(11), { placeholder: n, file: r } = e, a = N(r), [o, s] = _(null), c = a ?? void 0, l;
133
133
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = (e) => s(e.currentTarget.duration), t[0] = l) : l = t[0];
134
134
  let u;
135
135
  t[1] === c ? u = t[2] : (u = /* @__PURE__ */ x("video", {
@@ -935,17 +935,17 @@ function kt(e) {
935
935
  kt.role = Et;
936
936
  function At(e) {
937
937
  let t = [], n = [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = !1, o = (e) => {
938
- for (let s of c.toArray(e)) {
939
- if (!d(s)) {
938
+ for (let s of l.toArray(e)) {
939
+ if (!f(s)) {
940
940
  a = !0;
941
941
  continue;
942
942
  }
943
- if (s.type === l) {
944
- d(s) && o(s.props.children);
943
+ if (s.type === u) {
944
+ f(s) && o(s.props.children);
945
945
  continue;
946
946
  }
947
947
  if (Ft(s.type, wt)) {
948
- d(s) && Nt(s.props, {
948
+ f(s) && Nt(s.props, {
949
949
  slashCommands: t,
950
950
  mentionCandidates: n,
951
951
  commandTriggers: r,
@@ -979,9 +979,9 @@ function Mt(e) {
979
979
  }
980
980
  function Nt(e, t) {
981
981
  let { trigger: n } = e;
982
- for (let r of c.toArray(e.children)) if (d(r)) {
983
- if (r.type === l) {
984
- d(r) && Nt({
982
+ for (let r of l.toArray(e.children)) if (f(r)) {
983
+ if (r.type === u) {
984
+ f(r) && Nt({
985
985
  trigger: n,
986
986
  children: r.props.children
987
987
  }, t);
@@ -989,7 +989,7 @@ function Nt(e, t) {
989
989
  }
990
990
  if (Ft(r.type, Tt)) {
991
991
  if (t.mentionTriggers.has(n)) throw Error(`Composer.Trigger "${n}" already holds mentions; a trigger carries either commands or mentions, not both.`);
992
- t.commandTriggers.add(n), d(r) && t.slashCommands.push({
992
+ t.commandTriggers.add(n), f(r) && t.slashCommands.push({
993
993
  ...r.props,
994
994
  atomic: !1,
995
995
  trigger: n
@@ -998,7 +998,7 @@ function Nt(e, t) {
998
998
  }
999
999
  if (Ft(r.type, Et)) {
1000
1000
  if (t.commandTriggers.has(n)) throw Error(`Composer.Trigger "${n}" already holds commands; a trigger carries either commands or mentions, not both.`);
1001
- t.mentionTriggers.add(n), d(r) && t.mentionCandidates.push(Pt(r.props, n));
1001
+ t.mentionTriggers.add(n), f(r) && t.mentionCandidates.push(Pt(r.props, n));
1002
1002
  continue;
1003
1003
  }
1004
1004
  throw Error(`<Composer.Trigger trigger="${n}"> accepts only <Composer.Command> and <Composer.Mention> children; wrap them in a fragment rather than a component, which the registry cannot see through.`);
@@ -1851,8 +1851,8 @@ function or(e) {
1851
1851
  function sr(e) {
1852
1852
  return typeof e == "object" && !!e && "then" in e && typeof e.then == "function";
1853
1853
  }
1854
- function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r = !1, queueSubmissions: i = !1, hasInteracted: a = !1, maxExpandedTextChars: o, editorAriaLabel: c = "Rich prompt composer", className: l, children: u, validateSubmission: d, onSubmit: f, onStateChange: v }) {
1855
- let y = At(u), b = h({
1854
+ function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r = !1, queueSubmissions: i = !1, hasInteracted: a = !1, maxExpandedTextChars: o, editorAriaLabel: l = "Rich prompt composer", className: u, children: d, validateSubmission: f, onSubmit: p, onStateChange: v }) {
1855
+ let y = At(d), b = g({
1856
1856
  signature: jt(y),
1857
1857
  slashCommands: y.slashCommands,
1858
1858
  mentionCandidates: y.mentionCandidates,
@@ -1866,12 +1866,12 @@ function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r =
1866
1866
  commandTriggers: y.commandTriggers,
1867
1867
  mentionTriggers: y.mentionTriggers
1868
1868
  });
1869
- let { slashCommands: w, mentionCandidates: T, commandTriggers: E, mentionTriggers: D } = b.current, O = m(() => ({
1869
+ let { slashCommands: w, mentionCandidates: T, commandTriggers: E, mentionTriggers: D } = b.current, O = h(() => ({
1870
1870
  commandTriggers: E,
1871
1871
  mentionTriggers: D
1872
- }), [E, D]), ee = h(D);
1872
+ }), [E, D]), ee = g(D);
1873
1873
  ee.current = D;
1874
- let [te] = g(() => {
1874
+ let [te] = _(() => {
1875
1875
  if (e) return e;
1876
1876
  if (t === void 0) return;
1877
1877
  let n = yt(t);
@@ -1880,17 +1880,17 @@ function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r =
1880
1880
  slashCommands: w,
1881
1881
  mentionCandidates: T
1882
1882
  }) : void 0;
1883
- }), k = h(te?.remoteImages ?? []), ne = h(Kt({
1883
+ }), k = g(te?.remoteImages ?? []), ne = g(Kt({
1884
1884
  state: te,
1885
1885
  slashCommands: w,
1886
1886
  mentionCandidates: T,
1887
1887
  triggers: O
1888
- })), A = h(0), ie = h(!0);
1889
- p(() => (ie.current = !0, () => {
1888
+ })), A = g(0), ie = g(!0);
1889
+ m(() => (ie.current = !0, () => {
1890
1890
  ie.current = !1;
1891
1891
  }), []);
1892
- let [ae, j] = g(k.current), [M, N] = g(null), [P, F] = g(() => Zt(ne.current, k.current, w, r, i, 0)), I = h(P), L = h(ae), R = h(M), oe = h(null), z = h(null), se = h(void 0), B = h(null), V = h(null), ce = h(null), H = h(v), le = h(d), ue = h(f), U = h(/* @__PURE__ */ new Map()), de = h(() => null), W = h(() => void 0), G = h(() => void 0), he = h(() => !1), K = s({
1893
- extensions: m(() => Rt({
1892
+ let [ae, j] = _(k.current), [M, N] = _(null), [P, F] = _(() => Zt(ne.current, k.current, w, r, i, 0)), I = g(P), L = g(ae), R = g(M), oe = g(null), z = g(null), se = g(void 0), B = g(null), V = g(null), ce = g(null), H = g(v), le = g(f), ue = g(p), U = g(/* @__PURE__ */ new Map()), de = g(() => null), W = g(() => void 0), G = g(() => void 0), he = g(() => !1), K = s({
1893
+ extensions: h(() => Rt({
1894
1894
  getMentionTrigger: () => ee.current[0] ?? "@",
1895
1895
  getRemoteImageCount: () => L.current.length,
1896
1896
  attachImageFile: (e) => de.current(e)
@@ -1901,7 +1901,7 @@ function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r =
1901
1901
  attributes: {
1902
1902
  "data-slot": "composer-editor",
1903
1903
  role: "textbox",
1904
- "aria-label": c,
1904
+ "aria-label": l,
1905
1905
  "aria-disabled": n ? "true" : "false",
1906
1906
  dir: "auto",
1907
1907
  spellcheck: "false"
@@ -1917,44 +1917,44 @@ function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r =
1917
1917
  onSelectionUpdate({ editor: e }) {
1918
1918
  W.current(e), G.current(e);
1919
1919
  }
1920
- }), ge = m(() => M ? It(M, w, T, a) : [], [
1920
+ }), ge = h(() => M ? It(M, w, T, a) : [], [
1921
1921
  M,
1922
1922
  a,
1923
1923
  T,
1924
1924
  w
1925
- ]), _e = m(() => pe(P, w, E), [
1925
+ ]), _e = h(() => pe(P, w, E), [
1926
1926
  E,
1927
1927
  P,
1928
1928
  w
1929
1929
  ]);
1930
- p(() => {
1930
+ m(() => {
1931
1931
  I.current = P;
1932
- }, [P]), p(() => {
1932
+ }, [P]), m(() => {
1933
1933
  L.current = ae;
1934
- }, [ae]), p(() => {
1934
+ }, [ae]), m(() => {
1935
1935
  R.current = M;
1936
- }, [M]), p(() => {
1936
+ }, [M]), m(() => {
1937
1937
  P.shortcutsOpen && (M || P.reverseSearch !== null || !fe(P)) && F((e) => e.shortcutsOpen ? {
1938
1938
  ...e,
1939
1939
  shortcutsOpen: !1
1940
1940
  } : e);
1941
- }, [M, P]), p(() => {
1941
+ }, [M, P]), m(() => {
1942
1942
  H.current = v;
1943
- }, [v]), p(() => {
1944
- le.current = d;
1945
- }, [d]), p(() => {
1946
- ue.current = f;
1947
- }, [f]), p(() => {
1943
+ }, [v]), m(() => {
1944
+ le.current = f;
1945
+ }, [f]), m(() => {
1946
+ ue.current = p;
1947
+ }, [p]), m(() => {
1948
1948
  K && (K.setEditable(!n), K.view.dom.setAttribute("aria-disabled", n ? "true" : "false"), n && N(null));
1949
- }, [n, K]), p(() => {
1950
- K?.view.dom.setAttribute("aria-label", c);
1951
- }, [K, c]), p(() => {
1949
+ }, [n, K]), m(() => {
1950
+ K?.view.dom.setAttribute("aria-label", l);
1951
+ }, [K, l]), m(() => {
1952
1952
  H.current?.(P, _e), t !== void 0 && (_e ? bt(t, Be(P, _e.persistedPrompt)) : A.current === 0 && bt(t, null));
1953
1953
  }, [
1954
1954
  P,
1955
1955
  t,
1956
1956
  _e
1957
- ]), p(() => {
1957
+ ]), m(() => {
1958
1958
  F((e) => e.isTaskRunning === r && e.queueSubmissions === i ? e : {
1959
1959
  ...e,
1960
1960
  isTaskRunning: r,
@@ -2620,11 +2620,11 @@ function cr({ initialDraft: e, draftKey: t, disabled: n = !1, isTaskRunning: r =
2620
2620
  },
2621
2621
  children: /* @__PURE__ */ x("section", {
2622
2622
  "data-slot": "composer",
2623
- className: _("border-border bg-card relative border font-[inherit]", l),
2623
+ className: c("border-border bg-card relative border font-[inherit]", u),
2624
2624
  children: /* @__PURE__ */ S("div", {
2625
2625
  onKeyDownCapture: at,
2626
2626
  onMouseDownCapture: ot,
2627
- children: [u, y.hasLayoutChildren ? null : /* @__PURE__ */ x(lr, {})]
2627
+ children: [d, y.hasLayoutChildren ? null : /* @__PURE__ */ x(lr, {})]
2628
2628
  })
2629
2629
  })
2630
2630
  });
@@ -2649,7 +2649,7 @@ function ur(e) {
2649
2649
  let t = i(8), n, r;
2650
2650
  t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
2651
2651
  let a;
2652
- t[3] === n ? a = t[4] : (a = _("space-y-2", n), t[3] = n, t[4] = a);
2652
+ t[3] === n ? a = t[4] : (a = c("space-y-2", n), t[3] = n, t[4] = a);
2653
2653
  let o;
2654
2654
  return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ x("div", {
2655
2655
  className: a,
@@ -2660,7 +2660,7 @@ function dr(e) {
2660
2660
  let t = i(8), n, r;
2661
2661
  t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
2662
2662
  let a;
2663
- t[3] === n ? a = t[4] : (a = _("flex flex-wrap items-center gap-1.5", n), t[3] = n, t[4] = a);
2663
+ t[3] === n ? a = t[4] : (a = c("flex flex-wrap items-center gap-1.5", n), t[3] = n, t[4] = a);
2664
2664
  let o;
2665
2665
  return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ x("div", {
2666
2666
  className: a,
@@ -2673,12 +2673,12 @@ function fr(e) {
2673
2673
  let { state: a } = A("Composer.RemoteImages");
2674
2674
  if (a.remoteImages.length === 0) return null;
2675
2675
  let o;
2676
- t[3] === n ? o = t[4] : (o = _("border-border space-y-1 border-b pb-2 text-sm", n), t[3] = n, t[4] = o);
2676
+ t[3] === n ? o = t[4] : (o = c("border-border space-y-1 border-b pb-2 text-sm", n), t[3] = n, t[4] = o);
2677
2677
  let s;
2678
2678
  if (t[5] !== a.remoteImages || t[6] !== a.selectedRemoteImageId) {
2679
2679
  let e;
2680
2680
  t[8] === a.selectedRemoteImageId ? e = t[9] : (e = (e, t) => /* @__PURE__ */ S("div", {
2681
- className: _("flex h-6 items-center gap-2 rounded-sm px-2", a.selectedRemoteImageId === e.id ? "bg-primary text-primary-foreground" : "text-sky-500"),
2681
+ className: c("flex h-6 items-center gap-2 rounded-sm px-2", a.selectedRemoteImageId === e.id ? "bg-primary text-primary-foreground" : "text-sky-500"),
2682
2682
  children: [/* @__PURE__ */ S("span", {
2683
2683
  className: "shrink-0",
2684
2684
  children: [
@@ -2692,12 +2692,12 @@ function fr(e) {
2692
2692
  })]
2693
2693
  }, e.id), t[8] = a.selectedRemoteImageId, t[9] = e), s = a.remoteImages.map(e), t[5] = a.remoteImages, t[6] = a.selectedRemoteImageId, t[7] = s;
2694
2694
  } else s = t[7];
2695
- let c;
2696
- return t[10] !== r || t[11] !== o || t[12] !== s ? (c = /* @__PURE__ */ x("div", {
2695
+ let l;
2696
+ return t[10] !== r || t[11] !== o || t[12] !== s ? (l = /* @__PURE__ */ x("div", {
2697
2697
  className: o,
2698
2698
  ...r,
2699
2699
  children: s
2700
- }), t[10] = r, t[11] = o, t[12] = s, t[13] = c) : c = t[13], c;
2700
+ }), t[10] = r, t[11] = o, t[12] = s, t[13] = l) : l = t[13], l;
2701
2701
  }
2702
2702
  function pr(e) {
2703
2703
  let t = i(21), n, r, a, s;
@@ -2730,7 +2730,7 @@ function mr(e) {
2730
2730
  let { state: a } = A("Composer.Error");
2731
2731
  if (!a.error) return null;
2732
2732
  let o;
2733
- t[3] === n ? o = t[4] : (o = _("border-primary/30 bg-primary/10 text-primary rounded-md border px-3 py-2 text-xs", n), t[3] = n, t[4] = o);
2733
+ t[3] === n ? o = t[4] : (o = c("border-primary/30 bg-primary/10 text-primary rounded-md border px-3 py-2 text-xs", n), t[3] = n, t[4] = o);
2734
2734
  let s;
2735
2735
  return t[5] !== r || t[6] !== a.error || t[7] !== o ? (s = /* @__PURE__ */ x("div", {
2736
2736
  className: o,
@@ -2741,57 +2741,57 @@ function mr(e) {
2741
2741
  function hr(e) {
2742
2742
  let t = i(25), n, r;
2743
2743
  t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
2744
- let { activePopup: a, suggestions: o, actions: s } = A("Composer.Popup"), { acceptSuggestion: c } = s;
2744
+ let { activePopup: a, suggestions: o, actions: s } = A("Composer.Popup"), { acceptSuggestion: l } = s;
2745
2745
  if (!a) return null;
2746
- let l;
2747
- t[3] === o ? l = t[4] : (l = o.some(gr), t[3] = o, t[4] = l);
2748
- let u = l, d;
2749
- t[5] === n ? d = t[6] : (d = _("border-border bg-popover absolute inset-x-0 bottom-[calc(100%+0.5rem)] z-10 rounded-xl border shadow-lg", n), t[5] = n, t[6] = d);
2750
- let f;
2751
- if (t[7] !== c || t[8] !== a || t[9] !== o || t[10] !== u) {
2746
+ let u;
2747
+ t[3] === o ? u = t[4] : (u = o.some(gr), t[3] = o, t[4] = u);
2748
+ let d = u, f;
2749
+ t[5] === n ? f = t[6] : (f = c("border-border bg-popover absolute inset-x-0 bottom-[calc(100%+0.5rem)] z-10 rounded-xl border shadow-lg", n), t[5] = n, t[6] = f);
2750
+ let p;
2751
+ if (t[7] !== l || t[8] !== a || t[9] !== o || t[10] !== d) {
2752
2752
  let e;
2753
- t[12] !== c || t[13] !== a || t[14] !== u ? (e = (e, t) => /* @__PURE__ */ x(_r, {
2753
+ t[12] !== l || t[13] !== a || t[14] !== d ? (e = (e, t) => /* @__PURE__ */ x(_r, {
2754
2754
  selected: t === a.selectedIndex,
2755
- icon: u ? e.icon : null,
2755
+ icon: d ? e.icon : null,
2756
2756
  token: W(e),
2757
2757
  takesArgs: e.supportsArgs === !0,
2758
2758
  description: e.detail,
2759
- onMouseDown: () => c({ index: t })
2760
- }, `item:${e.id}`), t[12] = c, t[13] = a, t[14] = u, t[15] = e) : e = t[15], f = o.map(e), t[7] = c, t[8] = a, t[9] = o, t[10] = u, t[11] = f;
2761
- } else f = t[11];
2762
- let p;
2763
- t[16] === o.length ? p = t[17] : (p = o.length === 0 ? /* @__PURE__ */ x("div", {
2759
+ onMouseDown: () => l({ index: t })
2760
+ }, `item:${e.id}`), t[12] = l, t[13] = a, t[14] = d, t[15] = e) : e = t[15], p = o.map(e), t[7] = l, t[8] = a, t[9] = o, t[10] = d, t[11] = p;
2761
+ } else p = t[11];
2762
+ let m;
2763
+ t[16] === o.length ? m = t[17] : (m = o.length === 0 ? /* @__PURE__ */ x("div", {
2764
2764
  className: "text-muted-foreground px-2 py-1 text-[13px] leading-4",
2765
2765
  children: "no matches"
2766
- }) : null, t[16] = o.length, t[17] = p);
2767
- let m;
2768
- t[18] !== f || t[19] !== p ? (m = /* @__PURE__ */ S("div", {
2766
+ }) : null, t[16] = o.length, t[17] = m);
2767
+ let h;
2768
+ t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ S("div", {
2769
2769
  className: "flex max-h-72 flex-col gap-1 overflow-y-auto p-1",
2770
2770
  role: "listbox",
2771
2771
  "aria-label": "Suggestions",
2772
- children: [f, p]
2773
- }), t[18] = f, t[19] = p, t[20] = m) : m = t[20];
2774
- let h;
2775
- return t[21] !== r || t[22] !== d || t[23] !== m ? (h = /* @__PURE__ */ x("div", {
2776
- className: d,
2772
+ children: [p, m]
2773
+ }), t[18] = p, t[19] = m, t[20] = h) : h = t[20];
2774
+ let g;
2775
+ return t[21] !== r || t[22] !== f || t[23] !== h ? (g = /* @__PURE__ */ x("div", {
2776
+ className: f,
2777
2777
  ...r,
2778
- children: m
2779
- }), t[21] = r, t[22] = d, t[23] = m, t[24] = h) : h = t[24], h;
2778
+ children: h
2779
+ }), t[21] = r, t[22] = f, t[23] = h, t[24] = g) : g = t[24], g;
2780
2780
  }
2781
2781
  function gr(e) {
2782
2782
  return e.icon;
2783
2783
  }
2784
2784
  function _r(e) {
2785
- let t = i(23), { selected: n, icon: r, token: a, takesArgs: o, description: s, onMouseDown: c } = e, l = h(null), u, d;
2786
- t[0] === n ? (u = t[1], d = t[2]) : (u = () => {
2787
- n && l.current?.scrollIntoView({ block: "nearest" });
2788
- }, d = [n], t[0] = n, t[1] = u, t[2] = d), p(u, d);
2789
- let f = n ? "bg-accent text-foreground" : "text-foreground/80 hover:bg-accent/60", m;
2790
- t[3] === f ? m = t[4] : (m = _("flex w-full items-center gap-2 rounded-md px-2 py-1 text-start text-[13px] leading-4 [&_svg]:size-4 [&_svg]:shrink-0", f), t[3] = f, t[4] = m);
2791
- let g;
2792
- t[5] === c ? g = t[6] : (g = (e) => {
2793
- e.preventDefault(), c();
2794
- }, t[5] = c, t[6] = g);
2785
+ let t = i(23), { selected: n, icon: r, token: a, takesArgs: o, description: s, onMouseDown: l } = e, u = g(null), d, f;
2786
+ t[0] === n ? (d = t[1], f = t[2]) : (d = () => {
2787
+ n && u.current?.scrollIntoView({ block: "nearest" });
2788
+ }, f = [n], t[0] = n, t[1] = d, t[2] = f), m(d, f);
2789
+ let p = n ? "bg-accent text-foreground" : "text-foreground/80 hover:bg-accent/60", h;
2790
+ t[3] === p ? h = t[4] : (h = c("flex w-full items-center gap-2 rounded-md px-2 py-1 text-start text-[13px] leading-4 [&_svg]:size-4 [&_svg]:shrink-0", p), t[3] = p, t[4] = h);
2791
+ let _;
2792
+ t[5] === l ? _ = t[6] : (_ = (e) => {
2793
+ e.preventDefault(), l();
2794
+ }, t[5] = l, t[6] = _);
2795
2795
  let v;
2796
2796
  t[7] === r ? v = t[8] : (v = r === null ? null : /* @__PURE__ */ x("span", {
2797
2797
  className: "flex size-4 shrink-0 items-center justify-center",
@@ -2813,20 +2813,20 @@ function _r(e) {
2813
2813
  children: s
2814
2814
  }), t[13] = s, t[14] = C);
2815
2815
  let w;
2816
- return t[15] !== n || t[16] !== m || t[17] !== g || t[18] !== v || t[19] !== y || t[20] !== b || t[21] !== C ? (w = /* @__PURE__ */ S("button", {
2817
- ref: l,
2816
+ return t[15] !== n || t[16] !== h || t[17] !== _ || t[18] !== v || t[19] !== y || t[20] !== b || t[21] !== C ? (w = /* @__PURE__ */ S("button", {
2817
+ ref: u,
2818
2818
  type: "button",
2819
2819
  role: "option",
2820
2820
  "aria-selected": n,
2821
- className: m,
2822
- onMouseDown: g,
2821
+ className: h,
2822
+ onMouseDown: _,
2823
2823
  children: [
2824
2824
  v,
2825
2825
  y,
2826
2826
  b,
2827
2827
  C
2828
2828
  ]
2829
- }), t[15] = n, t[16] = m, t[17] = g, t[18] = v, t[19] = y, t[20] = b, t[21] = C, t[22] = w) : w = t[22], w;
2829
+ }), t[15] = n, t[16] = h, t[17] = _, t[18] = v, t[19] = y, t[20] = b, t[21] = C, t[22] = w) : w = t[22], w;
2830
2830
  }
2831
2831
  var vr = [
2832
2832
  {
@@ -2861,36 +2861,36 @@ function yr(e) {
2861
2861
  t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
2862
2862
  let { state: a, actions: o } = A("Composer.Shortcuts"), { closeShortcuts: s } = o;
2863
2863
  if (!a.shortcutsOpen || !fe(a)) return null;
2864
- let c;
2865
- t[3] === n ? c = t[4] : (c = _("border-border bg-popover border-t px-3 py-3 text-xs", n), t[3] = n, t[4] = c);
2866
2864
  let l;
2867
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ x("div", {
2865
+ t[3] === n ? l = t[4] : (l = c("border-border bg-popover border-t px-3 py-3 text-xs", n), t[3] = n, t[4] = l);
2866
+ let u;
2867
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ x("div", {
2868
2868
  className: "text-foreground font-medium",
2869
2869
  children: "Keyboard shortcuts"
2870
- }), t[5] = l) : l = t[5];
2871
- let u;
2872
- t[6] === s ? u = t[7] : (u = /* @__PURE__ */ S("div", {
2870
+ }), t[5] = u) : u = t[5];
2871
+ let d;
2872
+ t[6] === s ? d = t[7] : (d = /* @__PURE__ */ S("div", {
2873
2873
  className: "mb-3 flex items-center justify-between gap-3",
2874
- children: [l, /* @__PURE__ */ x("button", {
2874
+ children: [u, /* @__PURE__ */ x("button", {
2875
2875
  type: "button",
2876
2876
  className: "text-muted-foreground hover:bg-muted hover:text-foreground rounded-sm px-2 py-1",
2877
2877
  onClick: s,
2878
2878
  children: "close"
2879
2879
  })]
2880
- }), t[6] = s, t[7] = u);
2881
- let d;
2882
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ x("div", {
2880
+ }), t[6] = s, t[7] = d);
2881
+ let f;
2882
+ t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ x("div", {
2883
2883
  className: "grid gap-3 sm:grid-cols-3",
2884
2884
  children: vr.map(br)
2885
- }), t[8] = d) : d = t[8];
2886
- let f;
2887
- return t[9] !== r || t[10] !== c || t[11] !== u ? (f = /* @__PURE__ */ S("div", {
2885
+ }), t[8] = f) : f = t[8];
2886
+ let p;
2887
+ return t[9] !== r || t[10] !== l || t[11] !== d ? (p = /* @__PURE__ */ S("div", {
2888
2888
  role: "dialog",
2889
2889
  "aria-label": "Keyboard shortcuts",
2890
- className: c,
2890
+ className: l,
2891
2891
  ...r,
2892
- children: [u, d]
2893
- }), t[9] = r, t[10] = c, t[11] = u, t[12] = f) : f = t[12], f;
2892
+ children: [d, f]
2893
+ }), t[9] = r, t[10] = l, t[11] = d, t[12] = p) : p = t[12], p;
2894
2894
  }
2895
2895
  function br(e) {
2896
2896
  return /* @__PURE__ */ S("div", {
@@ -2923,36 +2923,36 @@ function Sr(e) {
2923
2923
  let { activePopup: a, state: o, commandTriggers: s } = A("Composer.Footer");
2924
2924
  if (o.reverseSearch !== null) {
2925
2925
  let e;
2926
- t[3] === n ? e = t[4] : (e = _("border-border text-muted-foreground flex items-center gap-2 border-t px-3 py-2 text-[11px]", n), t[3] = n, t[4] = e);
2926
+ t[3] === n ? e = t[4] : (e = c("border-border text-muted-foreground flex items-center gap-2 border-t px-3 py-2 text-[11px]", n), t[3] = n, t[4] = e);
2927
2927
  let i, a;
2928
2928
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ x("kbd", {
2929
2929
  className: "border-border bg-muted text-foreground rounded border px-1.5 py-0.5 font-[inherit]",
2930
2930
  children: "Ctrl R"
2931
2931
  }), a = /* @__PURE__ */ x("span", { children: "reverse-i-search:" }), t[5] = i, t[6] = a) : (i = t[5], a = t[6]);
2932
- let s = o.reverseSearch || "_", c;
2933
- t[7] === s ? c = t[8] : (c = /* @__PURE__ */ x("span", {
2932
+ let s = o.reverseSearch || "_", l;
2933
+ t[7] === s ? l = t[8] : (l = /* @__PURE__ */ x("span", {
2934
2934
  className: "text-foreground",
2935
2935
  children: s
2936
- }), t[7] = s, t[8] = c);
2937
- let l, u, d, f;
2938
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ x("span", { children: "Ctrl R previous" }), u = /* @__PURE__ */ x("span", { children: "Ctrl S next" }), d = /* @__PURE__ */ x("span", { children: "Enter accept" }), f = /* @__PURE__ */ x("span", { children: "Esc cancel" }), t[9] = l, t[10] = u, t[11] = d, t[12] = f) : (l = t[9], u = t[10], d = t[11], f = t[12]);
2939
- let p;
2940
- return t[13] !== r || t[14] !== e || t[15] !== c ? (p = /* @__PURE__ */ S("div", {
2936
+ }), t[7] = s, t[8] = l);
2937
+ let u, d, f, p;
2938
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ x("span", { children: "Ctrl R previous" }), d = /* @__PURE__ */ x("span", { children: "Ctrl S next" }), f = /* @__PURE__ */ x("span", { children: "Enter accept" }), p = /* @__PURE__ */ x("span", { children: "Esc cancel" }), t[9] = u, t[10] = d, t[11] = f, t[12] = p) : (u = t[9], d = t[10], f = t[11], p = t[12]);
2939
+ let m;
2940
+ return t[13] !== r || t[14] !== e || t[15] !== l ? (m = /* @__PURE__ */ S("div", {
2941
2941
  className: e,
2942
2942
  ...r,
2943
2943
  children: [
2944
2944
  i,
2945
2945
  a,
2946
- c,
2947
2946
  l,
2948
2947
  u,
2949
2948
  d,
2950
- f
2949
+ f,
2950
+ p
2951
2951
  ]
2952
- }), t[13] = r, t[14] = e, t[15] = c, t[16] = p) : p = t[16], p;
2952
+ }), t[13] = r, t[14] = e, t[15] = l, t[16] = m) : m = t[16], m;
2953
2953
  }
2954
- let c;
2955
- t[17] !== a || t[18] !== s || t[19] !== o.isTaskRunning || t[20] !== o.queueSubmissions ? (c = a !== null && s.includes(a.trigger) || a ? [
2954
+ let l;
2955
+ t[17] !== a || t[18] !== s || t[19] !== o.isTaskRunning || t[20] !== o.queueSubmissions ? (l = a !== null && s.includes(a.trigger) || a ? [
2956
2956
  ["Enter", "insert"],
2957
2957
  ["Tab", "insert"],
2958
2958
  ["Esc", "dismiss"]
@@ -2968,17 +2968,17 @@ function Sr(e) {
2968
2968
  ["Ctrl W", "word kill"],
2969
2969
  ["Alt B/F", "word move"],
2970
2970
  ["Ctrl Y", "yank"]
2971
- ], t[17] = a, t[18] = s, t[19] = o.isTaskRunning, t[20] = o.queueSubmissions, t[21] = c) : c = t[21];
2972
- let l = c, u;
2973
- t[22] === n ? u = t[23] : (u = _("border-border text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1 border-t px-3 py-2 text-[11px]", n), t[22] = n, t[23] = u);
2974
- let d;
2975
- t[24] === l ? d = t[25] : (d = l.map(Cr), t[24] = l, t[25] = d);
2971
+ ], t[17] = a, t[18] = s, t[19] = o.isTaskRunning, t[20] = o.queueSubmissions, t[21] = l) : l = t[21];
2972
+ let u = l, d;
2973
+ t[22] === n ? d = t[23] : (d = c("border-border text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1 border-t px-3 py-2 text-[11px]", n), t[22] = n, t[23] = d);
2976
2974
  let f;
2977
- return t[26] !== r || t[27] !== u || t[28] !== d ? (f = /* @__PURE__ */ x("div", {
2978
- className: u,
2975
+ t[24] === u ? f = t[25] : (f = u.map(Cr), t[24] = u, t[25] = f);
2976
+ let p;
2977
+ return t[26] !== r || t[27] !== d || t[28] !== f ? (p = /* @__PURE__ */ x("div", {
2978
+ className: d,
2979
2979
  ...r,
2980
- children: d
2981
- }), t[26] = r, t[27] = u, t[28] = d, t[29] = f) : f = t[29], f;
2980
+ children: f
2981
+ }), t[26] = r, t[27] = d, t[28] = f, t[29] = p) : p = t[29], p;
2982
2982
  }
2983
2983
  function Cr(e) {
2984
2984
  let [t, n] = e;
@@ -2993,7 +2993,7 @@ function Cr(e) {
2993
2993
  function wr(e) {
2994
2994
  let t = i(19), n, r, a, o;
2995
2995
  t[0] === e ? (n = t[1], r = t[2], a = t[3], o = t[4]) : ({accept: a, multiple: o, disabled: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = a, t[4] = o);
2996
- let s = a === void 0 ? "image/*,video/*,audio/*" : a, c = o === void 0 || o, { actions: l, disabled: u } = A("Composer.AttachFiles"), d = h(null), f;
2996
+ let s = a === void 0 ? "image/*,video/*,audio/*" : a, c = o === void 0 || o, { actions: l, disabled: u } = A("Composer.AttachFiles"), d = g(null), f;
2997
2997
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (f = () => d.current?.click(), t[5] = f) : f = t[5];
2998
2998
  let p;
2999
2999
  t[6] !== n || t[7] !== r ? (p = /* @__PURE__ */ x(Ar, {
@@ -3001,13 +3001,13 @@ function wr(e) {
3001
3001
  disabled: n,
3002
3002
  ...r
3003
3003
  }), t[6] = n, t[7] = r, t[8] = p) : p = t[8];
3004
- let m = u || n, g;
3005
- t[9] === l ? g = t[10] : (g = (e) => {
3004
+ let m = u || n, h;
3005
+ t[9] === l ? h = t[10] : (h = (e) => {
3006
3006
  let t = e.currentTarget;
3007
3007
  t.files && l.attachImageFiles(t.files), t.value = "";
3008
- }, t[9] = l, t[10] = g);
3008
+ }, t[9] = l, t[10] = h);
3009
3009
  let _;
3010
- t[11] !== s || t[12] !== c || t[13] !== m || t[14] !== g ? (_ = /* @__PURE__ */ x("input", {
3010
+ t[11] !== s || t[12] !== c || t[13] !== m || t[14] !== h ? (_ = /* @__PURE__ */ x("input", {
3011
3011
  ref: d,
3012
3012
  type: "file",
3013
3013
  accept: s,
@@ -3015,8 +3015,8 @@ function wr(e) {
3015
3015
  "aria-label": "Attach media files",
3016
3016
  hidden: !0,
3017
3017
  disabled: m,
3018
- onChange: g
3019
- }), t[11] = s, t[12] = c, t[13] = m, t[14] = g, t[15] = _) : _ = t[15];
3018
+ onChange: h
3019
+ }), t[11] = s, t[12] = c, t[13] = m, t[14] = h, t[15] = _) : _ = t[15];
3020
3020
  let v;
3021
3021
  return t[16] !== p || t[17] !== _ ? (v = /* @__PURE__ */ S(b, { children: [p, _] }), t[16] = p, t[17] = _, t[18] = v) : v = t[18], v;
3022
3022
  }