@athenaintel/react 0.1.0 → 0.3.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.
package/dist/index.cjs CHANGED
@@ -1378,7 +1378,7 @@ const createStoreImpl = (createState) => {
1378
1378
  };
1379
1379
  const createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
1380
1380
  const identity = (arg) => arg;
1381
- function useStore(api, selector = identity) {
1381
+ function useStore$1(api, selector = identity) {
1382
1382
  const slice2 = React.useSyncExternalStore(
1383
1383
  api.subscribe,
1384
1384
  React.useCallback(() => selector(api.getState()), [api, selector]),
@@ -1389,7 +1389,7 @@ function useStore(api, selector = identity) {
1389
1389
  }
1390
1390
  const createImpl = (createState) => {
1391
1391
  const api = createStore(createState);
1392
- const useBoundStore = (selector) => useStore(api, selector);
1392
+ const useBoundStore = (selector) => useStore$1(api, selector);
1393
1393
  Object.assign(useBoundStore, api);
1394
1394
  return useBoundStore;
1395
1395
  };
@@ -6434,10 +6434,10 @@ class ThreadMessageConverter {
6434
6434
  constructor() {
6435
6435
  __publicField(this, "cache", /* @__PURE__ */ new WeakMap());
6436
6436
  }
6437
- convertMessages(messages, converter2) {
6437
+ convertMessages(messages, converter) {
6438
6438
  return messages.map((m, idx) => {
6439
6439
  const cached = this.cache.get(m);
6440
- const newMessage = converter2(cached, m, idx);
6440
+ const newMessage = converter(cached, m, idx);
6441
6441
  this.cache.set(m, newMessage);
6442
6442
  return newMessage;
6443
6443
  });
@@ -9091,8 +9091,8 @@ function useRunManager(config2) {
9091
9091
  cancel
9092
9092
  };
9093
9093
  }
9094
- function useConvertedState(converter2, agentState, pendingCommands, isSending, toolStatuses) {
9095
- return React.useMemo(() => converter2(agentState, { pendingCommands, isSending, toolStatuses }), [converter2, agentState, pendingCommands, isSending, toolStatuses]);
9094
+ function useConvertedState(converter, agentState, pendingCommands, isSending, toolStatuses) {
9095
+ return React.useMemo(() => converter(agentState, { pendingCommands, isSending, toolStatuses }), [converter, agentState, pendingCommands, isSending, toolStatuses]);
9096
9096
  }
9097
9097
  const convertAppendMessageToCommand = (message) => {
9098
9098
  var _a2;
@@ -20593,7 +20593,6 @@ const safeStringify = (value) => {
20593
20593
  return "[Unable to serialize tool result]";
20594
20594
  }
20595
20595
  };
20596
- const optimisticMessageCache = /* @__PURE__ */ new Map();
20597
20596
  const commandsToMessages = (commands) => {
20598
20597
  return commands.flatMap((c) => {
20599
20598
  if (c.type === "add-message") {
@@ -20638,7 +20637,7 @@ const getTrackingIdFromMessage = (msg) => {
20638
20637
  }
20639
20638
  return void 0;
20640
20639
  };
20641
- const converter = (state, connectionMetadata) => {
20640
+ const createConverter = (optimisticMessageCache) => (state, connectionMetadata) => {
20642
20641
  const validatedState = parseLangGraphState(state);
20643
20642
  const backendTrackingIds = /* @__PURE__ */ new Set();
20644
20643
  for (const msg of validatedState.messages) {
@@ -20750,11 +20749,17 @@ const useAthenaRuntime = (config2) => {
20750
20749
  systemPrompt,
20751
20750
  threadId: threadIdProp
20752
20751
  } = config2;
20753
- const threadId = React.useMemo(() => threadIdProp ?? crypto.randomUUID(), [threadIdProp]);
20752
+ const generatedIdRef = React.useRef(null);
20753
+ if (generatedIdRef.current === null) {
20754
+ generatedIdRef.current = crypto.randomUUID();
20755
+ }
20756
+ const threadId = threadIdProp ?? generatedIdRef.current;
20754
20757
  const enabledTools = React.useMemo(
20755
20758
  () => Array.from(/* @__PURE__ */ new Set([...tools, ...frontendToolIds])),
20756
20759
  [tools, frontendToolIds]
20757
20760
  );
20761
+ const optimisticMessageCache = React.useRef(/* @__PURE__ */ new Map()).current;
20762
+ const converter = React.useMemo(() => createConverter(optimisticMessageCache), [optimisticMessageCache]);
20758
20763
  const tokenRef = React.useRef(token);
20759
20764
  tokenRef.current = token;
20760
20765
  const apiKeyRef = React.useRef(apiKey);
@@ -20770,49 +20775,57 @@ const useAthenaRuntime = (config2) => {
20770
20775
  Accept: "text/event-stream"
20771
20776
  }),
20772
20777
  onResponse: () => {
20773
- console.log("[AthenaSDK] Stream connected");
20778
+ if (process.env.NODE_ENV !== "production") {
20779
+ console.log("[AthenaSDK] Stream connected");
20780
+ }
20774
20781
  },
20775
20782
  onFinish: () => {
20776
- console.log("[AthenaSDK] Stream completed");
20783
+ if (process.env.NODE_ENV !== "production") {
20784
+ console.log("[AthenaSDK] Stream completed");
20785
+ }
20777
20786
  },
20778
20787
  onError: (error2, { commands, updateState }) => {
20779
20788
  const pendingCommands = commandsToMessages(commands);
20780
20789
  const isInvalidStringLength = error2 instanceof RangeError && /Invalid string length/i.test(error2.message);
20781
20790
  const userErrorMessage = isInvalidStringLength ? "The response was too large to process. Try reducing the amount of content in a single request or starting a new chat." : error2.message;
20782
20791
  updateState((state) => {
20783
- const newState = {
20784
- ...state,
20785
- messages: [...state.messages, ...pendingCommands]
20786
- };
20787
- const lastAssistantMessage = newState.messages.filter((m) => m.type === "ai").at(-1);
20788
- if (lastAssistantMessage) {
20789
- lastAssistantMessage.status = {
20790
- type: "incomplete",
20791
- reason: "error",
20792
- error: userErrorMessage
20792
+ const messages = [...state.messages, ...pendingCommands];
20793
+ const lastAiIdx = messages.findLastIndex((m) => m.type === "ai");
20794
+ if (lastAiIdx !== -1) {
20795
+ messages[lastAiIdx] = {
20796
+ ...messages[lastAiIdx],
20797
+ status: {
20798
+ type: "incomplete",
20799
+ reason: "error",
20800
+ error: userErrorMessage
20801
+ }
20793
20802
  };
20794
20803
  }
20795
- return newState;
20804
+ return { ...state, messages };
20796
20805
  });
20797
- console.error("[AthenaSDK] Error:", error2.message);
20806
+ if (process.env.NODE_ENV !== "production") {
20807
+ console.error("[AthenaSDK] Error:", error2.message);
20808
+ }
20798
20809
  },
20799
20810
  onCancel: async ({ commands, updateState }) => {
20800
20811
  const pendingCommands = commandsToMessages(commands);
20801
20812
  updateState((state) => {
20802
- const newState = {
20803
- ...state,
20804
- messages: [...state.messages, ...pendingCommands]
20805
- };
20806
- const lastAssistantMessage = newState.messages.filter((m) => m.type === "ai").at(-1);
20807
- if (lastAssistantMessage) {
20808
- lastAssistantMessage.status = {
20809
- type: "incomplete",
20810
- reason: "cancelled"
20813
+ const messages = [...state.messages, ...pendingCommands];
20814
+ const lastAiIdx = messages.findLastIndex((m) => m.type === "ai");
20815
+ if (lastAiIdx !== -1) {
20816
+ messages[lastAiIdx] = {
20817
+ ...messages[lastAiIdx],
20818
+ status: {
20819
+ type: "incomplete",
20820
+ reason: "cancelled"
20821
+ }
20811
20822
  };
20812
20823
  }
20813
- return newState;
20824
+ return { ...state, messages };
20814
20825
  });
20815
- console.log("[AthenaSDK] Cancelled");
20826
+ if (process.env.NODE_ENV !== "production") {
20827
+ console.log("[AthenaSDK] Cancelled");
20828
+ }
20816
20829
  },
20817
20830
  capabilities: {
20818
20831
  edit: false
@@ -20857,10 +20870,7 @@ const useAthenaRuntime = (config2) => {
20857
20870
  },
20858
20871
  get threadId() {
20859
20872
  return threadId;
20860
- },
20861
- credentials: "include",
20862
- mode: "cors",
20863
- cache: "no-store"
20873
+ }
20864
20874
  }
20865
20875
  });
20866
20876
  return runtime;
@@ -24088,6 +24098,14 @@ function TooltipContent({
24088
24098
  }
24089
24099
  ) });
24090
24100
  }
24101
+ const AthenaContext = React.createContext(null);
24102
+ function useAthenaConfig() {
24103
+ const ctx = React.useContext(AthenaContext);
24104
+ if (!ctx) {
24105
+ throw new Error("[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>");
24106
+ }
24107
+ return ctx;
24108
+ }
24091
24109
  function AthenaProvider({
24092
24110
  children,
24093
24111
  apiKey,
@@ -24103,15 +24121,17 @@ function AthenaProvider({
24103
24121
  systemPrompt,
24104
24122
  threadId
24105
24123
  }) {
24106
- const frontendToolNames = Object.keys(frontendTools);
24124
+ const frontendToolNames = React.useMemo(() => Object.keys(frontendTools), [frontendTools]);
24125
+ const auiTools = React.useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
24107
24126
  const aui = useAui({
24108
- tools: Tools({ toolkit: frontendTools })
24127
+ tools: auiTools
24109
24128
  });
24110
24129
  const parentAuthToken = useParentAuth();
24111
24130
  const effectiveToken = tokenProp ?? parentAuthToken;
24131
+ const effectiveBackendUrl = backendUrl ?? DEFAULT_BACKEND_URL;
24112
24132
  const runtime = useAthenaRuntime({
24113
24133
  apiUrl,
24114
- backendUrl,
24134
+ backendUrl: effectiveBackendUrl,
24115
24135
  apiKey,
24116
24136
  token: effectiveToken,
24117
24137
  model,
@@ -24123,7 +24143,11 @@ function AthenaProvider({
24123
24143
  systemPrompt,
24124
24144
  threadId
24125
24145
  });
24126
- return /* @__PURE__ */ jsxRuntime.jsx(AssistantRuntimeProvider, { aui, runtime, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children }) });
24146
+ const athenaConfig = React.useMemo(
24147
+ () => ({ backendUrl: effectiveBackendUrl, apiKey, token: effectiveToken }),
24148
+ [effectiveBackendUrl, apiKey, effectiveToken]
24149
+ );
24150
+ return /* @__PURE__ */ jsxRuntime.jsx(AssistantRuntimeProvider, { aui, runtime, children: /* @__PURE__ */ jsxRuntime.jsx(AthenaContext.Provider, { value: athenaConfig, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children }) }) });
24127
24151
  }
24128
24152
  function OrderedMap(content) {
24129
24153
  this.content = content;
@@ -59507,6 +59531,31 @@ class Store {
59507
59531
  return this.atom.subscribe(toObserver(observerOrFn));
59508
59532
  }
59509
59533
  }
59534
+ function defaultCompare(a, b) {
59535
+ return a === b;
59536
+ }
59537
+ function useStore(atom, selector, compare = defaultCompare) {
59538
+ const subscribe = React.useCallback(
59539
+ (handleStoreChange) => {
59540
+ if (!atom) {
59541
+ return () => {
59542
+ };
59543
+ }
59544
+ const { unsubscribe } = atom.subscribe(handleStoreChange);
59545
+ return unsubscribe;
59546
+ },
59547
+ [atom]
59548
+ );
59549
+ const boundGetSnapshot = React.useCallback(() => atom == null ? void 0 : atom.get(), [atom]);
59550
+ const selectedSnapshot = withSelectorExports.useSyncExternalStoreWithSelector(
59551
+ subscribe,
59552
+ boundGetSnapshot,
59553
+ boundGetSnapshot,
59554
+ selector,
59555
+ compare
59556
+ );
59557
+ return selectedSnapshot;
59558
+ }
59510
59559
  function createScopeRegistry() {
59511
59560
  return { entries: /* @__PURE__ */ new Map() };
59512
59561
  }
@@ -59542,52 +59591,13 @@ function getFilteredItems(cache, scope, query) {
59542
59591
  }
59543
59592
  return results;
59544
59593
  }
59545
- function toolsToMenuItems(tools) {
59546
- return tools.map((t) => ({
59547
- id: t.id,
59548
- name: t.name,
59549
- type: t.type,
59550
- fallbackIcon: t.icon ?? (t.type === "toolkit" ? "🧰" : "🔧"),
59551
- description: t.description,
59552
- visibleInScopes: /* @__PURE__ */ new Set(["root"])
59553
- }));
59554
- }
59555
- function useMentionSuggestions(tools) {
59556
- const store = React.useMemo(() => {
59557
- const registry = createScopeRegistry();
59558
- const cache = createItemCache();
59559
- registerSource(registry, "root", async () => ({
59560
- items: [],
59561
- pagination: { hasMore: false }
59562
- }));
59563
- const items = toolsToMenuItems(tools);
59564
- addItems(cache, items, "root");
59565
- return new Store({ registry, cache });
59566
- }, []);
59567
- React.useMemo(() => {
59568
- const { cache } = store.state;
59569
- for (const item of cache.items.values()) {
59570
- item.visibleInScopes.delete("root");
59571
- }
59572
- for (const [id, item] of cache.items) {
59573
- if (item.visibleInScopes.size === 0) {
59574
- cache.items.delete(id);
59575
- }
59576
- }
59577
- const items = toolsToMenuItems(tools);
59578
- addItems(cache, items, "root");
59579
- }, [tools, store]);
59580
- return store;
59581
- }
59582
- function selectItems(store, scope, query) {
59583
- const { cache } = store.state;
59584
- const items = getFilteredItems(cache, scope, query);
59585
- return { items, isFetching: false, hasMore: false };
59586
- }
59587
59594
  const MentionSuggestionList = React.forwardRef(({ store, query, command: command2, closeMenu }, ref) => {
59588
59595
  const [selectedIndex, setSelectedIndex] = React.useState(0);
59589
59596
  const scrollContainerRef = React.useRef(null);
59590
- const { items, isFetching } = selectItems(store, "root", query);
59597
+ const { items, isFetching } = useStore(store, (state) => ({
59598
+ items: getFilteredItems(state.cache, "root", query),
59599
+ isFetching: false
59600
+ }));
59591
59601
  React.useEffect(() => {
59592
59602
  setSelectedIndex(0);
59593
59603
  }, [query]);
@@ -59650,7 +59660,10 @@ const MentionSuggestionList = React.forwardRef(({ store, query, command: command
59650
59660
  },
59651
59661
  item.id
59652
59662
  )),
59653
- isFetching
59663
+ isFetching && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-sm text-muted-foreground", children: [
59664
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
59665
+ "Loading..."
59666
+ ] })
59654
59667
  ] }) });
59655
59668
  });
