claude-mux 0.7.0 → 0.7.1

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.
Files changed (115) hide show
  1. package/README.md +4 -2
  2. package/dist/cli.d.ts +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/utils/version.d.ts +1 -1
  5. package/dist/utils/version.js +1 -1
  6. package/dist/web/client/_app/immutable/chunks/{DU91Ml7U.js → BGcEgn7w.js} +1 -1
  7. package/{web/.svelte-kit/output/client/_app/immutable/chunks/DmdO6ygw.js → dist/web/client/_app/immutable/chunks/By6CYjmE.js} +1 -1
  8. package/dist/web/client/_app/immutable/chunks/{HKNo9LID.js → CR5jMWGV.js} +1 -1
  9. package/{web/.svelte-kit/output/client/_app/immutable/entry/app.CGIBnoln.js → dist/web/client/_app/immutable/entry/app.DmtnygN7.js} +2 -2
  10. package/dist/web/client/_app/immutable/entry/start.fYmelGlC.js +1 -0
  11. package/dist/web/client/_app/immutable/nodes/{0.CqlJ9a31.js → 0.DGDAdwT5.js} +1 -1
  12. package/dist/web/client/_app/immutable/nodes/{1.BQUZh2-w.js → 1.Cg8dWgUN.js} +1 -1
  13. package/dist/web/client/_app/immutable/nodes/{2.CCV1YdgF.js → 2.DItUEo3e.js} +1 -1
  14. package/dist/web/client/_app/immutable/nodes/{3.D9tDCdq8.js → 3.dHui0twF.js} +1 -1
  15. package/dist/web/client/_app/immutable/nodes/{4.BqPyNkFA.js → 4.CiEHP0cr.js} +1 -1
  16. package/dist/web/client/_app/version.json +1 -1
  17. package/dist/web/server/chunks/{0-BHWsmCJv.js → 0-BmRg-l2z.js} +5 -5
  18. package/dist/web/server/chunks/{0-BHWsmCJv.js.map → 0-BmRg-l2z.js.map} +1 -1
  19. package/dist/web/server/chunks/{1-YRx6A8Tm.js → 1-CPgO8U7d.js} +3 -3
  20. package/dist/web/server/chunks/{1-YRx6A8Tm.js.map → 1-CPgO8U7d.js.map} +1 -1
  21. package/dist/web/server/chunks/{2-eC6JuGAo.js → 2--ZO5fZp_.js} +5 -5
  22. package/dist/web/server/chunks/{2-eC6JuGAo.js.map → 2--ZO5fZp_.js.map} +1 -1
  23. package/dist/web/server/chunks/{3-Bk-wV20p.js → 3-7HqSep9c.js} +3 -3
  24. package/dist/web/server/chunks/{3-Bk-wV20p.js.map → 3-7HqSep9c.js.map} +1 -1
  25. package/dist/web/server/chunks/{4-nteBgDrW.js → 4-C1PCdmY0.js} +4 -4
  26. package/dist/web/server/chunks/{4-nteBgDrW.js.map → 4-C1PCdmY0.js.map} +1 -1
  27. package/dist/web/server/index.js +1 -1
  28. package/dist/web/server/index.js.map +1 -1
  29. package/dist/web/server/manifest.js +10 -10
  30. package/dist/web/server/manifest.js.map +1 -1
  31. package/docs/release-checklist.md +8 -34
  32. package/docs/removing-hooks.md +14 -14
  33. package/package.json +1 -1
  34. package/src/cli.ts +1 -1
  35. package/src/utils/version.ts +1 -1
  36. package/web/.svelte-kit/adapter-bun/chunks/internal.js +1 -1
  37. package/web/.svelte-kit/adapter-bun/manifest-full.js +1 -1
  38. package/web/.svelte-kit/adapter-bun/manifest.js +1 -1
  39. package/web/.svelte-kit/adapter-bun/nodes/0.js +1 -1
  40. package/web/.svelte-kit/adapter-bun/nodes/1.js +1 -1
  41. package/web/.svelte-kit/adapter-bun/nodes/2.js +1 -1
  42. package/web/.svelte-kit/adapter-bun/nodes/3.js +1 -1
  43. package/web/.svelte-kit/adapter-bun/nodes/4.js +1 -1
  44. package/web/.svelte-kit/adapter-node/.vite/manifest.json +200 -15
  45. package/web/.svelte-kit/adapter-node/_app/immutable/assets/AllSessionsPanel.BKhqOrbV.css +1 -0
  46. package/web/.svelte-kit/adapter-node/_app/immutable/assets/_layout.WptSHSUl.css +1 -0
  47. package/web/.svelte-kit/adapter-node/_app/immutable/assets/_page.DldLgTc-.css +1 -0
  48. package/web/.svelte-kit/adapter-node/_app/immutable/assets/_page.DoNWy7tW.css +1 -0
  49. package/web/.svelte-kit/adapter-node/chunks/AllSessionsPanel.svelte_svelte_type_style_lang.js +49 -0
  50. package/web/.svelte-kit/adapter-node/chunks/alert-dialog-description.js +2670 -0
  51. package/web/.svelte-kit/adapter-node/chunks/auth.js +59 -0
  52. package/web/.svelte-kit/adapter-node/chunks/button.js +82 -0
  53. package/web/.svelte-kit/adapter-node/chunks/client.js +29 -0
  54. package/web/.svelte-kit/adapter-node/chunks/context.js +28 -16
  55. package/web/.svelte-kit/adapter-node/chunks/events.js +121 -0
  56. package/web/.svelte-kit/adapter-node/chunks/index.js +1 -1
  57. package/web/.svelte-kit/adapter-node/chunks/index2.js +186 -68
  58. package/web/.svelte-kit/adapter-node/chunks/internal.js +5 -90
  59. package/web/.svelte-kit/adapter-node/chunks/pane.js +82 -0
  60. package/web/.svelte-kit/adapter-node/chunks/sessions-json.js +16 -1
  61. package/web/.svelte-kit/adapter-node/chunks/sessions.svelte.js +174 -12
  62. package/web/.svelte-kit/adapter-node/chunks/ws-handlers.js +782 -0
  63. package/web/.svelte-kit/adapter-node/entries/endpoints/api/auth/login/_server.ts.js +22 -0
  64. package/web/.svelte-kit/adapter-node/entries/endpoints/api/auth/logout/_server.ts.js +9 -0
  65. package/web/.svelte-kit/adapter-node/entries/endpoints/api/beads/_server.ts.js +22 -0
  66. package/web/.svelte-kit/adapter-node/entries/endpoints/api/chrome/_server.ts.js +30 -0
  67. package/web/.svelte-kit/adapter-node/entries/endpoints/api/files/image/_server.ts.js +53 -0
  68. package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/kill/_server.ts.js +12 -6
  69. package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/restart/_server.ts.js +40 -0
  70. package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/screenshots/_server.ts.js +28 -0
  71. package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/send/_server.ts.js +11 -4
  72. package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_server.ts.js +1 -78
  73. package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_target_/output/_server.ts.js +2 -2
  74. package/web/.svelte-kit/adapter-node/entries/endpoints/api/tmux/panes/_server.ts.js +21 -0
  75. package/web/.svelte-kit/adapter-node/entries/fallbacks/error.svelte.js +1 -18
  76. package/web/.svelte-kit/adapter-node/entries/hooks.server.js +105 -0
  77. package/web/.svelte-kit/adapter-node/entries/pages/_layout.svelte.js +493 -6
  78. package/web/.svelte-kit/adapter-node/entries/pages/_page.svelte.js +3024 -54
  79. package/web/.svelte-kit/adapter-node/entries/pages/login/_page.server.ts.js +15 -0
  80. package/web/.svelte-kit/adapter-node/entries/pages/login/_page.svelte.js +37 -0
  81. package/web/.svelte-kit/adapter-node/entries/pages/session/_target_/_page.svelte.js +623 -46
  82. package/web/.svelte-kit/adapter-node/manifest-full.js +67 -3
  83. package/web/.svelte-kit/adapter-node/manifest.js +67 -3
  84. package/web/.svelte-kit/adapter-node/nodes/0.js +2 -2
  85. package/web/.svelte-kit/adapter-node/nodes/1.js +1 -1
  86. package/web/.svelte-kit/adapter-node/nodes/2.js +2 -2
  87. package/web/.svelte-kit/adapter-node/nodes/3.js +6 -4
  88. package/web/.svelte-kit/adapter-node/nodes/4.js +8 -0
  89. package/web/.svelte-kit/ambient.d.ts +28 -2
  90. package/web/.svelte-kit/generated/server/internal.js +1 -1
  91. package/web/.svelte-kit/output/client/.vite/manifest.json +44 -44
  92. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DU91Ml7U.js → BGcEgn7w.js} +1 -1
  93. package/{dist/web/client/_app/immutable/chunks/DmdO6ygw.js → web/.svelte-kit/output/client/_app/immutable/chunks/By6CYjmE.js} +1 -1
  94. package/web/.svelte-kit/output/client/_app/immutable/chunks/{HKNo9LID.js → CR5jMWGV.js} +1 -1
  95. package/{dist/web/client/_app/immutable/entry/app.CGIBnoln.js → web/.svelte-kit/output/client/_app/immutable/entry/app.DmtnygN7.js} +2 -2
  96. package/web/.svelte-kit/output/client/_app/immutable/entry/start.fYmelGlC.js +1 -0
  97. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.CqlJ9a31.js → 0.DGDAdwT5.js} +1 -1
  98. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.BQUZh2-w.js → 1.Cg8dWgUN.js} +1 -1
  99. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.CCV1YdgF.js → 2.DItUEo3e.js} +1 -1
  100. package/web/.svelte-kit/output/client/_app/immutable/nodes/{3.D9tDCdq8.js → 3.dHui0twF.js} +1 -1
  101. package/web/.svelte-kit/output/client/_app/immutable/nodes/{4.BqPyNkFA.js → 4.CiEHP0cr.js} +1 -1
  102. package/web/.svelte-kit/output/client/_app/version.json +1 -1
  103. package/web/.svelte-kit/output/server/chunks/internal.js +1 -1
  104. package/web/.svelte-kit/output/server/manifest-full.js +1 -1
  105. package/web/.svelte-kit/output/server/manifest.js +1 -1
  106. package/web/.svelte-kit/output/server/nodes/0.js +1 -1
  107. package/web/.svelte-kit/output/server/nodes/1.js +1 -1
  108. package/web/.svelte-kit/output/server/nodes/2.js +1 -1
  109. package/web/.svelte-kit/output/server/nodes/3.js +1 -1
  110. package/web/.svelte-kit/output/server/nodes/4.js +1 -1
  111. package/dist/web/client/_app/immutable/entry/start.CJk8zB1j.js +0 -1
  112. package/web/.svelte-kit/adapter-node/_app/immutable/assets/_layout.4NiX29PU.css +0 -1
  113. package/web/.svelte-kit/adapter-node/_app/immutable/assets/_page.BEMzYUGV.css +0 -1
  114. package/web/.svelte-kit/adapter-node/_app/immutable/assets/_page.DOJn7TG7.css +0 -1
  115. package/web/.svelte-kit/output/client/_app/immutable/entry/start.CJk8zB1j.js +0 -1
