@pstdio/workbench 0.11.4 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,49 @@
1
- import { jsxs as ge, jsx as N } from "react/jsx-runtime";
2
- import { useRef as v, useState as we, useEffect as K, createElement as D } from "react";
3
- import { host as et } from "rimless";
4
- import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as tt, WEBVIEW_HOST_CAPABILITY_VERSION as ce, WEBVIEW_HOST_CAPABILITIES as nt, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as ot, resourceKey as V, isLocalizedString as st, matchesResourceWhen as rt } from "@pstdio/sdk/extensions";
5
- import { b as it, W as _, a as at } from "./workspaces-B9HZHIbz.js";
6
- import { renderBadgeListDisplay as dt } from "@pstdio/ui/kanban-renderer";
7
- import { w as ct } from "./workbench-menu-paths-B_QJzcNU.js";
8
- const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", mt = new Set(nt), ut = new Set(ot), Te = (e) => mt.has(e), Pe = (e) => ut.has(e), pt = (e) => {
9
- const [t = "", n] = e.split("@"), o = t.indexOf(":"), r = o === -1 ? t : t.slice(0, o), s = o === -1 ? void 0 : t.slice(o + 1), i = n === void 0 ? ce : Number(n);
1
+ import { jsxs as ue, jsx as N } from "react/jsx-runtime";
2
+ import { useRef as k, useState as be, useEffect as O, createElement as V } from "react";
3
+ import { host as Ge } from "rimless";
4
+ import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as Qe, WEBVIEW_HOST_CAPABILITY_VERSION as re, WEBVIEW_HOST_CAPABILITIES as Xe, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as Ye, isNavigationTarget as ie, qualifyNavigationTarget as Je, resourceKey as M, isLocalizedString as Ze, matchesResourceWhen as et } from "@pstdio/sdk/extensions";
5
+ import { b as tt, W as K, a as nt } from "./workspaces-DdUPyzkL.js";
6
+ import { renderBadgeListDisplay as ot } from "@pstdio/ui/kanban-renderer";
7
+ import { w as st } from "./workbench-menu-paths-B_QJzcNU.js";
8
+ const rt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", it = new Set(Xe), at = new Set(Ye), Re = (e) => it.has(e), Ee = (e) => at.has(e), dt = (e) => {
9
+ const [t = "", n] = e.split("@"), o = t.indexOf(":"), r = o === -1 ? t : t.slice(0, o), s = o === -1 ? void 0 : t.slice(o + 1), i = n === void 0 ? re : Number(n);
10
10
  return {
11
11
  capability: e,
12
12
  name: r,
13
13
  scope: s,
14
14
  version: i
15
15
  };