59656
59669
  MentionSuggestionList.displayName = "MentionSuggestionList";
@@ -59726,6 +59739,9 @@ const MentionSuggestionsExtension = Extension.create({
59726
59739
  };
59727
59740
  },
59728
59741
  addProseMirrorPlugins() {
59742
+ if (!this.options.store) {
59743
+ throw new Error("[MentionSuggestionsExtension] A `store` option is required.");
59744
+ }
59729
59745
  return [
59730
59746
  index_default({
59731
59747
  editor: this.editor,
@@ -59837,6 +59853,45 @@ const MentionSuggestionsExtension = Extension.create({
59837
59853
  ];
59838
59854
  }
59839
59855
  });
59856
+ function toolsToMenuItems(tools) {
59857
+ return tools.map((t) => ({
59858
+ id: t.id,
59859
+ name: t.name,
59860
+ type: t.type,
59861
+ fallbackIcon: t.icon ?? (t.type === "toolkit" ? "🧰" : "🔧"),
59862
+ description: t.description,
59863
+ visibleInScopes: /* @__PURE__ */ new Set(["root"])
59864
+ }));
59865
+ }
59866
+ function useMentionSuggestions(tools) {
59867
+ const storeRef = React.useRef(null);
59868
+ if (!storeRef.current) {
59869
+ const registry = createScopeRegistry();
59870
+ const cache = createItemCache();
59871
+ registerSource(registry, "root", async () => ({
59872
+ items: [],
59873
+ pagination: { hasMore: false }
59874
+ }));
59875
+ const items = toolsToMenuItems(tools);
59876
+ addItems(cache, items, "root");
59877
+ storeRef.current = new Store({ registry, cache });
59878
+ }
59879
+ const store = storeRef.current;
59880
+ React.useEffect(() => {
59881
+ store.setState((prev) => {
59882
+ const newCache = createItemCache();
59883
+ for (const [id, item] of prev.cache.items) {
59884
+ if (item.visibleInScopes.size > 0 && !item.visibleInScopes.has("root")) {
59885
+ newCache.items.set(id, { ...item, visibleInScopes: new Set(item.visibleInScopes) });
59886
+ }
59887
+ }
59888
+ const items = toolsToMenuItems(tools);
59889
+ addItems(newCache, items, "root");
59890
+ return { ...prev, cache: newCache };
59891
+ });
59892
+ }, [tools, store]);
59893
+ return store;
59894
+ }
59840
59895
  const TiptapComposer = ({ tools = [] }) => {
59841
59896
  const composerRuntime = useComposerRuntime();
59842
59897
  const editorRef = React.useRef(null);
@@ -60025,29 +60080,29 @@ const createLucideIcon = (iconName, iconNode) => {
60025
60080
  * This source code is licensed under the ISC license.
60026
60081
  * See the LICENSE file in the root directory of this source tree.
60027
60082
  */
60028
- const __iconNode$s = [
60083
+ const __iconNode$B = [
60029
60084
  ["path", { d: "M12 5v14", key: "s699le" }],
60030
60085
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
60031
60086
  ];
60032
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$s);
60087
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$B);
60033
60088
  /**
60034
60089
  * @license lucide-react v0.575.0 - ISC
60035
60090
  *
60036
60091
  * This source code is licensed under the ISC license.
60037
60092
  * See the LICENSE file in the root directory of this source tree.
60038
60093
  */
60039
- const __iconNode$r = [
60094
+ const __iconNode$A = [
60040
60095
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
60041
60096
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
60042
60097
  ];
60043
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$r);
60098
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$A);
60044
60099
  /**
60045
60100
  * @license lucide-react v0.575.0 - ISC
60046
60101
  *
60047
60102
  * This source code is licensed under the ISC license.
60048
60103
  * See the LICENSE file in the root directory of this source tree.
60049
60104
  */
60050
- const __iconNode$q = [
60105
+ const __iconNode$z = [
60051
60106
  ["path", { d: "M12 7v14", key: "1akyts" }],
60052
60107
  [
60053
60108
  "path",
@@ -60057,14 +60112,14 @@ const __iconNode$q = [
60057
60112
  }
60058
60113
  ]
60059
60114
  ];
60060
- const BookOpen = createLucideIcon("book-open", __iconNode$q);
60115
+ const BookOpen = createLucideIcon("book-open", __iconNode$z);
60061
60116
  /**
60062
60117
  * @license lucide-react v0.575.0 - ISC
60063
60118
  *
60064
60119
  * This source code is licensed under the ISC license.
60065
60120
  * See the LICENSE file in the root directory of this source tree.
60066
60121
  */
60067
- const __iconNode$p = [
60122
+ const __iconNode$y = [
60068
60123
  ["path", { d: "M12 18V5", key: "adv99a" }],
60069
60124
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
60070
60125
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -60074,148 +60129,148 @@ const __iconNode$p = [
60074
60129
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
60075
60130
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
60076
60131
  ];
60077
- const Brain = createLucideIcon("brain", __iconNode$p);
60132
+ const Brain = createLucideIcon("brain", __iconNode$y);
60078
60133
  /**
60079
60134
  * @license lucide-react v0.575.0 - ISC
60080
60135
  *
60081
60136
  * This source code is licensed under the ISC license.
60082
60137
  * See the LICENSE file in the root directory of this source tree.
60083
60138
  */
60084
- const __iconNode$o = [
60139
+ const __iconNode$x = [
60085
60140
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
60086
60141
  ["path", { d: "M18 17V9", key: "2bz60n" }],
60087
60142
  ["path", { d: "M13 17V5", key: "1frdt8" }],
60088
60143
  ["path", { d: "M8 17v-3", key: "17ska0" }]
60089
60144
  ];
60090
- const ChartColumn = createLucideIcon("chart-column", __iconNode$o);
60145
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$x);
60091
60146
  /**
60092
60147
  * @license lucide-react v0.575.0 - ISC
60093
60148
  *
60094
60149
  * This source code is licensed under the ISC license.
60095
60150
  * See the LICENSE file in the root directory of this source tree.
60096
60151
  */
60097
- const __iconNode$n = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
60098
- const Check = createLucideIcon("check", __iconNode$n);
60152
+ const __iconNode$w = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
60153
+ const Check = createLucideIcon("check", __iconNode$w);
60099
60154
  /**
60100
60155
  * @license lucide-react v0.575.0 - ISC
60101
60156
  *
60102
60157
  * This source code is licensed under the ISC license.
60103
60158
  * See the LICENSE file in the root directory of this source tree.
60104
60159
  */
60105
- const __iconNode$m = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
60106
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$m);
60160
+ const __iconNode$v = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
60161
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$v);
60107
60162
  /**
60108
60163
  * @license lucide-react v0.575.0 - ISC
60109
60164
  *
60110
60165
  * This source code is licensed under the ISC license.
60111
60166
  * See the LICENSE file in the root directory of this source tree.
60112
60167
  */
60113
- const __iconNode$l = [
60168
+ const __iconNode$u = [
60114
60169
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60115
60170
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
60116
60171
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
60117
60172
  ];
60118
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$l);
60173
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$u);
60119
60174
  /**
60120
60175
  * @license lucide-react v0.575.0 - ISC
60121
60176
  *
60122
60177
  * This source code is licensed under the ISC license.
60123
60178
  * See the LICENSE file in the root directory of this source tree.
60124
60179
  */
60125
- const __iconNode$k = [
60180
+ const __iconNode$t = [
60126
60181
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60127
60182
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
60128
60183
  ];
60129
- const CircleCheck = createLucideIcon("circle-check", __iconNode$k);
60184
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$t);
60130
60185
  /**
60131
60186
  * @license lucide-react v0.575.0 - ISC
60132
60187
  *
60133
60188
  * This source code is licensed under the ISC license.
60134
60189
  * See the LICENSE file in the root directory of this source tree.
60135
60190
  */
60136
- const __iconNode$j = [
60191
+ const __iconNode$s = [
60137
60192
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60138
60193
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
60139
60194
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
60140
60195
  ];
60141
- const CircleX = createLucideIcon("circle-x", __iconNode$j);
60196
+ const CircleX = createLucideIcon("circle-x", __iconNode$s);
60142
60197
  /**
60143
60198
  * @license lucide-react v0.575.0 - ISC
60144
60199
  *
60145
60200
  * This source code is licensed under the ISC license.
60146
60201
  * See the LICENSE file in the root directory of this source tree.
60147
60202
  */
60148
- const __iconNode$i = [
60203
+ const __iconNode$r = [
60149
60204
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
60150
60205
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
60151
60206
  ];
60152
- const Code = createLucideIcon("code", __iconNode$i);
60207
+ const Code = createLucideIcon("code", __iconNode$r);
60153
60208
  /**
60154
60209
  * @license lucide-react v0.575.0 - ISC
60155
60210
  *
60156
60211
  * This source code is licensed under the ISC license.
60157
60212
  * See the LICENSE file in the root directory of this source tree.
60158
60213
  */
60159
- const __iconNode$h = [
60214
+ const __iconNode$q = [
60160
60215
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
60161
60216
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
60162
60217
  ];
60163
- const Copy = createLucideIcon("copy", __iconNode$h);
60218
+ const Copy = createLucideIcon("copy", __iconNode$q);
60164
60219
  /**
60165
60220
  * @license lucide-react v0.575.0 - ISC
60166
60221
  *
60167
60222
  * This source code is licensed under the ISC license.
60168
60223
  * See the LICENSE file in the root directory of this source tree.
60169
60224
  */
60170
- const __iconNode$g = [
60225
+ const __iconNode$p = [
60171
60226
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
60172
60227
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60173
60228
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
60174
60229
  ];
60175
- const Database = createLucideIcon("database", __iconNode$g);
60230
+ const Database = createLucideIcon("database", __iconNode$p);
60176
60231
  /**
60177
60232
  * @license lucide-react v0.575.0 - ISC
60178
60233
  *
60179
60234
  * This source code is licensed under the ISC license.
60180
60235
  * See the LICENSE file in the root directory of this source tree.
60181
60236
  */
60182
- const __iconNode$f = [
60237
+ const __iconNode$o = [
60183
60238
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
60184
60239
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
60185
60240
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
60186
60241
  ];
60187
- const Download = createLucideIcon("download", __iconNode$f);
60242
+ const Download = createLucideIcon("download", __iconNode$o);
60188
60243
  /**
60189
60244
  * @license lucide-react v0.575.0 - ISC
60190
60245
  *
60191
60246
  * This source code is licensed under the ISC license.
60192
60247
  * See the LICENSE file in the root directory of this source tree.
60193
60248
  */
60194
- const __iconNode$e = [
60249
+ const __iconNode$n = [
60195
60250
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
60196
60251
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
60197
60252
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
60198
60253
  ];
60199
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$e);
60254
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$n);
60200
60255
  /**
60201
60256
  * @license lucide-react v0.575.0 - ISC
60202
60257
  *
60203
60258
  * This source code is licensed under the ISC license.
60204
60259
  * See the LICENSE file in the root directory of this source tree.
60205
60260
  */
60206
- const __iconNode$d = [
60261
+ const __iconNode$m = [
60207
60262
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
60208
60263
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
60209
60264
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
60210
60265
  ];
60211
- const ExternalLink = createLucideIcon("external-link", __iconNode$d);
60266
+ const ExternalLink = createLucideIcon("external-link", __iconNode$m);
60212
60267
  /**
60213
60268
  * @license lucide-react v0.575.0 - ISC
60214
60269
  *
60215
60270
  * This source code is licensed under the ISC license.
60216
60271
  * See the LICENSE file in the root directory of this source tree.
60217
60272
  */
60218
- const __iconNode$c = [
60273
+ const __iconNode$l = [
60219
60274
  [
60220
60275
  "path",
60221
60276
  {
@@ -60227,14 +60282,35 @@ const __iconNode$c = [
60227
60282
  ["path", { d: "M9 15h6", key: "cctwl0" }],
60228
60283
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
60229
60284
  ];
60230
- const FilePlus = createLucideIcon("file-plus", __iconNode$c);
60285
+ const FilePlus = createLucideIcon("file-plus", __iconNode$l);
60231
60286
  /**
60232
60287
  * @license lucide-react v0.575.0 - ISC
60233
60288
  *
60234
60289
  * This source code is licensed under the ISC license.
60235
60290
  * See the LICENSE file in the root directory of this source tree.
60236
60291
  */
60237
- const __iconNode$b = [
60292
+ const __iconNode$k = [
60293
+ [
60294
+ "path",
60295
+ {
60296
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
60297
+ key: "1oefj6"
60298
+ }
60299
+ ],
60300
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
60301
+ ["path", { d: "M8 13h2", key: "yr2amv" }],
60302
+ ["path", { d: "M14 13h2", key: "un5t4a" }],
60303
+ ["path", { d: "M8 17h2", key: "2yhykz" }],
60304
+ ["path", { d: "M14 17h2", key: "10kma7" }]
60305
+ ];
60306
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$k);
60307
+ /**
60308
+ * @license lucide-react v0.575.0 - ISC
60309
+ *
60310
+ * This source code is licensed under the ISC license.
60311
+ * See the LICENSE file in the root directory of this source tree.
60312
+ */
60313
+ const __iconNode$j = [
60238
60314
  [
60239
60315
  "path",
60240
60316
  {
@@ -60247,26 +60323,94 @@ const __iconNode$b = [
60247
60323
  ["path", { d: "M16 13H8", key: "t4e002" }],
60248
60324
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
60249
60325
  ];
60250
- const FileText = createLucideIcon("file-text", __iconNode$b);
60326
+ const FileText = createLucideIcon("file-text", __iconNode$j);
60251
60327
  /**
60252
60328
  * @license lucide-react v0.575.0 - ISC
60253
60329
  *
60254
60330
  * This source code is licensed under the ISC license.
60255
60331
  * See the LICENSE file in the root directory of this source tree.
60256
60332
  */
60257
- const __iconNode$a = [
60333
+ const __iconNode$i = [
60334
+ [
60335
+ "path",
60336
+ {
60337
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
60338
+ key: "1oefj6"
60339
+ }
60340
+ ],
60341
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
60342
+ ];
60343
+ const File$1 = createLucideIcon("file", __iconNode$i);
60344
+ /**
60345
+ * @license lucide-react v0.575.0 - ISC
60346
+ *
60347
+ * This source code is licensed under the ISC license.
60348
+ * See the LICENSE file in the root directory of this source tree.
60349
+ */
60350
+ const __iconNode$h = [
60258
60351
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60259
60352
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
60260
60353
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
60261
60354
  ];
60262
- const Globe = createLucideIcon("globe", __iconNode$a);
60355
+ const Globe = createLucideIcon("globe", __iconNode$h);
60263
60356
  /**
60264
60357
  * @license lucide-react v0.575.0 - ISC
60265
60358
  *
60266
60359
  * This source code is licensed under the ISC license.
60267
60360
  * See the LICENSE file in the root directory of this source tree.
60268
60361
  */
60269
- const __iconNode$9 = [
60362
+ const __iconNode$g = [
60363
+ [
60364
+ "path",
60365
+ {
60366
+ d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
60367
+ key: "zw3jo"
60368
+ }
60369
+ ],
60370
+ [
60371
+ "path",
60372
+ {
60373
+ d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
60374
+ key: "1wduqc"
60375
+ }
60376
+ ],
60377
+ [
60378
+ "path",
60379
+ {
60380
+ d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
60381
+ key: "kqbvx6"
60382
+ }
60383
+ ]
60384
+ ];
60385
+ const Layers = createLucideIcon("layers", __iconNode$g);
60386
+ /**
60387
+ * @license lucide-react v0.575.0 - ISC
60388
+ *
60389
+ * This source code is licensed under the ISC license.
60390
+ * See the LICENSE file in the root directory of this source tree.
60391
+ */
60392
+ const __iconNode$f = [
60393
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
60394
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
60395
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
60396
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
60397
+ ];
60398
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$f);
60399
+ /**
60400
+ * @license lucide-react v0.575.0 - ISC
60401
+ *
60402
+ * This source code is licensed under the ISC license.
60403
+ * See the LICENSE file in the root directory of this source tree.
60404
+ */
60405
+ const __iconNode$e = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
60406
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$e);
60407
+ /**
60408
+ * @license lucide-react v0.575.0 - ISC
60409
+ *
60410
+ * This source code is licensed under the ISC license.
60411
+ * See the LICENSE file in the root directory of this source tree.
60412
+ */
60413
+ const __iconNode$d = [
60270
60414
  ["path", { d: "M12 2v4", key: "3427ic" }],
60271
60415
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
60272
60416
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
@@ -60276,37 +60420,63 @@ const __iconNode$9 = [
60276
60420
  ["path", { d: "M2 12h4", key: "j09sii" }],
60277
60421
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
60278
60422
  ];
60279
- const Loader = createLucideIcon("loader", __iconNode$9);
60423
+ const Loader = createLucideIcon("loader", __iconNode$d);
60280
60424
  /**
60281
60425
  * @license lucide-react v0.575.0 - ISC
60282
60426
  *
60283
60427
  * This source code is licensed under the ISC license.
60284
60428
  * See the LICENSE file in the root directory of this source tree.
60285
60429
  */
60286
- const __iconNode$8 = [
60430
+ const __iconNode$c = [
60287
60431
  ["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
60288
60432
  ["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
60289
60433
  ];
60290
- const Mail = createLucideIcon("mail", __iconNode$8);
60434
+ const Mail = createLucideIcon("mail", __iconNode$c);
60291
60435
  /**
60292
60436
  * @license lucide-react v0.575.0 - ISC
60293
60437
  *
60294
60438
  * This source code is licensed under the ISC license.
60295
60439
  * See the LICENSE file in the root directory of this source tree.
60296
60440
  */
60297
- const __iconNode$7 = [
60441
+ const __iconNode$b = [
60442
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
60443
+ ["path", { d: "m21 3-7 7", key: "1l2asr" }],
60444
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
60445
+ ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
60446
+ ];
60447
+ const Maximize2 = createLucideIcon("maximize-2", __iconNode$b);
60448
+ /**
60449
+ * @license lucide-react v0.575.0 - ISC
60450
+ *
60451
+ * This source code is licensed under the ISC license.
60452
+ * See the LICENSE file in the root directory of this source tree.
60453
+ */
60454
+ const __iconNode$a = [
60455
+ ["path", { d: "m14 10 7-7", key: "oa77jy" }],
60456
+ ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
60457
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
60458
+ ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
60459
+ ];
60460
+ const Minimize2 = createLucideIcon("minimize-2", __iconNode$a);
60461
+ /**
60462
+ * @license lucide-react v0.575.0 - ISC
60463
+ *
60464
+ * This source code is licensed under the ISC license.
60465
+ * See the LICENSE file in the root directory of this source tree.
60466
+ */
60467
+ const __iconNode$9 = [
60298
60468
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
60299
60469
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
60300
60470
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
60301
60471
  ];
60302
- const Monitor = createLucideIcon("monitor", __iconNode$7);
60472
+ const Monitor = createLucideIcon("monitor", __iconNode$9);
60303
60473
  /**
60304
60474
  * @license lucide-react v0.575.0 - ISC
60305
60475
  *
60306
60476
  * This source code is licensed under the ISC license.
60307
60477
  * See the LICENSE file in the root directory of this source tree.
60308
60478
  */
60309
- const __iconNode$6 = [
60479
+ const __iconNode$8 = [
60310
60480
  ["path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", key: "re6nr2" }],
60311
60481
  ["path", { d: "M2 6h4", key: "aawbzj" }],
60312
60482
  ["path", { d: "M2 10h4", key: "l0bgd4" }],
@@ -60320,14 +60490,14 @@ const __iconNode$6 = [
60320
60490
  }
60321
60491
  ]
60322
60492
  ];
60323
- const NotebookPen = createLucideIcon("notebook-pen", __iconNode$6);
60493
+ const NotebookPen = createLucideIcon("notebook-pen", __iconNode$8);
60324
60494
  /**
60325
60495
  * @license lucide-react v0.575.0 - ISC
60326
60496
  *
60327
60497
  * This source code is licensed under the ISC license.
60328
60498
  * See the LICENSE file in the root directory of this source tree.
60329
60499
  */
60330
- const __iconNode$5 = [
60500
+ const __iconNode$7 = [
60331
60501
  ["path", { d: "M13 21h8", key: "1jsn5i" }],
60332
60502
  [
60333
60503
  "path",
@@ -60337,38 +60507,50 @@ const __iconNode$5 = [
60337
60507
  }
60338
60508
  ]
60339
60509
  ];
60340
- const PenLine = createLucideIcon("pen-line", __iconNode$5);
60510
+ const PenLine = createLucideIcon("pen-line", __iconNode$7);
60341
60511
  /**
60342
60512
  * @license lucide-react v0.575.0 - ISC
60343
60513
  *
60344
60514
  * This source code is licensed under the ISC license.
60345
60515
  * See the LICENSE file in the root directory of this source tree.
60346
60516
  */
60347
- const __iconNode$4 = [
60517
+ const __iconNode$6 = [
60518
+ ["path", { d: "M2 3h20", key: "91anmk" }],
60519
+ ["path", { d: "M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3", key: "2k9sn8" }],
60520
+ ["path", { d: "m7 21 5-5 5 5", key: "bip4we" }]
60521
+ ];
60522
+ const Presentation = createLucideIcon("presentation", __iconNode$6);
60523
+ /**
60524
+ * @license lucide-react v0.575.0 - ISC
60525
+ *
60526
+ * This source code is licensed under the ISC license.
60527
+ * See the LICENSE file in the root directory of this source tree.
60528
+ */
60529
+ const __iconNode$5 = [
60348
60530
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
60349
60531
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
60350
60532
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
60351
60533
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
60352
60534
  ];
60353
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$4);
60535
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$5);
60354
60536
  /**
60355
60537
  * @license lucide-react v0.575.0 - ISC
60356
60538
  *
60357
60539
  * This source code is licensed under the ISC license.
60358
60540
  * See the LICENSE file in the root directory of this source tree.
60359
60541
  */
60360
- const __iconNode$3 = [
60542
+ const __iconNode$4 = [
60361
60543
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
60362
60544
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
60363
60545
  ];
60364
- const Search = createLucideIcon("search", __iconNode$3);
60546
+ const Search = createLucideIcon("search", __iconNode$4);
60365
60547
  /**
60366
60548
  * @license lucide-react v0.575.0 - ISC
60367
60549
  *
60368
60550
  * This source code is licensed under the ISC license.
60369
60551
  * See the LICENSE file in the root directory of this source tree.
60370
60552
  */
60371
- const __iconNode$2 = [
60553
+ const __iconNode$3 = [
60372
60554
  [
60373
60555
  "path",
60374
60556
  {
@@ -60378,24 +60560,24 @@ const __iconNode$2 = [
60378
60560
  ],
60379
60561
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
60380
60562
  ];
60381
- const Settings = createLucideIcon("settings", __iconNode$2);
60563
+ const Settings = createLucideIcon("settings", __iconNode$3);
60382
60564
  /**
60383
60565
  * @license lucide-react v0.575.0 - ISC
60384
60566
  *
60385
60567
  * This source code is licensed under the ISC license.
60386
60568
  * See the LICENSE file in the root directory of this source tree.
60387
60569
  */
60388
- const __iconNode$1 = [
60570
+ const __iconNode$2 = [
60389
60571
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
60390
60572
  ];
60391
- const Square = createLucideIcon("square", __iconNode$1);
60573
+ const Square = createLucideIcon("square", __iconNode$2);
60392
60574
  /**
60393
60575
  * @license lucide-react v0.575.0 - ISC
60394
60576
  *
60395
60577
  * This source code is licensed under the ISC license.
60396
60578
  * See the LICENSE file in the root directory of this source tree.
60397
60579
  */
60398
- const __iconNode = [
60580
+ const __iconNode$1 = [
60399
60581
  [
60400
60582
  "path",
60401
60583
  {
@@ -60404,7 +60586,18 @@ const __iconNode = [
60404
60586
  }
60405
60587
  ]
60406
60588
  ];
60407
- const Wrench = createLucideIcon("wrench", __iconNode);
60589
+ const Wrench = createLucideIcon("wrench", __iconNode$1);
60590
+ /**
60591
+ * @license lucide-react v0.575.0 - ISC
60592
+ *
60593
+ * This source code is licensed under the ISC license.
60594
+ * See the LICENSE file in the root directory of this source tree.
60595
+ */
60596
+ const __iconNode = [
60597
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
60598
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
60599
+ ];
60600
+ const X = createLucideIcon("x", __iconNode);
60408
60601
  function Collapsible({ ...props }) {
60409
60602
  return /* @__PURE__ */ jsxRuntime.jsx(Root$2, { "data-slot": "collapsible", ...props });
60410
60603
  }
@@ -60414,37 +60607,94 @@ function CollapsibleTrigger({ ...props }) {
60414
60607
  function CollapsibleContent({ ...props }) {
60415
60608
  return /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent$1, { "data-slot": "collapsible-content", ...props });
60416
60609
  }
60610
+ const useAssetPanelStore = create((set2, get2) => ({
60611
+ isOpen: false,
60612
+ tabs: [],
60613
+ activeTabId: null,
60614
+ viewMode: "tabs",
60615
+ isFullscreen: false,
60616
+ autoOpenGeneration: 0,
60617
+ autoOpenedAssets: /* @__PURE__ */ new Map(),
60618
+ openAsset: (assetId, meta) => set2((s) => {
60619
+ const existing = s.tabs.find((t) => t.id === assetId);
60620
+ if (existing) {
60621
+ const tabs = meta ? s.tabs.map(
60622
+ (t) => t.id === assetId ? { ...t, name: meta.name ?? t.name, type: meta.type ?? t.type } : t
60623
+ ) : s.tabs;
60624
+ return { isOpen: true, tabs, activeTabId: assetId };
60625
+ }
60626
+ const newTab = {
60627
+ id: assetId,
60628
+ name: (meta == null ? void 0 : meta.name) ?? null,
60629
+ type: (meta == null ? void 0 : meta.type) ?? "unknown"
60630
+ };
60631
+ return { isOpen: true, tabs: [...s.tabs, newTab], activeTabId: assetId };
60632
+ }),
60633
+ closeTab: (assetId) => set2((s) => {
60634
+ var _a2;
60635
+ const tabs = s.tabs.filter((t) => t.id !== assetId);
60636
+ if (tabs.length === 0) {
60637
+ return { isOpen: false, tabs: [], activeTabId: null, isFullscreen: false };
60638
+ }
60639
+ const activeTabId = s.activeTabId === assetId ? ((_a2 = tabs[Math.min(s.tabs.findIndex((t) => t.id === assetId), tabs.length - 1)]) == null ? void 0 : _a2.id) ?? null : s.activeTabId;
60640
+ return { tabs, activeTabId };
60641
+ }),
60642
+ setActiveTab: (assetId) => set2({ activeTabId: assetId, viewMode: "tabs" }),
60643
+ setViewMode: (mode) => set2({ viewMode: mode }),
60644
+ closePanel: () => set2({ isOpen: false, tabs: [], activeTabId: null, viewMode: "tabs", isFullscreen: false }),
60645
+ toggleFullscreen: () => set2((s) => ({ isFullscreen: !s.isFullscreen })),
60646
+ resetAutoOpen: () => set2((s) => ({ autoOpenGeneration: s.autoOpenGeneration + 1 })),
60647
+ markAutoOpened: (assetId) => {
60648
+ const state = get2();
60649
+ if (state.autoOpenedAssets.get(assetId) === state.autoOpenGeneration) {
60650
+ return false;
60651
+ }
60652
+ state.autoOpenedAssets.set(assetId, state.autoOpenGeneration);
60653
+ return true;
60654
+ }
60655
+ }));
60417
60656
  const ANIMATION_DURATION = 200;
60418
60657
  const TOOL_META = {
60419
- search: { displayName: "Web Search", icon: Search, describer: (a) => a.query ? `"${a.query}"` : "" },
60420
- browse: { displayName: "Browse Page", icon: Globe, describer: (a) => a.url ?? "" },
60421
- search_email: { displayName: "Email Search", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60422
- unified_email_search: { displayName: "Email Search", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60423
- create_email_draft: { displayName: "Create Email Draft", icon: Mail },
60424
- unified_email_create_draft: { displayName: "Create Email Draft", icon: Mail },
60425
- edit_email_draft: { displayName: "Edit Email Draft", icon: Mail },
60426
- unified_edit_email_draft: { displayName: "Edit Email Draft", icon: Mail },
60427
- search_contacts: { displayName: "Search Contacts", icon: Search },
60428
- search_calendar_events: { displayName: "Search Calendar", icon: Search },
60429
- read_full_asset: { displayName: "Read Asset", icon: BookOpen },
60430
- create_new_document: { displayName: "Create Document", icon: FileText },
60431
- create_document_from_markdown: { displayName: "Create Document", icon: FileText },
60432
- append_markdown_to_athena_document: { displayName: "Write to Document", icon: PenLine },
60433
- replace_markdown_in_athena_document: { displayName: "Update Document", icon: PenLine },
60434
- create_new_sheet: { displayName: "Create Spreadsheet", icon: ChartColumn },
60435
- update_sheet_range: { displayName: "Update Spreadsheet", icon: ChartColumn },
60436
- run_python_code: { displayName: "Run Python", icon: Code },
60437
- run_sql_query_tool: { displayName: "Run SQL Query", icon: Database },
60438
- create_database: { displayName: "Create Database", icon: Database },
60439
- run_database_sql: { displayName: "Run Database Query", icon: Database },
60440
- computer_asset_exec: { displayName: "Run Command", icon: Monitor },
60441
- create_new_notebook: { displayName: "Create Notebook", icon: BookOpen },
60442
- execute_cell: { displayName: "Execute Cell", icon: Code },
60443
- create_new_aop: { displayName: "Create AOP", icon: Brain },
60444
- execute_aop: { displayName: "Execute AOP", icon: Brain },
60445
- list_contents: { displayName: "List Files", icon: Search },
60446
- search_assets: { displayName: "Search Assets", icon: Search },
60447
- save_preference_as_memory: { displayName: "Save Preference", icon: Settings }
60658
+ // Search & Browse
60659
+ search: { displayName: "Searching the web", icon: Search, describer: (a) => a.query ? `"${a.query}"` : "" },
60660
+ browse: { displayName: "Reading webpage", icon: Globe, describer: (a) => a.url ?? "" },
60661
+ search_email: { displayName: "Searching emails", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60662
+ unified_email_search: { displayName: "Searching emails", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60663
+ search_contacts: { displayName: "Looking up contacts", icon: Search },
60664
+ search_calendar_events: { displayName: "Checking calendar", icon: Search },
60665
+ search_assets: { displayName: "Searching files", icon: Search },
60666
+ list_contents: { displayName: "Browsing files", icon: Search },
60667
+ // Email
60668
+ create_email_draft: { displayName: "Drafting email", icon: Mail },
60669
+ unified_email_create_draft: { displayName: "Drafting email", icon: Mail },
60670
+ edit_email_draft: { displayName: "Editing email draft", icon: Mail },
60671
+ unified_edit_email_draft: { displayName: "Editing email draft", icon: Mail },
60672
+ // Documents
60673
+ read_full_asset: { displayName: "Reading document", icon: BookOpen },
60674
+ create_new_document: { displayName: "Creating document", icon: FileText },
60675
+ create_document_from_markdown: { displayName: "Creating document", icon: FileText },
60676
+ append_markdown_to_athena_document: { displayName: "Updating document", icon: PenLine },
60677
+ replace_markdown_in_athena_document: { displayName: "Updating document", icon: PenLine },
60678
+ // Spreadsheets
60679
+ create_new_sheet: { displayName: "Creating spreadsheet", icon: ChartColumn },
60680
+ update_sheet_range: { displayName: "Updating spreadsheet", icon: ChartColumn },
60681
+ // Presentations
60682
+ create_powerpoint_deck: { displayName: "Building presentation", icon: Monitor },
60683
+ execute_presentation_code: { displayName: "Generating slides", icon: Monitor },
60684
+ // Code & Data
60685
+ run_python_code: { displayName: "Running analysis", icon: Code },
60686
+ run_sql_query_tool: { displayName: "Querying data", icon: Database },
60687
+ create_database: { displayName: "Setting up database", icon: Database },
60688
+ run_database_sql: { displayName: "Querying database", icon: Database },
60689
+ computer_asset_exec: { displayName: "Running command", icon: Monitor },
60690
+ // Notebooks
60691
+ create_new_notebook: { displayName: "Creating notebook", icon: BookOpen },
60692
+ execute_cell: { displayName: "Running notebook cell", icon: Code },
60693
+ // Workflows
60694
+ create_new_aop: { displayName: "Creating workflow", icon: Brain },
60695
+ execute_aop: { displayName: "Running workflow", icon: Brain },
60696
+ // Preferences
60697
+ save_preference_as_memory: { displayName: "Saving preference", icon: Settings }
60448
60698
  };
60449
60699
  function getToolMeta(toolName) {
60450
60700
  if (TOOL_META[toolName]) return TOOL_META[toolName];
@@ -60481,6 +60731,59 @@ function isResultSuccess(result) {
60481
60731
  }
60482
60732
  return false;
60483
60733
  }
60734
+ function extractAssetId$1(result) {
60735
+ if (!result) return null;
60736
+ try {
60737
+ const obj = typeof result === "string" ? JSON.parse(result) : result;
60738
+ if (typeof obj === "object" && obj !== null) {
60739
+ const id = obj.asset_id ?? obj.assetId ?? obj.id;
60740
+ if (typeof id === "string" && id.startsWith("asset_")) return id;
60741
+ }
60742
+ } catch {
60743
+ }
60744
+ return null;
60745
+ }
60746
+ function toolMetaToAssetType(toolName) {
60747
+ const lower = toolName.toLowerCase();
60748
+ if (lower.includes("presentation") || lower.includes("pptx") || lower.includes("slide") || lower.includes("powerpoint"))
60749
+ return "presentation";
60750
+ if (lower.includes("sheet") || lower.includes("spreadsheet"))
60751
+ return "spreadsheet";
60752
+ if (lower.includes("document") || lower.includes("doc") || lower.includes("markdown"))
60753
+ return "document";
60754
+ return "unknown";
60755
+ }
60756
+ const CREATE_ASSET_TOOLS = [
60757
+ "create_powerpoint_deck",
60758
+ "create_document_from_markdown",
60759
+ "create_new_document",
60760
+ "create_new_sheet"
60761
+ ];
60762
+ function isAssetTool(toolName, result) {
60763
+ return CREATE_ASSET_TOOLS.includes(toolName.toLowerCase()) || extractAssetId$1(result) !== null;
60764
+ }
60765
+ function extractTitle(argsText, result) {
60766
+ if (argsText) {
60767
+ const args = tryParseJson$2(argsText);
60768
+ if (args) {
60769
+ const t = args.title ?? args.name ?? args.filename ?? args.sheet_name;
60770
+ if (t) return t;
60771
+ }
60772
+ }
60773
+ if (result) {
60774
+ try {
60775
+ const obj = typeof result === "string" ? JSON.parse(result) : result;
60776
+ if (typeof obj === "object" && obj !== null) {
60777
+ return obj.title ?? obj.name;
60778
+ }
60779
+ } catch {
60780
+ }
60781
+ }
60782
+ return null;
60783
+ }
60784
+ function clearAutoOpenedAssets() {
60785
+ useAssetPanelStore.getState().resetAutoOpen();
60786
+ }
60484
60787
  function ToolFallbackRoot({
60485
60788
  className,
60486
60789
  open: controlledOpen,
@@ -60514,7 +60817,7 @@ function ToolFallbackRoot({
60514
60817
  open: isOpen,
60515
60818
  onOpenChange: handleOpenChange,
60516
60819
  className: cn(
60517
- "aui-tool-fallback-root group/tool-fallback-root w-full rounded-xl border border-border/60 bg-background py-2.5 shadow-sm",
60820
+ "aui-tool-fallback-root group/tool-fallback-root my-3 w-full rounded-xl border border-border/60 bg-background py-2.5 shadow-sm",
60518
60821
  className
60519
60822
  ),
60520
60823
  style: {
@@ -60546,7 +60849,7 @@ function ToolFallbackTrigger({
60546
60849
  if (!parsed) return null;
60547
60850
  const desc = meta.describer(parsed);
60548
60851
  return desc || null;
60549
- }, [toolName, argsText, isRunning, meta]);
60852
+ }, [toolName, argsText, isRunning]);
60550
60853
  const resultMessage = React.useMemo(() => {
60551
60854
  if (!isComplete) return null;
60552
60855
  return extractResultMessage(result);
@@ -60585,16 +60888,16 @@ function ToolFallbackTrigger({
60585
60888
  ),
60586
60889
  children: [
60587
60890
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: isRunning ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
60588
- /* @__PURE__ */ jsxRuntime.jsx("b", { children: meta.displayName }),
60891
+ meta.displayName,
60589
60892
  "..."
60590
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("b", { children: meta.displayName }) }),
60893
+ ] }) : meta.displayName }),
60591
60894
  isRunning && /* @__PURE__ */ jsxRuntime.jsxs(
60592
60895
  "span",
60593
60896
  {
60594
60897
  "aria-hidden": true,
60595
60898
  className: "shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none",
60596
60899
  children: [
60597
- /* @__PURE__ */ jsxRuntime.jsx("b", { children: meta.displayName }),
60900
+ meta.displayName,
60598
60901
  "..."
60599
60902
  ]
60600
60903
  }
@@ -60710,6 +61013,99 @@ function ToolFallbackError({
60710
61013
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-destructive/80", children: errorText })
60711
61014
  ] });
60712
61015
  }
61016
+ function AssetToolCard({
61017
+ toolName,
61018
+ argsText,
61019
+ result,
61020
+ status
61021
+ }) {
61022
+ const [detailsOpen, setDetailsOpen] = React.useState(false);
61023
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
61024
+ const meta = getToolMeta(toolName);
61025
+ const ToolIcon = meta.icon;
61026
+ const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
61027
+ const isRunning = (status == null ? void 0 : status.type) === "running";
61028
+ const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
61029
+ const assetId = extractAssetId$1(result);
61030
+ const title = extractTitle(argsText, result);
61031
+ const assetType = toolMetaToAssetType(toolName);
61032
+ const wasCompleteAtMount = React.useRef(isComplete);
61033
+ React.useEffect(() => {
61034
+ if (isComplete && !isCancelled && assetId && !wasCompleteAtMount.current) {
61035
+ const store = useAssetPanelStore.getState();
61036
+ if (store.markAutoOpened(assetId)) {
61037
+ store.openAsset(assetId, {
61038
+ name: title ?? void 0,
61039
+ type: assetType
61040
+ });
61041
+ }
61042
+ }
61043
+ }, [isComplete, isCancelled, assetId, title, assetType]);
61044
+ const success = isComplete && isResultSuccess(result);
61045
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
61046
+ "aui-tool-fallback-root my-3 w-full rounded-xl border border-border/60 bg-background py-2.5 shadow-sm",
61047
+ isCancelled && "border-muted-foreground/30 bg-muted/30"
61048
+ ), children: [
61049
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5 px-3 text-sm", children: [
61050
+ /* @__PURE__ */ jsxRuntime.jsx(
61051
+ "div",
61052
+ {
61053
+ className: cn(
61054
+ "flex size-7 shrink-0 items-center justify-center rounded-lg",
61055
+ isRunning && "bg-blue-50 text-blue-600",
61056
+ isComplete && success && "bg-emerald-50 text-emerald-600",
61057
+ isComplete && !success && "bg-muted text-muted-foreground"
61058
+ ),
61059
+ children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(Loader, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(ToolIcon, { className: "size-3.5" })
61060
+ }
61061
+ ),
61062
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 grow flex-col items-start gap-0.5 text-left", children: [
61063
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "leading-tight font-medium", children: [
61064
+ meta.displayName,
61065
+ isRunning && "..."
61066
+ ] }),
61067
+ !isRunning && title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-full truncate text-xs leading-snug text-muted-foreground", children: title })
61068
+ ] }),
61069
+ assetId && isComplete && !isCancelled && CREATE_ASSET_TOOLS.includes(toolName.toLowerCase()) && /* @__PURE__ */ jsxRuntime.jsxs(
61070
+ "button",
61071
+ {
61072
+ onClick: () => openAsset(assetId, { name: title ?? void 0, type: assetType }),
61073
+ className: "flex shrink-0 items-center gap-1 rounded-md border border-border/60 px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
61074
+ children: [
61075
+ /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { className: "size-2.5" }),
61076
+ "Open"
61077
+ ]
61078
+ }
61079
+ ),
61080
+ isComplete && success && /* @__PURE__ */ jsxRuntime.jsx(CircleCheck, { className: "size-3.5 shrink-0 text-emerald-500" }),
61081
+ !isCancelled && /* @__PURE__ */ jsxRuntime.jsx(
61082
+ "button",
61083
+ {
61084
+ onClick: () => setDetailsOpen((o) => !o),
61085
+ className: cn(
61086
+ "flex size-5 shrink-0 items-center justify-center rounded transition-all",
61087
+ detailsOpen ? "bg-primary/5 text-primary" : "text-muted-foreground/40 hover:bg-muted/50 hover:text-muted-foreground"
61088
+ ),
61089
+ title: "Show details",
61090
+ children: /* @__PURE__ */ jsxRuntime.jsx(
61091
+ ChevronDown,
61092
+ {
61093
+ className: cn(
61094
+ "size-3 transition-transform duration-200",
61095
+ detailsOpen && "rotate-180"
61096
+ )
61097
+ }
61098
+ )
61099
+ }
61100
+ )
61101
+ ] }),
61102
+ (status == null ? void 0 : status.type) === "incomplete" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(ToolFallbackError, { status }) }),
61103
+ detailsOpen && !isCancelled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2.5 flex flex-col gap-2 border-t border-border/50 px-3 pt-2", children: [
61104
+ /* @__PURE__ */ jsxRuntime.jsx(ToolFallbackArgs, { argsText }),
61105
+ /* @__PURE__ */ jsxRuntime.jsx(ToolFallbackResult, { result })
61106
+ ] })
61107
+ ] });
61108
+ }
60713
61109
  const ToolFallbackImpl = ({
60714
61110
  toolName,
60715
61111
  argsText,
@@ -60717,6 +61113,17 @@ const ToolFallbackImpl = ({
60717
61113
  status
60718
61114
  }) => {
60719
61115
  const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
61116
+ if (isAssetTool(toolName, result)) {
61117
+ return /* @__PURE__ */ jsxRuntime.jsx(
61118
+ AssetToolCard,
61119
+ {
61120
+ toolName,
61121
+ argsText,
61122
+ result,
61123
+ status
61124
+ }
61125
+ );
61126
+ }
60720
61127
  return /* @__PURE__ */ jsxRuntime.jsxs(
60721
61128
  ToolFallbackRoot,
60722
61129
  {
@@ -61081,11 +61488,15 @@ function normalizeResult(result) {
61081
61488
  function truncate(text2, max2) {
61082
61489
  return text2.length > max2 ? `${text2.slice(0, max2)}...` : text2;
61083
61490
  }
61491
+ function formatToolName(name) {
61492
+ return name.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
61493
+ }
61084
61494
  function ToolCard({
61085
61495
  icon: Icon2,
61086
61496
  status,
61087
61497
  title,
61088
61498
  subtitle,
61499
+ toolName,
61089
61500
  badge,
61090
61501
  error: error2,
61091
61502
  children
@@ -61093,7 +61504,7 @@ function ToolCard({
61093
61504
  const isRunning = status === "running";
61094
61505
  const isComplete = status === "complete";
61095
61506
  const isError = status === "incomplete";
61096
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-1.5 w-full overflow-hidden rounded-xl border border-border/60 bg-background shadow-sm", children: [
61507
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 w-full overflow-hidden rounded-xl border border-border/60 bg-background shadow-sm", children: [
61097
61508
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 px-4 py-3", children: [
61098
61509
  /* @__PURE__ */ jsxRuntime.jsx(
61099
61510
  "div",
@@ -61109,11 +61520,12 @@ function ToolCard({
61109
61520
  ),
61110
61521
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
61111
61522
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
61112
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground", children: title }),
61523
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-medium text-foreground", children: title }),
61113
61524
  isComplete && !error2 && /* @__PURE__ */ jsxRuntime.jsx(CircleCheck, { className: "size-3.5 text-emerald-500" })
61114
61525
  ] }),
61115
61526
  subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[12px] text-muted-foreground", children: subtitle })
61116
61527
  ] }),
61528
+ toolName && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 rounded-md bg-muted/60 px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground", children: formatToolName(toolName) }),
61117
61529
  badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: badge }),
61118
61530
  isRunning && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
61119
61531
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-10 animate-pulse rounded-full bg-blue-100" }),
@@ -61167,6 +61579,7 @@ function parseSearchResults(data) {
61167
61579
  });
61168
61580
  }
61169
61581
  const WebSearchToolUIImpl = ({
61582
+ toolName,
61170
61583
  args,
61171
61584
  result,
61172
61585
  status
@@ -61185,11 +61598,12 @@ const WebSearchToolUIImpl = ({
61185
61598
  status: (status == null ? void 0 : status.type) ?? "complete",
61186
61599
  title: isRunning ? "Searching the web..." : "Web search",
61187
61600
  subtitle: query ? truncate(query, 80) : void 0,
61601
+ toolName,
61188
61602
  badge: isComplete && results.length > 0 ? `${results.length} results` : void 0,
61189
61603
  error: errorMsg,
61190
61604
  children: isComplete && results.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show search results", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2.5", children: results.map((r2, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5", children: [
61191
61605
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
61192
- r2.url ? /* @__PURE__ */ jsxRuntime.jsx(
61606
+ r2.url && /^https?:\/\//i.test(r2.url) ? /* @__PURE__ */ jsxRuntime.jsx(
61193
61607
  "a",
61194
61608
  {
61195
61609
  href: r2.url,
@@ -61198,7 +61612,7 @@ const WebSearchToolUIImpl = ({
61198
61612
  className: "text-[12px] font-medium text-blue-600 hover:underline",
61199
61613
  children: r2.title || r2.url
61200
61614
  }
61201
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] font-medium text-foreground", children: r2.title || "Result" }),
61615
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] font-medium text-foreground", children: r2.title || r2.url || "Result" }),
61202
61616
  r2.url && /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { className: "size-3 shrink-0 text-muted-foreground" })
61203
61617
  ] }),
61204
61618
  r2.url && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: truncate(r2.url, 60) }),
@@ -61212,6 +61626,7 @@ const WebSearchToolUI = React.memo(
61212
61626
  );
61213
61627
  WebSearchToolUI.displayName = "WebSearchToolUI";
61214
61628
  const BrowseToolUIImpl = ({
61629
+ toolName,
61215
61630
  args,
61216
61631
  result,
61217
61632
  status
@@ -61240,6 +61655,7 @@ const BrowseToolUIImpl = ({
61240
61655
  status: (status == null ? void 0 : status.type) ?? "complete",
61241
61656
  title: isRunning ? "Browsing page..." : pageTitle ? truncate(pageTitle, 50) : "Browsed page",
61242
61657
  subtitle: displayUrl,
61658
+ toolName,
61243
61659
  error: errorMsg,
61244
61660
  children: isComplete && pageContent && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show page content", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "whitespace-pre-wrap break-words text-[11px] leading-relaxed text-muted-foreground", children: truncate(pageContent, 3e3) }) })
61245
61661
  }
@@ -61263,6 +61679,7 @@ function parseEmailResults(data) {
61263
61679
  });
61264
61680
  }
61265
61681
  const EmailSearchToolUIImpl = ({
61682
+ toolName,
61266
61683
  args,
61267
61684
  result,
61268
61685
  status
@@ -61281,6 +61698,7 @@ const EmailSearchToolUIImpl = ({
61281
61698
  status: (status == null ? void 0 : status.type) ?? "complete",
61282
61699
  title: isRunning ? "Searching emails..." : "Email search",
61283
61700
  subtitle: query ? truncate(query, 80) : void 0,
61701
+ toolName,
61284
61702
  badge: isComplete && emails.length > 0 ? `${emails.length} emails` : void 0,
61285
61703
  error: errorMsg,
61286
61704
  children: isComplete && emails.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show email results", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: emails.map((email, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-0.5 py-2", i === 0 && "pt-0"), children: [
@@ -61298,33 +61716,124 @@ const EmailSearchToolUI = React.memo(
61298
61716
  EmailSearchToolUIImpl
61299
61717
  );
61300
61718
  EmailSearchToolUI.displayName = "EmailSearchToolUI";
61301
- const CreateDocumentToolUIImpl = ({
61719
+ function extractAssetId(result) {
61720
+ const data = normalizeResult(result);
61721
+ if (!data) return null;
61722
+ const id = data.asset_id ?? data.assetId ?? data.id;
61723
+ if (typeof id === "string" && id.startsWith("asset_")) return id;
61724
+ return null;
61725
+ }
61726
+ function resetAssetAutoOpen() {
61727
+ useAssetPanelStore.getState().resetAutoOpen();
61728
+ }
61729
+ function CreateAssetToolUIImpl({
61730
+ icon: Icon2,
61731
+ assetType,
61732
+ runningLabel,
61733
+ doneLabel,
61734
+ toolName,
61302
61735
  args,
61303
61736
  result,
61304
61737
  status
61305
- }) => {
61738
+ }) {
61306
61739
  const typedArgs = args;
61307
- const docName = (typedArgs == null ? void 0 : typedArgs.name) ?? (typedArgs == null ? void 0 : typedArgs.title) ?? (typedArgs == null ? void 0 : typedArgs.document_name) ?? "";
61740
+ const name = (typedArgs == null ? void 0 : typedArgs.name) ?? (typedArgs == null ? void 0 : typedArgs.title) ?? (typedArgs == null ? void 0 : typedArgs.document_name) ?? (typedArgs == null ? void 0 : typedArgs.sheet_name) ?? "";
61308
61741
  const data = React.useMemo(() => normalizeResult(result), [result]);
61309
61742
  const createdName = (data == null ? void 0 : data.name) ?? (data == null ? void 0 : data.title) ?? (data == null ? void 0 : data.asset_name);
61743
+ const assetId = extractAssetId(result);
61310
61744
  const isRunning = (status == null ? void 0 : status.type) === "running";
61745
+ const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
61746
+ const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
61311
61747
  const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
61748
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
61749
+ const wasCompleteAtMount = React.useRef(isComplete);
61750
+ React.useEffect(() => {
61751
+ if (isComplete && !isCancelled && assetId && !wasCompleteAtMount.current) {
61752
+ const store = useAssetPanelStore.getState();
61753
+ if (store.markAutoOpened(assetId)) {
61754
+ store.openAsset(assetId, {
61755
+ name: createdName || name || void 0,
61756
+ type: assetType
61757
+ });
61758
+ }
61759
+ }
61760
+ }, [isComplete, isCancelled, assetId, createdName, name, assetType]);
61761
+ const handleOpen = () => {
61762
+ if (assetId) {
61763
+ openAsset(assetId, {
61764
+ name: createdName || name || void 0,
61765
+ type: assetType
61766
+ });
61767
+ }
61768
+ };
61312
61769
  return /* @__PURE__ */ jsxRuntime.jsx(
61313
61770
  ToolCard,
61314
61771
  {
61315
- icon: FilePlus,
61772
+ icon: Icon2,
61316
61773
  status: (status == null ? void 0 : status.type) ?? "complete",
61317
- title: isRunning ? "Creating document..." : "Created document",
61318
- subtitle: createdName || docName || void 0,
61319
- error: errorMsg
61774
+ title: isRunning ? runningLabel : doneLabel,
61775
+ subtitle: createdName || name || void 0,
61776
+ toolName,
61777
+ error: errorMsg,
61778
+ children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
61779
+ "button",
61780
+ {
61781
+ onClick: handleOpen,
61782
+ className: "flex items-center gap-1.5 rounded-md border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
61783
+ children: [
61784
+ /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { className: "size-3" }),
61785
+ "Open ",
61786
+ assetType === "unknown" ? "asset" : assetType
61787
+ ]
61788
+ }
61789
+ ) })
61320
61790
  }
61321
61791
  );
61322
- };
61792
+ }
61793
+ const CreateDocumentToolUIImpl = (props) => /* @__PURE__ */ jsxRuntime.jsx(
61794
+ CreateAssetToolUIImpl,
61795
+ {
61796
+ icon: FilePlus,
61797
+ assetType: "document",
61798
+ runningLabel: "Creating document...",
61799
+ doneLabel: "Created document",
61800
+ ...props
61801
+ }
61802
+ );
61323
61803
  const CreateDocumentToolUI = React.memo(
61324
61804
  CreateDocumentToolUIImpl
61325
61805
  );
61326
61806
  CreateDocumentToolUI.displayName = "CreateDocumentToolUI";
61807
+ const CreateSheetToolUIImpl = (props) => /* @__PURE__ */ jsxRuntime.jsx(
61808
+ CreateAssetToolUIImpl,
61809
+ {
61810
+ icon: ChartColumn,
61811
+ assetType: "spreadsheet",
61812
+ runningLabel: "Creating spreadsheet...",
61813
+ doneLabel: "Created spreadsheet",
61814
+ ...props
61815
+ }
61816
+ );
61817
+ const CreateSheetToolUI = React.memo(
61818
+ CreateSheetToolUIImpl
61819
+ );
61820
+ CreateSheetToolUI.displayName = "CreateSheetToolUI";
61821
+ const CreatePresentationToolUIImpl = (props) => /* @__PURE__ */ jsxRuntime.jsx(
61822
+ CreateAssetToolUIImpl,
61823
+ {
61824
+ icon: Presentation,
61825
+ assetType: "presentation",
61826
+ runningLabel: "Creating presentation...",
61827
+ doneLabel: "Created presentation",
61828
+ ...props
61829
+ }
61830
+ );
61831
+ const CreatePresentationToolUI = React.memo(
61832
+ CreatePresentationToolUIImpl
61833
+ );
61834
+ CreatePresentationToolUI.displayName = "CreatePresentationToolUI";
61327
61835
  const CreateEmailDraftToolUIImpl = ({
61836
+ toolName,
61328
61837
  args,
61329
61838
  result,
61330
61839
  status
@@ -61340,6 +61849,7 @@ const CreateEmailDraftToolUIImpl = ({
61340
61849
  icon: Mail,
61341
61850
  status: (status == null ? void 0 : status.type) ?? "complete",
61342
61851
  title: isRunning ? "Creating email draft..." : "Email draft created",
61852
+ toolName,
61343
61853
  subtitle: subject ? truncate(subject, 60) : to ? `To: ${truncate(to, 40)}` : void 0,
61344
61854
  error: errorMsg
61345
61855
  }
@@ -61357,7 +61867,9 @@ const TOOL_UI_REGISTRY = {
61357
61867
  create_email_draft: CreateEmailDraftToolUI,
61358
61868
  unified_email_create_draft: CreateEmailDraftToolUI,
61359
61869
  create_new_document: CreateDocumentToolUI,
61360
- create_document_from_markdown: CreateDocumentToolUI
61870
+ create_document_from_markdown: CreateDocumentToolUI,
61871
+ create_new_sheet: CreateSheetToolUI,
61872
+ create_powerpoint_deck: CreatePresentationToolUI
61361
61873
  };
61362
61874
  const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
61363
61875
  const cx = clsx;
@@ -61469,14 +61981,7 @@ const TooltipIconButton = React.forwardRef(
61469
61981
  }
61470
61982
  );
61471
61983
  TooltipIconButton.displayName = "TooltipIconButton";
61472
- const SAMPLE_TOOLS = [
61473
- { id: "search_web", name: "Search Web", description: "Search the internet for information", icon: "🔍", type: "tool" },
61474
- { id: "read_file", name: "Read File", description: "Read contents of a file", icon: "📄", type: "tool" },
61475
- { id: "write_file", name: "Write File", description: "Write contents to a file", icon: "✏️", type: "tool" },
61476
- { id: "run_code", name: "Run Code", description: "Execute code in a sandbox", icon: "▶️", type: "tool" },
61477
- { id: "code_toolkit", name: "Code Toolkit", description: "Full suite of coding tools", icon: "🧰", type: "toolkit" },
61478
- { id: "research_toolkit", name: "Research Toolkit", description: "Research and analysis tools", icon: "📚", type: "toolkit" }
61479
- ];
61984
+ const EMPTY_MENTION_TOOLS = [];
61480
61985
  const AthenaChat = ({
61481
61986
  className,
61482
61987
  welcomeMessage = "Hello there!",
@@ -61485,13 +61990,17 @@ const AthenaChat = ({
61485
61990
  toolUIs,
61486
61991
  mentionTools
61487
61992
  }) => {
61488
- const tools = mentionTools ?? SAMPLE_TOOLS;
61489
- const mergedToolUIs = {
61993
+ const tools = mentionTools ?? EMPTY_MENTION_TOOLS;
61994
+ const mergedToolUIs = React.useMemo(() => ({
61490
61995
  append_markdown_to_athena_document: AppendDocumentToolUI,
61491
61996
  read_full_asset: ReadAssetToolUI,
61492
61997
  ...TOOL_UI_REGISTRY,
61493
61998
  ...toolUIs
61494
- };
61999
+ }), [toolUIs]);
62000
+ const AssistantMessageComponent = React.useMemo(
62001
+ () => () => /* @__PURE__ */ jsxRuntime.jsx(AssistantMessage, { toolUIs: mergedToolUIs }),
62002
+ [mergedToolUIs]
62003
+ );
61495
62004
  return /* @__PURE__ */ jsxRuntime.jsx(
61496
62005
  ThreadPrimitiveRoot,
61497
62006
  {
@@ -61512,7 +62021,7 @@ const AthenaChat = ({
61512
62021
  {
61513
62022
  components: {
61514
62023
  UserMessage,
61515
- AssistantMessage: () => /* @__PURE__ */ jsxRuntime.jsx(AssistantMessage, { toolUIs: mergedToolUIs })
62024
+ AssistantMessage: AssistantMessageComponent
61516
62025
  }
61517
62026
  }
61518
62027
  ),
@@ -61641,8 +62150,316 @@ const UserMessage = () => /* @__PURE__ */ jsxRuntime.jsx(
61641
62150
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-user-message-content wrap-break-word rounded-2xl bg-muted px-4 py-2.5 text-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(MessagePrimitiveParts, { components: { Text: TiptapText } }) })
61642
62151
  }
61643
62152
  );
62153
+ const embedCache = /* @__PURE__ */ new Map();
62154
+ function useAssetEmbed(assetId, options = {
62155
+ backendUrl: ""
62156
+ }) {
62157
+ const { readOnly = false, expiresInSeconds = 60 * 60 * 24 * 30, backendUrl, apiKey, token } = options;
62158
+ const [embedUrl, setEmbedUrl] = React.useState(null);
62159
+ const [isLoading, setIsLoading] = React.useState(false);
62160
+ const [error2, setError] = React.useState(null);
62161
+ const abortRef = React.useRef(null);
62162
+ React.useEffect(() => {
62163
+ var _a2;
62164
+ if (!assetId || !backendUrl) {
62165
+ setEmbedUrl(null);
62166
+ setIsLoading(false);
62167
+ setError(null);
62168
+ return;
62169
+ }
62170
+ const cacheKey = `${assetId}:${readOnly}:${token ?? apiKey ?? "anon"}`;
62171
+ const cached = embedCache.get(cacheKey);
62172
+ if (cached && cached.expiresAt > Date.now() / 1e3) {
62173
+ setEmbedUrl(cached.url);
62174
+ setIsLoading(false);
62175
+ setError(null);
62176
+ return;
62177
+ }
62178
+ const agoraBase = backendUrl.replace(/\/api\/assistant-ui\/?$/, "");
62179
+ const endpoint = `${agoraBase}/api/embed/generate-token`;
62180
+ (_a2 = abortRef.current) == null ? void 0 : _a2.abort();
62181
+ const controller = new AbortController();
62182
+ abortRef.current = controller;
62183
+ setIsLoading(true);
62184
+ setError(null);
62185
+ const headers = { "Content-Type": "application/json" };
62186
+ if (token) {
62187
+ headers["Authorization"] = `Bearer ${token}`;
62188
+ } else if (apiKey) {
62189
+ headers["X-API-KEY"] = apiKey;
62190
+ }
62191
+ fetch(endpoint, {
62192
+ method: "POST",
62193
+ headers,
62194
+ body: JSON.stringify({
62195
+ asset_id: assetId,
62196
+ read_only: readOnly,
62197
+ expires_in_seconds: expiresInSeconds
62198
+ }),
62199
+ signal: controller.signal
62200
+ }).then(async (res) => {
62201
+ if (!res.ok) {
62202
+ const text2 = await res.text().catch(() => "");
62203
+ throw new Error(`Failed to generate embed token (${res.status}): ${text2}`);
62204
+ }
62205
+ return res.json();
62206
+ }).then((data) => {
62207
+ embedCache.set(`${assetId}:${readOnly}:${token ?? apiKey ?? "anon"}`, { url: data.embed_url, expiresAt: data.expires_at });
62208
+ setEmbedUrl(data.embed_url);
62209
+ setIsLoading(false);
62210
+ }).catch((err) => {
62211
+ if (err.name === "AbortError") return;
62212
+ setError(err.message);
62213
+ setIsLoading(false);
62214
+ });
62215
+ return () => controller.abort();
62216
+ }, [assetId, readOnly, expiresInSeconds, backendUrl, apiKey, token]);
62217
+ return { embedUrl, isLoading, error: error2 };
62218
+ }
62219
+ const ASSET_TYPE_CONFIG = {
62220
+ presentation: { icon: Presentation, label: "Presentation" },
62221
+ spreadsheet: { icon: FileSpreadsheet, label: "Spreadsheet" },
62222
+ document: { icon: FileText, label: "Document" },
62223
+ unknown: { icon: File$1, label: "Asset" }
62224
+ };
62225
+ const AssetIframe = React.memo(
62226
+ ({ tabId, tabName }) => {
62227
+ const { backendUrl, apiKey, token } = useAthenaConfig();
62228
+ const { embedUrl, isLoading, error: error2 } = useAssetEmbed(tabId, {
62229
+ backendUrl,
62230
+ apiKey,
62231
+ token
62232
+ });
62233
+ if (isLoading) {
62234
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
62235
+ /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { className: "mx-auto size-6 animate-spin text-muted-foreground" }),
62236
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: "Loading..." })
62237
+ ] }) });
62238
+ }
62239
+ if (error2) {
62240
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-sm text-center", children: [
62241
+ /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { className: "mx-auto size-5 text-red-400" }),
62242
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-xs font-medium text-foreground", children: "Failed to load" }),
62243
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 line-clamp-2 break-words text-[10px] text-muted-foreground", children: error2 })
62244
+ ] }) });
62245
+ }
62246
+ if (!embedUrl) return null;
62247
+ return /* @__PURE__ */ jsxRuntime.jsx(
62248
+ "iframe",
62249
+ {
62250
+ src: embedUrl,
62251
+ width: "100%",
62252
+ height: "100%",
62253
+ frameBorder: "0",
62254
+ allow: "fullscreen",
62255
+ title: tabName ?? `Asset ${tabId}`,
62256
+ className: "h-full w-full"
62257
+ }
62258
+ );
62259
+ }
62260
+ );
62261
+ AssetIframe.displayName = "AssetIframe";
62262
+ const PanelContent = () => {
62263
+ const { tabs, activeTabId, viewMode, closeTab } = useAssetPanelStore();
62264
+ const isTiled = viewMode === "tiled" && tabs.length >= 2;
62265
+ const gridClass = React.useMemo(() => {
62266
+ const n = tabs.length;
62267
+ if (n <= 1) return "";
62268
+ if (n === 2) return "grid grid-cols-2 grid-rows-1";
62269
+ if (n <= 4) return "grid grid-cols-2 grid-rows-2";
62270
+ if (n <= 6) return "grid grid-cols-3 grid-rows-2";
62271
+ return "grid grid-cols-3 grid-rows-3";
62272
+ }, [tabs.length]);
62273
+ return /* @__PURE__ */ jsxRuntime.jsx(
62274
+ "div",
62275
+ {
62276
+ className: `flex-1 overflow-hidden ${isTiled ? `${gridClass} gap-px bg-border/60` : ""}`,
62277
+ children: tabs.map((tab) => {
62278
+ const isActive2 = tab.id === activeTabId;
62279
+ const config2 = ASSET_TYPE_CONFIG[tab.type];
62280
+ const TypeIcon = config2.icon;
62281
+ if (isTiled) {
62282
+ return /* @__PURE__ */ jsxRuntime.jsxs(
62283
+ "div",
62284
+ {
62285
+ className: "flex min-h-0 min-w-0 flex-col bg-background",
62286
+ children: [
62287
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1", children: [
62288
+ /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { className: "size-3 shrink-0 text-muted-foreground" }),
62289
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-[11px] font-medium text-foreground", children: tab.name ?? config2.label }),
62290
+ /* @__PURE__ */ jsxRuntime.jsx(
62291
+ "button",
62292
+ {
62293
+ onClick: () => closeTab(tab.id),
62294
+ className: "shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
62295
+ children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "size-2.5" })
62296
+ }
62297
+ )
62298
+ ] }),
62299
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetIframe, { tabId: tab.id, tabName: tab.name }) })
62300
+ ]
62301
+ },
62302
+ tab.id
62303
+ );
62304
+ }
62305
+ return /* @__PURE__ */ jsxRuntime.jsx(
62306
+ "div",
62307
+ {
62308
+ className: isActive2 ? "h-full w-full" : "hidden",
62309
+ children: /* @__PURE__ */ jsxRuntime.jsx(AssetIframe, { tabId: tab.id, tabName: tab.name })
62310
+ },
62311
+ tab.id
62312
+ );
62313
+ })
62314
+ }
62315
+ );
62316
+ };
62317
+ const TabBar = () => {
62318
+ const { tabs, activeTabId, setActiveTab, closeTab, viewMode } = useAssetPanelStore();
62319
+ if (tabs.length <= 1 || viewMode === "tiled") return null;
62320
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-0 overflow-x-auto border-b bg-muted/30", children: tabs.map((tab) => {
62321
+ const config2 = ASSET_TYPE_CONFIG[tab.type];
62322
+ const TypeIcon = config2.icon;
62323
+ const isActive2 = tab.id === activeTabId;
62324
+ return /* @__PURE__ */ jsxRuntime.jsxs(
62325
+ "div",
62326
+ {
62327
+ className: `group flex max-w-[180px] shrink-0 cursor-pointer items-center gap-1.5 border-r border-border/40 px-3 py-1.5 text-xs ${isActive2 ? "border-b-2 border-b-primary bg-background text-foreground" : "text-muted-foreground hover:bg-background/50 hover:text-foreground"}`,
62328
+ onClick: () => setActiveTab(tab.id),
62329
+ children: [
62330
+ /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { className: "size-3 shrink-0" }),
62331
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab.name ?? config2.label }),
62332
+ /* @__PURE__ */ jsxRuntime.jsx(
62333
+ "button",
62334
+ {
62335
+ onClick: (e) => {
62336
+ e.stopPropagation();
62337
+ closeTab(tab.id);
62338
+ },
62339
+ className: "ml-auto shrink-0 rounded p-0.5 opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100",
62340
+ children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "size-2.5" })
62341
+ }
62342
+ )
62343
+ ]
62344
+ },
62345
+ tab.id
62346
+ );
62347
+ }) });
62348
+ };
62349
+ const PanelHeader = ({ fullscreen }) => {
62350
+ const {
62351
+ closePanel,
62352
+ toggleFullscreen,
62353
+ tabs,
62354
+ activeTabId,
62355
+ viewMode,
62356
+ setViewMode
62357
+ } = useAssetPanelStore();
62358
+ const activeTab = tabs.find((t) => t.id === activeTabId);
62359
+ const config2 = ASSET_TYPE_CONFIG[(activeTab == null ? void 0 : activeTab.type) ?? "unknown"];
62360
+ const TypeIcon = config2.icon;
62361
+ const isTiled = viewMode === "tiled";
62362
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-4 py-2.5", children: [
62363
+ !isTiled && /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
62364
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "flex-1 truncate text-sm font-semibold text-foreground", children: isTiled ? `${tabs.length} Assets` : (activeTab == null ? void 0 : activeTab.name) ?? config2.label }),
62365
+ tabs.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx(
62366
+ "button",
62367
+ {
62368
+ onClick: () => setViewMode(isTiled ? "tabs" : "tiled"),
62369
+ className: `flex size-7 items-center justify-center rounded-lg transition-colors ${isTiled ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground"}`,
62370
+ title: isTiled ? "Switch to tabs" : "Tile all assets",
62371
+ children: isTiled ? /* @__PURE__ */ jsxRuntime.jsx(Layers, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(LayoutGrid, { className: "size-3.5" })
62372
+ }
62373
+ ),
62374
+ /* @__PURE__ */ jsxRuntime.jsx(
62375
+ "button",
62376
+ {
62377
+ onClick: toggleFullscreen,
62378
+ className: "flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
62379
+ title: fullscreen ? "Exit fullscreen" : "Fullscreen",
62380
+ children: fullscreen ? /* @__PURE__ */ jsxRuntime.jsx(Minimize2, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(Maximize2, { className: "size-3.5" })
62381
+ }
62382
+ ),
62383
+ /* @__PURE__ */ jsxRuntime.jsx(
62384
+ "button",
62385
+ {
62386
+ onClick: closePanel,
62387
+ className: "flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
62388
+ title: "Close all",
62389
+ children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "size-4" })
62390
+ }
62391
+ )
62392
+ ] });
62393
+ };
62394
+ const AssetPanel = () => {
62395
+ const isFullscreen = useAssetPanelStore((s) => s.isFullscreen);
62396
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
62397
+ /* @__PURE__ */ jsxRuntime.jsx(PanelHeader, { fullscreen: isFullscreen }),
62398
+ /* @__PURE__ */ jsxRuntime.jsx(TabBar, {}),
62399
+ /* @__PURE__ */ jsxRuntime.jsx(PanelContent, {})
62400
+ ] });
62401
+ if (isFullscreen) {
62402
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 z-50 flex flex-col bg-background", children: content });
62403
+ }
62404
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full flex-col bg-background", children: content });
62405
+ };
62406
+ const AthenaLayout = ({
62407
+ children,
62408
+ defaultChatPercent = 50,
62409
+ minPercent = 25
62410
+ }) => {
62411
+ const isOpen = useAssetPanelStore((s) => s.isOpen);
62412
+ const [chatPercent, setChatPercent] = React.useState(defaultChatPercent);
62413
+ const containerRef = React.useRef(null);
62414
+ const dragging = React.useRef(false);
62415
+ const onPointerDown = React.useCallback(
62416
+ (e) => {
62417
+ e.preventDefault();
62418
+ dragging.current = true;
62419
+ e.target.setPointerCapture(e.pointerId);
62420
+ },
62421
+ []
62422
+ );
62423
+ const onPointerMove = React.useCallback(
62424
+ (e) => {
62425
+ if (!dragging.current || !containerRef.current) return;
62426
+ const rect = containerRef.current.getBoundingClientRect();
62427
+ const pct = (e.clientX - rect.left) / rect.width * 100;
62428
+ setChatPercent(Math.max(minPercent, Math.min(100 - minPercent, pct)));
62429
+ },
62430
+ [minPercent]
62431
+ );
62432
+ const onPointerUp = React.useCallback(() => {
62433
+ dragging.current = false;
62434
+ }, []);
62435
+ if (!isOpen) {
62436
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children });
62437
+ }
62438
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "flex h-full w-full", children: [
62439
+ /* @__PURE__ */ jsxRuntime.jsx(
62440
+ "div",
62441
+ {
62442
+ className: "flex h-full flex-col overflow-hidden",
62443
+ style: { width: `${chatPercent}%` },
62444
+ children
62445
+ }
62446
+ ),
62447
+ /* @__PURE__ */ jsxRuntime.jsx(
62448
+ "div",
62449
+ {
62450
+ className: "flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
62451
+ onPointerDown,
62452
+ onPointerMove,
62453
+ onPointerUp
62454
+ }
62455
+ ),
62456
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, {}) })
62457
+ ] });
62458
+ };
61644
62459
  exports.AppendDocumentToolUI = AppendDocumentToolUI;