@@ -1,9 +1,2507 @@
1
- import { Z as head, _ as attr_class, $ as attr, a0 as ensure_array_like, a1 as attr_style, a2 as stringify } from "../../chunks/index2.js";
2
- import { o as onDestroy, s as sessionStore, g as getProjectColor, a as stateColor } from "../../chunks/sessions.svelte.js";
3
- import { e as escape_html } from "../../chunks/context.js";
4
- function _page($$renderer, $$props) {
1
+ import { a5 as derived, a6 as attributes, a7 as bind_props, a8 as spread_props, a9 as props_id, aa as clsx, a1 as ensure_array_like, ab as element, a2 as store_get, a3 as unsubscribe_stores, Z as attr_class, a0 as attr, _ as attr_style, $ as stringify, a4 as head } from "../../chunks/index2.js";
2
+ import { g as goto } from "../../chunks/client.js";
3
+ import { s as sessionStore, p as page, g as getProjectColor, a as stateColor } from "../../chunks/sessions.svelte.js";
4
+ import { c as cn, B as Button } from "../../chunks/button.js";
5
+ import { B as Badge } from "../../chunks/AllSessionsPanel.svelte_svelte_type_style_lang.js";
6
+ import { s as styleToString, C as Context, a as attachRef, w as watch, E as ENTER, S as SPACE, i as isHTMLElement, c as createBitsAttrs, b as boolToEmptyStrOrUndef, d as boolToStr, g as getAriaChecked, m as mergeProps, e as createId, f as boxWith, n as noop, D as DialogRootState, h as DialogCloseState, j as DialogContentState, F as Focus_scope, k as Escape_layer, l as Dismissible_layer, T as Text_selection_layer, o as Scroll_lock, p as simpleBox, q as executeCallbacks, r as DOMContext, u as useId, P as Portal, t as Dialog_title$1, v as Dialog_overlay$1, A as Alert_dialog, x as Alert_dialog_content, y as Alert_dialog_header, z as Alert_dialog_title, B as Alert_dialog_description, G as Alert_dialog_footer, H as Alert_dialog_cancel, I as Alert_dialog_action } from "../../chunks/alert-dialog-description.js";
7
+ import { i as is_array, b as get_prototype_of, o as object_prototype, e as escape_html } from "../../chunks/context.js";
8
+ import "clsx";
9
+ import { o as on } from "../../chunks/events.js";
10
+ const empty = [];
11
+ function snapshot(value, skip_warning = false, no_tojson = false) {
12
+ return clone(value, /* @__PURE__ */ new Map(), "", empty, null, no_tojson);
13
+ }
14
+ function clone(value, cloned, path, paths, original = null, no_tojson = false) {
15
+ if (typeof value === "object" && value !== null) {
16
+ var unwrapped = cloned.get(value);
17
+ if (unwrapped !== void 0) return unwrapped;
18
+ if (value instanceof Map) return (
19
+ /** @type {Snapshot<T>} */
20
+ new Map(value)
21
+ );
22
+ if (value instanceof Set) return (
23
+ /** @type {Snapshot<T>} */
24
+ new Set(value)
25
+ );
26
+ if (is_array(value)) {
27
+ var copy = (
28
+ /** @type {Snapshot<any>} */
29
+ Array(value.length)
30
+ );
31
+ cloned.set(value, copy);
32
+ if (original !== null) {
33
+ cloned.set(original, copy);
34
+ }
35
+ for (var i = 0; i < value.length; i += 1) {
36
+ var element2 = value[i];
37
+ if (i in value) {
38
+ copy[i] = clone(element2, cloned, path, paths, null, no_tojson);
39
+ }
40
+ }
41
+ return copy;
42
+ }
43
+ if (get_prototype_of(value) === object_prototype) {
44
+ copy = {};
45
+ cloned.set(value, copy);
46
+ if (original !== null) {
47
+ cloned.set(original, copy);
48
+ }
49
+ for (var key in value) {
50
+ copy[key] = clone(
51
+ // @ts-expect-error
52
+ value[key],
53
+ cloned,
54
+ path,
55
+ paths,
56
+ null,
57
+ no_tojson
58
+ );
59
+ }
60
+ return copy;
61
+ }
62
+ if (value instanceof Date) {
63
+ return (
64
+ /** @type {Snapshot<T>} */
65
+ structuredClone(value)
66
+ );
67
+ }
68
+ if (typeof /** @type {T & { toJSON?: any } } */
69
+ value.toJSON === "function" && !no_tojson) {
70
+ return clone(
71
+ /** @type {T & { toJSON(): any } } */
72
+ value.toJSON(),
73
+ cloned,
74
+ path,
75
+ paths,
76
+ // Associate the instance with the toJSON clone
77
+ value
78
+ );
79
+ }
80
+ }
81
+ if (value instanceof EventTarget) {
82
+ return (
83
+ /** @type {Snapshot<T>} */
84
+ value
85
+ );
86
+ }
87
+ try {
88
+ return (
89
+ /** @type {Snapshot<T>} */
90
+ structuredClone(value)
91
+ );
92
+ } catch (e) {
93
+ return (
94
+ /** @type {Snapshot<T>} */
95
+ value
96
+ );
97
+ }
98
+ }
99
+ const srOnlyStyles = {
100
+ position: "absolute",
101
+ width: "1px",
102
+ height: "1px",
103
+ padding: "0",
104
+ margin: "-1px",
105
+ overflow: "hidden",
106
+ clip: "rect(0, 0, 0, 0)",
107
+ whiteSpace: "nowrap",
108
+ borderWidth: "0",
109
+ transform: "translateX(-100%)"
110
+ };
111
+ const srOnlyStylesString = styleToString(srOnlyStyles);
112
+ function isFunction(value) {
113
+ return typeof value === "function";
114
+ }
115
+ function extract(value, defaultValue) {
116
+ if (isFunction(value)) {
117
+ const getter = value;
118
+ const gotten = getter();
119
+ if (gotten === void 0) return defaultValue;
120
+ return gotten;
121
+ }
122
+ if (value === void 0) return defaultValue;
123
+ return value;
124
+ }
125
+ function useDebounce(callback, wait) {
126
+ let context = null;
127
+ const wait$ = extract(wait, 250);
128
+ function debounced(...args) {
129
+ if (context) {
130
+ if (context.timeout) {
131
+ clearTimeout(context.timeout);
132
+ }
133
+ } else {
134
+ let resolve;
135
+ let reject;
136
+ const promise = new Promise((res, rej) => {
137
+ resolve = res;
138
+ reject = rej;
139
+ });
140
+ context = { timeout: null, runner: null, promise, resolve, reject };
141
+ }
142
+ context.runner = async () => {
143
+ if (!context) return;
144
+ const ctx = context;
145
+ context = null;
146
+ try {
147
+ ctx.resolve(await callback.apply(this, args));
148
+ } catch (error) {
149
+ ctx.reject(error);
150
+ }
151
+ };
152
+ context.timeout = setTimeout(context.runner, wait$);
153
+ return context.promise;
154
+ }
155
+ debounced.cancel = async () => {
156
+ if (!context || context.timeout === null) {
157
+ await new Promise((resolve) => setTimeout(resolve, 0));
158
+ if (!context || context.timeout === null) return;
159
+ }
160
+ clearTimeout(context.timeout);
161
+ context.reject("Cancelled");
162
+ context = null;
163
+ };
164
+ debounced.runScheduledNow = async () => {
165
+ if (!context || !context.timeout) {
166
+ await new Promise((resolve) => setTimeout(resolve, 0));
167
+ if (!context || !context.timeout) return;
168
+ }
169
+ clearTimeout(context.timeout);
170
+ context.timeout = null;
171
+ await context.runner?.();
172
+ };
173
+ Object.defineProperty(debounced, "pending", {
174
+ enumerable: true,
175
+ get() {
176
+ return !!context?.timeout;
177
+ }
178
+ });
179
+ return debounced;
180
+ }
181
+ class IsMounted {
182
+ #isMounted = false;
183
+ constructor() {
184
+ }
185
+ get current() {
186
+ return this.#isMounted;
187
+ }
188
+ }
189
+ class Previous {
190
+ #previousCallback = () => void 0;
191
+ #previous = derived(() => this.#previousCallback());
192
+ constructor(getter, initialValue) {
193
+ let actualPrevious = void 0;
194
+ if (initialValue !== void 0) actualPrevious = initialValue;
195
+ this.#previousCallback = () => {
196
+ try {
197
+ return actualPrevious;
198
+ } finally {
199
+ actualPrevious = getter();
200
+ }
201
+ };
202
+ }
203
+ get current() {
204
+ return this.#previous();
205
+ }
206
+ }
207
+ const checkboxAttrs = createBitsAttrs({
208
+ component: "checkbox",
209
+ parts: ["root", "group", "group-label", "input"]
210
+ });
211
+ const CheckboxGroupContext = new Context("Checkbox.Group");
212
+ const CheckboxRootContext = new Context("Checkbox.Root");
213
+ class CheckboxRootState {
214
+ static create(opts, group = null) {
215
+ return CheckboxRootContext.set(new CheckboxRootState(opts, group));
216
+ }
217
+ opts;
218
+ group;
219
+ #trueName = derived(() => {
220
+ if (this.group && this.group.opts.name.current) return this.group.opts.name.current;
221
+ return this.opts.name.current;
222
+ });
223
+ get trueName() {
224
+ return this.#trueName();
225
+ }
226
+ set trueName($$value) {
227
+ return this.#trueName($$value);
228
+ }
229
+ #trueRequired = derived(() => {
230
+ if (this.group && this.group.opts.required.current) return true;
231
+ return this.opts.required.current;
232
+ });
233
+ get trueRequired() {
234
+ return this.#trueRequired();
235
+ }
236
+ set trueRequired($$value) {
237
+ return this.#trueRequired($$value);
238
+ }
239
+ #trueDisabled = derived(() => {
240
+ if (this.group && this.group.opts.disabled.current) return true;
241
+ return this.opts.disabled.current;
242
+ });
243
+ get trueDisabled() {
244
+ return this.#trueDisabled();
245
+ }
246
+ set trueDisabled($$value) {
247
+ return this.#trueDisabled($$value);
248
+ }
249
+ #trueReadonly = derived(() => {
250
+ if (this.group && this.group.opts.readonly.current) return true;
251
+ return this.opts.readonly.current;
252
+ });
253
+ get trueReadonly() {
254
+ return this.#trueReadonly();
255
+ }
256
+ set trueReadonly($$value) {
257
+ return this.#trueReadonly($$value);
258
+ }
259
+ attachment;
260
+ constructor(opts, group) {
261
+ this.opts = opts;
262
+ this.group = group;
263
+ this.attachment = attachRef(this.opts.ref);
264
+ this.onkeydown = this.onkeydown.bind(this);
265
+ this.onclick = this.onclick.bind(this);
266
+ watch.pre(
267
+ [
268
+ () => snapshot(this.group?.opts.value.current),
269
+ () => this.opts.value.current
270
+ ],
271
+ ([groupValue, value]) => {
272
+ if (!groupValue || !value) return;
273
+ this.opts.checked.current = groupValue.includes(value);
274
+ }
275
+ );
276
+ watch.pre(() => this.opts.checked.current, (checked) => {
277
+ if (!this.group) return;
278
+ if (checked) {
279
+ this.group?.addValue(this.opts.value.current);
280
+ } else {
281
+ this.group?.removeValue(this.opts.value.current);
282
+ }
283
+ });
284
+ }
285
+ onkeydown(e) {
286
+ if (this.trueDisabled || this.trueReadonly) return;
287
+ if (e.key === ENTER) {
288
+ e.preventDefault();
289
+ if (this.opts.type.current === "submit") {
290
+ const form = e.currentTarget.closest("form");
291
+ form?.requestSubmit();
292
+ }
293
+ return;
294
+ }
295
+ if (e.key === SPACE) {
296
+ e.preventDefault();
297
+ this.#toggle();
298
+ }
299
+ }
300
+ #toggle() {
301
+ if (this.opts.indeterminate.current) {
302
+ this.opts.indeterminate.current = false;
303
+ this.opts.checked.current = true;
304
+ } else {
305
+ this.opts.checked.current = !this.opts.checked.current;
306
+ }
307
+ }
308
+ onclick(e) {
309
+ if (this.trueDisabled || this.trueReadonly) return;
310
+ if (this.opts.type.current === "submit") {
311
+ this.#toggle();
312
+ return;
313
+ }
314
+ e.preventDefault();
315
+ this.#toggle();
316
+ }
317
+ #snippetProps = derived(() => ({
318
+ checked: this.opts.checked.current,
319
+ indeterminate: this.opts.indeterminate.current
320
+ }));
321
+ get snippetProps() {
322
+ return this.#snippetProps();
323
+ }
324
+ set snippetProps($$value) {
325
+ return this.#snippetProps($$value);
326
+ }
327
+ #props = derived(() => ({
328
+ id: this.opts.id.current,
329
+ role: "checkbox",
330
+ type: this.opts.type.current,
331
+ disabled: this.trueDisabled,
332
+ "aria-checked": getAriaChecked(this.opts.checked.current, this.opts.indeterminate.current),
333
+ "aria-required": boolToStr(this.trueRequired),
334
+ "aria-readonly": boolToStr(this.trueReadonly),
335
+ "data-disabled": boolToEmptyStrOrUndef(this.trueDisabled),
336
+ "data-readonly": boolToEmptyStrOrUndef(this.trueReadonly),
337
+ "data-state": getCheckboxDataState(this.opts.checked.current, this.opts.indeterminate.current),
338
+ [checkboxAttrs.root]: "",
339
+ onclick: this.onclick,
340
+ onkeydown: this.onkeydown,
341
+ ...this.attachment
342
+ }));
343
+ get props() {
344
+ return this.#props();
345
+ }
346
+ set props($$value) {
347
+ return this.#props($$value);
348
+ }
349
+ }
350
+ class CheckboxInputState {
351
+ static create() {
352
+ return new CheckboxInputState(CheckboxRootContext.get());
353
+ }
354
+ root;
355
+ #trueChecked = derived(() => {
356
+ if (!this.root.group) return this.root.opts.checked.current;
357
+ if (this.root.opts.value.current !== void 0 && this.root.group.opts.value.current.includes(this.root.opts.value.current)) {
358
+ return true;
359
+ }
360
+ return false;
361
+ });
362
+ get trueChecked() {
363
+ return this.#trueChecked();
364
+ }
365
+ set trueChecked($$value) {
366
+ return this.#trueChecked($$value);
367
+ }
368
+ #shouldRender = derived(() => Boolean(this.root.trueName));
369
+ get shouldRender() {
370
+ return this.#shouldRender();
371
+ }
372
+ set shouldRender($$value) {
373
+ return this.#shouldRender($$value);
374
+ }
375
+ constructor(root) {
376
+ this.root = root;
377
+ this.onfocus = this.onfocus.bind(this);
378
+ }
379
+ onfocus(_) {
380
+ if (!isHTMLElement(this.root.opts.ref.current)) return;
381
+ this.root.opts.ref.current.focus();
382
+ }
383
+ #props = derived(() => ({
384
+ type: "checkbox",
385
+ checked: this.root.opts.checked.current === true,
386
+ disabled: this.root.trueDisabled,
387
+ required: this.root.trueRequired,
388
+ name: this.root.trueName,
389
+ value: this.root.opts.value.current,
390
+ readonly: this.root.trueReadonly,
391
+ onfocus: this.onfocus
392
+ }));
393
+ get props() {
394
+ return this.#props();
395
+ }
396
+ set props($$value) {
397
+ return this.#props($$value);
398
+ }
399
+ }
400
+ function getCheckboxDataState(checked, indeterminate) {
401
+ if (indeterminate) return "indeterminate";
402
+ return checked ? "checked" : "unchecked";
403
+ }
404
+ function Hidden_input($$renderer, $$props) {
405
+ $$renderer.component(($$renderer2) => {
406
+ let { value = void 0, $$slots, $$events, ...restProps } = $$props;
407
+ const mergedProps = mergeProps(restProps, {
408
+ "aria-hidden": "true",
409
+ tabindex: -1,
410
+ style: srOnlyStylesString
411
+ });
412
+ if (mergedProps.type === "checkbox") {
413
+ $$renderer2.push("<!--[-->");
414
+ $$renderer2.push(`<input${attributes({ ...mergedProps, value }, void 0, void 0, void 0, 4)}/>`);
415
+ } else {
416
+ $$renderer2.push("<!--[!-->");
417
+ $$renderer2.push(`<input${attributes({ value, ...mergedProps }, void 0, void 0, void 0, 4)}/>`);
418
+ }
419
+ $$renderer2.push(`<!--]-->`);
420
+ bind_props($$props, { value });
421
+ });
422
+ }
423
+ function Checkbox_input($$renderer, $$props) {
424
+ $$renderer.component(($$renderer2) => {
425
+ const inputState = CheckboxInputState.create();
426
+ if (inputState.shouldRender) {
427
+ $$renderer2.push("<!--[-->");
428
+ Hidden_input($$renderer2, spread_props([inputState.props]));
429
+ } else {
430
+ $$renderer2.push("<!--[!-->");
431
+ }
432
+ $$renderer2.push(`<!--]-->`);
433
+ });
434
+ }
435
+ function Checkbox$1($$renderer, $$props) {
436
+ $$renderer.component(($$renderer2) => {
437
+ const uid = props_id($$renderer2);
438
+ let {
439
+ checked = false,
440
+ ref = null,
441
+ onCheckedChange,
442
+ children,
443
+ disabled = false,
444
+ required = false,
445
+ name = void 0,
446
+ value = "on",
447
+ id = createId(uid),
448
+ indeterminate = false,
449
+ onIndeterminateChange,
450
+ child,
451
+ type = "button",
452
+ readonly,
453
+ $$slots,
454
+ $$events,
455
+ ...restProps
456
+ } = $$props;
457
+ const group = CheckboxGroupContext.getOr(null);
458
+ if (group && value) {
459
+ if (group.opts.value.current.includes(value)) {
460
+ checked = true;
461
+ } else {
462
+ checked = false;
463
+ }
464
+ }
465
+ watch.pre(() => value, () => {
466
+ if (group && value) {
467
+ if (group.opts.value.current.includes(value)) {
468
+ checked = true;
469
+ } else {
470
+ checked = false;
471
+ }
472
+ }
473
+ });
474
+ const rootState = CheckboxRootState.create(
475
+ {
476
+ checked: boxWith(() => checked, (v) => {
477
+ checked = v;
478
+ onCheckedChange?.(v);
479
+ }),
480
+ disabled: boxWith(() => disabled ?? false),
481
+ required: boxWith(() => required),
482
+ name: boxWith(() => name),
483
+ value: boxWith(() => value),
484
+ id: boxWith(() => id),
485
+ ref: boxWith(() => ref, (v) => ref = v),
486
+ indeterminate: boxWith(() => indeterminate, (v) => {
487
+ indeterminate = v;
488
+ onIndeterminateChange?.(v);
489
+ }),
490
+ type: boxWith(() => type),
491
+ readonly: boxWith(() => Boolean(readonly))
492
+ },
493
+ group
494
+ );
495
+ const mergedProps = mergeProps({ ...restProps }, rootState.props);
496
+ if (child) {
497
+ $$renderer2.push("<!--[-->");
498
+ child($$renderer2, { props: mergedProps, ...rootState.snippetProps });
499
+ $$renderer2.push(`<!---->`);
500
+ } else {
501
+ $$renderer2.push("<!--[!-->");
502
+ $$renderer2.push(`<button${attributes({ ...mergedProps })}>`);
503
+ children?.($$renderer2, rootState.snippetProps);
504
+ $$renderer2.push(`<!----></button>`);
505
+ }
506
+ $$renderer2.push(`<!--]--> `);
507
+ Checkbox_input($$renderer2);
508
+ $$renderer2.push(`<!---->`);
509
+ bind_props($$props, { checked, ref, indeterminate });
510
+ });
511
+ }
512
+ function Dialog$1($$renderer, $$props) {
513
+ $$renderer.component(($$renderer2) => {
514
+ let {
515
+ open = false,
516
+ onOpenChange = noop,
517
+ onOpenChangeComplete = noop,
518
+ children
519
+ } = $$props;
520
+ DialogRootState.create({
521
+ variant: boxWith(() => "dialog"),
522
+ open: boxWith(() => open, (v) => {
523
+ open = v;
524
+ onOpenChange(v);
525
+ }),
526
+ onOpenChangeComplete: boxWith(() => onOpenChangeComplete)
527
+ });
528
+ children?.($$renderer2);
529
+ $$renderer2.push(`<!---->`);
530
+ bind_props($$props, { open });
531
+ });
532
+ }
533
+ function Dialog_close($$renderer, $$props) {
534
+ $$renderer.component(($$renderer2) => {
535
+ const uid = props_id($$renderer2);
536
+ let {
537
+ children,
538
+ child,
539
+ id = createId(uid),
540
+ ref = null,
541
+ disabled = false,
542
+ $$slots,
543
+ $$events,
544
+ ...restProps
545
+ } = $$props;
546
+ const closeState = DialogCloseState.create({
547
+ variant: boxWith(() => "close"),
548
+ id: boxWith(() => id),
549
+ ref: boxWith(() => ref, (v) => ref = v),
550
+ disabled: boxWith(() => Boolean(disabled))
551
+ });
552
+ const mergedProps = mergeProps(restProps, closeState.props);
553
+ if (child) {
554
+ $$renderer2.push("<!--[-->");
555
+ child($$renderer2, { props: mergedProps });
556
+ $$renderer2.push(`<!---->`);
557
+ } else {
558
+ $$renderer2.push("<!--[!-->");
559
+ $$renderer2.push(`<button${attributes({ ...mergedProps })}>`);
560
+ children?.($$renderer2);
561
+ $$renderer2.push(`<!----></button>`);
562
+ }
563
+ $$renderer2.push(`<!--]-->`);
564
+ bind_props($$props, { ref });
565
+ });
566
+ }
567
+ function Dialog_content$1($$renderer, $$props) {
568
+ $$renderer.component(($$renderer2) => {
569
+ const uid = props_id($$renderer2);
570
+ let {
571
+ id = createId(uid),
572
+ children,
573
+ child,
574
+ ref = null,
575
+ forceMount = false,
576
+ onCloseAutoFocus = noop,
577
+ onOpenAutoFocus = noop,
578
+ onEscapeKeydown = noop,
579
+ onInteractOutside = noop,
580
+ trapFocus = true,
581
+ preventScroll = true,
582
+ restoreScrollDelay = null,
583
+ $$slots,
584
+ $$events,
585
+ ...restProps
586
+ } = $$props;
587
+ const contentState = DialogContentState.create({
588
+ id: boxWith(() => id),
589
+ ref: boxWith(() => ref, (v) => ref = v)
590
+ });
591
+ const mergedProps = mergeProps(restProps, contentState.props);
592
+ if (contentState.shouldRender || forceMount) {
593
+ $$renderer2.push("<!--[-->");
594
+ {
595
+ let focusScope = function($$renderer3, { props: focusScopeProps }) {
596
+ Escape_layer($$renderer3, spread_props([
597
+ mergedProps,
598
+ {
599
+ enabled: contentState.root.opts.open.current,
600
+ ref: contentState.opts.ref,
601
+ onEscapeKeydown: (e) => {
602
+ onEscapeKeydown(e);
603
+ if (e.defaultPrevented) return;
604
+ contentState.root.handleClose();
605
+ },
606
+ children: ($$renderer4) => {
607
+ Dismissible_layer($$renderer4, spread_props([
608
+ mergedProps,
609
+ {
610
+ ref: contentState.opts.ref,
611
+ enabled: contentState.root.opts.open.current,
612
+ onInteractOutside: (e) => {
613
+ onInteractOutside(e);
614
+ if (e.defaultPrevented) return;
615
+ contentState.root.handleClose();
616
+ },
617
+ children: ($$renderer5) => {
618
+ Text_selection_layer($$renderer5, spread_props([
619
+ mergedProps,
620
+ {
621
+ ref: contentState.opts.ref,
622
+ enabled: contentState.root.opts.open.current,
623
+ children: ($$renderer6) => {
624
+ if (child) {
625
+ $$renderer6.push("<!--[-->");
626
+ if (contentState.root.opts.open.current) {
627
+ $$renderer6.push("<!--[-->");
628
+ Scroll_lock($$renderer6, { preventScroll, restoreScrollDelay });
629
+ } else {
630
+ $$renderer6.push("<!--[!-->");
631
+ }
632
+ $$renderer6.push(`<!--]--> `);
633
+ child($$renderer6, {
634
+ props: mergeProps(mergedProps, focusScopeProps),
635
+ ...contentState.snippetProps
636
+ });
637
+ $$renderer6.push(`<!---->`);
638
+ } else {
639
+ $$renderer6.push("<!--[!-->");
640
+ Scroll_lock($$renderer6, { preventScroll });
641
+ $$renderer6.push(`<!----> <div${attributes({ ...mergeProps(mergedProps, focusScopeProps) })}>`);
642
+ children?.($$renderer6);
643
+ $$renderer6.push(`<!----></div>`);
644
+ }
645
+ $$renderer6.push(`<!--]-->`);
646
+ },
647
+ $$slots: { default: true }
648
+ }
649
+ ]));
650
+ },
651
+ $$slots: { default: true }
652
+ }
653
+ ]));
654
+ },
655
+ $$slots: { default: true }
656
+ }
657
+ ]));
658
+ };
659
+ Focus_scope($$renderer2, {
660
+ ref: contentState.opts.ref,
661
+ loop: true,
662
+ trapFocus,
663
+ enabled: contentState.root.opts.open.current,
664
+ onOpenAutoFocus,
665
+ onCloseAutoFocus,
666
+ focusScope
667
+ });
668
+ }
669
+ } else {
670
+ $$renderer2.push("<!--[!-->");
671
+ }
672
+ $$renderer2.push(`<!--]-->`);
673
+ bind_props($$props, { ref });
674
+ });
675
+ }
676
+ class SvelteResizeObserver {
677
+ #node;
678
+ #onResize;
679
+ constructor(node, onResize) {
680
+ this.#node = node;
681
+ this.#onResize = onResize;
682
+ this.handler = this.handler.bind(this);
683
+ }
684
+ handler() {
685
+ let rAF = 0;
686
+ const _node = this.#node();
687
+ if (!_node) return;
688
+ const resizeObserver = new ResizeObserver(() => {
689
+ cancelAnimationFrame(rAF);
690
+ rAF = window.requestAnimationFrame(this.#onResize);
691
+ });
692
+ resizeObserver.observe(_node);
693
+ return () => {
694
+ window.cancelAnimationFrame(rAF);
695
+ resizeObserver.unobserve(_node);
696
+ };
697
+ }
698
+ }
699
+ class StateMachine {
700
+ state;
701
+ #machine;
702
+ constructor(initialState, machine) {
703
+ this.state = simpleBox(initialState);
704
+ this.#machine = machine;
705
+ this.dispatch = this.dispatch.bind(this);
706
+ }
707
+ #reducer(event) {
708
+ const nextState = this.#machine[this.state.current][event];
709
+ return nextState ?? this.state.current;
710
+ }
711
+ dispatch(event) {
712
+ this.state.current = this.#reducer(event);
713
+ }
714
+ }
715
+ const presenceMachine = {
716
+ mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" },
717
+ unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" },
718
+ unmounted: { MOUNT: "mounted" }
719
+ };
720
+ class Presence {
721
+ opts;
722
+ prevAnimationNameState = "none";
723
+ styles = {};
724
+ initialStatus;
725
+ previousPresent;
726
+ machine;
727
+ present;
728
+ constructor(opts) {
729
+ this.opts = opts;
730
+ this.present = this.opts.open;
731
+ this.initialStatus = opts.open.current ? "mounted" : "unmounted";
732
+ this.previousPresent = new Previous(() => this.present.current);
733
+ this.machine = new StateMachine(this.initialStatus, presenceMachine);
734
+ this.handleAnimationEnd = this.handleAnimationEnd.bind(this);
735
+ this.handleAnimationStart = this.handleAnimationStart.bind(this);
736
+ watchPresenceChange(this);
737
+ watchStatusChange(this);
738
+ watchRefChange(this);
739
+ }
740
+ /**
741
+ * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
742
+ * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
743
+ * make sure we only trigger ANIMATION_END for the currently active animation.
744
+ */
745
+ handleAnimationEnd(event) {
746
+ if (!this.opts.ref.current) return;
747
+ const currAnimationName = getAnimationName(this.opts.ref.current);
748
+ const isCurrentAnimation = currAnimationName.includes(event.animationName) || currAnimationName === "none";
749
+ if (event.target === this.opts.ref.current && isCurrentAnimation) {
750
+ this.machine.dispatch("ANIMATION_END");
751
+ }
752
+ }
753
+ handleAnimationStart(event) {
754
+ if (!this.opts.ref.current) return;
755
+ if (event.target === this.opts.ref.current) {
756
+ this.prevAnimationNameState = getAnimationName(this.opts.ref.current);
757
+ }
758
+ }
759
+ #isPresent = derived(() => {
760
+ return ["mounted", "unmountSuspended"].includes(this.machine.state.current);
761
+ });
762
+ get isPresent() {
763
+ return this.#isPresent();
764
+ }
765
+ set isPresent($$value) {
766
+ return this.#isPresent($$value);
767
+ }
768
+ }
769
+ function watchPresenceChange(state) {
770
+ watch(() => state.present.current, () => {
771
+ if (!state.opts.ref.current) return;
772
+ const hasPresentChanged = state.present.current !== state.previousPresent.current;
773
+ if (!hasPresentChanged) return;
774
+ const prevAnimationName = state.prevAnimationNameState;
775
+ const currAnimationName = getAnimationName(state.opts.ref.current);
776
+ if (state.present.current) {
777
+ state.machine.dispatch("MOUNT");
778
+ } else if (currAnimationName === "none" || state.styles.display === "none") {
779
+ state.machine.dispatch("UNMOUNT");
780
+ } else {
781
+ const isAnimating = prevAnimationName !== currAnimationName;
782
+ if (state.previousPresent.current && isAnimating) {
783
+ state.machine.dispatch("ANIMATION_OUT");
784
+ } else {
785
+ state.machine.dispatch("UNMOUNT");
786
+ }
787
+ }
788
+ });
789
+ }
790
+ function watchStatusChange(state) {
791
+ watch(() => state.machine.state.current, () => {
792
+ if (!state.opts.ref.current) return;
793
+ const currAnimationName = getAnimationName(state.opts.ref.current);
794
+ state.prevAnimationNameState = state.machine.state.current === "mounted" ? currAnimationName : "none";
795
+ });
796
+ }
797
+ function watchRefChange(state) {
798
+ watch(() => state.opts.ref.current, () => {
799
+ if (!state.opts.ref.current) return;
800
+ state.styles = getComputedStyle(state.opts.ref.current);
801
+ return executeCallbacks(on(state.opts.ref.current, "animationstart", state.handleAnimationStart), on(state.opts.ref.current, "animationcancel", state.handleAnimationEnd), on(state.opts.ref.current, "animationend", state.handleAnimationEnd));
802
+ });
803
+ }
804
+ function getAnimationName(node) {
805
+ return node ? getComputedStyle(node).animationName || "none" : "none";
806
+ }
807
+ function Presence_layer($$renderer, $$props) {
808
+ $$renderer.component(($$renderer2) => {
809
+ let { open, forceMount, presence, ref } = $$props;
810
+ const presenceState = new Presence({ open: boxWith(() => open), ref });
811
+ if (forceMount || open || presenceState.isPresent) {
812
+ $$renderer2.push("<!--[-->");
813
+ presence?.($$renderer2, { present: presenceState.isPresent });
814
+ $$renderer2.push(`<!---->`);
815
+ } else {
816
+ $$renderer2.push("<!--[!-->");
817
+ }
818
+ $$renderer2.push(`<!--]-->`);
819
+ });
820
+ }
821
+ function clamp(n, min, max) {
822
+ return Math.min(max, Math.max(min, n));
823
+ }
824
+ const scrollAreaAttrs = createBitsAttrs({
825
+ component: "scroll-area",
826
+ parts: ["root", "viewport", "corner", "thumb", "scrollbar"]
827
+ });
828
+ const ScrollAreaRootContext = new Context("ScrollArea.Root");
829
+ const ScrollAreaScrollbarContext = new Context("ScrollArea.Scrollbar");
830
+ const ScrollAreaScrollbarVisibleContext = new Context("ScrollArea.ScrollbarVisible");
831
+ const ScrollAreaScrollbarAxisContext = new Context("ScrollArea.ScrollbarAxis");
832
+ const ScrollAreaScrollbarSharedContext = new Context("ScrollArea.ScrollbarShared");
833
+ class ScrollAreaRootState {
834
+ static create(opts) {
835
+ return ScrollAreaRootContext.set(new ScrollAreaRootState(opts));
836
+ }
837
+ opts;
838
+ attachment;
839
+ scrollAreaNode = null;
840
+ viewportNode = null;
841
+ contentNode = null;
842
+ scrollbarXNode = null;
843
+ scrollbarYNode = null;
844
+ cornerWidth = 0;
845
+ cornerHeight = 0;
846
+ scrollbarXEnabled = false;
847
+ scrollbarYEnabled = false;
848
+ domContext;
849
+ constructor(opts) {
850
+ this.opts = opts;
851
+ this.attachment = attachRef(opts.ref, (v) => this.scrollAreaNode = v);
852
+ this.domContext = new DOMContext(opts.ref);
853
+ }
854
+ #props = derived(() => ({
855
+ id: this.opts.id.current,
856
+ dir: this.opts.dir.current,
857
+ style: {
858
+ position: "relative",
859
+ "--bits-scroll-area-corner-height": `${this.cornerHeight}px`,
860
+ "--bits-scroll-area-corner-width": `${this.cornerWidth}px`
861
+ },
862
+ [scrollAreaAttrs.root]: "",
863
+ ...this.attachment
864
+ }));
865
+ get props() {
866
+ return this.#props();
867
+ }
868
+ set props($$value) {
869
+ return this.#props($$value);
870
+ }
871
+ }
872
+ class ScrollAreaViewportState {
873
+ static create(opts) {
874
+ return new ScrollAreaViewportState(opts, ScrollAreaRootContext.get());
875
+ }
876
+ opts;
877
+ root;
878
+ attachment;
879
+ #contentId = simpleBox(useId());
880
+ #contentRef = simpleBox(null);
881
+ contentAttachment = attachRef(this.#contentRef, (v) => this.root.contentNode = v);
882
+ constructor(opts, root) {
883
+ this.opts = opts;
884
+ this.root = root;
885
+ this.attachment = attachRef(opts.ref, (v) => this.root.viewportNode = v);
886
+ }
887
+ #props = derived(() => ({
888
+ id: this.opts.id.current,
889
+ style: {
890
+ overflowX: this.root.scrollbarXEnabled ? "scroll" : "hidden",
891
+ overflowY: this.root.scrollbarYEnabled ? "scroll" : "hidden"
892
+ },
893
+ [scrollAreaAttrs.viewport]: "",
894
+ ...this.attachment
895
+ }));
896
+ get props() {
897
+ return this.#props();
898
+ }
899
+ set props($$value) {
900
+ return this.#props($$value);
901
+ }
902
+ #contentProps = derived(() => ({
903
+ id: this.#contentId.current,
904
+ "data-scroll-area-content": "",
905
+ style: {
906
+ minWidth: this.root.scrollbarXEnabled ? "fit-content" : void 0
907
+ },
908
+ ...this.contentAttachment
909
+ }));
910
+ get contentProps() {
911
+ return this.#contentProps();
912
+ }
913
+ set contentProps($$value) {
914
+ return this.#contentProps($$value);
915
+ }
916
+ }
917
+ class ScrollAreaScrollbarState {
918
+ static create(opts) {
919
+ return ScrollAreaScrollbarContext.set(new ScrollAreaScrollbarState(opts, ScrollAreaRootContext.get()));
920
+ }
921
+ opts;
922
+ root;
923
+ #isHorizontal = derived(() => this.opts.orientation.current === "horizontal");
924
+ get isHorizontal() {
925
+ return this.#isHorizontal();
926
+ }
927
+ set isHorizontal($$value) {
928
+ return this.#isHorizontal($$value);
929
+ }
930
+ hasThumb = false;
931
+ constructor(opts, root) {
932
+ this.opts = opts;
933
+ this.root = root;
934
+ watch(() => this.isHorizontal, (isHorizontal) => {
935
+ if (isHorizontal) {
936
+ this.root.scrollbarXEnabled = true;
937
+ return () => {
938
+ this.root.scrollbarXEnabled = false;
939
+ };
940
+ } else {
941
+ this.root.scrollbarYEnabled = true;
942
+ return () => {
943
+ this.root.scrollbarYEnabled = false;
944
+ };
945
+ }
946
+ });
947
+ }
948
+ }
949
+ class ScrollAreaScrollbarHoverState {
950
+ static create() {
951
+ return new ScrollAreaScrollbarHoverState(ScrollAreaScrollbarContext.get());
952
+ }
953
+ scrollbar;
954
+ root;
955
+ isVisible = false;
956
+ constructor(scrollbar) {
957
+ this.scrollbar = scrollbar;
958
+ this.root = scrollbar.root;
959
+ }
960
+ #props = derived(() => ({ "data-state": this.isVisible ? "visible" : "hidden" }));
961
+ get props() {
962
+ return this.#props();
963
+ }
964
+ set props($$value) {
965
+ return this.#props($$value);
966
+ }
967
+ }
968
+ class ScrollAreaScrollbarScrollState {
969
+ static create() {
970
+ return new ScrollAreaScrollbarScrollState(ScrollAreaScrollbarContext.get());
971
+ }
972
+ scrollbar;
973
+ root;
974
+ machine = new StateMachine("hidden", {
975
+ hidden: { SCROLL: "scrolling" },
976
+ scrolling: { SCROLL_END: "idle", POINTER_ENTER: "interacting" },
977
+ interacting: { SCROLL: "interacting", POINTER_LEAVE: "idle" },
978
+ idle: {
979
+ HIDE: "hidden",
980
+ SCROLL: "scrolling",
981
+ POINTER_ENTER: "interacting"
982
+ }
983
+ });
984
+ #isHidden = derived(() => this.machine.state.current === "hidden");
985
+ get isHidden() {
986
+ return this.#isHidden();
987
+ }
988
+ set isHidden($$value) {
989
+ return this.#isHidden($$value);
990
+ }
991
+ constructor(scrollbar) {
992
+ this.scrollbar = scrollbar;
993
+ this.root = scrollbar.root;
994
+ useDebounce(() => this.machine.dispatch("SCROLL_END"), 100);
995
+ this.onpointerenter = this.onpointerenter.bind(this);
996
+ this.onpointerleave = this.onpointerleave.bind(this);
997
+ }
998
+ onpointerenter(_) {
999
+ this.machine.dispatch("POINTER_ENTER");
1000
+ }
1001
+ onpointerleave(_) {
1002
+ this.machine.dispatch("POINTER_LEAVE");
1003
+ }
1004
+ #props = derived(() => ({
1005
+ "data-state": this.machine.state.current === "hidden" ? "hidden" : "visible",
1006
+ onpointerenter: this.onpointerenter,
1007
+ onpointerleave: this.onpointerleave
1008
+ }));
1009
+ get props() {
1010
+ return this.#props();
1011
+ }
1012
+ set props($$value) {
1013
+ return this.#props($$value);
1014
+ }
1015
+ }
1016
+ class ScrollAreaScrollbarAutoState {
1017
+ static create() {
1018
+ return new ScrollAreaScrollbarAutoState(ScrollAreaScrollbarContext.get());
1019
+ }
1020
+ scrollbar;
1021
+ root;
1022
+ isVisible = false;
1023
+ constructor(scrollbar) {
1024
+ this.scrollbar = scrollbar;
1025
+ this.root = scrollbar.root;
1026
+ const handleResize = useDebounce(
1027
+ () => {
1028
+ const viewportNode = this.root.viewportNode;
1029
+ if (!viewportNode) return;
1030
+ const isOverflowX = viewportNode.offsetWidth < viewportNode.scrollWidth;
1031
+ const isOverflowY = viewportNode.offsetHeight < viewportNode.scrollHeight;
1032
+ this.isVisible = this.scrollbar.isHorizontal ? isOverflowX : isOverflowY;
1033
+ },
1034
+ 10
1035
+ );
1036
+ new SvelteResizeObserver(() => this.root.viewportNode, handleResize);
1037
+ new SvelteResizeObserver(() => this.root.contentNode, handleResize);
1038
+ }
1039
+ #props = derived(() => ({ "data-state": this.isVisible ? "visible" : "hidden" }));
1040
+ get props() {
1041
+ return this.#props();
1042
+ }
1043
+ set props($$value) {
1044
+ return this.#props($$value);
1045
+ }
1046
+ }
1047
+ class ScrollAreaScrollbarVisibleState {
1048
+ static create() {
1049
+ return ScrollAreaScrollbarVisibleContext.set(new ScrollAreaScrollbarVisibleState(ScrollAreaScrollbarContext.get()));
1050
+ }
1051
+ scrollbar;
1052
+ root;
1053
+ thumbNode = null;
1054
+ pointerOffset = 0;
1055
+ sizes = {
1056
+ content: 0,
1057
+ viewport: 0,
1058
+ scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
1059
+ };
1060
+ #thumbRatio = derived(() => getThumbRatio(this.sizes.viewport, this.sizes.content));
1061
+ get thumbRatio() {
1062
+ return this.#thumbRatio();
1063
+ }
1064
+ set thumbRatio($$value) {
1065
+ return this.#thumbRatio($$value);
1066
+ }
1067
+ #hasThumb = derived(() => Boolean(this.thumbRatio > 0 && this.thumbRatio < 1));
1068
+ get hasThumb() {
1069
+ return this.#hasThumb();
1070
+ }
1071
+ set hasThumb($$value) {
1072
+ return this.#hasThumb($$value);
1073
+ }
1074
+ prevTransformStyle = "";
1075
+ constructor(scrollbar) {
1076
+ this.scrollbar = scrollbar;
1077
+ this.root = scrollbar.root;
1078
+ }
1079
+ setSizes(sizes) {
1080
+ this.sizes = sizes;
1081
+ }
1082
+ getScrollPosition(pointerPos, dir) {
1083
+ return getScrollPositionFromPointer({
1084
+ pointerPos,
1085
+ pointerOffset: this.pointerOffset,
1086
+ sizes: this.sizes,
1087
+ dir
1088
+ });
1089
+ }
1090
+ onThumbPointerUp() {
1091
+ this.pointerOffset = 0;
1092
+ }
1093
+ onThumbPointerDown(pointerPos) {
1094
+ this.pointerOffset = pointerPos;
1095
+ }
1096
+ xOnThumbPositionChange() {
1097
+ if (!(this.root.viewportNode && this.thumbNode)) return;
1098
+ const scrollPos = this.root.viewportNode.scrollLeft;
1099
+ const offset = getThumbOffsetFromScroll({
1100
+ scrollPos,
1101
+ sizes: this.sizes,
1102
+ dir: this.root.opts.dir.current
1103
+ });
1104
+ const transformStyle = `translate3d(${offset}px, 0, 0)`;
1105
+ this.thumbNode.style.transform = transformStyle;
1106
+ this.prevTransformStyle = transformStyle;
1107
+ }
1108
+ xOnWheelScroll(scrollPos) {
1109
+ if (!this.root.viewportNode) return;
1110
+ this.root.viewportNode.scrollLeft = scrollPos;
1111
+ }
1112
+ xOnDragScroll(pointerPos) {
1113
+ if (!this.root.viewportNode) return;
1114
+ this.root.viewportNode.scrollLeft = this.getScrollPosition(pointerPos, this.root.opts.dir.current);
1115
+ }
1116
+ yOnThumbPositionChange() {
1117
+ if (!(this.root.viewportNode && this.thumbNode)) return;
1118
+ const scrollPos = this.root.viewportNode.scrollTop;
1119
+ const offset = getThumbOffsetFromScroll({ scrollPos, sizes: this.sizes });
1120
+ const transformStyle = `translate3d(0, ${offset}px, 0)`;
1121
+ this.thumbNode.style.transform = transformStyle;
1122
+ this.prevTransformStyle = transformStyle;
1123
+ }
1124
+ yOnWheelScroll(scrollPos) {
1125
+ if (!this.root.viewportNode) return;
1126
+ this.root.viewportNode.scrollTop = scrollPos;
1127
+ }
1128
+ yOnDragScroll(pointerPos) {
1129
+ if (!this.root.viewportNode) return;
1130
+ this.root.viewportNode.scrollTop = this.getScrollPosition(pointerPos, this.root.opts.dir.current);
1131
+ }
1132
+ }
1133
+ class ScrollAreaScrollbarXState {
1134
+ static create(opts) {
1135
+ return ScrollAreaScrollbarAxisContext.set(new ScrollAreaScrollbarXState(opts, ScrollAreaScrollbarVisibleContext.get()));
1136
+ }
1137
+ opts;
1138
+ scrollbarVis;
1139
+ root;
1140
+ scrollbar;
1141
+ attachment;
1142
+ computedStyle;
1143
+ constructor(opts, scrollbarVis) {
1144
+ this.opts = opts;
1145
+ this.scrollbarVis = scrollbarVis;
1146
+ this.root = scrollbarVis.root;
1147
+ this.scrollbar = scrollbarVis.scrollbar;
1148
+ this.attachment = attachRef(this.scrollbar.opts.ref, (v) => this.root.scrollbarXNode = v);
1149
+ }
1150
+ onThumbPointerDown = (pointerPos) => {
1151
+ this.scrollbarVis.onThumbPointerDown(pointerPos.x);
1152
+ };
1153
+ onDragScroll = (pointerPos) => {
1154
+ this.scrollbarVis.xOnDragScroll(pointerPos.x);
1155
+ };
1156
+ onThumbPointerUp = () => {
1157
+ this.scrollbarVis.onThumbPointerUp();
1158
+ };
1159
+ onThumbPositionChange = () => {
1160
+ this.scrollbarVis.xOnThumbPositionChange();
1161
+ };
1162
+ onWheelScroll = (e, maxScrollPos) => {
1163
+ if (!this.root.viewportNode) return;
1164
+ const scrollPos = this.root.viewportNode.scrollLeft + e.deltaX;
1165
+ this.scrollbarVis.xOnWheelScroll(scrollPos);
1166
+ if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
1167
+ e.preventDefault();
1168
+ }
1169
+ };
1170
+ onResize = () => {
1171
+ if (!(this.scrollbar.opts.ref.current && this.root.viewportNode && this.computedStyle)) return;
1172
+ this.scrollbarVis.setSizes({
1173
+ content: this.root.viewportNode.scrollWidth,
1174
+ viewport: this.root.viewportNode.offsetWidth,
1175
+ scrollbar: {
1176
+ size: this.scrollbar.opts.ref.current.clientWidth,
1177
+ paddingStart: toInt(this.computedStyle.paddingLeft),
1178
+ paddingEnd: toInt(this.computedStyle.paddingRight)
1179
+ }
1180
+ });
1181
+ };
1182
+ #thumbSize = derived(() => {
1183
+ return getThumbSize(this.scrollbarVis.sizes);
1184
+ });
1185
+ get thumbSize() {
1186
+ return this.#thumbSize();
1187
+ }
1188
+ set thumbSize($$value) {
1189
+ return this.#thumbSize($$value);
1190
+ }
1191
+ #props = derived(() => ({
1192
+ id: this.scrollbar.opts.id.current,
1193
+ "data-orientation": "horizontal",
1194
+ style: {
1195
+ bottom: 0,
1196
+ left: this.root.opts.dir.current === "rtl" ? "var(--bits-scroll-area-corner-width)" : 0,
1197
+ right: this.root.opts.dir.current === "ltr" ? "var(--bits-scroll-area-corner-width)" : 0,
1198
+ "--bits-scroll-area-thumb-width": `${this.thumbSize}px`
1199
+ },
1200
+ ...this.attachment
1201
+ }));
1202
+ get props() {
1203
+ return this.#props();
1204
+ }
1205
+ set props($$value) {
1206
+ return this.#props($$value);
1207
+ }
1208
+ }
1209
+ class ScrollAreaScrollbarYState {
1210
+ static create(opts) {
1211
+ return ScrollAreaScrollbarAxisContext.set(new ScrollAreaScrollbarYState(opts, ScrollAreaScrollbarVisibleContext.get()));
1212
+ }
1213
+ opts;
1214
+ scrollbarVis;
1215
+ root;
1216
+ scrollbar;
1217
+ attachment;
1218
+ computedStyle;
1219
+ constructor(opts, scrollbarVis) {
1220
+ this.opts = opts;
1221
+ this.scrollbarVis = scrollbarVis;
1222
+ this.root = scrollbarVis.root;
1223
+ this.scrollbar = scrollbarVis.scrollbar;
1224
+ this.attachment = attachRef(this.scrollbar.opts.ref, (v) => this.root.scrollbarYNode = v);
1225
+ this.onThumbPointerDown = this.onThumbPointerDown.bind(this);
1226
+ this.onDragScroll = this.onDragScroll.bind(this);
1227
+ this.onThumbPointerUp = this.onThumbPointerUp.bind(this);
1228
+ this.onThumbPositionChange = this.onThumbPositionChange.bind(this);
1229
+ this.onWheelScroll = this.onWheelScroll.bind(this);
1230
+ this.onResize = this.onResize.bind(this);
1231
+ }
1232
+ onThumbPointerDown(pointerPos) {
1233
+ this.scrollbarVis.onThumbPointerDown(pointerPos.y);
1234
+ }
1235
+ onDragScroll(pointerPos) {
1236
+ this.scrollbarVis.yOnDragScroll(pointerPos.y);
1237
+ }
1238
+ onThumbPointerUp() {
1239
+ this.scrollbarVis.onThumbPointerUp();
1240
+ }
1241
+ onThumbPositionChange() {
1242
+ this.scrollbarVis.yOnThumbPositionChange();
1243
+ }
1244
+ onWheelScroll(e, maxScrollPos) {
1245
+ if (!this.root.viewportNode) return;
1246
+ const scrollPos = this.root.viewportNode.scrollTop + e.deltaY;
1247
+ this.scrollbarVis.yOnWheelScroll(scrollPos);
1248
+ if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
1249
+ e.preventDefault();
1250
+ }
1251
+ }
1252
+ onResize() {
1253
+ if (!(this.scrollbar.opts.ref.current && this.root.viewportNode && this.computedStyle)) return;
1254
+ this.scrollbarVis.setSizes({
1255
+ content: this.root.viewportNode.scrollHeight,
1256
+ viewport: this.root.viewportNode.offsetHeight,
1257
+ scrollbar: {
1258
+ size: this.scrollbar.opts.ref.current.clientHeight,
1259
+ paddingStart: toInt(this.computedStyle.paddingTop),
1260
+ paddingEnd: toInt(this.computedStyle.paddingBottom)
1261
+ }
1262
+ });
1263
+ }
1264
+ #thumbSize = derived(() => {
1265
+ return getThumbSize(this.scrollbarVis.sizes);
1266
+ });
1267
+ get thumbSize() {
1268
+ return this.#thumbSize();
1269
+ }
1270
+ set thumbSize($$value) {
1271
+ return this.#thumbSize($$value);
1272
+ }
1273
+ #props = derived(() => ({
1274
+ id: this.scrollbar.opts.id.current,
1275
+ "data-orientation": "vertical",
1276
+ style: {
1277
+ top: 0,
1278
+ right: this.root.opts.dir.current === "ltr" ? 0 : void 0,
1279
+ left: this.root.opts.dir.current === "rtl" ? 0 : void 0,
1280
+ bottom: "var(--bits-scroll-area-corner-height)",
1281
+ "--bits-scroll-area-thumb-height": `${this.thumbSize}px`
1282
+ },
1283
+ ...this.attachment
1284
+ }));
1285
+ get props() {
1286
+ return this.#props();
1287
+ }
1288
+ set props($$value) {
1289
+ return this.#props($$value);
1290
+ }
1291
+ }
1292
+ class ScrollAreaScrollbarSharedState {
1293
+ static create() {
1294
+ return ScrollAreaScrollbarSharedContext.set(new ScrollAreaScrollbarSharedState(ScrollAreaScrollbarAxisContext.get()));
1295
+ }
1296
+ scrollbarState;
1297
+ root;
1298
+ scrollbarVis;
1299
+ scrollbar;
1300
+ rect = null;
1301
+ prevWebkitUserSelect = "";
1302
+ handleResize;
1303
+ handleThumbPositionChange;
1304
+ handleWheelScroll;
1305
+ handleThumbPointerDown;
1306
+ handleThumbPointerUp;
1307
+ #maxScrollPos = derived(() => this.scrollbarVis.sizes.content - this.scrollbarVis.sizes.viewport);
1308
+ get maxScrollPos() {
1309
+ return this.#maxScrollPos();
1310
+ }
1311
+ set maxScrollPos($$value) {
1312
+ return this.#maxScrollPos($$value);
1313
+ }
1314
+ constructor(scrollbarState) {
1315
+ this.scrollbarState = scrollbarState;
1316
+ this.root = scrollbarState.root;
1317
+ this.scrollbarVis = scrollbarState.scrollbarVis;
1318
+ this.scrollbar = scrollbarState.scrollbarVis.scrollbar;
1319
+ this.handleResize = useDebounce(() => this.scrollbarState.onResize(), 10);
1320
+ this.handleThumbPositionChange = this.scrollbarState.onThumbPositionChange;
1321
+ this.handleWheelScroll = this.scrollbarState.onWheelScroll;
1322
+ this.handleThumbPointerDown = this.scrollbarState.onThumbPointerDown;
1323
+ this.handleThumbPointerUp = this.scrollbarState.onThumbPointerUp;
1324
+ new SvelteResizeObserver(() => this.scrollbar.opts.ref.current, this.handleResize);
1325
+ new SvelteResizeObserver(() => this.root.contentNode, this.handleResize);
1326
+ this.onpointerdown = this.onpointerdown.bind(this);
1327
+ this.onpointermove = this.onpointermove.bind(this);
1328
+ this.onpointerup = this.onpointerup.bind(this);
1329
+ }
1330
+ handleDragScroll(e) {
1331
+ if (!this.rect) return;
1332
+ const x = e.clientX - this.rect.left;
1333
+ const y = e.clientY - this.rect.top;
1334
+ this.scrollbarState.onDragScroll({ x, y });
1335
+ }
1336
+ onpointerdown(e) {
1337
+ if (e.button !== 0) return;
1338
+ const target = e.target;
1339
+ target.setPointerCapture(e.pointerId);
1340
+ this.rect = this.scrollbar.opts.ref.current?.getBoundingClientRect() ?? null;
1341
+ this.prevWebkitUserSelect = this.root.domContext.getDocument().body.style.webkitUserSelect;
1342
+ this.root.domContext.getDocument().body.style.webkitUserSelect = "none";
1343
+ if (this.root.viewportNode) this.root.viewportNode.style.scrollBehavior = "auto";
1344
+ this.handleDragScroll(e);
1345
+ }
1346
+ onpointermove(e) {
1347
+ this.handleDragScroll(e);
1348
+ }
1349
+ onpointerup(e) {
1350
+ const target = e.target;
1351
+ if (target.hasPointerCapture(e.pointerId)) {
1352
+ target.releasePointerCapture(e.pointerId);
1353
+ }
1354
+ this.root.domContext.getDocument().body.style.webkitUserSelect = this.prevWebkitUserSelect;
1355
+ if (this.root.viewportNode) this.root.viewportNode.style.scrollBehavior = "";
1356
+ this.rect = null;
1357
+ }
1358
+ #props = derived(() => mergeProps({
1359
+ ...this.scrollbarState.props,
1360
+ style: { position: "absolute", ...this.scrollbarState.props.style },
1361
+ [scrollAreaAttrs.scrollbar]: "",
1362
+ onpointerdown: this.onpointerdown,
1363
+ onpointermove: this.onpointermove,
1364
+ onpointerup: this.onpointerup
1365
+ }));
1366
+ get props() {
1367
+ return this.#props();
1368
+ }
1369
+ set props($$value) {
1370
+ return this.#props($$value);
1371
+ }
1372
+ }
1373
+ class ScrollAreaThumbImplState {
1374
+ static create(opts) {
1375
+ return new ScrollAreaThumbImplState(opts, ScrollAreaScrollbarSharedContext.get());
1376
+ }
1377
+ opts;
1378
+ scrollbarState;
1379
+ attachment;
1380
+ #root;
1381
+ #removeUnlinkedScrollListener;
1382
+ #debounceScrollEnd = useDebounce(
1383
+ () => {
1384
+ if (this.#removeUnlinkedScrollListener) {
1385
+ this.#removeUnlinkedScrollListener();
1386
+ this.#removeUnlinkedScrollListener = void 0;
1387
+ }
1388
+ },
1389
+ 100
1390
+ );
1391
+ constructor(opts, scrollbarState) {
1392
+ this.opts = opts;
1393
+ this.scrollbarState = scrollbarState;
1394
+ this.#root = scrollbarState.root;
1395
+ this.attachment = attachRef(this.opts.ref, (v) => this.scrollbarState.scrollbarVis.thumbNode = v);
1396
+ this.onpointerdowncapture = this.onpointerdowncapture.bind(this);
1397
+ this.onpointerup = this.onpointerup.bind(this);
1398
+ }
1399
+ onpointerdowncapture(e) {
1400
+ const thumb = e.target;
1401
+ if (!thumb) return;
1402
+ const thumbRect = thumb.getBoundingClientRect();
1403
+ const x = e.clientX - thumbRect.left;
1404
+ const y = e.clientY - thumbRect.top;
1405
+ this.scrollbarState.handleThumbPointerDown({ x, y });
1406
+ }
1407
+ onpointerup(_) {
1408
+ this.scrollbarState.handleThumbPointerUp();
1409
+ }
1410
+ #props = derived(() => ({
1411
+ id: this.opts.id.current,
1412
+ "data-state": this.scrollbarState.scrollbarVis.hasThumb ? "visible" : "hidden",
1413
+ style: {
1414
+ width: "var(--bits-scroll-area-thumb-width)",
1415
+ height: "var(--bits-scroll-area-thumb-height)",
1416
+ transform: this.scrollbarState.scrollbarVis.prevTransformStyle
1417
+ },
1418
+ onpointerdowncapture: this.onpointerdowncapture,
1419
+ onpointerup: this.onpointerup,
1420
+ [scrollAreaAttrs.thumb]: "",
1421
+ ...this.attachment
1422
+ }));
1423
+ get props() {
1424
+ return this.#props();
1425
+ }
1426
+ set props($$value) {
1427
+ return this.#props($$value);
1428
+ }
1429
+ }
1430
+ class ScrollAreaCornerImplState {
1431
+ static create(opts) {
1432
+ return new ScrollAreaCornerImplState(opts, ScrollAreaRootContext.get());
1433
+ }
1434
+ opts;
1435
+ root;
1436
+ attachment;
1437
+ #width = 0;
1438
+ #height = 0;
1439
+ #hasSize = derived(() => Boolean(this.#width && this.#height));
1440
+ get hasSize() {
1441
+ return this.#hasSize();
1442
+ }
1443
+ set hasSize($$value) {
1444
+ return this.#hasSize($$value);
1445
+ }
1446
+ constructor(opts, root) {
1447
+ this.opts = opts;
1448
+ this.root = root;
1449
+ this.attachment = attachRef(this.opts.ref);
1450
+ new SvelteResizeObserver(() => this.root.scrollbarXNode, () => {
1451
+ const height = this.root.scrollbarXNode?.offsetHeight || 0;
1452
+ this.root.cornerHeight = height;
1453
+ this.#height = height;
1454
+ });
1455
+ new SvelteResizeObserver(() => this.root.scrollbarYNode, () => {
1456
+ const width = this.root.scrollbarYNode?.offsetWidth || 0;
1457
+ this.root.cornerWidth = width;
1458
+ this.#width = width;
1459
+ });
1460
+ }
1461
+ #props = derived(() => ({
1462
+ id: this.opts.id.current,
1463
+ style: {
1464
+ width: this.#width,
1465
+ height: this.#height,
1466
+ position: "absolute",
1467
+ right: this.root.opts.dir.current === "ltr" ? 0 : void 0,
1468
+ left: this.root.opts.dir.current === "rtl" ? 0 : void 0,
1469
+ bottom: 0
1470
+ },
1471
+ [scrollAreaAttrs.corner]: "",
1472
+ ...this.attachment
1473
+ }));
1474
+ get props() {
1475
+ return this.#props();
1476
+ }
1477
+ set props($$value) {
1478
+ return this.#props($$value);
1479
+ }
1480
+ }
1481
+ function toInt(value) {
1482
+ return value ? Number.parseInt(value, 10) : 0;
1483
+ }
1484
+ function getThumbRatio(viewportSize, contentSize) {
1485
+ const ratio = viewportSize / contentSize;
1486
+ return Number.isNaN(ratio) ? 0 : ratio;
1487
+ }
1488
+ function getThumbSize(sizes) {
1489
+ const ratio = getThumbRatio(sizes.viewport, sizes.content);
1490
+ const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
1491
+ const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
1492
+ return Math.max(thumbSize, 18);
1493
+ }
1494
+ function getScrollPositionFromPointer({ pointerPos, pointerOffset, sizes, dir = "ltr" }) {
1495
+ const thumbSizePx = getThumbSize(sizes);
1496
+ const thumbCenter = thumbSizePx / 2;
1497
+ const offset = pointerOffset || thumbCenter;
1498
+ const thumbOffsetFromEnd = thumbSizePx - offset;
1499
+ const minPointerPos = sizes.scrollbar.paddingStart + offset;
1500
+ const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
1501
+ const maxScrollPos = sizes.content - sizes.viewport;
1502
+ const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
1503
+ const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);
1504
+ return interpolate(pointerPos);
1505
+ }
1506
+ function getThumbOffsetFromScroll({ scrollPos, sizes, dir = "ltr" }) {
1507
+ const thumbSizePx = getThumbSize(sizes);
1508
+ const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
1509
+ const scrollbar = sizes.scrollbar.size - scrollbarPadding;
1510
+ const maxScrollPos = sizes.content - sizes.viewport;
1511
+ const maxThumbPos = scrollbar - thumbSizePx;
1512
+ const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
1513
+ const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange[0], scrollClampRange[1]);
1514
+ const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);
1515
+ return interpolate(scrollWithoutMomentum);
1516
+ }
1517
+ function linearScale(input, output) {
1518
+ return (value) => {
1519
+ if (input[0] === input[1] || output[0] === output[1]) return output[0];
1520
+ const ratio = (output[1] - output[0]) / (input[1] - input[0]);
1521
+ return output[0] + ratio * (value - input[0]);
1522
+ };
1523
+ }
1524
+ function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
1525
+ return scrollPos > 0 && scrollPos < maxScrollPos;
1526
+ }
1527
+ function Scroll_area$1($$renderer, $$props) {
1528
+ $$renderer.component(($$renderer2) => {
1529
+ const uid = props_id($$renderer2);
1530
+ let {
1531
+ ref = null,
1532
+ id = createId(uid),
1533
+ type = "hover",
1534
+ dir = "ltr",
1535
+ scrollHideDelay = 600,
1536
+ children,
1537
+ child,
1538
+ $$slots,
1539
+ $$events,
1540
+ ...restProps
1541
+ } = $$props;
1542
+ const rootState = ScrollAreaRootState.create({
1543
+ type: boxWith(() => type),
1544
+ dir: boxWith(() => dir),
1545
+ scrollHideDelay: boxWith(() => scrollHideDelay),
1546
+ id: boxWith(() => id),
1547
+ ref: boxWith(() => ref, (v) => ref = v)
1548
+ });
1549
+ const mergedProps = mergeProps(restProps, rootState.props);
1550
+ if (child) {
1551
+ $$renderer2.push("<!--[-->");
1552
+ child($$renderer2, { props: mergedProps });
1553
+ $$renderer2.push(`<!---->`);
1554
+ } else {
1555
+ $$renderer2.push("<!--[!-->");
1556
+ $$renderer2.push(`<div${attributes({ ...mergedProps })}>`);
1557
+ children?.($$renderer2);
1558
+ $$renderer2.push(`<!----></div>`);
1559
+ }
1560
+ $$renderer2.push(`<!--]-->`);
1561
+ bind_props($$props, { ref });
1562
+ });
1563
+ }
1564
+ function Scroll_area_viewport($$renderer, $$props) {
1565
+ $$renderer.component(($$renderer2) => {
1566
+ const uid = props_id($$renderer2);
1567
+ let {
1568
+ ref = null,
1569
+ id = createId(uid),
1570
+ children,
1571
+ $$slots,
1572
+ $$events,
1573
+ ...restProps
1574
+ } = $$props;
1575
+ const viewportState = ScrollAreaViewportState.create({
1576
+ id: boxWith(() => id),
1577
+ ref: boxWith(() => ref, (v) => ref = v)
1578
+ });
1579
+ const mergedProps = mergeProps(restProps, viewportState.props);
1580
+ const mergedContentProps = mergeProps({}, viewportState.contentProps);
1581
+ $$renderer2.push(`<div${attributes({ ...mergedProps })}><div${attributes({ ...mergedContentProps })}>`);
1582
+ children?.($$renderer2);
1583
+ $$renderer2.push(`<!----></div></div>`);
1584
+ bind_props($$props, { ref });
1585
+ });
1586
+ }
1587
+ function Scroll_area_scrollbar_shared($$renderer, $$props) {
1588
+ $$renderer.component(($$renderer2) => {
1589
+ let { child, children, $$slots, $$events, ...restProps } = $$props;
1590
+ const scrollbarSharedState = ScrollAreaScrollbarSharedState.create();
1591
+ const mergedProps = mergeProps(restProps, scrollbarSharedState.props);
1592
+ if (child) {
1593
+ $$renderer2.push("<!--[-->");
1594
+ child($$renderer2, { props: mergedProps });
1595
+ $$renderer2.push(`<!---->`);
1596
+ } else {
1597
+ $$renderer2.push("<!--[!-->");
1598
+ $$renderer2.push(`<div${attributes({ ...mergedProps })}>`);
1599
+ children?.($$renderer2);
1600
+ $$renderer2.push(`<!----></div>`);
1601
+ }
1602
+ $$renderer2.push(`<!--]-->`);
1603
+ });
1604
+ }
1605
+ function Scroll_area_scrollbar_x($$renderer, $$props) {
1606
+ $$renderer.component(($$renderer2) => {
1607
+ let { $$slots, $$events, ...restProps } = $$props;
1608
+ const isMounted = new IsMounted();
1609
+ const scrollbarXState = ScrollAreaScrollbarXState.create({ mounted: boxWith(() => isMounted.current) });
1610
+ const mergedProps = mergeProps(restProps, scrollbarXState.props);
1611
+ Scroll_area_scrollbar_shared($$renderer2, spread_props([mergedProps]));
1612
+ });
1613
+ }
1614
+ function Scroll_area_scrollbar_y($$renderer, $$props) {
1615
+ $$renderer.component(($$renderer2) => {
1616
+ let { $$slots, $$events, ...restProps } = $$props;
1617
+ const isMounted = new IsMounted();
1618
+ const scrollbarYState = ScrollAreaScrollbarYState.create({ mounted: boxWith(() => isMounted.current) });
1619
+ const mergedProps = mergeProps(restProps, scrollbarYState.props);
1620
+ Scroll_area_scrollbar_shared($$renderer2, spread_props([mergedProps]));
1621
+ });
1622
+ }
1623
+ function Scroll_area_scrollbar_visible($$renderer, $$props) {
1624
+ $$renderer.component(($$renderer2) => {
1625
+ let { $$slots, $$events, ...restProps } = $$props;
1626
+ const scrollbarVisibleState = ScrollAreaScrollbarVisibleState.create();
1627
+ if (scrollbarVisibleState.scrollbar.opts.orientation.current === "horizontal") {
1628
+ $$renderer2.push("<!--[-->");
1629
+ Scroll_area_scrollbar_x($$renderer2, spread_props([restProps]));
1630
+ } else {
1631
+ $$renderer2.push("<!--[!-->");
1632
+ Scroll_area_scrollbar_y($$renderer2, spread_props([restProps]));
1633
+ }
1634
+ $$renderer2.push(`<!--]-->`);
1635
+ });
1636
+ }
1637
+ function Scroll_area_scrollbar_auto($$renderer, $$props) {
1638
+ $$renderer.component(($$renderer2) => {
1639
+ let { forceMount = false, $$slots, $$events, ...restProps } = $$props;
1640
+ const scrollbarAutoState = ScrollAreaScrollbarAutoState.create();
1641
+ const mergedProps = mergeProps(restProps, scrollbarAutoState.props);
1642
+ {
1643
+ let presence = function($$renderer3) {
1644
+ Scroll_area_scrollbar_visible($$renderer3, spread_props([mergedProps]));
1645
+ };
1646
+ Presence_layer($$renderer2, {
1647
+ open: forceMount || scrollbarAutoState.isVisible,
1648
+ ref: scrollbarAutoState.scrollbar.opts.ref,
1649
+ presence
1650
+ });
1651
+ }
1652
+ });
1653
+ }
1654
+ function Scroll_area_scrollbar_scroll($$renderer, $$props) {
1655
+ $$renderer.component(($$renderer2) => {
1656
+ let { forceMount = false, $$slots, $$events, ...restProps } = $$props;
1657
+ const scrollbarScrollState = ScrollAreaScrollbarScrollState.create();
1658
+ const mergedProps = mergeProps(restProps, scrollbarScrollState.props);
1659
+ {
1660
+ let presence = function($$renderer3) {
1661
+ Scroll_area_scrollbar_visible($$renderer3, spread_props([mergedProps]));
1662
+ };
1663
+ Presence_layer($$renderer2, spread_props([
1664
+ mergedProps,
1665
+ {
1666
+ open: forceMount || !scrollbarScrollState.isHidden,
1667
+ ref: scrollbarScrollState.scrollbar.opts.ref,
1668
+ presence,
1669
+ $$slots: { presence: true }
1670
+ }
1671
+ ]));
1672
+ }
1673
+ });
1674
+ }
1675
+ function Scroll_area_scrollbar_hover($$renderer, $$props) {
1676
+ $$renderer.component(($$renderer2) => {
1677
+ let { forceMount = false, $$slots, $$events, ...restProps } = $$props;
1678
+ const scrollbarHoverState = ScrollAreaScrollbarHoverState.create();
1679
+ const scrollbarAutoState = ScrollAreaScrollbarAutoState.create();
1680
+ const mergedProps = mergeProps(restProps, scrollbarHoverState.props, scrollbarAutoState.props, {
1681
+ "data-state": scrollbarHoverState.isVisible ? "visible" : "hidden"
1682
+ });
1683
+ const open = forceMount || scrollbarHoverState.isVisible && scrollbarAutoState.isVisible;
1684
+ {
1685
+ let presence = function($$renderer3) {
1686
+ Scroll_area_scrollbar_visible($$renderer3, spread_props([mergedProps]));
1687
+ };
1688
+ Presence_layer($$renderer2, {
1689
+ open,
1690
+ ref: scrollbarAutoState.scrollbar.opts.ref,
1691
+ presence
1692
+ });
1693
+ }
1694
+ });
1695
+ }
1696
+ function Scroll_area_scrollbar$1($$renderer, $$props) {
1697
+ $$renderer.component(($$renderer2) => {
1698
+ const uid = props_id($$renderer2);
1699
+ let {
1700
+ ref = null,
1701
+ id = createId(uid),
1702
+ orientation,
1703
+ $$slots,
1704
+ $$events,
1705
+ ...restProps
1706
+ } = $$props;
1707
+ const scrollbarState = ScrollAreaScrollbarState.create({
1708
+ orientation: boxWith(() => orientation),
1709
+ id: boxWith(() => id),
1710
+ ref: boxWith(() => ref, (v) => ref = v)
1711
+ });
1712
+ const type = scrollbarState.root.opts.type.current;
1713
+ if (type === "hover") {
1714
+ $$renderer2.push("<!--[-->");
1715
+ Scroll_area_scrollbar_hover($$renderer2, spread_props([restProps, { id }]));
1716
+ } else {
1717
+ $$renderer2.push("<!--[!-->");
1718
+ if (type === "scroll") {
1719
+ $$renderer2.push("<!--[-->");
1720
+ Scroll_area_scrollbar_scroll($$renderer2, spread_props([restProps, { id }]));
1721
+ } else {
1722
+ $$renderer2.push("<!--[!-->");
1723
+ if (type === "auto") {
1724
+ $$renderer2.push("<!--[-->");
1725
+ Scroll_area_scrollbar_auto($$renderer2, spread_props([restProps, { id }]));
1726
+ } else {
1727
+ $$renderer2.push("<!--[!-->");
1728
+ if (type === "always") {
1729
+ $$renderer2.push("<!--[-->");
1730
+ Scroll_area_scrollbar_visible($$renderer2, spread_props([restProps, { id }]));
1731
+ } else {
1732
+ $$renderer2.push("<!--[!-->");
1733
+ }
1734
+ $$renderer2.push(`<!--]-->`);
1735
+ }
1736
+ $$renderer2.push(`<!--]-->`);
1737
+ }
1738
+ $$renderer2.push(`<!--]-->`);
1739
+ }
1740
+ $$renderer2.push(`<!--]-->`);
1741
+ bind_props($$props, { ref });
1742
+ });
1743
+ }
1744
+ function Scroll_area_thumb_impl($$renderer, $$props) {
1745
+ $$renderer.component(($$renderer2) => {
1746
+ let {
1747
+ ref = null,
1748
+ id,
1749
+ child,
1750
+ children,
1751
+ present,
1752
+ $$slots,
1753
+ $$events,
1754
+ ...restProps
1755
+ } = $$props;
1756
+ const isMounted = new IsMounted();
1757
+ const thumbState = ScrollAreaThumbImplState.create({
1758
+ id: boxWith(() => id),
1759
+ ref: boxWith(() => ref, (v) => ref = v),
1760
+ mounted: boxWith(() => isMounted.current)
1761
+ });
1762
+ const mergedProps = mergeProps(restProps, thumbState.props, { style: { hidden: !present } });
1763
+ if (child) {
1764
+ $$renderer2.push("<!--[-->");
1765
+ child($$renderer2, { props: mergedProps });
1766
+ $$renderer2.push(`<!---->`);
1767
+ } else {
1768
+ $$renderer2.push("<!--[!-->");
1769
+ $$renderer2.push(`<div${attributes({ ...mergedProps })}>`);
1770
+ children?.($$renderer2);
1771
+ $$renderer2.push(`<!----></div>`);
1772
+ }
1773
+ $$renderer2.push(`<!--]-->`);
1774
+ bind_props($$props, { ref });
1775
+ });
1776
+ }
1777
+ function Scroll_area_thumb($$renderer, $$props) {
5
1778
  $$renderer.component(($$renderer2) => {
6
- const sessionsByProject = () => {
1779
+ const uid = props_id($$renderer2);
1780
+ let {
1781
+ id = createId(uid),
1782
+ ref = null,
1783
+ forceMount = false,
1784
+ $$slots,
1785
+ $$events,
1786
+ ...restProps
1787
+ } = $$props;
1788
+ const scrollbarState = ScrollAreaScrollbarVisibleContext.get();
1789
+ let $$settled = true;
1790
+ let $$inner_renderer;
1791
+ function $$render_inner($$renderer3) {
1792
+ {
1793
+ let presence = function($$renderer4, { present }) {
1794
+ Scroll_area_thumb_impl($$renderer4, spread_props([
1795
+ restProps,
1796
+ {
1797
+ id,
1798
+ present,
1799
+ get ref() {
1800
+ return ref;
1801
+ },
1802
+ set ref($$value) {
1803
+ ref = $$value;
1804
+ $$settled = false;
1805
+ }
1806
+ }
1807
+ ]));
1808
+ };
1809
+ Presence_layer($$renderer3, {
1810
+ open: forceMount || scrollbarState.hasThumb,
1811
+ ref: scrollbarState.scrollbar.opts.ref,
1812
+ presence
1813
+ });
1814
+ }
1815
+ }
1816
+ do {
1817
+ $$settled = true;
1818
+ $$inner_renderer = $$renderer2.copy();
1819
+ $$render_inner($$inner_renderer);
1820
+ } while (!$$settled);
1821
+ $$renderer2.subsume($$inner_renderer);
1822
+ bind_props($$props, { ref });
1823
+ });
1824
+ }
1825
+ function Scroll_area_corner_impl($$renderer, $$props) {
1826
+ $$renderer.component(($$renderer2) => {
1827
+ let {
1828
+ ref = null,
1829
+ id,
1830
+ children,
1831
+ child,
1832
+ $$slots,
1833
+ $$events,
1834
+ ...restProps
1835
+ } = $$props;
1836
+ const cornerState = ScrollAreaCornerImplState.create({
1837
+ id: boxWith(() => id),
1838
+ ref: boxWith(() => ref, (v) => ref = v)
1839
+ });
1840
+ const mergedProps = mergeProps(restProps, cornerState.props);
1841
+ if (child) {
1842
+ $$renderer2.push("<!--[-->");
1843
+ child($$renderer2, { props: mergedProps });
1844
+ $$renderer2.push(`<!---->`);
1845
+ } else {
1846
+ $$renderer2.push("<!--[!-->");
1847
+ $$renderer2.push(`<div${attributes({ ...mergedProps })}>`);
1848
+ children?.($$renderer2);
1849
+ $$renderer2.push(`<!----></div>`);
1850
+ }
1851
+ $$renderer2.push(`<!--]-->`);
1852
+ bind_props($$props, { ref });
1853
+ });
1854
+ }
1855
+ function Scroll_area_corner($$renderer, $$props) {
1856
+ $$renderer.component(($$renderer2) => {
1857
+ const uid = props_id($$renderer2);
1858
+ let {
1859
+ ref = null,
1860
+ id = createId(uid),
1861
+ $$slots,
1862
+ $$events,
1863
+ ...restProps
1864
+ } = $$props;
1865
+ const scrollAreaState = ScrollAreaRootContext.get();
1866
+ const hasBothScrollbarsVisible = Boolean(scrollAreaState.scrollbarXNode && scrollAreaState.scrollbarYNode);
1867
+ const hasCorner = scrollAreaState.opts.type.current !== "scroll" && hasBothScrollbarsVisible;
1868
+ let $$settled = true;
1869
+ let $$inner_renderer;
1870
+ function $$render_inner($$renderer3) {
1871
+ if (hasCorner) {
1872
+ $$renderer3.push("<!--[-->");
1873
+ Scroll_area_corner_impl($$renderer3, spread_props([
1874
+ restProps,
1875
+ {
1876
+ id,
1877
+ get ref() {
1878
+ return ref;
1879
+ },
1880
+ set ref($$value) {
1881
+ ref = $$value;
1882
+ $$settled = false;
1883
+ }
1884
+ }
1885
+ ]));
1886
+ } else {
1887
+ $$renderer3.push("<!--[!-->");
1888
+ }
1889
+ $$renderer3.push(`<!--]-->`);
1890
+ }
1891
+ do {
1892
+ $$settled = true;
1893
+ $$inner_renderer = $$renderer2.copy();
1894
+ $$render_inner($$inner_renderer);
1895
+ } while (!$$settled);
1896
+ $$renderer2.subsume($$inner_renderer);
1897
+ bind_props($$props, { ref });
1898
+ });
1899
+ }
1900
+ const defaultAttributes = {
1901
+ xmlns: "http://www.w3.org/2000/svg",
1902
+ width: 24,
1903
+ height: 24,
1904
+ viewBox: "0 0 24 24",
1905
+ fill: "none",
1906
+ stroke: "currentColor",
1907
+ "stroke-width": 2,
1908
+ "stroke-linecap": "round",
1909
+ "stroke-linejoin": "round"
1910
+ };
1911
+ function Icon($$renderer, $$props) {
1912
+ $$renderer.component(($$renderer2) => {
1913
+ const {
1914
+ name,
1915
+ color = "currentColor",
1916
+ size = 24,
1917
+ strokeWidth = 2,
1918
+ absoluteStrokeWidth = false,
1919
+ iconNode = [],
1920
+ children,
1921
+ $$slots,
1922
+ $$events,
1923
+ ...props
1924
+ } = $$props;
1925
+ $$renderer2.push(`<svg${attributes(
1926
+ {
1927
+ ...defaultAttributes,
1928
+ ...props,
1929
+ width: size,
1930
+ height: size,
1931
+ stroke: color,
1932
+ "stroke-width": absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
1933
+ class: clsx(["lucide-icon lucide", name && `lucide-${name}`, props.class])
1934
+ },
1935
+ void 0,
1936
+ void 0,
1937
+ void 0,
1938
+ 3
1939
+ )}><!--[-->`);
1940
+ const each_array = ensure_array_like(iconNode);
1941
+ for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
1942
+ let [tag, attrs] = each_array[$$index];
1943
+ element($$renderer2, tag, () => {
1944
+ $$renderer2.push(`${attributes({ ...attrs }, void 0, void 0, void 0, 3)}`);
1945
+ });
1946
+ }
1947
+ $$renderer2.push(`<!--]-->`);
1948
+ children?.($$renderer2);
1949
+ $$renderer2.push(`<!----></svg>`);
1950
+ });
1951
+ }
1952
+ function Check($$renderer, $$props) {
1953
+ $$renderer.component(($$renderer2) => {
1954
+ let { $$slots, $$events, ...props } = $$props;
1955
+ const iconNode = [["path", { "d": "M20 6 9 17l-5-5" }]];
1956
+ Icon($$renderer2, spread_props([
1957
+ { name: "check" },
1958
+ /**
1959
+ * @component @name Check
1960
+ * @description Lucide SVG icon component, renders SVG Element with children.
1961
+ *
1962
+ * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgNiA5IDE3bC01LTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/check
1963
+ * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
1964
+ *
1965
+ * @param {Object} props - Lucide icons props and any valid SVG attribute
1966
+ * @returns {FunctionalComponent} Svelte component
1967
+ *
1968
+ */
1969
+ props,
1970
+ {
1971
+ iconNode,
1972
+ children: ($$renderer3) => {
1973
+ props.children?.($$renderer3);
1974
+ $$renderer3.push(`<!---->`);
1975
+ },
1976
+ $$slots: { default: true }
1977
+ }
1978
+ ]));
1979
+ });
1980
+ }
1981
+ function Minus($$renderer, $$props) {
1982
+ $$renderer.component(($$renderer2) => {
1983
+ let { $$slots, $$events, ...props } = $$props;
1984
+ const iconNode = [["path", { "d": "M5 12h14" }]];
1985
+ Icon($$renderer2, spread_props([
1986
+ { name: "minus" },
1987
+ /**
1988
+ * @component @name Minus
1989
+ * @description Lucide SVG icon component, renders SVG Element with children.
1990
+ *
1991
+ * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/minus
1992
+ * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
1993
+ *
1994
+ * @param {Object} props - Lucide icons props and any valid SVG attribute
1995
+ * @returns {FunctionalComponent} Svelte component
1996
+ *
1997
+ */
1998
+ props,
1999
+ {
2000
+ iconNode,
2001
+ children: ($$renderer3) => {
2002
+ props.children?.($$renderer3);
2003
+ $$renderer3.push(`<!---->`);
2004
+ },
2005
+ $$slots: { default: true }
2006
+ }
2007
+ ]));
2008
+ });
2009
+ }
2010
+ function Checkbox($$renderer, $$props) {
2011
+ $$renderer.component(($$renderer2) => {
2012
+ let {
2013
+ ref = null,
2014
+ checked = false,
2015
+ indeterminate = false,
2016
+ class: className,
2017
+ $$slots,
2018
+ $$events,
2019
+ ...restProps
2020
+ } = $$props;
2021
+ let $$settled = true;
2022
+ let $$inner_renderer;
2023
+ function $$render_inner($$renderer3) {
2024
+ $$renderer3.push(`<!---->`);
2025
+ {
2026
+ let children = function($$renderer4, { checked: checked2, indeterminate: indeterminate2 }) {
2027
+ $$renderer4.push(`<div data-slot="checkbox-indicator" class="text-current transition-none">`);
2028
+ if (checked2) {
2029
+ $$renderer4.push("<!--[-->");
2030
+ Check($$renderer4, { class: "size-3.5" });
2031
+ } else {
2032
+ $$renderer4.push("<!--[!-->");
2033
+ if (indeterminate2) {
2034
+ $$renderer4.push("<!--[-->");
2035
+ Minus($$renderer4, { class: "size-3.5" });
2036
+ } else {
2037
+ $$renderer4.push("<!--[!-->");
2038
+ }
2039
+ $$renderer4.push(`<!--]-->`);
2040
+ }
2041
+ $$renderer4.push(`<!--]--></div>`);
2042
+ };
2043
+ Checkbox$1?.($$renderer3, spread_props([
2044
+ {
2045
+ "data-slot": "checkbox",
2046
+ class: cn("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className)
2047
+ },
2048
+ restProps,
2049
+ {
2050
+ get ref() {
2051
+ return ref;
2052
+ },
2053
+ set ref($$value) {
2054
+ ref = $$value;
2055
+ $$settled = false;
2056
+ },
2057
+ get checked() {
2058
+ return checked;
2059
+ },
2060
+ set checked($$value) {
2061
+ checked = $$value;
2062
+ $$settled = false;
2063
+ },
2064
+ get indeterminate() {
2065
+ return indeterminate;
2066
+ },
2067
+ set indeterminate($$value) {
2068
+ indeterminate = $$value;
2069
+ $$settled = false;
2070
+ },
2071
+ children,
2072
+ $$slots: { default: true }
2073
+ }
2074
+ ]));
2075
+ }
2076
+ $$renderer3.push(`<!---->`);
2077
+ }
2078
+ do {
2079
+ $$settled = true;
2080
+ $$inner_renderer = $$renderer2.copy();
2081
+ $$render_inner($$inner_renderer);
2082
+ } while (!$$settled);
2083
+ $$renderer2.subsume($$inner_renderer);
2084
+ bind_props($$props, { ref, checked, indeterminate });
2085
+ });
2086
+ }
2087
+ function Dialog($$renderer, $$props) {
2088
+ $$renderer.component(($$renderer2) => {
2089
+ let { open = false, $$slots, $$events, ...restProps } = $$props;
2090
+ let $$settled = true;
2091
+ let $$inner_renderer;
2092
+ function $$render_inner($$renderer3) {
2093
+ $$renderer3.push(`<!---->`);
2094
+ Dialog$1?.($$renderer3, spread_props([
2095
+ restProps,
2096
+ {
2097
+ get open() {
2098
+ return open;
2099
+ },
2100
+ set open($$value) {
2101
+ open = $$value;
2102
+ $$settled = false;
2103
+ }
2104
+ }
2105
+ ]));
2106
+ $$renderer3.push(`<!---->`);
2107
+ }
2108
+ do {
2109
+ $$settled = true;
2110
+ $$inner_renderer = $$renderer2.copy();
2111
+ $$render_inner($$inner_renderer);
2112
+ } while (!$$settled);
2113
+ $$renderer2.subsume($$inner_renderer);
2114
+ bind_props($$props, { open });
2115
+ });
2116
+ }
2117
+ function Dialog_portal($$renderer, $$props) {
2118
+ let { $$slots, $$events, ...restProps } = $$props;
2119
+ $$renderer.push(`<!---->`);
2120
+ Portal?.($$renderer, spread_props([restProps]));
2121
+ $$renderer.push(`<!---->`);
2122
+ }
2123
+ function Dialog_title($$renderer, $$props) {
2124
+ $$renderer.component(($$renderer2) => {
2125
+ let {
2126
+ ref = null,
2127
+ class: className,
2128
+ $$slots,
2129
+ $$events,
2130
+ ...restProps
2131
+ } = $$props;
2132
+ let $$settled = true;
2133
+ let $$inner_renderer;
2134
+ function $$render_inner($$renderer3) {
2135
+ $$renderer3.push(`<!---->`);
2136
+ Dialog_title$1?.($$renderer3, spread_props([
2137
+ {
2138
+ "data-slot": "dialog-title",
2139
+ class: cn("text-lg leading-none font-semibold", className)
2140
+ },
2141
+ restProps,
2142
+ {
2143
+ get ref() {
2144
+ return ref;
2145
+ },
2146
+ set ref($$value) {
2147
+ ref = $$value;
2148
+ $$settled = false;
2149
+ }
2150
+ }
2151
+ ]));
2152
+ $$renderer3.push(`<!---->`);
2153
+ }
2154
+ do {
2155
+ $$settled = true;
2156
+ $$inner_renderer = $$renderer2.copy();
2157
+ $$render_inner($$inner_renderer);
2158
+ } while (!$$settled);
2159
+ $$renderer2.subsume($$inner_renderer);
2160
+ bind_props($$props, { ref });
2161
+ });
2162
+ }
2163
+ function Dialog_footer($$renderer, $$props) {
2164
+ $$renderer.component(($$renderer2) => {
2165
+ let {
2166
+ ref = null,
2167
+ class: className,
2168
+ children,
2169
+ $$slots,
2170
+ $$events,
2171
+ ...restProps
2172
+ } = $$props;
2173
+ $$renderer2.push(`<div${attributes({
2174
+ "data-slot": "dialog-footer",
2175
+ class: clsx(cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)),
2176
+ ...restProps
2177
+ })}>`);
2178
+ children?.($$renderer2);
2179
+ $$renderer2.push(`<!----></div>`);
2180
+ bind_props($$props, { ref });
2181
+ });
2182
+ }
2183
+ function Dialog_header($$renderer, $$props) {
2184
+ $$renderer.component(($$renderer2) => {
2185
+ let {
2186
+ ref = null,
2187
+ class: className,
2188
+ children,
2189
+ $$slots,
2190
+ $$events,
2191
+ ...restProps
2192
+ } = $$props;
2193
+ $$renderer2.push(`<div${attributes({
2194
+ "data-slot": "dialog-header",
2195
+ class: clsx(cn("flex flex-col gap-2 text-center sm:text-start", className)),
2196
+ ...restProps
2197
+ })}>`);
2198
+ children?.($$renderer2);
2199
+ $$renderer2.push(`<!----></div>`);
2200
+ bind_props($$props, { ref });
2201
+ });
2202
+ }
2203
+ function Dialog_overlay($$renderer, $$props) {
2204
+ $$renderer.component(($$renderer2) => {
2205
+ let {
2206
+ ref = null,
2207
+ class: className,
2208
+ $$slots,
2209
+ $$events,
2210
+ ...restProps
2211
+ } = $$props;
2212
+ let $$settled = true;
2213
+ let $$inner_renderer;
2214
+ function $$render_inner($$renderer3) {
2215
+ $$renderer3.push(`<!---->`);
2216
+ Dialog_overlay$1?.($$renderer3, spread_props([
2217
+ {
2218
+ "data-slot": "dialog-overlay",
2219
+ class: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className)
2220
+ },
2221
+ restProps,
2222
+ {
2223
+ get ref() {
2224
+ return ref;
2225
+ },
2226
+ set ref($$value) {
2227
+ ref = $$value;
2228
+ $$settled = false;
2229
+ }
2230
+ }
2231
+ ]));
2232
+ $$renderer3.push(`<!---->`);
2233
+ }
2234
+ do {
2235
+ $$settled = true;
2236
+ $$inner_renderer = $$renderer2.copy();
2237
+ $$render_inner($$inner_renderer);
2238
+ } while (!$$settled);
2239
+ $$renderer2.subsume($$inner_renderer);
2240
+ bind_props($$props, { ref });
2241
+ });
2242
+ }
2243
+ function X($$renderer, $$props) {
2244
+ $$renderer.component(($$renderer2) => {
2245
+ let { $$slots, $$events, ...props } = $$props;
2246
+ const iconNode = [
2247
+ ["path", { "d": "M18 6 6 18" }],
2248
+ ["path", { "d": "m6 6 12 12" }]
2249
+ ];
2250
+ Icon($$renderer2, spread_props([
2251
+ { name: "x" },
2252
+ /**
2253
+ * @component @name X
2254
+ * @description Lucide SVG icon component, renders SVG Element with children.
2255
+ *
2256
+ * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x
2257
+ * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
2258
+ *
2259
+ * @param {Object} props - Lucide icons props and any valid SVG attribute
2260
+ * @returns {FunctionalComponent} Svelte component
2261
+ *
2262
+ */
2263
+ props,
2264
+ {
2265
+ iconNode,
2266
+ children: ($$renderer3) => {
2267
+ props.children?.($$renderer3);
2268
+ $$renderer3.push(`<!---->`);
2269
+ },
2270
+ $$slots: { default: true }
2271
+ }
2272
+ ]));
2273
+ });
2274
+ }
2275
+ function Dialog_content($$renderer, $$props) {
2276
+ $$renderer.component(($$renderer2) => {
2277
+ let {
2278
+ ref = null,
2279
+ class: className,
2280
+ portalProps,
2281
+ children,
2282
+ showCloseButton = true,
2283
+ $$slots,
2284
+ $$events,
2285
+ ...restProps
2286
+ } = $$props;
2287
+ let $$settled = true;
2288
+ let $$inner_renderer;
2289
+ function $$render_inner($$renderer3) {
2290
+ Dialog_portal($$renderer3, spread_props([
2291
+ portalProps,
2292
+ {
2293
+ children: ($$renderer4) => {
2294
+ $$renderer4.push(`<!---->`);
2295
+ Dialog_overlay?.($$renderer4, {});
2296
+ $$renderer4.push(`<!----> <!---->`);
2297
+ Dialog_content$1?.($$renderer4, spread_props([
2298
+ {
2299
+ "data-slot": "dialog-content",
2300
+ class: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className)
2301
+ },
2302
+ restProps,
2303
+ {
2304
+ get ref() {
2305
+ return ref;
2306
+ },
2307
+ set ref($$value) {
2308
+ ref = $$value;
2309
+ $$settled = false;
2310
+ },
2311
+ children: ($$renderer5) => {
2312
+ children?.($$renderer5);
2313
+ $$renderer5.push(`<!----> `);
2314
+ if (showCloseButton) {
2315
+ $$renderer5.push("<!--[-->");
2316
+ $$renderer5.push(`<!---->`);
2317
+ Dialog_close?.($$renderer5, {
2318
+ class: "ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2319
+ children: ($$renderer6) => {
2320
+ X($$renderer6, {});
2321
+ $$renderer6.push(`<!----> <span class="sr-only">Close</span>`);
2322
+ },
2323
+ $$slots: { default: true }
2324
+ });
2325
+ $$renderer5.push(`<!---->`);
2326
+ } else {
2327
+ $$renderer5.push("<!--[!-->");
2328
+ }
2329
+ $$renderer5.push(`<!--]-->`);
2330
+ },
2331
+ $$slots: { default: true }
2332
+ }
2333
+ ]));
2334
+ $$renderer4.push(`<!---->`);
2335
+ },
2336
+ $$slots: { default: true }
2337
+ }
2338
+ ]));
2339
+ }
2340
+ do {
2341
+ $$settled = true;
2342
+ $$inner_renderer = $$renderer2.copy();
2343
+ $$render_inner($$inner_renderer);
2344
+ } while (!$$settled);
2345
+ $$renderer2.subsume($$inner_renderer);
2346
+ bind_props($$props, { ref });
2347
+ });
2348
+ }
2349
+ function Scroll_area_scrollbar($$renderer, $$props) {
2350
+ $$renderer.component(($$renderer2) => {
2351
+ let {
2352
+ ref = null,
2353
+ class: className,
2354
+ orientation = "vertical",
2355
+ children,
2356
+ $$slots,
2357
+ $$events,
2358
+ ...restProps
2359
+ } = $$props;
2360
+ let $$settled = true;
2361
+ let $$inner_renderer;
2362
+ function $$render_inner($$renderer3) {
2363
+ $$renderer3.push(`<!---->`);
2364
+ Scroll_area_scrollbar$1?.($$renderer3, spread_props([
2365
+ {
2366
+ "data-slot": "scroll-area-scrollbar",
2367
+ orientation,
2368
+ class: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" && "h-full w-2.5 border-s border-s-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className)
2369
+ },
2370
+ restProps,
2371
+ {
2372
+ get ref() {
2373
+ return ref;
2374
+ },
2375
+ set ref($$value) {
2376
+ ref = $$value;
2377
+ $$settled = false;
2378
+ },
2379
+ children: ($$renderer4) => {
2380
+ children?.($$renderer4);
2381
+ $$renderer4.push(`<!----> <!---->`);
2382
+ Scroll_area_thumb?.($$renderer4, {
2383
+ "data-slot": "scroll-area-thumb",
2384
+ class: "bg-border relative flex-1 rounded-full"
2385
+ });
2386
+ $$renderer4.push(`<!---->`);
2387
+ },
2388
+ $$slots: { default: true }
2389
+ }
2390
+ ]));
2391
+ $$renderer3.push(`<!---->`);
2392
+ }
2393
+ do {
2394
+ $$settled = true;
2395
+ $$inner_renderer = $$renderer2.copy();
2396
+ $$render_inner($$inner_renderer);
2397
+ } while (!$$settled);
2398
+ $$renderer2.subsume($$inner_renderer);
2399
+ bind_props($$props, { ref });
2400
+ });
2401
+ }
2402
+ function Scroll_area($$renderer, $$props) {
2403
+ $$renderer.component(($$renderer2) => {
2404
+ let {
2405
+ ref = null,
2406
+ viewportRef = null,
2407
+ class: className,
2408
+ orientation = "vertical",
2409
+ scrollbarXClasses = "",
2410
+ scrollbarYClasses = "",
2411
+ children,
2412
+ $$slots,
2413
+ $$events,
2414
+ ...restProps
2415
+ } = $$props;
2416
+ let $$settled = true;
2417
+ let $$inner_renderer;
2418
+ function $$render_inner($$renderer3) {
2419
+ $$renderer3.push(`<!---->`);
2420
+ Scroll_area$1?.($$renderer3, spread_props([
2421
+ { "data-slot": "scroll-area", class: cn("relative", className) },
2422
+ restProps,
2423
+ {
2424
+ get ref() {
2425
+ return ref;
2426
+ },
2427
+ set ref($$value) {
2428
+ ref = $$value;
2429
+ $$settled = false;
2430
+ },
2431
+ children: ($$renderer4) => {
2432
+ $$renderer4.push(`<!---->`);
2433
+ Scroll_area_viewport?.($$renderer4, {
2434
+ "data-slot": "scroll-area-viewport",
2435
+ class: "ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1",
2436
+ get ref() {
2437
+ return viewportRef;
2438
+ },
2439
+ set ref($$value) {
2440
+ viewportRef = $$value;
2441
+ $$settled = false;
2442
+ },
2443
+ children: ($$renderer5) => {
2444
+ children?.($$renderer5);
2445
+ $$renderer5.push(`<!---->`);
2446
+ },
2447
+ $$slots: { default: true }
2448
+ });
2449
+ $$renderer4.push(`<!----> `);
2450
+ if (orientation === "vertical" || orientation === "both") {
2451
+ $$renderer4.push("<!--[-->");
2452
+ Scroll_area_scrollbar($$renderer4, { orientation: "vertical", class: scrollbarYClasses });
2453
+ } else {
2454
+ $$renderer4.push("<!--[!-->");
2455
+ }
2456
+ $$renderer4.push(`<!--]--> `);
2457
+ if (orientation === "horizontal" || orientation === "both") {
2458
+ $$renderer4.push("<!--[-->");
2459
+ Scroll_area_scrollbar($$renderer4, { orientation: "horizontal", class: scrollbarXClasses });
2460
+ } else {
2461
+ $$renderer4.push("<!--[!-->");
2462
+ }
2463
+ $$renderer4.push(`<!--]--> <!---->`);
2464
+ Scroll_area_corner?.($$renderer4, {});
2465
+ $$renderer4.push(`<!---->`);
2466
+ },
2467
+ $$slots: { default: true }
2468
+ }
2469
+ ]));
2470
+ $$renderer3.push(`<!---->`);
2471
+ }
2472
+ do {
2473
+ $$settled = true;
2474
+ $$inner_renderer = $$renderer2.copy();
2475
+ $$render_inner($$inner_renderer);
2476
+ } while (!$$settled);
2477
+ $$renderer2.subsume($$inner_renderer);
2478
+ bind_props($$props, { ref, viewportRef });
2479
+ });
2480
+ }
2481
+ function AllSessionsPanel($$renderer, $$props) {
2482
+ $$renderer.component(($$renderer2) => {
2483
+ var $$store_subs;
2484
+ let { onSessionSelect, compact = false } = $$props;
2485
+ let tmuxPanes = [];
2486
+ let showFolderBrowser = false;
2487
+ let browserPath = "";
2488
+ let browserFolders = [];
2489
+ let browserShowHidden = false;
2490
+ let browserIsRoot = false;
2491
+ let browserParent = null;
2492
+ let browserError = "";
2493
+ let alertOpen = false;
2494
+ let alertTitle = "";
2495
+ let alertMessage = "";
2496
+ let alertOnConfirm = () => {
2497
+ };
2498
+ function showConfirm(title, message, onConfirm) {
2499
+ alertTitle = title;
2500
+ alertMessage = message;
2501
+ alertOnConfirm = onConfirm;
2502
+ alertOpen = true;
2503
+ }
2504
+ const sessionsByProject = (() => {
7
2505
  const groups = /* @__PURE__ */ new Map();
8
2506
  for (const session of sessionStore.sessions) {
9
2507
  const key = session.cwd || "unknown";
@@ -11,8 +2509,8 @@ function _page($$renderer, $$props) {
11
2509
  groups.get(key).push(session);
12
2510
  }
13
2511
  return groups;
14
- };
15
- const allProjects = () => {
2512
+ })();
2513
+ const allProjects = (() => {
16
2514
  const projects = /* @__PURE__ */ new Set();
17
2515
  for (const session of sessionStore.sessions) {
18
2516
  if (session.cwd) projects.add(session.cwd);
@@ -21,66 +2519,538 @@ function _page($$renderer, $$props) {
21
2519
  projects.add(cwd);
22
2520
  }
23
2521
  return [...projects].sort();
24
- };
25
- onDestroy(() => {
26
- sessionStore.disconnect();
27
- });
2522
+ })();
2523
+ function flattenTree(nodes) {
2524
+ const result = [];
2525
+ for (const node of nodes) {
2526
+ result.push(node);
2527
+ if (node.children.length > 0) {
2528
+ result.push(...flattenTree(node.children));
2529
+ }
2530
+ }
2531
+ return result;
2532
+ }
2533
+ const projectTree = (() => {
2534
+ const projects = allProjects;
2535
+ const sessionsMap = sessionsByProject;
2536
+ const sorted = [...projects].sort((a, b) => a.length - b.length);
2537
+ const roots = [];
2538
+ const nodeMap = /* @__PURE__ */ new Map();
2539
+ for (const cwd of sorted) {
2540
+ const node = {
2541
+ cwd,
2542
+ sessions: sessionsMap.get(cwd) || [],
2543
+ children: [],
2544
+ depth: 0
2545
+ };
2546
+ let parent = null;
2547
+ for (const potentialParent of sorted) {
2548
+ if (potentialParent === cwd) continue;
2549
+ if (cwd.startsWith(potentialParent + "/")) {
2550
+ const parentNode = nodeMap.get(potentialParent);
2551
+ if (parentNode && (!parent || potentialParent.length > parent.cwd.length)) {
2552
+ parent = parentNode;
2553
+ }
2554
+ }
2555
+ }
2556
+ if (parent) {
2557
+ node.depth = parent.depth + 1;
2558
+ parent.children.push(node);
2559
+ } else {
2560
+ roots.push(node);
2561
+ }
2562
+ nodeMap.set(cwd, node);
2563
+ }
2564
+ return roots;
2565
+ })();
2566
+ const flatProjects = (() => flattenTree(projectTree))();
2567
+ const otherTmuxPanes = (() => {
2568
+ const claudeTargets = new Set(sessionStore.sessions.map((s) => s.tmux_target));
2569
+ return tmuxPanes.filter((p) => !claudeTargets.has(p.target));
2570
+ })();
2571
+ const currentTarget = store_get($$store_subs ??= {}, "$page", page).url.pathname.startsWith("/session/") ? decodeURIComponent(store_get($$store_subs ??= {}, "$page", page).url.pathname.split("/session/")[1]) : null;
2572
+ async function fetchTmuxPanes() {
2573
+ try {
2574
+ const res = await fetch("/api/tmux/panes");
2575
+ tmuxPanes = await res.json();
2576
+ } catch {
2577
+ tmuxPanes = [];
2578
+ }
2579
+ }
2580
+ function killSession(id, pid, tmux_target) {
2581
+ showConfirm("Kill Session", "Are you sure you want to kill this session?", async () => {
2582
+ await fetch(`/api/sessions/${encodeURIComponent(id)}/kill`, {
2583
+ method: "POST",
2584
+ headers: { "Content-Type": "application/json" },
2585
+ body: JSON.stringify({ pid, tmux_target })
2586
+ });
2587
+ });
2588
+ }
2589
+ function deleteProject(cwd) {
2590
+ showConfirm("Delete Project", `Delete project "${cwd}" and all its sessions?`, async () => {
2591
+ const sessions = sessionsByProject.get(cwd) || [];
2592
+ for (const s of sessions) {
2593
+ await fetch(`/api/sessions/${encodeURIComponent(s.id)}/kill`, {
2594
+ method: "POST",
2595
+ headers: { "Content-Type": "application/json" },
2596
+ body: JSON.stringify({ pid: s.pid, tmux_target: s.tmux_target })
2597
+ });
2598
+ }
2599
+ sessionStore.removeProject(cwd);
2600
+ });
2601
+ }
2602
+ async function newSessionInProject(cwd) {
2603
+ const res = await fetch("/api/projects/new-session", {
2604
+ method: "POST",
2605
+ headers: { "Content-Type": "application/json" },
2606
+ body: JSON.stringify({ cwd })
2607
+ });
2608
+ const data = await res.json();
2609
+ sessionStore.saveProject(cwd);
2610
+ if (data.ok && data.session) {
2611
+ data.session + ":1.1";
2612
+ goto();
2613
+ onSessionSelect?.();
2614
+ }
2615
+ }
2616
+ async function openFolderBrowser() {
2617
+ showFolderBrowser = true;
2618
+ await browseTo("~");
2619
+ }
2620
+ async function browseTo(path) {
2621
+ browserError = "";
2622
+ const res = await fetch(`/api/browse?path=${encodeURIComponent(path)}&showHidden=${browserShowHidden}`);
2623
+ const data = await res.json();
2624
+ if (data.error) {
2625
+ browserError = data.error;
2626
+ return;
2627
+ }
2628
+ browserPath = data.current;
2629
+ browserFolders = data.folders;
2630
+ browserIsRoot = data.isRoot;
2631
+ browserParent = data.parent;
2632
+ }
2633
+ async function selectFolder() {
2634
+ showFolderBrowser = false;
2635
+ await newSessionInProject(browserPath);
2636
+ }
28
2637
  function getProjectName(cwd) {
29
2638
  return cwd.split("/").pop() || cwd;
30
2639
  }
31
- head("1uha8ag", $$renderer2, ($$renderer3) => {
32
- $$renderer3.title(($$renderer4) => {
33
- $$renderer4.push(`<title>claude-watch</title>`);
2640
+ async function closeChrome() {
2641
+ await fetch("/api/chrome", { method: "DELETE" });
2642
+ }
2643
+ let $$settled = true;
2644
+ let $$inner_renderer;
2645
+ function $$render_inner($$renderer3) {
2646
+ $$renderer3.push(`<div${attr_class("all-sessions-panel svelte-183q6rw", void 0, { "compact": compact })}><header class="header svelte-183q6rw"><a href="/" class="title-link svelte-183q6rw"><h1 class="svelte-183q6rw">claude-mux</h1></a> <div class="header-actions svelte-183q6rw">`);
2647
+ if (!compact) {
2648
+ $$renderer3.push("<!--[-->");
2649
+ Button($$renderer3, {
2650
+ variant: "secondary",
2651
+ size: "icon",
2652
+ onclick: closeChrome,
2653
+ title: "Close Chrome/Brave debugging instances",
2654
+ children: ($$renderer4) => {
2655
+ $$renderer4.push(`<iconify-icon icon="mdi:google-chrome"></iconify-icon>`);
2656
+ },
2657
+ $$slots: { default: true }
2658
+ });
2659
+ } else {
2660
+ $$renderer3.push("<!--[!-->");
2661
+ }
2662
+ $$renderer3.push(`<!--]--> `);
2663
+ Button($$renderer3, {
2664
+ variant: sessionStore.paused ? "destructive" : "secondary",
2665
+ size: "icon",
2666
+ onclick: () => sessionStore.togglePause(),
2667
+ title: sessionStore.paused ? "Resume" : "Pause",
2668
+ children: ($$renderer4) => {
2669
+ $$renderer4.push(`<iconify-icon${attr("icon", sessionStore.paused ? "mdi:play" : "mdi:pause")}></iconify-icon>`);
2670
+ },
2671
+ $$slots: { default: true }
34
2672
  });
35
- });
36
- $$renderer2.push(`<div class="container svelte-1uha8ag"><header class="header svelte-1uha8ag"><h1 class="svelte-1uha8ag">claude-watch</h1> <div class="header-actions svelte-1uha8ag"><button${attr_class("btn svelte-1uha8ag", void 0, { "paused": sessionStore.paused })}${attr("title", sessionStore.paused ? "Resume" : "Pause")}><iconify-icon${attr("icon", sessionStore.paused ? "mdi:play" : "mdi:pause")}></iconify-icon></button> <button class="btn svelte-1uha8ag" title="New Project"><iconify-icon icon="mdi:plus"></iconify-icon></button></div></header> <p class="count svelte-1uha8ag">${escape_html(sessionStore.sessions.length)} session${escape_html(sessionStore.sessions.length !== 1 ? "s" : "")}</p> `);
37
- if (allProjects().length === 0) {
38
- $$renderer2.push("<!--[-->");
39
- $$renderer2.push(`<div class="empty svelte-1uha8ag">No sessions yet. Click + to add a project.</div>`);
40
- } else {
41
- $$renderer2.push("<!--[!-->");
42
- $$renderer2.push(`<!--[-->`);
43
- const each_array = ensure_array_like(allProjects());
44
- for (let $$index_1 = 0, $$length = each_array.length; $$index_1 < $$length; $$index_1++) {
45
- let cwd = each_array[$$index_1];
46
- const sessions = sessionsByProject().get(cwd) || [];
47
- const color = getProjectColor(cwd);
48
- $$renderer2.push(`<div class="project-group svelte-1uha8ag"><div class="project-header svelte-1uha8ag"${attr_style(`background: ${stringify(color)}20; color: ${stringify(color)}`)}><span class="dot svelte-1uha8ag"${attr_style(`background: ${stringify(color)}`)}></span> <span class="name svelte-1uha8ag">${escape_html(getProjectName(cwd))}</span> <span class="count-badge svelte-1uha8ag">${escape_html(sessions.length)}</span> <div class="spacer svelte-1uha8ag"></div> <button title="New Session" class="svelte-1uha8ag"><iconify-icon icon="mdi:plus"></iconify-icon></button> <button class="delete svelte-1uha8ag" title="Delete Project"><iconify-icon icon="mdi:delete"></iconify-icon></button></div> <div class="project-sessions svelte-1uha8ag">`);
49
- const each_array_1 = ensure_array_like(sessions);
50
- if (each_array_1.length !== 0) {
51
- $$renderer2.push("<!--[-->");
52
- for (let $$index = 0, $$length2 = each_array_1.length; $$index < $$length2; $$index++) {
53
- let session = each_array_1[$$index];
54
- $$renderer2.push(`<a${attr("href", `/session/${stringify(encodeURIComponent(session.tmux_target || session.id))}`)}${attr_class(`session ${stringify(session.state)}`, "svelte-1uha8ag")}><span class="state svelte-1uha8ag"${attr_style(`background: ${stringify(stateColor(session.state))}`)}></span> <div class="session-info svelte-1uha8ag"><div class="target svelte-1uha8ag">${escape_html(session.pane_title || session.tmux_target || session.id)}</div> `);
55
- if (session.current_action) {
56
- $$renderer2.push("<!--[-->");
57
- $$renderer2.push(`<div class="action svelte-1uha8ag">${escape_html(session.current_action)}</div>`);
2673
+ $$renderer3.push(`<!----> `);
2674
+ Button($$renderer3, {
2675
+ variant: "secondary",
2676
+ size: "icon",
2677
+ onclick: openFolderBrowser,
2678
+ title: "New Project",
2679
+ children: ($$renderer4) => {
2680
+ $$renderer4.push(`<iconify-icon icon="mdi:plus"></iconify-icon>`);
2681
+ },
2682
+ $$slots: { default: true }
2683
+ });
2684
+ $$renderer3.push(`<!----></div></header> <p class="count svelte-183q6rw">${escape_html(sessionStore.sessions.length)} session${escape_html(sessionStore.sessions.length !== 1 ? "s" : "")}</p> <div class="scroll-content svelte-183q6rw">`);
2685
+ if (flatProjects.length === 0) {
2686
+ $$renderer3.push("<!--[-->");
2687
+ $$renderer3.push(`<div class="empty svelte-183q6rw">No sessions yet. Click + to add a project.</div>`);
2688
+ } else {
2689
+ $$renderer3.push("<!--[!-->");
2690
+ $$renderer3.push(`<!--[-->`);
2691
+ const each_array = ensure_array_like(flatProjects);
2692
+ for (let $$index_1 = 0, $$length = each_array.length; $$index_1 < $$length; $$index_1++) {
2693
+ let project = each_array[$$index_1];
2694
+ const color = getProjectColor(project.cwd);
2695
+ const isNested = project.depth > 0;
2696
+ const firstSession = project.sessions[0];
2697
+ $$renderer3.push(`<div${attr_class("project-group svelte-183q6rw", void 0, { "nested": isNested })}${attr_style(`margin-left: ${stringify(project.depth * (compact ? 16 : 24))}px; border-left-color: ${stringify(color)}`)}><div class="project-header svelte-183q6rw"><div class="project-info svelte-183q6rw">`);
2698
+ if (isNested) {
2699
+ $$renderer3.push("<!--[-->");
2700
+ $$renderer3.push(`<span class="nest-indicator svelte-183q6rw">└</span>`);
2701
+ } else {
2702
+ $$renderer3.push("<!--[!-->");
2703
+ }
2704
+ $$renderer3.push(`<!--]--> <span class="name svelte-183q6rw">${escape_html(getProjectName(project.cwd))}</span> <div class="meta svelte-183q6rw">`);
2705
+ Badge($$renderer3, {
2706
+ variant: "secondary",
2707
+ class: "text-xs",
2708
+ children: ($$renderer4) => {
2709
+ $$renderer4.push(`<!---->${escape_html(project.sessions.length)}`);
2710
+ },
2711
+ $$slots: { default: true }
2712
+ });
2713
+ $$renderer3.push(`<!----> `);
2714
+ if (!compact) {
2715
+ $$renderer3.push("<!--[-->");
2716
+ if (firstSession?.git_root) {
2717
+ $$renderer3.push("<!--[-->");
2718
+ Badge($$renderer3, {
2719
+ variant: "outline",
2720
+ class: "border-orange-700 text-orange-400",
2721
+ children: ($$renderer4) => {
2722
+ $$renderer4.push(`<!---->git`);
2723
+ },
2724
+ $$slots: { default: true }
2725
+ });
58
2726
  } else {
59
- $$renderer2.push("<!--[!-->");
2727
+ $$renderer3.push("<!--[!-->");
60
2728
  }
61
- $$renderer2.push(`<!--]--></div> <div class="actions svelte-1uha8ag">`);
62
- if (session.tmux_target) {
63
- $$renderer2.push("<!--[-->");
64
- $$renderer2.push(`<button title="Stop (Esc)" class="svelte-1uha8ag"><iconify-icon icon="mdi:stop"></iconify-icon></button>`);
2729
+ $$renderer3.push(`<!--]--> `);
2730
+ if (firstSession?.beads_enabled) {
2731
+ $$renderer3.push("<!--[-->");
2732
+ Badge($$renderer3, {
2733
+ variant: "outline",
2734
+ class: "border-purple-700 text-purple-400",
2735
+ children: ($$renderer4) => {
2736
+ $$renderer4.push(`<!---->beads`);
2737
+ },
2738
+ $$slots: { default: true }
2739
+ });
65
2740
  } else {
66
- $$renderer2.push("<!--[!-->");
2741
+ $$renderer3.push("<!--[!-->");
67
2742
  }
68
- $$renderer2.push(`<!--]--> <button class="danger svelte-1uha8ag" title="Kill"><iconify-icon icon="mdi:power"></iconify-icon></button></div></a>`);
2743
+ $$renderer3.push(`<!--]-->`);
2744
+ } else {
2745
+ $$renderer3.push("<!--[!-->");
69
2746
  }
70
- } else {
71
- $$renderer2.push("<!--[!-->");
72
- $$renderer2.push(`<div class="empty-project svelte-1uha8ag">No active sessions</div>`);
2747
+ $$renderer3.push(`<!--]--></div></div> <div class="project-actions svelte-183q6rw">`);
2748
+ Button($$renderer3, {
2749
+ variant: "ghost",
2750
+ size: "icon-sm",
2751
+ onclick: () => newSessionInProject(project.cwd),
2752
+ title: "New Session",
2753
+ children: ($$renderer4) => {
2754
+ $$renderer4.push(`<iconify-icon icon="mdi:plus"></iconify-icon>`);
2755
+ },
2756
+ $$slots: { default: true }
2757
+ });
2758
+ $$renderer3.push(`<!----> `);
2759
+ if (!compact) {
2760
+ $$renderer3.push("<!--[-->");
2761
+ Button($$renderer3, {
2762
+ variant: "ghost",
2763
+ size: "icon-sm",
2764
+ class: "hover:bg-red-900/50 hover:text-red-300",
2765
+ onclick: () => deleteProject(project.cwd),
2766
+ title: "Delete Project",
2767
+ children: ($$renderer4) => {
2768
+ $$renderer4.push(`<iconify-icon icon="mdi:delete"></iconify-icon>`);
2769
+ },
2770
+ $$slots: { default: true }
2771
+ });
2772
+ } else {
2773
+ $$renderer3.push("<!--[!-->");
2774
+ }
2775
+ $$renderer3.push(`<!--]--></div></div> <div class="project-sessions svelte-183q6rw">`);
2776
+ const each_array_1 = ensure_array_like(project.sessions);
2777
+ if (each_array_1.length !== 0) {
2778
+ $$renderer3.push("<!--[-->");
2779
+ for (let $$index = 0, $$length2 = each_array_1.length; $$index < $$length2; $$index++) {
2780
+ let session = each_array_1[$$index];
2781
+ if (session.tmux_target) {
2782
+ $$renderer3.push("<!--[-->");
2783
+ const isActive = session.tmux_target === currentTarget;
2784
+ $$renderer3.push(`<a${attr("href", `/session/${stringify(encodeURIComponent(session.tmux_target))}`)}${attr_class(`session ${stringify(session.state)}`, "svelte-183q6rw", { "active": isActive })}><span class="state svelte-183q6rw"${attr_style(`background: ${stringify(stateColor(session.state))}`)}></span> <div class="session-info svelte-183q6rw"><div class="target svelte-183q6rw">${escape_html(session.pane_title || session.tmux_target)}</div> <div class="action svelte-183q6rw">${escape_html(session.current_action || session.state)}</div></div> `);
2785
+ if (!compact) {
2786
+ $$renderer3.push("<!--[-->");
2787
+ $$renderer3.push(`<div class="actions svelte-183q6rw">`);
2788
+ Button($$renderer3, {
2789
+ variant: "ghost-destructive",
2790
+ size: "icon-sm",
2791
+ onclick: (e) => {
2792
+ e.preventDefault();
2793
+ e.stopPropagation();
2794
+ killSession(session.id, session.pid, session.tmux_target);
2795
+ },
2796
+ title: "Kill",
2797
+ children: ($$renderer4) => {
2798
+ $$renderer4.push(`<iconify-icon icon="mdi:power"></iconify-icon>`);
2799
+ },
2800
+ $$slots: { default: true }
2801
+ });
2802
+ $$renderer3.push(`<!----></div>`);
2803
+ } else {
2804
+ $$renderer3.push("<!--[!-->");
2805
+ }
2806
+ $$renderer3.push(`<!--]--></a>`);
2807
+ } else {
2808
+ $$renderer3.push("<!--[!-->");
2809
+ $$renderer3.push(`<div${attr_class(`session ${stringify(session.state)} no-tmux`, "svelte-183q6rw")}><span class="state svelte-183q6rw"${attr_style(`background: ${stringify(stateColor(session.state))}`)}></span> <div class="session-info svelte-183q6rw"><div class="target svelte-183q6rw">${escape_html(session.id)}</div> <div class="action svelte-183q6rw">${escape_html(session.current_action || session.state)}</div> <div class="no-tmux-label svelte-183q6rw">No tmux pane</div></div> `);
2810
+ if (!compact) {
2811
+ $$renderer3.push("<!--[-->");
2812
+ $$renderer3.push(`<div class="actions svelte-183q6rw">`);
2813
+ Button($$renderer3, {
2814
+ variant: "ghost-destructive",
2815
+ size: "icon-sm",
2816
+ onclick: () => killSession(session.id, session.pid, session.tmux_target),
2817
+ title: "Kill",
2818
+ children: ($$renderer4) => {
2819
+ $$renderer4.push(`<iconify-icon icon="mdi:power"></iconify-icon>`);
2820
+ },
2821
+ $$slots: { default: true }
2822
+ });
2823
+ $$renderer3.push(`<!----></div>`);
2824
+ } else {
2825
+ $$renderer3.push("<!--[!-->");
2826
+ }
2827
+ $$renderer3.push(`<!--]--></div>`);
2828
+ }
2829
+ $$renderer3.push(`<!--]-->`);
2830
+ }
2831
+ } else {
2832
+ $$renderer3.push("<!--[!-->");
2833
+ $$renderer3.push(`<div class="empty-project svelte-183q6rw">No active sessions</div>`);
2834
+ }
2835
+ $$renderer3.push(`<!--]--></div></div>`);
73
2836
  }
74
- $$renderer2.push(`<!--]--></div></div>`);
2837
+ $$renderer3.push(`<!--]-->`);
75
2838
  }
76
- $$renderer2.push(`<!--]-->`);
77
- }
78
- $$renderer2.push(`<!--]--></div> `);
79
- {
80
- $$renderer2.push("<!--[!-->");
2839
+ $$renderer3.push(`<!--]--> `);
2840
+ if (otherTmuxPanes.length > 0) {
2841
+ $$renderer3.push("<!--[-->");
2842
+ $$renderer3.push(`<div class="other-tmux svelte-183q6rw"><div class="other-tmux-header svelte-183q6rw"><h2 class="svelte-183q6rw">Other tmux</h2> `);
2843
+ Button($$renderer3, {
2844
+ variant: "ghost",
2845
+ size: "icon-sm",
2846
+ onclick: fetchTmuxPanes,
2847
+ title: "Refresh",
2848
+ children: ($$renderer4) => {
2849
+ $$renderer4.push(`<iconify-icon icon="mdi:refresh"></iconify-icon>`);
2850
+ },
2851
+ $$slots: { default: true }
2852
+ });
2853
+ $$renderer3.push(`<!----></div> <div class="other-tmux-list svelte-183q6rw"><!--[-->`);
2854
+ const each_array_2 = ensure_array_like(otherTmuxPanes);
2855
+ for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
2856
+ let pane = each_array_2[$$index_2];
2857
+ $$renderer3.push(`<a${attr("href", `/session/${stringify(encodeURIComponent(pane.target))}`)} class="tmux-pane svelte-183q6rw"><iconify-icon icon="mdi:console" class="pane-icon svelte-183q6rw"></iconify-icon> <div class="pane-info svelte-183q6rw"><span class="pane-target svelte-183q6rw">${escape_html(pane.target)}</span> `);
2858
+ if (!compact) {
2859
+ $$renderer3.push("<!--[-->");
2860
+ $$renderer3.push(`<span class="pane-command svelte-183q6rw">${escape_html(pane.command)}</span>`);
2861
+ } else {
2862
+ $$renderer3.push("<!--[!-->");
2863
+ }
2864
+ $$renderer3.push(`<!--]--></div></a>`);
2865
+ }
2866
+ $$renderer3.push(`<!--]--></div></div>`);
2867
+ } else {
2868
+ $$renderer3.push("<!--[!-->");
2869
+ }
2870
+ $$renderer3.push(`<!--]--></div></div> <!---->`);
2871
+ Dialog?.($$renderer3, {
2872
+ get open() {
2873
+ return showFolderBrowser;
2874
+ },
2875
+ set open($$value) {
2876
+ showFolderBrowser = $$value;
2877
+ $$settled = false;
2878
+ },
2879
+ children: ($$renderer4) => {
2880
+ $$renderer4.push(`<!---->`);
2881
+ Dialog_content?.($$renderer4, {
2882
+ class: "max-w-md",
2883
+ children: ($$renderer5) => {
2884
+ $$renderer5.push(`<!---->`);
2885
+ Dialog_header?.($$renderer5, {
2886
+ children: ($$renderer6) => {
2887
+ $$renderer6.push(`<!---->`);
2888
+ Dialog_title?.($$renderer6, {
2889
+ children: ($$renderer7) => {
2890
+ $$renderer7.push(`<!---->Select Folder`);
2891
+ },
2892
+ $$slots: { default: true }
2893
+ });
2894
+ $$renderer6.push(`<!---->`);
2895
+ },
2896
+ $$slots: { default: true }
2897
+ });
2898
+ $$renderer5.push(`<!----> <div class="fb-path svelte-183q6rw">${escape_html(browserPath)}</div> `);
2899
+ if (browserError) {
2900
+ $$renderer5.push("<!--[-->");
2901
+ $$renderer5.push(`<p class="text-sm text-destructive">${escape_html(browserError)}</p>`);
2902
+ } else {
2903
+ $$renderer5.push("<!--[!-->");
2904
+ }
2905
+ $$renderer5.push(`<!--]--> <div class="flex items-center gap-2 py-2">`);
2906
+ Checkbox($$renderer5, {
2907
+ id: "show-hidden",
2908
+ checked: browserShowHidden,
2909
+ onCheckedChange: (v) => {
2910
+ browserShowHidden = !!v;
2911
+ browseTo(browserPath);
2912
+ }
2913
+ });
2914
+ $$renderer5.push(`<!----> <label for="show-hidden" class="text-sm text-muted-foreground cursor-pointer">Show hidden</label></div> `);
2915
+ Scroll_area($$renderer5, {
2916
+ class: "h-64 rounded-md border",
2917
+ children: ($$renderer6) => {
2918
+ $$renderer6.push(`<div class="p-2">`);
2919
+ if (!browserIsRoot && browserParent) {
2920
+ $$renderer6.push("<!--[-->");
2921
+ $$renderer6.push(`<button class="fb-item svelte-183q6rw"><iconify-icon icon="mdi:folder-arrow-up"></iconify-icon> ..</button>`);
2922
+ } else {
2923
+ $$renderer6.push("<!--[!-->");
2924
+ }
2925
+ $$renderer6.push(`<!--]--> <!--[-->`);
2926
+ const each_array_3 = ensure_array_like(browserFolders);
2927
+ for (let $$index_3 = 0, $$length = each_array_3.length; $$index_3 < $$length; $$index_3++) {
2928
+ let folder = each_array_3[$$index_3];
2929
+ $$renderer6.push(`<button class="fb-item svelte-183q6rw"><iconify-icon icon="mdi:folder"></iconify-icon> ${escape_html(folder.name)}</button>`);
2930
+ }
2931
+ $$renderer6.push(`<!--]--></div>`);
2932
+ },
2933
+ $$slots: { default: true }
2934
+ });
2935
+ $$renderer5.push(`<!----> <!---->`);
2936
+ Dialog_footer?.($$renderer5, {
2937
+ children: ($$renderer6) => {
2938
+ Button($$renderer6, {
2939
+ variant: "outline",
2940
+ onclick: () => showFolderBrowser = false,
2941
+ children: ($$renderer7) => {
2942
+ $$renderer7.push(`<!---->Cancel`);
2943
+ },
2944
+ $$slots: { default: true }
2945
+ });
2946
+ $$renderer6.push(`<!----> `);
2947
+ Button($$renderer6, {
2948
+ onclick: selectFolder,
2949
+ children: ($$renderer7) => {
2950
+ $$renderer7.push(`<!---->Select`);
2951
+ },
2952
+ $$slots: { default: true }
2953
+ });
2954
+ $$renderer6.push(`<!---->`);
2955
+ },
2956
+ $$slots: { default: true }
2957
+ });
2958
+ $$renderer5.push(`<!---->`);
2959
+ },
2960
+ $$slots: { default: true }
2961
+ });
2962
+ $$renderer4.push(`<!---->`);
2963
+ },
2964
+ $$slots: { default: true }
2965
+ });
2966
+ $$renderer3.push(`<!----> <!---->`);
2967
+ Alert_dialog?.($$renderer3, {
2968
+ get open() {
2969
+ return alertOpen;
2970
+ },
2971
+ set open($$value) {
2972
+ alertOpen = $$value;
2973
+ $$settled = false;
2974
+ },
2975
+ children: ($$renderer4) => {
2976
+ $$renderer4.push(`<!---->`);
2977
+ Alert_dialog_content?.($$renderer4, {
2978
+ children: ($$renderer5) => {
2979
+ $$renderer5.push(`<!---->`);
2980
+ Alert_dialog_header?.($$renderer5, {
2981
+ children: ($$renderer6) => {
2982
+ $$renderer6.push(`<!---->`);
2983
+ Alert_dialog_title?.($$renderer6, {
2984
+ children: ($$renderer7) => {
2985
+ $$renderer7.push(`<!---->${escape_html(alertTitle)}`);
2986
+ },
2987
+ $$slots: { default: true }
2988
+ });
2989
+ $$renderer6.push(`<!----> <!---->`);
2990
+ Alert_dialog_description?.($$renderer6, {
2991
+ children: ($$renderer7) => {
2992
+ $$renderer7.push(`<!---->${escape_html(alertMessage)}`);
2993
+ },
2994
+ $$slots: { default: true }
2995
+ });
2996
+ $$renderer6.push(`<!---->`);
2997
+ },
2998
+ $$slots: { default: true }
2999
+ });
3000
+ $$renderer5.push(`<!----> <!---->`);
3001
+ Alert_dialog_footer?.($$renderer5, {
3002
+ children: ($$renderer6) => {
3003
+ $$renderer6.push(`<!---->`);
3004
+ Alert_dialog_cancel?.($$renderer6, {
3005
+ children: ($$renderer7) => {
3006
+ $$renderer7.push(`<!---->Cancel`);
3007
+ },
3008
+ $$slots: { default: true }
3009
+ });
3010
+ $$renderer6.push(`<!----> <!---->`);
3011
+ Alert_dialog_action?.($$renderer6, {
3012
+ onclick: () => {
3013
+ alertOnConfirm();
3014
+ alertOpen = false;
3015
+ },
3016
+ class: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
3017
+ children: ($$renderer7) => {
3018
+ $$renderer7.push(`<!---->Confirm`);
3019
+ },
3020
+ $$slots: { default: true }
3021
+ });
3022
+ $$renderer6.push(`<!---->`);
3023
+ },
3024
+ $$slots: { default: true }
3025
+ });
3026
+ $$renderer5.push(`<!---->`);
3027
+ },
3028
+ $$slots: { default: true }
3029
+ });
3030
+ $$renderer4.push(`<!---->`);
3031
+ },
3032
+ $$slots: { default: true }
3033
+ });
3034
+ $$renderer3.push(`<!---->`);
81
3035
  }
82
- $$renderer2.push(`<!--]-->`);
3036
+ do {
3037
+ $$settled = true;
3038
+ $$inner_renderer = $$renderer2.copy();
3039
+ $$render_inner($$inner_renderer);
3040
+ } while (!$$settled);
3041
+ $$renderer2.subsume($$inner_renderer);
3042
+ if ($$store_subs) unsubscribe_stores($$store_subs);
3043
+ });
3044
+ }
3045
+ function _page($$renderer) {
3046
+ head("1uha8ag", $$renderer, ($$renderer2) => {
3047
+ $$renderer2.title(($$renderer3) => {
3048
+ $$renderer3.push(`<title>claude-mux</title>`);
3049
+ });
83
3050
  });
3051
+ $$renderer.push(`<div class="root-page svelte-1uha8ag">`);
3052
+ AllSessionsPanel($$renderer, {});
3053
+ $$renderer.push(`<!----></div>`);
84
3054
  }
85
3055
  export {
86
3056
  _page as default