16
- }, bt = (e) => Pe(e.name) ? !!e.scope : e.scope === void 0, L = (e) => ({
16
+ }, ct = (e) => Ee(e.name) ? !!e.scope : e.scope === void 0, F = (e) => ({
17
17
  capability: e,
18
18
  code: "unsupported_webview_capability",
19
19
  message: `Unsupported webview capability: ${e}`,
20
20
  severity: "error"
21
- }), ft = (e, t, n) => ({
21
+ }), lt = (e, t, n) => ({
22
22
  capability: e,
23
23
  code: "unsupported_webview_capability_version",
24
- message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${ce.toString()})`,
24
+ message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${re.toString()})`,
25
25
  severity: "error"
26
- }), Ie = (e) => ({
26
+ }), pe = (e) => ({
27
27
  capability: e,
28
28
  code: "undeclared_webview_capability",
29
29
  message: `Webview did not declare host capability: ${e}`,
30
30
  severity: "error"
31
- }), ht = (e, t = {}) => {
31
+ }), mt = (e, t = {}) => {
32
32
  const n = [], o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
33
- for (const s of tt)
33
+ for (const s of Qe)
34
34
  t[s] && o.add(s);
35
35
  for (const s of e ?? []) {
36
- const i = pt(s);
37
- if (!Te(i.name) || !bt(i)) {
38
- n.push(L(s));
36
+ const i = dt(s);
37
+ if (!Re(i.name) || !ct(i)) {
38
+ n.push(F(s));
39
39
  continue;
40
40
  }
41
- if (i.version !== ce) {
42
- n.push(ft(s, i.name, i.version));
41
+ if (i.version !== re) {
42
+ n.push(lt(s, i.name, i.version));
43
43
  continue;
44
44
  }
45
45
  if (!t[i.name]) {
46
- n.push(L(s));
46
+ n.push(F(s));
47
47
  continue;
48
48
  }
49
49
  if (i.scope === void 0) {
@@ -58,34 +58,34 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
58
58
  allowedScopes: r,
59
59
  diagnostics: n
60
60
  };
61
- }, gt = (e) => {
61
+ }, ut = (e) => {
62
62
  const t = e.params;
63
63
  return typeof t?.mount == "string" && t.mount.length > 0 ? t.mount : void 0;
64
- }, wt = (e) => {
64
+ }, bt = (e) => {
65
65
  const {
66
66
  allowed: t,
67
67
  allowedScopes: n,
68
68
  diagnostics: o
69
- } = ht(e.declaredCapabilities, e.capabilities), r = (i) => {
69
+ } = mt(e.declaredCapabilities, e.capabilities), r = (i) => {
70
70
  e.onDiagnostic?.(i);
71
71
  }, s = (i) => (r(i), new Error(i.message));
72
72
  return {
73
73
  diagnostics: o,
74
74
  async call(i) {
75
- if (!Te(i.method)) throw s(L(i.method));
76
- if (Pe(i.method)) {
77
- const d = gt(i);
78
- if (!d) throw s(L(i.method));
75
+ if (!Re(i.method)) throw s(F(i.method));
76
+ if (Ee(i.method)) {
77
+ const d = ut(i);
78
+ if (!d) throw s(F(i.method));
79
79
  if (!n.get(i.method)?.has(d))
80
- throw s(Ie(`${i.method}:${d}`));
80
+ throw s(pe(`${i.method}:${d}`));
81
81
  } else if (!t.has(i.method))
82
- throw s(Ie(i.method));
82
+ throw s(pe(i.method));
83
83
  const a = e.capabilities[i.method];
84
- if (!a) throw s(L(i.method));
84
+ if (!a) throw s(F(i.method));
85
85
  return await a(i.params);
86
86
  }
87
87
  };
88
- }, It = (e) => typeof e == "object" && e !== null, ye = (e) => {
88
+ }, pt = (e) => typeof e == "object" && e !== null, fe = (e) => {
89
89
  try {
90
90
  const t = JSON.stringify(e);
91
91
  if (typeof t == "string" && t.length > 0) return t;
@@ -96,7 +96,7 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
96
96
  } catch {
97
97
  return "Unknown error";
98
98
  }
99
- }, yt = (e) => {
99
+ }, ft = (e) => {
100
100
  if (e instanceof Error) return {
101
101
  message: e.message,
102
102
  stack: e.stack
@@ -104,7 +104,7 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
104
104
  if (typeof e == "string") return {
105
105
  message: e
106
106
  };
107
- if (It(e)) {
107
+ if (pt(e)) {
108
108
  const t = typeof e.message == "string" ? e.message : null, n = typeof e.stack == "string" ? e.stack : void 0;
109
109
  return t ? n ? {
110
110
  message: t,
@@ -112,15 +112,15 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
112
112
  } : {
113
113
  message: t
114
114
  } : {
115
- message: ye(e)
115
+ message: fe(e)
116
116
  };
117
117
  }
118
118
  return e == null ? {
119
119
  message: "Unknown error"
120
120
  } : {
121
- message: ye(e)
121
+ message: fe(e)
122
122
  };
123
- }, oe = () => {
123
+ }, ee = () => {
124
124
  if (typeof document > "u") return {};
125
125
  const e = getComputedStyle(document.documentElement), t = {};
126
126
  for (let n = 0; n < e.length; n += 1) {
@@ -128,26 +128,26 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
128
128
  o.startsWith("--chakra-") && (t[o] = e.getPropertyValue(o).trim());
129
129
  }
130
130
  return t;
131
- }, se = (e) => {
131
+ }, te = (e) => {
132
132
  if (typeof document > "u") return e;
133
133
  const t = document.documentElement.getAttribute("data-theme");
134
134
  if (t === "dark" || t === "light") return t;
135
135
  const n = document.documentElement.getAttribute("data-color-mode");
136
136
  return n === "dark" || n === "light" ? n : e;
137
- }, vt = {
137
+ }, ht = {
138
138
  border: 0,
139
139
  display: "block",
140
140
  flex: "1 1 0%",
141
141
  height: "100%",
142
142
  minHeight: 0,
143
143
  width: "100%"
144
- }, kt = {
144
+ }, wt = {
145
145
  display: "flex",
146
146
  height: "100%",
147
147
  minHeight: 0,
148
148
  position: "relative",
149
149
  width: "100%"
150
- }, xt = {
150
+ }, gt = {
151
151
  alignItems: "center",
152
152
  background: "rgba(255, 255, 255, 0.92)",
153
153
  color: "#7a1f12",
@@ -158,7 +158,7 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
158
158
  position: "absolute",
159
159
  textAlign: "center",
160
160
  zIndex: 1
161
- }, Rt = "allow-scripts allow-forms allow-popups", Et = (e) => {
161
+ }, It = "allow-scripts allow-forms allow-popups", vt = (e) => {
162
162
  const {
163
163
  view: t,
164
164
  props: n,
@@ -169,105 +169,105 @@ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
169
169
  onError: a,
170
170
  onDiagnostics: d,
171
171
  title: m
172
- } = e, l = v(null), c = v(null), p = v(null), u = v(!1), g = v(null), x = v(n), A = v(o), T = v(r), W = v(s), z = v(t.webview.capabilities), te = v(i), j = v(a), f = v(d), [k, w] = we(null), [P, Q] = we(0);
173
- return x.current = n, A.current = o, T.current = r, W.current = s, z.current = t.webview.capabilities, te.current = i, j.current = a, f.current = d, K(() => {
174
- const h = l.current;
172
+ } = e, c = k(null), l = k(null), b = k(null), u = k(!1), w = k(null), R = k(n), E = k(o), T = k(r), H = k(s), U = k(t.webview.capabilities), J = k(i), j = k(a), f = k(d), [x, g] = be(null), [P, q] = be(0);
173
+ return R.current = n, E.current = o, T.current = r, H.current = s, U.current = t.webview.capabilities, J.current = i, j.current = a, f.current = d, O(() => {
174
+ const h = c.current;
175
175
  if (!h) return;
176
- const C = () => {
177
- c.current === h ? Q((y) => y + 1) : c.current = h;
176
+ const A = () => {
177
+ l.current === h ? q((y) => y + 1) : l.current = h;
178
178
  };
179
- h.addEventListener("load", C);
180
- const S = () => h.removeEventListener("load", C), F = `${P}
179
+ h.addEventListener("load", A);
180
+ const C = () => h.removeEventListener("load", A), D = `${P}
181
181
  ${t.webview.runtimeUrl}
182
182
  ${t.webview.moduleUrl}`;
183
- if (g.current === F) return S;
184
- g.current = F;
185
- const Ye = t.webview.styles, Xe = t.webview.moduleUrl, fe = (y) => {
183
+ if (w.current === D) return C;
184
+ w.current = D;
185
+ const _e = t.webview.styles, Ue = t.webview.moduleUrl, le = (y) => {
186
186
  y.length > 0 && f.current?.(y);
187
- }, he = () => wt({
187
+ }, me = () => bt({
188
188
  capabilities: T.current ?? {},
189
- declaredCapabilities: z.current,
190
- onDiagnostic: (y) => fe([y])
189
+ declaredCapabilities: U.current,
190
+ onDiagnostic: (y) => le([y])
191
191
  });
192
- fe(he().diagnostics);
193
- const Je = {
192
+ le(me().diagnostics);
193
+ const qe = {
194
194
  ready: () => {
195
195
  },
196
196
  runtimeError: (y) => {
197
- w(y.message), j.current?.(y);
197
+ g(y.message), j.current?.(y);
198
198
  },
199
- call: async (y) => await he().call(y)
199
+ call: async (y) => await me().call(y)
200
200
  };
201
201
  return (() => {
202
- u.current = !1, p.current = null;
203
- const y = et.connect(h, Je);
204
- h.contentWindow?.location.replace(t.webview.runtimeUrl), y.then(async (ne) => {
205
- if (l.current !== h) return;
206
- const M = ne.remote;
207
- p.current = M, W.current?.bind((Ze) => M.hostEvent?.(Ze)), await M.init({
208
- moduleUrl: Xe,
209
- styles: Ye,
210
- props: x.current,
211
- theme: se(A.current),
212
- themeVariables: oe(),
202
+ u.current = !1, b.current = null;
203
+ const y = Ge.connect(h, qe);
204
+ h.contentWindow?.location.replace(t.webview.runtimeUrl), y.then(async (Z) => {
205
+ if (c.current !== h) return;
206
+ const W = Z.remote;
207
+ b.current = W, H.current?.bind((ze) => W.hostEvent?.(ze)), await W.init({
208
+ moduleUrl: Ue,
209
+ styles: _e,
210
+ props: R.current,
211
+ theme: te(E.current),
212
+ themeVariables: ee(),
213
213
  extensionId: t.extensionId
214
- }), l.current === h && (u.current = !0, w(null), te.current?.());
215
- }).catch((ne) => {
216
- if (l.current !== h) return;
217
- const M = yt(ne);
218
- w(M.message), j.current?.(M);
214
+ }), c.current === h && (u.current = !0, g(null), J.current?.());
215
+ }).catch((Z) => {
216
+ if (c.current !== h) return;
217
+ const W = ft(Z);
218
+ g(W.message), j.current?.(W);
219
219
  });
220
- })(), S;
221
- }, [P, t.extensionId, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), K(() => {
222
- const h = p.current;
220
+ })(), C;
221
+ }, [P, t.extensionId, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), O(() => {
222
+ const h = b.current;
223
223
  if (!(!h || !s))
224
- return s.bind((C) => h.hostEvent?.(C)), () => s.unbind();
225
- }, [s]), K(() => {
226
- u.current && p.current?.propsUpdate({
224
+ return s.bind((A) => h.hostEvent?.(A)), () => s.unbind();
225
+ }, [s]), O(() => {
226
+ u.current && b.current?.propsUpdate({
227
227
  props: n
228
228
  });
229
- }, [n]), K(() => {
230
- u.current && p.current?.themeUpdate({
231
- theme: se(o),
232
- variables: oe()
229
+ }, [n]), O(() => {
230
+ u.current && b.current?.themeUpdate({
231
+ theme: te(o),
232
+ variables: ee()
233
233
  });
234
- }, [o]), K(() => {
234
+ }, [o]), O(() => {
235
235
  if (typeof window > "u" || typeof MutationObserver > "u") return;
236
236
  let h = null;
237
- const C = () => {
237
+ const A = () => {
238
238
  h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
239
- h = null, u.current && p.current?.themeUpdate({
240
- theme: se(A.current),
241
- variables: oe()
239
+ h = null, u.current && b.current?.themeUpdate({
240
+ theme: te(E.current),
241
+ variables: ee()
242
242
  });
243
243
  });
244
- }, S = new MutationObserver(C), F = {
244
+ }, C = new MutationObserver(A), D = {
245
245
  attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
246
246
  attributes: !0
247
247
  };
248
- return S.observe(document.documentElement, F), S.observe(document.body, F), () => {
249
- S.disconnect(), h !== null && cancelAnimationFrame(h);
248
+ return C.observe(document.documentElement, D), C.observe(document.body, D), () => {
249
+ C.disconnect(), h !== null && cancelAnimationFrame(h);
250
250
  };
251
- }, []), /* @__PURE__ */ ge("div", { style: kt, children: [
252
- k ? /* @__PURE__ */ N("div", { role: "alert", style: xt, children: /* @__PURE__ */ ge("div", { children: [
251
+ }, []), /* @__PURE__ */ ue("div", { style: wt, children: [
252
+ x ? /* @__PURE__ */ N("div", { role: "alert", style: gt, children: /* @__PURE__ */ ue("div", { children: [
253
253
  /* @__PURE__ */ N("strong", { children: "Extension view failed to load." }),
254
- /* @__PURE__ */ N("div", { children: k })
254
+ /* @__PURE__ */ N("div", { children: x })
255
255
  ] }) }) : null,
256
256
  /* @__PURE__ */ N(
257
257
  "iframe",
258
258
  {
259
- ref: l,
259
+ ref: c,
260
260
  title: m ?? t.label,
261
261
  allow: "fullscreen",
262
262
  allowFullScreen: !0,
263
- sandbox: Rt,
263
+ sandbox: It,
264
264
  style: {
265
- ...vt,
265
+ ...ht,
266
266
  colorScheme: o
267
267
  },
268
268
  onError: () => {
269
269
  const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
270
- w(h), j.current?.({
270
+ g(h), j.current?.({
271
271
  message: h
272
272
  });
273
273
  }
@@ -277,7 +277,30 @@ ${t.webview.runtimeUrl}
277
277
  ${t.webview.moduleUrl}`
278
278
  )
279
279
  ] });
280
- }, At = () => {
280
+ }, yt = "[pstdio.extension-host] ", kt = (e, t = console.info) => {
281
+ t(`${yt}${JSON.stringify(e)}`);
282
+ }, xt = (e, t) => {
283
+ const n = (o) => kt({
284
+ extensionId: e.extensionId,
285
+ contributionId: e.id,
286
+ ...o
287
+ }, t);
288
+ return {
289
+ onReady: () => n({
290
+ event: "webview-ready"
291
+ }),
292
+ onError: (o) => n({
293
+ event: "webview-error",
294
+ ...o
295
+ }),
296
+ onDiagnostics: (o) => {
297
+ for (const r of o) n({
298
+ event: "webview-diagnostic",
299
+ ...r
300
+ });
301
+ }
302
+ };
303
+ }, Rt = () => {
281
304
  let e = null;
282
305
  const t = [], n = /* @__PURE__ */ new Set();
283
306
  return {
@@ -295,13 +318,13 @@ ${t.webview.moduleUrl}`
295
318
  for (const o of n) o();
296
319
  }
297
320
  };
298
- }, Ct = "terminal.session", St = (e) => {
321
+ }, Et = "terminal.session", At = (e) => {
299
322
  const {
300
323
  terminal: t,
301
324
  hostEvents: n
302
325
  } = e, o = (r) => {
303
326
  n.emit({
304
- scope: Ct,
327
+ scope: Et,
305
328
  payload: r
306
329
  });
307
330
  };
@@ -351,31 +374,31 @@ ${t.webview.moduleUrl}`
351
374
  let a = () => {
352
375
  }, d = () => {
353
376
  }, m = !1;
354
- const l = () => {
377
+ const c = () => {
355
378
  m || (m = !0, a(), d());
356
379
  };
357
380
  return a = t.subscribe(i, {
358
- onData: (c) => o({
381
+ onData: (l) => o({
359
382
  sessionId: i,
360
383
  kind: "data",
361
- chunk: c
384
+ chunk: l
362
385
  }),
363
- onExit: (c) => {
386
+ onExit: (l) => {
364
387
  o({
365
388
  sessionId: i,
366
389
  kind: "exit",
367
- code: c.code,
368
- signal: c.signal
369
- }), l();
390
+ code: l.code,
391
+ signal: l.signal
392
+ }), c();
370
393
  }
371
- }), d = n.onDisconnect(l), {
394
+ }), d = n.onDisconnect(c), {
372
395
  operation: "subscribe",
373
396
  accepted: !0
374
397
  };
375
398
  }
376
399
  }
377
400
  };
378
- }, Tt = (e) => {
401
+ }, Ct = (e) => {
379
402
  if (typeof document > "u") return;
380
403
  const t = new KeyboardEvent("keydown", {
381
404
  ...e,
@@ -383,7 +406,7 @@ ${t.webview.moduleUrl}`
383
406
  cancelable: !0
384
407
  });
385
408
  document.dispatchEvent(t);
386
- }, Pt = (e) => ({
409
+ }, St = (e) => ({
387
410
  ...e.placement?.placementIdentity ? {
388
411
  "placement.close": (t) => {
389
412
  if (t !== void 0 && (typeof t != "object" || t === null || Array.isArray(t) || Object.keys(t).length > 0))
@@ -421,35 +444,30 @@ ${t.webview.moduleUrl}`
421
444
  value: n.value
422
445
  };
423
446
  },
424
- "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? Tt)(t),
447
+ "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? Ct)(t),
425
448
  ...e.hostEvents ? {
426
- "terminal.session": St({
449
+ "terminal.session": At({
427
450
  terminal: e.workbench.terminal,
428
451
  hostEvents: e.hostEvents
429
452
  })
430
453
  } : {}
431
- }), jt = (e, t) => {
432
- for (const n of t)
433
- console.warn(`[workbench.webview:${e}] ${n.code}/${n.capability}: ${n.message}`);
434
- }, $t = (e, t) => {
435
- console.error(`[workbench.webview:${e}] runtime error: ${t}`);
436
- }, Ht = () => "light", ve = /* @__PURE__ */ new WeakMap(), Wt = (e, t) => {
437
- let n = ve.get(e);
438
- n || (n = /* @__PURE__ */ new Map(), ve.set(e, n));
454
+ }), Tt = () => "light", he = /* @__PURE__ */ new WeakMap(), Pt = (e, t) => {
455
+ let n = he.get(e);
456
+ n || (n = /* @__PURE__ */ new Map(), he.set(e, n));
439
457
  const o = t.instanceId;
440
458
  let r = n.get(o);
441
- return r || (r = At(), n.set(o, r)), r;
442
- }, Mt = (e) => {
459
+ return r || (r = Rt(), n.set(o, r)), r;
460
+ }, jt = (e) => {
443
461
  const {
444
462
  context: t,
445
463
  createHostCapabilities: n,
446
464
  createProps: o,
447
- createTheme: r = Ht,
465
+ createTheme: r = Tt,
448
466
  ownerId: s,
449
467
  title: i,
450
468
  webview: a
451
469
  } = e;
452
- return /* @__PURE__ */ N(Et, { view: {
470
+ return /* @__PURE__ */ N(vt, { view: {
453
471
  extensionId: s ?? "workbench",
454
472
  id: t.webviewId,
455
473
  label: a.title ?? i,
@@ -459,17 +477,11 @@ ${t.webview.moduleUrl}`
459
477
  runtimeUrl: a.runtimeUrl,
460
478
  styles: a.styles ?? []
461
479
  }
462
- }, props: o(t), theme: r(t), capabilities: n(t), hostEvents: t.hostEvents, onDiagnostics: (d) => jt(t.webviewId, d), onError: (d) => $t(t.webviewId, d.message) });
463
- }, b = (e, t = "") => e === void 0 ? t : lt(e) ? e.default ?? e.$l10n : e, R = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), J = (e, t) => R(e) && e.kind === t && typeof e.id == "string", je = (e) => R(e) && typeof e.type == "string" && typeof e.id == "string", $e = (e) => e === void 0 || e === "preview" || e === "pin", le = (e, t = /* @__PURE__ */ new Set()) => {
464
- if (!R(e) || e.kind !== "page" || !J(e.page, "page") || t.has(e) || e.resource !== void 0 && !je(e.resource) || e.section !== void 0 && !R(e.section) || !$e(e.open)) return !1;
465
- if (e.parent === void 0) return !0;
466
- const n = new Set(t);
467
- return n.add(e), le(e.parent, n);
468
- }, He = (e) => {
469
- if (!R(e) || e.kind !== "panel" || !R(e.panel)) return !1;
470
- const t = e.panel;
471
- return (J(t, "placement") || t.kind === "page-slot" && J(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || je(e.resource)) && $e(e.open);
472
- }, Bt = (e) => R(e) ? e.kind === "page" ? le(e) : e.kind === "panel" ? He(e) : e.kind === "href" ? typeof e.href == "string" : e.kind === "command" && R(e.target) && J(e.target.command, "command") && (e.target.params === void 0 || R(e.target.params)) : !1, We = (e) => Bt(e) ? !0 : !R(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((t) => le(t) || He(t)), Vt = (e, t) => {
480
+ }, props: o(t), theme: r(t), capabilities: n(t), hostEvents: t.hostEvents, ...xt({
481
+ extensionId: s ?? "workbench",
482
+ id: t.webviewId
483
+ }) });
484
+ }, p = (e, t = "") => e === void 0 ? t : rt(e) ? e.default ?? e.$l10n : e, $t = (e, t) => {
473
485
  const n = t.commandTargetOf?.(e);
474
486
  if (n) return n;
475
487
  const o = e.target.command, r = o.extensionId ?? t.extensionId;
@@ -478,53 +490,39 @@ ${t.webview.moduleUrl}`
478
490
  commandId: t.commandIdOf?.(o) ?? (r && r !== "pstdio" ? `${r}.command.${o.id}` : o.id),
479
491
  args: e.target.params
480
492
  };
481
- }, ae = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
482
- ...e,
483
- extensionId: t
484
- }, Me = (e, t) => ({
485
- ...e,
486
- page: ae(e.page, t),
487
- ...e.parent ? {
488
- parent: Me(e.parent, t)
489
- } : {}
490
- });
491
- function H(e, t = {}) {
492
- return e.kind === "command" ? Vt(e, t) : e.kind === "href" ? e : e.kind === "page" ? Me(e, t.extensionId) : e.kind === "panel" ? {
493
- ...e,
494
- panel: e.panel.kind === "page-slot" ? {
495
- ...e.panel,
496
- page: ae(e.panel.page, t.extensionId)
497
- } : ae(e.panel, t.extensionId)
498
- } : {
493
+ };
494
+ function S(e, t = {}) {
495
+ if (!ie(e)) throw new Error("Invalid navigation target.");
496
+ return t.extensionId && (e = Je(e, t.extensionId, t.projectId)), e.kind === "command" ? $t(e, t) : e.kind === "href" || e.kind === "page" || e.kind === "panel" ? e : {
499
497
  kind: "compound",
500
- targets: e.targets.map((n) => H(n, t))
498
+ targets: e.targets.map((n) => S(n, t))
501
499
  };
502
500
  }
503
- const me = (e, t = {}) => {
501
+ const Ae = ie, Ce = (e, t = {}) => {
504
502
  if (e != null) {
505
- if (!We(e)) throw new Error("Renderer callback returned an invalid navigation target.");
506
- return H(e, t);
503
+ if (!Ae(e)) throw new Error("Renderer callback returned an invalid navigation target.");
504
+ return S(e, t);
507
505
  }
508
- }, ee = (e) => {
506
+ }, Se = (e) => {
509
507
  const t = e;
510
508
  if (!t?.outcome) return e;
511
509
  if (t.outcome.status === "success") return t.outcome.value;
512
510
  throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
513
- }, O = (e) => ({
511
+ }, B = (e) => ({
514
512
  id: e.id,
515
513
  kind: e.kind,
516
514
  context: {
517
515
  projectId: e.projectId,
518
516
  ...e.context ?? {}
519
517
  }
520
- }), Dt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ot = (e) => {
521
- if (!(!Dt(e) || e.deleted !== !0))
518
+ }), Ht = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Wt = (e) => {
519
+ if (!(!Ht(e) || e.deleted !== !0))
522
520
  return typeof e.id == "string" ? e.id : void 0;
523
- }, Ft = async (e, t, n) => {
524
- if (!t || Ot(n) !== (t.id ?? V(t)) || V(e.workbench.getPrimaryResource()) !== V(t)) return;
521
+ }, Mt = async (e, t, n) => {
522
+ if (!t || Wt(n) !== (t.id ?? M(t)) || M(e.workbench.getPrimaryResource()) !== M(t)) return;
525
523
  const o = e.workbench.pageLocations.navigateToParent();
526
524
  if (!o.ok) throw new Error(o.diagnostic.message);
527
- }, E = async (e, t, n = {}) => {
525
+ }, Te = async (e, t, n = {}) => {
528
526
  const o = n.resource, r = await e.executeCommand(t, {
529
527
  projectId: e.projectId,
530
528
  ...n.params ? {
@@ -540,33 +538,49 @@ const me = (e, t = {}) => {
540
538
  ...n.metadata ? {
541
539
  metadata: n.metadata
542
540
  } : {}
543
- }), s = ee(r);
544
- return await Ft(e, n.resource, s), s;
545
- }, Kt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Nt = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Lt = async (e, t, n) => {
541
+ });
542
+ Se(r);
543
+ const s = r?.outcome;
544
+ if (s?.status === "success")
545
+ for (const i of s.navigationRequests ?? [])
546
+ try {
547
+ await e.workbench.navigation.openTarget(S(i));
548
+ } catch (a) {
549
+ e.workbench.notifications.show({
550
+ level: "warning",
551
+ title: "Command completed, but navigation failed",
552
+ message: a instanceof Error ? a.message : String(a)
553
+ });
554
+ }
555
+ return r;
556
+ }, v = async (e, t, n = {}) => {
557
+ const o = Se(await Te(e, t, n));
558
+ return await Mt(e, n.resource, o), o;
559
+ }, Vt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Bt = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Dt = async (e, t, n) => {
546
560
  const {
547
561
  target: o
548
562
  } = n;
549
563
  if (o.kind === "command") {
550
- await E(e, Nt(o.target.command, t.extensionId), {
564
+ await v(e, Bt(o.target.command, t.extensionId), {
551
565
  params: o.target.params
552
566
  }), e.workbench.commandPaletteResources.refresh();
553
567
  return;
554
568
  }
555
- await e.workbench.navigation.openTarget(H(o, {
569
+ await e.workbench.navigation.openTarget(S(o, {
556
570
  extensionId: t.extensionId
557
571
  }));
558
- }, _t = (e, t, n, o) => ({
572
+ }, Ot = (e, t, n, o) => ({
559
573
  id: `${t.id}:${o.id}`,
560
574
  label: o.label,
561
575
  description: o.description,
562
576
  icon: o.icon,
563
577
  keywords: o.keywords,
564
578
  group: n,
565
- activate: () => Lt(e, t, o)
566
- }), Ut = (e, t) => {
579
+ activate: () => Dt(e, t, o)
580
+ }), Nt = (e, t) => {
567
581
  const n = [];
568
582
  for (const o of t) {
569
- const r = b(o.title, o.id);
583
+ const r = p(o.title, o.id);
570
584
  n.push(e.workbench.commandPaletteResources.registerProvider({
571
585
  id: o.id,
572
586
  title: r,
@@ -575,7 +589,7 @@ const me = (e, t = {}) => {
575
589
  query: s,
576
590
  limit: i
577
591
  }) => {
578
- const a = e.workbench.getActiveResource(), d = await E(e, o.queryHandlerId, {
592
+ const a = e.workbench.getActiveResource(), d = await v(e, o.queryHandlerId, {
579
593
  params: {
580
594
  projectId: e.projectId,
581
595
  modeId: e.workbench.modes.getActiveModeId(),
@@ -585,7 +599,7 @@ const me = (e, t = {}) => {
585
599
  limit: i
586
600
  }
587
601
  });
588
- return Kt(d) ? (d.items ?? []).map((m) => _t(e, o, r, m)) : [];
602
+ return Vt(d) ? (d.items ?? []).map((m) => Ot(e, o, r, m)) : [];
589
603
  }
590
604
  }));
591
605
  }
@@ -594,15 +608,15 @@ const me = (e, t = {}) => {
594
608
  for (let o = n.length - 1; o >= 0; o -= 1) n[o]?.dispose();
595
609
  }
596
610
  };
597
- }, re = (e, t = "") => b(e, t), qt = (e, t, n) => {
598
- const o = O({
611
+ }, ne = (e, t = "") => p(e, t), Ft = (e, t, n) => {
612
+ const o = B({
599
613
  id: t.id,
600
614
  kind: "renderer",
601
615
  projectId: e.projectId,
602
616
  context: {
603
617
  controlsRendererId: t.id
604
618
  }
605
- }), r = (s, i, a) => s ? E(e, s, {
619
+ }), r = (s, i, a) => s ? v(e, s, {
606
620
  params: {
607
621
  renderer: {
608
622
  rendererId: t.id,
@@ -624,15 +638,15 @@ const me = (e, t = {}) => {
624
638
  }) : Promise.resolve(void 0);
625
639
  return e.workbench.views.registerView({
626
640
  id: t.id,
627
- title: re(t.title, t.id),
641
+ title: ne(t.title, t.id),
628
642
  icon: t.icon,
629
643
  body: {
630
644
  kind: "controls",
631
- emptyTitle: re(t.emptyTitle, ""),
632
- emptyDescription: re(t.emptyDescription, ""),
645
+ emptyTitle: ne(t.emptyTitle, ""),
646
+ emptyDescription: ne(t.emptyDescription, ""),
633
647
  defaultValues: t.defaultValues,
634
648
  executeQuery: async (s) => {
635
- const i = await r(t.queryHandlerId, {}, s ?? n.resolveResource?.(t)), a = it.safeParse(i);
649
+ const i = await r(t.queryHandlerId, {}, s ?? n.resolveResource?.(t)), a = tt.safeParse(i);
636
650
  if (!a.success) {
637
651
  const d = a.error.issues.map((m) => `body.query.${m.path.join(".")}: ${m.message}`).join("; ");
638
652
  throw new Error(`Extension "${t.extensionId}" view "${t.id}" has invalid controls. Expected serializable control declarations. ${d}`);
@@ -666,35 +680,35 @@ const me = (e, t = {}) => {
666
680
  }) : void 0
667
681
  }
668
682
  });
669
- }, zt = (e, t, n = {}) => {
683
+ }, Kt = (e, t, n = {}) => {
670
684
  const o = [];
671
- for (const r of t) o.push(qt(e, r, n));
685
+ for (const r of t) o.push(Ft(e, r, n));
672
686
  return {
673
687
  dispose() {
674
688
  for (let r = o.length - 1; r >= 0; r -= 1) o[r]?.dispose();
675
689
  }
676
690
  };
677
- }, $ = (e, t = "") => b(e, t), ke = (e) => ({
691
+ }, $ = (e, t = "") => p(e, t), we = (e) => ({
678
692
  ...e,
679
693
  label: $(e.label, e.id),
680
694
  description: e.description ? $(e.description) : void 0,
681
- icon: e.icon ? D(_, {
695
+ icon: e.icon ? V(K, {
682
696
  name: e.icon,
683
697
  size: 14
684
698
  }) : void 0
685
- }), Qt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Gt = (e) => ({
699
+ }), Lt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), _t = (e) => ({
686
700
  id: e.id,
687
701
  values: e.values,
688
702
  resource: e.resource ? e.resource : void 0
689
- }), Yt = (e, t) => {
690
- const n = /* @__PURE__ */ new WeakMap(), o = O({
703
+ }), Ut = (e, t) => {
704
+ const n = /* @__PURE__ */ new WeakMap(), o = B({
691
705
  id: t.id,
692
706
  kind: "dataTableRenderer",
693
707
  projectId: e.projectId,
694
708
  context: {
695
709
  dataTableRendererId: t.id
696
710
  }
697
- }), r = (s, i, a, d) => E(e, s, {
711
+ }), r = (s, i, a, d) => v(e, s, {
698
712
  params: {
699
713
  renderer: {
700
714
  rendererId: t.id,
@@ -724,14 +738,14 @@ const me = (e, t = {}) => {
724
738
  body: {
725
739
  kind: "dataTable",
726
740
  resourceKind: t.resourceKind,
727
- columns: t.columns?.map(ke),
741
+ columns: t.columns?.map(we),
728
742
  initialPageSize: t.initialPageSize,
729
743
  pageSizeOptions: t.pageSizeOptions,
730
744
  selectionMode: t.selectionMode,
731
745
  selectionActions: t.selectionActions?.map((s) => ({
732
746
  id: s.id,
733
747
  label: $(s.label, s.id),
734
- icon: s.icon ? D(_, {
748
+ icon: s.icon ? V(K, {
735
749
  name: s.icon,
736
750
  size: 16
737
751
  }) : void 0,
@@ -748,12 +762,12 @@ const me = (e, t = {}) => {
748
762
  modeId: i
749
763
  }) => {
750
764
  const a = await r(t.queryHandlerId, {}, s, i);
751
- return Qt(a) ? {
765
+ return Lt(a) ? {
752
766
  rows: a.rows.map((m) => {
753
- const l = Gt(m);
754
- return n.set(l, m), l;
767
+ const c = _t(m);
768
+ return n.set(c, m), c;
755
769
  }),
756
- columns: a.columns?.map(ke)
770
+ columns: a.columns?.map(we)
757
771
  } : {
758
772
  rows: []
759
773
  };
@@ -761,7 +775,7 @@ const me = (e, t = {}) => {
761
775
  rowActions: t.rowActions?.map((s) => ({
762
776
  id: s.id,
763
777
  label: $(s.label, s.id),
764
- icon: s.icon ? D(_, {
778
+ icon: s.icon ? V(K, {
765
779
  name: s.icon,
766
780
  size: 16
767
781
  }) : void 0,
@@ -775,25 +789,25 @@ const me = (e, t = {}) => {
775
789
  onRowActivate: t.rowActivationHandlerId ? async (s) => {
776
790
  const i = await r(t.rowActivationHandlerId, {
777
791
  row: n.get(s) ?? s
778
- }, s.resource), a = me(i, {
792
+ }, s.resource), a = Ce(i, {
779
793
  extensionId: t.extensionId
780
794
  });
781
795
  a && await e.workbench.navigation.openTarget(a);
782
796
  } : void 0
783
797
  }
784
798
  });
785
- }, Xt = (e, t) => {
786
- const n = t.map((o) => Yt(e, o));
799
+ }, qt = (e, t) => {
800
+ const n = t.map((o) => Ut(e, o));
787
801
  return {
788
802
  dispose() {
789
803
  for (let o = n.length - 1; o >= 0; o -= 1) n[o]?.dispose();
790
804
  }
791
805
  };
792
- }, Jt = {
806
+ }, zt = {
793
807
  first: 0,
794
808
  default: 1,
795
809
  last: 2
796
- }, qo = {
810
+ }, Ko = {
797
811
  commands: [],
798
812
  commandPaletteContributions: [],
799
813
  diagnostics: [],
@@ -811,7 +825,7 @@ const me = (e, t = {}) => {
811
825
  statuses: [],
812
826
  settingsPanels: [],
813
827
  settingsDefinitions: []
814
- }, Zt = (e) => `workbench.extension.menu.${e.id}`, en = (e) => `workbench.extension.palette.${e.id}`, Be = (e, t) => Jt[e.placement ?? "default"] * 1e3 + t, Ve = (e) => e === void 0 ? "" : st(e) ? e.default ?? e.$l10n : e, tn = (e) => {
828
+ }, Gt = (e) => `workbench.extension.menu.${e.id}`, Qt = (e) => `workbench.extension.palette.${e.id}`, Pe = (e, t) => zt[e.placement ?? "default"] * 1e3 + t, je = (e) => e === void 0 ? "" : Ze(e) ? e.default ?? e.$l10n : e, Xt = (e) => {
815
829
  const {
816
830
  commandId: t,
817
831
  contribution: n,
@@ -828,10 +842,10 @@ const me = (e, t = {}) => {
828
842
  group: s.group ?? n.group,
829
843
  args: n.params,
830
844
  overflowLabel: s.overflowLabel,
831
- order: Be(n, o),
845
+ order: Pe(n, o),
832
846
  when: i
833
847
  };
834
- }, nn = (e) => {
848
+ }, Yt = (e) => {
835
849
  const {
836
850
  commandId: t,
837
851
  contribution: n,
@@ -844,30 +858,30 @@ const me = (e, t = {}) => {
844
858
  icon: n.icon,
845
859
  group: n.group,
846
860
  args: n.params,
847
- order: Be(n, o)
861
+ order: Pe(n, o)
848
862
  };
849
- }, on = (e) => {
863
+ }, Jt = (e) => {
850
864
  const {
851
- createCommandId: t = Zt,
865
+ createCommandId: t = Gt,
852
866
  createWhenExpression: n,
853
867
  menuSlotsById: o,
854
868
  menuTargetsById: r,
855
869
  metadata: s,
856
- resolveString: i = Ve
870
+ resolveString: i = je
857
871
  } = e, a = [], d = [];
858
- return s.menuContributions.forEach((m, l) => {
859
- const c = m.target ? r?.get(m.target) : o.get(m.slotId);
860
- if (!c) {
872
+ return s.menuContributions.forEach((m, c) => {
873
+ const l = m.target ? r?.get(m.target) : o.get(m.slotId);
874
+ if (!l) {
861
875
  d.push({
862
876
  contribution: m,
863
877
  targetId: m.target ?? m.slotId
864
878
  });
865
879
  return;
866
880
  }
867
- const p = t(m), u = s.commands.find((g) => g.id === m.commandId);
881
+ const b = t(m), u = s.commands.find((w) => w.id === m.commandId);
868
882
  a.push({
869
883
  command: {
870
- id: p,
884
+ id: b,
871
885
  label: i(m.label, m.extensionId),
872
886
  category: m.group,
873
887
  description: u ? i(u.description, u.extensionId) : void 0,
@@ -875,26 +889,26 @@ const me = (e, t = {}) => {
875
889
  params: u?.params
876
890
  },
877
891
  contribution: m,
878
- menuItem: tn({
879
- commandId: p,
892
+ menuItem: Xt({
893
+ commandId: b,
880
894
  contribution: m,
881
- index: l,
895
+ index: c,
882
896
  resolveString: i,
883
- slot: c,
897
+ slot: l,
884
898
  when: n?.(m)
885
899
  }),
886
- menuPath: c.menuPath,
900
+ menuPath: l.menuPath,
887
901
  targetCommandId: m.commandId
888
902
  });
889
903
  }), {
890
904
  registrations: a,
891
905
  unresolved: d
892
906
  };
893
- }, sn = (e) => {
907
+ }, Zt = (e) => {
894
908
  const {
895
- createCommandId: t = en,
909
+ createCommandId: t = Qt,
896
910
  metadata: n,
897
- resolveString: o = Ve
911
+ resolveString: o = je
898
912
  } = e, r = [];
899
913
  return (n.commandPaletteContributions ?? []).forEach((s, i) => {
900
914
  const a = t(s), d = n.commands.find((m) => m.id === s.commandId);
@@ -908,7 +922,7 @@ const me = (e, t = {}) => {
908
922
  params: d?.params
909
923
  },
910
924
  contribution: s,
911
- menuItem: nn({
925
+ menuItem: Yt({
912
926
  commandId: a,
913
927
  contribution: s,
914
928
  index: i,
@@ -917,7 +931,7 @@ const me = (e, t = {}) => {
917
931
  targetCommandId: s.commandId
918
932
  });
919
933
  }), r;
920
- }, rn = (e) => ({
934
+ }, en = (e) => ({
921
935
  id: e.rendererId,
922
936
  kind: "renderer",
923
937
  context: {
@@ -927,9 +941,9 @@ const me = (e, t = {}) => {
927
941
  resourceId: e.resource.id
928
942
  } : {}
929
943
  }
930
- }), xe = async (e, t, n, o, r = {}, s) => {
931
- const i = o, a = await e.executeCommand(n, {
932
- projectId: e.projectId,
944
+ }), ge = async (e, t, n, o, r = {}, s) => {
945
+ const i = o;
946
+ return v(e, n, {
933
947
  params: {
934
948
  renderer: {
935
949
  rendererId: t,
@@ -944,28 +958,26 @@ const me = (e, t = {}) => {
944
958
  ...r
945
959
  },
946
960
  resource: i,
947
- slot: rn({
961
+ slot: en({
948
962
  projectId: e.projectId,
949
963
  rendererId: t,
950
964
  resource: i
951
965
  }),
952
- source: "dashboard",
953
966
  ...s ? {
954
967
  metadata: s
955
968
  } : {}
956
969
  });
957
- return ee(a);
958
- }, De = (e) => {
970
+ }, $e = (e) => {
959
971
  if (!e || typeof e != "object") return;
960
972
  const t = e.revision;
961
973
  return typeof t == "string" ? t : void 0;
962
- }, zo = (e, t) => {
974
+ }, Lo = (e, t) => {
963
975
  const n = e.metadata, o = n?.fileRendererOrigin;
964
976
  if (!o || typeof o != "object") return;
965
977
  const r = o;
966
978
  if (typeof r.rendererId != "string" || typeof r.instanceId != "string" || typeof r.operationId != "string")
967
979
  return;
968
- const s = n?.fileRendererResourceKey, i = De(t.outcome.value);
980
+ const s = n?.fileRendererResourceKey, i = $e(t.outcome.value);
969
981
  return {
970
982
  origin: {
971
983
  rendererId: r.rendererId,
@@ -979,43 +991,43 @@ const me = (e, t = {}) => {
979
991
  revision: i
980
992
  } : {}
981
993
  };
982
- }, an = (e, t) => e.workbench.views.registerView({
994
+ }, tn = (e, t) => e.workbench.views.registerView({
983
995
  id: t.id,
984
- title: b(t.title, t.id),
996
+ title: p(t.title, t.id),
985
997
  icon: t.icon,
986
998
  body: {
987
999
  kind: "file",
988
1000
  resourceKind: t.resourceKind,
989
- load: async (n) => await xe(e, t.id, t.loadHandlerId, n) ?? {},
1001
+ load: async (n) => await ge(e, t.id, t.loadHandlerId, n) ?? {},
990
1002
  save: t.saveHandlerId ? async (n, o, r) => {
991
- const s = await xe(e, t.id, t.saveHandlerId, n, {
1003
+ const s = await ge(e, t.id, t.saveHandlerId, n, {
992
1004
  content: o
993
1005
  }, {
994
1006
  ...r ? {
995
1007
  fileRendererOrigin: r
996
1008
  } : {},
997
- ...V(n) ? {
998
- fileRendererResourceKey: V(n)
1009
+ ...M(n) ? {
1010
+ fileRendererResourceKey: M(n)
999
1011
  } : {}
1000
- }), i = De(s);
1012
+ }), i = $e(s);
1001
1013
  return i ? {
1002
1014
  revision: i
1003
1015
  } : void 0;
1004
1016
  } : void 0
1005
1017
  }
1006
- }), dn = (e) => {
1018
+ }), nn = (e) => {
1007
1019
  const t = [];
1008
1020
  for (const n of e.metadata.fileRenderers ?? [])
1009
- t.push(an(e, n));
1021
+ t.push(tn(e, n));
1010
1022
  return {
1011
1023
  dispose() {
1012
1024
  for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1013
1025
  }
1014
1026
  };
1015
- }, cn = (e) => (n) => D(_, {
1027
+ }, on = (e) => (n) => V(K, {
1016
1028
  name: e ?? "MoreHorizontal",
1017
1029
  ...n
1018
- }), ln = (e, t) => ({
1030
+ }), sn = (e, t) => ({
1019
1031
  color: e?.color,
1020
1032
  canDragIn: e?.canDragIn,
1021
1033
  canDragOut: e?.canDragOut,
@@ -1023,12 +1035,12 @@ const me = (e, t = {}) => {
1023
1035
  actions: e?.actions?.map((n) => ({
1024
1036
  id: n.id,
1025
1037
  label: t(n.label, n.id),
1026
- icon: cn(n.icon)
1038
+ icon: on(n.icon)
1027
1039
  }))
1028
- }), Oe = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, mn = (e, t) => {
1040
+ }), He = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, rn = (e, t) => {
1029
1041
  const n = /* @__PURE__ */ new Map();
1030
1042
  return (o) => {
1031
- const r = Oe(t, o), s = n.get(r);
1043
+ const r = He(t, o), s = n.get(r);
1032
1044
  if (s) return s;
1033
1045
  const i = {
1034
1046
  getSnapshot: () => (e.workbench.statuses.getStatuses(r) ?? []).map((a) => ({
@@ -1042,18 +1054,18 @@ const me = (e, t = {}) => {
1042
1054
  return n.set(r, i), e.workbench.statuses.load(r).catch(() => {
1043
1055
  }), i;
1044
1056
  };
1045
- }, un = (e, t, n, o, r) => {
1057
+ }, an = (e, t, n, o, r) => {
1046
1058
  const s = n?.find((d) => d.id === o);
1047
1059
  if (s?.type.kind !== "status") return;
1048
- const i = Oe(t, s.type.statuses), a = e.workbench.statuses.getStatuses(i)?.find((d) => d.id === r);
1060
+ const i = He(t, s.type.statuses), a = e.workbench.statuses.getStatuses(i)?.find((d) => d.id === r);
1049
1061
  return a ? {
1050
1062
  color: a.color
1051
1063
  } : void 0;
1052
- }, pn = (e) => {
1064
+ }, dn = (e) => {
1053
1065
  if (e.defaultSettings?.columnGrouping) return e.defaultSettings.columnGrouping;
1054
1066
  const t = e.attributes?.filter((n) => n.type.kind === "status") ?? [];
1055
1067
  return t.length === 1 ? t[0]?.id : void 0;
1056
- }, Re = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ee = (e, t, n, o, r, s) => (t ?? []).map((i) => {
1068
+ }, Ie = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ve = (e, t, n, o, r, s) => (t ?? []).map((i) => {
1057
1069
  const a = i.display, d = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
1058
1070
  kind: "badge-list",
1059
1071
  itemsAttributeId: a.itemsAttributeId
@@ -1067,16 +1079,16 @@ const me = (e, t = {}) => {
1067
1079
  options: r(i.type.statuses)
1068
1080
  } : i.type.kind === "enum" || i.type.kind === "enum-multi" ? {
1069
1081
  ...i.type,
1070
- options: Array.isArray(i.type.options) ? i.type.options.map((l) => ({
1071
- ...l,
1072
- label: n(l.label, l.value)
1082
+ options: Array.isArray(i.type.options) ? i.type.options.map((c) => ({
1083
+ ...c,
1084
+ label: n(c.label, c.value)
1073
1085
  })) : i.type.options
1074
1086
  } : i.type,
1075
1087
  display: d
1076
1088
  };
1077
1089
  return o(e, m);
1078
- }), bn = (e, t, n, o, r = () => [], s) => {
1079
- let i = Ee(e, t, n, o, r, s);
1090
+ }), cn = (e, t, n, o, r = () => [], s) => {
1091
+ let i = ve(e, t, n, o, r, s);
1080
1092
  const a = /* @__PURE__ */ new Set();
1081
1093
  return {
1082
1094
  source: {
@@ -1084,17 +1096,17 @@ const me = (e, t = {}) => {
1084
1096
  subscribe: (d) => (a.add(d), () => a.delete(d))
1085
1097
  },
1086
1098
  set(d) {
1087
- i = Ee(e, d, n, o, r, s);
1099
+ i = ve(e, d, n, o, r, s);
1088
1100
  for (const m of a) m();
1089
1101
  }
1090
1102
  };
1091
- }, fn = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Fe = (e, t) => {
1103
+ }, ln = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), We = (e, t) => {
1092
1104
  const {
1093
1105
  resource: n
1094
1106
  } = t;
1095
- if (fn(n)) return n;
1096
- }, hn = (e, t) => {
1097
- const n = Fe(e, t);
1107
+ if (ln(n)) return n;
1108
+ }, mn = (e, t) => {
1109
+ const n = We(e, t);
1098
1110
  if (n) return n;
1099
1111
  if (e.resourceKind)
1100
1112
  return {
@@ -1102,14 +1114,14 @@ const me = (e, t = {}) => {
1102
1114
  id: t.id,
1103
1115
  label: t.title
1104
1116
  };
1105
- }, gn = (e, t) => {
1117
+ }, un = (e, t) => {
1106
1118
  const n = e, o = t(n);
1107
1119
  return o === void 0 ? n : {
1108
1120
  ...n,
1109
1121
  resource: o
1110
1122
  };
1111
- }, Ke = (...e) => Object.assign({}, ...e.filter((t) => !!t)), wn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, In = (e) => Object.keys(e ?? {}).length > 0, yn = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), vn = (e, t, n) => {
1112
- if (!yn.has(t.type)) return;
1123
+ }, Me = (...e) => Object.assign({}, ...e.filter((t) => !!t)), bn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, pn = (e) => Object.keys(e ?? {}).length > 0, fn = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), hn = (e, t, n) => {
1124
+ if (!fn.has(t.type)) return;
1113
1125
  const o = "options" in t && Array.isArray(t.options) ? t.options : [], r = t;
1114
1126
  return {
1115
1127
  id: e,
@@ -1127,19 +1139,19 @@ const me = (e, t = {}) => {
1127
1139
  multiple: t.type === "files" ? r.multiple !== !1 : void 0,
1128
1140
  accept: t.type === "files" && typeof r.accept == "string" ? r.accept : void 0
1129
1141
  };
1130
- }, kn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([n, o]) => {
1131
- const r = vn(n, o, t);
1142
+ }, wn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([n, o]) => {
1143
+ const r = hn(n, o, t);
1132
1144
  return r ? [r] : [];
1133
- }), xn = (e, t) => O({
1145
+ }), gn = (e, t) => B({
1134
1146
  id: t.id,
1135
1147
  kind: "kanbanRenderer",
1136
1148
  projectId: e.projectId,
1137
1149
  context: {
1138
1150
  kanbanRendererId: t.id
1139
1151
  }
1140
- }), U = (e, t, n, o, r) => {
1152
+ }), L = (e, t, n, o, r) => {
1141
1153
  const s = r ?? e.workbench.getPrimaryResource();
1142
- return E(e, n, {
1154
+ return v(e, n, {
1143
1155
  params: {
1144
1156
  renderer: {
1145
1157
  rendererId: t.id,
@@ -1154,44 +1166,44 @@ const me = (e, t = {}) => {
1154
1166
  ...o
1155
1167
  },
1156
1168
  resource: s,
1157
- slot: xn(e, t),
1169
+ slot: gn(e, t),
1158
1170
  metadata: {
1159
1171
  kanbanRendererId: t.id
1160
1172
  }
1161
1173
  });
1162
- }, Ne = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Rn = (e, t, n) => (t.rowActions ?? []).map((o) => {
1174
+ }, Ve = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, In = (e, t, n) => (t.rowActions ?? []).map((o) => {
1163
1175
  const r = e.workbench.commands.getCommand(o.commandId)?.command;
1164
1176
  return e.workbench.commands.registerCommand({
1165
- id: Ne(t, o),
1177
+ id: Ve(t, o),
1166
1178
  label: n(o.label, o.id),
1167
1179
  icon: o.icon,
1168
1180
  params: r?.params
1169
1181
  }, {
1170
- execute: (s, i) => U(e, t, o.commandId, Ke(wn(s)), i?.resource)
1182
+ execute: (s, i) => L(e, t, o.commandId, Me(bn(s)), i?.resource)
1171
1183
  });
1172
- }), En = (e, t, n, o, r, s) => {
1173
- const i = Ne(t, n), a = e.workbench.commands.getCommand(i), d = {
1184
+ }), vn = (e, t, n, o, r, s) => {
1185
+ const i = Ve(t, n), a = e.workbench.commands.getCommand(i), d = {
1174
1186
  rowId: o.id
1175
1187
  }, m = r ? {
1176
1188
  resource: r
1177
- } : void 0, l = s(n.label, n.id);
1178
- return a && In(a.command.params) ? (e.workbench.commandPalette.requestParams({
1189
+ } : void 0, c = s(n.label, n.id);
1190
+ return a && pn(a.command.params) ? (e.workbench.commandPalette.requestParams({
1179
1191
  record: a,
1180
- label: l,
1192
+ label: c,
1181
1193
  args: d,
1182
1194
  context: m
1183
1195
  }), Promise.resolve()) : a ? e.workbench.commands.executeCommand(a.command.id, d, m).then(() => {
1184
- }) : U(e, t, n.commandId, d, r).then(() => {
1196
+ }) : L(e, t, n.commandId, d, r).then(() => {
1185
1197
  });
1186
- }, An = (e) => e ? D(_, {
1198
+ }, yn = (e) => e ? V(K, {
1187
1199
  name: e,
1188
1200
  size: 16
1189
- }) : void 0, Cn = (e, t) => {
1201
+ }) : void 0, kn = (e, t) => {
1190
1202
  if (e.createRow)
1191
1203
  return {
1192
1204
  title: t(e.createRow.title, "Create row"),
1193
1205
  submitLabel: t(e.createRow.submitLabel, "Create"),
1194
- fields: kn(e, t),
1206
+ fields: wn(e, t),
1195
1207
  labels: {
1196
1208
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1197
1209
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1199,12 +1211,12 @@ const me = (e, t = {}) => {
1199
1211
  removeFile: t(e.createRow.labels?.removeFile, "Remove file")
1200
1212
  }
1201
1213
  };
1202
- }, Sn = (e, t, n, o, r) => {
1214
+ }, xn = (e, t, n, o, r) => {
1203
1215
  if (t.rowActivationHandlerId)
1204
1216
  return async (s) => {
1205
- const i = o(t, s), a = await U(e, t, t.rowActivationHandlerId, {
1217
+ const i = o(t, s), a = await L(e, t, t.rowActivationHandlerId, {
1206
1218
  row: r(s)
1207
- }, i), d = me(a, {
1219
+ }, i), d = Ce(a, {
1208
1220
  extensionId: t.extensionId
1209
1221
  });
1210
1222
  d && await e.workbench.navigation.openTarget(d);
@@ -1215,11 +1227,11 @@ const me = (e, t = {}) => {
1215
1227
  row: s,
1216
1228
  resource: o(t, s)
1217
1229
  });
1218
- }, Tn = (e, t, n, o) => {
1230
+ }, Rn = (e, t, n, o) => {
1219
1231
  const r = e.createRow;
1220
1232
  if (r)
1221
1233
  return async (s) => {
1222
- const i = Ke(s.values, r.columnParam ? {
1234
+ const i = Me(s.values, r.columnParam ? {
1223
1235
  [r.columnParam]: s.columnId
1224
1236
  } : void 0, r.attributesParam ? {
1225
1237
  [r.attributesParam]: s.attributeValues
@@ -1237,16 +1249,16 @@ const me = (e, t = {}) => {
1237
1249
  attributes: d.attributes ?? {}
1238
1250
  });
1239
1251
  };
1240
- }, Pn = (e, t, n, o, r) => {
1252
+ }, En = (e, t, n, o, r) => {
1241
1253
  const s = t.rowActions;
1242
1254
  if (s?.length)
1243
1255
  return (i) => s.map((a) => {
1244
- const d = r(t, i), m = () => En(e, t, a, i, d, o);
1256
+ const d = r(t, i), m = () => vn(e, t, a, i, d, o);
1245
1257
  return {
1246
1258
  key: a.id,
1247
1259
  label: o(a.label, a.id),
1248
1260
  commandId: a.commandId,
1249
- icon: An(a.icon),
1261
+ icon: yn(a.icon),
1250
1262
  onClick: () => n.executeRowAction ? n.executeRowAction({
1251
1263
  record: t,
1252
1264
  action: a,
@@ -1256,99 +1268,99 @@ const me = (e, t = {}) => {
1256
1268
  }) : m()
1257
1269
  };
1258
1270
  });
1259
- }, jn = (e, t, n = {}) => {
1260
- const o = [], r = n.resolveLabel ?? ((l, c) => b(l, c)), s = (l, c) => {
1261
- const p = c.display?.kind === "badge-list" ? {
1262
- ...c,
1263
- render: (u, g) => dt(c, u, g)
1264
- } : c;
1265
- return n.decorateAttribute?.(l, p) ?? p;
1266
- }, i = n.resolveRowResource ?? Fe, a = n.resolveRowActionResource ?? hn, d = n.onAfterMutation ?? (() => {
1267
- }), m = (l, c, p) => U(e, l, c, p).then((u) => (d(l), u));
1268
- for (const l of t) {
1269
- const c = mn(e, l), p = (f, k) => e.workbench.notifications.show({
1270
- id: `workbench.extension.${l.extensionId}.kanban.${l.id}.display.${f}`,
1271
+ }, An = (e, t, n = {}) => {
1272
+ const o = [], r = n.resolveLabel ?? ((c, l) => p(c, l)), s = (c, l) => {
1273
+ const b = l.display?.kind === "badge-list" ? {
1274
+ ...l,
1275
+ render: (u, w) => ot(l, u, w)
1276
+ } : l;
1277
+ return n.decorateAttribute?.(c, b) ?? b;
1278
+ }, i = n.resolveRowResource ?? We, a = n.resolveRowActionResource ?? mn, d = n.onAfterMutation ?? (() => {
1279
+ }), m = (c, l, b) => L(e, c, l, b).then((u) => (d(c), u));
1280
+ for (const c of t) {
1281
+ const l = rn(e, c), b = (f, x) => e.workbench.notifications.show({
1282
+ id: `workbench.extension.${c.extensionId}.kanban.${c.id}.display.${f}`,
1271
1283
  level: "error",
1272
1284
  title: "Extension display is not available",
1273
- message: `Attribute "${f}" in renderer "${l.id}" uses unknown display kind "${k}".`
1274
- }), u = bn(l, l.attributes, r, s, c, p);
1275
- let g = l.attributes, x = pn(l);
1276
- const A = /* @__PURE__ */ new WeakMap();
1277
- let T, W = 0;
1278
- const z = (f) => i(l, f), j = Sn(e, l, n, i, (f) => A.get(f) ?? f);
1279
- o.push(...Rn(e, l, r)), o.push(e.workbench.views.registerView({
1280
- id: l.id,
1281
- title: r(l.title, l.id),
1282
- icon: l.icon,
1285
+ message: `Attribute "${f}" in renderer "${c.id}" uses unknown display kind "${x}".`
1286
+ }), u = cn(c, c.attributes, r, s, l, b);
1287
+ let w = c.attributes, R = dn(c);
1288
+ const E = /* @__PURE__ */ new WeakMap();
1289
+ let T, H = 0;
1290
+ const U = (f) => i(c, f), j = xn(e, c, n, i, (f) => E.get(f) ?? f);
1291
+ o.push(...In(e, c, r)), o.push(e.workbench.views.registerView({
1292
+ id: c.id,
1293
+ title: r(c.title, c.id),
1294
+ icon: c.icon,
1283
1295
  body: {
1284
1296
  kind: "kanban",
1285
- resourceKind: l.resourceKind,
1297
+ resourceKind: c.resourceKind,
1286
1298
  storageScope: e.projectId,
1287
1299
  attributes: u.source,
1288
- defaultSettings: l.defaultSettings,
1289
- defaultFilters: l.defaultFilters,
1290
- defaultViews: l.defaultViews?.map((f) => ({
1300
+ defaultSettings: c.defaultSettings,
1301
+ defaultFilters: c.defaultFilters,
1302
+ defaultViews: c.defaultViews?.map((f) => ({
1291
1303
  ...f,
1292
1304
  title: r(f.title, f.id)
1293
1305
  })),
1294
- defaultActiveViewId: l.defaultActiveViewId,
1295
- emptyTitle: r(l.emptyTitle, ""),
1296
- emptyDescription: r(l.emptyDescription, ""),
1297
- hideToolbar: l.hideToolbar,
1298
- createRow: Cn(l, r),
1299
- getBoardColumnConfig: (f) => ln(T?.[f] ?? un(e, l, g, x, f), r),
1306
+ defaultActiveViewId: c.defaultActiveViewId,
1307
+ emptyTitle: r(c.emptyTitle, ""),
1308
+ emptyDescription: r(c.emptyDescription, ""),
1309
+ hideToolbar: c.hideToolbar,
1310
+ createRow: kn(c, r),
1311
+ getBoardColumnConfig: (f) => sn(T?.[f] ?? an(e, c, w, R, f), r),
1300
1312
  onRowActivate: j,
1301
1313
  executeQuery: async (f) => {
1302
- W += 1;
1303
- const k = W, w = await U(e, l, l.queryHandlerId, {
1314
+ H += 1;
1315
+ const x = H, g = await L(e, c, c.queryHandlerId, {
1304
1316
  settings: f.settings,
1305
1317
  filters: f.filters
1306
- }), P = (h) => h.map((C) => {
1307
- const S = gn(C, z);
1308
- return A.set(S, C), S;
1318
+ }), P = (h) => h.map((A) => {
1319
+ const C = un(A, U);
1320
+ return E.set(C, A), C;
1309
1321
  });
1310
- if (k !== W)
1311
- return Array.isArray(w) ? P(w) : Re(w) ? P(w.rows ?? []) : [];
1312
- if (x = f.settings.columnGrouping, Array.isArray(w)) return P(w);
1313
- if (!Re(w)) return [];
1314
- const Q = w.attributes ?? g;
1315
- return g = Q, u.set(Q), T = w.boardColumnConfigs, P(w.rows ?? []);
1322
+ if (x !== H)
1323
+ return Array.isArray(g) ? P(g) : Ie(g) ? P(g.rows ?? []) : [];
1324
+ if (R = f.settings.columnGrouping, Array.isArray(g)) return P(g);
1325
+ if (!Ie(g)) return [];
1326
+ const q = g.attributes ?? w;
1327
+ return w = q, u.set(q), T = g.boardColumnConfigs, P(g.rows ?? []);
1316
1328
  },
1317
- onAttributeChange: l.attributeChangeHandlerId ? (f, k, w) => m(l, l.attributeChangeHandlerId, {
1329
+ onAttributeChange: c.attributeChangeHandlerId ? (f, x, g) => m(c, c.attributeChangeHandlerId, {
1318
1330
  rowId: f,
1319
- attributeId: k,
1320
- value: w
1331
+ attributeId: x,
1332
+ value: g
1321
1333
  }).then(() => {
1322
1334
  }) : void 0,
1323
- onReorder: l.reorderHandlerId ? (f, k) => m(l, l.reorderHandlerId, {
1335
+ onReorder: c.reorderHandlerId ? (f, x) => m(c, c.reorderHandlerId, {
1324
1336
  rowId: f,
1325
- beforeRowId: k
1337
+ beforeRowId: x
1326
1338
  }).then(() => {
1327
1339
  }) : void 0,
1328
- onCreateRow: Tn(l, n, m, l.rowActivationHandlerId ? j : void 0),
1329
- onColumnAction: l.columnActionHandlerId ? async (f, k) => {
1330
- await m(l, l.columnActionHandlerId, {
1340
+ onCreateRow: Rn(c, n, m, c.rowActivationHandlerId ? j : void 0),
1341
+ onColumnAction: c.columnActionHandlerId ? async (f, x) => {
1342
+ await m(c, c.columnActionHandlerId, {
1331
1343
  columnId: f,
1332
- actionId: k
1344
+ actionId: x
1333
1345
  });
1334
1346
  } : void 0,
1335
- getRowContextMenuActions: Pn(e, l, n, r, a)
1347
+ getRowContextMenuActions: En(e, c, n, r, a)
1336
1348
  }
1337
1349
  }));
1338
1350
  }
1339
1351
  return {
1340
1352
  dispose() {
1341
- for (let l = o.length - 1; l >= 0; l -= 1) o[l]?.dispose();
1353
+ for (let c = o.length - 1; c >= 0; c -= 1) o[c]?.dispose();
1342
1354
  }
1343
1355
  };
1344
- }, $n = (e, t) => {
1356
+ }, Cn = (e, t) => {
1345
1357
  if (e)
1346
1358
  return Object.fromEntries(Object.entries(e).map(([n, o]) => [n, {
1347
1359
  ...o,
1348
1360
  label: o.label === void 0 ? void 0 : t(o.label, n),
1349
1361
  description: o.description === void 0 ? void 0 : t(o.description)
1350
1362
  }]));
1351
- }, Le = (e) => ({
1363
+ }, Be = (e) => ({
1352
1364
  id: e.treeId,
1353
1365
  kind: "renderer",
1354
1366
  context: {
@@ -1362,7 +1374,7 @@ const me = (e, t = {}) => {
1362
1374
  resourceId: e.resource.id
1363
1375
  } : {}
1364
1376
  }
1365
- }), G = (e, t, n, o) => {
1377
+ }), z = (e, t, n, o) => {
1366
1378
  const r = n.resource, s = e.workbench.modes.getActiveModeId();
1367
1379
  return {
1368
1380
  renderer: {
@@ -1386,21 +1398,19 @@ const me = (e, t = {}) => {
1386
1398
  node: o
1387
1399
  } : {}
1388
1400
  };
1389
- }, Y = async (e, t, n, o) => {
1390
- const r = o.renderer, s = r?.resource, i = await e.executeCommand(n, {
1391
- projectId: e.projectId,
1401
+ }, G = async (e, t, n, o) => {
1402
+ const r = o.renderer, s = r?.resource;
1403
+ return v(e, n, {
1392
1404
  params: o,
1393
1405
  resource: s,
1394
- slot: Le({
1406
+ slot: Be({
1395
1407
  modeId: r?.modeId,
1396
1408
  projectId: e.projectId,
1397
1409
  resource: s,
1398
1410
  treeId: t.id
1399
- }),
1400
- source: "dashboard"
1411
+ })
1401
1412
  });
1402
- return ee(i);
1403
- }, _e = async (e, t, n, o, r) => {
1413
+ }, De = async (e, t, n, o, r) => {
1404
1414
  const s = e.workbench.modes.getActiveModeId(), i = {
1405
1415
  ...o ?? {},
1406
1416
  renderer: {
@@ -1416,184 +1426,183 @@ const me = (e, t = {}) => {
1416
1426
  placement: "visible"
1417
1427
  }
1418
1428
  }
1419
- }, a = await e.executeCommand(n, {
1420
- projectId: e.projectId,
1429
+ };
1430
+ return v(e, n, {
1421
1431
  params: i,
1422
1432
  resource: r,
1423
- slot: Le({
1433
+ slot: Be({
1424
1434
  modeId: s,
1425
1435
  projectId: e.projectId,
1426
1436
  resource: r,
1427
1437
  treeId: t.id
1428
1438
  }),
1429
- source: "dashboard",
1430
1439
  metadata: {
1431
1440
  treeId: t.id
1432
1441
  }
1433
1442
  });
1434
- return ee(a);
1435
- }, Hn = (e, t) => e.panels.flatMap((n) => [n, ...n.panelMenus ?? []]).filter((n) => n.renderer?.kind === "tree" && n.renderer.id === t.id), Ue = (e, t) => t.viewId ? e.find((n) => n.id === t.viewId) : e.length === 1 ? e[0] : void 0, Wn = async (e) => {
1443
+ }, Sn = (e, t) => e.panels.flatMap((n) => [n, ...n.panelMenus ?? []]).filter((n) => n.renderer?.kind === "tree" && n.renderer.id === t.id), Oe = (e, t) => t.viewId ? e.find((n) => n.id === t.viewId) : e.length === 1 ? e[0] : void 0, Tn = async (e) => {
1436
1444
  const {
1437
1445
  ctx: t,
1438
1446
  getHostTreeHeaderNodes: n,
1439
1447
  record: o,
1440
1448
  treeViews: r
1441
- } = e, s = Ue(r, t);
1449
+ } = e, s = Oe(r, t);
1442
1450
  return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await n?.({
1443
1451
  ctx: t,
1444
1452
  record: o,
1445
1453
  panel: s
1446
1454
  }) ?? [];
1447
- }, Mn = async (e) => {
1455
+ }, Pn = async (e) => {
1448
1456
  const {
1449
1457
  ctx: t,
1450
1458
  getHostTreeFooterNodes: n,
1451
1459
  record: o,
1452
1460
  treeViews: r
1453
- } = e, s = Ue(r, t);
1461
+ } = e, s = Oe(r, t);
1454
1462
  return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await n?.({
1455
1463
  ctx: t,
1456
1464
  record: o,
1457
1465
  panel: s
1458
1466
  }) ?? [];
1459
- }, Bn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Ae = (e) => e && !Array.isArray(e) ? e : void 0, Vn = (e, t) => {
1460
- const n = /* @__PURE__ */ new WeakMap(), o = `workbench.extensionTreeRenderer.${t.id}.command`, r = (c) => e.resolveNodeResource?.(c) ?? c, s = (c) => {
1461
- if (c.emptyState)
1467
+ }, jn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, ye = (e) => e && !Array.isArray(e) ? e : void 0, $n = (e, t) => {
1468
+ const n = /* @__PURE__ */ new WeakMap(), o = `workbench.extensionTreeRenderer.${t.id}.command`, r = (l) => e.resolveNodeResource?.(l) ?? l, s = (l) => {
1469
+ if (l.emptyState)
1462
1470
  return {
1463
- title: b(c.emptyState.title),
1464
- description: b(c.emptyState.description),
1465
- icon: c.emptyState.icon
1471
+ title: p(l.emptyState.title),
1472
+ description: p(l.emptyState.description),
1473
+ icon: l.emptyState.icon
1466
1474
  };
1467
- }, i = (c, p, u) => c ? H(c, {
1468
- commandTargetOf: (x) => ({
1475
+ }, i = (l, b, u) => l ? S(l, {
1476
+ commandTargetOf: (R) => ({
1469
1477
  kind: "command",
1470
1478
  commandId: o,
1471
1479
  args: {
1472
- commandId: `${x.target.command.extensionId ?? t.extensionId}.command.${x.target.command.id}`,
1473
- ...p ? {
1474
- nodeId: p.id
1480
+ commandId: `${R.target.command.extensionId ?? t.extensionId}.command.${R.target.command.id}`,
1481
+ ...b ? {
1482
+ nodeId: b.id
1475
1483
  } : {},
1476
- params: x.target.params,
1477
- resource: p?.resource ?? u.resource,
1484
+ params: R.target.params,
1485
+ resource: b?.resource ?? u.resource,
1478
1486
  treeId: t.id
1479
1487
  }
1480
1488
  }),
1481
- extensionId: t.extensionId
1482
- }) : void 0, a = (c, p, u) => {
1483
- const g = c.command ? `${c.command.extensionId ?? t.extensionId}.command.${c.command.id}` : void 0;
1489
+ extensionId: t.extensionId,
1490
+ projectId: e.projectId
1491
+ }) : void 0, a = (l, b, u) => {
1492
+ const w = l.command ? `${l.command.extensionId ?? t.extensionId}.command.${l.command.id}` : void 0;
1484
1493
  return {
1485
- id: c.id,
1486
- label: b(c.label),
1487
- icon: c.icon,
1488
- args: Ae(c.params),
1489
- params: $n(c.input, b),
1490
- submitLabel: c.submitLabel,
1491
- when: c.when,
1492
- disabled: c.disabled,
1494
+ id: l.id,
1495
+ label: p(l.label),
1496
+ icon: l.icon,
1497
+ args: ye(l.params),
1498
+ params: Cn(l.input, p),
1499
+ submitLabel: l.submitLabel,
1500
+ when: l.when,
1501
+ disabled: l.disabled,
1493
1502
  // Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
1494
1503
  // node-target navigation runs through the runner command and must not refetch.
1495
- run: g ? async (x) => {
1496
- const A = await _e(e, t, g, Bn(x, Ae(c.params)), p?.resource ?? u.resource);
1504
+ run: w ? async (R) => {
1505
+ const E = await De(e, t, w, jn(R, ye(l.params)), b?.resource ?? u.resource);
1497
1506
  u.refresh();
1498
- const T = We(A) ? i(A, p, u) : void 0;
1507
+ const T = Ae(E) ? i(E, b, u) : void 0;
1499
1508
  T && await e.workbench.navigation.openTarget(T);
1500
1509
  } : void 0
1501
1510
  };
1502
- }, d = (c, p) => {
1511
+ }, d = (l, b) => {
1503
1512
  const u = {
1504
- id: c.id,
1505
- selected: c.selected,
1506
- label: b(c.label),
1507
- icon: c.icon,
1508
- iconColor: c.iconColor,
1509
- iconTooltip: c.iconTooltip,
1510
- resource: c.resource ? r(c.resource) : void 0,
1511
- target: i(c.target, c, p),
1512
- rowVariant: c.rowVariant,
1513
- actions: c.actions?.map((g) => a(g, c, p)),
1514
- contextMenuActions: c.contextMenuActions?.map((g) => a(g, c, p)),
1515
- collapsible: c.collapsible,
1516
- disabled: c.disabled,
1517
- children: c.children?.map((g) => d(g, p)),
1518
- description: c.description,
1519
- contextValue: c.contextValue,
1520
- hiddenByDefault: c.hiddenByDefault,
1521
- canHide: c.canHide
1513
+ id: l.id,
1514
+ selected: l.selected,
1515
+ label: p(l.label),
1516
+ icon: l.icon,
1517
+ iconColor: l.iconColor,
1518
+ iconTooltip: l.iconTooltip,
1519
+ resource: l.resource ? r(l.resource) : void 0,
1520
+ target: i(l.target, l, b),
1521
+ rowVariant: l.rowVariant,
1522
+ actions: l.actions?.map((w) => a(w, l, b)),
1523
+ contextMenuActions: l.contextMenuActions?.map((w) => a(w, l, b)),
1524
+ collapsible: l.collapsible,
1525
+ disabled: l.disabled,
1526
+ children: l.children?.map((w) => d(w, b)),
1527
+ description: l.description,
1528
+ contextValue: l.contextValue,
1529
+ hiddenByDefault: l.hiddenByDefault,
1530
+ canHide: l.canHide
1522
1531
  };
1523
- return n.set(u, c), u;
1532
+ return n.set(u, l), u;
1524
1533
  };
1525
1534
  return {
1526
- mapNodes: (c, p) => c.map((u) => d(u, p)),
1527
- mapSections: (c, p) => c.map((u) => ({
1535
+ mapNodes: (l, b) => l.map((u) => d(u, b)),
1536
+ mapSections: (l, b) => l.map((u) => ({
1528
1537
  id: u.id,
1529
- label: b(u.label),
1530
- actions: u.actions?.map((g) => a(g, void 0, p)),
1538
+ label: p(u.label),
1539
+ actions: u.actions?.map((w) => a(w, void 0, b)),
1531
1540
  collapsible: u.collapsible,
1532
1541
  emptyState: s(u),
1533
- nodes: u.nodes.map((g) => d(g, p)),
1542
+ nodes: u.nodes.map((w) => d(w, b)),
1534
1543
  hiddenByDefault: u.hiddenByDefault,
1535
1544
  canHide: u.canHide
1536
1545
  })),
1537
1546
  originalNodes: n,
1538
1547
  runnerCommandId: o
1539
1548
  };
1540
- }, ie = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), Dn = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), X = (e, t) => t.length > 0 ? [{
1549
+ }, oe = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), Hn = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), Q = (e, t) => t.length > 0 ? [{
1541
1550
  id: e,
1542
1551
  nodes: t,
1543
1552
  canReorder: !1
1544
- }] : [], On = (e, t) => {
1545
- const n = Vn(e, t), o = Hn(e.metadata, t), r = e.workbench.commands.registerCommand({
1553
+ }] : [], Wn = (e, t) => {
1554
+ const n = $n(e, t), o = Sn(e.metadata, t), r = e.workbench.commands.registerCommand({
1546
1555
  id: n.runnerCommandId,
1547
- label: `${b(t.title, t.id)} tree command`
1556
+ label: `${p(t.title, t.id)} tree command`
1548
1557
  }, {
1549
1558
  execute: async (i) => {
1550
- const a = i, d = await _e(e, t, a.commandId, a.params, a.resource);
1559
+ const a = i, d = await De(e, t, a.commandId, a.params, a.resource);
1551
1560
  for (const m of e.workbench.views.listViews())
1552
1561
  m.body.kind === "file" && e.workbench.views.refreshView(m.id);
1553
1562
  return d;
1554
1563
  }
1555
1564
  }), s = e.workbench.views.registerView({
1556
1565
  id: t.id,
1557
- title: b(t.title, t.id),
1566
+ title: p(t.title, t.id),
1558
1567
  icon: t.icon,
1559
1568
  body: {
1560
1569
  kind: "tree",
1561
1570
  searchable: t.searchable,
1562
- searchPlaceholder: b(t.searchPlaceholder, "Search files"),
1571
+ searchPlaceholder: p(t.searchPlaceholder, "Search files"),
1563
1572
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1564
1573
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1565
1574
  getHeader: async (i) => {
1566
- const a = await Wn({
1575
+ const a = await Tn({
1567
1576
  ctx: i,
1568
1577
  getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
1569
1578
  record: t,
1570
1579
  treeViews: o
1571
1580
  });
1572
- if (!t.headerHandlerId) return X(`${t.id}:host-header`, a);
1573
- const d = await Y(e, t, t.headerHandlerId, G(e, t, i)), m = ie(d) ? n.mapSections(d, i) : [];
1574
- return [...X(`${t.id}:host-header`, a), ...m];
1581
+ if (!t.headerHandlerId) return Q(`${t.id}:host-header`, a);
1582
+ const d = await G(e, t, t.headerHandlerId, z(e, t, i)), m = oe(d) ? n.mapSections(d, i) : [];
1583
+ return [...Q(`${t.id}:host-header`, a), ...m];
1575
1584
  },
1576
1585
  getBody: async (i) => {
1577
- const a = await Y(e, t, t.bodyHandlerId, G(e, t, i));
1578
- return ie(a) ? n.mapSections(a, i) : [];
1586
+ const a = await G(e, t, t.bodyHandlerId, z(e, t, i));
1587
+ return oe(a) ? n.mapSections(a, i) : [];
1579
1588
  },
1580
1589
  getFooter: async (i) => {
1581
- const a = await Mn({
1590
+ const a = await Pn({
1582
1591
  ctx: i,
1583
1592
  getHostTreeFooterNodes: e.getHostTreeFooterNodes,
1584
1593
  record: t,
1585
1594
  treeViews: o
1586
1595
  });
1587
- if (!t.footerHandlerId) return X(`${t.id}:host-footer`, a);
1588
- const d = await Y(e, t, t.footerHandlerId, G(e, t, i));
1589
- return [...ie(d) ? n.mapSections(d, i) : [], ...X(`${t.id}:host-footer`, a)];
1596
+ if (!t.footerHandlerId) return Q(`${t.id}:host-footer`, a);
1597
+ const d = await G(e, t, t.footerHandlerId, z(e, t, i));
1598
+ return [...oe(d) ? n.mapSections(d, i) : [], ...Q(`${t.id}:host-footer`, a)];
1590
1599
  },
1591
1600
  getChildren: async (i, a) => {
1592
1601
  if (!t.childrenHandlerId) return i.children ?? [];
1593
1602
  const d = n.originalNodes.get(i);
1594
1603
  if (!d) return i.children ?? [];
1595
- const m = await Y(e, t, t.childrenHandlerId, G(e, t, a, d));
1596
- return Dn(m) ? n.mapNodes(m, a) : [];
1604
+ const m = await G(e, t, t.childrenHandlerId, z(e, t, a, d));
1605
+ return Hn(m) ? n.mapNodes(m, a) : [];
1597
1606
  }
1598
1607
  }
1599
1608
  });
@@ -1602,16 +1611,16 @@ const me = (e, t = {}) => {
1602
1611
  s.dispose(), r.dispose();
1603
1612
  }
1604
1613
  };
1605
- }, Fn = (e) => {
1614
+ }, Mn = (e) => {
1606
1615
  const t = [];
1607
1616
  for (const n of e.metadata.treeRenderers ?? [])
1608
- t.push(On(e, n));
1617
+ t.push(Wn(e, n));
1609
1618
  return {
1610
1619
  dispose() {
1611
1620
  for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1612
1621
  }
1613
1622
  };
1614
- }, I = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, Z = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, qe = (e) => {
1623
+ }, I = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, Y = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, Ne = (e) => {
1615
1624
  if (!e) return;
1616
1625
  const t = (n) => {
1617
1626
  if (n)
@@ -1624,26 +1633,26 @@ const me = (e, t = {}) => {
1624
1633
  resourceType: e.resourceType?.map((n) => n.id),
1625
1634
  metadata: e.metadata
1626
1635
  };
1627
- }, Qo = qe, ue = (e) => ({
1636
+ }, _o = Ne, ae = (e) => ({
1628
1637
  kind: e.kind,
1629
1638
  id: I(e),
1630
1639
  extensionId: e.extensionId
1631
- }), Kn = (e, t, n) => {
1640
+ }), Vn = (e, t, n) => {
1632
1641
  const o = n?.(t.when);
1633
1642
  return o ? e.context.matches(o) : !0;
1634
- }, Nn = (e) => ({
1643
+ }, Bn = (e) => ({
1635
1644
  id: e.id,
1636
- label: b(e.label, e.id),
1645
+ label: p(e.label, e.id),
1637
1646
  icon: e.icon,
1638
1647
  canHide: !0,
1639
1648
  canReorder: !0,
1640
- target: H(e.action, {
1649
+ target: S(e.action, {
1641
1650
  extensionId: e.extensionId
1642
1651
  })
1643
- }), Ln = (e, t, n) => {
1652
+ }), Dn = (e, t, n) => {
1644
1653
  const o = /* @__PURE__ */ new Map();
1645
1654
  for (const r of t) {
1646
- if (!Kn(e, r, n)) continue;
1655
+ if (!Vn(e, r, n)) continue;
1647
1656
  const s = r.group || void 0, i = s ? `${r.extensionId}:${s}` : "navigation.root", a = o.get(i) ?? {
1648
1657
  id: i,
1649
1658
  label: s,
@@ -1652,68 +1661,68 @@ const me = (e, t = {}) => {
1652
1661
  canReorder: !0,
1653
1662
  nodes: []
1654
1663
  };
1655
- a.nodes.push(Nn(r)), o.set(i, a);
1664
+ a.nodes.push(Bn(r)), o.set(i, a);
1656
1665
  }
1657
1666
  return [...o.values()];
1658
- }, _n = (e) => {
1667
+ }, On = (e) => {
1659
1668
  const t = /* @__PURE__ */ new Map();
1660
1669
  for (const n of e) {
1661
- const o = ue(n.owner), r = `${n.extensionId}:${o.kind}:${o.id}:${n.slot}`;
1670
+ const o = ae(n.owner), r = `${n.extensionId}:${o.kind}:${o.id}:${n.slot}`;
1662
1671
  t.set(r, [...t.get(r) ?? [], n]);
1663
1672
  }
1664
1673
  return [...t.values()];
1665
- }, Un = (e) => [...new Set(e.flatMap((t) => t.group ? [`${t.extensionId}:${t.group}`] : []))], qn = (e) => _n(e.metadata.navigationItems).map((t) => {
1674
+ }, Nn = (e) => [...new Set(e.flatMap((t) => t.group ? [`${t.extensionId}:${t.group}`] : []))], Fn = (e) => On(e.metadata.navigationItems).map((t) => {
1666
1675
  const n = t[0];
1667
1676
  return e.workbench.navigationTrees.registerContribution({
1668
1677
  id: `${n.extensionId}.navigation-items.${n.owner.kind}.${I(n.owner)}.${n.slot}`,
1669
- owner: ue(n.owner),
1678
+ owner: ae(n.owner),
1670
1679
  sourceExtensionId: n.extensionId,
1671
1680
  declarationIndex: e.metadata.navigationItems.indexOf(n),
1672
1681
  slot: n.slot,
1673
- defaultExpandedSectionIds: Un(t),
1674
- getSections: () => Ln(e.workbench, t, e.createWhenExpression)
1682
+ defaultExpandedSectionIds: Nn(t),
1683
+ getSections: () => Dn(e.workbench, t, e.createWhenExpression)
1675
1684
  });
1676
- }), zn = (e) => e.metadata.navigationTrees.map((t, n) => {
1685
+ }), Kn = (e) => e.metadata.navigationTrees.map((t, n) => {
1677
1686
  const o = I(t.view);
1678
1687
  return e.workbench.navigationTrees.registerContribution({
1679
1688
  id: t.id,
1680
1689
  idScope: t.id,
1681
- owner: ue(t.owner),
1690
+ owner: ae(t.owner),
1682
1691
  sourceExtensionId: t.extensionId,
1683
1692
  declarationIndex: e.metadata.navigationItems.length + n,
1684
1693
  slot: t.slot,
1685
1694
  viewId: o
1686
1695
  });
1687
- }), Qn = (e) => [...qn(e), ...zn(e)], Gn = () => {
1696
+ }), Ln = (e) => [...Fn(e), ...Kn(e)], _n = () => {
1688
1697
  if (typeof navigator > "u") return;
1689
1698
  const e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
1690
1699
  if (e.includes("mac")) return "mac";
1691
1700
  if (e.includes("win")) return "win";
1692
1701
  if (e.includes("linux")) return "linux";
1693
- }, Yn = (e, t = Gn()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, Xn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
1694
- action: H(t.action, {
1695
- commandIdOf: (n) => n.extensionId ? Z({
1702
+ }, Un = (e, t = _n()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, qn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
1703
+ action: S(t.action, {
1704
+ commandIdOf: (n) => n.extensionId ? Y({
1696
1705
  extensionId: n.extensionId,
1697
1706
  id: n.id
1698
1707
  }) : void 0
1699
1708
  }),
1700
- keybinding: Yn(t),
1709
+ keybinding: Un(t),
1701
1710
  when: e.createWhenExpression?.(t.when)
1702
- })), Jn = (e, t) => ({
1711
+ })), zn = (e, t) => ({
1703
1712
  ...e,
1704
1713
  tab: e.tab && t.createTab ? t.createTab({
1705
1714
  ...e.tab,
1706
1715
  extensionId: t.extensionId,
1707
1716
  placementId: t.placementId
1708
1717
  }) : void 0
1709
- }), Zn = (e, t) => e.kind === "panels" ? e : {
1718
+ }), Gn = (e, t) => e.kind === "panels" ? e : {
1710
1719
  ...e,
1711
1720
  tab: e.tab && t.createTab ? t.createTab({
1712
1721
  ...e.tab,
1713
1722
  extensionId: t.extensionId,
1714
1723
  placementId: t.placementId
1715
1724
  }) : void 0
1716
- }, eo = (e, t) => e.pages.map((n) => ({
1725
+ }, Qn = (e, t) => e.pages.map((n) => ({
1717
1726
  id: n.id,
1718
1727
  ref: {
1719
1728
  extensionId: n.extensionId,
@@ -1724,12 +1733,12 @@ const me = (e, t = {}) => {
1724
1733
  path: n.path,
1725
1734
  modeId: I(n.mode),
1726
1735
  resource: n.resource,
1727
- main: Zn(n.main, {
1736
+ main: Gn(n.main, {
1728
1737
  extensionId: n.extensionId,
1729
1738
  placementId: `${n.id}.$main`,
1730
1739
  createTab: t
1731
1740
  }),
1732
- slots: n.slots.map((o) => Jn(o, {
1741
+ slots: n.slots.map((o) => zn(o, {
1733
1742
  extensionId: n.extensionId,
1734
1743
  placementId: `${n.id}.${o.id}`,
1735
1744
  createTab: t
@@ -1740,20 +1749,20 @@ const me = (e, t = {}) => {
1740
1749
  ...n.parent ? {
1741
1750
  parentId: I(n.parent)
1742
1751
  } : {}
1743
- })), q = (e, t) => {
1752
+ })), _ = (e, t) => {
1744
1753
  const n = e.pages.flatMap((o) => [...o.main.kind === "view" && o.resource ? [{
1745
1754
  ...o.resource,
1746
1755
  view: o.main.view
1747
1756
  }] : [], ...o.slots.flatMap((r) => r.item.kind === "binding" ? [r.item.binding] : [])]);
1748
1757
  return n.push(...e.placements.flatMap((o) => o.item.kind === "binding" ? [o.item.binding] : [])), n.find((o) => I(o.view) === t)?.kinds[0]?.id;
1749
- }, ze = (e) => e.body.kind === "webview" ? {
1758
+ }, Fe = (e) => e.body.kind === "webview" ? {
1750
1759
  webview: e.body.webview
1751
1760
  } : {
1752
1761
  renderer: {
1753
1762
  kind: e.body.kind,
1754
1763
  id: e.id
1755
1764
  }
1756
- }, to = (e, t) => e.viewMenus.flatMap((n) => {
1765
+ }, Xn = (e, t) => e.viewMenus.flatMap((n) => {
1757
1766
  if (I(n.owner) !== t.id) return [];
1758
1767
  const o = e.views.find((r) => r.id === I(n.view));
1759
1768
  return o ? [{
@@ -1767,25 +1776,25 @@ const me = (e, t = {}) => {
1767
1776
  placement: n.placement,
1768
1777
  hostTreeHeader: n.hostTreeHeader,
1769
1778
  hostTreeFooter: n.hostTreeFooter,
1770
- ...ze(o)
1779
+ ...Fe(o)
1771
1780
  }] : [];
1772
- }), no = (e) => e.views.map((t) => {
1773
- const n = to(e, t);
1781
+ }), Yn = (e) => e.views.map((t) => {
1782
+ const n = Xn(e, t);
1774
1783
  return {
1775
1784
  id: t.id,
1776
1785
  extensionId: t.extensionId,
1777
1786
  title: t.title,
1778
1787
  icon: t.icon,
1779
1788
  panelMenus: n.length > 0 ? n : void 0,
1780
- ...ze(t)
1789
+ ...Fe(t)
1781
1790
  };
1782
- }), de = (e) => e?.map(({
1791
+ }), se = (e) => e?.map(({
1783
1792
  command: t,
1784
1793
  ...n
1785
1794
  }) => ({
1786
1795
  ...n,
1787
- commandId: Z(t)
1788
- })), oo = (e) => e.views.flatMap((t) => {
1796
+ commandId: Y(t)
1797
+ })), Jn = (e) => e.views.flatMap((t) => {
1789
1798
  const n = t.body;
1790
1799
  return n.kind !== "kanban" ? [] : [{
1791
1800
  ...n,
@@ -1793,7 +1802,7 @@ const me = (e, t = {}) => {
1793
1802
  extensionId: t.extensionId,
1794
1803
  title: t.title,
1795
1804
  icon: t.icon,
1796
- resourceKind: q(e, t.id),
1805
+ resourceKind: _(e, t.id),
1797
1806
  createRow: n.createRow ? {
1798
1807
  title: n.createRow.title,
1799
1808
  submitLabel: n.createRow.submitLabel,
@@ -1801,16 +1810,16 @@ const me = (e, t = {}) => {
1801
1810
  params: n.createRow.params,
1802
1811
  attributesParam: n.createRow.attributesParam,
1803
1812
  labels: n.createRow.labels,
1804
- commandId: Z(n.createRow.command),
1813
+ commandId: Y(n.createRow.command),
1805
1814
  attachments: n.createRow.attachments ? {
1806
1815
  resourceParam: n.createRow.attachments.resourceParam,
1807
1816
  fileParam: n.createRow.attachments.fileParam,
1808
- commandId: Z(n.createRow.attachments.command)
1817
+ commandId: Y(n.createRow.attachments.command)
1809
1818
  } : void 0
1810
1819
  } : void 0,
1811
- rowActions: de(n.rowActions)
1820
+ rowActions: se(n.rowActions)
1812
1821
  }];
1813
- }), so = (e) => e.views.flatMap((t) => {
1822
+ }), Zn = (e) => e.views.flatMap((t) => {
1814
1823
  const n = t.body;
1815
1824
  return n.kind !== "dataTable" ? [] : [{
1816
1825
  ...n,
@@ -1818,32 +1827,32 @@ const me = (e, t = {}) => {
1818
1827
  extensionId: t.extensionId,
1819
1828
  title: t.title,
1820
1829
  icon: t.icon,
1821
- resourceKind: q(e, t.id),
1822
- selectionActions: de(n.selectionActions),
1823
- rowActions: de(n.rowActions)
1830
+ resourceKind: _(e, t.id),
1831
+ selectionActions: se(n.selectionActions),
1832
+ rowActions: se(n.rowActions)
1824
1833
  }];
1825
- }), ro = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
1834
+ }), eo = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
1826
1835
  ...t.body,
1827
1836
  id: t.id,
1828
1837
  extensionId: t.extensionId,
1829
1838
  title: t.title,
1830
1839
  icon: t.icon,
1831
- resourceKind: q(e, t.id)
1832
- }] : []), io = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
1840
+ resourceKind: _(e, t.id)
1841
+ }] : []), to = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
1833
1842
  ...t.body,
1834
1843
  id: t.id,
1835
1844
  extensionId: t.extensionId,
1836
1845
  title: t.title,
1837
1846
  icon: t.icon,
1838
- resourceKind: q(e, t.id)
1839
- }] : []), ao = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
1847
+ resourceKind: _(e, t.id)
1848
+ }] : []), no = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
1840
1849
  ...t.body,
1841
1850
  id: t.id,
1842
1851
  extensionId: t.extensionId,
1843
1852
  title: t.title,
1844
1853
  icon: t.icon,
1845
- resourceKind: q(e, t.id)
1846
- }] : []), co = (e) => e.modes.map((t) => ({
1854
+ resourceKind: _(e, t.id)
1855
+ }] : []), oo = (e) => e.modes.map((t) => ({
1847
1856
  id: t.id,
1848
1857
  extensionId: t.extensionId,
1849
1858
  modeId: t.id,
@@ -1858,15 +1867,15 @@ const me = (e, t = {}) => {
1858
1867
  ...t.chrome ? {
1859
1868
  chrome: Object.fromEntries(Object.entries(t.chrome).map(([n, o]) => [n, o === !1 ? !1 : I(o)]))
1860
1869
  } : {}
1861
- })), lo = (e, t = {}) => {
1862
- const n = no(e);
1870
+ })), so = (e, t = {}) => {
1871
+ const n = Yn(e);
1863
1872
  return {
1864
1873
  extensions: e.extensions,
1865
1874
  commands: e.commands,
1866
1875
  menuContributions: e.menuContributions,
1867
1876
  commandPaletteContributions: e.commandPaletteContributions,
1868
- modes: co(e),
1869
- pages: eo(e, t.createTab),
1877
+ modes: oo(e),
1878
+ pages: Qn(e, t.createTab),
1870
1879
  placements: e.placements.map((o) => ({
1871
1880
  id: o.id,
1872
1881
  ref: {
@@ -1920,12 +1929,12 @@ const me = (e, t = {}) => {
1920
1929
  section: o.section ? I(o.section) : void 0
1921
1930
  }] : [];
1922
1931
  }),
1923
- kanbanRenderers: oo(e),
1924
- dataTableRenderers: so(e),
1932
+ kanbanRenderers: Jn(e),
1933
+ dataTableRenderers: Zn(e),
1925
1934
  commandPaletteResources: e.commandPaletteResources ?? [],
1926
- treeRenderers: ro(e),
1927
- fileRenderers: io(e),
1928
- controlsRenderers: ao(e),
1935
+ treeRenderers: eo(e),
1936
+ fileRenderers: to(e),
1937
+ controlsRenderers: no(e),
1929
1938
  keybindings: e.keybindings ?? [],
1930
1939
  settingsDefinitions: e.settingsDefinitions ?? [],
1931
1940
  statuses: e.statuses,
@@ -1935,13 +1944,13 @@ const me = (e, t = {}) => {
1935
1944
  viewId: I(o.view),
1936
1945
  slot: o.slot.id.endsWith("leading") ? "leading" : "trailing",
1937
1946
  order: o.order,
1938
- when: qe(o.when)
1947
+ when: Ne(o.when)
1939
1948
  })),
1940
1949
  diagnostics: e.diagnostics
1941
1950
  };
1942
- }, mo = (e, t, n = {}) => {
1951
+ }, ro = (e, t, n = {}) => {
1943
1952
  e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
1944
- }, uo = (e) => {
1953
+ }, io = (e) => {
1945
1954
  const t = /* @__PURE__ */ new Map(), n = (o, r) => {
1946
1955
  for (const s of new Set(r.refreshEventIds ?? [])) {
1947
1956
  const i = t.get(s) ?? [];
@@ -1957,20 +1966,20 @@ const me = (e, t = {}) => {
1957
1966
  refreshEventIds: o.body.refreshEventIds
1958
1967
  });
1959
1968
  return t;
1960
- }, po = (e) => {
1961
- const t = uo(e.metadata);
1969
+ }, ao = (e) => {
1970
+ const t = io(e.metadata);
1962
1971
  return e.subscribe((n) => {
1963
1972
  const {
1964
1973
  id: o,
1965
1974
  ...r
1966
1975
  } = n;
1967
- for (const s of t.get(o) ?? []) mo(e.workbench, s, r);
1976
+ for (const s of t.get(o) ?? []) ro(e.workbench, s, r);
1968
1977
  });
1969
- }, Go = (e, t) => {
1978
+ }, Uo = (e, t) => {
1970
1979
  for (const n of t.views)
1971
1980
  n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
1972
- }, bo = (e) => (t) => ({
1973
- ...Pt({
1981
+ }, co = (e) => (t) => ({
1982
+ ...St({
1974
1983
  workbench: t.workbench,
1975
1984
  placement: t.placement,
1976
1985
  hostEvents: t.hostEvents
@@ -1978,29 +1987,31 @@ const me = (e, t = {}) => {
1978
1987
  "navigation.open": (o) => {
1979
1988
  const r = o;
1980
1989
  if (!r.target) throw new Error("navigation.open requires a target.");
1981
- return t.workbench.navigation.openTarget(H(r.target, {
1982
- extensionId: e.extensionIdForWebview(t.webviewId)
1990
+ return t.workbench.navigation.openTarget(S(r.target, {
1991
+ extensionId: e.extensionIdForWebview(t.webviewId),
1992
+ projectId: e.projectId
1983
1993
  }));
1984
1994
  },
1985
1995
  "commands.execute": async (o) => {
1986
1996
  const r = o, s = r.resource ?? t.placement.resource;
1987
- return e.executeCommand(r.commandId, {
1988
- projectId: e.projectId,
1997
+ return Te({
1998
+ ...e,
1999
+ workbench: t.workbench
2000
+ }, r.commandId, {
1989
2001
  ...r.params ? {
1990
2002
  params: r.params
1991
2003
  } : {},
1992
2004
  ...s ? {
1993
2005
  resource: s
1994
2006
  } : {},
1995
- slot: O({
2007
+ slot: B({
1996
2008
  id: t.webviewId,
1997
2009
  kind: e.slotKind,
1998
2010
  projectId: e.projectId,
1999
2011
  context: {
2000
2012
  panelId: t.webviewId
2001
2013
  }
2002
- }),
2003
- source: "dashboard"
2014
+ })
2004
2015
  });
2005
2016
  },
2006
2017
  ...e.files ? {
@@ -2015,17 +2026,17 @@ const me = (e, t = {}) => {
2015
2026
  webviewId: t.webviewId
2016
2027
  })
2017
2028
  } : {}
2018
- }), fo = (e) => ({
2019
- title: b(e.title) || void 0,
2029
+ }), lo = (e) => ({
2030
+ title: p(e.title) || void 0,
2020
2031
  runtimeUrl: e.runtimeUrl,
2021
2032
  moduleUrl: e.moduleUrl,
2022
2033
  styles: e.styles,
2023
2034
  capabilities: e.capabilities
2024
- }), Qe = "extensions", ho = 1e3, go = 25, wo = (e) => e === void 0 ? void 0 : e, Io = (e) => e === "global" ? "user" : "project", yo = (e, t) => t ? (n) => ({
2035
+ }), Ke = "extensions", mo = 1e3, uo = 25, bo = (e) => e === void 0 ? void 0 : e, po = (e) => e === "global" ? "user" : "project", fo = (e, t) => t ? (n) => ({
2025
2036
  ...e(n),
2026
2037
  ...t(n)
2027
- }) : e, vo = (e, t) => {
2028
- const n = e.createWebviewHostCapabilities ?? bo({
2038
+ }) : e, ho = (e, t) => {
2039
+ const n = e.createWebviewHostCapabilities ?? co({
2029
2040
  artifacts: e.webviewArtifacts,
2030
2041
  executeCommand: e.executeCommand,
2031
2042
  extensionIdForWebview: (o) => e.metadata.panels.find((r) => r.id === o)?.extensionId,
@@ -2033,26 +2044,26 @@ const me = (e, t = {}) => {
2033
2044
  projectId: e.projectId,
2034
2045
  slotKind: t
2035
2046
  });
2036
- return yo(n, e.createWebviewHostCapabilityOverrides);
2037
- }, ko = (e) => e.metadata.panels.flatMap((t) => {
2047
+ return fo(n, e.createWebviewHostCapabilityOverrides);
2048
+ }, wo = (e) => e.metadata.panels.flatMap((t) => {
2038
2049
  if (!t.webview) return [];
2039
- const n = fo(t.webview);
2050
+ const n = lo(t.webview);
2040
2051
  return [e.workbench.views.registerView({
2041
2052
  id: t.id,
2042
- title: b(t.title, t.id),
2053
+ title: p(t.title, t.id),
2043
2054
  icon: t.icon,
2044
2055
  body: {
2045
2056
  kind: "react",
2046
2057
  render: (o) => {
2047
2058
  const r = e.metadata.settingsPanels.some((s) => s.id === o.instance.panelId && s.viewId === t.id) ? "settings" : "panel";
2048
- return e.renderWebview?.(o) ?? Mt({
2059
+ return e.renderWebview?.(o) ?? jt({
2049
2060
  context: {
2050
2061
  workbench: o.workbench,
2051
2062
  webviewId: t.id,
2052
2063
  placement: o.instance,
2053
- hostEvents: Wt(o.workbench, o.instance)
2064
+ hostEvents: Pt(o.workbench, o.instance)
2054
2065
  },
2055
- createHostCapabilities: vo(e, r),
2066
+ createHostCapabilities: ho(e, r),
2056
2067
  createProps: e.createWebviewProps ?? (({
2057
2068
  placement: s
2058
2069
  }) => ({
@@ -2061,41 +2072,41 @@ const me = (e, t = {}) => {
2061
2072
  })),
2062
2073
  createTheme: e.createWebviewTheme,
2063
2074
  ownerId: t.extensionId,
2064
- title: b(t.title, t.id),
2075
+ title: p(t.title, t.id),
2065
2076
  webview: n
2066
2077
  });
2067
2078
  }
2068
2079
  }
2069
2080
  })];
2070
- }), xo = {
2081
+ }), go = {
2071
2082
  first: 1e6,
2072
2083
  default: 0,
2073
2084
  last: -1e6
2074
- }, Ro = (e) => e.metadata.panels.flatMap((t) => t.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
2085
+ }, Io = (e) => e.metadata.panels.flatMap((t) => t.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
2075
2086
  id: t.id,
2076
2087
  ownerViewId: t.ownerPanelId,
2077
2088
  viewId: t.viewId,
2078
2089
  side: t.side,
2079
- priority: xo[t.placement ?? "default"] - n
2080
- })), Ce = (e) => {
2090
+ priority: go[t.placement ?? "default"] - n
2091
+ })), ke = (e) => {
2081
2092
  if (!e || typeof e != "object" || !("statuses" in e) || !Array.isArray(e.statuses))
2082
2093
  throw new Error("Status provider returned an invalid response");
2083
2094
  return e.statuses;
2084
- }, Eo = (e, t) => {
2095
+ }, vo = (e, t) => {
2085
2096
  const n = e.metadata.statuses ?? [];
2086
2097
  if (n.length === 0) return [];
2087
2098
  const o = "workbench.extension-statuses.settings", r = n.map((s, i) => e.workbench.statuses.registerStatusSet({
2088
2099
  id: s.id,
2089
- title: b(s.title, s.id),
2100
+ title: p(s.title, s.id),
2090
2101
  actions: s.actions?.map((a) => ({
2091
2102
  id: a.id,
2092
- label: b(a.label, a.id),
2103
+ label: p(a.label, a.id),
2093
2104
  icon: a.icon
2094
2105
  })),
2095
- query: async () => Ce(await E(t, s.queryHandlerId, {
2106
+ query: async () => ke(await v(t, s.queryHandlerId, {
2096
2107
  params: {}
2097
2108
  })),
2098
- save: s.saveHandlerId ? async (a) => Ce(await E(t, s.saveHandlerId, {
2109
+ save: s.saveHandlerId ? async (a) => ke(await v(t, s.saveHandlerId, {
2099
2110
  params: {
2100
2111
  statuses: a
2101
2112
  }
@@ -2109,7 +2120,7 @@ const me = (e, t = {}) => {
2109
2120
  title: "Statuses",
2110
2121
  body: {
2111
2122
  kind: "react",
2112
- render: () => D(at, {
2123
+ render: () => V(nt, {
2113
2124
  workbench: e.workbench
2114
2125
  })
2115
2126
  }
@@ -2118,13 +2129,13 @@ const me = (e, t = {}) => {
2118
2129
  title: "Statuses",
2119
2130
  icon: "list-checks",
2120
2131
  kind: "view",
2121
- order: go,
2122
- section: e.settingsSectionId ?? Qe,
2132
+ order: uo,
2133
+ section: e.settingsSectionId ?? Ke,
2123
2134
  scope: "project",
2124
2135
  viewId: o
2125
2136
  })), r;
2126
- }, Ao = (e) => {
2127
- const t = [], n = e.settingsSectionId ?? Qe;
2137
+ }, yo = (e) => {
2138
+ const t = [], n = e.settingsSectionId ?? Ke;
2128
2139
  e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
2129
2140
  id: n,
2130
2141
  title: e.settingsSectionTitle ?? "Extensions"
@@ -2133,16 +2144,16 @@ const me = (e, t = {}) => {
2133
2144
  for (const i of o)
2134
2145
  t.push(e.workbench.settings.registerSection({
2135
2146
  id: i.id,
2136
- title: b(i.title, i.id),
2147
+ title: p(i.title, i.id),
2137
2148
  order: i.order,
2138
2149
  scope: i.scope
2139
2150
  }));
2140
2151
  const r = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((i) => [i.key, {
2141
2152
  type: i.type,
2142
- scope: Io(i.scope),
2143
- default: wo(i.default),
2153
+ scope: po(i.scope),
2154
+ default: bo(i.default),
2144
2155
  enum: i.enum,
2145
- description: b(i.description)
2156
+ description: p(i.description)
2146
2157
  }]));
2147
2158
  Object.keys(r).length > 0 && t.push(e.workbench.preferences.registerSchema({
2148
2159
  properties: r
@@ -2151,61 +2162,60 @@ const me = (e, t = {}) => {
2151
2162
  for (const [i, a] of s.entries())
2152
2163
  t.push(e.workbench.settings.registerPanel({
2153
2164
  id: a.id,
2154
- title: b(a.title, a.id),
2165
+ title: p(a.title, a.id),
2155
2166
  icon: a.icon,
2156
2167
  kind: "view",
2157
- order: ho + i,
2168
+ order: mo + i,
2158
2169
  section: a.section ?? n,
2159
2170
  scope: a.scope,
2160
2171
  viewId: a.viewId
2161
2172
  }));
2162
2173
  return t;
2163
- }, B = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), Co = (e, t) => {
2164
- if (!B(e)) return {};
2165
- const n = B(e.indicator) ? {
2174
+ }, X = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), ko = (e, t, n) => ie(e) ? S(e, {
2175
+ extensionId: t,
2176
+ projectId: n
2177
+ }) : void 0, xo = (e, t, n) => {
2178
+ if (!X(e)) return {};
2179
+ const o = X(e.indicator) ? {
2166
2180
  icon: String(e.indicator.icon ?? ""),
2167
2181
  color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
2168
- label: b(e.indicator.label)
2169
- } : void 0, o = Array.isArray(e.menu) ? e.menu.flatMap((r) => !B(r) || typeof r.id != "string" || !Array.isArray(r.rows) ? [] : [{
2170
- id: r.id,
2171
- rows: r.rows.flatMap((s) => {
2172
- if (!B(s) || typeof s.id != "string") return [];
2173
- const i = me(s.action, {
2174
- extensionId: t
2175
- });
2182
+ label: p(e.indicator.label)
2183
+ } : void 0, r = Array.isArray(e.menu) ? e.menu.flatMap((s) => !X(s) || typeof s.id != "string" || !Array.isArray(s.rows) ? [] : [{
2184
+ id: s.id,
2185
+ rows: s.rows.flatMap((i) => {
2186
+ if (!X(i) || typeof i.id != "string") return [];
2187
+ const a = ko(i.action, t, n);
2176
2188
  return [{
2177
- id: s.id,
2178
- label: b(s.label, s.id),
2179
- icon: typeof s.icon == "string" ? s.icon : void 0,
2180
- iconColor: typeof s.iconColor == "string" ? s.iconColor : void 0,
2181
- selected: s.selected === !0,
2182
- disabled: s.disabled === !0,
2183
- action: i ? {
2189
+ id: i.id,
2190
+ label: p(i.label, i.id),
2191
+ icon: typeof i.icon == "string" ? i.icon : void 0,
2192
+ iconColor: typeof i.iconColor == "string" ? i.iconColor : void 0,
2193
+ selected: i.selected === !0,
2194
+ disabled: i.disabled === !0,
2195
+ action: a ? {
2184
2196
  kind: "navigation",
2185
- target: i
2197
+ target: a
2186
2198
  } : void 0
2187
2199
  }];
2188
2200
  })
2189
2201
  }]) : void 0;
2190
2202
  return {
2191
- label: b(e.label),
2203
+ label: p(e.label),
2192
2204
  icon: typeof e.icon == "string" ? e.icon : void 0,
2193
- indicator: n?.icon ? n : void 0,
2194
- menu: o
2205
+ indicator: o?.icon ? o : void 0,
2206
+ menu: r
2195
2207
  };
2196
- }, So = (e, t) => {
2208
+ }, Ro = (e, t) => {
2197
2209
  const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = new Set(t.refreshEventIds ?? []), i = (a) => {
2198
2210
  if (o.has(a.instanceId)) return;
2199
2211
  o.add(a.instanceId);
2200
2212
  const d = a.resource ? {
2201
2213
  type: a.resource.type,
2202
- id: a.resource.id ?? V(a.resource),
2214
+ id: a.resource.id ?? M(a.resource),
2203
2215
  label: a.resource.label,
2204
2216
  metadata: a.resource.metadata
2205
2217
  } : void 0;
2206
- Promise.resolve(e.executeCommand(t.queryHandlerId, {
2207
- projectId: e.projectId,
2208
- source: "dashboard",
2218
+ Promise.resolve(v(e, t.queryHandlerId, {
2209
2219
  resource: d,
2210
2220
  params: {
2211
2221
  renderer: {
@@ -2220,8 +2230,7 @@ const me = (e, t = {}) => {
2220
2230
  }
2221
2231
  }
2222
2232
  })).then((m) => {
2223
- const l = B(m) && B(m.outcome) ? m.outcome.value : m;
2224
- n.set(a.instanceId, Co(l, t.extensionId));
2233
+ n.set(a.instanceId, xo(m, t.extensionId, e.projectId));
2225
2234
  for (const c of r) c();
2226
2235
  }).finally(() => o.delete(a.instanceId));
2227
2236
  };
@@ -2232,8 +2241,8 @@ const me = (e, t = {}) => {
2232
2241
  },
2233
2242
  subscribe(a) {
2234
2243
  r.add(a);
2235
- const d = e.subscribeRefreshEvents?.((l) => {
2236
- s.has(l.id) && (n.clear(), a());
2244
+ const d = e.subscribeRefreshEvents?.((c) => {
2245
+ s.has(c.id) && (n.clear(), a());
2237
2246
  });
2238
2247
  return {
2239
2248
  dispose() {
@@ -2242,24 +2251,24 @@ const me = (e, t = {}) => {
2242
2251
  };
2243
2252
  }
2244
2253
  };
2245
- }, Se = (e) => {
2254
+ }, xe = (e) => {
2246
2255
  for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
2247
- }, pe = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, be = (e, t, n, o, r) => e.prepareCommandArgs?.(t, n, o, r) ?? n, To = (e, t) => t.commands.map((n) => e.workbench.commands.registerCommand({
2256
+ }, de = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, ce = (e, t, n, o, r) => e.prepareCommandArgs?.(t, n, o, r) ?? n, Eo = (e, t) => t.commands.map((n) => e.workbench.commands.registerCommand({
2248
2257
  id: n.id,
2249
- label: b(n.title, n.id),
2250
- description: b(n.description),
2258
+ label: p(n.title, n.id),
2259
+ description: p(n.description),
2251
2260
  params: n.params
2252
2261
  }, {
2253
- prepareArgs: (o, r, s) => be(e, n.id, o, r, s),
2254
- execute: (o, r) => E(e, n.id, {
2255
- params: pe(o),
2262
+ prepareArgs: (o, r, s) => ce(e, n.id, o, r, s),
2263
+ execute: (o, r) => v(e, n.id, {
2264
+ params: de(o),
2256
2265
  resource: r?.resource
2257
2266
  })
2258
- })), Ge = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Po = (e, t) => {
2267
+ })), Le = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Ao = (e, t) => {
2259
2268
  if (!e.menuSlotsById) return [];
2260
2269
  const {
2261
2270
  registrations: n
2262
- } = on({
2271
+ } = Jt({
2263
2272
  metadata: e.metadata,
2264
2273
  menuSlotsById: e.menuSlotsById,
2265
2274
  menuTargetsById: e.menuTargetsById,
@@ -2276,14 +2285,14 @@ const me = (e, t = {}) => {
2276
2285
  }]
2277
2286
  }));
2278
2287
  return (e.menuRegistrations ?? o).flatMap((s) => [e.workbench.commands.registerCommand(s.command, {
2279
- prepareArgs: (i, a, d) => be(t, s.targetCommandId, i, a, d),
2280
- execute: (i, a) => E(t, s.targetCommandId, {
2288
+ prepareArgs: (i, a, d) => ce(t, s.targetCommandId, i, a, d),
2289
+ execute: (i, a) => v(t, s.targetCommandId, {
2281
2290
  params: {
2282
2291
  ...s.contribution.params ?? {},
2283
- ...pe(i) ?? {}
2292
+ ...de(i) ?? {}
2284
2293
  },
2285
- resource: Ge(e, a),
2286
- slot: O({
2294
+ resource: Le(e, a),
2295
+ slot: B({
2287
2296
  id: s.contribution.slotId,
2288
2297
  kind: "menu",
2289
2298
  projectId: e.projectId,
@@ -2296,17 +2305,17 @@ const me = (e, t = {}) => {
2296
2305
  menuPath: i,
2297
2306
  menuItem: a
2298
2307
  }) => e.workbench.layout.registerMenuItem(i, a))]);
2299
- }, jo = (e, t) => sn({
2308
+ }, Co = (e, t) => Zt({
2300
2309
  metadata: e.metadata
2301
2310
  }).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
2302
- prepareArgs: (r, s, i) => be(t, o.targetCommandId, r, s, i),
2303
- execute: (r, s) => E(t, o.targetCommandId, {
2311
+ prepareArgs: (r, s, i) => ce(t, o.targetCommandId, r, s, i),
2312
+ execute: (r, s) => v(t, o.targetCommandId, {
2304
2313
  params: {
2305
2314
  ...o.contribution.params ?? {},
2306
- ...pe(r) ?? {}
2315
+ ...de(r) ?? {}
2307
2316
  },
2308
- resource: Ge(e, s),
2309
- slot: O({
2317
+ resource: Le(e, s),
2318
+ slot: B({
2310
2319
  id: "workbench.commandPalette",
2311
2320
  kind: "menu",
2312
2321
  projectId: e.projectId,
@@ -2315,25 +2324,25 @@ const me = (e, t = {}) => {
2315
2324
  }
2316
2325
  })
2317
2326
  }),
2318
- isVisible: () => rt(o.contribution.when, e.workbench.getPrimaryResource()?.type)
2319
- }), e.workbench.layout.registerMenuItem(ct, o.menuItem)]), $o = (e, t) => {
2327
+ isVisible: () => et(o.contribution.when, e.workbench.getPrimaryResource()?.type)
2328
+ }), e.workbench.layout.registerMenuItem(st, o.menuItem)]), So = (e, t) => {
2320
2329
  const n = t?.mode;
2321
2330
  if (!n) return !0;
2322
2331
  const o = e.workbench.modes.getActiveModeId() ?? "";
2323
2332
  return Array.isArray(n) ? n.includes(o) : n === o;
2324
- }, Ho = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
2333
+ }, To = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
2325
2334
  id: t.id,
2326
2335
  viewId: t.viewId,
2327
2336
  slot: t.slot,
2328
2337
  order: t.order,
2329
- isVisible: () => $o(e, t.when)
2330
- })), Wo = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), Mo = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2338
+ isVisible: () => So(e, t.when)
2339
+ })), Po = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), jo = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2331
2340
  kind: t.id,
2332
- label: b(t.label, t.id),
2341
+ label: p(t.label, t.id),
2333
2342
  icon: t.icon ?? "FileText"
2334
- })), Bo = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
2343
+ })), $o = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
2335
2344
  id: t.modeId,
2336
- label: b(t.label, t.modeId),
2345
+ label: p(t.label, t.modeId),
2337
2346
  panels: t.panelRegions,
2338
2347
  regionSettings: t.regionSettings,
2339
2348
  floatingPanels: t.floatingPanels,
@@ -2341,60 +2350,61 @@ const me = (e, t = {}) => {
2341
2350
  chrome: t.chrome,
2342
2351
  activate: () => {
2343
2352
  }
2344
- })), Vo = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), Yo = (e) => {
2353
+ })), Ho = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), qo = (e) => {
2345
2354
  const t = {
2346
2355
  ...e,
2347
- metadata: lo(e.metadata, {
2348
- createTab: (r) => So(e, r)
2356
+ metadata: so(e.metadata, {
2357
+ createTab: (r) => Ro(e, r)
2349
2358
  })
2350
2359
  }, n = [], o = t;
2351
2360
  try {
2352
- return n.push(...To(o, t.metadata)), n.push(...Xn({
2361
+ return n.push(...Eo(o, t.metadata)), n.push(...qn({
2353
2362
  bindings: t.metadata.keybindings,
2354
2363
  createWhenExpression: t.createKeybindingWhenExpression,
2355
2364
  workbench: t.workbench
2356
- })), n.push(...Po(t, o)), n.push(...jo(t, o)), n.push(Fn({
2365
+ })), n.push(...Ao(t, o)), n.push(...Co(t, o)), n.push(Mn({
2357
2366
  ...t,
2358
2367
  resolveNodeResource: t.resolveTreeNodeResource
2359
- })), n.push(dn(t)), n.push(zt(o, t.metadata.controlsRenderers ?? [])), n.push(...ko(t)), n.push(...Ao(t)), n.push(...Eo(t, o)), n.push(jn(o, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(Xt(o, t.metadata.dataTableRenderers ?? [])), n.push(...Ro(t)), n.push(Ut(o, t.metadata.commandPaletteResources ?? [])), n.push(...Qn({
2368
+ })), n.push(nn(t)), n.push(Kt(o, t.metadata.controlsRenderers ?? [])), n.push(...wo(t)), n.push(...yo(t)), n.push(...vo(t, o)), n.push(An(o, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(qt(o, t.metadata.dataTableRenderers ?? [])), n.push(...Io(t)), n.push(Nt(o, t.metadata.commandPaletteResources ?? [])), n.push(...Ln({
2360
2369
  createWhenExpression: e.createNavigationWhenExpression,
2361
2370
  metadata: e.metadata,
2362
2371
  workbench: e.workbench
2363
- })), e.subscribeRefreshEvents && n.push(po({
2372
+ })), e.subscribeRefreshEvents && n.push(ao({
2364
2373
  metadata: e.metadata,
2365
2374
  subscribe: e.subscribeRefreshEvents,
2366
2375
  workbench: e.workbench
2367
- })), n.push(...Ho(t)), n.push(...Mo(t)), n.push(...Wo(t)), n.push(...Bo(t)), n.push(...Vo(t)), {
2376
+ })), n.push(...To(t)), n.push(...jo(t)), n.push(...Po(t)), n.push(...$o(t)), n.push(...Ho(t)), {
2368
2377
  dispose() {
2369
- Se(n);
2378
+ xe(n);
2370
2379
  }
2371
2380
  };
2372
2381
  } catch (r) {
2373
- throw Se(n), r;
2382
+ throw xe(n), r;
2374
2383
  }
2375
2384
  };
2376
2385
  export {
2377
- sn as buildWorkbenchExtensionCommandPaletteRegistrations,
2378
- on as buildWorkbenchExtensionMenuRegistrations,
2379
- St as createTerminalSessionCapability,
2380
- Pt as createWorkbenchWebviewHostCapabilities,
2381
- qo as emptyWorkbenchExtensionMetadata,
2382
- zo as fileRendererRefreshEnvelopeFromCommand,
2383
- Wt as getBridgeWebviewHostEventPublisher,
2384
- We as isExtensionNavigationTarget,
2385
- Go as refreshOpenWorkbenchExtensionWebviews,
2386
- mo as refreshWorkbenchExtensionRenderer,
2387
- Ut as registerWorkbenchExtensionCommandPaletteResources,
2388
- Yo as registerWorkbenchExtensionContributions,
2389
- zt as registerWorkbenchExtensionControlsRenderers,
2390
- Xt as registerWorkbenchExtensionDataTableRenderers,
2391
- dn as registerWorkbenchExtensionFileRenderers,
2392
- jn as registerWorkbenchExtensionKanbanRenderers,
2393
- po as registerWorkbenchExtensionRendererRefreshEvents,
2394
- Fn as registerWorkbenchExtensionTreeRenderers,
2395
- Mt as renderBridgeWebviewFrame,
2396
- H as toWorkbenchNavigationTarget,
2397
- me as toWorkbenchNavigationTargetResult,
2398
- Qo as toWorkbenchWhenExpression
2386
+ Zt as buildWorkbenchExtensionCommandPaletteRegistrations,
2387
+ Jt as buildWorkbenchExtensionMenuRegistrations,
2388
+ At as createTerminalSessionCapability,
2389
+ St as createWorkbenchWebviewHostCapabilities,
2390
+ Ko as emptyWorkbenchExtensionMetadata,
2391
+ Te as executeWorkbenchExtensionCommandResponse,
2392
+ Lo as fileRendererRefreshEnvelopeFromCommand,
2393
+ Pt as getBridgeWebviewHostEventPublisher,
2394
+ Ae as isExtensionNavigationTarget,
2395
+ Uo as refreshOpenWorkbenchExtensionWebviews,
2396
+ ro as refreshWorkbenchExtensionRenderer,
2397
+ Nt as registerWorkbenchExtensionCommandPaletteResources,
2398
+ qo as registerWorkbenchExtensionContributions,
2399
+ Kt as registerWorkbenchExtensionControlsRenderers,
2400
+ qt as registerWorkbenchExtensionDataTableRenderers,
2401
+ nn as registerWorkbenchExtensionFileRenderers,
2402
+ An as registerWorkbenchExtensionKanbanRenderers,
2403
+ ao as registerWorkbenchExtensionRendererRefreshEvents,
2404
+ Mn as registerWorkbenchExtensionTreeRenderers,
2405
+ jt as renderBridgeWebviewFrame,
2406
+ S as toWorkbenchNavigationTarget,
2407
+ Ce as toWorkbenchNavigationTargetResult,
2408
+ _o as toWorkbenchWhenExpression
2399
2409
  };
2400
2410
  //# sourceMappingURL=extensions.js.map