62460
+ exports.AssetPanel = AssetPanel;
61645
62461
  exports.AthenaChat = AthenaChat;
62462
+ exports.AthenaLayout = AthenaLayout;
61646
62463
  exports.AthenaProvider = AthenaProvider;
61647
62464
  exports.BrowseToolUI = BrowseToolUI;
61648
62465
  exports.Button = Button;
@@ -61651,6 +62468,9 @@ exports.CollapsibleContent = CollapsibleContent;
61651
62468
  exports.CollapsibleTrigger = CollapsibleTrigger;
61652
62469
  exports.CreateDocumentToolUI = CreateDocumentToolUI;
61653
62470
  exports.CreateEmailDraftToolUI = CreateEmailDraftToolUI;
62471
+ exports.CreatePresentationToolUI = CreatePresentationToolUI;
62472
+ exports.CreateSheetToolUI = CreateSheetToolUI;
62473
+ exports.DEFAULT_BACKEND_URL = DEFAULT_BACKEND_URL;
61654
62474
  exports.EmailSearchToolUI = EmailSearchToolUI;
61655
62475
  exports.ReadAssetToolUI = ReadAssetToolUI;
61656
62476
  exports.TOOL_UI_REGISTRY = TOOL_UI_REGISTRY;
@@ -61670,9 +62490,14 @@ exports.TooltipProvider = TooltipProvider;
61670
62490
  exports.TooltipTrigger = TooltipTrigger;
61671
62491
  exports.WebSearchToolUI = WebSearchToolUI;
61672
62492
  exports.buttonVariants = buttonVariants;
62493
+ exports.clearAutoOpenedAssets = clearAutoOpenedAssets;
61673
62494
  exports.cn = cn;
61674
62495
  exports.getAssetInfo = getAssetInfo;
62496
+ exports.resetAssetAutoOpen = resetAssetAutoOpen;
61675
62497
  exports.tryParseJson = tryParseJson$1;
62498
+ exports.useAssetEmbed = useAssetEmbed;
62499
+ exports.useAssetPanelStore = useAssetPanelStore;
62500
+ exports.useAthenaConfig = useAthenaConfig;
61676
62501
  exports.useAthenaRuntime = useAthenaRuntime;
61677
62502
  exports.useMentionSuggestions = useMentionSuggestions;
61678
62503
  exports.useParentAuth = useParentAuth;