@principal-ade/panel-layouts 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,13 +1,13 @@
1
- import './index.css';var Y = Object.defineProperty;
2
- var Q = (t, e, o) => e in t ? Y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var _ = (t, e, o) => Q(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { EditableConfigurablePanelLayout as ot, ResponsiveConfigurablePanelLayout as rt, mapThemeToPanelVars as at, mapThemeToTabVars as st } from "@principal-ade/panels";
5
- import U, { useState as W, useRef as A, useEffect as I, useCallback as w, forwardRef as Z, useMemo as M } from "react";
6
- import { jsx as f, jsxs as T, Fragment as ee } from "react/jsx-runtime";
1
+ import './index.css';var se = Object.defineProperty;
2
+ var ne = (t, e, o) => e in t ? se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
+ var E = (t, e, o) => ne(t, typeof e != "symbol" ? e + "" : e, o);
4
+ import { EditableConfigurablePanelLayout as it, ResponsiveConfigurablePanelLayout as lt, mapThemeToPanelVars as ct, mapThemeToTabVars as pt } from "@principal-ade/panels";
5
+ import ie, { useState as _, useRef as L, useEffect as I, useCallback as w, forwardRef as le, useMemo as O } from "react";
6
+ import { jsx as f, jsxs as S, Fragment as ce } from "react/jsx-runtime";
7
7
  import { useTheme as $ } from "@principal-ade/industry-theme";
8
- class te {
8
+ class pe {
9
9
  constructor() {
10
- _(this, "storageKey", "panel-layouts");
10
+ E(this, "storageKey", "panel-layouts");
11
11
  }
12
12
  async load(e) {
13
13
  try {
@@ -23,51 +23,51 @@ class te {
23
23
  `${this.storageKey}:${e}`,
24
24
  JSON.stringify(o)
25
25
  );
26
- } catch (r) {
27
- console.error(`Failed to save panel layout for ${e}:`, r);
26
+ } catch (a) {
27
+ console.error(`Failed to save panel layout for ${e}:`, a);
28
28
  }
29
29
  }
30
30
  }
31
- function Ee(t) {
31
+ function $e(t) {
32
32
  const {
33
33
  viewKey: e,
34
34
  defaultSizes: o,
35
- panelType: r,
36
- adapter: a = new te()
37
- } = t, [n, s] = W(o), [l, d] = W(t.collapsed), p = A(t.collapsed), g = A({}), c = A(null), m = A(null);
35
+ panelType: a,
36
+ adapter: r = new pe()
37
+ } = t, [n, s] = _(o), [i, p] = _(t.collapsed), d = L(t.collapsed), g = L({}), c = L(null), m = L(null);
38
38
  I(() => {
39
39
  (async () => {
40
- const C = await a.load(e);
40
+ const C = await r.load(e);
41
41
  C != null && C.sizes && (s(C.sizes), y(C.sizes));
42
42
  })();
43
43
  }, [e]);
44
44
  const y = w(
45
- (b) => {
46
- "left" in b && b.left > 0 && (g.current.left = b.left), "middle" in b && b.middle > 0 && (g.current.middle = b.middle), "right" in b && b.right > 0 && (g.current.right = b.right);
45
+ (k) => {
46
+ "left" in k && k.left > 0 && (g.current.left = k.left), "middle" in k && k.middle > 0 && (g.current.middle = k.middle), "right" in k && k.right > 0 && (g.current.right = k.right);
47
47
  },
48
48
  []
49
49
  ), u = w(
50
- (b) => {
51
- const C = g.current[b];
50
+ (k) => {
51
+ const C = g.current[k];
52
52
  if (C && C > 0)
53
53
  return C;
54
- if (b === "left" && "left" in o && o.left > 0)
54
+ if (k === "left" && "left" in o && o.left > 0)
55
55
  return o.left;
56
- if (b === "right" && "right" in o && o.right > 0)
56
+ if (k === "right" && "right" in o && o.right > 0)
57
57
  return o.right;
58
58
  },
59
59
  [o]
60
- ), i = A(o);
60
+ ), l = L(o);
61
61
  I(() => {
62
- ("left" in o && o.left !== i.current.left || "middle" in o && "middle" in i.current && o.middle !== i.current.middle || "right" in o && o.right !== i.current.right) && (s(o), y(o), i.current = o);
62
+ ("left" in o && o.left !== l.current.left || "middle" in o && "middle" in l.current && o.middle !== l.current.middle || "right" in o && o.right !== l.current.right) && (s(o), y(o), l.current = o);
63
63
  }, [o, y]), I(() => {
64
- const b = t.collapsed.left !== p.current.left, C = "right" in t.collapsed && "right" in p.current && t.collapsed.right !== p.current.right;
65
- (b || C) && (d(t.collapsed), p.current = { ...t.collapsed });
64
+ const k = t.collapsed.left !== d.current.left, C = "right" in t.collapsed && "right" in d.current && t.collapsed.right !== d.current.right;
65
+ (k || C) && (p(t.collapsed), d.current = { ...t.collapsed });
66
66
  }, [t.collapsed.left, t.collapsed.right]);
67
- const k = w(
68
- async (b) => {
67
+ const b = w(
68
+ async (k) => {
69
69
  try {
70
- await a.save(e, { sizes: b });
70
+ await r.save(e, { sizes: k });
71
71
  } catch (C) {
72
72
  console.error(
73
73
  `Failed to save panel preferences for ${e}:`,
@@ -75,23 +75,23 @@ function Ee(t) {
75
75
  );
76
76
  }
77
77
  },
78
- [e, a]
78
+ [e, r]
79
79
  ), P = w(
80
- (b) => {
81
- const C = { ...b };
80
+ (k) => {
81
+ const C = { ...k };
82
82
  let v = !0;
83
- if ("left" in b) {
84
- const x = !!(l != null && l.left), h = b.left;
83
+ if ("left" in k) {
84
+ const x = !!(i != null && i.left), h = k.left;
85
85
  if (x) {
86
- const S = u("left");
87
- S !== void 0 && S > 0 ? C.left = S : v = !1;
86
+ const T = u("left");
87
+ T !== void 0 && T > 0 ? C.left = T : v = !1;
88
88
  } else h === 0 && (v = !1);
89
89
  }
90
- if (r === "three-panel" && "right" in b) {
91
- const x = !!(l != null && l.right), h = b.right;
90
+ if (a === "three-panel" && "right" in k) {
91
+ const x = !!(i != null && i.right), h = k.right;
92
92
  if (x) {
93
- const S = u("right");
94
- S !== void 0 && S > 0 ? C.right = S : v = !1;
93
+ const T = u("right");
94
+ T !== void 0 && T > 0 ? C.right = T : v = !1;
95
95
  } else h === 0 && (v = !1);
96
96
  }
97
97
  if (s(C), y(C), c.current && (clearTimeout(c.current), c.current = null), !v) {
@@ -100,50 +100,50 @@ function Ee(t) {
100
100
  }
101
101
  m.current = C, c.current = setTimeout(() => {
102
102
  const x = m.current;
103
- x && (k(x), m.current = null), c.current = null;
103
+ x && (b(x), m.current = null), c.current = null;
104
104
  }, 500);
105
105
  },
106
106
  [
107
- l,
107
+ i,
108
108
  u,
109
- r,
110
- k,
109
+ a,
110
+ b,
111
111
  y
112
112
  ]
113
113
  );
114
114
  I(() => () => {
115
115
  if (c.current) {
116
- const b = m.current;
117
- b && (k(b), m.current = null), clearTimeout(c.current), c.current = null;
116
+ const k = m.current;
117
+ k && (b(k), m.current = null), clearTimeout(c.current), c.current = null;
118
118
  }
119
- }, [k]);
120
- const L = w(async () => {
121
- }, []), z = w(async () => {
119
+ }, [b]);
120
+ const W = w(async () => {
121
+ }, []), A = w(async () => {
122
122
  }, []), D = w(async () => {
123
- }, []), F = w(async () => {
123
+ }, []), j = w(async () => {
124
124
  }, []);
125
- return r === "three-panel" ? {
125
+ return a === "three-panel" ? {
126
126
  type: "three-panel",
127
127
  sizes: n,
128
- collapsed: l,
128
+ collapsed: i,
129
129
  handlePanelResize: P,
130
- handleLeftCollapseComplete: L,
131
- handleLeftExpandComplete: z,
130
+ handleLeftCollapseComplete: W,
131
+ handleLeftExpandComplete: A,
132
132
  handleRightCollapseComplete: D,
133
- handleRightExpandComplete: F
133
+ handleRightExpandComplete: j
134
134
  } : {
135
135
  type: "two-panel",
136
136
  sizes: n,
137
- collapsed: l,
137
+ collapsed: i,
138
138
  handlePanelResize: P,
139
- handleLeftCollapseComplete: L,
140
- handleLeftExpandComplete: z
139
+ handleLeftCollapseComplete: W,
140
+ handleLeftExpandComplete: A
141
141
  };
142
142
  }
143
- class oe {
143
+ class de {
144
144
  constructor() {
145
- _(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
146
- _(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
145
+ E(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
146
+ E(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
147
147
  }
148
148
  /**
149
149
  * Load all user-created workspace presets
@@ -171,8 +171,8 @@ class oe {
171
171
  */
172
172
  async loadRepositoryState(e) {
173
173
  try {
174
- const o = `${this.REPO_STATE_PREFIX}${e}`, r = localStorage.getItem(o);
175
- return r ? JSON.parse(r) : null;
174
+ const o = `${this.REPO_STATE_PREFIX}${e}`, a = localStorage.getItem(o);
175
+ return a ? JSON.parse(a) : null;
176
176
  } catch (o) {
177
177
  return console.error(
178
178
  `Failed to load repository state for ${e}:`,
@@ -185,13 +185,13 @@ class oe {
185
185
  */
186
186
  async saveRepositoryState(e, o) {
187
187
  try {
188
- const r = `${this.REPO_STATE_PREFIX}${e}`;
189
- localStorage.setItem(r, JSON.stringify(o));
190
- } catch (r) {
188
+ const a = `${this.REPO_STATE_PREFIX}${e}`;
189
+ localStorage.setItem(a, JSON.stringify(o));
190
+ } catch (a) {
191
191
  throw console.error(
192
192
  `Failed to save repository state for ${e}:`,
193
- r
194
- ), r;
193
+ a
194
+ ), a;
195
195
  }
196
196
  }
197
197
  /**
@@ -201,15 +201,15 @@ class oe {
201
201
  try {
202
202
  const e = {};
203
203
  for (let o = 0; o < localStorage.length; o++) {
204
- const r = localStorage.key(o);
205
- if (r && r.startsWith(this.REPO_STATE_PREFIX)) {
206
- const a = r.substring(this.REPO_STATE_PREFIX.length), n = localStorage.getItem(r);
204
+ const a = localStorage.key(o);
205
+ if (a && a.startsWith(this.REPO_STATE_PREFIX)) {
206
+ const r = a.substring(this.REPO_STATE_PREFIX.length), n = localStorage.getItem(a);
207
207
  if (n)
208
208
  try {
209
- e[a] = JSON.parse(n);
209
+ e[r] = JSON.parse(n);
210
210
  } catch (s) {
211
211
  console.error(
212
- `Failed to parse repository state for ${a}:`,
212
+ `Failed to parse repository state for ${r}:`,
213
213
  s
214
214
  );
215
215
  }
@@ -248,8 +248,8 @@ class R {
248
248
  * Create a new workspace layout
249
249
  */
250
250
  static async createWorkspaceLayout(e) {
251
- const o = await this.adapter.loadWorkspacePresets(), r = this.generateWorkspaceId(e.name), a = {
252
- id: r,
251
+ const o = await this.adapter.loadWorkspacePresets(), a = this.generateWorkspaceId(e.name), r = {
252
+ id: a,
253
253
  name: e.name,
254
254
  description: e.description,
255
255
  layout: e.layout,
@@ -260,29 +260,29 @@ class R {
260
260
  isBuiltIn: !1
261
261
  }, n = {
262
262
  ...o,
263
- [r]: a
263
+ [a]: r
264
264
  };
265
- return await this.adapter.saveWorkspacePresets(n), a;
265
+ return await this.adapter.saveWorkspacePresets(n), r;
266
266
  }
267
267
  /**
268
268
  * Update an existing workspace layout
269
269
  */
270
270
  static async updateWorkspaceLayout(e, o) {
271
- const r = await this.adapter.loadWorkspacePresets(), a = r[e];
272
- if (!a)
271
+ const a = await this.adapter.loadWorkspacePresets(), r = a[e];
272
+ if (!r)
273
273
  return console.error(`Workspace layout ${e} not found`), null;
274
- if (a.isBuiltIn)
274
+ if (r.isBuiltIn)
275
275
  return console.error(`Cannot update built-in workspace layout ${e}`), null;
276
276
  const n = {
277
- ...a,
277
+ ...r,
278
278
  ...o,
279
279
  id: e,
280
280
  // Preserve ID
281
- createdAt: a.createdAt,
281
+ createdAt: r.createdAt,
282
282
  // Preserve creation time
283
283
  updatedAt: Date.now()
284
284
  }, s = {
285
- ...r,
285
+ ...a,
286
286
  [e]: n
287
287
  };
288
288
  return await this.adapter.saveWorkspacePresets(s), n;
@@ -291,13 +291,13 @@ class R {
291
291
  * Delete a workspace layout
292
292
  */
293
293
  static async deleteWorkspaceLayout(e) {
294
- const o = await this.adapter.loadWorkspacePresets(), r = o[e];
295
- if (!r)
294
+ const o = await this.adapter.loadWorkspacePresets(), a = o[e];
295
+ if (!a)
296
296
  return console.error(`Workspace layout ${e} not found`), !1;
297
- if (r.isBuiltIn)
297
+ if (a.isBuiltIn)
298
298
  return console.error(`Cannot delete built-in workspace layout ${e}`), !1;
299
- const a = { ...o };
300
- return delete a[e], await this.adapter.saveWorkspacePresets(a), !0;
299
+ const r = { ...o };
300
+ return delete r[e], await this.adapter.saveWorkspacePresets(r), !0;
301
301
  }
302
302
  /**
303
303
  * Get repository state (which workspace + current sizes/collapsed)
@@ -315,9 +315,9 @@ class R {
315
315
  * Update only sizes in repository state
316
316
  */
317
317
  static async updateRepositorySizes(e, o) {
318
- const r = await this.getRepositoryState(e);
319
- r && await this.setRepositoryState(e, {
320
- ...r,
318
+ const a = await this.getRepositoryState(e);
319
+ a && await this.setRepositoryState(e, {
320
+ ...a,
321
321
  sizes: o
322
322
  });
323
323
  }
@@ -325,9 +325,9 @@ class R {
325
325
  * Update only collapsed state in repository state
326
326
  */
327
327
  static async updateRepositoryCollapsed(e, o) {
328
- const r = await this.getRepositoryState(e);
329
- r && await this.setRepositoryState(e, {
330
- ...r,
328
+ const a = await this.getRepositoryState(e);
329
+ a && await this.setRepositoryState(e, {
330
+ ...a,
331
331
  collapsed: o
332
332
  });
333
333
  }
@@ -335,39 +335,39 @@ class R {
335
335
  * Check if repository state differs from workspace defaults
336
336
  */
337
337
  static hasStateDeviation(e, o) {
338
- const r = o.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(o.defaultSizes) : !1, a = o.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(o.defaultCollapsed) : !1;
339
- return { hasSizeDeviation: r, hasCollapsedDeviation: a };
338
+ const a = o.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(o.defaultSizes) : !1, r = o.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(o.defaultCollapsed) : !1;
339
+ return { hasSizeDeviation: a, hasCollapsedDeviation: r };
340
340
  }
341
341
  /**
342
342
  * Update workspace defaults from repository state
343
343
  */
344
344
  static async updateWorkspaceFromRepositoryState(e, o) {
345
- const r = await this.getWorkspaceLayout(e), a = await this.getRepositoryState(o);
346
- if (!r || !a || r.isBuiltIn) {
345
+ const a = await this.getWorkspaceLayout(e), r = await this.getRepositoryState(o);
346
+ if (!a || !r || a.isBuiltIn) {
347
347
  console.error(
348
348
  "Cannot update built-in workspace or workspace/state not found"
349
349
  );
350
350
  return;
351
351
  }
352
352
  await this.updateWorkspaceLayout(e, {
353
- defaultSizes: a.sizes,
354
- defaultCollapsed: a.collapsed
353
+ defaultSizes: r.sizes,
354
+ defaultCollapsed: r.collapsed
355
355
  });
356
356
  }
357
357
  /**
358
358
  * Reset repository state to workspace defaults
359
359
  */
360
360
  static async resetRepositoryToWorkspaceDefaults(e, o) {
361
- const r = await this.getWorkspaceLayout(o);
362
- if (!r) {
361
+ const a = await this.getWorkspaceLayout(o);
362
+ if (!a) {
363
363
  console.error(`Workspace ${o} not found`);
364
364
  return;
365
365
  }
366
- const a = await this.getRepositoryState(e);
367
- a && await this.setRepositoryState(e, {
368
- ...a,
369
- sizes: r.defaultSizes || { left: 20, middle: 45, right: 35 },
370
- collapsed: r.defaultCollapsed || { left: !1, right: !1 }
366
+ const r = await this.getRepositoryState(e);
367
+ r && await this.setRepositoryState(e, {
368
+ ...r,
369
+ sizes: a.defaultSizes || { left: 20, middle: 45, right: 35 },
370
+ collapsed: a.defaultCollapsed || { left: !1, right: !1 }
371
371
  });
372
372
  }
373
373
  /**
@@ -381,9 +381,9 @@ class R {
381
381
  */
382
382
  static async findMatchingWorkspace(e) {
383
383
  const o = await this.getWorkspaceLayouts();
384
- for (const [r, a] of Object.entries(o))
385
- if (this.isLayoutMatchingWorkspace(e, a))
386
- return r;
384
+ for (const [a, r] of Object.entries(o))
385
+ if (this.isLayoutMatchingWorkspace(e, r))
386
+ return a;
387
387
  return null;
388
388
  }
389
389
  /**
@@ -610,26 +610,26 @@ class R {
610
610
  Object.keys(e).length;
611
611
  }
612
612
  }
613
- _(R, "adapter", new oe());
614
- function De(t = {}) {
615
- const { repositoryKey: e, autoInitialize: o = !1, defaultWorkspaceId: r } = t, [a, n] = W(
613
+ E(R, "adapter", new de());
614
+ function je(t = {}) {
615
+ const { repositoryKey: e, autoInitialize: o = !1, defaultWorkspaceId: a } = t, [r, n] = _(
616
616
  {}
617
- ), [s, l] = W(null), [d, p] = W(null), [g, c] = W(!0), [m, y] = W(null), u = w(async () => {
617
+ ), [s, i] = _(null), [p, d] = _(null), [g, c] = _(!0), [m, y] = _(null), u = w(async () => {
618
618
  try {
619
619
  c(!0), y(null);
620
620
  const v = await R.getWorkspaceLayouts();
621
621
  if (n(v), e) {
622
622
  let x = await R.getRepositoryState(e);
623
623
  if (!x && o) {
624
- const h = r || "project-management", S = await R.getWorkspaceLayout(h);
625
- S && (x = {
624
+ const h = a || "project-management", T = await R.getWorkspaceLayout(h);
625
+ T && (x = {
626
626
  workspaceId: h,
627
- sizes: S.defaultSizes || {
627
+ sizes: T.defaultSizes || {
628
628
  left: 20,
629
629
  middle: 45,
630
630
  right: 35
631
631
  },
632
- collapsed: S.defaultCollapsed || {
632
+ collapsed: T.defaultCollapsed || {
633
633
  left: !1,
634
634
  right: !1
635
635
  }
@@ -638,27 +638,27 @@ function De(t = {}) {
638
638
  x
639
639
  ));
640
640
  }
641
- if (l(x), x != null && x.workspaceId) {
641
+ if (i(x), x != null && x.workspaceId) {
642
642
  const h = await R.getWorkspaceLayout(
643
643
  x.workspaceId
644
644
  );
645
- p(h);
645
+ d(h);
646
646
  } else
647
- p(null);
647
+ d(null);
648
648
  }
649
649
  } catch (v) {
650
650
  y(v), console.error("Failed to load workspace data:", v);
651
651
  } finally {
652
652
  c(!1);
653
653
  }
654
- }, [e, o, r]);
654
+ }, [e, o, a]);
655
655
  I(() => {
656
656
  u();
657
657
  }, [u]);
658
- const i = w(
658
+ const l = w(
659
659
  async (v) => await R.getWorkspaceLayout(v),
660
660
  []
661
- ), k = w(
661
+ ), b = w(
662
662
  async (v) => {
663
663
  const x = await R.createWorkspaceLayout(v);
664
664
  return await u(), x;
@@ -670,13 +670,13 @@ function De(t = {}) {
670
670
  return await u(), h;
671
671
  },
672
672
  [u]
673
- ), L = w(
673
+ ), W = w(
674
674
  async (v) => {
675
675
  const x = await R.deleteWorkspaceLayout(v);
676
676
  return x && await u(), x;
677
677
  },
678
678
  [u]
679
- ), z = w(
679
+ ), A = w(
680
680
  async (v) => {
681
681
  if (!e) {
682
682
  console.error("Cannot apply workspace without repositoryKey");
@@ -707,7 +707,7 @@ function De(t = {}) {
707
707
  await R.updateRepositorySizes(e, v), await u();
708
708
  },
709
709
  [e, u]
710
- ), F = w(
710
+ ), j = w(
711
711
  async (v) => {
712
712
  if (!e) {
713
713
  console.error("Cannot update collapsed without repositoryKey");
@@ -719,7 +719,7 @@ function De(t = {}) {
719
719
  ), await u();
720
720
  },
721
721
  [e, u]
722
- ), b = w(async () => {
722
+ ), k = w(async () => {
723
723
  if (!e || !(s != null && s.workspaceId)) {
724
724
  console.error("Cannot reset without repositoryKey and active workspace");
725
725
  return;
@@ -732,146 +732,146 @@ function De(t = {}) {
732
732
  await u();
733
733
  }, [u]);
734
734
  return {
735
- workspaces: a,
735
+ workspaces: r,
736
736
  repositoryState: s,
737
- activeWorkspace: d,
737
+ activeWorkspace: p,
738
738
  loading: g,
739
739
  error: m,
740
- getWorkspace: i,
741
- createWorkspace: k,
740
+ getWorkspace: l,
741
+ createWorkspace: b,
742
742
  updateWorkspace: P,
743
- deleteWorkspace: L,
744
- applyWorkspace: z,
743
+ deleteWorkspace: W,
744
+ applyWorkspace: A,
745
745
  updateSizes: D,
746
- updateCollapsed: F,
747
- resetToDefaults: b,
746
+ updateCollapsed: j,
747
+ resetToDefaults: k,
748
748
  refresh: C
749
749
  };
750
750
  }
751
- function _e(t = {}) {
751
+ function qe(t = {}) {
752
752
  const {
753
753
  initialFocus: e = null,
754
754
  collapsed: o = {},
755
- panelType: r = "three-panel",
756
- onFocusChange: a,
755
+ panelType: a = "three-panel",
756
+ onFocusChange: r,
757
757
  events: n,
758
758
  getPanelId: s
759
- } = t, [l, d] = W(
759
+ } = t, [i, p] = _(
760
760
  e
761
- ), p = w(
762
- (i) => {
763
- const k = l;
764
- if (d(i), a == null || a(i), n && s) {
765
- if (k) {
766
- const L = s(k);
767
- L && n.emit({
761
+ ), d = w(
762
+ (l) => {
763
+ const b = i;
764
+ if (p(l), r == null || r(l), n && s) {
765
+ if (b) {
766
+ const W = s(b);
767
+ W && n.emit({
768
768
  type: "panel:blur",
769
769
  source: "panel-layouts",
770
770
  timestamp: Date.now(),
771
771
  payload: {
772
- panelId: L,
773
- panelSlot: k,
774
- nextPanelId: s(i)
772
+ panelId: W,
773
+ panelSlot: b,
774
+ nextPanelId: s(l)
775
775
  }
776
776
  });
777
777
  }
778
- const P = s(i);
778
+ const P = s(l);
779
779
  P && n.emit({
780
780
  type: "panel:focus",
781
781
  source: "panel-layouts",
782
782
  timestamp: Date.now(),
783
783
  payload: {
784
784
  panelId: P,
785
- panelSlot: i,
785
+ panelSlot: l,
786
786
  source: "keyboard-shortcut"
787
787
  }
788
788
  });
789
789
  }
790
790
  },
791
- [l, a, n, s]
791
+ [i, r, n, s]
792
792
  ), g = w(() => {
793
- const i = l;
794
- if (d(null), a == null || a(null), n && s && i) {
795
- const k = s(i);
796
- k && n.emit({
793
+ const l = i;
794
+ if (p(null), r == null || r(null), n && s && l) {
795
+ const b = s(l);
796
+ b && n.emit({
797
797
  type: "panel:blur",
798
798
  source: "panel-layouts",
799
799
  timestamp: Date.now(),
800
800
  payload: {
801
- panelId: k,
802
- panelSlot: i
801
+ panelId: b,
802
+ panelSlot: l
803
803
  }
804
804
  });
805
805
  }
806
- }, [l, a, n, s]), c = w(() => {
807
- const i = [];
808
- return o.left || i.push("left"), i.push("middle"), r === "three-panel" && !o.right && i.push("right"), i;
809
- }, [o, r]), m = w(() => {
810
- const i = c();
811
- if (i.length === 0) return;
812
- if (l === null) {
813
- p(i[0]);
806
+ }, [i, r, n, s]), c = w(() => {
807
+ const l = [];
808
+ return o.left || l.push("left"), l.push("middle"), a === "three-panel" && !o.right && l.push("right"), l;
809
+ }, [o, a]), m = w(() => {
810
+ const l = c();
811
+ if (l.length === 0) return;
812
+ if (i === null) {
813
+ d(l[0]);
814
814
  return;
815
815
  }
816
- const k = i.indexOf(l);
817
- if (k === -1) {
818
- p(i[0]);
816
+ const b = l.indexOf(i);
817
+ if (b === -1) {
818
+ d(l[0]);
819
819
  return;
820
820
  }
821
- const P = (k + 1) % i.length;
822
- p(i[P]);
823
- }, [l, c, p]), y = w(() => {
824
- const i = c();
825
- if (i.length === 0) return;
826
- if (l === null) {
827
- p(i[i.length - 1]);
821
+ const P = (b + 1) % l.length;
822
+ d(l[P]);
823
+ }, [i, c, d]), y = w(() => {
824
+ const l = c();
825
+ if (l.length === 0) return;
826
+ if (i === null) {
827
+ d(l[l.length - 1]);
828
828
  return;
829
829
  }
830
- const k = i.indexOf(l);
831
- if (k === -1) {
832
- p(i[i.length - 1]);
830
+ const b = l.indexOf(i);
831
+ if (b === -1) {
832
+ d(l[l.length - 1]);
833
833
  return;
834
834
  }
835
- const P = k === 0 ? i.length - 1 : k - 1;
836
- p(i[P]);
837
- }, [l, c, p]), u = w(
838
- (i) => l === i,
839
- [l]
835
+ const P = b === 0 ? l.length - 1 : b - 1;
836
+ d(l[P]);
837
+ }, [i, c, d]), u = w(
838
+ (l) => i === l,
839
+ [i]
840
840
  );
841
841
  return {
842
- focusedPanel: l,
843
- setFocus: p,
842
+ focusedPanel: i,
843
+ setFocus: d,
844
844
  clearFocus: g,
845
845
  focusNext: m,
846
846
  focusPrevious: y,
847
847
  isFocused: u
848
848
  };
849
849
  }
850
- function $e(t) {
850
+ function Fe(t) {
851
851
  const {
852
852
  enabled: e = !0,
853
853
  focusedPanel: o,
854
- collapsed: r,
855
- panelType: a,
854
+ collapsed: a,
855
+ panelType: r,
856
856
  setFocus: n,
857
857
  onExpand: s,
858
- onCollapse: l
859
- } = t, d = A(o), p = A(r), g = A(a);
858
+ onCollapse: i
859
+ } = t, p = L(o), d = L(a), g = L(r);
860
860
  I(() => {
861
- d.current = o;
861
+ p.current = o;
862
862
  }, [o]), I(() => {
863
- p.current = r;
864
- }, [r]), I(() => {
865
- g.current = a;
866
- }, [a]);
863
+ d.current = a;
864
+ }, [a]), I(() => {
865
+ g.current = r;
866
+ }, [r]);
867
867
  const c = w(
868
868
  (m) => {
869
869
  if (!m.altKey || m.ctrlKey || m.metaKey || m.shiftKey)
870
870
  return;
871
- const y = m.code, u = d.current, i = p.current, k = g.current;
872
- y === "Digit1" || y === "Numpad1" ? (m.preventDefault(), i.left ? s("left") : u !== "left" ? n("left") : (l("left"), n("middle"))) : y === "Digit2" || y === "Numpad2" ? (m.preventDefault(), n("middle")) : (y === "Digit3" || y === "Numpad3") && k === "three-panel" && (m.preventDefault(), i.right ? s("right") : u !== "right" ? n("right") : (l("right"), n("middle")));
871
+ const y = m.code, u = p.current, l = d.current, b = g.current;
872
+ y === "Digit1" || y === "Numpad1" ? (m.preventDefault(), l.left ? s("left") : u !== "left" ? n("left") : (i("left"), n("middle"))) : y === "Digit2" || y === "Numpad2" ? (m.preventDefault(), n("middle")) : (y === "Digit3" || y === "Numpad3") && b === "three-panel" && (m.preventDefault(), l.right ? s("right") : u !== "right" ? n("right") : (i("right"), n("middle")));
873
873
  },
874
- [n, s, l]
874
+ [n, s, i]
875
875
  );
876
876
  I(() => {
877
877
  if (e)
@@ -880,33 +880,33 @@ function $e(t) {
880
880
  };
881
881
  }, [e, c]);
882
882
  }
883
- function Fe(t, e, o, r) {
883
+ function Oe(t, e, o, a) {
884
884
  I(() => {
885
- const a = e.on(
885
+ const r = e.on(
886
886
  "panel:focus",
887
887
  (s) => {
888
888
  s.payload.panelId === t && o();
889
889
  }
890
890
  );
891
891
  let n;
892
- return r && (n = e.on(
892
+ return a && (n = e.on(
893
893
  "panel:blur",
894
894
  (s) => {
895
- s.payload.panelId === t && r();
895
+ s.payload.panelId === t && a();
896
896
  }
897
897
  )), () => {
898
- a(), n == null || n();
898
+ r(), n == null || n();
899
899
  };
900
- }, [t, e, o, r]);
900
+ }, [t, e, o, a]);
901
901
  }
902
- const je = ({
902
+ const Me = ({
903
903
  isFocused: t,
904
904
  className: e = "",
905
905
  style: o = {}
906
906
  }) => {
907
907
  if (!t)
908
908
  return null;
909
- const r = {
909
+ const a = {
910
910
  position: "absolute",
911
911
  top: 0,
912
912
  left: 0,
@@ -924,29 +924,29 @@ const je = ({
924
924
  "div",
925
925
  {
926
926
  className: `panel-focus-indicator ${e}`,
927
- style: r,
927
+ style: a,
928
928
  role: "presentation",
929
929
  "aria-hidden": "true"
930
930
  }
931
931
  );
932
- }, re = ({
932
+ }, ue = ({
933
933
  value: t,
934
934
  onChange: e,
935
935
  placeholder: o = "> Type a command...",
936
- onClose: r,
937
- onEnter: a
936
+ onClose: a,
937
+ onEnter: r
938
938
  }) => {
939
- const { theme: n } = $(), s = A(null);
939
+ const { theme: n } = $(), s = L(null);
940
940
  I(() => {
941
941
  s.current && s.current.focus();
942
942
  }, []);
943
- const l = (d) => {
944
- switch (d.key) {
943
+ const i = (p) => {
944
+ switch (p.key) {
945
945
  case "Enter":
946
- d.preventDefault(), a == null || a();
946
+ p.preventDefault(), r == null || r();
947
947
  break;
948
948
  case "Escape":
949
- d.preventDefault(), r();
949
+ p.preventDefault(), a();
950
950
  break;
951
951
  }
952
952
  };
@@ -964,8 +964,8 @@ const je = ({
964
964
  ref: s,
965
965
  type: "text",
966
966
  value: t,
967
- onChange: (d) => e(d.target.value),
968
- onKeyDown: l,
967
+ onChange: (p) => e(p.target.value),
968
+ onKeyDown: i,
969
969
  placeholder: o,
970
970
  style: {
971
971
  width: "100%",
@@ -986,16 +986,16 @@ const je = ({
986
986
  )
987
987
  }
988
988
  );
989
- }, B = Z(
990
- ({ command: t, isSelected: e, onClick: o, onMouseEnter: r }, a) => {
991
- const { theme: n } = $(), { label: s, description: l, icon: d, shortcut: p } = t, [g, c] = U.useState(!1);
992
- return /* @__PURE__ */ T(
989
+ }, B = le(
990
+ ({ command: t, isSelected: e, onClick: o, onMouseEnter: a }, r) => {
991
+ const { theme: n } = $(), { label: s, description: i, icon: p, shortcut: d } = t, [g, c] = ie.useState(!1);
992
+ return /* @__PURE__ */ S(
993
993
  "div",
994
994
  {
995
- ref: a,
995
+ ref: r,
996
996
  onClick: o,
997
997
  onMouseEnter: () => {
998
- c(!0), r();
998
+ c(!0), a();
999
999
  },
1000
1000
  onMouseLeave: () => c(!1),
1001
1001
  style: {
@@ -1012,7 +1012,7 @@ const je = ({
1012
1012
  m.preventDefault();
1013
1013
  },
1014
1014
  children: [
1015
- d && /* @__PURE__ */ f(
1015
+ p && /* @__PURE__ */ f(
1016
1016
  "div",
1017
1017
  {
1018
1018
  style: {
@@ -1025,10 +1025,10 @@ const je = ({
1025
1025
  fontSize: "16px",
1026
1026
  color: e || g ? n.colors.primary : n.colors.textSecondary
1027
1027
  },
1028
- children: d
1028
+ children: p
1029
1029
  }
1030
1030
  ),
1031
- /* @__PURE__ */ T("div", { style: { flex: 1, minWidth: 0 }, children: [
1031
+ /* @__PURE__ */ S("div", { style: { flex: 1, minWidth: 0 }, children: [
1032
1032
  /* @__PURE__ */ f(
1033
1033
  "div",
1034
1034
  {
@@ -1036,12 +1036,12 @@ const je = ({
1036
1036
  fontSize: "14px",
1037
1037
  fontWeight: 500,
1038
1038
  color: e || g ? n.colors.text : n.colors.textSecondary,
1039
- marginBottom: l ? "2px" : 0
1039
+ marginBottom: i ? "2px" : 0
1040
1040
  },
1041
1041
  children: s
1042
1042
  }
1043
1043
  ),
1044
- l && /* @__PURE__ */ f(
1044
+ i && /* @__PURE__ */ f(
1045
1045
  "div",
1046
1046
  {
1047
1047
  style: {
@@ -1051,11 +1051,11 @@ const je = ({
1051
1051
  textOverflow: "ellipsis",
1052
1052
  whiteSpace: "nowrap"
1053
1053
  },
1054
- children: l
1054
+ children: i
1055
1055
  }
1056
1056
  )
1057
1057
  ] }),
1058
- p && /* @__PURE__ */ f(
1058
+ d && /* @__PURE__ */ f(
1059
1059
  "div",
1060
1060
  {
1061
1061
  style: {
@@ -1068,7 +1068,7 @@ const je = ({
1068
1068
  borderRadius: "4px",
1069
1069
  fontFamily: n.fonts.monospace
1070
1070
  },
1071
- children: p
1071
+ children: d
1072
1072
  }
1073
1073
  )
1074
1074
  ]
@@ -1077,25 +1077,25 @@ const je = ({
1077
1077
  }
1078
1078
  );
1079
1079
  B.displayName = "CommandItem";
1080
- const ae = ({
1080
+ const fe = ({
1081
1081
  commands: t,
1082
1082
  selectedIndex: e,
1083
1083
  onSelect: o,
1084
- onHover: r,
1085
- maxResults: a = 10
1084
+ onHover: a,
1085
+ maxResults: r = 10
1086
1086
  }) => {
1087
- const { theme: n } = $(), s = A(null), l = A(null), d = t.slice(0, a);
1087
+ const { theme: n } = $(), s = L(null), i = L(null), p = t.slice(0, r);
1088
1088
  I(() => {
1089
- if (l.current && s.current) {
1090
- const c = l.current, m = s.current, y = c.offsetTop, u = y + c.offsetHeight, i = m.scrollTop, k = m.clientHeight;
1091
- y < i ? m.scrollTop = y - 8 : u > i + k && (m.scrollTop = u - k + 8);
1089
+ if (i.current && s.current) {
1090
+ const c = i.current, m = s.current, y = c.offsetTop, u = y + c.offsetHeight, l = m.scrollTop, b = m.clientHeight;
1091
+ y < l ? m.scrollTop = y - 8 : u > l + b && (m.scrollTop = u - b + 8);
1092
1092
  }
1093
1093
  }, [e]);
1094
- const p = d.reduce((c, m, y) => {
1094
+ const d = p.reduce((c, m, y) => {
1095
1095
  const u = m.category || "Other";
1096
1096
  return c[u] || (c[u] = []), c[u].push({ command: m, index: y }), c;
1097
- }, {}), g = Object.keys(p).sort((c, m) => c === "Other" ? 1 : m === "Other" ? -1 : c.localeCompare(m));
1098
- return /* @__PURE__ */ T(
1097
+ }, {}), g = Object.keys(d).sort((c, m) => c === "Other" ? 1 : m === "Other" ? -1 : c.localeCompare(m));
1098
+ return /* @__PURE__ */ S(
1099
1099
  "div",
1100
1100
  {
1101
1101
  ref: s,
@@ -1105,7 +1105,7 @@ const ae = ({
1105
1105
  padding: "8px 0"
1106
1106
  },
1107
1107
  children: [
1108
- g.map((c) => /* @__PURE__ */ T("div", { children: [
1108
+ g.map((c) => /* @__PURE__ */ S("div", { children: [
1109
1109
  g.length > 1 && /* @__PURE__ */ f(
1110
1110
  "div",
1111
1111
  {
@@ -1120,19 +1120,19 @@ const ae = ({
1120
1120
  children: c
1121
1121
  }
1122
1122
  ),
1123
- p[c].map(({ command: m, index: y }) => /* @__PURE__ */ f(
1123
+ d[c].map(({ command: m, index: y }) => /* @__PURE__ */ f(
1124
1124
  B,
1125
1125
  {
1126
1126
  command: m,
1127
1127
  isSelected: y === e,
1128
1128
  onClick: () => o(m),
1129
- onMouseEnter: () => r(y),
1130
- ref: y === e ? l : void 0
1129
+ onMouseEnter: () => a(y),
1130
+ ref: y === e ? i : void 0
1131
1131
  },
1132
1132
  m.id
1133
1133
  ))
1134
1134
  ] }, c)),
1135
- t.length > a && /* @__PURE__ */ T(
1135
+ t.length > r && /* @__PURE__ */ S(
1136
1136
  "div",
1137
1137
  {
1138
1138
  style: {
@@ -1144,7 +1144,7 @@ const ae = ({
1144
1144
  },
1145
1145
  children: [
1146
1146
  "Showing ",
1147
- a,
1147
+ r,
1148
1148
  " of ",
1149
1149
  t.length,
1150
1150
  " results"
@@ -1154,34 +1154,34 @@ const ae = ({
1154
1154
  ]
1155
1155
  }
1156
1156
  );
1157
- }, Oe = ({
1157
+ }, Ne = ({
1158
1158
  commandPalette: t,
1159
1159
  config: e
1160
1160
  }) => {
1161
- const { theme: o } = $(), r = A(null), {
1162
- isOpen: a,
1161
+ const { theme: o } = $(), a = L(null), {
1162
+ isOpen: r,
1163
1163
  close: n,
1164
1164
  query: s,
1165
- setQuery: l,
1166
- filteredCommands: d,
1167
- selectedIndex: p,
1165
+ setQuery: i,
1166
+ filteredCommands: p,
1167
+ selectedIndex: d,
1168
1168
  setSelectedIndex: g,
1169
1169
  executeSelected: c
1170
1170
  } = t;
1171
1171
  if (I(() => {
1172
- if (!a) return;
1173
- const u = (k) => {
1174
- r.current && !r.current.contains(k.target) && n();
1175
- }, i = setTimeout(() => {
1172
+ if (!r) return;
1173
+ const u = (b) => {
1174
+ a.current && !a.current.contains(b.target) && n();
1175
+ }, l = setTimeout(() => {
1176
1176
  document.addEventListener("mousedown", u);
1177
1177
  }, 100);
1178
1178
  return () => {
1179
- clearTimeout(i), document.removeEventListener("mousedown", u);
1179
+ clearTimeout(l), document.removeEventListener("mousedown", u);
1180
1180
  };
1181
- }, [a, n]), !a)
1181
+ }, [r, n]), !r)
1182
1182
  return null;
1183
1183
  const m = (e == null ? void 0 : e.maxHeight) || "50vh", y = (e == null ? void 0 : e.placeholder) || "> Type a command...";
1184
- return /* @__PURE__ */ T(ee, { children: [
1184
+ return /* @__PURE__ */ S(ce, { children: [
1185
1185
  /* @__PURE__ */ f(
1186
1186
  "div",
1187
1187
  {
@@ -1195,10 +1195,10 @@ const ae = ({
1195
1195
  onClick: n
1196
1196
  }
1197
1197
  ),
1198
- /* @__PURE__ */ T(
1198
+ /* @__PURE__ */ S(
1199
1199
  "div",
1200
1200
  {
1201
- ref: r,
1201
+ ref: a,
1202
1202
  className: e == null ? void 0 : e.className,
1203
1203
  style: {
1204
1204
  position: "fixed",
@@ -1215,18 +1215,18 @@ const ae = ({
1215
1215
  ...e == null ? void 0 : e.style
1216
1216
  },
1217
1217
  children: [
1218
- /* @__PURE__ */ T("div", { children: [
1218
+ /* @__PURE__ */ S("div", { children: [
1219
1219
  /* @__PURE__ */ f(
1220
- re,
1220
+ ue,
1221
1221
  {
1222
1222
  value: s,
1223
- onChange: l,
1223
+ onChange: i,
1224
1224
  placeholder: y,
1225
1225
  onClose: n,
1226
1226
  onEnter: c
1227
1227
  }
1228
1228
  ),
1229
- /* @__PURE__ */ T(
1229
+ /* @__PURE__ */ S(
1230
1230
  "div",
1231
1231
  {
1232
1232
  style: {
@@ -1239,11 +1239,11 @@ const ae = ({
1239
1239
  backgroundColor: o.colors.background
1240
1240
  },
1241
1241
  children: [
1242
- /* @__PURE__ */ T("span", { children: [
1242
+ /* @__PURE__ */ S("span", { children: [
1243
1243
  /* @__PURE__ */ f("kbd", { style: { padding: "2px 6px", backgroundColor: o.colors.backgroundSecondary, borderRadius: "3px", border: `1px solid ${o.colors.border}` }, children: "Enter" }),
1244
1244
  " Execute"
1245
1245
  ] }),
1246
- /* @__PURE__ */ T("span", { children: [
1246
+ /* @__PURE__ */ S("span", { children: [
1247
1247
  /* @__PURE__ */ f("kbd", { style: { padding: "2px 6px", backgroundColor: o.colors.backgroundSecondary, borderRadius: "3px", border: `1px solid ${o.colors.border}` }, children: "Esc" }),
1248
1248
  " Close"
1249
1249
  ] })
@@ -1251,11 +1251,11 @@ const ae = ({
1251
1251
  }
1252
1252
  )
1253
1253
  ] }),
1254
- d.length > 0 && /* @__PURE__ */ f(
1255
- ae,
1254
+ p.length > 0 && /* @__PURE__ */ f(
1255
+ fe,
1256
1256
  {
1257
- commands: d,
1258
- selectedIndex: p,
1257
+ commands: p,
1258
+ selectedIndex: d,
1259
1259
  onSelect: (u) => {
1260
1260
  t.executeCommand(u.id);
1261
1261
  },
@@ -1263,7 +1263,7 @@ const ae = ({
1263
1263
  maxResults: e == null ? void 0 : e.maxResults
1264
1264
  }
1265
1265
  ),
1266
- s && d.length === 0 && /* @__PURE__ */ T(
1266
+ s && p.length === 0 && /* @__PURE__ */ S(
1267
1267
  "div",
1268
1268
  {
1269
1269
  style: {
@@ -1286,8 +1286,8 @@ const ae = ({
1286
1286
  };
1287
1287
  class K {
1288
1288
  constructor() {
1289
- _(this, "commands", /* @__PURE__ */ new Map());
1290
- _(this, "listeners", /* @__PURE__ */ new Set());
1289
+ E(this, "commands", /* @__PURE__ */ new Map());
1290
+ E(this, "listeners", /* @__PURE__ */ new Set());
1291
1291
  }
1292
1292
  /**
1293
1293
  * Register one or more commands
@@ -1328,7 +1328,7 @@ class K {
1328
1328
  */
1329
1329
  getCommands(e) {
1330
1330
  const o = Array.from(this.commands.values());
1331
- return e ? o.filter((r) => r.isAvailable ? r.isAvailable(e) : !0) : o;
1331
+ return e ? o.filter((a) => a.isAvailable ? a.isAvailable(e) : !0) : o;
1332
1332
  }
1333
1333
  /**
1334
1334
  * Get a command by ID
@@ -1344,24 +1344,24 @@ class K {
1344
1344
  * @param context - Command context
1345
1345
  */
1346
1346
  async executeCommand(e, o) {
1347
- var a, n;
1348
- const r = this.commands.get(e);
1349
- if (!r) {
1347
+ var r, n;
1348
+ const a = this.commands.get(e);
1349
+ if (!a) {
1350
1350
  console.warn(`Command not found: ${e}`);
1351
1351
  return;
1352
1352
  }
1353
- if (r.isAvailable && !r.isAvailable(o)) {
1353
+ if (a.isAvailable && !a.isAvailable(o)) {
1354
1354
  console.warn(`Command not available: ${e}`);
1355
1355
  return;
1356
1356
  }
1357
1357
  try {
1358
- await r.execute(o), (a = o.events) == null || a.emit({
1358
+ await a.execute(o), (r = o.events) == null || r.emit({
1359
1359
  type: "command:executed",
1360
1360
  source: "command-palette",
1361
1361
  timestamp: Date.now(),
1362
1362
  payload: {
1363
- commandId: r.id,
1364
- commandLabel: r.label
1363
+ commandId: a.id,
1364
+ commandLabel: a.label
1365
1365
  }
1366
1366
  });
1367
1367
  } catch (s) {
@@ -1370,7 +1370,7 @@ class K {
1370
1370
  source: "command-palette",
1371
1371
  timestamp: Date.now(),
1372
1372
  payload: {
1373
- commandId: r.id,
1373
+ commandId: a.id,
1374
1374
  error: s instanceof Error ? s.message : String(s)
1375
1375
  }
1376
1376
  });
@@ -1383,17 +1383,17 @@ class K {
1383
1383
  * @returns Filtered and sorted commands
1384
1384
  */
1385
1385
  searchCommands(e, o) {
1386
- const r = this.getCommands(o);
1386
+ const a = this.getCommands(o);
1387
1387
  if (!e.trim())
1388
- return this.sortCommands(r);
1389
- const a = e.toLowerCase();
1390
- return r.map((s) => {
1391
- var d, p;
1392
- let l = 0;
1393
- return s.label.toLowerCase() === a ? l += 1e3 : s.label.toLowerCase().startsWith(a) ? l += 500 : s.label.toLowerCase().includes(a) && (l += 250), (d = s.description) != null && d.toLowerCase().includes(a) && (l += 100), s.keywords && s.keywords.some(
1394
- (c) => c.toLowerCase().includes(a)
1395
- ) && (l += 150), (p = s.category) != null && p.toLowerCase().includes(a) && (l += 50), l > 0 && s.priority && (l += s.priority), { command: s, score: l };
1396
- }).filter((s) => s.score > 0).sort((s, l) => l.score - s.score).map((s) => s.command);
1388
+ return this.sortCommands(a);
1389
+ const r = e.toLowerCase();
1390
+ return a.map((s) => {
1391
+ var p, d;
1392
+ let i = 0;
1393
+ return s.label.toLowerCase() === r ? i += 1e3 : s.label.toLowerCase().startsWith(r) ? i += 500 : s.label.toLowerCase().includes(r) && (i += 250), (p = s.description) != null && p.toLowerCase().includes(r) && (i += 100), s.keywords && s.keywords.some(
1394
+ (c) => c.toLowerCase().includes(r)
1395
+ ) && (i += 150), (d = s.category) != null && d.toLowerCase().includes(r) && (i += 50), i > 0 && s.priority && (i += s.priority), { command: s, score: i };
1396
+ }).filter((s) => s.score > 0).sort((s, i) => i.score - s.score).map((s) => s.command);
1397
1397
  }
1398
1398
  /**
1399
1399
  * Sort commands by priority and label
@@ -1401,12 +1401,12 @@ class K {
1401
1401
  * @returns Sorted commands
1402
1402
  */
1403
1403
  sortCommands(e) {
1404
- return e.sort((o, r) => {
1405
- const a = (r.priority || 0) - (o.priority || 0);
1406
- if (a !== 0)
1407
- return a;
1408
- const n = o.category || "", s = r.category || "", l = n.localeCompare(s);
1409
- return l !== 0 ? l : o.label.localeCompare(r.label);
1404
+ return e.sort((o, a) => {
1405
+ const r = (a.priority || 0) - (o.priority || 0);
1406
+ if (r !== 0)
1407
+ return r;
1408
+ const n = o.category || "", s = a.category || "", i = n.localeCompare(s);
1409
+ return i !== 0 ? i : o.label.localeCompare(a.label);
1410
1410
  });
1411
1411
  }
1412
1412
  /**
@@ -1438,24 +1438,24 @@ class K {
1438
1438
  this.listeners.forEach((e) => e());
1439
1439
  }
1440
1440
  }
1441
- let j = null;
1442
- function Me() {
1443
- return j || (j = new K()), j;
1441
+ let q = null;
1442
+ function Be() {
1443
+ return q || (q = new K()), q;
1444
1444
  }
1445
- function Ne() {
1446
- j = null;
1445
+ function Ke() {
1446
+ q = null;
1447
1447
  }
1448
- function qe({
1448
+ function Ve({
1449
1449
  context: t,
1450
1450
  commands: e = [],
1451
1451
  keyboard: o = { key: " ", altKey: !0 },
1452
- config: r = {},
1453
- registry: a
1452
+ config: a = {},
1453
+ registry: r
1454
1454
  }) {
1455
- const [n, s] = W(!1), [l, d] = W(""), [p, g] = W(0), [c, m] = W([]), y = M(
1456
- () => a || new K(),
1457
- [a]
1458
- ), u = M(
1455
+ const [n, s] = _(!1), [i, p] = _(""), [d, g] = _(0), [c, m] = _([]), y = O(
1456
+ () => r || new K(),
1457
+ [r]
1458
+ ), u = O(
1459
1459
  () => ({
1460
1460
  ...t,
1461
1461
  closeCommandPalette: () => s(!1)
@@ -1464,29 +1464,29 @@ function qe({
1464
1464
  );
1465
1465
  I(() => {
1466
1466
  let h = !0;
1467
- const S = y.subscribe(() => {
1467
+ const T = y.subscribe(() => {
1468
1468
  if (h) {
1469
- const E = y.getCommands(u);
1470
- m(E);
1469
+ const z = y.getCommands(u);
1470
+ m(z);
1471
1471
  }
1472
1472
  });
1473
1473
  if (e.length > 0)
1474
1474
  y.registerCommands(e);
1475
1475
  else {
1476
- const E = y.getCommands(u);
1477
- m(E);
1476
+ const z = y.getCommands(u);
1477
+ m(z);
1478
1478
  }
1479
1479
  return () => {
1480
- h = !1, S();
1480
+ h = !1, T();
1481
1481
  };
1482
1482
  }, [y]);
1483
- const i = M(() => (r.fuzzySearch === !1, y.searchCommands(l, u)), [l, y, u, r.fuzzySearch]);
1483
+ const l = O(() => (a.fuzzySearch === !1, y.searchCommands(i, u)), [i, y, u, a.fuzzySearch]);
1484
1484
  I(() => {
1485
1485
  g(0);
1486
- }, [i]);
1487
- const k = w(() => {
1486
+ }, [l]);
1487
+ const b = w(() => {
1488
1488
  var h;
1489
- s(!0), d(""), g(0), (h = t.events) == null || h.emit({
1489
+ s(!0), p(""), g(0), (h = t.events) == null || h.emit({
1490
1490
  type: "command-palette:opened",
1491
1491
  source: "command-palette",
1492
1492
  timestamp: Date.now(),
@@ -1494,33 +1494,33 @@ function qe({
1494
1494
  });
1495
1495
  }, [t.events]), P = w(() => {
1496
1496
  var h;
1497
- s(!1), d(""), g(0), (h = t.events) == null || h.emit({
1497
+ s(!1), p(""), g(0), (h = t.events) == null || h.emit({
1498
1498
  type: "command-palette:closed",
1499
1499
  source: "command-palette",
1500
1500
  timestamp: Date.now(),
1501
1501
  payload: {}
1502
1502
  });
1503
- }, [t.events]), L = w(() => {
1504
- n ? P() : k();
1505
- }, [n, k, P]), z = w(
1503
+ }, [t.events]), W = w(() => {
1504
+ n ? P() : b();
1505
+ }, [n, b, P]), A = w(
1506
1506
  async (h) => {
1507
1507
  await y.executeCommand(h, u), P();
1508
1508
  },
1509
1509
  [y, u, P]
1510
1510
  ), D = w(() => {
1511
1511
  g((h) => {
1512
- const S = r.maxResults || i.length, E = Math.min(i.length, S) - 1;
1513
- return h < E ? h + 1 : 0;
1512
+ const T = a.maxResults || l.length, z = Math.min(l.length, T) - 1;
1513
+ return h < z ? h + 1 : 0;
1514
1514
  });
1515
- }, [i.length, r.maxResults]), F = w(() => {
1515
+ }, [l.length, a.maxResults]), j = w(() => {
1516
1516
  g((h) => {
1517
- const S = r.maxResults || i.length, E = Math.min(i.length, S) - 1;
1518
- return h > 0 ? h - 1 : E;
1517
+ const T = a.maxResults || l.length, z = Math.min(l.length, T) - 1;
1518
+ return h > 0 ? h - 1 : z;
1519
1519
  });
1520
- }, [i.length, r.maxResults]), b = w(async () => {
1521
- const h = i[0];
1522
- h && await z(h.id);
1523
- }, [i, z]), C = w(
1520
+ }, [l.length, a.maxResults]), k = w(async () => {
1521
+ const h = l[0];
1522
+ h && await A(h.id);
1523
+ }, [l, A]), C = w(
1524
1524
  (h) => {
1525
1525
  y.registerCommands(h);
1526
1526
  },
@@ -1533,41 +1533,41 @@ function qe({
1533
1533
  ), x = w(
1534
1534
  (h) => {
1535
1535
  const {
1536
- key: S = " ",
1537
- altKey: E = !0,
1538
- ctrlKey: J = !1,
1539
- metaKey: H = !1,
1540
- shiftKey: X = !1
1541
- } = o, G = h.altKey === E && h.ctrlKey === J && h.metaKey === H && h.shiftKey === X;
1542
- if ((S === " " ? h.code === "Space" : h.key === S) && G) {
1543
- const O = h.target;
1544
- if (O.tagName === "INPUT" || O.tagName === "TEXTAREA" || O.isContentEditable)
1536
+ key: T = " ",
1537
+ altKey: z = !0,
1538
+ ctrlKey: te = !1,
1539
+ metaKey: oe = !1,
1540
+ shiftKey: ae = !1
1541
+ } = o, re = h.altKey === z && h.ctrlKey === te && h.metaKey === oe && h.shiftKey === ae;
1542
+ if ((T === " " ? h.code === "Space" : h.key === T) && re) {
1543
+ const F = h.target;
1544
+ if (F.tagName === "INPUT" || F.tagName === "TEXTAREA" || F.isContentEditable)
1545
1545
  return;
1546
- h.preventDefault(), L();
1546
+ h.preventDefault(), W();
1547
1547
  }
1548
1548
  },
1549
- [o, L]
1549
+ [o, W]
1550
1550
  );
1551
1551
  return I(() => (window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x)), [x]), {
1552
1552
  isOpen: n,
1553
- open: k,
1553
+ open: b,
1554
1554
  close: P,
1555
- toggle: L,
1556
- query: l,
1557
- setQuery: d,
1558
- filteredCommands: i,
1559
- executeCommand: z,
1560
- selectedIndex: p,
1555
+ toggle: W,
1556
+ query: i,
1557
+ setQuery: p,
1558
+ filteredCommands: l,
1559
+ executeCommand: A,
1560
+ selectedIndex: d,
1561
1561
  setSelectedIndex: g,
1562
1562
  selectNext: D,
1563
- selectPrevious: F,
1564
- executeSelected: b,
1563
+ selectPrevious: j,
1564
+ executeSelected: k,
1565
1565
  commands: c,
1566
1566
  registerCommands: C,
1567
1567
  unregisterCommands: v
1568
1568
  };
1569
1569
  }
1570
- const se = [
1570
+ const me = [
1571
1571
  {
1572
1572
  id: "panel.focus.left",
1573
1573
  label: "Focus Left Panel",
@@ -1721,10 +1721,144 @@ const se = [
1721
1721
  }
1722
1722
  }
1723
1723
  ];
1724
- function Be() {
1725
- return se;
1724
+ function Je() {
1725
+ return me;
1726
1726
  }
1727
- const ne = {
1727
+ const V = {
1728
+ name: "get_visible_panels",
1729
+ description: "Get the current visibility state of all panel slots (left, middle, right). Returns which panels are active in each slot and whether side panels are collapsed.",
1730
+ inputs: {
1731
+ type: "object",
1732
+ properties: {},
1733
+ required: []
1734
+ },
1735
+ outputs: {
1736
+ type: "object",
1737
+ properties: {
1738
+ left: {
1739
+ type: "object",
1740
+ properties: {
1741
+ panelId: {
1742
+ type: "string",
1743
+ description: "The ID of the panel in the left slot"
1744
+ },
1745
+ collapsed: {
1746
+ type: "boolean",
1747
+ description: "Whether the left panel is collapsed"
1748
+ },
1749
+ size: {
1750
+ type: "number",
1751
+ description: "Width percentage of the left panel"
1752
+ }
1753
+ }
1754
+ },
1755
+ middle: {
1756
+ type: "object",
1757
+ properties: {
1758
+ panelId: {
1759
+ type: "string",
1760
+ description: "The ID of the panel in the middle slot"
1761
+ },
1762
+ size: {
1763
+ type: "number",
1764
+ description: "Width percentage of the middle panel"
1765
+ }
1766
+ }
1767
+ },
1768
+ right: {
1769
+ type: "object",
1770
+ properties: {
1771
+ panelId: {
1772
+ type: "string",
1773
+ description: "The ID of the panel in the right slot"
1774
+ },
1775
+ collapsed: {
1776
+ type: "boolean",
1777
+ description: "Whether the right panel is collapsed"
1778
+ },
1779
+ size: {
1780
+ type: "number",
1781
+ description: "Width percentage of the right panel"
1782
+ }
1783
+ }
1784
+ },
1785
+ workspaceId: {
1786
+ type: "string",
1787
+ description: "The ID of the currently active workspace layout"
1788
+ }
1789
+ }
1790
+ },
1791
+ tags: ["panel", "layout", "visibility", "state", "query"],
1792
+ tool_call_template: {
1793
+ call_template_type: "panel_event",
1794
+ event_type: "panel:get-visibility"
1795
+ }
1796
+ }, J = {
1797
+ name: "get_panel_state",
1798
+ description: "Get the current state of a specific panel. Returns panel-specific state data if the panel supports state queries.",
1799
+ inputs: {
1800
+ type: "object",
1801
+ properties: {
1802
+ panelId: {
1803
+ type: "string",
1804
+ description: 'The ID of the panel to query state from (e.g., "file-tree", "terminal")'
1805
+ }
1806
+ },
1807
+ required: ["panelId"]
1808
+ },
1809
+ outputs: {
1810
+ type: "object",
1811
+ properties: {
1812
+ panelId: { type: "string", description: "The queried panel ID" },
1813
+ hasState: {
1814
+ type: "boolean",
1815
+ description: "Whether the panel supports state queries"
1816
+ },
1817
+ state: {
1818
+ type: "object",
1819
+ description: "The panel state (shape depends on the panel)"
1820
+ }
1821
+ }
1822
+ },
1823
+ tags: ["panel", "state", "query"],
1824
+ tool_call_template: {
1825
+ call_template_type: "panel_event",
1826
+ event_type: "panel:get-state"
1827
+ }
1828
+ }, H = {
1829
+ name: "list_panels_with_state",
1830
+ description: "Get a list of all panels that support state queries. Use this to discover which panels can be queried with get_panel_state.",
1831
+ inputs: {
1832
+ type: "object",
1833
+ properties: {},
1834
+ required: []
1835
+ },
1836
+ outputs: {
1837
+ type: "object",
1838
+ properties: {
1839
+ panels: {
1840
+ type: "array",
1841
+ items: {
1842
+ type: "object",
1843
+ properties: {
1844
+ panelId: { type: "string", description: "The panel ID" },
1845
+ name: { type: "string", description: "The panel display name" },
1846
+ description: {
1847
+ type: "string",
1848
+ description: "Description of the state this panel provides"
1849
+ }
1850
+ }
1851
+ },
1852
+ description: "List of panels that support state queries"
1853
+ }
1854
+ }
1855
+ },
1856
+ tags: ["panel", "state", "query", "discovery"],
1857
+ tool_call_template: {
1858
+ call_template_type: "panel_event",
1859
+ event_type: "panel:list-state-panels"
1860
+ }
1861
+ }, G = {
1728
1862
  name: "toggle_panel",
1729
1863
  description: "Collapse or expand a side panel to give more space to the main content area.",
1730
1864
  inputs: {
@@ -1751,7 +1885,7 @@ const ne = {
1751
1885
  call_template_type: "panel_event",
1752
1886
  event_type: "panel:toggle"
1753
1887
  }
1754
- }, le = {
1888
+ }, X = {
1755
1889
  name: "collapse_all_panels",
1756
1890
  description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
1757
1891
  inputs: {
@@ -1771,7 +1905,7 @@ const ne = {
1771
1905
  call_template_type: "panel_event",
1772
1906
  event_type: "panel:collapse-all"
1773
1907
  }
1774
- }, ie = {
1908
+ }, Q = {
1775
1909
  name: "expand_all_panels",
1776
1910
  description: "Expand both left and right panels to show all content. Restores the default layout.",
1777
1911
  inputs: {
@@ -1791,7 +1925,7 @@ const ne = {
1791
1925
  call_template_type: "panel_event",
1792
1926
  event_type: "panel:expand-all"
1793
1927
  }
1794
- }, ce = {
1928
+ }, Y = {
1795
1929
  name: "switch_panel",
1796
1930
  description: "Change which content is displayed in a panel slot (left, middle, or right).",
1797
1931
  inputs: {
@@ -1822,7 +1956,7 @@ const ne = {
1822
1956
  call_template_type: "panel_event",
1823
1957
  event_type: "panel:switch"
1824
1958
  }
1825
- }, de = {
1959
+ }, U = {
1826
1960
  name: "focus_panel",
1827
1961
  description: "Set focus to a specific panel slot for keyboard navigation.",
1828
1962
  inputs: {
@@ -1848,7 +1982,7 @@ const ne = {
1848
1982
  call_template_type: "panel_event",
1849
1983
  event_type: "panel:focus"
1850
1984
  }
1851
- }, pe = {
1985
+ }, Z = {
1852
1986
  name: "reset_layout",
1853
1987
  description: "Reset panel sizes to the default layout configuration.",
1854
1988
  inputs: {
@@ -1868,38 +2002,54 @@ const ne = {
1868
2002
  call_template_type: "panel_event",
1869
2003
  event_type: "panel:reset-layout"
1870
2004
  }
1871
- }, ue = [
1872
- ne,
1873
- le,
1874
- ie,
1875
- ce,
1876
- de,
1877
- pe
1878
- ], Ke = {
2005
+ }, ye = [
2006
+ // State query tools
2007
+ V,
2008
+ J,
2009
+ H,
2010
+ // Layout action tools
2011
+ G,
2012
+ X,
2013
+ Q,
2014
+ Y,
2015
+ U,
2016
+ Z
2017
+ ], He = [
2018
+ V,
2019
+ J,
2020
+ H
2021
+ ], Ge = [
2022
+ G,
2023
+ X,
2024
+ Q,
2025
+ Y,
2026
+ U,
2027
+ Z
2028
+ ], Xe = {
1879
2029
  id: "panel-layouts",
1880
2030
  name: "Panel Layouts",
1881
- description: "Generic panel layout operations",
1882
- tools: ue
2031
+ description: "Generic panel layout and state query operations",
2032
+ tools: ye
1883
2033
  };
1884
- function fe(t, e, o = {}) {
2034
+ function he(t, e, o = {}) {
1885
2035
  const {
1886
- categoryPrefix: r = "Panel Tools",
1887
- basePriority: a = 50,
2036
+ categoryPrefix: a = "Panel Tools",
2037
+ basePriority: r = 50,
1888
2038
  includePanelInCategory: n = !0
1889
- } = o, s = n ? `${r} > ${t.panelId}` : r, l = ye(t.inputs);
2039
+ } = o, s = n ? `${a} > ${t.panelId}` : a, i = we(t.inputs);
1890
2040
  return {
1891
2041
  id: `tool.${t.qualifiedName}`,
1892
- label: me(t.name),
2042
+ label: ge(t.name),
1893
2043
  description: t.description,
1894
2044
  category: s,
1895
2045
  keywords: [...t.tags, t.panelId, "tool"],
1896
- priority: a,
1897
- execute: async (d) => {
2046
+ priority: r,
2047
+ execute: async (p) => {
1898
2048
  var g;
1899
- if (l) {
2049
+ if (i) {
1900
2050
  console.warn(
1901
2051
  `Tool "${t.qualifiedName}" requires parameters. Invoke programmatically with: registry.invokeTool('${t.qualifiedName}', { ... })`
1902
- ), (g = d.events) == null || g.emit({
2052
+ ), (g = p.events) == null || g.emit({
1903
2053
  type: "tool:requires-parameters",
1904
2054
  source: "command-palette",
1905
2055
  timestamp: Date.now(),
@@ -1910,55 +2060,55 @@ function fe(t, e, o = {}) {
1910
2060
  });
1911
2061
  return;
1912
2062
  }
1913
- const p = await e.invokeTool(
2063
+ const d = await e.invokeTool(
1914
2064
  t.qualifiedName,
1915
2065
  {},
1916
2066
  "command-palette"
1917
2067
  );
1918
- p.success || console.error(`Tool invocation failed: ${p.error}`), d.closeCommandPalette();
2068
+ d.success || console.error(`Tool invocation failed: ${d.error}`), p.closeCommandPalette();
1919
2069
  }
1920
2070
  };
1921
2071
  }
1922
- function V(t, e = {}) {
1923
- return t.getAllTools().map((r) => fe(r, t, e));
2072
+ function ee(t, e = {}) {
2073
+ return t.getAllTools().map((a) => he(a, t, e));
1924
2074
  }
1925
- function Ve(t, e = {}) {
1926
- return () => V(t, e);
2075
+ function Qe(t, e = {}) {
2076
+ return () => ee(t, e);
1927
2077
  }
1928
- function me(t) {
2078
+ function ge(t) {
1929
2079
  return t.split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
1930
2080
  }
1931
- function ye(t) {
2081
+ function we(t) {
1932
2082
  return !(t.type !== "object" || !t.required || t.required.length === 0);
1933
2083
  }
1934
- function Je(t, e = {}) {
1935
- return V(t, e);
2084
+ function Ye(t, e = {}) {
2085
+ return ee(t, e);
1936
2086
  }
1937
- function He(t) {
2087
+ function Ue(t) {
1938
2088
  const { inputs: e } = t;
1939
2089
  if (e.type !== "object" || !e.properties)
1940
2090
  return [];
1941
- const o = new Set(e.required || []), r = [];
1942
- for (const [a, n] of Object.entries(e.properties))
1943
- r.push({
1944
- name: a,
2091
+ const o = new Set(e.required || []), a = [];
2092
+ for (const [r, n] of Object.entries(e.properties))
2093
+ a.push({
2094
+ name: r,
1945
2095
  type: n.type || "unknown",
1946
2096
  description: n.description || "",
1947
- required: o.has(a),
2097
+ required: o.has(r),
1948
2098
  default: n.default,
1949
2099
  enum: n.enum
1950
2100
  });
1951
- return r;
2101
+ return a;
1952
2102
  }
1953
- function he(t) {
2103
+ function be(t) {
1954
2104
  const e = {};
1955
2105
  if (t.inputs.properties)
1956
- for (const [o, r] of Object.entries(t.inputs.properties)) {
1957
- const a = r;
2106
+ for (const [o, a] of Object.entries(t.inputs.properties)) {
2107
+ const r = a;
1958
2108
  e[o] = {
1959
- type: a.type || "string",
1960
- description: a.description,
1961
- ...a.enum && { enum: a.enum }
2109
+ type: r.type || "string",
2110
+ description: r.description,
2111
+ ...r.enum && { enum: r.enum }
1962
2112
  };
1963
2113
  }
1964
2114
  return {
@@ -1971,12 +2121,12 @@ function he(t) {
1971
2121
  }
1972
2122
  };
1973
2123
  }
1974
- function Xe(t) {
2124
+ function Ze(t) {
1975
2125
  return {
1976
- functionDeclarations: t.map(he)
2126
+ functionDeclarations: t.map(be)
1977
2127
  };
1978
2128
  }
1979
- function ge(t) {
2129
+ function ke(t) {
1980
2130
  return {
1981
2131
  type: "function",
1982
2132
  function: {
@@ -1986,54 +2136,54 @@ function ge(t) {
1986
2136
  }
1987
2137
  };
1988
2138
  }
1989
- function Ge(t) {
1990
- return t.map(ge);
2139
+ function et(t) {
2140
+ return t.map(ke);
1991
2141
  }
1992
- function we(t) {
2142
+ function xe(t) {
1993
2143
  return {
1994
2144
  name: t.name,
1995
2145
  description: t.description,
1996
2146
  input_schema: t.inputs
1997
2147
  };
1998
2148
  }
1999
- function Ye(t) {
2000
- return t.map(we);
2149
+ function tt(t) {
2150
+ return t.map(xe);
2001
2151
  }
2002
- function ke(t) {
2152
+ function ve(t) {
2003
2153
  return {
2004
2154
  name: t.name,
2005
2155
  description: t.description,
2006
2156
  parameters: t.inputs
2007
2157
  };
2008
2158
  }
2009
- function Qe(t) {
2010
- return t.map(ke);
2159
+ function ot(t) {
2160
+ return t.map(ve);
2011
2161
  }
2012
- function Ue(t, e = {}) {
2162
+ function at(t, e = {}) {
2013
2163
  const {
2014
2164
  header: o = "You have access to the following tools:",
2015
- includeParameters: r = !0
2016
- } = e, a = t.map((n) => {
2165
+ includeParameters: a = !0
2166
+ } = e, r = t.map((n) => {
2017
2167
  let s = `- ${n.name}: ${n.description}`;
2018
- if (r && n.inputs.properties) {
2019
- const l = Object.entries(n.inputs.properties).map(([d, p]) => {
2168
+ if (a && n.inputs.properties) {
2169
+ const i = Object.entries(n.inputs.properties).map(([p, d]) => {
2020
2170
  var m;
2021
- const g = p, c = (m = n.inputs.required) != null && m.includes(d) ? " (required)" : "";
2022
- return ` - ${d}: ${g.description || g.type}${c}`;
2171
+ const g = d, c = (m = n.inputs.required) != null && m.includes(p) ? " (required)" : "";
2172
+ return ` - ${p}: ${g.description || g.type}${c}`;
2023
2173
  }).join(`
2024
2174
  `);
2025
- l && (s += `
2026
- ${l}`);
2175
+ i && (s += `
2176
+ ${i}`);
2027
2177
  }
2028
2178
  return s;
2029
2179
  });
2030
2180
  return `${o}
2031
2181
 
2032
- ${a.join(`
2182
+ ${r.join(`
2033
2183
 
2034
2184
  `)}`;
2035
2185
  }
2036
- const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2186
+ const Ce = ({ size: t = 18 }) => /* @__PURE__ */ S(
2037
2187
  "svg",
2038
2188
  {
2039
2189
  width: t,
@@ -2049,7 +2199,7 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2049
2199
  /* @__PURE__ */ f("path", { d: "M9 3v18" })
2050
2200
  ]
2051
2201
  }
2052
- ), xe = ({ size: t = 18 }) => /* @__PURE__ */ T(
2202
+ ), Te = ({ size: t = 18 }) => /* @__PURE__ */ S(
2053
2203
  "svg",
2054
2204
  {
2055
2205
  width: t,
@@ -2066,7 +2216,7 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2066
2216
  /* @__PURE__ */ f("path", { d: "m16 15-3-3 3-3" })
2067
2217
  ]
2068
2218
  }
2069
- ), ve = ({ size: t = 18 }) => /* @__PURE__ */ T(
2219
+ ), Se = ({ size: t = 18 }) => /* @__PURE__ */ S(
2070
2220
  "svg",
2071
2221
  {
2072
2222
  width: t,
@@ -2082,7 +2232,7 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2082
2232
  /* @__PURE__ */ f("path", { d: "M15 3v18" })
2083
2233
  ]
2084
2234
  }
2085
- ), Ce = ({ size: t = 18 }) => /* @__PURE__ */ T(
2235
+ ), Pe = ({ size: t = 18 }) => /* @__PURE__ */ S(
2086
2236
  "svg",
2087
2237
  {
2088
2238
  width: t,
@@ -2099,27 +2249,27 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2099
2249
  /* @__PURE__ */ f("path", { d: "m8 9 3 3-3 3" })
2100
2250
  ]
2101
2251
  }
2102
- ), N = ({
2252
+ ), M = ({
2103
2253
  isCollapsed: t,
2104
2254
  onToggle: e,
2105
2255
  side: o = "left",
2106
- iconSize: r = 18,
2107
- style: a,
2256
+ iconSize: a = 18,
2257
+ style: r,
2108
2258
  shortcutHint: n = "Cmd/Ctrl+B",
2109
2259
  title: s,
2110
- className: l
2260
+ className: i
2111
2261
  }) => {
2112
- const { theme: d } = $(), p = () => o === "right" ? t ? /* @__PURE__ */ f(ve, { size: r }) : /* @__PURE__ */ f(Ce, { size: r }) : t ? /* @__PURE__ */ f(be, { size: r }) : /* @__PURE__ */ f(xe, { size: r });
2262
+ const { theme: p } = $(), d = () => o === "right" ? t ? /* @__PURE__ */ f(Se, { size: a }) : /* @__PURE__ */ f(Pe, { size: a }) : t ? /* @__PURE__ */ f(Ce, { size: a }) : /* @__PURE__ */ f(Te, { size: a });
2113
2263
  return /* @__PURE__ */ f(
2114
2264
  "button",
2115
2265
  {
2116
2266
  onClick: e,
2117
2267
  title: s ?? `${t ? "Show" : "Hide"} ${o === "right" ? "Right Panel" : "Sidebar"}${n ? ` (${n})` : ""}`,
2118
- className: l,
2268
+ className: i,
2119
2269
  style: {
2120
2270
  background: "transparent",
2121
2271
  border: "none",
2122
- color: t ? d.colors.textSecondary : d.colors.primary,
2272
+ color: t ? p.colors.textSecondary : p.colors.primary,
2123
2273
  cursor: "pointer",
2124
2274
  padding: "6px",
2125
2275
  borderRadius: "4px",
@@ -2129,18 +2279,18 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2129
2279
  transition: "all 0.2s",
2130
2280
  width: "32px",
2131
2281
  height: "32px",
2132
- ...a
2282
+ ...r
2133
2283
  },
2134
2284
  onMouseEnter: (c) => {
2135
- c.currentTarget.style.backgroundColor = d.colors.backgroundTertiary, c.currentTarget.style.color = d.colors.primary;
2285
+ c.currentTarget.style.backgroundColor = p.colors.backgroundTertiary, c.currentTarget.style.color = p.colors.primary;
2136
2286
  },
2137
2287
  onMouseLeave: (c) => {
2138
- c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = t ? d.colors.textSecondary : d.colors.primary;
2288
+ c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = t ? p.colors.textSecondary : p.colors.primary;
2139
2289
  },
2140
- children: p()
2290
+ children: d()
2141
2291
  }
2142
2292
  );
2143
- }, Se = ({ size: t = 14 }) => /* @__PURE__ */ T(
2293
+ }, Ie = ({ size: t = 14 }) => /* @__PURE__ */ S(
2144
2294
  "svg",
2145
2295
  {
2146
2296
  width: t,
@@ -2158,7 +2308,7 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2158
2308
  /* @__PURE__ */ f("path", { d: "M20 17H4" })
2159
2309
  ]
2160
2310
  }
2161
- ), Te = ({ size: t = 14 }) => /* @__PURE__ */ T(
2311
+ ), Re = ({ size: t = 14 }) => /* @__PURE__ */ S(
2162
2312
  "svg",
2163
2313
  {
2164
2314
  width: t,
@@ -2176,20 +2326,20 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2176
2326
  /* @__PURE__ */ f("path", { d: "M4 17h16" })
2177
2327
  ]
2178
2328
  }
2179
- ), q = ({
2329
+ ), N = ({
2180
2330
  onSwitch: t,
2181
2331
  variant: e = "left-middle",
2182
2332
  iconSize: o = 14,
2183
- style: r,
2184
- title: a,
2333
+ style: a,
2334
+ title: r,
2185
2335
  className: n
2186
2336
  }) => {
2187
- const { theme: s } = $(), l = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", d = e === "left-middle" ? Se : Te;
2337
+ const { theme: s } = $(), i = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", p = e === "left-middle" ? Ie : Re;
2188
2338
  return /* @__PURE__ */ f(
2189
2339
  "button",
2190
2340
  {
2191
2341
  onClick: t,
2192
- title: a ?? l(),
2342
+ title: r ?? i(),
2193
2343
  className: n,
2194
2344
  style: {
2195
2345
  background: "transparent",
@@ -2204,18 +2354,18 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2204
2354
  transition: "all 0.2s",
2205
2355
  width: "32px",
2206
2356
  height: "32px",
2207
- ...r
2357
+ ...a
2208
2358
  },
2209
- onMouseEnter: (p) => {
2210
- p.currentTarget.style.backgroundColor = s.colors.backgroundTertiary, p.currentTarget.style.color = s.colors.text;
2359
+ onMouseEnter: (d) => {
2360
+ d.currentTarget.style.backgroundColor = s.colors.backgroundTertiary, d.currentTarget.style.color = s.colors.text;
2211
2361
  },
2212
- onMouseLeave: (p) => {
2213
- p.currentTarget.style.backgroundColor = "transparent", p.currentTarget.style.color = s.colors.textSecondary;
2362
+ onMouseLeave: (d) => {
2363
+ d.currentTarget.style.backgroundColor = "transparent", d.currentTarget.style.color = s.colors.textSecondary;
2214
2364
  },
2215
- children: /* @__PURE__ */ f(d, { size: o })
2365
+ children: /* @__PURE__ */ f(p, { size: o })
2216
2366
  }
2217
2367
  );
2218
- }, Pe = ({ size: t = 14 }) => /* @__PURE__ */ T(
2368
+ }, We = ({ size: t = 14 }) => /* @__PURE__ */ S(
2219
2369
  "svg",
2220
2370
  {
2221
2371
  width: t,
@@ -2232,20 +2382,20 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2232
2382
  /* @__PURE__ */ f("path", { d: "M9 21V9" })
2233
2383
  ]
2234
2384
  }
2235
- ), Ie = ({
2385
+ ), _e = ({
2236
2386
  onConfigure: t,
2237
2387
  iconSize: e = 14,
2238
2388
  style: o,
2239
- title: r = "Configure panel layout",
2240
- className: a
2389
+ title: a = "Configure panel layout",
2390
+ className: r
2241
2391
  }) => {
2242
2392
  const { theme: n } = $();
2243
2393
  return /* @__PURE__ */ f(
2244
2394
  "button",
2245
2395
  {
2246
2396
  onClick: t,
2247
- title: r,
2248
- className: a,
2397
+ title: a,
2398
+ className: r,
2249
2399
  style: {
2250
2400
  background: "transparent",
2251
2401
  border: "none",
@@ -2267,32 +2417,32 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2267
2417
  onMouseLeave: (s) => {
2268
2418
  s.currentTarget.style.backgroundColor = "transparent", s.currentTarget.style.color = n.colors.textSecondary;
2269
2419
  },
2270
- children: /* @__PURE__ */ f(Pe, { size: e })
2420
+ children: /* @__PURE__ */ f(We, { size: e })
2271
2421
  }
2272
2422
  );
2273
- }, Ze = ({
2423
+ }, rt = ({
2274
2424
  leftSidebarCollapsed: t = !1,
2275
2425
  onToggleLeftSidebar: e,
2276
2426
  showLeftSidebarControl: o = !1,
2277
- rightSidebarCollapsed: r = !1,
2278
- onToggleRightSidebar: a,
2427
+ rightSidebarCollapsed: a = !1,
2428
+ onToggleRightSidebar: r,
2279
2429
  showRightSidebarControl: n = !1,
2280
2430
  onSwitchLeftMiddlePanels: s,
2281
- showSwitchLeftMiddle: l = !1,
2282
- onSwitchRightMiddlePanels: d,
2283
- showSwitchRightMiddle: p = !1,
2431
+ showSwitchLeftMiddle: i = !1,
2432
+ onSwitchRightMiddlePanels: p,
2433
+ showSwitchRightMiddle: d = !1,
2284
2434
  onConfigurePanels: g,
2285
2435
  showConfigureButton: c = !1,
2286
2436
  gap: m = 4,
2287
2437
  style: y,
2288
2438
  className: u,
2289
- iconSize: i,
2290
- leftCollapseButtonProps: k,
2439
+ iconSize: l,
2440
+ leftCollapseButtonProps: b,
2291
2441
  rightCollapseButtonProps: P,
2292
- leftMiddleSwitchButtonProps: L,
2293
- rightMiddleSwitchButtonProps: z,
2442
+ leftMiddleSwitchButtonProps: W,
2443
+ rightMiddleSwitchButtonProps: A,
2294
2444
  configureButtonProps: D
2295
- }) => o && e || l && s || c && g || p && d || n && a ? /* @__PURE__ */ T(
2445
+ }) => o && e || i && s || c && g || d && p || n && r ? /* @__PURE__ */ S(
2296
2446
  "div",
2297
2447
  {
2298
2448
  className: u,
@@ -2304,48 +2454,48 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2304
2454
  },
2305
2455
  children: [
2306
2456
  o && e && /* @__PURE__ */ f(
2307
- N,
2457
+ M,
2308
2458
  {
2309
2459
  isCollapsed: t,
2310
2460
  onToggle: e,
2311
2461
  side: "left",
2312
- iconSize: i ?? 18,
2313
- ...k
2462
+ iconSize: l ?? 18,
2463
+ ...b
2314
2464
  }
2315
2465
  ),
2316
- l && s && /* @__PURE__ */ f(
2317
- q,
2466
+ i && s && /* @__PURE__ */ f(
2467
+ N,
2318
2468
  {
2319
2469
  onSwitch: s,
2320
2470
  variant: "left-middle",
2321
- iconSize: i ?? 14,
2322
- ...L
2471
+ iconSize: l ?? 14,
2472
+ ...W
2323
2473
  }
2324
2474
  ),
2325
2475
  c && g && /* @__PURE__ */ f(
2326
- Ie,
2476
+ _e,
2327
2477
  {
2328
2478
  onConfigure: g,
2329
- iconSize: i ?? 14,
2479
+ iconSize: l ?? 14,
2330
2480
  ...D
2331
2481
  }
2332
2482
  ),
2333
- p && d && /* @__PURE__ */ f(
2334
- q,
2483
+ d && p && /* @__PURE__ */ f(
2484
+ N,
2335
2485
  {
2336
- onSwitch: d,
2486
+ onSwitch: p,
2337
2487
  variant: "right-middle",
2338
- iconSize: i ?? 14,
2339
- ...z
2488
+ iconSize: l ?? 14,
2489
+ ...A
2340
2490
  }
2341
2491
  ),
2342
- n && a && /* @__PURE__ */ f(
2343
- N,
2492
+ n && r && /* @__PURE__ */ f(
2493
+ M,
2344
2494
  {
2345
- isCollapsed: r,
2346
- onToggle: a,
2495
+ isCollapsed: a,
2496
+ onToggle: r,
2347
2497
  side: "right",
2348
- iconSize: i ?? 18,
2498
+ iconSize: l ?? 18,
2349
2499
  ...P
2350
2500
  }
2351
2501
  )
@@ -2353,54 +2503,59 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
2353
2503
  }
2354
2504
  ) : null;
2355
2505
  export {
2356
- re as CommandInput,
2506
+ ue as CommandInput,
2357
2507
  B as CommandItem,
2358
- ae as CommandList,
2359
- Oe as CommandPalette,
2508
+ fe as CommandList,
2509
+ Ne as CommandPalette,
2360
2510
  K as CommandRegistryService,
2361
- ot as EditableConfigurablePanelLayout,
2362
- je as FocusIndicator,
2363
- te as LocalStoragePersistenceAdapter,
2364
- oe as LocalStorageWorkspaceAdapter,
2365
- N as PanelCollapseButton,
2366
- Ie as PanelConfigureButton,
2367
- Ze as PanelControls,
2368
- q as PanelSwitchButton,
2369
- rt as ResponsiveConfigurablePanelLayout,
2511
+ it as EditableConfigurablePanelLayout,
2512
+ Me as FocusIndicator,
2513
+ pe as LocalStoragePersistenceAdapter,
2514
+ de as LocalStorageWorkspaceAdapter,
2515
+ M as PanelCollapseButton,
2516
+ _e as PanelConfigureButton,
2517
+ rt as PanelControls,
2518
+ N as PanelSwitchButton,
2519
+ lt as ResponsiveConfigurablePanelLayout,
2370
2520
  R as WorkspaceLayoutService,
2371
- le as collapseAllPanelsTool,
2372
- Ve as createToolCommandsProvider,
2373
- ie as expandAllPanelsTool,
2374
- de as focusPanelTool,
2375
- Ue as generateToolsSystemPrompt,
2376
- Me as getGlobalCommandRegistry,
2377
- Be as getPanelCommands,
2378
- He as getToolParameterInfo,
2379
- ue as layoutTools,
2380
- Ke as layoutToolsMetadata,
2381
- at as mapThemeToPanelVars,
2382
- st as mapThemeToTabVars,
2383
- se as panelCommands,
2384
- Ne as resetGlobalCommandRegistry,
2385
- pe as resetLayoutTool,
2386
- ce as switchPanelTool,
2387
- ne as togglePanelTool,
2388
- ke as toolToAIFunction,
2389
- we as toolToAnthropicFormat,
2390
- fe as toolToCommand,
2391
- he as toolToGeminiFunction,
2392
- ge as toolToOpenAIFunction,
2393
- Qe as toolsToAIFunctions,
2394
- Ye as toolsToAnthropicFormat,
2395
- V as toolsToCommands,
2396
- Xe as toolsToGeminiFormat,
2397
- Ge as toolsToOpenAIFormat,
2398
- qe as useCommandPalette,
2399
- _e as usePanelFocus,
2400
- Fe as usePanelFocusListener,
2401
- $e as usePanelKeyboardShortcuts,
2402
- Ee as usePanelPersistence,
2403
- Je as useToolCommands,
2404
- De as useWorkspace
2521
+ X as collapseAllPanelsTool,
2522
+ Qe as createToolCommandsProvider,
2523
+ Q as expandAllPanelsTool,
2524
+ U as focusPanelTool,
2525
+ at as generateToolsSystemPrompt,
2526
+ Be as getGlobalCommandRegistry,
2527
+ Je as getPanelCommands,
2528
+ J as getPanelStateTool,
2529
+ Ue as getToolParameterInfo,
2530
+ V as getVisiblePanelsTool,
2531
+ Ge as layoutActionTools,
2532
+ ye as layoutTools,
2533
+ Xe as layoutToolsMetadata,
2534
+ H as listPanelsWithStateTool,
2535
+ ct as mapThemeToPanelVars,
2536
+ pt as mapThemeToTabVars,
2537
+ me as panelCommands,
2538
+ Ke as resetGlobalCommandRegistry,
2539
+ Z as resetLayoutTool,
2540
+ He as stateQueryTools,
2541
+ Y as switchPanelTool,
2542
+ G as togglePanelTool,
2543
+ ve as toolToAIFunction,
2544
+ xe as toolToAnthropicFormat,
2545
+ he as toolToCommand,
2546
+ be as toolToGeminiFunction,
2547
+ ke as toolToOpenAIFunction,
2548
+ ot as toolsToAIFunctions,
2549
+ tt as toolsToAnthropicFormat,
2550
+ ee as toolsToCommands,
2551
+ Ze as toolsToGeminiFormat,
2552
+ et as toolsToOpenAIFormat,
2553
+ Ve as useCommandPalette,
2554
+ qe as usePanelFocus,
2555
+ Oe as usePanelFocusListener,
2556
+ Fe as usePanelKeyboardShortcuts,
2557
+ $e as usePanelPersistence,
2558
+ Ye as useToolCommands,
2559
+ je as useWorkspace
2405
2560
  };
2406
2561
  //# sourceMappingURL=index.esm.js.map