@openchambery/web 1.19.13-beta.4 → 1.19.13-beta.6
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/assets/{AgentAvatar-mbvX7YlW.js → AgentAvatar-Bk-m9q6w.js} +1 -1
- package/dist/assets/AssistantView-7NzDL0Ft.js +2 -0
- package/dist/assets/{DiagramView-qyOlOyET.js → DiagramView-CAbNIt3t.js} +1 -1
- package/dist/assets/{FadeInOnReveal-moBbL8Ll.js → FadeInOnReveal-UGwClbL_.js} +1 -1
- package/dist/assets/Icon-D1BcR8Tz.js +1 -0
- package/dist/assets/{MarkdownRenderer-DJORbaAh.js → MarkdownRenderer-BPYs05iK.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-Baw1_E_b.js → MarkdownRendererImpl-DMOxz3F2.js} +3 -3
- package/dist/assets/{MarkstreamRendererImpl-C3y7cRux.js → MarkstreamRendererImpl-igQBbbc_.js} +2 -2
- package/dist/assets/MobileDetailNavigation-BqXkyZTu.js +1 -0
- package/dist/assets/MobileShareBridge-XVaxj2S6.js +4 -0
- package/dist/assets/MobileSurface-6zONMJbZ.js +2 -0
- package/dist/assets/{MultiRunWindow-CnzvP7OW.js → MultiRunWindow-DK4IMgXD.js} +1 -1
- package/dist/assets/{OnboardingScreen-j0iCyH7f.js → OnboardingScreen-Ql6mH4XV.js} +1 -1
- package/dist/assets/{OverlayScrollbar-CDC5B3RH.js → OverlayScrollbar-Bahg_P3r.js} +1 -1
- package/dist/assets/{SettingsView-Gerbi-eT.js → SettingsView-DyV0qt_2.js} +8 -8
- package/dist/assets/{SettingsWindow-Czkt-v7v.js → SettingsWindow-D6BMtTR9.js} +1 -1
- package/dist/assets/{TerminalView-C3PKUnFu.js → TerminalView-D24PhNyX.js} +1 -1
- package/dist/assets/{ToolOutputDialog-Nv1AVjeU.js → ToolOutputDialog-uKzrTqq_.js} +1 -1
- package/dist/assets/{appThemeRegistry-eohB6OfO.js → appThemeRegistry-CvGPIE7-.js} +1 -1
- package/dist/assets/{button-xx1UOBA5.js → button-9R-WgVMl.js} +1 -1
- package/dist/assets/{clipboard-CUasgPiF.js → clipboard-CzXos-TI.js} +1 -1
- package/dist/assets/{collapsible-CACHBRYZ.js → collapsible-Bbz9KiJf.js} +1 -1
- package/dist/assets/{context-menu-CYbm4wBZ.js → context-menu-CSyOhRz8.js} +1 -1
- package/dist/assets/{desktopHosts-DILvrAok.js → desktopHosts-B052a4UK.js} +1 -1
- package/dist/assets/{desktopRelayRestore-t8asCr3m.js → desktopRelayRestore-OjKNXr10.js} +1 -1
- package/dist/assets/{diagram-u0BC9uuY.js → diagram-NdsZih8P.js} +1 -1
- package/dist/assets/{dialog-BwQ3rY_x.js → dialog-gtFLyacK.js} +1 -1
- package/dist/assets/{es-CRjOwvYM.js → es-BtC17YQH.js} +1 -1
- package/dist/assets/fileMentionTouchSelection-DstJbYAw.js +4 -0
- package/dist/assets/{fileQueries-Bgly-E8f.js → fileQueries-B_s_B-fH.js} +1 -1
- package/dist/assets/{fr-D9taEN9L.js → fr-DPohCCUO.js} +1 -1
- package/dist/assets/{gitApi-CrP1R39C.js → gitApi-ClM_B3fS.js} +3 -3
- package/dist/assets/{input-CI730njs.js → input-Cd_1HyQv.js} +1 -1
- package/dist/assets/insertionBoundaries-RilpwKtQ.js +1 -0
- package/dist/assets/{ja-CYQ5aoWp.js → ja-CflPxUNi.js} +1 -1
- package/dist/assets/{ko-BwASV0Q0.js → ko-CuSU80xd.js} +1 -1
- package/dist/assets/main-C2wx8T4t.js +169 -0
- package/dist/assets/{main-Bjgj-x5l.js → main-uBrYU2q0.js} +2 -2
- package/dist/assets/{markdownHeightCache-DEjGKLv8.js → markdownHeightCache-BL8CUQ0M.js} +1 -1
- package/dist/assets/miniChat-Bt2HBpWq.js +2 -0
- package/dist/assets/mobile-CpcbfIT1.js +2 -0
- package/dist/assets/{multirun-IUfGqjJa.js → multirun-FNfO4hCT.js} +1 -1
- package/dist/assets/{persistence-YbQKzHUQ.js → persistence-DwRBC4zl.js} +2 -2
- package/dist/assets/{pl-DUI1vPil.js → pl-eJvVbQ74.js} +1 -1
- package/dist/assets/platform-DQ5_LNKO.js +2 -0
- package/dist/assets/{projectMeta-B94Ha79_.js → projectMeta-Cfq8wYwb.js} +2 -2
- package/dist/assets/{pt-BR-CZQFJllP.js → pt-BR-DSejAksY.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-DwWmaqPt.js → renderElectronMiniChatApp-CA5VKfGo.js} +2 -2
- package/dist/assets/renderMobileApp-De8AWiA6.js +28 -0
- package/dist/assets/{runtimeConfig-DhAd_g4W.js → runtimeConfig-BpsTIe2G.js} +1 -1
- package/dist/assets/runtimeEndpointReset-CjT4jAvZ.js +147 -0
- package/dist/assets/sessionChangeSummary-DKJxz5er.js +2 -0
- package/dist/assets/sessionLookup-CBT9qysS.js +1 -0
- package/dist/assets/{sortable-tabs-strip-Dom6Sthu.js → sortable-tabs-strip-BSzFYDAO.js} +1 -1
- package/dist/assets/src-BdO1hC7q.css +2 -0
- package/dist/assets/{store-CSnH_QXM.js → store-DHdMj3y4.js} +2 -2
- package/dist/assets/{terminalApi-noa4Cdbh.js → terminalApi-CfgOfnZk.js} +1 -1
- package/dist/assets/{textarea-BfNtUdJE.js → textarea-DE1UrdtK.js} +1 -1
- package/dist/assets/{tooltip-DPxumadF.js → tooltip-DSjr26A_.js} +1 -1
- package/dist/assets/{uk-C1FYZlmA.js → uk-DV9OgOAg.js} +1 -1
- package/dist/assets/{url-CVhsI9kR.js → url-CMQwHq4k.js} +1 -1
- package/dist/assets/{useAppFontEffects-BO7HWYlJ.js → useAppFontEffects-BD0BG-np.js} +43 -44
- package/dist/assets/{useDesktopWindowControlsLayout-BAuvqFxV.js → useDesktopWindowControlsLayout-CF2GHw9J.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-B9GzC3CE.js → useEffectiveDirectory-Tz4YgZHt.js} +1 -1
- package/dist/assets/{useFontPreferences-CB-cGo3I.js → useFontPreferences-DCaY8NbU.js} +1 -1
- package/dist/assets/useMobileNavigationStore-BlYOTQfq.js +413 -0
- package/dist/assets/{useSessionAutoCleanup-DSAkV_JD.js → useSessionAutoCleanup-VgkhRtrf.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-BW-HxZ9_.js → useWorkerHighlightedLines-DT0cJd4V.js} +1 -1
- package/dist/assets/{utils-BHTVlVov.js → utils-2ZK8yboQ.js} +1 -1
- package/dist/assets/{vendor-reactuses-core-DDoDDyM9.js → vendor-reactuses-core-BnW6GxJt.js} +1 -1
- package/dist/assets/{zh-CN-C96qP1ip.js → zh-CN-92n_rGTt.js} +1 -1
- package/dist/assets/{zh-TW-BsRk1Rbb.js → zh-TW-CwVxwJCj.js} +1 -1
- package/dist/index.html +8 -8
- package/dist/mini-chat.html +8 -8
- package/dist/mobile.html +8 -8
- package/package.json +1 -1
- package/server/index.js +1 -0
- package/server/lib/assistants/DOCUMENTATION.md +93 -16
- package/server/lib/assistants/assign.js +117 -12
- package/server/lib/assistants/assign.test.js +79 -0
- package/server/lib/assistants/bubbles.js +1 -1
- package/server/lib/assistants/contact-store.js +496 -11
- package/server/lib/assistants/contact-store.test.js +323 -7
- package/server/lib/assistants/contact-tools.js +303 -52
- package/server/lib/assistants/contact-tools.test.js +239 -7
- package/server/lib/assistants/contracts.js +31 -0
- package/server/lib/assistants/harness.js +169 -50
- package/server/lib/assistants/harness.test.js +355 -3
- package/server/lib/assistants/routes.js +3 -0
- package/server/lib/assistants/service.js +586 -43
- package/server/lib/assistants/service.test.js +696 -7
- package/server/lib/llm/DOCUMENTATION.md +2 -0
- package/server/lib/llm/completions.js +4 -0
- package/server/lib/llm/completions.test.js +3 -0
- package/server/lib/llm/generate.js +12 -5
- package/server/lib/llm/generate.test.js +40 -0
- package/server/lib/opencode/feature-routes-runtime.js +5 -0
- package/dist/assets/AssistantView-4rOhnCbj.js +0 -2
- package/dist/assets/Icon-CkzzhaLr.js +0 -1
- package/dist/assets/MobileDetailNavigation-Cy-LwJ5M.js +0 -1
- package/dist/assets/MobileShareBridge-CTai3NEM.js +0 -4
- package/dist/assets/MobileSurface-CYg5Flgz.js +0 -2
- package/dist/assets/insertionBoundaries-C8jXd3NT.js +0 -4
- package/dist/assets/main-DZg9T7tk.js +0 -169
- package/dist/assets/miniChat-DUFEC4jl.js +0 -2
- package/dist/assets/mobile-BqOSxf04.js +0 -2
- package/dist/assets/platform-DzsGqlGW.js +0 -2
- package/dist/assets/renderMobileApp-ByS1wjSm.js +0 -28
- package/dist/assets/runtimeEndpointReset-Dk_Xpe6y.js +0 -147
- package/dist/assets/sessionChangeSummary-DQDZ5HW-.js +0 -1
- package/dist/assets/sessionLookup-DZcwnQYW.js +0 -1
- package/dist/assets/src-AA-5nXsF.css +0 -2
- package/dist/assets/useMobileNavigationStore-Dqe-sz0u.js +0 -413
|
@@ -106,3 +106,5 @@ The Assistant contact harness owns system prompt, OpenChamber transcript,
|
|
|
106
106
|
bubble splitting, and OpenChamber API tools (`assign_session`). Those tools
|
|
107
107
|
deliver through contact **cards**, not this completions payload. The gateway
|
|
108
108
|
stays a text generator: OpenCode coding tools stay denied.
|
|
109
|
+
|
|
110
|
+
Internal completion/generate calls accept an optional AbortSignal from the contact continuation. It is combined with the generator deadline and passed to upstream requests and settle polling. Cancellation still runs throwaway-session cleanup; it must not turn a late model response into a new tool operation.
|
|
@@ -78,7 +78,9 @@ export async function createChatCompletion({
|
|
|
78
78
|
fetchImpl,
|
|
79
79
|
onTextDelta = null,
|
|
80
80
|
globalEventHub = null,
|
|
81
|
+
signal = null,
|
|
81
82
|
}) {
|
|
83
|
+
signal?.throwIfAborted();
|
|
82
84
|
if (!isRecord(body)) throw new LlmError('validation_error', 400, 'JSON body is required');
|
|
83
85
|
// Bundled OpenCode 1.18.4 generate is a full-turn JSON reply (sessionless
|
|
84
86
|
// generate or throwaway session.promptAsync). This HTTP gateway does not
|
|
@@ -100,6 +102,7 @@ export async function createChatCompletion({
|
|
|
100
102
|
provider: { list: async () => ({ error: { status: 500 } }) },
|
|
101
103
|
config: { providers: async () => ({ error: { status: 500 } }) },
|
|
102
104
|
});
|
|
105
|
+
signal?.throwIfAborted();
|
|
103
106
|
if (!isConnectedModel(catalog, resolved.providerID, resolved.modelID)) {
|
|
104
107
|
throw new LlmError(
|
|
105
108
|
'no_provider',
|
|
@@ -124,6 +127,7 @@ export async function createChatCompletion({
|
|
|
124
127
|
))?.acceptsImages),
|
|
125
128
|
onTextDelta,
|
|
126
129
|
globalEventHub,
|
|
130
|
+
signal,
|
|
127
131
|
});
|
|
128
132
|
} catch (error) {
|
|
129
133
|
if (error instanceof LlmError) throw error;
|
|
@@ -50,6 +50,7 @@ describe('createChatCompletion', () => {
|
|
|
50
50
|
it('forwards in-process onTextDelta and globalEventHub to generateText', async () => {
|
|
51
51
|
const generateText = vi.fn(async () => ({ text: 'streamed', source: 'throwaway-session' }))
|
|
52
52
|
const onTextDelta = vi.fn()
|
|
53
|
+
const signal = new AbortController().signal
|
|
53
54
|
const globalEventHub = { subscribeEvent: vi.fn() }
|
|
54
55
|
await createChatCompletion({
|
|
55
56
|
generateText,
|
|
@@ -60,9 +61,11 @@ describe('createChatCompletion', () => {
|
|
|
60
61
|
body: { model: 'openai/gpt-5.2', messages: [{ role: 'user', content: 'hi' }] },
|
|
61
62
|
onTextDelta,
|
|
62
63
|
globalEventHub,
|
|
64
|
+
signal,
|
|
63
65
|
})
|
|
64
66
|
expect(generateText.mock.calls[0][0].onTextDelta).toBe(onTextDelta)
|
|
65
67
|
expect(generateText.mock.calls[0][0].globalEventHub).toBe(globalEventHub)
|
|
68
|
+
expect(generateText.mock.calls[0][0].signal).toBe(signal)
|
|
66
69
|
})
|
|
67
70
|
|
|
68
71
|
it('forwards optional file parts on user messages', async () => {
|
|
@@ -66,7 +66,10 @@ const sleep = (ms, signal) => new Promise((resolve, reject) => {
|
|
|
66
66
|
reject(signal.reason instanceof Error ? signal.reason : new Error('aborted'));
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const timer = setTimeout(
|
|
69
|
+
const timer = setTimeout(() => {
|
|
70
|
+
signal?.removeEventListener?.('abort', onAbort);
|
|
71
|
+
resolve();
|
|
72
|
+
}, ms);
|
|
70
73
|
const onAbort = () => {
|
|
71
74
|
clearTimeout(timer);
|
|
72
75
|
reject(signal.reason instanceof Error ? signal.reason : new Error('aborted'));
|
|
@@ -441,7 +444,9 @@ export async function generateOpenCodeText({
|
|
|
441
444
|
forwardImageParts = false,
|
|
442
445
|
onTextDelta = null,
|
|
443
446
|
globalEventHub = null,
|
|
447
|
+
signal: parentSignal = null,
|
|
444
448
|
}) {
|
|
449
|
+
parentSignal?.throwIfAborted();
|
|
445
450
|
if (!providerID || !modelID) {
|
|
446
451
|
const error = new Error('providerID and modelID are required');
|
|
447
452
|
error.code = 'validation_error';
|
|
@@ -458,7 +463,9 @@ export async function generateOpenCodeText({
|
|
|
458
463
|
const baseUrl = buildOpenCodeUrl('/', '').replace(/\/$/, '');
|
|
459
464
|
const headers = getOpenCodeAuthHeaders() || {};
|
|
460
465
|
const probe = await detect({ fetchImpl, baseUrl, headers, client: clientFactory?.() });
|
|
466
|
+
parentSignal?.throwIfAborted();
|
|
461
467
|
const controller = new AbortController();
|
|
468
|
+
const requestSignal = parentSignal ? AbortSignal.any([parentSignal, controller.signal]) : controller.signal;
|
|
462
469
|
const timeout = setTimeout(() => controller.abort(new Error(`OpenCode LLM generate timed out after ${GENERATE_TIMEOUT_MS}ms`)), GENERATE_TIMEOUT_MS);
|
|
463
470
|
|
|
464
471
|
try {
|
|
@@ -476,7 +483,7 @@ export async function generateOpenCodeText({
|
|
|
476
483
|
const parts = message.parts.filter((part) => part?.type !== 'file' || !String(part.mime || '').startsWith('image/'));
|
|
477
484
|
return parts.length === message.parts.length ? message : { ...message, parts };
|
|
478
485
|
}),
|
|
479
|
-
signal:
|
|
486
|
+
signal: requestSignal,
|
|
480
487
|
});
|
|
481
488
|
}
|
|
482
489
|
|
|
@@ -506,7 +513,7 @@ export async function generateOpenCodeText({
|
|
|
506
513
|
// Session fence: deny every native OpenCode/MCP/skill tool for this throwaway.
|
|
507
514
|
permission: LLM_SESSION_DENY_PERMISSION,
|
|
508
515
|
metadata: { openchamber: { llm: { purpose: 'chat-completions' } } },
|
|
509
|
-
}, { signal:
|
|
516
|
+
}, { signal: requestSignal });
|
|
510
517
|
const sessionID = created?.data?.id;
|
|
511
518
|
if (created?.error || !sessionID) {
|
|
512
519
|
failGenerate(`OpenCode LLM session create failed: ${sdkErrorMessage(created, 'create failed')}`);
|
|
@@ -550,7 +557,7 @@ export async function generateOpenCodeText({
|
|
|
550
557
|
{ type: 'text', text: flattened.prompt, synthetic: false },
|
|
551
558
|
...promptFiles,
|
|
552
559
|
],
|
|
553
|
-
}, { signal:
|
|
560
|
+
}, { signal: requestSignal });
|
|
554
561
|
if (!promptAdmitted(prompted)) {
|
|
555
562
|
failGenerate(`OpenCode LLM promptAsync failed: ${sdkErrorMessage(prompted, 'promptAsync failed')}`);
|
|
556
563
|
}
|
|
@@ -561,7 +568,7 @@ export async function generateOpenCodeText({
|
|
|
561
568
|
client,
|
|
562
569
|
sessionID,
|
|
563
570
|
directory: workingDirectory,
|
|
564
|
-
signal:
|
|
571
|
+
signal: requestSignal,
|
|
565
572
|
});
|
|
566
573
|
text = assistantTextFromMessages(settled);
|
|
567
574
|
}
|
|
@@ -9,6 +9,46 @@ const completedAssistant = (text) => ({
|
|
|
9
9
|
parts: [{ type: 'text', text }],
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
+
|
|
13
|
+
describe('generate cancellation', () => {
|
|
14
|
+
it('cancels throwaway polling and still deletes only its temporary session', async () => {
|
|
15
|
+
const controller = new AbortController()
|
|
16
|
+
const remove = vi.fn(async () => ({ data: true }))
|
|
17
|
+
const client = {
|
|
18
|
+
tool: { ids: async () => ({ data: [] }) },
|
|
19
|
+
session: {
|
|
20
|
+
create: async () => ({ data: { id: 'ses_abort_fixture' } }),
|
|
21
|
+
update: async () => ({ data: { id: 'ses_abort_fixture' } }),
|
|
22
|
+
promptAsync: async () => ({ response: { status: 204 } }),
|
|
23
|
+
status: async (_args, { signal }) => { controller.abort(); signal.throwIfAborted() },
|
|
24
|
+
delete: remove,
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
await expect(generateOpenCodeText({
|
|
28
|
+
providerID: 'p', modelID: 'm', messages: [{ role: 'user', content: 'work' }],
|
|
29
|
+
buildOpenCodeUrl: () => 'http://localhost:1', getOpenCodeAuthHeaders: () => ({}),
|
|
30
|
+
detect: async () => ({ available: false, mode: 'throwaway-session' }),
|
|
31
|
+
clientFactory: () => client, ensureTempDirectory: async () => '/tmp/abort-fixture',
|
|
32
|
+
signal: controller.signal,
|
|
33
|
+
})).rejects.toMatchObject({ name: 'AbortError' })
|
|
34
|
+
expect(remove).toHaveBeenCalledExactlyOnceWith({ sessionID: 'ses_abort_fixture', directory: '/tmp/abort-fixture' })
|
|
35
|
+
})
|
|
36
|
+
it('aborts an in-flight model request when the contact continuation is cancelled', async () => {
|
|
37
|
+
const controller = new AbortController()
|
|
38
|
+
const fetchImpl = vi.fn(async (_url, { signal }) => {
|
|
39
|
+
controller.abort()
|
|
40
|
+
signal.throwIfAborted()
|
|
41
|
+
})
|
|
42
|
+
await expect(generateOpenCodeText({
|
|
43
|
+
providerID: 'p', modelID: 'm', messages: [{ role: 'user', content: 'work' }],
|
|
44
|
+
buildOpenCodeUrl: () => 'http://localhost:1', getOpenCodeAuthHeaders: () => ({}),
|
|
45
|
+
detect: async () => ({ available: true, mode: 'http', url: 'http://localhost:1/generate' }),
|
|
46
|
+
fetchImpl, signal: controller.signal,
|
|
47
|
+
})).rejects.toMatchObject({ name: 'AbortError' })
|
|
48
|
+
expect(fetchImpl).toHaveBeenCalledTimes(1)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
|
|
12
52
|
describe('detectSessionlessGenerate', () => {
|
|
13
53
|
it('returns unavailable when the probe 404s', async () => {
|
|
14
54
|
const fetchImpl = vi.fn(async () => new Response('missing', { status: 404 }))
|
|
@@ -105,6 +105,7 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
105
105
|
formatSettingsResponse,
|
|
106
106
|
readSettingsFromDisk,
|
|
107
107
|
readSettingsFromDiskMigrated,
|
|
108
|
+
readSettingsFromDiskStrict,
|
|
108
109
|
persistSettings,
|
|
109
110
|
sanitizeProjects,
|
|
110
111
|
sanitizeSkillCatalogs,
|
|
@@ -246,6 +247,10 @@ export const createFeatureRoutesRuntime = (dependencies) => {
|
|
|
246
247
|
: {}),
|
|
247
248
|
}));
|
|
248
249
|
},
|
|
250
|
+
readModelPreferences: async () => {
|
|
251
|
+
const settings = await readSettingsFromDiskStrict();
|
|
252
|
+
return { favoriteModels: settings.favoriteModels, recentModels: settings.recentModels };
|
|
253
|
+
},
|
|
249
254
|
listScheduledTasks: (projectID) => projectConfigRuntime.listScheduledTasks(projectID),
|
|
250
255
|
sessionIndexService,
|
|
251
256
|
upsertScheduledTask: (projectID, task) => projectConfigRuntime.upsertScheduledTask(projectID, task),
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{c as n,i as r}from"./runtime-switch-LvWDU-SL.js";import{et as i}from"./persistence-YbQKzHUQ.js";import{a}from"./vendor-zustand-B4dlGEM2.js";import{nt as o,rt as s}from"./vendor-base-ui-CnHfUmDN.js";import{r as c}from"./platform-DzsGqlGW.js";import{t as l}from"./useUIStore-CxOoCv7B.js";import{n as u}from"./vendor-react-DLPElpoQ.js";import{r as d}from"./vendor-sonner-DVzioF3d.js";import{n as f,r as p,u as m}from"./vendor-reactuses-core-DDoDDyM9.js";import{n as h}from"./clipboard-CUasgPiF.js";import{a as g,n as _}from"./MobileShareBridge-CTai3NEM.js";import{Oo as v,dr as y,qt as b,r as x,vn as S}from"./useMobileNavigationStore-Dqe-sz0u.js";import{g as C,i as w,l as ee,m as T,n as E,o as D,p as O,t as k,x as A,y as j}from"./MobileDetailNavigation-Cy-LwJ5M.js";import{i as M,n as N,r as P}from"./useAssistantUIStore-CLPCNoj_.js";import{a as F,i as I,n as L,o as R,r as z,t as B}from"./dialog-BwQ3rY_x.js";import{t as V}from"./utils-BHTVlVov.js";import{t as H}from"./AgentAvatar-mbvX7YlW.js";import{n as U}from"./Icon-CkzzhaLr.js";import{t as W}from"./button-xx1UOBA5.js";import{i as te}from"./OverlayScrollbar-CDC5B3RH.js";import{t as ne}from"./MarkdownRenderer-DJORbaAh.js";import{c as re,s as G}from"./imageSource-BlAJJUEI.js";import{a as ie,c as ae,i as oe,n as K,o as q,p as se,r as J,t as ce}from"./sessionChangeSummary-DQDZ5HW-.js";import{a as le,i as Y,n as ue,r as de,t as fe}from"./context-menu-CYbm4wBZ.js";import{i as pe,n as X,r as me}from"./assistant-attachment-cache-C0aRnFkj.js";import{t as he}from"./sessionLookup-DZcwnQYW.js";var Z=u(),Q=e(s(),1),$=o(),ge=e=>{let t=(0,Z.c)(17),{name:n,emoji:r,size:i,label:a,working:o,className:s}=e,c=i===void 0?24:i,l=o!==void 0&&o,{t:u}=h(),d=`calc(${c}px * var(--dpt-n, 1))`,f;t[0]===s?f=t[1]:(f=V(`relative inline-block shrink-0 align-middle leading-none`,s),t[0]=s,t[1]=f);let p;t[2]===d?p=t[3]:(p={width:d,height:d},t[2]=d,t[3]=p);let m;t[4]!==r||t[5]!==a||t[6]!==n||t[7]!==c?(m=(0,$.jsx)(H,{name:n,emoji:r,size:c,label:a,shape:`circle`}),t[4]=r,t[5]=a,t[6]=n,t[7]=c,t[8]=m):m=t[8];let g;t[9]!==u||t[10]!==l?(g=l?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-0 bottom-0 size-2 translate-x-1/4 translate-y-1/4 rounded-full bg-[var(--status-success)] ring-2 ring-background`,"data-assistant-working-dot":``,"aria-label":u(`assistants.contact.working`)}):null,t[9]=u,t[10]=l,t[11]=g):g=t[11];let _;return t[12]!==f||t[13]!==p||t[14]!==m||t[15]!==g?(_=(0,$.jsxs)(`span`,{className:f,style:p,"data-assistant-working-avatar":``,children:[m,g]}),t[12]=f,t[13]=p,t[14]=m,t[15]=g,t[16]=_):_=t[16],_},_e=a(e=>({workingByID:{},setWorking:(t,n)=>e(e=>({workingByID:{...e.workingByID,[t]:n}}))})),ve=({sending:e=!1,processing:t=!1,serverWorking:n=!1})=>e||t||n,ye=(e,t)=>{let n=(0,Z.c)(5),r=t!==void 0&&t,i;n[0]===e?i=n[1]:(i=t=>!!t.workingByID[e],n[0]=e,n[1]=i);let a=_e(i),o;return n[2]!==a||n[3]!==r?(o=ve({processing:a,serverWorking:r}),n[2]=a,n[3]=r,n[4]=o):o=n[4],o},be=`max-h-72 max-w-full rounded-[1.35rem] border border-border/40 object-contain`;function xe({assistantID:e,descriptor:t}){let{t:n}=h(),r=re(),{attachmentID:i,sha256:a,size:o,mime:s,filename:c}=t,l=Q.useMemo(()=>({type:`file`,attachmentID:i,sha256:a,size:o,mime:s,filename:c}),[i,a,o,s,c]),u=s.startsWith(`image/`),[d,p]=Q.useState(0),[m,g]=Q.useState(``),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x=Q.useRef(null),S=Q.useRef([]);Q.useEffect(()=>{g(``),v(!1);let t=new AbortController,n;return u&&me(e,l,{signal:t.signal}).then(e=>{if(t.signal.aborted){e.release();return}n=e.release,g(e.url)}).catch(()=>{t.signal.aborted||v(!0)}),()=>{t.abort(),n?.()}},[e,l,r,u,d]),Q.useEffect(()=>()=>{x.current?.abort(),S.current.forEach(e=>URL.revokeObjectURL(e)),S.current=[]},[e,l,r]);let C=f(async()=>{if(x.current)return;let t=new AbortController;x.current=t,b(!0),v(!1);try{let r=await X(e,l,{signal:t.signal});if(t.signal.aborted)return;S.current.forEach(e=>URL.revokeObjectURL(e));let i=URL.createObjectURL(r);S.current=[i];let a=document.createElement(`a`);a.href=i,a.download=c||n(`assistants.contact.attachment.file`),document.body.appendChild(a),a.click(),a.remove()}catch{t.signal.aborted||v(!0)}finally{x.current===t&&(x.current=null),t.signal.aborted||b(!1)}}),w=c||n(u?`assistants.contact.attachment.image`:`assistants.contact.attachment.file`);return u&&m&&!_?(0,$.jsx)(`img`,{src:m,alt:w,className:be,onError:()=>v(!0),"data-assistant-contact-image":``}):(0,$.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5 ring-1 ring-inset ring-[var(--surface-subtle)]`,"data-assistant-contact-file":``,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(U,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:w})]}),_?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:n(`assistants.contact.attachment.loadFailed`)}):null,u&&!_||y?(0,$.jsx)(`span`,{role:`status`,className:`typography-micro text-muted-foreground`,children:n(`common.loading`)}):(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:u?()=>p(e=>e+1):()=>void C(),children:n(_?`chat.history.retry`:`assistants.contact.attachment.download`)})]})}function Se(e){let t=(0,Z.c)(19),{part:n}=e,{t:r}=h(),i=/^(?:https?:|data:|blob:)/i.test(n.url)?n.url:``,a=G(i,``),[o,s]=Q.useState(!1);if(n.mime.startsWith(`image/`)&&a&&!o){let e;t[0]!==n.filename||t[1]!==r?(e=n.filename||r(`assistants.contact.attachment.image`),t[0]=n.filename,t[1]=r,t[2]=e):e=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>s(!0),t[3]=i):i=t[3];let o;return t[4]!==a||t[5]!==e?(o=(0,$.jsx)(`img`,{src:a,alt:e,className:be,onError:i,"data-assistant-contact-image":``}),t[4]=a,t[5]=e,t[6]=o):o=t[6],o}let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(U,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),t[7]=c):c=t[7];let l;t[8]!==n.filename||t[9]!==r?(l=n.filename||r(`assistants.contact.attachment.file`),t[8]=n.filename,t[9]=r,t[10]=l):l=t[10];let u;t[11]===l?u=t[12]:(u=(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:l}),t[11]=l,t[12]=u);let d;t[13]!==o||t[14]!==r?(d=o?(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>s(!1),children:r(`chat.history.retry`)}):null,t[13]=o,t[14]=r,t[15]=d):d=t[15];let f;return t[16]!==u||t[17]!==d?(f=(0,$.jsxs)(`div`,{className:`flex max-w-full items-center gap-2.5 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5`,"data-assistant-contact-file":``,children:[c,u,d]}),t[16]=u,t[17]=d,t[18]=f):f=t[18],f}function Ce(e){let t=(0,Z.c)(4),{assistantID:n,part:r}=e,i=re(),a;return t[0]!==n||t[1]!==r||t[2]!==i?(a=`attachmentID`in r?(0,$.jsx)(xe,{assistantID:n,descriptor:r},`${i}:${n}:${r.attachmentID}:${r.sha256}`):(0,$.jsx)(Se,{part:r},`${i}:${r.url}`),t[0]=n,t[1]=r,t[2]=i,t[3]=a):a=t[3],a}var we=[],Te=e=>e.flatMap(e=>e.type===`text`&&e.text.trim()?[e.text]:[]).join(`
|
|
2
|
-
`),Ee=(e,t,n,r=Date.now())=>({assistantID:e,messageID:t,parts:n,status:`sending`,createdAt:r}),De=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},Oe=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},ke=(e,t,n,r)=>({messageID:t?`${e.turnID}:preview:${t.bubbleIndex}`:`${e.turnID}:preview:${r}`,assistantID:e.assistantID,role:`assistant`,turnID:e.turnID,bubbleIndex:t?.bubbleIndex??0,createdAt:t?.occurredAt??e.occurredAt,ordinal:n,status:r,fromAssistantID:null,fromAssistantName:null,parts:t?[{type:`text`,text:t.text}]:[],text:t?.text??``,cards:[]}),Ae=(e,t,n)=>{let r=e.bubbles.filter(e=>!t.has(e.bubbleIndex)).map((t,r)=>ke(e,t,n+r,t.done?`complete`:`streaming`));return e.status===`failed`?[...r,ke(e,null,n+r.length,`failed`)]:e.status===`admitted`||e.status===`streaming`?[...r,ke(e,null,n+r.length,`admitted`)]:r},je=(e,t,n,r=[])=>{let i=new Set(e.map(e=>e.messageID)),a=t.flatMap((t,r)=>t.assistantID!==n||i.has(t.messageID)?[]:[{messageID:t.messageID,assistantID:n,role:`user`,turnID:t.messageID,bubbleIndex:0,createdAt:t.createdAt,ordinal:e.length+r,status:t.status,fromAssistantID:null,fromAssistantName:null,parts:[...t.parts],text:Te(t.parts),cards:[]}]),o=a.length===0?e:[...e,...a],s=r.filter(e=>e.assistantID===n);if(s.length===0)return o;let c=new Map,l=new Map;o.forEach((e,t)=>{if(c.set(e.turnID,t),e.role!==`assistant`||e.messageID.includes(`:preview:`))return;let n=l.get(e.turnID)??new Set;n.add(e.bubbleIndex),l.set(e.turnID,n)});let u=new Map,d=[];for(let e of s){let t=Ae(e,l.get(e.turnID)??new Set,o.length+d.length);if(t.length===0)continue;let n=c.get(e.turnID);if(n===void 0){d.push(...t);continue}let r=u.get(n)??[];r.push(...t),u.set(n,r)}return u.size===0&&d.length===0?o:o.flatMap((e,t)=>[e,...u.get(t)??[]]).concat(d)},Me=(e,t)=>{let n=new Set(t.map(e=>e.messageID)),r=e.filter(e=>!n.has(e.messageID));return r.length===e.length?e:r},Ne=(e,t)=>e.map(e=>e.messageID===t?{...e,status:`admitted`}:e),Pe=(e,t,n,r=Date.now())=>e.some(e=>e.assistantID===t&&e.turnID===n)?e:[...e,{assistantID:t,turnID:n,status:`admitted`,bubbles:[],occurredAt:r}],Fe=(e,t,n)=>!t?.turnID||!t.assistantID||n?.has(t.turnID)?e:Pe(e,t.assistantID,t.turnID,t.admittedAt),Ie=(e,t)=>{let n=t.assistantID,r=t.pendingSendTurnIDs??new Set,i=t.settledTurnIDs??new Set,a=typeof t.snapshotRevision==`number`&&Number.isFinite(t.snapshotRevision)?t.snapshotRevision:null,o=t.admissionRevisionByTurnID instanceof Map?t.admissionRevisionByTurnID:new Map(Object.entries(t.admissionRevisionByTurnID??{}).map(([e,t])=>[e,Number(t)])),s=t.occurredAt??Date.now(),c=t.activeContactTurn&&t.activeContactTurn.turnID?t.activeContactTurn:null,l=!!(t.serverWorking||c),u=Fe(e,c?{assistantID:n,turnID:c.turnID,admittedAt:c.admittedAt}:null,i),d=Array.isArray(t.messages)?t.messages:[];for(let e of d)e.role===`assistant`&&e.status===`error`&&(r.has(e.turnID)||i.has(e.turnID)||(u=Re(u,{assistantID:n,turnID:e.turnID,status:`error`,error:e.text||`upstream_error`,occurredAt:s})));if(u=ze(u,d),l){let t=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID)||c&&e.turnID===c.turnID)return!0;let t=o.get(e.turnID);return typeof t==`number`&&a!=null&&a<t?!0:typeof t==`number`&&a!=null&&a>=t&&e.turnID!==c?.turnID?!1:!c||e.turnID===c.turnID});return t.length===e.length&&t.every((t,n)=>t===e[n])?e:t}if(a==null)return u.length===e.length&&u.every((t,n)=>t===e[n])?e:u;let f=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID))return!0;if(i.has(e.turnID))return!1;let t=o.get(e.turnID);return typeof t==`number`&&a<t});return f.length===e.length&&f.every((t,n)=>t===e[n])?e:f.length===u.length?u:f},Le=(e,t)=>Pe(e,t.assistantID,t.turnID,t.occurredAt).map(e=>{if(e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`failed`||e.status===`complete`)return e;let n=e.bubbles.find(e=>e.bubbleIndex===t.bubbleIndex);if(n?.done)return e;let r=n?{...n,text:`${n.text}${t.delta}`,done:t.done,occurredAt:t.occurredAt}:{bubbleIndex:t.bubbleIndex,text:t.delta,done:t.done,occurredAt:t.occurredAt},i=n?e.bubbles.map(e=>e.bubbleIndex===t.bubbleIndex?r:e):[...e.bubbles,r].sort((e,t)=>e.bubbleIndex-t.bubbleIndex);return{...e,status:`streaming`,bubbles:i}}),Re=(e,t,n={})=>n.requireExisting&&!e.some(e=>e.assistantID===t.assistantID&&e.turnID===t.turnID)?e:Pe(e,t.assistantID,t.turnID,t.occurredAt).map(e=>e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`complete`||e.status===`failed`?e:{...e,status:t.status===`error`?`failed`:`complete`,...t.error?{error:t.error}:{}}),ze=(e,t)=>{let n=new Set(t.flatMap(e=>e.role===`assistant`?[e.turnID]:[])),r=e.filter(e=>e.status!==`complete`||!n.has(e.turnID));return r.length===e.length?e:r},Be=(e,t,n)=>e.map(e=>e.messageID===t?{...e,status:`failed`,error:n}:e),Ve=(e,t)=>{if(e instanceof j){if(e.code===`no_provider`)return t.noProvider;if(e.code===`admission_timeout`||e.code===`generate_timeout`)return t.timedOut;if(e.message&&e.message!==e.code)return e.message}return A(e)?t.timedOut:t.sendFailed},He=()=>{let e=!1;return{tryAcquire:()=>!e&&(e=!0,!0),release:()=>{e=!1}}},Ue=e=>{let t=e.text.trim();if(e.sending||!t&&e.attachments.length===0||!e.gate.tryAcquire())return{ok:!1};let n=[...t?[{type:`text`,text:t}]:[],...e.attachments.map(e=>({type:`file`,mime:e.mime,url:e.url,filename:e.name}))],r=e.createMessageID();return{ok:!0,messageID:r,parts:n,turn:Ee(e.assistantID,r,n,e.createdAt)}},We=e=>e.some(e=>e.status===`sending`),Ge=e=>e.some(e=>e.status===`admitted`||e.status===`streaming`),Ke=[`cursor-pointer rounded-[1.35rem] bg-[var(--surface-elevated)] ring-1 ring-inset ring-[var(--surface-subtle)]`,`px-3.5 py-3 text-left transition-[background-color,box-shadow,transform] duration-200 ease-out motion-reduce:transition-none`,`hover:-translate-y-px hover:bg-interactive-hover/45 hover:shadow-sm active:translate-y-0 motion-reduce:hover:translate-y-0`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`].join(` `),qe=`${Ke} w-fit min-w-0 max-w-[min(100%,15rem)]`,Je=`${Ke} w-fit min-w-0 max-w-[min(100%,20rem)]`;function Ye(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}var Xe=e=>{let t=(0,Z.c)(26),{card:n}=e,{t:r}=h(),i=se(),a;t[0]===i?a=t[1]:(a=i&&!c(),t[0]=i,t[1]=a);let o=!!a,s=n.name,l=`${n.providerID}/${n.modelID}`,u;t[2]!==n.mode||t[3]!==l?(u=[l,n.mode].filter(Boolean),t[2]=n.mode,t[3]=l,t[4]=u):u=t[4];let d=u,p;t[5]!==n.assistantID||t[6]!==o?(p=()=>{if(o){x.getState().openAssistant(n.assistantID);return}N(n.assistantID)},t[5]=n.assistantID,t[6]=o,t[7]=p):p=t[7];let m=f(p),g;t[8]===m?g=t[9]:(g=e=>{Ye(e,m)},t[8]=m,t[9]=g);let _=f(g),v;t[10]!==r||t[11]!==s?(v=r(`assistants.contact.card.assistant.aria`,{name:s}),t[10]=r,t[11]=s,t[12]=v):v=t[12];let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`span`,{className:`relative inline-block size-6 shrink-0 leading-none`,children:(0,$.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-lg bg-[var(--surface-muted)] text-muted-foreground`,children:(0,$.jsx)(U,{name:`robot-2`,className:`size-3`})})}),t[13]=y):y=t[13];let b;t[14]===s?b=t[15]:(b=(0,$.jsx)(`h3`,{className:`min-w-0 truncate typography-ui-label font-medium text-foreground`,children:s}),t[14]=s,t[15]=b);let S;t[16]===d?S=t[17]:(S=d.length>0?(0,$.jsx)(`p`,{className:`truncate typography-micro text-muted-foreground`,children:d.join(` · `)}):null,t[16]=d,t[17]=S);let C;t[18]!==b||t[19]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[y,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[b,S]})]}),t[18]=b,t[19]=S,t[20]=C):C=t[20];let w;return t[21]!==_||t[22]!==m||t[23]!==C||t[24]!==v?(w=(0,$.jsx)(`article`,{className:qe,role:`button`,tabIndex:0,"aria-label":v,"data-assistant-contact-card":`assistant`,onClick:m,onKeyDown:_,children:C}),t[21]=_,t[22]=m,t[23]=C,t[24]=v,t[25]=w):w=t[25],w},Ze=e=>{let t=(0,Z.c)(25),{card:n}=e,{t:r}=h(),i=n.name,a;t[0]!==n.kind||t[1]!==n.time||t[2]!==n.timezone?(a=[n.kind,n.time,n.timezone].filter(Boolean),t[0]=n.kind,t[1]=n.time,t[2]=n.timezone,t[3]=a):a=t[3];let o=a.join(` `),s;t[4]!==n.prompt||t[5]!==o?(s=o.trim()||(typeof n.prompt==`string`?n.prompt.trim():``),t[4]=n.prompt,t[5]=o,t[6]=s):s=t[6];let c=s,l=f(Qe),u;t[7]===l?u=t[8]:(u=e=>{Ye(e,l)},t[7]=l,t[8]=u);let d=f(u),p;t[9]!==r||t[10]!==i?(p=r(`assistants.contact.card.schedule.aria`,{name:i}),t[9]=r,t[10]=i,t[11]=p):p=t[11];let m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(`span`,{className:`relative inline-block size-6 shrink-0 leading-none`,children:(0,$.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-lg bg-[var(--surface-muted)] text-muted-foreground`,children:(0,$.jsx)(U,{name:`calendar`,className:`size-3`})})}),t[12]=m):m=t[12];let g;t[13]===i?g=t[14]:(g=(0,$.jsx)(`h3`,{className:`min-w-0 truncate typography-ui-label font-medium text-foreground`,children:i}),t[13]=i,t[14]=g);let _;t[15]===c?_=t[16]:(_=c?(0,$.jsx)(`p`,{className:`truncate typography-micro text-muted-foreground`,children:c}):null,t[15]=c,t[16]=_);let v;t[17]!==g||t[18]!==_?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[m,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[g,_]})]}),t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;return t[20]!==d||t[21]!==l||t[22]!==p||t[23]!==v?(y=(0,$.jsx)(`article`,{className:qe,role:`button`,tabIndex:0,"aria-label":p,"data-assistant-contact-card":`schedule`,onClick:l,onKeyDown:d,children:v}),t[20]=d,t[21]=l,t[22]=p,t[23]=v,t[24]=y):y=t[24],y};function Qe(){l.getState().setActiveMainTab(`schedule`),l.getState().setScheduledTasksDialogOpen(!0)}var $e=(e,t)=>e===`busy`||e===`retry`?e:t===`error`||t===`question`||t===`complete`?t:e===`idle`?`complete`:t===`busy`||t===`retry`||t===`idle`?t:t||`busy`,et=e=>e===`busy`?`assistants.contact.card.session.status.busy`:e===`retry`?`assistants.contact.card.session.status.retry`:e===`idle`?`assistants.contact.card.session.status.idle`:e===`complete`?`assistants.contact.card.session.status.complete`:e===`error`?`assistants.contact.card.session.status.error`:e===`question`?`assistants.contact.card.session.status.question`:null,tt=e=>e===`busy`?`bg-[var(--status-info)]/10 text-[var(--status-info)]`:e===`retry`||e===`question`?`bg-[var(--status-warning)]/10 text-[var(--status-warning)]`:e===`error`?`bg-[var(--status-error)]/10 text-[var(--status-error)]`:e===`idle`||e===`complete`?`bg-[var(--status-success)]/10 text-[var(--status-success)]`:`bg-[var(--surface-muted)] text-muted-foreground`,nt=e=>e.split(/[/\\]/u).filter(Boolean).at(-1)||e,rt=e=>{let t=(0,Z.c)(35),{card:n}=e,{t:r}=h(),i=se(),a;t[0]===i?a=t[1]:(a=i&&!c(),t[0]=i,t[1]=a);let o=!!a,s;t[2]===n.sessionID?s=t[3]:(s=e=>e.activeSessions.find(e=>e.id===n.sessionID)??e.archivedSessions.find(e=>e.id===n.sessionID)??null,t[2]=n.sessionID,t[3]=s);let u=y(s),d=b(n.sessionID),p=(typeof u?.title==`string`&&u.title.trim()?u.title.trim():null)||n.title||r(`assistants.contact.card.session.untitled`),m=$e(d?.type,n.status),g=et(m),_=m===`busy`||m===`retry`,v=nt(typeof u?.directory==`string`&&u.directory.trim()?u.directory.trim():n.directory),x=K(u)||n.branch,C=oe(u),w=J(u),ee=ce(w),T=[v,C,x].filter(it),E;t[4]!==n.directory||t[5]!==n.sessionID||t[6]!==o?(E=()=>{let e=he(n.sessionID)?.directory||n.directory;S(n.sessionID,e,{phoneShell:o,switchToChat:!0}),o||l.getState().setActiveMainTab(`chat`)},t[4]=n.directory,t[5]=n.sessionID,t[6]=o,t[7]=E):E=t[7];let D=f(E),O;t[8]===D?O=t[9]:(O=e=>{Ye(e,D)},t[8]=D,t[9]=O);let k=f(O),A=Je,j=r(`assistants.contact.card.session.aria`,{title:p}),M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-lg bg-[var(--surface-muted)] text-muted-foreground`,children:(0,$.jsx)(U,{name:`chat-3`,className:`size-3`})}),t[10]=M):M=t[10];let N;t[11]===_?N=t[12]:(N=_?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-0 bottom-0 size-2 translate-x-1/4 translate-y-1/4 rounded-full bg-[var(--status-success)] ring-2 ring-[var(--surface-elevated)]`,"data-assistant-working-dot":``,"aria-hidden":!0}):null,t[11]=_,t[12]=N);let P;t[13]===N?P=t[14]:(P=(0,$.jsxs)(`span`,{className:`relative inline-block size-6 shrink-0 leading-none`,children:[M,N]}),t[13]=N,t[14]=P);let F;t[15]===p?F=t[16]:(F=(0,$.jsx)(`h3`,{className:`min-w-0 flex-1 truncate typography-ui-label font-medium text-foreground`,children:p}),t[15]=p,t[16]=F);let I=g?(0,$.jsx)(`span`,{className:V(`shrink-0 rounded-full px-1.5 py-0.5 typography-micro leading-none`,tt(m)),children:r(g)}):null,L;t[17]!==F||t[18]!==I?(L=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[F,I]}),t[17]=F,t[18]=I,t[19]=L):L=t[19];let R;t[20]===T?R=t[21]:(R=T.length>0?(0,$.jsx)(`p`,{className:`truncate typography-micro text-muted-foreground`,children:T.join(` · `)}):null,t[20]=T,t[21]=R);let z=ee||w?.files!==void 0&&w.files>0?(0,$.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-1.5 typography-micro tabular-nums`,children:[w?.additions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-success)]`,children:[`+`,w.additions]}),w?.deletions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-error)]`,children:[`−`,w.deletions]}),w?.files===void 0?null:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:w.files===1?r(`assistants.contact.card.session.changes.filesSingle`,{count:w.files}):r(`assistants.contact.card.session.changes.filesPlural`,{count:w.files})})]}):null,B;t[22]!==L||t[23]!==R||t[24]!==z?(B=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[L,R,z]}),t[22]=L,t[23]=R,t[24]=z,t[25]=B):B=t[25];let H;t[26]!==P||t[27]!==B?(H=(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[P,B]}),t[26]=P,t[27]=B,t[28]=H):H=t[28];let W;return t[29]!==k||t[30]!==D||t[31]!==H||t[32]!==A||t[33]!==j?(W=(0,$.jsx)(`article`,{className:A,role:`button`,tabIndex:0,"aria-label":j,"data-assistant-contact-card":`session`,onClick:D,onKeyDown:k,children:H}),t[29]=k,t[30]=D,t[31]=H,t[32]=A,t[33]=j,t[34]=W):W=t[34],W};function it(e){return!!(e&&e.trim())}var at=2,ot=1500,st=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),ct=e=>e.scrollHeight-e.scrollTop-e.clientHeight,lt=e=>ct(e)<=at,ut=(e,t)=>{let n=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;n&&n!==e;){if(n instanceof HTMLElement&&n.scrollHeight>n.clientHeight+1&&n.scrollTop+n.clientHeight<n.scrollHeight-1)return!0;n=n.parentElement}return!1},dt=e=>e.altKey||e.ctrlKey||e.metaKey?!1:e.key===`ArrowDown`||e.key===`PageDown`||e.key===`End`,ft=({active:e,assistantID:t,contentRevision:n,onLoadEarlier:r})=>{let i=Q.useRef(null),[a,o]=Q.useState(null),[s,c]=Q.useState(null),l=Q.useRef(!0),u=Q.useRef(null),d=Q.useRef(null),h=Q.useRef(null),g=Q.useRef(0),_=Q.useRef(null),v=Q.useRef(null),y=Q.useRef(e);y.current=e;let b=Q.useMemo(()=>e=>{i.current=e,o(t=>t===e?t:e)},[]),x=Q.useMemo(()=>e=>{c(t=>t===e?t:e)},[]),S=f(()=>{let e=i.current;if(!e||!y.current||l.current)return;let t=e.getBoundingClientRect().top,n=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.getBoundingClientRect().bottom>t);u.current=n?{id:n.dataset.messageId,offset:n.getBoundingClientRect().top-t}:null}),C=f(()=>{let e=i.current,t=u.current;if(!e||!t||!y.current||l.current)return;if(Math.abs(e.scrollTop-g.current)>.5){g.current=e.scrollTop,S();return}let n=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.dataset.messageId===t.id);if(!n){S();return}let r=n.getBoundingClientRect().top-e.getBoundingClientRect().top-t.offset;Math.abs(r)>.5&&(e.scrollTop+=r),g.current=e.scrollTop}),w=f(()=>{l.current=!1,g.current=i.current?.scrollTop??0,S()}),ee=f(()=>{if(!y.current||!l.current)return!1;let e=i.current;if(!e)return!1;let t=st(e),n=Math.min(g.current,Math.max(0,t.scrollHeight-t.clientHeight));return t.scrollTop<n-.5?(l.current=!1,g.current=t.scrollTop,S(),!1):lt(t)?(g.current=t.scrollTop,!1):(e.scrollTop=e.scrollHeight,g.current=e.scrollTop,!0)}),T=f(e=>{v.current={direction:e,expiresAt:performance.now()+ot}}),E=f(()=>{let e=v.current;return e?performance.now()>e.expiresAt?(v.current=null,null):e.direction:null}),D=f(()=>{l.current=!1,S()}),O=f(()=>{if(!y.current)return;let e=i.current;if(!e)return;let t=st(e),n=t.scrollTop>g.current,a=Math.min(g.current,Math.max(0,t.scrollHeight-t.clientHeight));if(g.current=t.scrollTop,l.current){t.scrollTop<a-.5&&D();return}let o=E();S(),t.scrollTop<=80&&o===`up`&&r?.(),n&<(t)&&(o===`down`||o===`scrollbar`)&&(l.current=!0)}),k=f(e=>{let t=i.current;if(!(!t||e.deltaY===0)){if(e.deltaY<0){if(q(t,e.target))return;T(`up`),D(),t.scrollTop<=80&&r?.();return}ut(t,e.target)||T(`down`)}}),A=f(e=>{v.current=null;let t=e.touches.item(0);_.current=t?{x:t.clientX,y:t.clientY,deltaX:0,deltaY:0}:null}),j=f(e=>{let t=i.current,n=e.touches.item(0);if(!t||!n){_.current=null;return}let a=_.current;if(!a)return;let o=n.clientY-a.y,s=o*a.deltaY<0,c=(s?0:a.deltaX)+n.clientX-a.x,l=(s?0:a.deltaY)+o;if(_.current={x:n.clientX,y:n.clientY,deltaX:c,deltaY:l},!(Math.abs(c)>=Math.abs(l))){if(l>0&&q(t,e.target)||l<0&&ut(t,e.target)){_.current.deltaX=0,_.current.deltaY=0;return}T(l>0?`up`:`down`),l>2&&(D(),t.scrollTop<=80&&r?.())}}),M=f(()=>{_.current=null}),N=f(e=>{if(ie(e)){T(`up`),D(),(i.current?.scrollTop??1/0)<=80&&r?.();return}dt(e)&&T(`down`)}),P=f(e=>{let t=i.current;e.pointerType===`mouse`&&e.target===t&&T(`scrollbar`)});Q.useLayoutEffect(()=>{let n=e?t:null,r=i.current;(d.current!==n||h.current!==r)&&(d.current=n,h.current=r,l.current=!0,u.current=null,v.current=null,_.current=null,g.current=r?.scrollTop??0),e&&(ee(),C())},[e,t,n,a]);let F=Q.useMemo(()=>()=>void 0,[]),I=e&&a?a:F,L=Q.useMemo(()=>({passive:!0}),[]);p(`scroll`,O,I,L),p(`wheel`,k,I,L),p(`touchstart`,A,I,L),p(`touchmove`,j,I,L),p(`touchend`,M,I,L),p(`touchcancel`,M,I,L),p(`keydown`,N,I),p(`pointerdown`,P,I,L);let R=f(()=>{ee(),C()});return m(typeof ResizeObserver<`u`&&e?s:null,R),{scrollRef:b,contentRef:x,preparePrepend:w}},pt=64,mt=e=>{if(!e)return[];let t=Array.from(e.files||[]);return t.length>0?t:Array.from(e.items||[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e instanceof File)},ht=e=>Array.from(e?.files||[]),gt=async(e,t=i)=>{let n=[],r=0;for(let i of Array.from(e||[])){if(!i||i.size<=0)continue;if(i.size>26214400){r+=1;continue}let e=URL.createObjectURL(i);n.push({id:t(),url:e,name:i.name.trim()||`attachment`,mime:i.type.trim()||`application/octet-stream`,file:i})}return{attachments:n,skippedTooLarge:r}},_t=(e,t)=>{let n=[...e,...t];for(let e of n.slice(pt))e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url);return n.slice(0,pt)},vt=e=>e.trim().startsWith(`oc.settle.`),yt=({assistant:e,warning:t,active:n,overlayHeader:r=!1})=>{let{t:a}=h(),o=re(),s=l(e=>e.isMobile),c=O(),u=C(),d=T(e.id,n),p=g(e.name),m=p.displayName||e.name,y=(e,t)=>{let n=e?u.data?.assistants.find(t=>t.id===e):void 0;return n?g(n.name).displayName||n.name:t||a(`assistants.contact.peer.unknown`)},[b,x]=Q.useState(``),[S,w]=Q.useState([]),D=Q.useRef(null),k=Q.useRef(new Map),A=Q.useRef(new AbortController);Q.useEffect(()=>{let e=new AbortController;return A.current=e,()=>e.abort()},[e.id,o]);let M=Q.useRef(new Set);Q.useEffect(()=>{let e=new Set(S.map(e=>e.url));for(let t of M.current)e.has(t)||URL.revokeObjectURL(t);M.current=e},[S]),Q.useEffect(()=>()=>{for(let e of M.current)URL.revokeObjectURL(e)},[]);let[N,P]=Q.useState([]),[F,I]=Q.useState([]),[L,R]=Q.useState(null);Q.useEffect(()=>{k.current.clear(),D.current=null,P([]),I([]),R(null)},[o]);let z=Q.useMemo(()=>He(),[]),B=Q.useRef(new Set),H=Q.useRef(new Map),te=_e(e=>e.setWorking),G=d.data?.messages??we,ie=De(N,e.id),oe=Oe(F,e.id),K=je(G,ie,e.id,oe).filter(e=>{let t=Array.isArray(e.parts)?e.parts:[];return t.length===0||t.some(e=>!(e.type===`text`&&vt(e.text)))}),q=We(ie),se=Ge(oe),J=!!(e.working||e.activeContactTurn),ce=u.data?.revision??null,le=oe.reduce((e,t)=>e+t.bubbles.reduce((e,t)=>e+t.text.length,0),0),Y=new Map(oe.map(e=>[e.turnID,e])),ue=Q.useRef(!1),de=f(async(e=!1)=>{if(!(!n||ue.current||d.isFetchingPreviousPage||d.isFillingMessageGap)&&!(e&&d.previousPageError)&&!(!d.hasPreviousPage&&!d.hasMessageGap)){ue.current=!0,me();try{d.hasMessageGap?await d.retryMessageGap():await d.fetchPreviousPage()}catch{}finally{ue.current=!1}}}),{scrollRef:fe,contentRef:X,preparePrepend:me}=ft({active:n,assistantID:e.id,contentRevision:`${K[0]?.messageID}:${K.length}:${le}:${d.isFetchingPreviousPage}:${d.hasPreviousPage}:${d.isFillingMessageGap}`,onLoadEarlier:()=>{de(!0)}});Q.useEffect(()=>{R(null),B.current.clear(),H.current=new Map,P(t=>De(t,e.id)),I(t=>Oe(t,e.id))},[e.id]),Q.useEffect(()=>{P(e=>Me(e,G))},[G]),Q.useEffect(()=>{let t=new Set(ie.filter(e=>e.status===`sending`).map(e=>e.messageID));I(n=>Ie(n,{assistantID:e.id,activeContactTurn:e.activeContactTurn?{turnID:e.activeContactTurn.turnID,admittedAt:e.activeContactTurn.admittedAt}:null,serverWorking:J,snapshotRevision:ce,admissionRevisionByTurnID:H.current,pendingSendTurnIDs:t,messages:G,settledTurnIDs:B.current}))},[e.activeContactTurn,e.id,G,ie,J,ce]),Q.useEffect(()=>{te(e.id,q||se||J)},[e.id,se,q,J,te]),Q.useEffect(()=>{let t=e.id;return()=>{te(t,!1)}},[e.id,te]);let he=f(t=>{if(!(!(`assistantID`in t)||t.assistantID!==e.id)){if(t.type===`contact-turn-start`){B.current.delete(t.turnID),I(e=>Pe(e,t.assistantID,t.turnID,t.occurredAt));return}if(t.type===`contact-bubble-delta`){if(B.current.has(t.turnID))return;I(e=>Le(e,t));return}t.type===`contact-turn-end`&&(B.current.add(t.turnID),I(e=>ze(Re(e,t,{requireExisting:!0}),G)))}});Q.useEffect(()=>{if(n)return v(he)},[n,e.id]);let Z=f(async e=>{if(q)return;let t=A.current,n=await gt(e);if(t.signal.aborted){n.attachments.forEach(e=>URL.revokeObjectURL(e.url));return}n.skippedTooLarge>0&&R(a(`assistants.contact.attachment.tooLarge`)),n.attachments.length!==0&&w(e=>_t(e,n.attachments))}),ve=f(e=>{let t=mt(e.clipboardData);t.length!==0&&(e.preventDefault(),Z(t))}),ye=f(e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}),be=f(e=>{let t=ht(e.dataTransfer);t.length!==0&&(e.preventDefault(),Z(t))}),xe=f(async()=>{let t=A.current,n=b,r=S,o=e.id,s=D.current,l=s?.assistantID===o&&s.text===n&&s.attachments===r?s.messageID:null,u=Ue({gate:z,sending:We(ie),text:n,attachments:r,assistantID:o,createMessageID:()=>l||`oc_contact_${i()}`});if(!u.ok)return;D.current={assistantID:o,text:n,attachments:r,messageID:u.messageID},P(e=>[...e.filter(e=>e.messageID!==u.messageID),u.turn]),R(null);let d=()=>{x(e=>e===n?``:e),w(e=>e.filter(e=>!r.includes(e))),r.forEach(e=>k.current.delete(`${o}:${e.id}`)),D.current=null};try{let e=[];for(let n of r){let r=`${o}:${n.id}`,i=k.current.get(r);if(!i){if(i=await pe(o,n.file,n.id,t.signal),t.signal.aborted)return;k.current.set(r,i)}e.push(i)}if(t.signal.aborted)return;let n=[...u.parts.filter(e=>e.type===`text`),...e];P(e=>e.map(e=>e.messageID===u.messageID?{...e,parts:n}:e));let i=await ee(o,u.messageID,{parts:n});if(t.signal.aborted)return;d(),typeof i.revision==`number`&&H.current.set(u.messageID,i.revision),P(e=>Ne(e,u.messageID)),B.current.has(u.messageID)||I(e=>Pe(e,o,u.messageID)),c.data?.serverInstanceID&&_({serverInstanceID:c.data.serverInstanceID,assistantID:o,name:m,avatarSeed:o,...p.avatarEmoji?{avatarEmoji:p.avatarEmoji}:{}}).catch(()=>void 0)}catch(e){if(t.signal.aborted)return;if(e instanceof j&&e.code===`admission_timeout`)try{let e=await E(o,u.messageID);if(t.signal.aborted)return;if(e){d(),typeof e.revision==`number`&&H.current.set(u.messageID,e.revision),P(e=>Ne(e,u.messageID)),B.current.has(u.messageID)||I(e=>Pe(e,o,u.messageID));return}}catch{}let n=Ve(e,{noProvider:a(`assistants.contact.noProvider`),sendFailed:a(`assistants.contact.sendFailed`),timedOut:a(`assistants.contact.timedOut`)});P(e=>Be(e,u.messageID,n)),R(n)}finally{z.release()}}),Se=d.isError&&K.length===0,Te=d.isSuccess&&K.length===0,Ee=new Map(ie.map(e=>[e.messageID,e]));return(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,$.jsxs)(`div`,{ref:fe,className:V(`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-4 pb-9 sm:px-8 sm:pb-12`,r?`pt-[calc(max(0.625rem,var(--oc-safe-area-top,0px))+var(--oc-mobile-detail-navigation-height)+1.25rem)]`:`pt-5 sm:pt-7`),style:{overflowAnchor:`none`,overscrollBehavior:`contain`,overscrollBehaviorY:`contain`},"data-assistant-contact-transcript":``,children:[t?(0,$.jsx)(`p`,{className:`mb-3 typography-micro text-[var(--status-warning)]`,children:t}):null,Se?(0,$.jsxs)(`div`,{ref:X,className:`mx-auto flex h-full min-h-56 max-w-xs flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-error":``,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ge,{name:e.id,emoji:p.avatarEmoji,size:44,label:m}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`absolute -right-1 -bottom-1 flex size-5 items-center justify-center rounded-full bg-[var(--surface-elevated)] text-[var(--status-error)] ring-2 ring-background`,children:(0,$.jsx)(U,{name:`error-warning`,className:`size-3`})})]}),(0,$.jsx)(`p`,{className:`mt-4 typography-ui-label font-medium text-foreground`,children:m}),(0,$.jsx)(`p`,{className:`mt-1.5 typography-ui leading-6 text-muted-foreground`,children:a(`assistants.contact.loadFailed`)}),(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void d.refetch(),children:a(`chat.history.retry`)})]}):Te?(0,$.jsxs)(`div`,{ref:X,className:`mx-auto flex h-full min-h-56 max-w-sm flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-empty":``,children:[(0,$.jsx)(ge,{name:e.id,emoji:p.avatarEmoji,size:48,label:m,className:`opacity-90`}),(0,$.jsx)(`p`,{className:`mt-5 typography-ui-header font-medium tracking-[-0.01em] text-foreground`,children:a(`assistants.conversation.emptyTitle`,{name:m})}),(0,$.jsx)(`p`,{className:`mt-2 max-w-xs typography-ui leading-6 text-muted-foreground/80`,children:a(`assistants.contact.empty`)})]}):(0,$.jsxs)(`div`,{ref:X,className:`mx-auto flex w-full max-w-[42rem] flex-col`,children:[d.isPending?(0,$.jsx)(`p`,{role:`status`,className:`py-3 text-center typography-micro text-muted-foreground`,children:a(`common.loading`)}):null,d.hasPreviousPage||d.hasMessageGap?(0,$.jsxs)(`div`,{className:`mb-3 flex flex-col items-center gap-1`,"data-assistant-contact-pagination":``,"aria-busy":d.isFetchingPreviousPage||d.isFillingMessageGap,children:[d.previousPageError?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:a(`chat.history.loadOlderFailed`)}):null,d.hasMessageGap?(0,$.jsx)(`p`,{role:`status`,className:`typography-micro text-muted-foreground`,children:a(`assistants.contact.history.gap`)}):null,(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,disabled:d.isFetchingPreviousPage||d.isFillingMessageGap,onClick:()=>void de(),children:a(d.isFetchingPreviousPage||d.isFillingMessageGap?`chat.history.loadingMore`:d.previousPageError||d.hasMessageGap?`chat.history.retry`:`chat.history.loadOlder`)})]}):null,K.map((t,n)=>{let r=n>0?K[n-1]:null,i=t.role===`user`,o=t.role===`peer`,s=t.role===`assistant`&&r?.role===`assistant`&&r.turnID===t.turnID,c=r?.turnID!==t.turnID,l=!i&&(o||!s),d=o?y(t.fromAssistantID,t.fromAssistantName):m,f=o&&t.fromAssistantID?u.data?.assistants.find(e=>e.id===t.fromAssistantID):e,p=f?g(f.name):null,h=Ee.get(t.messageID),_=Y.get(t.turnID),v=t.status===`admitted`&&t.messageID.endsWith(`:preview:admitted`),b=t.status===`failed`&&t.messageID.endsWith(`:preview:failed`);return(0,$.jsxs)(`div`,{"data-message-id":t.messageID,className:V(`flex w-full`,i?`justify-end`:`justify-start`,c?`mt-6 first:mt-0`:s?`mt-1.5`:`mt-3`),"data-assistant-contact-role":t.role,"data-assistant-contact-turn-status":h?.status??t.status,"data-assistant-contact-run-start":t.role===`assistant`&&!s?``:void 0,children:[i?null:(0,$.jsx)(`div`,{className:`mr-2.5 flex w-8 shrink-0 justify-center pt-0.5`,children:l?(0,$.jsx)(ge,{name:f?.id||t.fromAssistantID||e.id,emoji:p?.avatarEmoji,size:28,label:d}):(0,$.jsx)(`span`,{className:`size-7`,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:V(`flex min-w-0 flex-col gap-1.5`,i?`max-w-[min(82%,30rem)] items-end`:`max-w-[min(84%,34rem)] items-start`),children:[o?(0,$.jsx)(`span`,{className:`mb-0.5 px-1 typography-micro text-muted-foreground/75`,children:a(`assistants.contact.peer.from`,{name:d})}):null,v?(0,$.jsxs)(`div`,{role:`status`,"aria-label":a(`assistants.contact.processing`),className:`inline-flex w-fit items-center gap-1 rounded-full bg-[var(--surface-muted)] px-3.5 py-2.5 text-muted-foreground/70`,"data-assistant-contact-processing":``,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.45s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.22s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-duration:1.4s] motion-reduce:animate-none`})]}):null,t.parts.map((n,r)=>{if(n.type===`card`&&n.cardType===`session`)return(0,$.jsx)(rt,{card:n},`${t.messageID}:card:${r}`);if(n.type===`card`&&n.cardType===`assistant`)return(0,$.jsx)(Xe,{card:n},`${t.messageID}:card:${r}`);if(n.type===`card`&&n.cardType===`schedule`)return(0,$.jsx)(Ze,{card:n},`${t.messageID}:card:${r}`);if(n.type===`file`)return(0,$.jsx)(Ce,{assistantID:e.id,part:n},`${t.messageID}:file:${r}`);if(n.type===`text`&&vt(n.text))return null;if(n.type===`text`&&(n.text.trim()||t.status===`streaming`)){let e=!i;return(0,$.jsxs)(`div`,{"aria-label":o?a(`assistants.contact.peer.aria`,{name:d}):void 0,"data-assistant-contact-text":``,className:V(`min-w-0 max-w-full [overflow-wrap:anywhere] rounded-[1.35rem] px-4 py-2.5 typography-markdown leading-6`,e?null:`whitespace-pre-wrap`,i?`rounded-[1.15rem] rounded-br-lg bg-[var(--primary-base)]/90 text-[var(--primary-foreground)]`:o?`rounded-[1.25rem] border border-dashed border-border/50 bg-[var(--surface-muted)]/70 text-foreground`:V(`bg-[var(--surface-muted)] text-foreground`,s&&`rounded-tl-lg`)),children:[e?(0,$.jsx)(ne,{content:n.text,messageId:t.messageID,isAnimated:!1,isStreaming:t.status===`streaming`,variant:`assistant`,enableFileReferences:!1,className:`w-full min-w-0 [overflow-wrap:anywhere]`}):n.text,t.status===`streaming`&&r===t.parts.length-1?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`ml-0.5 inline-block h-[1em] w-px translate-y-[0.12em] animate-pulse bg-current opacity-45 [animation-duration:1.1s] motion-reduce:animate-none`,"data-assistant-contact-streaming-caret":``}):null]},`${t.messageID}:text:${r}`)}return null}),h?.status===`sending`?(0,$.jsx)(`p`,{className:`px-1 typography-micro text-muted-foreground/75`,children:a(`assistants.contact.sending`)}):null,h?.status===`failed`?(0,$.jsx)(`p`,{className:`px-1 typography-micro text-[var(--status-error)]`,children:h.error||a(`assistants.contact.sendFailed`)}):null,b?(0,$.jsx)(`p`,{className:`px-1 typography-micro text-[var(--status-error)]`,children:_?.error||a(`assistants.contact.sendFailed`)}):null]})]},t.messageID)})]})]}),(0,$.jsxs)(`footer`,{className:`relative z-10 shrink-0 bg-background pt-1`,"data-assistant-contact-composer":``,children:[L?(0,$.jsxs)(`div`,{className:`chat-input-column mb-2 flex items-center gap-2`,children:[(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:L}),D.current?(0,$.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,disabled:q,onClick:()=>void xe(),children:a(`chat.history.retry`)}):null]}):null,(0,$.jsx)(`form`,{className:V(`relative w-full pt-1.5 pb-4`,s&&`bottom-safe-area oc-mobile-composer`),onSubmit:e=>{e.preventDefault(),xe()},onDragOver:ye,onDrop:be,children:(0,$.jsx)(`div`,{className:`chat-input-column relative overflow-visible`,children:(0,$.jsx)(ae,{layout:`inline`,value:b,attachments:S,pending:q,isMobile:s,placeholder:a(`assistants.contact.placeholder`,{name:m}),sendLabel:a(`assistants.contact.send`),addFilesLabel:a(`assistants.contact.addFiles`),removeAttachmentLabel:a(`assistants.contact.removeAttachment`),fileAccept:`*/*`,onChange:e=>x(e),onSubmit:()=>{xe()},onAddFiles:e=>{Z(e)},onRemoveAttachment:t=>{q||(k.current.delete(`${e.id}:${t}`),D.current=null,w(e=>e.filter(e=>e.id!==t)))},onPaste:ve,onDragOver:ye,onDrop:be,className:V(`relative z-10`,s&&`oc-mobile-composer-surface`),style:{borderRadius:`1.5rem`},"data-assistant-contact-composer-surface":``,textareaProps:{"aria-label":a(`assistants.contact.placeholder`,{name:m})}})})})]})]})};async function bt(e){await w(e);let t=M.getState().defaultShareAssistant;if(t?.assistantID!==e.id)return;let n=await D();n.serverInstanceID&&t.serverInstanceID===n.serverInstanceID&&M.getState().setDefaultShareAssistant(null)}function xt({assistant:e,open:t,onOpenChange:n,onDeleted:r}){let{t:i}=h(),[a,o]=Q.useState(!1),s=e?g(e.name).displayName||e.name:``,c=f(e=>{a&&!e||n(e)}),l=f(()=>{a||n(!1)}),u=f(async()=>{if(!(!e||a)){o(!0);try{await bt(e),r?.(e.id),n(!1),d.success(i(`assistants.settings.toast.deleted`))}catch{d.error(i(`assistants.settings.toast.deleteFailed`))}finally{o(!1)}}});return(0,$.jsx)(B,{open:t&&e!==null,onOpenChange:c,children:(0,$.jsxs)(L,{className:`max-w-md`,children:[(0,$.jsxs)(F,{children:[(0,$.jsx)(R,{children:i(`assistants.settings.delete`)}),(0,$.jsx)(z,{children:i(`assistants.settings.deleteConfirm`,{name:s})})]}),(0,$.jsxs)(I,{children:[(0,$.jsx)(W,{size:`sm`,variant:`ghost`,onClick:l,disabled:a,children:i(`settings.common.actions.cancel`)}),(0,$.jsx)(W,{size:`sm`,variant:`destructive`,onClick:u,disabled:a,children:i(`settings.common.actions.delete`)})]})]})})}var St=`line-clamp-2 min-w-0 max-w-full overflow-clip whitespace-normal [overflow-wrap:anywhere] typography-micro text-muted-foreground`,Ct={image:`assistants.contact.attachment.image`,file:`assistants.contact.attachment.file`,session:`assistants.contact.card.session.untitled`,assistant:`assistants.title`,schedule:`assistants.settings.scheduledTasks.title`};function wt(e,t){return e?.text.replace(/\s+/gu,` `).trim()||t(e?.fallbackKind?Ct[e.fallbackKind]:`assistants.contact.empty`)}var Tt=e=>e.capabilityPending?`loading`:e.capabilityError||e.supported!==!0||e.capabilityEnabled!==!0?`unavailable`:e.snapshotPending?`loading`:e.snapshotEnabled===!0?e.assistantCount===0?`onboarding`:e.hasAssistant?`ready`:e.snapshotSettled?`unavailable`:`loading`:`unavailable`,Et=t({AssistantView:()=>kt}),Dt=e=>{let t=(0,Z.c)(21),{assistant:n,onBack:r}=e,{t:i}=h(),a=se(),o;t[0]===n?o=t[1]:(o=n?g(n.name):null,t[0]=n,t[1]=o);let s=o,c=n&&s?s.displayName||n.name:``,l;t[2]!==n||t[3]!==a?(l=()=>{n&&P(n.id,a?{openMobileSettings:a.openSettings}:void 0)},t[2]=n,t[3]=a,t[4]=l):l=t[4];let u=f(l),d;t[5]!==n||t[6]!==c||t[7]!==s?.avatarEmoji||t[8]!==i?(d=n?(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(ge,{name:n.id,emoji:s?.avatarEmoji,size:28,label:c}),(0,$.jsx)(`span`,{className:`truncate font-medium tracking-[-0.01em]`,children:c||i(`assistants.title`)})]}):c||i(`assistants.title`),t[5]=n,t[6]=c,t[7]=s?.avatarEmoji,t[8]=i,t[9]=d):d=t[9];let p;t[10]===i?p=t[11]:(p=i(`assistants.actions.backToChat`),t[10]=i,t[11]=p);let m;t[12]!==n||t[13]!==u||t[14]!==i?(m=n?[{icon:`settings-3`,ariaLabel:i(`assistants.conversation.openSettings`),onClick:u}]:[],t[12]=n,t[13]=u,t[14]=i,t[15]=m):m=t[15];let _;return t[16]!==r||t[17]!==d||t[18]!==p||t[19]!==m?(_=(0,$.jsx)(k,{title:d,backAriaLabel:p,onBack:r,actions:m,overlay:!0}),t[16]=r,t[17]=d,t[18]=p,t[19]=m,t[20]=_):_=t[20],_},Ot=e=>{let t=(0,Z.c)(47),{summary:n,assistantID:r,displayName:i,avatarEmoji:a,selected:o,enabled:s,editLabel:c,deleteLabel:l,onSelect:u,onEdit:d,onDelete:p,serverWorking:m}=e,h=ye(r,m!==void 0&&m),[g,_]=Q.useState(!1),v;t[0]===u?v=t[1]:(v=()=>u(),t[0]=u,t[1]=v);let y=f(v),b;t[2]===d?b=t[3]:(b=()=>{_(!1),d()},t[2]=d,t[3]=b);let x=f(b),S;t[4]===p?S=t[5]:(S=()=>{_(!1),p()},t[4]=p,t[5]=S);let C=f(S),w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e.preventDefault(),_(!0)},t[6]=w):w=t[6];let ee=o?`border-border/50 bg-[var(--surface-elevated)]`:`border-transparent hover:bg-interactive-hover`,T=!s&&`opacity-65`,E;t[7]!==ee||t[8]!==T?(E=V(`flex w-full min-h-11 items-center gap-3 rounded-xl border px-3 py-3 text-left outline-none transition-[background-color,border-color,opacity] duration-150 ease-out active:bg-interactive-active focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,ee,T),t[7]=ee,t[8]=T,t[9]=E):E=t[9];let D;t[10]!==y||t[11]!==o||t[12]!==E?(D=(0,$.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":o,onClick:y,onContextMenu:w,className:E}),t[10]=y,t[11]=o,t[12]=E,t[13]=D):D=t[13];let O;t[14]!==r||t[15]!==a||t[16]!==i||t[17]!==h?(O=(0,$.jsx)(ge,{name:r,emoji:a,size:24,label:i,working:h}),t[14]=r,t[15]=a,t[16]=i,t[17]=h,t[18]=O):O=t[18];let k;t[19]===i?k=t[20]:(k=(0,$.jsx)(`span`,{className:`block truncate typography-ui-label font-medium`,children:i}),t[19]=i,t[20]=k);let A;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(A=V(St,`mt-1.5`),t[21]=A):A=t[21];let j;t[22]===n?j=t[23]:(j=(0,$.jsx)(`span`,{className:A,children:n}),t[22]=n,t[23]=j);let M;t[24]!==k||t[25]!==j?(M=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[k,j]}),t[24]=k,t[25]=j,t[26]=M):M=t[26];let N;t[27]!==O||t[28]!==M||t[29]!==D?(N=(0,$.jsxs)(le,{render:D,children:[O,M]}),t[27]=O,t[28]=M,t[29]=D,t[30]=N):N=t[30];let P;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(U,{name:`edit`,className:`size-4`}),t[31]=P):P=t[31];let F;t[32]!==c||t[33]!==x?(F=(0,$.jsxs)(de,{onClick:x,children:[P,c]}),t[32]=c,t[33]=x,t[34]=F):F=t[34];let I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(Y,{}),t[35]=I):I=t[35];let L;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(U,{name:`delete-bin`,className:`size-4`}),t[36]=L):L=t[36];let R;t[37]!==l||t[38]!==C?(R=(0,$.jsxs)(de,{onClick:C,className:`text-[var(--status-error)] focus:text-[var(--status-error)] data-[highlighted]:text-[var(--status-error)] [&_svg]:text-[var(--status-error)]`,children:[L,l]}),t[37]=l,t[38]=C,t[39]=R):R=t[39];let z;t[40]!==F||t[41]!==R?(z=(0,$.jsxs)(ue,{className:`min-w-[10rem]`,children:[F,I,R]}),t[40]=F,t[41]=R,t[42]=z):z=t[42];let B;return t[43]!==g||t[44]!==N||t[45]!==z?(B=(0,$.jsxs)(fe,{open:g,onOpenChange:_,children:[N,z]}),t[43]=g,t[44]=N,t[45]=z,t[46]=B):B=t[46],B},kt=e=>{let t=(0,Z.c)(110),{activeOverride:i,onMobileBack:a}=e,{t:o}=h(),{isMobile:s}=te(),c=se(),u=Q.useSyncExternalStore(n,r,r),d=l(At),p=i??d,m=l(jt),_=s||m,v=O(),y=C(),b=y.data,x;t[0]===u?x=t[1]:(x=e=>e.assistantByTransport[u]??null,t[0]=u,t[1]=x);let S=M(x),w=M(Mt),ee=M(Nt),T;t[2]!==S||t[3]!==b?.assistants?(T=b?.assistants.find(e=>e.id===S)??null,t[2]=S,t[3]=b?.assistants,t[4]=T):T=t[4];let E=T,D;t[5]!==w||t[6]!==S||t[7]!==b?(D=()=>{!S&&b?.assistants[0]&&w(b.assistants[0].id)},t[5]=w,t[6]=S,t[7]=b,t[8]=D):D=t[8];let k=b?.assistants,A;t[9]!==w||t[10]!==S||t[11]!==k?(A=[w,S,k],t[9]=w,t[10]=S,t[11]=k,t[12]=A):A=t[12],Q.useEffect(D,A);let j;t[13]!==E||t[14]!==w||t[15]!==S||t[16]!==b?.assistants||t[17]!==y.isSuccess?(j=()=>{y.isSuccess&&S&&!E&&w(b?.assistants[0]?.id??null)},t[13]=E,t[14]=w,t[15]=S,t[16]=b?.assistants,t[17]=y.isSuccess,t[18]=j):j=t[18];let N=b?.assistants,F;t[19]!==E||t[20]!==w||t[21]!==S||t[22]!==y.isSuccess||t[23]!==N?(F=[E,w,S,N,y.isSuccess],t[19]=E,t[20]=w,t[21]=S,t[22]=y.isSuccess,t[23]=N,t[24]=F):F=t[24],Q.useEffect(j,F);let I;t[25]!==c||t[26]!==ee?(I=()=>{if(ee(),c){c.openSettings();return}let e=l.getState();e.setSettingsPage(`assistants`),e.setSettingsDialogOpen(!0)},t[25]=c,t[26]=ee,t[27]=I):I=t[27];let L=f(I),R;t[28]===c?R=t[29]:(R=e=>{P(e,c?{openMobileSettings:c.openSettings}:void 0)},t[28]=c,t[29]=R);let z=f(R),B;t[30]!==E||t[31]!==c?(B=()=>{E&&P(E.id,c?{openMobileSettings:c.openSettings}:void 0)},t[30]=E,t[31]=c,t[32]=B):B=t[32];let H=f(B),[ne,re]=Q.useState(null),G;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{re(e)},t[33]=G):G=t[33];let ie=f(G),ae;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e||re(null)},t[34]=ae):ae=t[34];let oe=f(ae),K=f(Pt),q;t[35]!==a||t[36]!==K?(q=()=>{if(a){a();return}K()},t[35]=a,t[36]=K,t[37]=q):q=t[37];let J=f(q),ce=Tt({capabilityPending:v.isPending,snapshotPending:y.isPending,capabilityError:v.isError,supported:v.data?.supported,capabilityEnabled:v.data?.enabled,snapshotEnabled:b?.enabled,snapshotSettled:y.isSuccess,assistantCount:b?.assistants.length??0,hasAssistant:!!E}),le;t[38]!==E||t[39]!==J||t[40]!==_?(le=(e,t,n,r)=>(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[_?(0,$.jsx)(Dt,{assistant:E,onBack:J}):null,(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--oc-safe-area-top,0px))+var(--oc-mobile-detail-navigation-height,3.5rem))] text-center`,children:[(0,$.jsx)(U,{name:e,className:`size-6 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`mt-4 typography-ui-header font-semibold`,children:t}),n?(0,$.jsx)(`p`,{className:`mt-2 max-w-md typography-ui text-muted-foreground`,children:n}):null,r?(0,$.jsx)(`div`,{className:`mt-5`,children:r}):null]})]}),t[38]=E,t[39]=J,t[40]=_,t[41]=le):le=t[41];let Y=le;if(ce===`loading`){let e;t[42]!==E||t[43]!==J||t[44]!==_?(e=_?(0,$.jsx)(Dt,{assistant:E,onBack:J}):null,t[42]=E,t[43]=J,t[44]=_,t[45]=e):e=t[45];let n;t[46]===o?n=t[47]:(n=o(`common.loading`),t[46]=o,t[47]=n);let r;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(U,{name:`loader-4`,className:`size-6 animate-spin text-muted-foreground`}),t[48]=r):r=t[48];let i;t[49]===n?i=t[50]:(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--oc-safe-area-top,0px))+var(--oc-mobile-detail-navigation-height,3.5rem))] text-center`,"aria-busy":`true`,"aria-label":n,"data-assistant-workspace-loading":``,children:r}),t[49]=n,t[50]=i);let a;return t[51]!==e||t[52]!==i?(a=(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[e,i]}),t[51]=e,t[52]=i,t[53]=a):a=t[53],a}if(ce===`unavailable`){let e;return t[54]!==Y||t[55]!==o?(e=Y(`cloud-off`,o(`assistants.state.unavailable`)),t[54]=Y,t[55]=o,t[56]=e):e=t[56],e}if(ce===`onboarding`){let e;if(t[57]!==L||t[58]!==Y||t[59]!==o){let n=o(`assistants.onboarding.title`),r=o(`assistants.onboarding.description`),i;t[61]===o?i=t[62]:(i=o(`assistants.onboarding.action`),t[61]=o,t[62]=i);let a;t[63]!==L||t[64]!==i?(a=(0,$.jsx)(W,{onClick:L,children:i}),t[63]=L,t[64]=i,t[65]=a):a=t[65],e=Y(`ai-agent`,n,r,a),t[57]=L,t[58]=Y,t[59]=o,t[60]=e}else e=t[60];return e}if(!b||!E){let e;return t[66]!==Y||t[67]!==o?(e=Y(`cloud-off`,o(`assistants.state.unavailable`)),t[66]=Y,t[67]=o,t[68]=e):e=t[68],e}let ue;t[69]===E.name?ue=t[70]:(ue=g(E.name),t[69]=E.name,t[70]=ue);let de=ue,fe;t[71]!==E.enabled||t[72]!==y.isError||t[73]!==o?(fe=E.enabled?y.isError?o(`assistants.state.staleSnapshot`):null:o(`assistants.state.assistantDisabled`),t[71]=E.enabled,t[72]=y.isError,t[73]=o,t[74]=fe):fe=t[74];let pe=fe,X;t[75]!==_||t[76]!==L||t[77]!==z||t[78]!==ie||t[79]!==w||t[80]!==S||t[81]!==b||t[82]!==o?(X=_?null:(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 w-[clamp(16rem,22vw,20rem)] shrink-0 flex-col overflow-hidden`,children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 px-4 pb-3 pt-4 sm:px-5`,children:[(0,$.jsx)(`h1`,{className:`min-w-0 flex-1 truncate typography-ui-label font-semibold text-foreground`,children:o(`assistants.title`)}),(0,$.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":o(`assistants.settings.create`),onClick:L,children:(0,$.jsx)(U,{name:`add`,className:`size-4`})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-4 sm:px-4`,role:`listbox`,"aria-label":o(`assistants.listAria`),children:(0,$.jsx)(`div`,{className:`flex flex-col gap-1 border-t border-border/40 pt-3`,children:b.assistants.map(e=>{let t=e.id===S,n=g(e.name);return(0,$.jsx)(Ot,{assistantID:e.id,summary:wt(e.latestMessagePreview,o),displayName:n.displayName,avatarEmoji:n.avatarEmoji??void 0,selected:t,enabled:e.enabled,editLabel:o(`assistants.menu.edit`),deleteLabel:o(`assistants.settings.delete`),assignedSessionIDs:e.assignedSessionIDs,serverWorking:e.working,onSelect:()=>w(e.id),onEdit:()=>z(e.id),onDelete:()=>ie(e)},e.id)})})})]}),t[75]=_,t[76]=L,t[77]=z,t[78]=ie,t[79]=w,t[80]=S,t[81]=b,t[82]=o,t[83]=X):X=t[83];let me=ne!==null,he;t[84]!==ne||t[85]!==oe||t[86]!==me?(he=(0,$.jsx)(xt,{assistant:ne,open:me,onOpenChange:oe}),t[84]=ne,t[85]=oe,t[86]=me,t[87]=he):he=t[87];let _e=!_&&`border-l border-[var(--surface-subtle)]`,ve;t[88]===_e?ve=t[89]:(ve=V(`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,_e),t[88]=_e,t[89]=ve);let ye;t[90]!==E||t[91]!==J||t[92]!==_||t[93]!==H||t[94]!==de||t[95]!==o?(ye=_?(0,$.jsx)(Dt,{assistant:E,onBack:J}):(0,$.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center gap-3.5 border-b border-[var(--surface-subtle)]/70 px-5 sm:px-7`,children:[(0,$.jsx)(ge,{name:E.id,emoji:de.avatarEmoji,size:30,label:de.displayName||E.name}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate typography-ui-label font-semibold tracking-[-0.01em] text-foreground`,children:de.displayName}),(0,$.jsx)(`div`,{className:`mt-1 truncate typography-micro leading-none text-muted-foreground/55`,children:o(`assistants.conversation.contactHint`)})]}),(0,$.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 rounded-full text-muted-foreground/65 transition-colors hover:text-foreground`,onClick:H,"aria-label":o(`assistants.conversation.openSettings`),children:(0,$.jsx)(U,{name:`settings-3`,className:`size-4`})})]}),t[90]=E,t[91]=J,t[92]=_,t[93]=H,t[94]=de,t[95]=o,t[96]=ye):ye=t[96];let be;t[97]!==p||t[98]!==E||t[99]!==_||t[100]!==pe?(be=(0,$.jsx)(yt,{assistant:E,warning:pe,active:p,overlayHeader:_}),t[97]=p,t[98]=E,t[99]=_,t[100]=pe,t[101]=be):be=t[101];let xe;t[102]!==ve||t[103]!==ye||t[104]!==be?(xe=(0,$.jsxs)(`div`,{className:ve,children:[ye,be]}),t[102]=ve,t[103]=ye,t[104]=be,t[105]=xe):xe=t[105];let Se;return t[106]!==X||t[107]!==he||t[108]!==xe?(Se=(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 overflow-hidden bg-background`,"data-presentation":`workspace`,children:[X,he,xe]}),t[106]=X,t[107]=he,t[108]=xe,t[109]=Se):Se=t[109],Se};function At(e){return e.activeMainTab===`assistant`}function jt(e){return e.isMobile}function Mt(e){return e.selectAssistant}function Nt(e){return e.requestCreate}function Pt(){l.getState().setActiveMainTab(`chat`)}export{xt as a,wt as i,Et as n,ye as o,St as r,ge as s,kt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{t as r}from"./utils-BHTVlVov.js";var i=e(n(),1),a={add:`<path d="M5 12h14" /> <path d="M12 5v14" />`,"add-circle":`<circle cx="12" cy="12" r="10" /> <path d="M8 12h8" /> <path d="M12 8v8" />`,"ai-agent":`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,"ai-agent-fill":`<path d="M12 8V4H8" fill="currentColor"/> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" fill="currentColor"/> <path d="M20 14h2" fill="currentColor"/> <path d="M15 13v2" fill="currentColor"/> <path d="M9 13v2" fill="currentColor"/>`,"ai-generate-2":`<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72" /> <path d="m14 7 3 3" /> <path d="M5 6v4" /> <path d="M19 14v4" /> <path d="M10 2v2" /> <path d="M7 8H3" /> <path d="M21 16h-4" /> <path d="M11 3H9" />`,alert:`<circle cx="12" cy="12" r="10" /> <line x1="12" x2="12" y1="8" y2="12" /> <line x1="12" x2="12.01" y1="16" y2="16" />`,"alert-fill":`<path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z" fill="currentColor"/>`,"align-justify":`<path d="M3 5h18" /> <path d="M3 12h18" /> <path d="M3 19h18" />`,apple:`<path d="M12 6.528V3a1 1 0 0 1 1-1h0" /> <path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21" />`,"apps-2-ai":`<rect width="7" height="7" x="3" y="3" rx="1" /> <rect width="7" height="7" x="14" y="3" rx="1" /> <rect width="7" height="7" x="14" y="14" rx="1" /> <rect width="7" height="7" x="3" y="14" rx="1" />`,archive:`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"archive-stack":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"arrow-down":`<path d="M12 5v14" /> <path d="m19 12-7 7-7-7" />`,"arrow-down-s":`<path d="m6 9 6 6 6-6" />`,"arrow-go-back":`<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 0 11H12" />`,"arrow-go-forward":`<path d="m15 14 5-5-5-5" /> <path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />`,"arrow-left":`<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />`,"arrow-left-long":`<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />`,"arrow-left-right":`<path d="M8 7H3v5" /><path d="m3 7 7 7" /><path d="M16 17h5v-5" /><path d="m21 17-7-7" />`,"arrow-left-s":`<path d="m15 18-6-6 6-6" />`,"arrow-right":`<path d="M5 12h14" /> <path d="m12 5 7 7-7 7" />`,"arrow-right-s":`<path d="m9 18 6-6-6-6" />`,"arrow-up":`<path d="m5 12 7-7 7 7" /> <path d="M12 19V5" />`,"arrow-up-double":`<path d="m17 11-5-5-5 5" /> <path d="m17 18-5-5-5 5" />`,"arrow-up-s":`<path d="m18 15-6-6-6 6" />`,"attachment-2":`<path d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" />`,"bar-chart-2":`<path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" />`,"bar-chart-box":`<path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" />`,book:`<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />`,"book-open":`<path d="M12 7v14" /> <path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" />`,booklet:`<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />`,brain:`<path d="M12 18V5" /> <path d="M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" /> <path d="M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" /> <path d="M17.997 5.125a4 4 0 0 1 2.526 5.77" /> <path d="M18 18a4 4 0 0 0 2-7.464" /> <path d="M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" /> <path d="M6 18a4 4 0 0 1-2-7.464" /> <path d="M6.003 5.125a4 4 0 0 0-2.526 5.77" />`,"brain-ai-3":`<path d="M12 18V5" /> <path d="M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4" /> <path d="M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5" /> <path d="M17.997 5.125a4 4 0 0 1 2.526 5.77" /> <path d="M18 18a4 4 0 0 0 2-7.464" /> <path d="M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517" /> <path d="M6 18a4 4 0 0 1-2-7.464" /> <path d="M6.003 5.125a4 4 0 0 0-2.526 5.77" />`,briefcase:`<path d="M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16" /> <rect width="20" height="14" x="2" y="6" rx="2" />`,bug:`<path d="M12 20v-9" /> <path d="M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" /> <path d="M14.12 3.88 16 2" /> <path d="M21 21a4 4 0 0 0-3.81-4" /> <path d="M21 5a4 4 0 0 1-3.55 3.97" /> <path d="M22 13h-4" /> <path d="M3 21a4 4 0 0 1 3.81-4" /> <path d="M3 5a4 4 0 0 0 3.55 3.97" /> <path d="M6 13H2" /> <path d="m8 2 1.88 1.88" /> <path d="M9 7.13V6a3 3 0 1 1 6 0v1.13" />`,calendar:`<path d="M8 2v4" /> <path d="M16 2v4" /> <rect width="18" height="18" x="3" y="4" rx="2" /> <path d="M3 10h18" />`,"calendar-schedule":`<path d="M16 14v2.2l1.6 1" /> <path d="M16 2v4" /> <path d="M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" /> <path d="M3 10h5" /> <path d="M8 2v4" /> <circle cx="16" cy="16" r="6" />`,camera:`<path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" /> <circle cx="12" cy="13" r="3" />`,"chat-1":`<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />`,"chat-3":`<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />`,"chat-4":`<path d="M12 3a9 9 0 0 1 7.45 14.05L21 21l-4.05-1.55A9 9 0 1 1 12 3Z" />`,"chat-ai-3":`<path d="M12 6V2H8" /> <path d="M15 11v2" /> <path d="M2 12h2" /> <path d="M20 12h2" /> <path d="M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z" /> <path d="M9 11v2" />`,"chat-history":`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" /> <path d="M12 7v5l4 2" />`,"chat-new":`<path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" /> <path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" />`,"chat-thread":`<path d="M10.5 7C11.3 4.9 13.1 3.5 15.25 3.5c3.45 0 6.25 2.45 6.25 5.5 0 1.13-.38 2.18-1.03 3.06l.58 2.14-2.3-.75c-.4.18-.8.32-1.2.43" /><path d="M8.5 8.25c-3.6 0-6.5 2.55-6.5 5.75 0 1.21.42 2.33 1.13 3.25l-.63 2.27 2.48-.8c1.04.56 2.24.88 3.52.88 3.6 0 6.5-2.55 6.5-5.75S12.1 8.25 8.5 8.25Z" />`,check:`<path d="M20 6 9 17l-5-5" />`,checkbox:`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="m9 12 2 2 4-4" />`,"checkbox-blank":`<rect width="18" height="18" x="3" y="3" rx="2" />`,"checkbox-blank-circle-fill":`<circle cx="12" cy="12" r="10" fill="currentColor"/>`,"checkbox-circle":`<circle cx="12" cy="12" r="10" /> <path d="m9 12 2 2 4-4" />`,"checkbox-circle-fill":`<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM17.4571 9.45711L11 15.9142L6.79289 11.7071L8.20711 10.2929L11 13.0858L16.0429 8.04289L17.4571 9.45711Z" fill="currentColor"/>`,"checkbox-multiple":`<path d="m12 15 2 2 4-4" /> <rect width="14" height="14" x="8" y="8" rx="2" ry="2" /> <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" />`,close:`<path d="M18 6 6 18" /> <path d="m6 6 12 12" />`,"close-circle":`<circle cx="12" cy="12" r="10" /> <path d="m15 9-6 6" /> <path d="m9 9 6 6" />`,cloud:`<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" />`,"cloud-off":`<path d="M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057" /> <path d="M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78" /> <path d="m2 2 20 20" />`,code:`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,"code-ai":`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,"code-box":`<path d="m18 16 4-4-4-4" /> <path d="m6 8-4 4 4 4" /> <path d="m14.5 4-5 16" />`,"code-sslash":`<path d="m16 18 6-6-6-6" /> <path d="m8 6-6 6 6 6" />`,command:`<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />`,"compass-3":`<circle cx="12" cy="12" r="10" /> <path d="m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" />`,computer:`<rect width="20" height="14" x="2" y="3" rx="2" /> <line x1="8" x2="16" y1="21" y2="21" /> <line x1="12" x2="12" y1="17" y2="21" />`,"contract-up-down":`<path d="m7 20 5-5 5 5" /> <path d="m7 4 5 5 5-5" />`,"corner-down-left":`<path d="M20 4v7a4 4 0 0 1-4 4H4" /> <path d="m9 10-5 5 5 5" />`,cursor:`<path d="M12.586 12.586 19 19" /> <path d="M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z" />`,"database-2":`<ellipse cx="12" cy="5" rx="9" ry="3" /> <path d="M3 5V19A9 3 0 0 0 21 19V5" /> <path d="M3 12A9 3 0 0 0 21 12" />`,"delete-bin":`<path d="M10 11v6" /> <path d="M14 11v6" /> <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> <path d="M3 6h18" /> <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`,"discord-fill":`<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" fill="currentColor"/>`,"donut-chart":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" />`,"donut-chart-fill":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" fill="currentColor"/> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" fill="currentColor"/>`,download:`<path d="M12 15V3" /> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /> <path d="m7 10 5 5 5-5" />`,"download-cloud":`<path d="M12 13v8l-4-4" /> <path d="m12 21 4-4" /> <path d="M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284" />`,"drag-move-2":`<circle cx="9" cy="12" r="1" /> <circle cx="9" cy="5" r="1" /> <circle cx="9" cy="19" r="1" /> <circle cx="15" cy="12" r="1" /> <circle cx="15" cy="5" r="1" /> <circle cx="15" cy="19" r="1" />`,draggable:`<circle cx="9" cy="12" r="1" /> <circle cx="9" cy="5" r="1" /> <circle cx="9" cy="19" r="1" /> <circle cx="15" cy="12" r="1" /> <circle cx="15" cy="5" r="1" /> <circle cx="15" cy="19" r="1" />`,earth:`<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" />`,edit:`<path d="M15 5.5 18.5 9" /><path d="M4.5 19.5 5.75 14.75 15.25 5.25a2.1 2.1 0 0 1 3 0l.5.5a2.1 2.1 0 0 1 0 3L9.25 18.25Z" />`,"edit-2":`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />`,"emotion-happy":`<circle cx="12" cy="12" r="10" /> <path d="M8 14s1.5 2 4 2 4-2 4-2" /> <line x1="9" x2="9.01" y1="9" y2="9" /> <line x1="15" x2="15.01" y1="9" y2="9" />`,"equalizer-2":`<path d="M10 5H3" /> <path d="M12 19H3" /> <path d="M14 3v4" /> <path d="M16 17v4" /> <path d="M21 12h-9" /> <path d="M21 19h-5" /> <path d="M21 5h-7" /> <path d="M8 10v4" /> <path d="M8 12H3" />`,"error-warning":`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /> <path d="M12 9v4" /> <path d="M12 17h.01" />`,"error-warning-fill":`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z" fill="currentColor"/>`,"expand-up-down":`<path d="m7 15 5 5 5-5" /> <path d="m7 9 5-5 5 5" />`,"external-link":`<path d="M15 3h6v6" /> <path d="M10 14 21 3" /> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />`,eye:`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /> <circle cx="12" cy="12" r="3" />`,"eye-off":`<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" /> <path d="M14.084 14.158a3 3 0 0 1-4.242-4.242" /> <path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" /> <path d="m2 2 20 20" />`,file:`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" />`,"file-add":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M9 15h6" /> <path d="M12 18v-6" />`,"file-check":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="m9 15 2 2 4-4" />`,"file-check-fill":`<path 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" fill="currentColor"/> <path d="M14 2v5a1 1 0 0 0 1 1h5" fill="currentColor"/> <path d="m9 15 2 2 4-4" fill="currentColor"/>`,"file-code":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 12.5 8 15l2 2.5" /> <path d="m14 12.5 2 2.5-2 2.5" />`,"file-copy":`<rect width="14" height="14" x="8" y="8" rx="3.5" ry="3.5" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,"file-copy-2":`<path d="M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8" /> <path d="M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z" /> <path d="M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1" />`,"file-download":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M12 18v-6" /> <path d="m9 15 3 3 3-3" />`,"file-edit":`<path d="M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z" />`,"file-image":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <circle cx="10" cy="12" r="2" /> <path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22" />`,"file-list-2":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-music":`<path d="M11.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.35" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M8 20v-7l3 1.474" /> <circle cx="6" cy="20" r="2" />`,"file-pdf":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-search":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <circle cx="11.5" cy="14.5" r="2.5" /> <path d="M13.3 16.3 15 18" />`,"file-text":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M10 9H8" /> <path d="M16 13H8" /> <path d="M16 17H8" />`,"file-transfer":`<path d="M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M2 15h10" /> <path d="m9 18 3-3-3-3" />`,"file-video":`<path 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" /> <path d="M14 2v5a1 1 0 0 0 1 1h5" /> <path d="M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z" />`,flashlight:`<path d="M12 13v1" /> <path d="M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z" /> <path d="M6 6h12" />`,flask:`<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2" /> <path d="M6.453 15h11.094" /> <path d="M8.5 2h7" />`,"fold-vertical":`<path d="M12 22v-6" /> <path d="M12 8V2" /> <path d="M4 12H2" /> <path d="M10 12H8" /> <path d="M16 12h-2" /> <path d="M22 12h-2" /> <path d="m15 19-3-3-3 3" /> <path d="m15 5-3 3-3-3" />`,folder:`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-3":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-3-fill":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-6":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-add":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" /><path d="M12 11v6" /><path d="M9 14h6" />`,"folder-open":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-open-fill":`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,"folder-received":`<path d="M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1" /> <path d="M2 13h10" /> <path d="m9 16 3-3-3-3" />`,folders:`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />`,fullscreen:`<path d="M8 3H5a2 2 0 0 0-2 2v3" /> <path d="M21 8V5a2 2 0 0 0-2-2h-3" /> <path d="M3 16v3a2 2 0 0 0 2 2h3" /> <path d="M16 21h3a2 2 0 0 0 2-2v-3" />`,"fullscreen-exit":`<path d="M8 3v3a2 2 0 0 1-2 2H3" /> <path d="M21 8h-3a2 2 0 0 1-2-2V3" /> <path d="M3 16h3a2 2 0 0 1 2 2v3" /> <path d="M16 21v-3a2 2 0 0 1 2-2h3" />`,gamepad:`<line x1="6" x2="10" y1="11" y2="11" /> <line x1="8" x2="8" y1="9" y2="13" /> <line x1="15" x2="15.01" y1="12" y2="12" /> <line x1="18" x2="18.01" y1="10" y2="10" /> <path d="M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z" />`,"git-branch":`<circle cx="18" cy="6" r="2.6" /><circle cx="6" cy="18" r="2.6" /><path d="M6 15.4V3" /><path d="M18 8.6c0 4.6-3.4 7.4-9.4 8" />`,"git-close-pull-request":`<circle cx="6" cy="6" r="3" /> <path d="M6 9v12" /> <path d="m21 3-6 6" /> <path d="m21 9-6-6" /> <path d="M18 11.5V15" /> <circle cx="18" cy="18" r="3" />`,"git-commit":`<circle cx="12" cy="12" r="3" /> <line x1="3" x2="9" y1="12" y2="12" /> <line x1="15" x2="21" y1="12" y2="12" />`,"git-merge":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M6 21V9a9 9 0 0 0 9 9" />`,"git-pr-draft":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M18 6V5" /> <path d="M18 11v-1" /> <line x1="6" x2="6" y1="9" y2="21" />`,"git-pull-request":`<circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M13 6h3a2 2 0 0 1 2 2v7" /> <line x1="6" x2="6" y1="9" y2="21" />`,"git-repository":`<path d="M18 19a5 5 0 0 1-5-5v8" /> <path d="M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5" /> <circle cx="13" cy="12" r="2" /> <circle cx="20" cy="19" r="2" />`,github:`<path d="M5.88401 18.6533C5.58404 18.4526 5.32587 18.1975 5.0239 17.8369C4.91473 17.7065 4.47283 17.1524 4.55811 17.2583C4.09533 16.6833 3.80296 16.417 3.50156 16.3089C2.9817 16.1225 2.7114 15.5499 2.89784 15.0301C3.08428 14.5102 3.65685 14.2399 4.17672 14.4263C4.92936 14.6963 5.43847 15.1611 6.12425 16.0143C6.03025 15.8974 6.46364 16.441 6.55731 16.5529C6.74784 16.7804 6.88732 16.9182 6.99629 16.9911C7.20118 17.1283 7.58451 17.1874 8.14709 17.1311C8.17065 16.7489 8.24136 16.3783 8.34919 16.0358C5.38097 15.3104 3.70116 13.3952 3.70116 9.63971C3.70116 8.40085 4.0704 7.28393 4.75917 6.3478C4.5415 5.45392 4.57433 4.37284 5.06092 3.15636C5.1725 2.87739 5.40361 2.66338 5.69031 2.57352C5.77242 2.54973 5.81791 2.53915 5.89878 2.52673C6.70167 2.40343 7.83573 2.69705 9.31449 3.62336C10.181 3.41879 11.0885 3.315 12.0012 3.315C12.9129 3.315 13.8196 3.4186 14.6854 3.62277C16.1619 2.69 17.2986 2.39649 18.1072 2.52651C18.1919 2.54013 18.2645 2.55783 18.3249 2.57766C18.6059 2.66991 18.8316 2.88179 18.9414 3.15636C19.4279 4.37256 19.4608 5.45344 19.2433 6.3472C19.9342 7.28337 20.3012 8.39208 20.3012 9.63971C20.3012 13.3968 18.627 15.3048 15.6588 16.032C15.7837 16.447 15.8496 16.9105 15.8496 17.4121C15.8496 18.0765 15.8471 18.711 15.8424 19.4225C15.8412 19.6127 15.8397 19.8159 15.8375 20.1281C16.2129 20.2109 16.5229 20.5077 16.6031 20.9089C16.7114 21.4504 16.3602 21.9773 15.8186 22.0856C14.6794 22.3134 13.8353 21.5538 13.8353 20.5611C13.8353 20.4708 13.836 20.3417 13.8375 20.1145C13.8398 19.8015 13.8412 19.599 13.8425 19.4094C13.8471 18.7019 13.8496 18.0716 13.8496 17.4121C13.8496 16.7148 13.6664 16.2602 13.4237 16.051C12.7627 15.4812 13.0977 14.3973 13.965 14.2999C16.9314 13.9666 18.3012 12.8177 18.3012 9.63971C18.3012 8.68508 17.9893 7.89571 17.3881 7.23559C17.1301 6.95233 17.0567 6.54659 17.199 6.19087C17.3647 5.77663 17.4354 5.23384 17.2941 4.57702L17.2847 4.57968C16.7928 4.71886 16.1744 5.0198 15.4261 5.5285C15.182 5.69438 14.8772 5.74401 14.5932 5.66413C13.7729 5.43343 12.8913 5.315 12.0012 5.315C11.111 5.315 10.2294 5.43343 9.40916 5.66413C9.12662 5.74359 8.82344 5.69492 8.57997 5.53101C7.8274 5.02439 7.2056 4.72379 6.71079 4.58376C6.56735 5.23696 6.63814 5.77782 6.80336 6.19087C6.94565 6.54659 6.87219 6.95233 6.61423 7.23559C6.01715 7.8912 5.70116 8.69376 5.70116 9.63971C5.70116 12.8116 7.07225 13.9683 10.023 14.2999C10.8883 14.3971 11.2246 15.4769 10.5675 16.0482C10.3751 16.2156 10.1384 16.7802 10.1384 17.4121V20.5611C10.1384 21.5474 9.30356 22.2869 8.17878 22.09C7.63476 21.9948 7.27093 21.4766 7.36613 20.9326C7.43827 20.5204 7.75331 20.2116 8.13841 20.1276V19.1381C7.22829 19.1994 6.47656 19.0498 5.88401 18.6533Z" fill="currentColor"/>`,"github-fill":`<path d="M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z" fill="currentColor"/>`,global:`<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" />`,"graduation-cap":`<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z" /> <path d="M22 10v6" /> <path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5" />`,hammer:`<path d="m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9" /> <path d="m18 15 4-4" /> <path d="m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5" />`,heart:`<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" />`,history:`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" /> <path d="M12 7v5l4 2" />`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" /> <path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />`,hourglass:`<path d="M8 3.5h8c.8 0 1.5.7 1.5 1.5 0 2.6-1.8 4.5-3.8 5.9-.4.3-.7.6-.7 1.1s.3.8.7 1.1c2 1.4 3.8 3.3 3.8 5.9 0 .8-.7 1.5-1.5 1.5H8c-.8 0-1.5-.7-1.5-1.5 0-2.6 1.8-4.5 3.8-5.9.4-.3.7-.6.7-1.1s-.3-.8-.7-1.1C8.3 9.5 6.5 7.6 6.5 5c0-.8.7-1.5 1.5-1.5z" />`,"hourglass-fill":`<path d="M5 22h14" fill="currentColor"/> <path d="M5 2h14" fill="currentColor"/> <path d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22" fill="currentColor"/> <path d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2" fill="currentColor"/>`,"image-download":`<path d="M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21" /> <path d="m14 19 3 3v-5.5" /> <path d="m17 22 3-3" /> <circle cx="9" cy="9" r="2" />`,"inbox-archive":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" /> <path d="M10 12h4" />`,"inbox-unarchive":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h2" /> <path d="M20 8v11a2 2 0 0 1-2 2h-2" /> <path d="m9 15 3-3 3 3" /> <path d="M12 12v9" />`,"inbox-unarchive-fill":`<rect width="20" height="5" x="2" y="3" rx="1" /> <path d="M4 8v11a2 2 0 0 0 2 2h2" fill="currentColor"/> <path d="M20 8v11a2 2 0 0 1-2 2h-2" fill="currentColor"/> <path d="m9 15 3-3 3 3" fill="currentColor"/> <path d="M12 12v9" fill="currentColor"/>`,information:`<circle cx="12" cy="12" r="10" /> <path d="M12 16v-4" /> <path d="M12 8h.01" />`,"information-fill":`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 11V17H13V11H11ZM11 7V9H13V7H11Z" fill="currentColor"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4" /> <path d="m21 2-9.6 9.6" /> <circle cx="7.5" cy="15.5" r="5.5" />`,"layout-column":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M12 3v18" />`,"layout-left":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" />`,"layout-left-rounded":`<rect width="18" height="18" x="3" y="3" rx="4" /><path d="M9.5 3v18" />`,"layout-right":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M15 3v18" />`,leaf:`<path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z" /> <path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12" />`,lightbulb:`<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5" /> <path d="M9 18h6" /> <path d="M10 22h4" />`,"link-unlink-m":`<path d="m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" /> <path d="m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" /> <line x1="8" x2="8" y1="2" y2="5" /> <line x1="2" x2="5" y1="8" y2="8" /> <line x1="16" x2="16" y1="19" y2="22" /> <line x1="19" x2="22" y1="16" y2="16" />`,"list-check-2":`<path d="M13 5h8" /> <path d="M13 12h8" /> <path d="M13 19h8" /> <path d="m3 17 2 2 4-4" /> <path d="m3 7 2 2 4-4" />`,"list-check-3":`<path d="M13 5h8" /> <path d="M13 12h8" /> <path d="M13 19h8" /> <path d="m3 17 2 2 4-4" /> <rect x="3" y="4" width="6" height="6" rx="1" />`,"list-unordered":`<path d="M3 5h.01" /> <path d="M3 12h.01" /> <path d="M3 19h.01" /> <path d="M8 5h13" /> <path d="M8 12h13" /> <path d="M8 19h13" />`,loader:`<path d="M12 2v4" /> <path d="m16.2 7.8 2.9-2.9" /> <path d="M18 12h4" /> <path d="m16.2 16.2 2.9 2.9" /> <path d="M12 18v4" /> <path d="m4.9 19.1 2.9-2.9" /> <path d="M2 12h4" /> <path d="m4.9 4.9 2.9 2.9" />`,"loader-4":`<path d="M21 12a9 9 0 1 1-6.219-8.56" />`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" />`,"lock-2":`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 10 0v4" />`,"lock-unlock":`<rect width="18" height="11" x="3" y="11" rx="2" ry="2" /> <path d="M7 11V7a5 5 0 0 1 9.9-1" />`,"loop-right-ai":`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /> <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" /> <path d="M8 16H3v5" />`,macbook:`<path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z" /> <path d="M20.054 15.987H3.946" />`,"menu-2":`<path d="M4 5h16" /> <path d="M4 12h16" /> <path d="M4 19h16" />`,"menu-fold-2":`<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" /> <path d="m16 15-3-3 3-3" />`,"menu-search":`<path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" />`,mic:`<path d="M12 19v3" /> <path d="M19 10v2a7 7 0 0 1-14 0v-2" /> <rect x="9" y="2" width="6" height="13" rx="3" />`,more:`<circle cx="12" cy="12" r="1" /> <circle cx="19" cy="12" r="1" /> <circle cx="5" cy="12" r="1" />`,"more-2":`<circle cx="12" cy="12" r="1" /> <circle cx="19" cy="12" r="1" /> <circle cx="5" cy="12" r="1" />`,"more-2-fill":`<circle cx="12" cy="12" r="1" fill="currentColor"/> <circle cx="19" cy="12" r="1" fill="currentColor"/> <circle cx="5" cy="12" r="1" fill="currentColor"/>`,music:`<path d="M9 18V5l12-2v13" /> <circle cx="6" cy="18" r="3" /> <circle cx="18" cy="16" r="3" />`,"node-tree":`<rect x="16" y="16" width="6" height="6" rx="1" /> <rect x="2" y="16" width="6" height="6" rx="1" /> <rect x="9" y="2" width="6" height="6" rx="1" /> <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" /> <path d="M12 12V8" />`,"notification-3":`<path d="M10.268 21a2 2 0 0 0 3.464 0" /> <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />`,palette:`<path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" /> <circle cx="13.5" cy="6.5" r=".5" fill="currentColor" /> <circle cx="17.5" cy="10.5" r=".5" fill="currentColor" /> <circle cx="6.5" cy="12.5" r=".5" fill="currentColor" /> <circle cx="8.5" cy="7.5" r=".5" fill="currentColor" />`,pause:`<path d="M6 5H8V19H6V5ZM16 5H18V19H16V5Z" fill="currentColor"/>`,pencil:`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" /> <path d="m15 5 4 4" />`,"pencil-ai":`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"pencil-ai-2":`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"picture-in-picture-2":`<path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" /> <rect width="10" height="7" x="12" y="13" rx="2" />`,"pie-chart":`<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /> <path d="M21.21 15.89A10 10 0 1 1 8 2.83" />`,play:`<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />`,"play-list-add":`<path d="M16 5H3" /> <path d="M11 12H3" /> <path d="M16 19H3" /> <path d="M18 9v6" /> <path d="M21 12h-6" />`,plug:`<path d="M12 22v-5" /> <path d="M15 8V2" /> <path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" /> <path d="M9 8V2" />`,"plug-2":`<path d="M12 22v-5" /> <path d="M15 8V2" /> <path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" /> <path d="M9 8V2" />`,pulse:`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" />`,pushpin:`<path d="M12 17v5" /> <path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />`,"pushpin-2":`<path d="M12 17v5" /> <path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />`,"pushpin-2-fill":`<path d="M22.3126 10.1753L20.8984 11.5895L20.1913 10.8824L15.9486 15.125L15.2415 18.6606L13.8273 20.0748L9.58466 15.8321L4.63492 20.7819L3.2207 19.3677L8.17045 14.4179L3.92781 10.1753L5.34202 8.76107L8.87756 8.05396L13.1202 3.81132L12.4131 3.10422L13.8273 1.69L22.3126 10.1753Z" fill="currentColor" />`,question:`<circle cx="12" cy="12" r="10" /> <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" /> <path d="M12 17h.01" />`,"record-circle":`<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="1" />`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" /> <path d="M21 3v5h-5" /> <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" /> <path d="M8 16H3v5" />`,restart:`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /> <path d="M3 3v5h5" />`,robot:`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,"robot-2":`<path d="M12 8V4H8" /> <rect width="16" height="12" x="4" y="8" rx="2" /> <path d="M2 14h2" /> <path d="M20 14h2" /> <path d="M15 13v2" /> <path d="M9 13v2" />`,rocket:`<path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" /> <path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09" /> <path d="M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z" /> <path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05" />`,"save-3":`<path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" /> <path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" /> <path d="M7 3v4a1 1 0 0 0 1 1h7" />`,"scales-3":`<path d="M12 3v18" /> <path d="m19 8 3 8a5 5 0 0 1-6 0zV7" /> <path d="M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1" /> <path d="m5 8 3 8a5 5 0 0 1-6 0zV7" /> <path d="M7 21h10" />`,"scan-2":`<path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" />`,scissors:`<circle cx="6" cy="6" r="3" /> <path d="M8.12 8.12 12 12" /> <path d="M20 4 8.12 15.88" /> <circle cx="6" cy="18" r="3" /> <path d="M14.8 14.8 20 20" />`,search:`<path d="m21 21-4.34-4.34" /> <circle cx="11" cy="11" r="8" />`,"search-eye":`<path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" /> <circle cx="12" cy="12" r="3" /> <path d="m16 16-1.9-1.9" />`,"send-plane":`<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" /> <path d="m21.854 2.147-10.94 10.939" />`,"send-plane-2":`<path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" /> <path d="M6 12h16" />`,server:`<rect width="20" height="8" x="2" y="2" rx="2" ry="2" /> <rect width="20" height="8" x="2" y="14" rx="2" ry="2" /> <line x1="6" x2="6.01" y1="6" y2="6" /> <line x1="6" x2="6.01" y1="18" y2="18" />`,"settings-3":`<path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" /> <circle cx="12" cy="12" r="3" />`,"share-2":`<path d="M12 2v13" /> <path d="m16 6-4-4-4 4" /> <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8" />`,shield:`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />`,"shield-check":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="m9 12 2 2 4-4" />`,"shield-keyhole":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />`,"shield-user":`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="M6.376 18.91a6 6 0 0 1 11.249.003" /> <circle cx="12" cy="11" r="4" />`,shuffle:`<path d="m18 14 4 4-4 4" /> <path d="m18 2 4 4-4 4" /> <path d="M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22" /> <path d="M2 6h1.972a4 4 0 0 1 3.6 2.2" /> <path d="M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45" />`,"slash-commands-2":`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2" ry="2" /> <path d="M12 18h.01" />`,sparkling:`<path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /> <path d="M20 2v4" /> <path d="M22 4h-4" /> <circle cx="4" cy="20" r="2" />`,"split-cells-horizontal":`<path d="M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3" /> <path d="M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3" /> <line x1="12" x2="12" y1="4" y2="20" />`,stack:`<path 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" /> <path 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" /> <path 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" />`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" />`,"star-fill":`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" fill="currentColor"/>`,"sticky-note":`<path d="M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z" /> <path d="M15 3v5a1 1 0 0 0 1 1h5" />`,stop:`<rect width="18" height="18" x="3" y="3" rx="2" />`,"stop-circle":`<circle cx="12" cy="12" r="9" /><rect x="9.25" y="9.25" width="5.5" height="5.5" rx="1.25" />`,subtract:`<path d="M5 12h14" />`,survey:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" /> <path d="M12 11h4" /> <path d="M12 16h4" /> <path d="M8 11h.01" /> <path d="M8 16h.01" />`,target:`<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="6" /> <circle cx="12" cy="12" r="2" />`,task:`<path d="M21.801 10A10 10 0 1 1 17 3.335" /> <path d="m9 11 3 3L22 4" />`,terminal:`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,"terminal-box":`<path d="M12 19h8" /> <path d="m4 17 6-6-6-6" />`,"terminal-window":`<path d="m7 11 2-2-2-2" /> <path d="M11 13h4" /> <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />`,text:`<path d="M12 4v16" /> <path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /> <path d="M9 20h6" />`,"text-wrap":`<path d="m16 16-3 3 3 3" /> <path d="M3 12h14.5a1 1 0 0 1 0 7H13" /> <path d="M3 19h6" /> <path d="M3 5h18" />`,time:`<circle cx="12" cy="12" r="9" /><path d="M12 7v5.25l3.25 1.75" />`,timer:`<line x1="10" x2="14" y1="2" y2="2" /> <line x1="12" x2="15" y1="14" y2="11" /> <circle cx="12" cy="14" r="8" />`,tools:`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" />`,"twitter-xfill":`<path d="M17.6874 3.0625L12.6907 8.77425L8.37045 3.0625H2.11328L9.58961 12.8387L2.50378 20.9375H5.53795L11.0068 14.6886L15.7863 20.9375H21.8885L14.095 10.6342L20.7198 3.0625H17.6874ZM16.6232 19.1225L5.65436 4.78217H7.45745L18.3034 19.1225H16.6232Z" fill="currentColor"/>`,unpin:`<path d="M12 17v5" /> <path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /> <path d="m2 2 20 20" /> <path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />`,user:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" />`,"user-3":`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" />`,"video-chat":`<path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" /> <rect x="2" y="6" width="14" height="12" rx="2" />`,"volume-up":`<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" /> <path d="M16 9a5 5 0 0 1 0 6" /> <path d="M19.364 18.364a9 9 0 0 0 0-12.728" />`,window:`<rect x="2" y="4" width="20" height="16" rx="2" /> <path d="M10 4v4" /> <path d="M2 8h20" /> <path d="M6 4v4" />`},o=t(),s=`openchamber-icon-sprite-v2`,c=1.5,l=(()=>{let e=2166136261;for(let[t,n]of Object.entries(a)){let r=`${t}:${n};`;for(let t=0;t<r.length;t+=1)e=Math.imul(e^r.charCodeAt(t),16777619)}return(e>>>0).toString(36)})(),u=!1,d=new Set,f=null;function p(e){if(u&&d.has(e)&&f===l||typeof document>`u`)return;let t=document.body;if(!t)return;let n=document.getElementById(s);if(n){let t=new Set(Array.from(n.querySelectorAll(`symbol[id^="oc-"]`),e=>e.id.slice(3)));if(!n.innerHTML.includes(`--oc-icon-stroke`)||n.dataset.spriteSignature!==l||!t.has(e))n.remove();else{u=!0,d=t,f=l;return}}let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);r.id=s,r.setAttribute(`aria-hidden`,`true`),r.dataset.spriteSignature=l,r.style.display=`none`,r.innerHTML=Object.entries(a).map(([e,t])=>`<symbol id="oc-${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--oc-icon-stroke, ${c})" stroke-linecap="round" stroke-linejoin="round">${t}</symbol>`).join(``),t.insertBefore(r,t.firstChild),u=!0,d=new Set(Object.keys(a)),f=l}var m=i.memo(({name:e,className:t,weight:n=`regular`,style:i,...a})=>{typeof document<`u`&&p(e);let s=n===`medium`?2:c;return(0,o.jsx)(`svg`,{className:r(`oc-icon`,t),viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,stroke:`currentColor`,strokeWidth:s,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{"--oc-icon-stroke":s,...i},...a,children:(0,o.jsx)(`use`,{href:`#oc-${e}`})})});m.displayName=`Icon`;export{m as n,a as r,c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{i as t,n}from"./runtime-switch-LvWDU-SL.js";import{n as r}from"./runtime-fetch-zIalUnbb.js";import{u as i}from"./persistence-YbQKzHUQ.js";import{nt as a,rt as o}from"./vendor-base-ui-CnHfUmDN.js";import{n as s}from"./vendor-react-DLPElpoQ.js";import{s as c}from"./vendor-tanstack-react-query-D7pys_c9.js";import{Do as l,Oo as u}from"./useMobileNavigationStore-Dqe-sz0u.js";import{t as d}from"./utils-BHTVlVov.js";import{n as f}from"./Icon-CkzzhaLr.js";import{t as p}from"./button-xx1UOBA5.js";var m=e(o(),1),h=s(),g=async(e,t)=>{try{let t=await e.json();if(t&&typeof t.error==`string`&&t.error.trim().length>0)return t.error}catch{return t}return t},_=e=>{let t=typeof e==`string`?e.trim():``;if(!t)throw Error(`projectId is required`);return t},v=e=>e===null||typeof e==`string`,y=e=>e===null||typeof e==`number`&&Number.isFinite(e),b=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=864e13,x=e=>e===null||b(e),S=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.projectId==`string`&&t.projectId.length>0&&typeof t.taskId==`string`&&t.taskId.length>0&&typeof t.taskName==`string`&&(t.trigger===`scheduled`||t.trigger===`manual`)&&(t.status===`running`||t.status===`success`||t.status===`error`)&&v(t.sessionId)&&v(t.directory)&&v(t.error)&&b(t.startedAt)&&x(t.finishedAt)&&y(t.durationMs)&&(t.durationMs===null||t.durationMs>=0)},C=e=>{if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Malformed scheduled task runs response`);let t=e;if(!Array.isArray(t.runs)||!t.runs.every(S)||!v(t.nextCursor)||typeof t.complete!=`boolean`||t.complete!==(t.nextCursor===null)||t.nextCursor!==null&&t.nextCursor.length===0)throw Error(`Malformed scheduled task runs response`);return{runs:t.runs,nextCursor:t.nextCursor,complete:t.complete}},w=async(e,t)=>{let n=new URLSearchParams;e.before&&n.set(`before`,e.before);let i=e.limit??20;if(!Number.isInteger(i)||i<1)throw Error(`limit must be a positive integer`);n.set(`limit`,String(i)),e.projectId&&n.set(`projectId`,e.projectId),e.taskId&&n.set(`taskId`,e.taskId);let a=await r(`/api/openchamber/scheduled-task-runs?${n.toString()}`,{signal:t});if(!a.ok)throw Error(await g(a,`Failed to load scheduled task history`));return C(await a.json().catch(()=>null))},T=async()=>{let e=await r(`/api/openchamber/scheduled-tasks`);if(!e.ok)throw Error(await g(e,`Failed to load schedules`));let t=await e.json().catch(()=>null);return{tasks:Array.isArray(t?.tasks)?t.tasks:[],failedProjectIds:Array.isArray(t?.failedProjectIds)?t.failedProjectIds.filter(e=>typeof e==`string`):[]}},E=async(e,t)=>{let n=_(e),i=await r(`/api/projects/${encodeURIComponent(n)}/scheduled-tasks`,{method:`PUT`,headers:{"content-type":`application/json`,accept:`application/json`},body:JSON.stringify({task:t})});if(!i.ok)throw Error(await g(i,`Failed to save schedule`));let a=await i.json().catch(()=>null);return!a||!Array.isArray(a.tasks)?[]:a.tasks},D=async(e,t)=>{let n=_(e),i=_(t),a=await r(`/api/projects/${encodeURIComponent(n)}/scheduled-tasks/${encodeURIComponent(i)}`,{method:`DELETE`,headers:{accept:`application/json`}});if(!a.ok)throw Error(await g(a,`Failed to delete schedule`));let o=await a.json().catch(()=>null);return!o||!Array.isArray(o.tasks)?[]:o.tasks},O=async(e,t)=>{let n=_(e),i=_(t),a=await r(`/api/projects/${encodeURIComponent(n)}/scheduled-tasks/${encodeURIComponent(i)}/run`,{method:`POST`,headers:{accept:`application/json`}});if(!a.ok)throw Error(await g(a,`Failed to run schedule`));let o=await a.json().catch(()=>null);return{sessionId:typeof o?.sessionId==`string`&&o.sessionId.length>0?o.sessionId:void 0}},k=class extends Error{code;status;resource;constructor(e,t,n,r){super(typeof r==`string`&&r.trim()?r.trim():e),this.code=e,this.status=t,this.resource=n}},A=e=>{if(!e||typeof e!=`object`)return!1;let t=`name`in e?String(e.name):``;return t===`AbortError`||t===`TimeoutError`},j=class extends k{operation;constructor(e,t,n){super(e,t,`share_operation`),this.operation=n}},M=(e,t=200)=>{throw new k(`invalid_${e}_response`,t,e)},N=(e,t)=>e&&typeof e==`object`&&!Array.isArray(e)?e:M(t),P=(e,t)=>typeof e==`string`?e:M(t),F=(e,t)=>e===null||typeof e==`string`?e:M(t),I=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:M(t),L=(e,t)=>e===null?null:I(e,t),R=(e,t)=>typeof e==`boolean`?e:M(t),z=(e,t,n)=>t.includes(e)?e:M(n),ee=e=>{let t=N(e,`capability`);return{supported:R(t.supported,`capability`),enabled:R(t.enabled,`capability`),revision:I(t.revision,`capability`),serverInstanceID:F(t.serverInstanceID,`capability`)}},te=e=>{if(e==null)return null;let t=N(e,`assistant`);return{turnID:P(t.turnID,`assistant`),messageID:P(t.messageID,`assistant`),status:z(t.status,[`queued`,`running`],`assistant`),admittedAt:I(t.admittedAt,`assistant`)}},ne=e=>{if(e==null)return null;let t=N(e,`assistant_preview`),n=I(t.ordinal,`assistant_preview`);return!Number.isSafeInteger(n)||n<0?M(`assistant_preview`):{messageID:P(t.messageID,`assistant_preview`),ordinal:n,role:z(t.role,[`user`,`assistant`],`assistant_preview`),text:P(t.text,`assistant_preview`),fallbackKind:t.fallbackKind===null?null:z(t.fallbackKind,[`image`,`file`,`session`,`assistant`,`schedule`],`assistant_preview`)}},B=e=>{let t=N(e,`assistant`),n=Array.isArray(t.historySessionIDs)?t.historySessionIDs.map(e=>P(e,`assistant`)):[],r=t.historySessionCount===void 0?n.length:I(t.historySessionCount,`assistant`);if(!Number.isSafeInteger(r)||r<n.length)return M(`assistant`);let i=Array.isArray(t.assignedSessionIDs)?t.assignedSessionIDs.map(e=>P(e,`assistant`)):[],a=t.activeContactTurn===void 0?null:te(t.activeContactTurn),o=t.working===void 0?a!=null:R(t.working,`assistant`);return{latestMessagePreview:ne(t.latestMessagePreview),id:P(t.id,`assistant`),revision:I(t.revision,`assistant`),enabled:R(t.enabled,`assistant`),name:P(t.name,`assistant`),defaultPrompt:P(t.defaultPrompt,`assistant`),workspacePath:F(t.workspacePath,`assistant`),effectiveWorkspacePath:P(t.effectiveWorkspacePath,`assistant`),managedWorkspacePath:F(t.managedWorkspacePath??null,`assistant`),providerID:P(t.providerID,`assistant`),modelID:P(t.modelID,`assistant`),agent:F(t.agent,`assistant`),variant:F(t.variant??null,`assistant`),mode:z(t.mode,[`continuous`,`stateless`],`assistant`),sessionID:F(t.sessionID,`assistant`),sessionGeneration:I(t.sessionGeneration,`assistant`),historySessionIDs:n,historySessionCount:r,assignedSessionIDs:i,working:o,activeContactTurn:a,createdAt:L(t.createdAt,`assistant`),updatedAt:I(t.updatedAt,`assistant`),tombstoneAt:L(t.tombstoneAt,`assistant`)}},re=e=>{let t=N(e,`snapshot`);return{revision:I(t.revision,`snapshot`),enabled:R(t.enabled,`snapshot`),assistants:Array.isArray(t.assistants)?t.assistants.map(B):M(`snapshot`)}},ie=e=>{let t=N(e,`binding`);return{sessionID:F(t.sessionID,`binding`),directory:P(t.directory,`binding`),sessionGeneration:I(t.sessionGeneration,`binding`)}},ae=e=>{let t=N(e,`message_admission`);if(t.admitted!==!0)return M(`message_admission`);let n=t.revision===void 0||t.revision===null?null:I(t.revision,`message_admission`);return{binding:ie(t.binding),messageID:P(t.messageID,`message_admission`),admitted:!0,revision:n,...t.replayed===!0?{replayed:!0}:{}}},oe=e=>{let t=N(e,`share_operation`);return{operationID:P(t.operationID,`share_operation`),assistantID:P(t.assistantID,`share_operation`),sessionID:F(t.sessionID,`share_operation`),messageID:F(t.messageID,`share_operation`),state:z(t.state,[`submitting`,`running`,`completed`,`failed`,`unresolved`],`share_operation`),phase:P(t.phase,`share_operation`),attempt:I(t.attempt,`share_operation`),leaseExpiresAt:L(t.leaseExpiresAt,`share_operation`),errorCode:F(t.errorCode,`share_operation`)}},se=e=>{let t=N(e,`assistant_contact_part`);if(t.type===`text`)return{type:`text`,text:P(t.text,`assistant_contact_part`)};if(t.type===`file`){let e=t.filename===void 0||t.filename===null?void 0:P(t.filename,`assistant_contact_part`),n=P(t.mime,`assistant_contact_part`),r=t.url!==void 0&&t.url!==null,i=t.attachmentID!==void 0&&t.attachmentID!==null;if(r&&i)return M(`assistant_contact_part`);if(i){let r=I(t.size,`assistant_contact_part`);return!Number.isSafeInteger(r)||r<0?M(`assistant_contact_part`):{type:`file`,mime:n,attachmentID:P(t.attachmentID,`assistant_contact_part`),sha256:P(t.sha256,`assistant_contact_part`),size:r,...e?{filename:e}:{}}}return r?{type:`file`,mime:n,url:P(t.url,`assistant_contact_part`),...e?{filename:e}:{}}:M(`assistant_contact_part`)}if(t.type===`card`){let e=z(t.cardType,[`session`,`assistant`,`schedule`],`assistant_contact_part`);return e===`session`?{type:`card`,cardType:`session`,sessionID:P(t.sessionID,`assistant_contact_part`),directory:P(t.directory,`assistant_contact_part`),title:F(t.title??null,`assistant_contact_part`),status:F(t.status??null,`assistant_contact_part`),branch:F(t.branch??null,`assistant_contact_part`)}:e===`assistant`?{type:`card`,cardType:`assistant`,assistantID:P(t.assistantID,`assistant_contact_part`),name:P(t.name,`assistant_contact_part`),providerID:P(t.providerID,`assistant_contact_part`),modelID:P(t.modelID,`assistant_contact_part`),mode:z(t.mode??`continuous`,[`continuous`,`stateless`],`assistant_contact_part`)}:{type:`card`,cardType:`schedule`,taskID:P(t.taskID,`assistant_contact_part`),projectID:P(t.projectID,`assistant_contact_part`),name:P(t.name,`assistant_contact_part`),kind:F(t.kind??null,`assistant_contact_part`),time:F(t.time??null,`assistant_contact_part`),timezone:F(t.timezone??null,`assistant_contact_part`),prompt:F(t.prompt??null,`assistant_contact_part`)}}return M(`assistant_contact_part`)},ce=e=>{let t=N(e,`assistant_contact`),n=F(t.nextCursor,`assistant_contact`),r=R(t.complete,`assistant_contact`);if(!r&&!n||r&&n||!Array.isArray(t.messages))return M(`assistant_contact`);let i=I(t.generation,`assistant_contact`),a=I(t.revision,`assistant_contact`);return!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(a)||a<0?M(`assistant_contact`):{messages:t.messages.map(e=>{let t=N(e,`assistant_contact_message`);if(!Array.isArray(t.parts))return M(`assistant_contact_message`);let n=t.parts.map(se);return{messageID:P(t.messageID,`assistant_contact_message`),assistantID:P(t.assistantID,`assistant_contact_message`),role:z(t.role,[`user`,`assistant`,`peer`],`assistant_contact_message`),turnID:P(t.turnID,`assistant_contact_message`),bubbleIndex:I(t.bubbleIndex,`assistant_contact_message`),createdAt:I(t.createdAt,`assistant_contact_message`),ordinal:I(t.ordinal,`assistant_contact_message`),status:P(t.status,`assistant_contact_message`),fromAssistantID:F(t.fromAssistantID??null,`assistant_contact_message`),fromAssistantName:F(t.fromAssistantName??null,`assistant_contact_message`),parts:n,text:typeof t.text==`string`?t.text:n.filter(e=>e.type===`text`).map(e=>e.text).join(``),cards:n.filter(e=>e.type===`card`)}}),nextCursor:n,complete:r,generation:i,revision:a}},le=e=>{let t=N(e,`assistant_scheduled_tasks`);return Array.isArray(t.tasks)?{tasks:t.tasks.map(e=>{let t=N(e,`assistant_scheduled_task`),n=t.task===null||t.task===void 0?null:N(t.task,`assistant_scheduled_task_live`);return{assistantID:P(t.assistantID,`assistant_scheduled_task`),projectID:P(t.projectID,`assistant_scheduled_task`),taskID:P(t.taskID,`assistant_scheduled_task`),createdAt:I(t.createdAt,`assistant_scheduled_task`),projectPath:F(t.projectPath??null,`assistant_scheduled_task`),projectLabel:F(t.projectLabel??null,`assistant_scheduled_task`),task:n}})}:M(`assistant_scheduled_tasks`)},ue=()=>({messages:[],generation:-1,revision:0,olderCursor:null,olderComplete:!0,hasMessageGap:!1,gapCursor:null,gapRequestIDs:null,gapTargetIDs:null,liveWindowIDs:[]}),V=e=>!!(e&&e.generation>=0),de=(e,t)=>e.ordinal===t.ordinal?e.messageID.localeCompare(t.messageID):e.ordinal-t.ordinal,H=(e,t,n=`incoming`)=>{let r=new Map;for(let t of e)r.set(t.messageID,t);for(let e of t)(n===`incoming`||!r.has(e.messageID))&&r.set(e.messageID,e);return[...r.values()].sort(de)},fe=e=>{let t=1/0;for(let n of e)n.ordinal<t&&(t=n.ordinal);return Number.isFinite(t)?t:null},U=e=>e.map(e=>e.messageID),pe=(e,t)=>{for(let n of e)if(t.has(n))return!0;return!1},me=e=>new Set(e),he=(e,t)=>!e||!t||e.length!==t.length?!1:e.every((e,n)=>e===t[n]),ge=e=>({...e,hasMessageGap:!1,gapCursor:null,gapRequestIDs:null,gapTargetIDs:null}),_e=(e,t)=>{let n=e??ue(),r=V(n),i=[...t.messages].sort(de),a=U(i);if(r&&t.generation<n.generation)return n;if(r&&t.generation>n.generation)return{messages:i,generation:t.generation,revision:t.revision,olderCursor:t.nextCursor,olderComplete:t.complete,hasMessageGap:!1,gapCursor:null,gapRequestIDs:null,gapTargetIDs:null,liveWindowIDs:a};if(!r)return{messages:i,generation:t.generation,revision:t.revision,olderCursor:t.complete?null:t.nextCursor,olderComplete:t.complete,hasMessageGap:!1,gapCursor:null,gapRequestIDs:null,gapTargetIDs:null,liveWindowIDs:a};if(i.length===0)return{...n,generation:t.generation,revision:Math.max(n.revision,t.revision),olderCursor:n.olderCursor??t.nextCursor,olderComplete:n.olderComplete&&t.complete,liveWindowIDs:[],hasMessageGap:n.hasMessageGap,gapCursor:n.hasMessageGap?t.nextCursor??n.gapCursor:null,gapRequestIDs:n.hasMessageGap?n.gapRequestIDs:null,gapTargetIDs:n.hasMessageGap?n.gapTargetIDs:null};let o=fe(i),s=H(n.messages.filter(e=>e.ordinal<o),H(n.messages.filter(e=>e.ordinal>=o),i,t.revision>=n.revision?`incoming`:`existing`),`incoming`),c=n.liveWindowIDs,l=me(a),u=c.length>0&&pe(c,l),d=n.hasMessageGap,f=n.gapCursor,p=n.gapRequestIDs,m=n.gapTargetIDs;if(!u&&c.length>0&&t.nextCursor){d=!0,f=t.nextCursor;let e=c.filter(e=>!l.has(e));p=e.length>0?e:[...c],m=n.hasMessageGap&&n.gapTargetIDs&&n.gapTargetIDs.length>0?n.gapTargetIDs:p}else n.hasMessageGap?(d=!0,f=n.gapCursor,p=n.gapRequestIDs,m=n.gapTargetIDs):(d=!1,f=null,p=null,m=null);return{messages:s,generation:t.generation,revision:Math.max(n.revision,t.revision),olderCursor:n.liveWindowIDs.length===0&&n.messages.length===0?t.complete?null:t.nextCursor:n.olderCursor,olderComplete:!r||n.liveWindowIDs.length===0&&n.messages.length===0?t.complete:n.olderComplete,hasMessageGap:d,gapCursor:d?f:null,gapRequestIDs:d?p:null,gapTargetIDs:d?m:null,liveWindowIDs:a}},ve=(e,t)=>{if(!V(e)||t.generation!==e.generation)return e;let n=t.revision>=e.revision?`incoming`:`existing`,r=H(e.messages,t.messages,n);return{...e,messages:r,revision:Math.max(e.revision,t.revision),olderCursor:t.complete?null:t.nextCursor,olderComplete:t.complete}},ye=(e,t,n)=>{if(!V(e)||t.generation!==e.generation)return e;let r=t.revision>=e.revision?`incoming`:`existing`,i=H(e.messages,t.messages,r),a=Math.max(e.revision,t.revision),o=n?.requestIDs??e.gapRequestIDs;if(!(e.hasMessageGap&&o&&e.gapRequestIDs&&he(o,e.gapRequestIDs)))return{...e,messages:i,revision:a};let s=U(t.messages),c=e.gapTargetIDs??[],l=me(c);return c.length>0&&pe(s,l)||t.complete||!t.nextCursor?ge({...e,messages:i,revision:a}):{...e,messages:i,revision:a,hasMessageGap:!0,gapCursor:t.nextCursor??e.gapCursor,gapRequestIDs:e.gapRequestIDs,gapTargetIDs:e.gapTargetIDs}},W={snapshot:(e=t())=>[e,`assistants`,`snapshot`],capability:(e=t())=>[e,`assistants`,`capability`],history:(e,r,i,a=t(),o=n())=>[a,o,`assistants`,`history`,e,r,i],contact:(e,r=t(),i=n())=>[r,i,`assistants`,`contact`,e],scheduledTasks:(e,r=t(),i=n())=>[r,i,`assistants`,`scheduled-tasks`,e],globalScheduledTasks:(e=t())=>[e,`scheduled-tasks`]},G=async(e,t={})=>{let n=await r(e,t),i=await n.json().catch(()=>null);if(!n.ok){let e=i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:`request_failed`,t=i&&typeof i==`object`&&`message`in i&&typeof i.message==`string`?i.message:void 0;throw new k(e,n.status,void 0,t)}return i},K=(e,t)=>({method:e,headers:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),q=(e,r)=>{if(t()!==e||n()!==r)throw new k(`runtime_stale`,409)},be=(e,t,r)=>{i.setQueryData(W.snapshot(r),n=>n&&{...n,assistants:n.assistants.map(n=>n.id!==e||n.sessionGeneration>t.sessionGeneration?n:{...n,sessionID:t.sessionID,sessionGeneration:t.sessionGeneration,effectiveWorkspacePath:t.directory})}),i.invalidateQueries({queryKey:W.snapshot(r)}),i.invalidateQueries({queryKey:[r,n(),`assistants`,`history`,e]})},xe=(e,t)=>{i.setQueryData(W.snapshot(t),t=>t&&{...t,assistants:t.assistants.some(t=>t.id===e.id)?t.assistants.map(t=>t.id===e.id?e:t):[...t.assistants,e]}),i.invalidateQueries({queryKey:W.snapshot(t)})},Se=2500,Ce=15e3,we=e=>!!e?.assistants.some(e=>e.working||e.activeContactTurn),Te=(e,t={})=>{if(t.assistantID){let n=e?.assistants.find(e=>e.id===t.assistantID);return n?.working||n?.activeContactTurn?Se:Ce}return we(e)?Se:Ce},J=(e=t())=>({queryKey:W.snapshot(e),queryFn:async({signal:e})=>re(await G(`/api/openchamber/assistants/snapshot`,{signal:e})),retry:2,refetchInterval:e=>Te(e.state.data),refetchIntervalInBackground:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!0}),Ee=()=>{let e=(0,h.c)(5),n,r,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=t(),n=c,r=J(a),e[0]=n,e[1]=r,e[2]=a):(n=e[0],r=e[1],a=e[2]);let o=n(r),s,l;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>u(e=>{if(t()!==a)return;if(e.type===`event-stream-ready`){i.invalidateQueries({queryKey:W.snapshot(a),exact:!0});return}if(e.type===`contact-turn-start`||e.type===`contact-turn-end`){i.invalidateQueries({queryKey:W.snapshot(a),exact:!0});return}if(e.type!==`assistants-changed`)return;let n=i.getQueryData(W.snapshot(a));(!n||e.revision>n.revision)&&i.invalidateQueries({queryKey:W.snapshot(a),exact:!0})}),l=[a],e[3]=s,e[4]=l):(s=e[3],l=e[4]),m.useEffect(s,l),o},De=(e,t={})=>{let n=new URLSearchParams;return n.set(`limit`,String(t.limit??20)),t.before&&n.set(`before`,t.before),t.messageID&&n.set(`messageID`,t.messageID),`/api/openchamber/assistants/${encodeURIComponent(e)}/contact/messages?${n}`},Y=async(e,t,n)=>ce(await G(De(e,t),n?{signal:n}:{})),Oe=(e,t)=>e.generation===t.generation&&e.revision===t.revision&&e.olderCursor===t.olderCursor&&e.olderComplete===t.olderComplete&&e.hasMessageGap===t.hasMessageGap&&e.gapCursor===t.gapCursor&&e.messages===t.messages&&e.liveWindowIDs===t.liveWindowIDs&&e.gapRequestIDs===t.gapRequestIDs&&e.gapTargetIDs===t.gapTargetIDs,X=new Map,Z=new Map,Q=e=>e.join(``),ke=async(e,t,n,r,a)=>{let o=Q(t),s=Z.get(o);if(s)return s;let c=(async()=>{let o=i.getQueryData(t)??n,s=0,c=!1,l=!1,u=o.gapRequestIDs?[...o.gapRequestIDs]:null,d=o.gapCursor;for(;o.hasMessageGap&&o.gapCursor&&s<5&&!a?.aborted;){q(r.transport,r.runtimeGeneration),s+=1;let n=o.gapCursor;try{let s=await Y(e,{limit:20,before:n},a);q(r.transport,r.runtimeGeneration);let l=i.getQueryData(t)??o;if(s.generation!==l.generation){o=l;break}let f=!u||!!(l.hasMessageGap&&l.gapRequestIDs&&l.gapRequestIDs.length===u.length&&l.gapRequestIDs.every((e,t)=>e===u[t]));if(o=ye(l,s,u?{requestIDs:u,cursor:d}:void 0),i.setQueryData(t,o),!f)break;if(!o.hasMessageGap){c=!0;break}if(o.gapCursor&&o.gapCursor!==n)c=!0;else break}catch(e){if(a?.aborted||A(e))break;l=!0,o=i.getQueryData(t)??o;break}}return{view:i.getQueryData(t)??o,failed:l,progressed:c}})();Z.set(o,c);try{return await c}finally{Z.get(o)===c&&Z.delete(o)}},Ae=(e,r=t(),a=n(),o={})=>({queryKey:W.contact(e,r,a),queryFn:async({signal:t})=>{q(r,a),await l(),q(r,a);let n=W.contact(e,r,a),o=i.getQueryData(n),s=await Y(e,{limit:20},t);q(r,a);let c=_e(i.getQueryData(n)??o??null,s);i.setQueryData(n,c);let u=Q(n);if(c.hasMessageGap&&c.gapCursor){X.delete(u);let i=await ke(e,n,c,{transport:r,runtimeGeneration:a},t);c=i.view,(i.failed||i.view.hasMessageGap&&!i.progressed)&&i.view.gapCursor&&X.set(u,i.view.gapCursor)}else X.delete(u);q(r,a);let d=i.getQueryData(n)??c;return o&&Oe(o,d)?o:d},retry:2,refetchInterval:()=>o.reconcileInForeground?Te(i.getQueryData(W.snapshot(r)),{assistantID:e}):!1,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!0,structuralSharing:!0}),je=(e,r=!0)=>{let a=t(),o=n(),[s,l]=m.useState(!1),[d,f]=m.useState(null),[p,h]=m.useState(!1),g=m.useRef(null),_=m.useRef(null),v=m.useRef(null),y=m.useRef(null),b=m.useRef({assistantID:e,transport:a,runtimeGeneration:o,enabled:r});b.current={assistantID:e,transport:a,runtimeGeneration:o,enabled:r};let x=c({...Ae(e,a,o,{reconcileInForeground:!0}),enabled:r&&!!e});m.useEffect(()=>u(n=>{t()===a&&(n.type===`assistants-changed`||n.type===`event-stream-ready`||n.type===`contact-turn-end`)&&(n.type===`contact-turn-end`&&`assistantID`in n&&n.assistantID!==e||i.invalidateQueries({queryKey:W.contact(e,a,o),exact:!0}))}),[e,o,a]),m.useEffect(()=>{let t=Q(W.contact(e,a,o));return()=>{v.current?.abort(),y.current?.abort(),v.current=null,y.current=null,g.current=null,_.current=null,X.delete(t)}},[e,a,o,r]);let S=x.data,C=W.contact(e,a,o),w=async()=>{if(!e||!r)return;if(g.current)return g.current;let t=i.getQueryData(C)??S;if(!t||t.olderComplete||!t.olderCursor)return;f(null),l(!0);let n=new AbortController;y.current?.abort(),y.current=n;let s={transport:a,runtimeGeneration:o,assistantID:e,cursor:t.olderCursor},c=(async()=>{try{q(s.transport,s.runtimeGeneration);let e=await Y(s.assistantID,{limit:20,before:s.cursor},n.signal);if(n.signal.aborted||(q(s.transport,s.runtimeGeneration),b.current.assistantID!==s.assistantID||b.current.transport!==s.transport||b.current.runtimeGeneration!==s.runtimeGeneration))return;let r=i.getQueryData(C)??t;if(e.generation!==r.generation)return;i.setQueryData(C,ve(r,e))}catch(e){if(n.signal.aborted||A(e))return;let t=e instanceof Error?e:Error(String(e));throw f(t),t}finally{y.current===n&&(y.current=null),l(!1),g.current=null}})();return g.current=c,c},T=async(t=`explicit`)=>{if(!e||!r)return;if(_.current)return _.current;let n=i.getQueryData(C)??S;if(!n?.hasMessageGap||!n.gapCursor)return;let s=Q(C);if(t===`auto`&&X.get(s)===n.gapCursor)return;t===`explicit`&&X.delete(s),h(!0);let c=new AbortController;v.current?.abort(),v.current=c;let l={transport:a,runtimeGeneration:o,assistantID:e,cursor:n.gapCursor},u=(async()=>{try{q(l.transport,l.runtimeGeneration);let e=await ke(l.assistantID,C,n,{transport:l.transport,runtimeGeneration:l.runtimeGeneration},c.signal);if(c.signal.aborted)return;if(q(l.transport,l.runtimeGeneration),e.failed||!e.progressed){e.view.gapCursor&&X.set(s,e.view.gapCursor);return}e.view.hasMessageGap||X.delete(s)}catch(e){if(c.signal.aborted||A(e))return;throw X.set(s,l.cursor),e}finally{v.current===c&&(v.current=null),h(!1),_.current=null}})();return _.current=u,u};return m.useEffect(()=>{if(!r||!e||!S?.hasMessageGap||!S.gapCursor||x.isFetching||p)return;let t=Q(C);X.get(t)!==S.gapCursor&&T(`auto`).catch(()=>void 0)},[r,e,S?.hasMessageGap,S?.gapCursor,x.isFetching,p,C]),{data:S?{messages:S.messages,generation:S.generation,revision:S.revision,nextCursor:S.olderCursor,complete:S.olderComplete}:void 0,status:x.status,fetchStatus:x.fetchStatus,isError:x.isError,isPending:x.isPending,isFetching:x.isFetching,isSuccess:x.isSuccess,error:x.error instanceof Error?x.error:x.error?Error(String(x.error)):null,refetch:()=>x.refetch(),fetchPreviousPage:w,hasPreviousPage:!!(S&&!S.olderComplete&&S.olderCursor),isFetchingPreviousPage:s,previousPageError:d,hasMessageGap:!!S?.hasMessageGap,isFillingMessageGap:p,retryMessageGap:()=>T(`explicit`)}},Me=async(e,r)=>{let a=t(),o=n();await l(),q(a,o);let s=await Y(e,{messageID:r,limit:1});if(q(a,o),!s.messages.some(e=>e.messageID===r&&e.role===`user`))return null;i.invalidateQueries({queryKey:W.contact(e,a,o),exact:!0}),i.invalidateQueries({queryKey:W.snapshot(a),exact:!0});let c=i.getQueryData(W.snapshot(a));return{admitted:!0,messageID:r,revision:s.revision??c?.revision??null}},Ne=(e,r=t(),i=n())=>({queryKey:W.scheduledTasks(e,r,i),queryFn:async({signal:t})=>{q(r,i);let n=le(await G(`/api/openchamber/assistants/${encodeURIComponent(e)}/scheduled-tasks`,{signal:t}));return q(r,i),n},refetchOnMount:`always`,retry:(e,t)=>!(t instanceof k&&t.status===404)&&e<2}),Pe=(e,r)=>{let i=(0,h.c)(6),a=r===void 0||r,o,s;if(i[0]!==e){let r=t(),a=n();s=c,o=Ne(e,r,a),i[0]=e,i[1]=o,i[2]=s}else o=i[1],s=i[2];let l=a&&!!e,u;return i[3]!==o||i[4]!==l?(u={...o,enabled:l},i[3]=o,i[4]=l,i[5]=u):u=i[5],s(u)},Fe=(e=t())=>({queryKey:W.globalScheduledTasks(e),queryFn:T,refetchOnMount:`always`}),Ie=e=>{let t=(0,h.c)(3),n=e===void 0||e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Fe(),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i={...r,enabled:n},t[1]=n,t[2]=i),c(i)},Le=(e,r=t())=>{i.invalidateQueries({queryKey:[r,n(),`assistants`,`contact`,e]})},Re=(e=t())=>({queryKey:W.capability(e),queryFn:()=>$e(),retry:!1}),ze=()=>{let e=(0,h.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Re(),e[0]=t):t=e[0],c(t)},Be=(e=i,n=t())=>e.getQueryData(W.snapshot(n)),Ve=(e=i,n=t())=>e.fetchQuery(J(n)),He=async(e=i)=>{let r=t(),a=n();await e.invalidateQueries({queryKey:W.snapshot(r),exact:!0}),q(r,a);let o=await e.fetchQuery(J(r));return q(r,a),o},Ue=15e3,We=e=>{throw e instanceof k?e:A(e)?new k(`admission_timeout`,408):e},Ge=async(e,r,i)=>{let a=t(),o=n(),s=typeof i==`string`?[{type:`text`,text:i}]:Array.isArray(i.parts)&&i.parts.length>0?i.parts:[{type:`text`,text:i.text??``}],c=AbortSignal.timeout(Ue);try{let t=ae(await G(`/api/openchamber/assistants/${encodeURIComponent(e)}/messages`,{...K(`POST`,{messageID:r,parts:s}),signal:c}));return q(a,o),be(e,t.binding,a),Le(e,a),t}catch(e){return We(e)}},Ke=async(e,r,i,a,o)=>{let s=t(),c=n(),l=oe(await G(`/api/openchamber/assistants/${encodeURIComponent(e)}/share`,K(`POST`,{operationID:r,payload:{messageID:i,parts:a,source:o}})));return q(s,c),l},qe=async(e,r=t(),i=n())=>{q(r,i);let a=oe(await G(`/api/openchamber/assistants/share-operations/${encodeURIComponent(e)}`));return q(r,i),a},Je=async(e,r=t(),i=n())=>{let a=e;for(let e=0;e<60&&(a.state===`running`||a.state===`submitting`);e+=1)q(r,i),await new Promise(e=>setTimeout(e,750)),a=await qe(a.operationID,r,i);if(q(r,i),a.state===`completed`)return a;throw a.state===`failed`?new j(a.errorCode??`share_failed`,400,a):new j(`share_unresolved`,408,a)},Ye=async(e,n)=>{await G(`/api/openchamber/assistants/settings`,K(`PUT`,{enabled:e,expectedRevision:n}));let r=t();await Promise.all([i.invalidateQueries({queryKey:W.snapshot(r),exact:!0}),i.invalidateQueries({queryKey:W.capability(r),exact:!0})])},Xe=async e=>{let n=t(),r=B(await G(`/api/openchamber/assistants`,K(`POST`,e)));return xe(r,n),r},Ze=async(e,r)=>{let i=t(),a=n(),o=B(await G(`/api/openchamber/assistants/${encodeURIComponent(e.id)}`,K(`PATCH`,{...r,expectedRevision:e.revision})));return q(i,a),xe(o,i),o},Qe=async e=>{await G(`/api/openchamber/assistants/${encodeURIComponent(e.id)}`,K(`DELETE`,{expectedRevision:e.revision})),await i.invalidateQueries({queryKey:W.snapshot(t())})},$e=async()=>ee(await G(`/api/openchamber/assistants/capability`)),$=a();function et(e){let t=(0,h.c)(32),{title:n,subtitle:r,backAriaLabel:i,onBack:a,backDisabled:o,actions:s,trailing:c,sticky:l,overlay:u,elevated:m}=e,g=o!==void 0&&o,_;t[0]===s?_=t[1]:(_=s===void 0?[]:s,t[0]=s,t[1]=_);let v=_,y=l!==void 0&&l,b=u!==void 0&&u,x=m!==void 0&&m,S=!!c||v.length>0,C=x||v.some(nt),w=y&&`oc-mobile-detail-navigation-sticky`,T=b&&`absolute inset-x-0 top-0`,E=C?`z-[60]`:b?`z-30`:void 0,D;t[2]!==w||t[3]!==T||t[4]!==E?(D=d(`oc-mobile-detail-navigation relative shrink-0 pt-[max(0.25rem,var(--oc-safe-area-top,0px))]`,w,T,E),t[2]=w,t[3]=T,t[4]=E,t[5]=D):D=t[5];let O=S&&v.length+ +!!c>1?`grid-cols-[2.75rem_minmax(0,1fr)_auto]`:`grid-cols-[2.75rem_minmax(0,1fr)_2.75rem]`,k;t[6]===O?k=t[7]:(k=d(`oc-mobile-detail-navigation-content grid items-center gap-1 px-4`,O),t[6]=O,t[7]=k);let A;t[8]!==i||t[9]!==g||t[10]!==a?(A=a?(0,$.jsx)(p,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:`justify-self-start`,onClick:a,disabled:g,"aria-label":i,children:(0,$.jsx)(f,{name:`arrow-left-s`,className:`size-5`})}):(0,$.jsx)(`span`,{"aria-hidden":`true`}),t[8]=i,t[9]=g,t[10]=a,t[11]=A):A=t[11];let j;t[12]===n?j=t[13]:(j=(0,$.jsx)(`div`,{className:`oc-mobile-detail-title w-full truncate typography-ui-label font-medium text-foreground`,children:n}),t[12]=n,t[13]=j);let M;t[14]===r?M=t[15]:(M=r?(0,$.jsx)(`div`,{className:`oc-mobile-detail-subtitle w-full truncate text-muted-foreground`,"aria-live":`polite`,children:r}):null,t[14]=r,t[15]=M);let N;t[16]!==j||t[17]!==M?(N=(0,$.jsxs)(`div`,{className:`flex w-full max-w-72 min-w-0 flex-col items-center justify-center justify-self-center px-1`,children:[j,M]}),t[16]=j,t[17]=M,t[18]=N):N=t[18];let P;t[19]===v?P=t[20]:(P=v.map(tt),t[19]=v,t[20]=P);let F;t[21]!==P||t[22]!==c?(F=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2`,children:[c,P]}),t[21]=P,t[22]=c,t[23]=F):F=t[23];let I;t[24]!==k||t[25]!==A||t[26]!==N||t[27]!==F?(I=(0,$.jsxs)(`div`,{className:k,children:[A,N,F]}),t[24]=k,t[25]=A,t[26]=N,t[27]=F,t[28]=I):I=t[28];let L;return t[29]!==D||t[30]!==I?(L=(0,$.jsx)(`header`,{className:D,children:I}),t[29]=D,t[30]=I,t[31]=L):L=t[31],L}function tt(e,t){return(0,$.jsx)(p,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:d(e.elevated&&`relative z-[60]`),onClick:e.onClick,disabled:e.disabled,"aria-label":e.ariaLabel,"aria-expanded":e.pressed,title:e.title,children:(0,$.jsx)(f,{name:e.icon,className:`size-5`})},`${e.icon}:${t}`)}function nt(e){return e.elevated}export{T as C,E,D as S,O as T,Ie as _,Ve as a,j as b,Be as c,Ye as d,Ze as f,Ee as g,Pe as h,Qe as i,Ge as l,je as m,Me as n,$e as o,ze as p,Xe as r,He as s,et as t,Ke as u,Je as v,w,A as x,k as y};
|