@pstdio/workbench 0.3.0 → 0.5.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,82 +1,82 @@
1
- import { jsxs as de, jsx as P } from "react/jsx-runtime";
2
- import { useRef as I, useState as He, useEffect as A, createElement as V } from "react";
3
- import { host as Ve } from "rimless";
4
- import { W as F } from "./icon-B9XolQG8.js";
5
- import { isLocalizedString as Fe, matchesResourceWhen as Le } from "@pstdio/sdk/extensions";
6
- import { w as Oe } from "./workbench-menu-paths-B_QJzcNU.js";
7
- const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ie = ["host.dispatchKeyboardEvent"], Ue = [...Ne, ...Ie], _e = new Set(Ue), ye = (e) => _e.has(e), qe = (e) => {
8
- const [t, r] = e.split("@"), o = r === void 0 ? X : Number(r);
1
+ import { jsxs as be, jsx as S } from "react/jsx-runtime";
2
+ import { useRef as I, useState as fe, useEffect as T, createElement as W } from "react";
3
+ import { host as _e } from "rimless";
4
+ import { W as j } from "./icon-B9XolQG8.js";
5
+ import { isLocalizedString as qe, matchesResourceWhen as ze } from "@pstdio/sdk/extensions";
6
+ import { w as Qe } from "./workbench-menu-paths-B_QJzcNU.js";
7
+ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ee = ["host.dispatchKeyboardEvent"], Ye = [...Ge, ...Ee], Xe = new Set(Ye), xe = (e) => Xe.has(e), Je = (e) => {
8
+ const [t, r] = e.split("@"), n = r === void 0 ? te : Number(r);
9
9
  return {
10
10
  capability: e,
11
11
  name: t ?? "",
12
- version: o
12
+ version: n
13
13
  };
14
- }, D = (e) => ({
14
+ }, V = (e) => ({
15
15
  capability: e,
16
16
  code: "unsupported_webview_capability",
17
17
  message: `Unsupported webview capability: ${e}`,
18
18
  severity: "error"
19
- }), ze = (e, t, r) => ({
19
+ }), Ze = (e, t, r) => ({
20
20
  capability: e,
21
21
  code: "unsupported_webview_capability_version",
22
- message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${X.toString()})`,
22
+ message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${te.toString()})`,
23
23
  severity: "error"
24
- }), Qe = (e) => ({
24
+ }), et = (e) => ({
25
25
  capability: e,
26
26
  code: "undeclared_webview_capability",
27
27
  message: `Webview did not declare host capability: ${e}`,
28
28
  severity: "error"
29
- }), Ge = (e, t = {}) => {
30
- const r = [], o = /* @__PURE__ */ new Set();
31
- for (const n of Ie)
32
- t[n] && o.add(n);
33
- for (const n of e ?? []) {
34
- const s = qe(n);
35
- if (!ye(s.name)) {
36
- r.push(D(n));
29
+ }), tt = (e, t = {}) => {
30
+ const r = [], n = /* @__PURE__ */ new Set();
31
+ for (const o of Ee)
32
+ t[o] && n.add(o);
33
+ for (const o of e ?? []) {
34
+ const s = Je(o);
35
+ if (!xe(s.name)) {
36
+ r.push(V(o));
37
37
  continue;
38
38
  }
39
- if (s.version !== X) {
40
- r.push(ze(n, s.name, s.version));
39
+ if (s.version !== te) {
40
+ r.push(Ze(o, s.name, s.version));
41
41
  continue;
42
42
  }
43
43
  if (!t[s.name]) {
44
- r.push(D(n));
44
+ r.push(V(o));
45
45
  continue;
46
46
  }
47
- o.add(s.name);
47
+ n.add(s.name);
48
48
  }
49
49
  return {
50
- allowed: o,
50
+ allowed: n,
51
51
  diagnostics: r
52
52
  };
53
- }, Ye = (e) => {
53
+ }, rt = (e) => {
54
54
  const {
55
55
  allowed: t,
56
56
  diagnostics: r
57
- } = Ge(e.declaredCapabilities, e.capabilities), o = (n) => {
58
- e.onDiagnostic?.(n);
57
+ } = tt(e.declaredCapabilities, e.capabilities), n = (o) => {
58
+ e.onDiagnostic?.(o);
59
59
  };
60
60
  return {
61
61
  diagnostics: r,
62
- async call(n) {
63
- if (!ye(n.method)) {
64
- const a = D(n.method);
65
- throw o(a), new Error(a.message);
62
+ async call(o) {
63
+ if (!xe(o.method)) {
64
+ const i = V(o.method);
65
+ throw n(i), new Error(i.message);
66
66
  }
67
- if (!t.has(n.method)) {
68
- const a = Qe(n.method);
69
- throw o(a), new Error(a.message);
67
+ if (!t.has(o.method)) {
68
+ const i = et(o.method);
69
+ throw n(i), new Error(i.message);
70
70
  }
71
- const s = e.capabilities[n.method];
71
+ const s = e.capabilities[o.method];
72
72
  if (!s) {
73
- const a = D(n.method);
74
- throw o(a), new Error(a.message);
73
+ const i = V(o.method);
74
+ throw n(i), new Error(i.message);
75
75
  }
76
- return await s(n.params);
76
+ return await s(o.params);
77
77
  }
78
78
  };
79
- }, Xe = (e) => typeof e == "object" && e !== null, ce = (e) => {
79
+ }, nt = (e) => typeof e == "object" && e !== null, pe = (e) => {
80
80
  try {
81
81
  const t = JSON.stringify(e);
82
82
  if (typeof t == "string" && t.length > 0) return t;
@@ -87,7 +87,7 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
87
87
  } catch {
88
88
  return "Unknown error";
89
89
  }
90
- }, Je = (e) => {
90
+ }, ot = (e) => {
91
91
  if (e instanceof Error) return {
92
92
  message: e.message,
93
93
  stack: e.stack
@@ -95,7 +95,7 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
95
95
  if (typeof e == "string") return {
96
96
  message: e
97
97
  };
98
- if (Xe(e)) {
98
+ if (nt(e)) {
99
99
  const t = typeof e.message == "string" ? e.message : null, r = typeof e.stack == "string" ? e.stack : void 0;
100
100
  return t ? r ? {
101
101
  message: t,
@@ -103,42 +103,42 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
103
103
  } : {
104
104
  message: t
105
105
  } : {
106
- message: ce(e)
106
+ message: pe(e)
107
107
  };
108
108
  }
109
109
  return e == null ? {
110
110
  message: "Unknown error"
111
111
  } : {
112
- message: ce(e)
112
+ message: pe(e)
113
113
  };
114
- }, U = () => {
114
+ }, Q = () => {
115
115
  if (typeof document > "u") return {};
116
116
  const e = getComputedStyle(document.documentElement), t = {};
117
117
  for (let r = 0; r < e.length; r += 1) {
118
- const o = e.item(r);
119
- o.startsWith("--chakra-") && (t[o] = e.getPropertyValue(o).trim());
118
+ const n = e.item(r);
119
+ n.startsWith("--chakra-") && (t[n] = e.getPropertyValue(n).trim());
120
120
  }
121
121
  return t;
122
- }, _ = (e) => {
122
+ }, G = (e) => {
123
123
  if (typeof document > "u") return e;
124
124
  const t = document.documentElement.getAttribute("data-theme");
125
125
  if (t === "dark" || t === "light") return t;
126
126
  const r = document.documentElement.getAttribute("data-color-mode");
127
127
  return r === "dark" || r === "light" ? r : e;
128
- }, Ze = {
128
+ }, st = {
129
129
  border: 0,
130
130
  display: "block",
131
131
  flex: "1 1 0%",
132
132
  height: "100%",
133
133
  minHeight: 0,
134
134
  width: "100%"
135
- }, et = {
135
+ }, it = {
136
136
  display: "flex",
137
137
  height: "100%",
138
138
  minHeight: 0,
139
139
  position: "relative",
140
140
  width: "100%"
141
- }, tt = {
141
+ }, at = {
142
142
  alignItems: "center",
143
143
  background: "rgba(255, 255, 255, 0.92)",
144
144
  color: "#7a1f12",
@@ -149,151 +149,163 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
149
149
  position: "absolute",
150
150
  textAlign: "center",
151
151
  zIndex: 1
152
- }, rt = "allow-scripts allow-forms allow-popups", ot = (e) => {
152
+ }, dt = "allow-scripts allow-forms allow-popups", ct = (e) => {
153
153
  const {
154
154
  view: t,
155
155
  props: r,
156
- theme: o,
157
- capabilities: n,
156
+ theme: n,
157
+ capabilities: o,
158
158
  hostEvents: s,
159
- onReady: a,
159
+ onReady: i,
160
160
  onError: d,
161
161
  onDiagnostics: c,
162
162
  title: b
163
- } = e, i = I(null), l = I(null), u = I(!1), f = I(null), p = I(r), h = I(o), v = I(n), te = I(s), re = I(t.webview.capabilities), oe = I(a), M = I(d), ne = I(c), [se, $] = He(null);
164
- return p.current = r, h.current = o, v.current = n, te.current = s, re.current = t.webview.capabilities, oe.current = a, M.current = d, ne.current = c, A(() => {
165
- const w = i.current;
166
- if (!w) return;
167
- const R = `${t.webview.runtimeUrl}
163
+ } = e, a = I(null), l = I(null), m = I(!1), f = I(null), p = I(r), w = I(n), v = I(o), se = I(s), ie = I(t.webview.capabilities), ae = I(i), L = I(d), de = I(c), [ce, O] = fe(null), [q, le] = fe(0);
164
+ return p.current = r, w.current = n, v.current = o, se.current = s, ie.current = t.webview.capabilities, ae.current = i, L.current = d, de.current = c, T(() => {
165
+ const h = a.current;
166
+ if (!h) return;
167
+ const C = () => {
168
+ m.current && le((g) => g + 1);
169
+ };
170
+ h.addEventListener("load", C);
171
+ const E = () => h.removeEventListener("load", C), P = `${q}
172
+ ${t.webview.runtimeUrl}
168
173
  ${t.webview.moduleUrl}`;
169
- if (f.current === R) return;
170
- f.current = R, u.current = !1, l.current = null;
171
- const x = t.webview.styles, B = t.webview.moduleUrl, ie = (g) => {
172
- g.length > 0 && ne.current?.(g);
173
- }, ae = () => Ye({
174
+ if (f.current === P) return E;
175
+ f.current = P;
176
+ const Ve = t.webview.styles, Fe = t.webview.moduleUrl, me = (g) => {
177
+ g.length > 0 && de.current?.(g);
178
+ }, ue = () => rt({
174
179
  capabilities: v.current ?? {},
175
- declaredCapabilities: re.current,
176
- onDiagnostic: (g) => ie([g])
180
+ declaredCapabilities: ie.current,
181
+ onDiagnostic: (g) => me([g])
177
182
  });
178
- ie(ae().diagnostics);
179
- const $e = {
183
+ me(ue().diagnostics);
184
+ const Ne = {
180
185
  ready: () => {
181
186
  },
182
187
  runtimeError: (g) => {
183
- $(g.message), M.current?.(g);
188
+ O(g.message), L.current?.(g);
184
189
  },
185
- call: async (g) => await ae().call(g)
186
- }, Be = Ve.connect(w, $e);
187
- return w.contentWindow?.location.replace(t.webview.runtimeUrl), Be.then(async (g) => {
188
- const C = g.remote;
189
- l.current = C, te.current?.bind((De) => C.hostEvent?.(De)), await C.init({
190
- moduleUrl: B,
191
- styles: x,
192
- props: p.current,
193
- theme: _(h.current),
194
- themeVariables: U()
195
- }), u.current = !0, $(null), oe.current?.();
196
- }).catch((g) => {
197
- const C = Je(g);
198
- $(C.message), M.current?.(C);
199
- }), () => {
190
+ call: async (g) => await ue().call(g)
200
191
  };
201
- }, [t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), A(() => {
202
- const w = l.current;
203
- if (!(!w || !s))
204
- return s.bind((R) => w.hostEvent?.(R)), () => s.unbind();
205
- }, [s]), A(() => {
206
- u.current && l.current?.propsUpdate({
192
+ return (() => {
193
+ m.current = !1, l.current = null;
194
+ const g = _e.connect(h, Ne);
195
+ h.contentWindow?.location.replace(t.webview.runtimeUrl), g.then(async (z) => {
196
+ const x = z.remote;
197
+ l.current = x, se.current?.bind((Ue) => x.hostEvent?.(Ue)), await x.init({
198
+ moduleUrl: Fe,
199
+ styles: Ve,
200
+ props: p.current,
201
+ theme: G(w.current),
202
+ themeVariables: Q()
203
+ }), m.current = !0, O(null), ae.current?.();
204
+ }).catch((z) => {
205
+ const x = ot(z);
206
+ O(x.message), L.current?.(x);
207
+ });
208
+ })(), E;
209
+ }, [q, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), T(() => {
210
+ const h = l.current;
211
+ if (!(!h || !s))
212
+ return s.bind((C) => h.hostEvent?.(C)), () => s.unbind();
213
+ }, [s]), T(() => {
214
+ m.current && l.current?.propsUpdate({
207
215
  props: r
208
216
  });
209
- }, [r]), A(() => {
210
- u.current && l.current?.themeUpdate({
211
- theme: _(o),
212
- variables: U()
217
+ }, [r]), T(() => {
218
+ m.current && l.current?.themeUpdate({
219
+ theme: G(n),
220
+ variables: Q()
213
221
  });
214
- }, [o]), A(() => {
222
+ }, [n]), T(() => {
215
223
  if (typeof window > "u" || typeof MutationObserver > "u") return;
216
- let w = null;
217
- const R = () => {
218
- w !== null && cancelAnimationFrame(w), w = requestAnimationFrame(() => {
219
- w = null, u.current && l.current?.themeUpdate({
220
- theme: _(h.current),
221
- variables: U()
224
+ let h = null;
225
+ const C = () => {
226
+ h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
227
+ h = null, m.current && l.current?.themeUpdate({
228
+ theme: G(w.current),
229
+ variables: Q()
222
230
  });
223
231
  });
224
- }, x = new MutationObserver(R), B = {
232
+ }, E = new MutationObserver(C), P = {
225
233
  attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
226
234
  attributes: !0
227
235
  };
228
- return x.observe(document.documentElement, B), x.observe(document.body, B), () => {
229
- x.disconnect(), w !== null && cancelAnimationFrame(w);
236
+ return E.observe(document.documentElement, P), E.observe(document.body, P), () => {
237
+ E.disconnect(), h !== null && cancelAnimationFrame(h);
230
238
  };
231
- }, []), /* @__PURE__ */ de("div", { style: et, children: [
232
- se ? /* @__PURE__ */ P("div", { role: "alert", style: tt, children: /* @__PURE__ */ de("div", { children: [
233
- /* @__PURE__ */ P("strong", { children: "Extension view failed to load." }),
234
- /* @__PURE__ */ P("div", { children: se })
239
+ }, []), /* @__PURE__ */ be("div", { style: it, children: [
240
+ ce ? /* @__PURE__ */ S("div", { role: "alert", style: at, children: /* @__PURE__ */ be("div", { children: [
241
+ /* @__PURE__ */ S("strong", { children: "Extension view failed to load." }),
242
+ /* @__PURE__ */ S("div", { children: ce })
235
243
  ] }) }) : null,
236
- /* @__PURE__ */ P(
244
+ /* @__PURE__ */ S(
237
245
  "iframe",
238
246
  {
239
- ref: i,
247
+ ref: a,
240
248
  title: b ?? t.label,
241
249
  allow: "fullscreen",
242
250
  allowFullScreen: !0,
243
- sandbox: rt,
251
+ sandbox: dt,
244
252
  style: {
245
- ...Ze,
246
- colorScheme: o
253
+ ...st,
254
+ colorScheme: n
255
+ },
256
+ onLoad: () => {
257
+ m.current && le((h) => h + 1);
247
258
  },
248
259
  onError: () => {
249
- const w = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
250
- $(w), M.current?.({
251
- message: w
260
+ const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
261
+ O(h), L.current?.({
262
+ message: h
252
263
  });
253
264
  }
254
- }
265
+ },
266
+ q
255
267
  )
256
268
  ] });
257
- }, nt = () => {
269
+ }, lt = () => {
258
270
  let e = null;
259
271
  const t = [], r = /* @__PURE__ */ new Set();
260
272
  return {
261
- emit(o) {
262
- e ? e(o) : t.push(o);
273
+ emit(n) {
274
+ e ? e(n) : t.push(n);
263
275
  },
264
- bind(o) {
265
- for (e = o; t.length > 0; ) o(t.shift());
276
+ bind(n) {
277
+ for (e = n; t.length > 0; ) n(t.shift());
266
278
  },
267
- onDisconnect(o) {
268
- return r.add(o), () => r.delete(o);
279
+ onDisconnect(n) {
280
+ return r.add(n), () => r.delete(n);
269
281
  },
270
282
  unbind() {
271
283
  e = null;
272
- for (const o of r) o();
284
+ for (const n of r) n();
273
285
  }
274
286
  };
275
- }, st = "terminal.session", it = (e) => {
287
+ }, mt = "terminal.session", ut = (e) => {
276
288
  const {
277
289
  terminal: t,
278
290
  hostEvents: r
279
- } = e, o = (n) => {
291
+ } = e, n = (o) => {
280
292
  r.emit({
281
- scope: st,
282
- payload: n
293
+ scope: mt,
294
+ payload: o
283
295
  });
284
296
  };
285
- return async (n) => {
286
- const s = n;
297
+ return async (o) => {
298
+ const s = o;
287
299
  switch (s.operation) {
288
300
  case "open": {
289
301
  const {
290
- sessionId: a
302
+ sessionId: i
291
303
  } = await t.open({
292
304
  request: s.request
293
305
  });
294
306
  return {
295
307
  operation: "open",
296
- sessionId: a
308
+ sessionId: i
297
309
  };
298
310
  }
299
311
  case "write":
@@ -323,36 +335,36 @@ ${t.webview.moduleUrl}`;
323
335
  };
324
336
  case "subscribe": {
325
337
  const {
326
- sessionId: a
338
+ sessionId: i
327
339
  } = s;
328
340
  let d = () => {
329
341
  }, c = () => {
330
342
  }, b = !1;
331
- const i = () => {
343
+ const a = () => {
332
344
  b || (b = !0, d(), c());
333
345
  };
334
- return d = t.subscribe(a, {
335
- onData: (l) => o({
336
- sessionId: a,
346
+ return d = t.subscribe(i, {
347
+ onData: (l) => n({
348
+ sessionId: i,
337
349
  kind: "data",
338
350
  chunk: l
339
351
  }),
340
352
  onExit: (l) => {
341
- o({
342
- sessionId: a,
353
+ n({
354
+ sessionId: i,
343
355
  kind: "exit",
344
356
  code: l.code,
345
357
  signal: l.signal
346
- }), i();
358
+ }), a();
347
359
  }
348
- }), c = r.onDisconnect(i), {
360
+ }), c = r.onDisconnect(a), {
349
361
  operation: "subscribe",
350
362
  accepted: !0
351
363
  };
352
364
  }
353
365
  }
354
366
  };
355
- }, at = (e) => {
367
+ }, bt = (e) => {
356
368
  if (typeof document > "u") return;
357
369
  const t = new KeyboardEvent("keydown", {
358
370
  ...e,
@@ -360,7 +372,7 @@ ${t.webview.moduleUrl}`;
360
372
  cancelable: !0
361
373
  });
362
374
  document.dispatchEvent(t);
363
- }, ve = (e) => ({
375
+ }, Ae = (e) => ({
364
376
  "commands.execute": (t) => {
365
377
  const r = t;
366
378
  return e.workbench.commands.executeCommand(r.commandId, r.params);
@@ -391,79 +403,79 @@ ${t.webview.moduleUrl}`;
391
403
  value: r.value
392
404
  };
393
405
  },
394
- "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? at)(t),
406
+ "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? bt)(t),
395
407
  ...e.hostEvents ? {
396
- "terminal.session": it({
408
+ "terminal.session": ut({
397
409
  terminal: e.workbench.terminal,
398
410
  hostEvents: e.hostEvents
399
411
  })
400
412
  } : {}
401
- }), dt = (e, t) => {
413
+ }), ft = (e, t) => {
402
414
  for (const r of t)
403
415
  console.warn(`[workbench.webview:${e}] ${r.code}/${r.capability}: ${r.message}`);
404
- }, ct = (e, t) => {
416
+ }, pt = (e, t) => {
405
417
  console.error(`[workbench.webview:${e}] runtime error: ${t}`);
406
- }, T = "webview:bridge", lt = (e) => {
418
+ }, K = "webview:bridge", ht = (e) => {
407
419
  if (typeof e != "object" || e === null || Array.isArray(e)) return !1;
408
420
  const t = e;
409
421
  return typeof t.runtimeUrl == "string" && typeof t.moduleUrl == "string";
410
- }, mt = ({
422
+ }, wt = ({
411
423
  placement: e
412
424
  }) => ({
413
425
  placement: e,
414
426
  resource: e.resource
415
- }), ke = () => "light", le = /* @__PURE__ */ new WeakMap(), Re = (e, t) => {
416
- let r = le.get(e);
417
- r || (r = /* @__PURE__ */ new Map(), le.set(e, r));
418
- const o = t.instanceId;
419
- let n = r.get(o);
420
- return n || (n = nt(), r.set(o, n)), n;
421
- }, Ce = (e) => {
427
+ }), Pe = () => "light", he = /* @__PURE__ */ new WeakMap(), Te = (e, t) => {
428
+ let r = he.get(e);
429
+ r || (r = /* @__PURE__ */ new Map(), he.set(e, r));
430
+ const n = t.instanceId;
431
+ let o = r.get(n);
432
+ return o || (o = lt(), r.set(n, o)), o;
433
+ }, Se = (e) => {
422
434
  const {
423
435
  context: t,
424
436
  createHostCapabilities: r,
425
- createProps: o,
426
- createTheme: n = ke,
437
+ createProps: n,
438
+ createTheme: o = Pe,
427
439
  ownerId: s,
428
- title: a,
440
+ title: i,
429
441
  webview: d
430
442
  } = e;
431
- return /* @__PURE__ */ P(ot, { view: {
443
+ return /* @__PURE__ */ S(ct, { view: {
432
444
  extensionId: s ?? "workbench",
433
445
  id: t.webviewId,
434
- label: d.title ?? a,
446
+ label: d.title ?? i,
435
447
  webview: {
436
448
  capabilities: d.capabilities,
437
449
  moduleUrl: d.moduleUrl,
438
450
  runtimeUrl: d.runtimeUrl,
439
451
  styles: d.styles ?? []
440
452
  }
441
- }, props: o(t), theme: n(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (c) => dt(t.webviewId, c), onError: (c) => ct(t.webviewId, c.message) });
442
- }, ut = (e, t, r, o) => {
453
+ }, props: n(t), theme: o(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (c) => ft(t.webviewId, c), onError: (c) => pt(t.webviewId, c.message) });
454
+ }, gt = (e, t, r, n) => {
443
455
  const {
444
- workbench: n,
456
+ workbench: o,
445
457
  panel: s,
446
- instance: a
447
- } = e, d = lt(s.config) ? s.config : null;
448
- return d ? Ce({
458
+ instance: i
459
+ } = e, d = ht(s.config) ? s.config : null;
460
+ return d ? Se({
449
461
  context: {
450
- workbench: n,
451
- webviewId: a.panelId,
452
- placement: a,
453
- hostEvents: Re(n, a)
462
+ workbench: o,
463
+ webviewId: i.panelId,
464
+ placement: i,
465
+ hostEvents: Te(o, i)
454
466
  },
455
467
  createHostCapabilities: t,
456
468
  createProps: r,
457
- createTheme: o,
469
+ createTheme: n,
458
470
  ownerId: "ownerId" in s ? s.ownerId : void 0,
459
471
  title: s.title,
460
472
  webview: d
461
473
  }) : null;
462
- }, bt = (e = {}) => {
463
- const t = e.createHostCapabilities ?? ve, r = e.createProps ?? mt, o = e.createTheme ?? ke;
474
+ }, It = (e = {}) => {
475
+ const t = e.createHostCapabilities ?? Ae, r = e.createProps ?? wt, n = e.createTheme ?? Pe;
464
476
  return {
465
- id: T,
466
- render: (n) => ut(n, t, r, o)
477
+ id: K,
478
+ render: (o) => gt(o, t, r, n)
467
479
  };
468
480
  }, y = (e, t) => ({
469
481
  id: e,
@@ -495,12 +507,12 @@ y("workspace.headerPrimary", {
495
507
  }), y("workspace.sidenav", {
496
508
  kind: "panel"
497
509
  });
498
- const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", m = (e, t = "") => e === void 0 ? t : ft(e) ? e.default ?? e.$l10n : e, L = (e) => {
510
+ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", u = (e, t = "") => e === void 0 ? t : yt(e) ? e.default ?? e.$l10n : e, N = (e) => {
499
511
  const t = e;
500
512
  if (!t?.outcome) return e;
501
513
  if (t.outcome.status === "success") return t.outcome.value;
502
514
  throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
503
- }, J = (e) => {
515
+ }, re = (e) => {
504
516
  if (e)
505
517
  return {
506
518
  type: e.kind,
@@ -508,13 +520,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
508
520
  label: e.label,
509
521
  metadata: e.metadata
510
522
  };
511
- }, O = (e) => ({
523
+ }, U = (e) => ({
512
524
  kind: e.type,
513
525
  uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
514
526
  id: e.id,
515
527
  label: e.label,
516
528
  metadata: e.metadata
517
- }), S = (e) => ({
529
+ }), M = (e) => ({
518
530
  id: e.id,
519
531
  kind: e.kind,
520
532
  context: {
@@ -522,13 +534,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
522
534
  ...e.context ?? {}
523
535
  }
524
536
  }), k = async (e, t, r = {}) => {
525
- const o = J(r.resource), n = await e.executeCommand(t, {
537
+ const n = re(r.resource), o = await e.executeCommand(t, {
526
538
  projectId: e.projectId,
527
539
  ...r.params ? {
528
540
  params: r.params
529
541
  } : {},
530
- ...o ? {
531
- resource: o
542
+ ...n ? {
543
+ resource: n
532
544
  } : {},
533
545
  ...r.slot ? {
534
546
  slot: r.slot
@@ -538,168 +550,189 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
538
550
  metadata: r.metadata
539
551
  } : {}
540
552
  });
541
- return L(n);
542
- }, pt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ht = (e) => typeof e == "string" ? e : e?.id, wt = async (e, t) => {
553
+ return N(o);
554
+ }, vt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), kt = (e) => typeof e == "string" ? e : e?.id, Rt = async (e, t) => {
543
555
  if (t.kind === "resource" && t.resource) {
544
- await e.workbench.resources.openResource(O(t.resource), {
556
+ await e.workbench.resources.openResource(U(t.resource), {
545
557
  replaceActive: !0
546
558
  }).catch(() => {
547
559
  });
548
560
  return;
549
561
  }
550
- const r = ht(t.command);
562
+ const r = kt(t.command);
551
563
  r && (await k(e, r, {
552
564
  params: t.params
553
565
  }), e.workbench.commandPaletteResources.refresh());
554
- }, gt = (e, t, r, o) => ({
555
- id: `${t.id}:${o.id}`,
556
- label: o.label,
557
- description: o.description,
558
- icon: o.icon,
559
- keywords: o.keywords,
566
+ }, Ct = (e, t, r, n) => ({
567
+ id: `${t.id}:${n.id}`,
568
+ label: n.label,
569
+ description: n.description,
570
+ icon: n.icon,
571
+ keywords: n.keywords,
560
572
  group: r,
561
- activate: () => wt(e, o.target)
562
- }), It = (e, t) => {
573
+ activate: () => Rt(e, n.target)
574
+ }), Et = (e, t) => {
563
575
  const r = [];
564
- for (const o of t) {
565
- const n = m(o.title, o.id);
576
+ for (const n of t) {
577
+ const o = u(n.title, n.id);
566
578
  r.push(e.workbench.commandPaletteResources.registerProvider({
567
- id: o.id,
568
- title: n,
569
- refreshEventIds: o.refreshEventIds,
579
+ id: n.id,
580
+ title: o,
581
+ refreshEventIds: n.refreshEventIds,
570
582
  query: async ({
571
583
  query: s,
572
- limit: a
584
+ limit: i
573
585
  }) => {
574
- const d = e.workbench.getActiveResource(), c = await k(e, o.queryCommandId, {
586
+ const d = e.workbench.getActiveResource(), c = await k(e, n.queryCommandId, {
575
587
  params: {
576
588
  projectId: e.projectId,
577
589
  modeId: e.workbench.modes.getActiveModeId(),
578
- activeResource: J(d),
579
- providerId: o.id,
590
+ activeResource: re(d),
591
+ providerId: n.id,
580
592
  query: s,
581
- limit: a
593
+ limit: i
582
594
  }
583
595
  });
584
- return pt(c) ? (c.items ?? []).map((b) => gt(e, o, n, b)) : [];
596
+ return vt(c) ? (c.items ?? []).map((b) => Ct(e, n, o, b)) : [];
585
597
  }
586
598
  }));
587
599
  }
588
600
  return {
589
601
  dispose() {
590
- for (let o = r.length - 1; o >= 0; o -= 1) r[o]?.dispose();
602
+ for (let n = r.length - 1; n >= 0; n -= 1) r[n]?.dispose();
591
603
  }
592
604
  };
593
- }, N = (e) => ({
594
- title: m(e.title),
605
+ }, _ = (e) => ({
606
+ title: u(e.title),
595
607
  runtimeUrl: e.runtimeUrl,
596
608
  moduleUrl: e.moduleUrl,
597
609
  styles: e.styles,
598
610
  capabilities: e.capabilities
599
- }), W = (e) => e ? {
611
+ }), D = (e) => e ? {
600
612
  resourceKinds: e.resourceKinds ? [...e.resourceKinds] : void 0
601
- } : void 0, yt = (e) => {
602
- const t = e.treeRendererId ?? e.fileRendererId ?? e.controlsRendererId ?? e.dataTableRendererId ?? (e.webview ? T : void 0);
613
+ } : void 0, xt = {
614
+ first: 1e6,
615
+ default: 0,
616
+ last: -1e6
617
+ }, A = (e) => ({
618
+ priority: xt[e.placement ?? "default"] - (e.declarationIndex ?? 0)
619
+ }), $ = (e) => {
620
+ const t = [];
621
+ let r = 0;
622
+ for (const n of e)
623
+ t.push(r), r += n.panelMenus?.length ?? 0;
624
+ return t;
625
+ }, At = (e) => {
626
+ const t = e.treeRendererId ?? e.fileRendererId ?? e.controlsRendererId ?? e.dataTableRendererId ?? (e.webview ? K : void 0);
603
627
  if (!t) throw new Error(`Panel Menu has no renderer: ${e.id}`);
604
628
  return t;
605
- }, j = (e) => e?.map((t) => ({
606
- id: t.id,
607
- title: m(t.title, t.id),
608
- side: t.side,
609
- rendererId: yt(t),
610
- config: t.webview ? N(t.webview) : void 0
611
- })), K = (e) => e.workbench.layout.registerPanel(e.contribution), q = (e, t = "") => m(e, t), vt = (e) => !!e && typeof e == "object" && !Array.isArray(e), kt = (e, t, r) => {
612
- const o = (n, s, a) => n ? k(e, n, {
629
+ }, B = (e, t = 0) => e?.map((r, n) => ({
630
+ id: r.id,
631
+ title: u(r.title, r.id),
632
+ side: r.side,
633
+ rendererId: At(r),
634
+ config: r.webview ? _(r.webview) : void 0,
635
+ ...A({
636
+ placement: r.placement,
637
+ declarationIndex: t + n
638
+ })
639
+ })), H = (e) => e.workbench.layout.registerPanel(e.contribution), Y = (e, t = "") => u(e, t), Pt = (e) => !!e && typeof e == "object" && !Array.isArray(e), Tt = (e, t, r) => {
640
+ const n = (o, s, i) => o ? k(e, o, {
613
641
  params: s,
614
- resource: a
642
+ resource: i
615
643
  }) : Promise.resolve(void 0);
616
644
  return e.workbench.renderers.registerControlsRenderer({
617
645
  id: t.id,
618
- title: q(t.title, t.id),
619
- emptyTitle: q(t.emptyTitle, ""),
620
- emptyDescription: q(t.emptyDescription, ""),
646
+ title: Y(t.title, t.id),
647
+ emptyTitle: Y(t.emptyTitle, ""),
648
+ emptyDescription: Y(t.emptyDescription, ""),
621
649
  defaultValues: t.defaultValues,
622
- executeQuery: async (n) => {
623
- const s = await o(t.queryCommandId, {}, n ?? r.resolveResource?.(t));
624
- return vt(s) ? s : {};
650
+ executeQuery: async (o) => {
651
+ const s = await n(t.queryCommandId, {}, o ?? r.resolveResource?.(t));
652
+ return Pt(s) ? s : {};
625
653
  },
626
654
  updateValue: t.updateValueCommandId ? ({
627
- controlId: n,
655
+ controlId: o,
628
656
  value: s,
629
- values: a,
657
+ values: i,
630
658
  resource: d
631
- }) => o(t.updateValueCommandId, {
632
- controlId: n,
659
+ }) => n(t.updateValueCommandId, {
660
+ controlId: o,
633
661
  value: s,
634
- values: a
662
+ values: i
635
663
  }, d).then(() => {
636
664
  }) : void 0,
637
665
  apply: t.applyCommandId ? ({
638
- values: n,
666
+ values: o,
639
667
  resource: s
640
- }) => o(t.applyCommandId, {
641
- values: n
668
+ }) => n(t.applyCommandId, {
669
+ values: o
642
670
  }, s).then(() => {
643
671
  }) : void 0,
644
672
  reset: t.resetCommandId ? ({
645
- controlIds: n,
673
+ controlIds: o,
646
674
  resource: s
647
- }) => o(t.resetCommandId, {
648
- controlIds: n
675
+ }) => n(t.resetCommandId, {
676
+ controlIds: o
649
677
  }, s).then(() => {
650
678
  }) : void 0
651
679
  });
652
- }, Rt = (e, t) => {
680
+ }, St = (e, t, r, n) => {
653
681
  if (t.controlsRendererId)
654
- return K({
682
+ return H({
655
683
  workbench: e.workbench,
656
684
  contribution: {
657
685
  id: t.id,
658
- title: m(t.title, t.id),
686
+ title: u(t.title, t.id),
687
+ icon: t.icon,
659
688
  region: t.region,
660
689
  closable: t.closable,
661
690
  rendererId: t.controlsRendererId,
662
691
  singleton: !0,
663
692
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
664
- eligibleLocations: W(t.eligibleLocations),
665
- panelMenus: j(t.panelMenus)
693
+ eligibleLocations: D(t.eligibleLocations),
694
+ panelMenus: B(t.panelMenus, n),
695
+ ...A({
696
+ placement: t.placement,
697
+ declarationIndex: r
698
+ })
666
699
  }
667
700
  });
668
- }, oo = (e, t, r, o = {}) => {
669
- const n = [];
670
- for (const s of t) n.push(kt(e, s, o));
671
- for (const s of r) {
672
- const a = Rt(e, s);
673
- a && n.push(a);
674
- }
675
- return {
701
+ }, un = (e, t, r, n = {}) => {
702
+ const o = [];
703
+ for (const i of t) o.push(Tt(e, i, n));
704
+ const s = $(r);
705
+ return r.forEach((i, d) => {
706
+ const c = St(e, i, d, s[d]);
707
+ c && o.push(c);
708
+ }), {
676
709
  dispose() {
677
- for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
710
+ for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
678
711
  }
679
712
  };
680
- }, E = (e, t = "") => m(e, t), me = (e) => ({
713
+ }, R = (e, t = "") => u(e, t), we = (e) => ({
681
714
  ...e,
682
- label: E(e.label, e.id),
683
- description: e.description ? E(e.description) : void 0,
684
- icon: e.icon ? V(F, {
715
+ label: R(e.label, e.id),
716
+ description: e.description ? R(e.description) : void 0,
717
+ icon: e.icon ? W(j, {
685
718
  name: e.icon,
686
719
  size: 14
687
720
  }) : void 0
688
- }), Ct = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Et = (e) => ({
721
+ }), Wt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), jt = (e) => ({
689
722
  id: e.id,
690
723
  values: e.values,
691
- resource: e.resource ? O(e.resource) : void 0
692
- }), xt = (e, t) => {
693
- const r = S({
724
+ resource: e.resource ? U(e.resource) : void 0
725
+ }), Kt = (e, t) => {
726
+ const r = M({
694
727
  id: t.id,
695
728
  kind: "dataTableRenderer",
696
729
  projectId: e.projectId,
697
730
  context: {
698
731
  dataTableRendererId: t.id
699
732
  }
700
- }), o = (n, s, a) => k(e, n, {
733
+ }), n = (o, s, i) => k(e, o, {
701
734
  params: s,
702
- resource: a,
735
+ resource: i,
703
736
  slot: r,
704
737
  metadata: {
705
738
  dataTableRendererId: t.id
@@ -707,81 +740,100 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
707
740
  });
708
741
  return e.workbench.renderers.registerDataTableRenderer({
709
742
  id: t.id,
710
- title: E(t.title, t.id),
743
+ title: R(t.title, t.id),
711
744
  resourceKind: t.resourceKind,
712
- columns: t.columns?.map(me),
745
+ columns: t.columns?.map(we),
713
746
  initialPageSize: t.initialPageSize,
714
747
  pageSizeOptions: t.pageSizeOptions,
715
- emptyTitle: t.emptyTitle ? E(t.emptyTitle) : void 0,
716
- emptyDescription: t.emptyDescription ? E(t.emptyDescription) : void 0,
748
+ selectionMode: t.selectionMode,
749
+ selectionActions: t.selectionActions?.map((o) => ({
750
+ id: o.id,
751
+ label: R(o.label, o.id),
752
+ icon: o.icon ? W(j, {
753
+ name: o.icon,
754
+ size: 16
755
+ }) : void 0,
756
+ destructive: o.destructive,
757
+ run: (s) => n(o.commandId, {
758
+ rowIds: s.map((i) => i.id)
759
+ }).then(() => {
760
+ })
761
+ })),
762
+ emptyTitle: t.emptyTitle ? R(t.emptyTitle) : void 0,
763
+ emptyDescription: t.emptyDescription ? R(t.emptyDescription) : void 0,
717
764
  executeQuery: async ({
718
- resource: n,
765
+ resource: o,
719
766
  modeId: s
720
767
  }) => {
721
- const a = await o(t.queryCommandId, {
768
+ const i = await n(t.queryCommandId, {
722
769
  rendererId: t.id,
723
770
  projectId: e.projectId,
724
771
  modeId: s,
725
- resource: n ? {
726
- type: n.kind,
727
- id: n.id ?? n.uri,
728
- label: n.label,
729
- metadata: n.metadata
772
+ resource: o ? {
773
+ type: o.kind,
774
+ id: o.id ?? o.uri,
775
+ label: o.label,
776
+ metadata: o.metadata
730
777
  } : void 0
731
- }, n);
732
- return Ct(a) ? {
733
- rows: a.rows.map(Et),
734
- columns: a.columns?.map(me)
778
+ }, o);
779
+ return Wt(i) ? {
780
+ rows: i.rows.map(jt),
781
+ columns: i.columns?.map(we)
735
782
  } : {
736
783
  rows: []
737
784
  };
738
785
  },
739
- rowActions: t.rowActions?.map((n) => ({
740
- id: n.id,
741
- label: E(n.label, n.id),
742
- icon: n.icon ? V(F, {
743
- name: n.icon,
786
+ rowActions: t.rowActions?.map((o) => ({
787
+ id: o.id,
788
+ label: R(o.label, o.id),
789
+ icon: o.icon ? W(j, {
790
+ name: o.icon,
744
791
  size: 16
745
792
  }) : void 0,
746
- destructive: n.destructive,
747
- run: (s) => o(n.commandId, {
748
- rowId: s.id
749
- }, s.resource).then(() => {
750
- })
793
+ destructive: o.destructive,
794
+ run: async (s) => {
795
+ await n(o.commandId, {
796
+ rowId: s.id
797
+ }, s.resource), e.workbench.renderers.refreshDataTableRenderer(t.id);
798
+ }
751
799
  }))
752
800
  });
753
- }, At = (e, t) => {
801
+ }, Mt = (e, t, r, n) => {
754
802
  if (t.dataTableRendererId)
755
- return K({
803
+ return H({
756
804
  workbench: e.workbench,
757
805
  contribution: {
758
806
  id: t.id,
759
- title: m(t.title, t.id),
807
+ title: u(t.title, t.id),
808
+ icon: t.icon,
760
809
  region: t.region,
761
810
  closable: t.closable,
762
811
  rendererId: t.dataTableRendererId,
763
812
  singleton: !0,
764
813
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
765
- eligibleLocations: W(t.eligibleLocations),
766
- panelMenus: j(t.panelMenus)
814
+ eligibleLocations: D(t.eligibleLocations),
815
+ panelMenus: B(t.panelMenus, n),
816
+ ...A({
817
+ placement: t.placement,
818
+ declarationIndex: r
819
+ })
767
820
  }
768
821
  });
769
- }, Pt = (e, t, r) => {
770
- const o = t.map((n) => xt(e, n));
771
- for (const n of r) {
772
- const s = At(e, n);
773
- s && o.push(s);
774
- }
775
- return {
822
+ }, Dt = (e, t, r) => {
823
+ const n = t.map((s) => Kt(e, s)), o = $(r);
824
+ return r.forEach((s, i) => {
825
+ const d = Mt(e, s, i, o[i]);
826
+ d && n.push(d);
827
+ }), {
776
828
  dispose() {
777
- for (let n = o.length - 1; n >= 0; n -= 1) o[n]?.dispose();
829
+ for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
778
830
  }
779
831
  };
780
- }, Tt = {
832
+ }, $t = {
781
833
  first: 0,
782
834
  default: 1,
783
835
  last: 2
784
- }, no = {
836
+ }, bn = {
785
837
  commands: [],
786
838
  commandPaletteContributions: [],
787
839
  diagnostics: [],
@@ -798,112 +850,112 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
798
850
  settingsDefinitions: [],
799
851
  treeItems: [],
800
852
  panels: []
801
- }, St = (e) => `workbench.extension.menu.${e.id}`, Wt = (e) => `workbench.extension.palette.${e.id}`, Ee = (e, t) => Tt[e.placement ?? "default"] * 1e3 + t, xe = (e) => e === void 0 ? "" : Fe(e) ? e.default ?? e.$l10n : e, jt = (e) => {
853
+ }, Bt = (e) => `workbench.extension.menu.${e.id}`, Ht = (e) => `workbench.extension.palette.${e.id}`, We = (e, t) => $t[e.placement ?? "default"] * 1e3 + t, je = (e) => e === void 0 ? "" : qe(e) ? e.default ?? e.$l10n : e, Lt = (e) => {
802
854
  const {
803
855
  commandId: t,
804
856
  contribution: r,
805
- index: o,
806
- resolveString: n,
857
+ index: n,
858
+ resolveString: o,
807
859
  slot: s,
808
- when: a
860
+ when: i
809
861
  } = e;
810
862
  return {
811
863
  commandId: t,
812
864
  sourceCommandId: r.commandId,
813
- label: n(r.label, r.extensionId),
865
+ label: o(r.label, r.extensionId),
814
866
  icon: r.icon,
815
867
  group: s.group ?? r.group,
816
868
  overflowLabel: s.overflowLabel,
817
- order: Ee(r, o),
818
- when: a
869
+ order: We(r, n),
870
+ when: i
819
871
  };
820
- }, Kt = (e) => {
872
+ }, Ot = (e) => {
821
873
  const {
822
874
  commandId: t,
823
875
  contribution: r,
824
- index: o,
825
- resolveString: n
876
+ index: n,
877
+ resolveString: o
826
878
  } = e;
827
879
  return {
828
880
  commandId: t,
829
- label: n(r.label, r.extensionId),
881
+ label: o(r.label, r.extensionId),
830
882
  icon: r.icon,
831
883
  group: r.group,
832
- order: Ee(r, o)
884
+ order: We(r, n)
833
885
  };
834
- }, Mt = (e) => {
886
+ }, Vt = (e) => {
835
887
  const {
836
- createCommandId: t = St,
888
+ createCommandId: t = Bt,
837
889
  createWhenExpression: r,
838
- menuSlotsById: o,
839
- menuTargetsById: n,
890
+ menuSlotsById: n,
891
+ menuTargetsById: o,
840
892
  metadata: s,
841
- resolveString: a = xe
893
+ resolveString: i = je
842
894
  } = e, d = [];
843
895
  return s.menuContributions.forEach((c, b) => {
844
- const i = c.target ? n?.get(c.target) : o.get(c.slotId);
845
- if (!i) return;
846
- const l = t(c), u = s.commands.find((f) => f.id === c.commandId);
896
+ const a = c.target ? o?.get(c.target) : n.get(c.slotId);
897
+ if (!a) return;
898
+ const l = t(c), m = s.commands.find((f) => f.id === c.commandId);
847
899
  d.push({
848
900
  command: {
849
901
  id: l,
850
- label: a(c.label, c.extensionId),
902
+ label: i(c.label, c.extensionId),
851
903
  category: c.group,
852
- description: u ? a(u.description, u.extensionId) : void 0,
904
+ description: m ? i(m.description, m.extensionId) : void 0,
853
905
  icon: c.icon,
854
- params: u?.params
906
+ params: m?.params
855
907
  },
856
908
  contribution: c,
857
- menuItem: jt({
909
+ menuItem: Lt({
858
910
  commandId: l,
859
911
  contribution: c,
860
912
  index: b,
861
- resolveString: a,
862
- slot: i,
913
+ resolveString: i,
914
+ slot: a,
863
915
  when: r?.(c)
864
916
  }),
865
- menuPath: i.menuPath,
917
+ menuPath: a.menuPath,
866
918
  targetCommandId: c.commandId
867
919
  });
868
920
  }), d;
869
- }, $t = (e) => {
921
+ }, Ft = (e) => {
870
922
  const {
871
- createCommandId: t = Wt,
923
+ createCommandId: t = Ht,
872
924
  metadata: r,
873
- resolveString: o = xe
874
- } = e, n = [];
875
- return (r.commandPaletteContributions ?? []).forEach((s, a) => {
925
+ resolveString: n = je
926
+ } = e, o = [];
927
+ return (r.commandPaletteContributions ?? []).forEach((s, i) => {
876
928
  const d = t(s), c = r.commands.find((b) => b.id === s.commandId);
877
- n.push({
929
+ o.push({
878
930
  command: {
879
931
  id: d,
880
- label: o(s.label, s.extensionId),
932
+ label: n(s.label, s.extensionId),
881
933
  category: s.group,
882
- description: c ? o(c.description, c.extensionId) : void 0,
934
+ description: c ? n(c.description, c.extensionId) : void 0,
883
935
  icon: s.icon,
884
936
  params: c?.params
885
937
  },
886
938
  contribution: s,
887
- menuItem: Kt({
939
+ menuItem: Ot({
888
940
  commandId: d,
889
941
  contribution: s,
890
- index: a,
891
- resolveString: o
942
+ index: i,
943
+ resolveString: n
892
944
  }),
893
945
  targetCommandId: s.commandId
894
946
  });
895
- }), n;
896
- }, so = (e) => {
947
+ }), o;
948
+ }, fn = (e) => {
897
949
  const {
898
950
  createResource: t,
899
951
  metadata: r
900
952
  } = e;
901
- return r ? r.routes.map((o) => ({
953
+ return r ? r.routes.map((n) => ({
902
954
  resource: t({
903
- route: o
955
+ route: n
904
956
  })
905
957
  })) : [];
906
- }, Bt = (e) => {
958
+ }, Nt = (e) => {
907
959
  if (e)
908
960
  return {
909
961
  type: e.kind,
@@ -911,7 +963,7 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
911
963
  label: e.label,
912
964
  metadata: e.metadata
913
965
  };
914
- }, Dt = (e) => ({
966
+ }, Ut = (e) => ({
915
967
  id: e.rendererId,
916
968
  kind: "renderer",
917
969
  context: {
@@ -921,174 +973,179 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
921
973
  resourceId: e.resource.id
922
974
  } : {}
923
975
  }
924
- }), ue = async (e, t, r, o, n = {}) => {
925
- const s = Bt(o), a = await e.executeCommand(r, {
976
+ }), ge = async (e, t, r, n, o = {}) => {
977
+ const s = Nt(n), i = await e.executeCommand(r, {
926
978
  projectId: e.projectId,
927
979
  params: {
928
980
  projectId: e.projectId,
929
981
  resource: s,
930
- ...n
982
+ ...o
931
983
  },
932
984
  resource: s,
933
- slot: Dt({
985
+ slot: Ut({
934
986
  projectId: e.projectId,
935
987
  rendererId: t,
936
988
  resource: s
937
989
  }),
938
990
  source: "dashboard"
939
991
  });
940
- return L(a);
941
- }, Ht = (e, t) => e.workbench.renderers.registerFileRenderer({
992
+ return N(i);
993
+ }, _t = (e, t) => e.workbench.renderers.registerFileRenderer({
942
994
  id: t.id,
943
- title: m(t.title, t.id),
995
+ title: u(t.title, t.id),
944
996
  resourceKind: t.resourceKind,
945
- load: async (r) => await ue(e, t.id, t.loadCommandId, r) ?? {},
946
- save: t.saveCommandId ? async (r, o) => {
947
- await ue(e, t.id, t.saveCommandId, r, {
948
- content: o
997
+ load: async (r) => await ge(e, t.id, t.loadCommandId, r) ?? {},
998
+ save: t.saveCommandId ? async (r, n) => {
999
+ await ge(e, t.id, t.saveCommandId, r, {
1000
+ content: n
949
1001
  });
950
1002
  } : void 0
951
- }), Vt = (e, t) => {
1003
+ }), qt = (e, t, r, n) => {
952
1004
  if (t.fileRendererId)
953
- return K({
1005
+ return H({
954
1006
  workbench: e.workbench,
955
1007
  contribution: {
956
1008
  id: t.id,
957
- title: m(t.title, t.id),
1009
+ title: u(t.title, t.id),
1010
+ icon: t.icon,
958
1011
  region: t.region,
959
1012
  closable: t.closable,
960
1013
  rendererId: t.fileRendererId,
961
1014
  singleton: !0,
962
1015
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
963
- eligibleLocations: W(t.eligibleLocations),
964
- panelMenus: j(t.panelMenus)
1016
+ eligibleLocations: D(t.eligibleLocations),
1017
+ panelMenus: B(t.panelMenus, n),
1018
+ ...A({
1019
+ placement: t.placement,
1020
+ declarationIndex: r
1021
+ })
965
1022
  }
966
1023
  });
967
- }, Ft = (e) => {
1024
+ }, zt = (e) => {
968
1025
  const t = [];
969
- for (const r of e.metadata.fileRenderers ?? [])
970
- t.push(Ht(e, r));
971
- for (const r of e.metadata.panels) {
972
- const o = Vt(e, r);
973
- o && t.push(o);
974
- }
975
- return {
1026
+ for (const n of e.metadata.fileRenderers ?? [])
1027
+ t.push(_t(e, n));
1028
+ const r = $(e.metadata.panels);
1029
+ return e.metadata.panels.forEach((n, o) => {
1030
+ const s = qt(e, n, o, r[o]);
1031
+ s && t.push(s);
1032
+ }), {
976
1033
  dispose() {
977
- for (let r = t.length - 1; r >= 0; r -= 1) t[r]?.dispose();
1034
+ for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
978
1035
  }
979
1036
  };
980
- }, Lt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), be = (e, t, r, o) => (t ?? []).map((n) => {
1037
+ }, Qt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ie = (e, t, r, n) => (t ?? []).map((o) => {
981
1038
  const s = {
982
- ...n,
983
- label: r(n.label, n.id),
984
- type: n.type.kind === "enum" || n.type.kind === "enum-multi" ? {
985
- ...n.type,
986
- options: Array.isArray(n.type.options) ? n.type.options.map((a) => ({
987
- ...a,
988
- label: r(a.label, a.value)
989
- })) : n.type.options
990
- } : n.type
1039
+ ...o,
1040
+ label: r(o.label, o.id),
1041
+ type: o.type.kind === "enum" || o.type.kind === "enum-multi" ? {
1042
+ ...o.type,
1043
+ options: Array.isArray(o.type.options) ? o.type.options.map((i) => ({
1044
+ ...i,
1045
+ label: r(i.label, i.value)
1046
+ })) : o.type.options
1047
+ } : o.type
991
1048
  };
992
- return o(e, s);
993
- }), Ot = (e, t, r, o) => {
994
- let n = be(e, t, r, o);
1049
+ return n(e, s);
1050
+ }), Gt = (e, t, r, n) => {
1051
+ let o = Ie(e, t, r, n);
995
1052
  const s = /* @__PURE__ */ new Set();
996
1053
  return {
997
1054
  source: {
998
- getSnapshot: () => n,
999
- subscribe: (a) => (s.add(a), () => s.delete(a))
1055
+ getSnapshot: () => o,
1056
+ subscribe: (i) => (s.add(i), () => s.delete(i))
1000
1057
  },
1001
- set(a) {
1002
- n = be(e, a, r, o);
1058
+ set(i) {
1059
+ o = Ie(e, i, r, n);
1003
1060
  for (const d of s) d();
1004
1061
  }
1005
1062
  };
1006
- }, Nt = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), Ut = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), _t = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Ae = (e, t) => {
1063
+ }, Yt = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), Xt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Jt = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Ke = (e, t) => {
1007
1064
  const {
1008
1065
  resource: r
1009
1066
  } = t;
1010
- if (Nt(r)) return r;
1011
- if (Ut(r)) return O(r);
1012
- }, qt = (e, t) => {
1013
- const r = Ae(e, t);
1067
+ if (Yt(r)) return r;
1068
+ if (Xt(r)) return U(r);
1069
+ }, Zt = (e, t) => {
1070
+ const r = Ke(e, t);
1014
1071
  if (r) return r;
1015
1072
  if (e.resourceKind)
1016
1073
  return {
1017
1074
  kind: e.resourceKind,
1018
- uri: _t(e.resourceKind, t.id),
1075
+ uri: Jt(e.resourceKind, t.id),
1019
1076
  id: t.id,
1020
1077
  label: t.title
1021
1078
  };
1022
- }, fe = (e, t) => {
1023
- const r = e, o = t(r);
1024
- return o === void 0 ? r : {
1079
+ }, ye = (e, t) => {
1080
+ const r = e, n = t(r);
1081
+ return n === void 0 ? r : {
1025
1082
  ...r,
1026
- resource: o
1083
+ resource: n
1027
1084
  };
1028
- }, Pe = (...e) => Object.assign({}, ...e.filter((t) => !!t)), zt = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Qt = (e) => Object.keys(e ?? {}).length > 0, Gt = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), Yt = (e, t, r) => {
1029
- if (!Gt.has(t.type)) return;
1030
- const o = "options" in t && Array.isArray(t.options) ? t.options : [], n = t;
1085
+ }, Me = (...e) => Object.assign({}, ...e.filter((t) => !!t)), er = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, tr = (e) => Object.keys(e ?? {}).length > 0, rr = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), nr = (e, t, r) => {
1086
+ if (!rr.has(t.type)) return;
1087
+ const n = "options" in t && Array.isArray(t.options) ? t.options : [], o = t;
1031
1088
  return {
1032
1089
  id: e,
1033
1090
  label: r(t.label, e),
1034
1091
  description: t.description === void 0 ? void 0 : r(t.description),
1035
- placeholder: n.placeholder === void 0 ? void 0 : r(n.placeholder),
1092
+ placeholder: o.placeholder === void 0 ? void 0 : r(o.placeholder),
1036
1093
  type: t.type,
1037
1094
  required: t.required === !0,
1038
1095
  defaultValue: t.defaultValue,
1039
- options: t.type === "select" || t.type === "multi-select" ? o.map((s) => ({
1096
+ options: t.type === "select" || t.type === "multi-select" ? n.map((s) => ({
1040
1097
  value: s.value,
1041
1098
  label: r(s.label, s.value),
1042
1099
  icon: s.icon
1043
1100
  })) : void 0,
1044
- multiple: t.type === "files" ? n.multiple !== !1 : void 0,
1045
- accept: t.type === "files" && typeof n.accept == "string" ? n.accept : void 0
1101
+ multiple: t.type === "files" ? o.multiple !== !1 : void 0,
1102
+ accept: t.type === "files" && typeof o.accept == "string" ? o.accept : void 0
1046
1103
  };
1047
- }, Xt = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, o]) => {
1048
- const n = Yt(r, o, t);
1049
- return n ? [n] : [];
1050
- }), Jt = (e, t) => S({
1104
+ }, or = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, n]) => {
1105
+ const o = nr(r, n, t);
1106
+ return o ? [o] : [];
1107
+ }), sr = (e, t) => M({
1051
1108
  id: t.id,
1052
1109
  kind: "kanbanRenderer",
1053
1110
  projectId: e.projectId,
1054
1111
  context: {
1055
1112
  kanbanRendererId: t.id
1056
1113
  }
1057
- }), H = (e, t, r, o, n) => k(e, r, {
1058
- params: o,
1059
- resource: n ?? e.workbench.getPrimaryResource(),
1060
- slot: Jt(e, t),
1114
+ }), F = (e, t, r, n, o) => k(e, r, {
1115
+ params: n,
1116
+ resource: o ?? e.workbench.getPrimaryResource(),
1117
+ slot: sr(e, t),
1061
1118
  metadata: {
1062
1119
  kanbanRendererId: t.id
1063
1120
  }
1064
- }), Te = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Zt = (e, t, r) => (t.rowActions ?? []).map((o) => {
1065
- const n = e.workbench.commands.getCommand(o.commandId)?.command;
1121
+ }), De = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, ir = (e, t, r) => (t.rowActions ?? []).map((n) => {
1122
+ const o = e.workbench.commands.getCommand(n.commandId)?.command;
1066
1123
  return e.workbench.commands.registerCommand({
1067
- id: Te(t, o),
1068
- label: r(o.label, o.id),
1069
- icon: o.icon,
1070
- params: n?.params
1124
+ id: De(t, n),
1125
+ label: r(n.label, n.id),
1126
+ icon: n.icon,
1127
+ params: o?.params
1071
1128
  }, {
1072
- execute: (s, a) => H(e, t, o.commandId, Pe(zt(s)), a?.resource)
1129
+ execute: (s, i) => F(e, t, n.commandId, Me(er(s)), i?.resource)
1073
1130
  });
1074
- }), er = (e, t, r, o, n, s) => {
1075
- const a = Te(t, r), d = e.workbench.commands.getCommand(a), c = {
1076
- rowId: o.id
1077
- }, b = n ? {
1078
- resource: n
1079
- } : void 0, i = s(r.label, r.id);
1080
- return d && Qt(d.command.params) ? (e.workbench.commandPalette.requestParams({
1131
+ }), ar = (e, t, r, n, o, s) => {
1132
+ const i = De(t, r), d = e.workbench.commands.getCommand(i), c = {
1133
+ rowId: n.id
1134
+ }, b = o ? {
1135
+ resource: o
1136
+ } : void 0, a = s(r.label, r.id);
1137
+ return d && tr(d.command.params) ? (e.workbench.commandPalette.requestParams({
1081
1138
  record: d,
1082
- label: i,
1139
+ label: a,
1083
1140
  args: c,
1084
1141
  context: b
1085
1142
  }), Promise.resolve()) : d ? e.workbench.commands.executeCommand(d.command.id, c, b).then(() => {
1086
- }) : H(e, t, r.commandId, c, n).then(() => {
1143
+ }) : F(e, t, r.commandId, c, o).then(() => {
1087
1144
  });
1088
- }, tr = (e) => (r) => V(F, {
1145
+ }, dr = (e) => (r) => W(j, {
1089
1146
  name: e ?? "MoreHorizontal",
1090
1147
  ...r
1091
- }), rr = (e, t) => ({
1148
+ }), cr = (e, t) => ({
1092
1149
  color: e?.color,
1093
1150
  canDragIn: e?.canDragIn,
1094
1151
  canDragOut: e?.canDragOut,
@@ -1096,17 +1153,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1096
1153
  actions: e?.actions?.map((r) => ({
1097
1154
  id: r.id,
1098
1155
  label: t(r.label, r.id),
1099
- icon: tr(r.icon)
1156
+ icon: dr(r.icon)
1100
1157
  }))
1101
- }), or = (e) => e ? V(F, {
1158
+ }), lr = (e) => e ? W(j, {
1102
1159
  name: e,
1103
1160
  size: 16
1104
- }) : void 0, nr = (e, t) => {
1161
+ }) : void 0, mr = (e, t) => {
1105
1162
  if (e.createRow)
1106
1163
  return {
1107
1164
  title: t(e.createRow.title, "Create row"),
1108
1165
  submitLabel: t(e.createRow.submitLabel, "Create"),
1109
- fields: Xt(e, t),
1166
+ fields: or(e, t),
1110
1167
  labels: {
1111
1168
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1112
1169
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1114,161 +1171,166 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1114
1171
  removeFile: t(e.createRow.labels?.removeFile, "Remove file")
1115
1172
  }
1116
1173
  };
1117
- }, sr = (e, t, r) => {
1174
+ }, ur = (e, t, r) => {
1118
1175
  if (t.onRowClick)
1119
- return (o) => t.onRowClick?.({
1176
+ return (n) => t.onRowClick?.({
1120
1177
  record: e,
1121
- row: o,
1122
- resource: r(e, o)
1178
+ row: n,
1179
+ resource: r(e, n)
1123
1180
  });
1124
- }, ir = (e, t, r) => {
1125
- const o = e.createRow;
1126
- if (o)
1127
- return async (n) => {
1128
- const s = Pe(n.values, o.columnParam ? {
1129
- [o.columnParam]: n.columnId
1130
- } : void 0, o.attributesParam ? {
1131
- [o.attributesParam]: n.attributeValues
1132
- } : void 0), a = await r(e, o.commandId, s);
1181
+ }, br = (e, t, r) => {
1182
+ const n = e.createRow;
1183
+ if (n)
1184
+ return async (o) => {
1185
+ const s = Me(o.values, n.columnParam ? {
1186
+ [n.columnParam]: o.columnId
1187
+ } : void 0, n.attributesParam ? {
1188
+ [n.attributesParam]: o.attributeValues
1189
+ } : void 0), i = await r(e, n.commandId, s);
1133
1190
  await t.onAfterCreate?.({
1134
1191
  record: e,
1135
- created: a,
1136
- submission: n
1192
+ created: i,
1193
+ submission: o
1137
1194
  });
1138
1195
  };
1139
- }, ar = (e, t, r, o, n) => {
1196
+ }, fr = (e, t, r, n, o) => {
1140
1197
  const s = t.rowActions;
1141
1198
  if (s?.length)
1142
- return (a) => s.map((d) => {
1143
- const c = n(t, a), b = () => er(e, t, d, a, c, o);
1199
+ return (i) => s.map((d) => {
1200
+ const c = o(t, i), b = () => ar(e, t, d, i, c, n);
1144
1201
  return {
1145
1202
  key: d.id,
1146
- label: o(d.label, d.id),
1203
+ label: n(d.label, d.id),
1147
1204
  commandId: d.commandId,
1148
- icon: or(d.icon),
1205
+ icon: lr(d.icon),
1149
1206
  onClick: () => r.executeRowAction ? r.executeRowAction({
1150
1207
  record: t,
1151
1208
  action: d,
1152
- row: a,
1209
+ row: i,
1153
1210
  resource: c,
1154
1211
  runDefault: b
1155
1212
  }) : b()
1156
1213
  };
1157
1214
  });
1158
- }, dr = (e, t, r = {}) => {
1159
- const o = [], n = r.resolveLabel ?? ((i, l) => m(i, l)), s = r.decorateAttribute ?? ((i, l) => l), a = r.resolveRowResource ?? Ae, d = r.resolveRowActionResource ?? qt, c = r.onAfterMutation ?? (() => {
1160
- }), b = (i, l, u) => H(e, i, l, u).then((f) => (c(i), f));
1161
- for (const i of t) {
1162
- const l = Ot(i, i.attributes, n, s);
1163
- let u;
1164
- const f = (p) => a(i, p);
1165
- o.push(...Zt(e, i, n)), o.push(e.workbench.renderers.registerKanbanRenderer({
1166
- id: i.id,
1167
- title: n(i.title, i.id),
1168
- resourceKind: i.resourceKind,
1215
+ }, pr = (e, t, r = {}) => {
1216
+ const n = [], o = r.resolveLabel ?? ((a, l) => u(a, l)), s = r.decorateAttribute ?? ((a, l) => l), i = r.resolveRowResource ?? Ke, d = r.resolveRowActionResource ?? Zt, c = r.onAfterMutation ?? (() => {
1217
+ }), b = (a, l, m) => F(e, a, l, m).then((f) => (c(a), f));
1218
+ for (const a of t) {
1219
+ const l = Gt(a, a.attributes, o, s);
1220
+ let m;
1221
+ const f = (p) => i(a, p);
1222
+ n.push(...ir(e, a, o)), n.push(e.workbench.renderers.registerKanbanRenderer({
1223
+ id: a.id,
1224
+ title: o(a.title, a.id),
1225
+ resourceKind: a.resourceKind,
1169
1226
  attributes: l.source,
1170
- defaultSettings: i.defaultSettings,
1171
- defaultFilters: i.defaultFilters,
1172
- defaultViews: i.defaultViews?.map((p) => ({
1227
+ defaultSettings: a.defaultSettings,
1228
+ defaultFilters: a.defaultFilters,
1229
+ defaultViews: a.defaultViews?.map((p) => ({
1173
1230
  ...p,
1174
- title: n(p.title, p.id)
1231
+ title: o(p.title, p.id)
1175
1232
  })),
1176
- defaultActiveViewId: i.defaultActiveViewId,
1177
- emptyTitle: n(i.emptyTitle, ""),
1178
- emptyDescription: n(i.emptyDescription, ""),
1179
- hideToolbar: i.hideToolbar,
1180
- createRow: nr(i, n),
1181
- getBoardColumnConfig: (p) => rr(u?.[p], n),
1182
- onRowClick: sr(i, r, a),
1233
+ defaultActiveViewId: a.defaultActiveViewId,
1234
+ emptyTitle: o(a.emptyTitle, ""),
1235
+ emptyDescription: o(a.emptyDescription, ""),
1236
+ hideToolbar: a.hideToolbar,
1237
+ createRow: mr(a, o),
1238
+ getBoardColumnConfig: (p) => cr(m?.[p], o),
1239
+ onRowClick: ur(a, r, i),
1183
1240
  executeQuery: async (p) => {
1184
- const h = await H(e, i, i.queryCommandId, {
1241
+ const w = await F(e, a, a.queryCommandId, {
1185
1242
  settings: p.settings,
1186
1243
  filters: p.filters
1187
1244
  });
1188
- return Array.isArray(h) ? h.map((v) => fe(v, f)) : Lt(h) ? (l.set(h.attributes), u = h.boardColumnConfigs, (h.rows ?? []).map((v) => fe(v, f))) : [];
1245
+ return Array.isArray(w) ? w.map((v) => ye(v, f)) : Qt(w) ? (l.set(w.attributes), m = w.boardColumnConfigs, (w.rows ?? []).map((v) => ye(v, f))) : [];
1189
1246
  },
1190
- onAttributeChange: i.updateAttributeCommandId ? (p, h, v) => b(i, i.updateAttributeCommandId, {
1247
+ onAttributeChange: a.updateAttributeCommandId ? (p, w, v) => b(a, a.updateAttributeCommandId, {
1191
1248
  rowId: p,
1192
- attributeId: h,
1249
+ attributeId: w,
1193
1250
  value: v
1194
1251
  }).then(() => {
1195
1252
  }) : void 0,
1196
- onReorder: i.reorderCommandId ? (p, h) => b(i, i.reorderCommandId, {
1253
+ onReorder: a.reorderCommandId ? (p, w) => b(a, a.reorderCommandId, {
1197
1254
  rowId: p,
1198
- beforeRowId: h
1255
+ beforeRowId: w
1199
1256
  }).then(() => {
1200
1257
  }) : void 0,
1201
- onCreateRow: ir(i, r, b),
1202
- onColumnAction: i.columnActionCommandId ? async (p, h) => {
1203
- await b(i, i.columnActionCommandId, {
1258
+ onCreateRow: br(a, r, b),
1259
+ onColumnAction: a.columnActionCommandId ? async (p, w) => {
1260
+ await b(a, a.columnActionCommandId, {
1204
1261
  columnId: p,
1205
- actionId: h
1262
+ actionId: w
1206
1263
  });
1207
1264
  } : void 0,
1208
- getRowContextMenuActions: ar(e, i, r, n, d)
1209
- })), o.push(e.workbench.layout.registerPanel({
1265
+ getRowContextMenuActions: fr(e, a, r, o, d)
1266
+ })), n.push(e.workbench.layout.registerPanel({
1210
1267
  closable: !1,
1211
- id: i.id,
1212
- title: n(i.title, i.id),
1268
+ id: a.id,
1269
+ title: o(a.title, a.id),
1213
1270
  region: "main",
1214
- rendererId: i.id,
1271
+ rendererId: a.id,
1215
1272
  singleton: !0,
1216
- resourceKinds: i.resourceKind ? [i.resourceKind] : void 0
1273
+ resourceKinds: a.resourceKind ? [a.resourceKind] : void 0
1217
1274
  }));
1218
1275
  }
1219
1276
  return {
1220
1277
  dispose() {
1221
- for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
1278
+ for (let a = n.length - 1; a >= 0; a -= 1) n[a]?.dispose();
1222
1279
  }
1223
1280
  };
1224
- }, cr = (e, t) => {
1281
+ }, hr = (e, t) => {
1225
1282
  if (e)
1226
- return Object.fromEntries(Object.entries(e).map(([r, o]) => [r, {
1227
- ...o,
1228
- label: o.label === void 0 ? void 0 : t(o.label, r),
1229
- description: o.description === void 0 ? void 0 : t(o.description)
1283
+ return Object.fromEntries(Object.entries(e).map(([r, n]) => [r, {
1284
+ ...n,
1285
+ label: n.label === void 0 ? void 0 : t(n.label, r),
1286
+ description: n.description === void 0 ? void 0 : t(n.description)
1230
1287
  }]));
1231
- }, lr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.treeRendererId === t.id), Se = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, mr = async (e) => {
1288
+ }, wr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.treeRendererId === t.id), $e = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, gr = async (e) => {
1232
1289
  const {
1233
1290
  ctx: t,
1234
1291
  getHostTreeHeaderNodes: r,
1235
- record: o,
1236
- treeViews: n
1237
- } = e, s = Se(n, t);
1292
+ record: n,
1293
+ treeViews: o
1294
+ } = e, s = $e(o, t);
1238
1295
  return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await r?.({
1239
1296
  ctx: t,
1240
- record: o,
1297
+ record: n,
1241
1298
  panel: s
1242
1299
  }) ?? [];
1243
- }, ur = async (e) => {
1300
+ }, Ir = async (e) => {
1244
1301
  const {
1245
1302
  ctx: t,
1246
1303
  getHostTreeFooterNodes: r,
1247
- record: o,
1248
- treeViews: n
1249
- } = e, s = Se(n, t);
1304
+ record: n,
1305
+ treeViews: o
1306
+ } = e, s = $e(o, t);
1250
1307
  return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await r?.({
1251
1308
  ctx: t,
1252
- record: o,
1309
+ record: n,
1253
1310
  panel: s
1254
1311
  }) ?? [];
1255
- }, br = (e, t) => {
1312
+ }, yr = (e, t, r, n) => {
1256
1313
  if (t.treeRendererId)
1257
- return K({
1314
+ return H({
1258
1315
  workbench: e.workbench,
1259
1316
  contribution: {
1260
1317
  id: t.id,
1261
- title: m(t.title, t.id),
1318
+ title: u(t.title, t.id),
1319
+ icon: t.icon,
1262
1320
  region: t.region,
1263
1321
  closable: t.closable,
1264
1322
  rendererId: t.treeRendererId,
1265
1323
  singleton: !0,
1266
1324
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
1267
- eligibleLocations: W(t.eligibleLocations),
1268
- panelMenus: j(t.panelMenus)
1325
+ eligibleLocations: D(t.eligibleLocations),
1326
+ panelMenus: B(t.panelMenus, n),
1327
+ ...A({
1328
+ placement: t.placement,
1329
+ declarationIndex: r
1330
+ })
1269
1331
  }
1270
1332
  });
1271
- }, G = (e) => {
1333
+ }, Z = (e) => {
1272
1334
  if (e)
1273
1335
  return {
1274
1336
  type: e.kind,
@@ -1276,13 +1338,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1276
1338
  label: e.label,
1277
1339
  metadata: e.metadata
1278
1340
  };
1279
- }, pe = (e) => ({
1341
+ }, ve = (e) => ({
1280
1342
  kind: e.type,
1281
1343
  uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
1282
1344
  id: e.id,
1283
1345
  label: e.label,
1284
1346
  metadata: e.metadata
1285
- }), We = (e) => ({
1347
+ }), Be = (e) => ({
1286
1348
  id: e.treeId,
1287
1349
  kind: "renderer",
1288
1350
  context: {
@@ -1296,46 +1358,46 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1296
1358
  resourceId: e.resource.id
1297
1359
  } : {}
1298
1360
  }
1299
- }), z = (e, t, r, o) => {
1300
- const n = G(r.resource);
1361
+ }), X = (e, t, r, n) => {
1362
+ const o = Z(r.resource);
1301
1363
  return {
1302
1364
  projectId: e.projectId,
1303
1365
  modeId: e.workbench.modes.getActiveModeId(),
1304
- resource: n,
1366
+ resource: o,
1305
1367
  treeId: t.id,
1306
1368
  state: e.workbench.renderers.getTreeState(t.id),
1307
1369
  ...r.filter ? {
1308
1370
  filter: r.filter
1309
1371
  } : {},
1310
- ...o ? {
1311
- node: o
1372
+ ...n ? {
1373
+ node: n
1312
1374
  } : {}
1313
1375
  };
1314
- }, Q = async (e, t, r) => {
1315
- const o = r.resource, n = await e.executeCommand(t, {
1376
+ }, J = async (e, t, r) => {
1377
+ const n = r.resource, o = await e.executeCommand(t, {
1316
1378
  projectId: e.projectId,
1317
1379
  params: r,
1318
- resource: o,
1319
- slot: We({
1380
+ resource: n,
1381
+ slot: Be({
1320
1382
  modeId: r.modeId,
1321
1383
  projectId: e.projectId,
1322
- resource: o,
1384
+ resource: n,
1323
1385
  treeId: r.treeId
1324
1386
  }),
1325
1387
  source: "dashboard"
1326
1388
  });
1327
- return L(n);
1328
- }, je = async (e, t, r, o, n) => {
1329
- const s = e.workbench.modes.getActiveModeId(), a = await e.executeCommand(r, {
1389
+ return N(o);
1390
+ }, He = async (e, t, r, n, o) => {
1391
+ const s = e.workbench.modes.getActiveModeId(), i = await e.executeCommand(r, {
1330
1392
  projectId: e.projectId,
1331
- ...o ? {
1332
- params: o
1393
+ ...n ? {
1394
+ params: n
1333
1395
  } : {},
1334
- resource: n,
1335
- slot: We({
1396
+ resource: o,
1397
+ slot: Be({
1336
1398
  modeId: s,
1337
1399
  projectId: e.projectId,
1338
- resource: n,
1400
+ resource: o,
1339
1401
  treeId: t.id
1340
1402
  }),
1341
1403
  source: "dashboard",
@@ -1343,190 +1405,190 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1343
1405
  treeId: t.id
1344
1406
  }
1345
1407
  });
1346
- return L(a);
1347
- }, fr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, pr = (e, t) => {
1348
- const r = /* @__PURE__ */ new WeakMap(), o = `workbench.extensionTreeRenderer.${t.id}.command`, n = (i) => {
1349
- if (i.emptyState)
1408
+ return N(i);
1409
+ }, vr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, kr = (e, t) => {
1410
+ const r = /* @__PURE__ */ new WeakMap(), n = `workbench.extensionTreeRenderer.${t.id}.command`, o = (a) => {
1411
+ if (a.emptyState)
1350
1412
  return {
1351
- title: m(i.emptyState.title),
1352
- description: m(i.emptyState.description),
1353
- icon: i.emptyState.icon
1413
+ title: u(a.emptyState.title),
1414
+ description: u(a.emptyState.description),
1415
+ icon: a.emptyState.icon
1354
1416
  };
1355
- }, s = (i, l, u) => {
1356
- if (i) {
1357
- if (i.kind === "resource" && i.resource)
1417
+ }, s = (a, l, m) => {
1418
+ if (a) {
1419
+ if (a.kind === "resource" && a.resource)
1358
1420
  return {
1359
1421
  kind: "resource",
1360
- resource: pe(i.resource),
1422
+ resource: ve(a.resource),
1361
1423
  input: {
1362
1424
  replaceActive: !0
1363
1425
  }
1364
1426
  };
1365
- if (i.kind === "panel" && i.panelId) return {
1427
+ if (a.kind === "panel" && a.panelId) return {
1366
1428
  kind: "panel",
1367
- panelId: i.panelId
1429
+ panelId: a.panelId
1368
1430
  };
1369
- if (!(i.kind !== "command" || !i.commandId))
1431
+ if (!(a.kind !== "command" || !a.commandId))
1370
1432
  return {
1371
1433
  kind: "command",
1372
- commandId: o,
1434
+ commandId: n,
1373
1435
  args: {
1374
- commandId: i.commandId,
1436
+ commandId: a.commandId,
1375
1437
  nodeId: l.id,
1376
- params: i.args,
1377
- resource: l.resource ?? G(u.resource),
1438
+ params: a.args,
1439
+ resource: l.resource ?? Z(m.resource),
1378
1440
  treeId: t.id
1379
1441
  }
1380
1442
  };
1381
1443
  }
1382
- }, a = (i, l, u) => {
1383
- const f = i.commandId;
1444
+ }, i = (a, l, m) => {
1445
+ const f = a.commandId;
1384
1446
  return {
1385
- id: i.id,
1386
- label: m(i.label),
1387
- icon: i.icon,
1388
- args: i.args,
1389
- params: cr(i.params, m),
1390
- submitLabel: i.submitLabel,
1391
- when: i.when,
1392
- disabled: i.disabled,
1447
+ id: a.id,
1448
+ label: u(a.label),
1449
+ icon: a.icon,
1450
+ args: a.args,
1451
+ params: hr(a.params, u),
1452
+ submitLabel: a.submitLabel,
1453
+ when: a.when,
1454
+ disabled: a.disabled,
1393
1455
  // Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
1394
1456
  // node-target navigation runs through the runner command and must not refetch.
1395
1457
  run: f ? async (p) => {
1396
- await je(e, t, f, fr(p, i.args), l?.resource ?? G(u.resource)), e.workbench.renderers.refresh(t.id);
1458
+ await He(e, t, f, vr(p, a.args), l?.resource ?? Z(m.resource)), e.workbench.renderers.refresh(t.id);
1397
1459
  } : void 0
1398
1460
  };
1399
- }, d = (i, l) => {
1400
- const u = {
1401
- id: i.id,
1402
- label: m(i.label),
1403
- icon: i.icon,
1404
- iconColor: i.iconColor,
1405
- iconTooltip: i.iconTooltip,
1406
- resource: i.resource ? pe(i.resource) : void 0,
1407
- target: s(i.target, i, l),
1408
- rowVariant: i.rowVariant,
1409
- actions: i.actions?.map((f) => a(f, i, l)),
1410
- contextMenuActions: i.contextMenuActions?.map((f) => a(f, i, l)),
1411
- collapsible: i.collapsible,
1412
- disabled: i.disabled,
1413
- children: i.children?.map((f) => d(f, l)),
1414
- description: i.description,
1415
- contextValue: i.contextValue,
1416
- hiddenByDefault: i.hiddenByDefault,
1417
- canHide: i.canHide
1461
+ }, d = (a, l) => {
1462
+ const m = {
1463
+ id: a.id,
1464
+ label: u(a.label),
1465
+ icon: a.icon,
1466
+ iconColor: a.iconColor,
1467
+ iconTooltip: a.iconTooltip,
1468
+ resource: a.resource ? ve(a.resource) : void 0,
1469
+ target: s(a.target, a, l),
1470
+ rowVariant: a.rowVariant,
1471
+ actions: a.actions?.map((f) => i(f, a, l)),
1472
+ contextMenuActions: a.contextMenuActions?.map((f) => i(f, a, l)),
1473
+ collapsible: a.collapsible,
1474
+ disabled: a.disabled,
1475
+ children: a.children?.map((f) => d(f, l)),
1476
+ description: a.description,
1477
+ contextValue: a.contextValue,
1478
+ hiddenByDefault: a.hiddenByDefault,
1479
+ canHide: a.canHide
1418
1480
  };
1419
- return r.set(u, i), u;
1481
+ return r.set(m, a), m;
1420
1482
  };
1421
1483
  return {
1422
- mapNodes: (i, l) => i.map((u) => d(u, l)),
1423
- mapSections: (i, l) => i.map((u) => ({
1424
- id: u.id,
1425
- label: m(u.label),
1426
- actions: u.actions?.map((f) => a(f, void 0, l)),
1427
- collapsible: u.collapsible,
1428
- emptyState: n(u),
1429
- nodes: u.nodes.map((f) => d(f, l)),
1430
- hiddenByDefault: u.hiddenByDefault,
1431
- canHide: u.canHide
1484
+ mapNodes: (a, l) => a.map((m) => d(m, l)),
1485
+ mapSections: (a, l) => a.map((m) => ({
1486
+ id: m.id,
1487
+ label: u(m.label),
1488
+ actions: m.actions?.map((f) => i(f, void 0, l)),
1489
+ collapsible: m.collapsible,
1490
+ emptyState: o(m),
1491
+ nodes: m.nodes.map((f) => d(f, l)),
1492
+ hiddenByDefault: m.hiddenByDefault,
1493
+ canHide: m.canHide
1432
1494
  })),
1433
1495
  originalNodes: r,
1434
- runnerCommandId: o
1496
+ runnerCommandId: n
1435
1497
  };
1436
- }, hr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), he = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), wr = (e) => {
1498
+ }, Rr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), ke = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), Cr = (e) => {
1437
1499
  for (const t of e)
1438
1500
  for (const r of t.nodes)
1439
1501
  if (r.selected) return r.id;
1440
- }, gr = (e, t) => {
1441
- const r = pr(e, t), o = lr(e.metadata, t), n = e.workbench.commands.registerCommand({
1502
+ }, Er = (e, t) => {
1503
+ const r = kr(e, t), n = wr(e.metadata, t), o = e.workbench.commands.registerCommand({
1442
1504
  id: r.runnerCommandId,
1443
- label: `${m(t.title, t.id)} tree command`
1505
+ label: `${u(t.title, t.id)} tree command`
1444
1506
  }, {
1445
- execute: async (a) => {
1446
- const d = a;
1507
+ execute: async (i) => {
1508
+ const d = i;
1447
1509
  d.nodeId && e.workbench.renderers.setSelectedNode(t.id, d.nodeId);
1448
- const c = await je(e, t, d.commandId, d.params, d.resource);
1510
+ const c = await He(e, t, d.commandId, d.params, d.resource);
1449
1511
  for (const b of e.workbench.renderers.listFileRenderers())
1450
1512
  e.workbench.renderers.refreshFileRenderer(b.id);
1451
1513
  return c;
1452
1514
  }
1453
1515
  }), s = e.workbench.renderers.registerTreeRenderer({
1454
1516
  id: t.id,
1455
- title: m(t.title, t.id),
1517
+ title: u(t.title, t.id),
1456
1518
  icon: t.icon,
1457
1519
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1458
1520
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1459
- getHeader: (a) => mr({
1460
- ctx: a,
1521
+ getHeader: (i) => gr({
1522
+ ctx: i,
1461
1523
  getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
1462
1524
  record: t,
1463
- treeViews: o
1525
+ treeViews: n
1464
1526
  }),
1465
- getBody: async (a) => {
1466
- const d = await Q(e, t.bodyCommandId, z(e, t, a));
1467
- if (!hr(d)) return [];
1468
- const c = wr(d);
1469
- return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d, a);
1527
+ getBody: async (i) => {
1528
+ const d = await J(e, t.bodyCommandId, X(e, t, i));
1529
+ if (!Rr(d)) return [];
1530
+ const c = Cr(d);
1531
+ return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d, i);
1470
1532
  },
1471
- getFooter: async (a) => {
1472
- const d = await ur({
1473
- ctx: a,
1533
+ getFooter: async (i) => {
1534
+ const d = await Ir({
1535
+ ctx: i,
1474
1536
  getHostTreeFooterNodes: e.getHostTreeFooterNodes,
1475
1537
  record: t,
1476
- treeViews: o
1538
+ treeViews: n
1477
1539
  });
1478
1540
  if (!t.footerCommandId) return d;
1479
- const c = await Q(e, t.footerCommandId, z(e, t, a));
1480
- return [...he(c) ? r.mapNodes(c, a) : [], ...d];
1541
+ const c = await J(e, t.footerCommandId, X(e, t, i));
1542
+ return [...ke(c) ? r.mapNodes(c, i) : [], ...d];
1481
1543
  },
1482
- getChildren: async (a, d) => {
1483
- if (!t.childrenCommandId) return a.children ?? [];
1484
- const c = r.originalNodes.get(a) ?? a, b = await Q(e, t.childrenCommandId, z(e, t, d, c));
1485
- return he(b) ? r.mapNodes(b, d) : [];
1544
+ getChildren: async (i, d) => {
1545
+ if (!t.childrenCommandId) return i.children ?? [];
1546
+ const c = r.originalNodes.get(i) ?? i, b = await J(e, t.childrenCommandId, X(e, t, d, c));
1547
+ return ke(b) ? r.mapNodes(b, d) : [];
1486
1548
  }
1487
1549
  });
1488
1550
  return {
1489
1551
  dispose() {
1490
- s.dispose(), n.dispose();
1552
+ s.dispose(), o.dispose();
1491
1553
  }
1492
1554
  };
1493
- }, Ir = (e) => {
1555
+ }, xr = (e) => {
1494
1556
  const t = [];
1495
- for (const r of e.metadata.treeRenderers ?? [])
1496
- t.push(gr(e, r));
1497
- for (const r of e.metadata.panels) {
1498
- const o = br(e, r);
1499
- o && t.push(o);
1500
- }
1501
- return {
1557
+ for (const n of e.metadata.treeRenderers ?? [])
1558
+ t.push(Er(e, n));
1559
+ const r = $(e.metadata.panels);
1560
+ return e.metadata.panels.forEach((n, o) => {
1561
+ const s = yr(e, n, o, r[o]);
1562
+ s && t.push(s);
1563
+ }), {
1502
1564
  dispose() {
1503
- for (let r = t.length - 1; r >= 0; r -= 1) t[r]?.dispose();
1565
+ for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1504
1566
  }
1505
1567
  };
1506
- }, yr = (e) => (t) => ({
1507
- ...ve({
1568
+ }, Ar = (e) => (t) => ({
1569
+ ...Ae({
1508
1570
  workbench: t.workbench,
1509
1571
  hostEvents: t.hostEvents
1510
1572
  }),
1511
1573
  // Extension guests speak the SDK resource shape (`type`); normalize to the
1512
1574
  // workbench shape (`kind` + synthesized uri) the resource registry expects,
1513
1575
  // mirroring how commands.execute and tree targets normalize their resources.
1514
- "resource.open": (o) => {
1515
- const n = o;
1516
- if (!n.resource) throw new Error("resource.open requires a resource.");
1517
- return t.workbench.resources.openResource(O(n.resource), n.input);
1576
+ "resource.open": (n) => {
1577
+ const o = n;
1578
+ if (!o.resource) throw new Error("resource.open requires a resource.");
1579
+ return t.workbench.resources.openResource(U(o.resource), o.input);
1518
1580
  },
1519
- "commands.execute": async (o) => {
1520
- const n = o, s = n.resource ?? J(t.placement.resource);
1521
- return e.executeCommand(n.commandId, {
1581
+ "commands.execute": async (n) => {
1582
+ const o = n, s = o.resource ?? re(t.placement.resource);
1583
+ return e.executeCommand(o.commandId, {
1522
1584
  projectId: e.projectId,
1523
- ...n.params ? {
1524
- params: n.params
1585
+ ...o.params ? {
1586
+ params: o.params
1525
1587
  } : {},
1526
1588
  ...s ? {
1527
1589
  resource: s
1528
1590
  } : {},
1529
- slot: S({
1591
+ slot: M({
1530
1592
  id: t.webviewId,
1531
1593
  kind: e.slotKind,
1532
1594
  projectId: e.projectId,
@@ -1542,17 +1604,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1542
1604
  "files.list": e.files.list,
1543
1605
  "files.delete": e.files.delete
1544
1606
  } : {}
1545
- }), Z = (e, t) => ({
1607
+ }), ne = (e, t) => ({
1546
1608
  kind: t,
1547
1609
  uri: `workbench://extension-route/${encodeURIComponent(e.id)}`,
1548
1610
  id: e.id,
1549
- label: m(e.label, e.id),
1611
+ label: u(e.label, e.id),
1550
1612
  metadata: {
1551
1613
  extensionId: e.extensionId,
1552
1614
  extensionRouteId: e.id,
1553
1615
  path: e.path
1554
1616
  }
1555
- }), we = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), vr = (e) => {
1617
+ }), Re = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), Pr = (e) => {
1556
1618
  if (e.metadata.routes.length === 0) return [];
1557
1619
  const t = [];
1558
1620
  e.workbench.resources.getKind(e.routeResourceKind) || t.push(e.workbench.resources.registerKind({
@@ -1564,48 +1626,48 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1564
1626
  t.push(e.workbench.layout.registerPanel({
1565
1627
  closable: !1,
1566
1628
  id: r.id,
1567
- title: m(r.label, r.id),
1629
+ title: u(r.label, r.id),
1568
1630
  region: "main",
1569
- rendererId: T,
1631
+ rendererId: K,
1570
1632
  singleton: !0,
1571
- config: N(r.webview)
1633
+ config: _(r.webview)
1572
1634
  }));
1573
1635
  return t.push(e.workbench.resources.registerProvider({
1574
1636
  id: "workbench.extension.routes",
1575
1637
  kind: e.routeResourceKind,
1576
1638
  list: () => e.metadata.routes.map((r) => ({
1577
- resource: Z(r, e.routeResourceKind)
1639
+ resource: ne(r, e.routeResourceKind)
1578
1640
  }))
1579
1641
  }), e.workbench.resources.registerPresenter({
1580
1642
  id: "workbench.extension.routes",
1581
- canOpen: (r) => r.kind === e.routeResourceKind && !!we(e.metadata, r),
1582
- open: (r, o) => {
1583
- const n = we(e.metadata, r);
1584
- return e.workbench.layout.openPanel(n.id, {
1585
- strategy: o.replaceActive ? {
1643
+ canOpen: (r) => r.kind === e.routeResourceKind && !!Re(e.metadata, r),
1644
+ open: (r, n) => {
1645
+ const o = Re(e.metadata, r);
1646
+ return e.workbench.layout.openPanel(o.id, {
1647
+ strategy: n.replaceActive ? {
1586
1648
  kind: "replace-active"
1587
1649
  } : {
1588
- kind: "activate-or-open"
1650
+ kind: "persistent"
1589
1651
  },
1590
- title: m(n.label, n.id)
1652
+ title: u(o.label, o.id)
1591
1653
  });
1592
1654
  }
1593
1655
  })), t;
1594
- }, kr = {
1656
+ }, Tr = {
1595
1657
  "workbench.left.tree": "sidenav",
1596
1658
  "workbench.main.left.tree": "main-left-menu",
1597
1659
  "workbench.main.right.tree": "main-right-menu"
1598
- }, Rr = (e) => e ? kr[e] ?? "sidenav" : "sidenav", Cr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Er = (e, t) => {
1660
+ }, Sr = (e) => e ? Tr[e] ?? "sidenav" : "sidenav", Wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, jr = (e, t) => {
1599
1661
  if (t.action.kind === "kanbanRenderer") return {
1600
1662
  kind: "panel",
1601
1663
  panelId: t.action.kanbanRendererId
1602
1664
  };
1603
1665
  const r = t.action;
1604
1666
  if (r.kind === "route") {
1605
- const o = e.metadata.routes.find((n) => n.id === r.route);
1606
- return o ? {
1667
+ const n = e.metadata.routes.find((o) => o.id === r.route);
1668
+ return n ? {
1607
1669
  kind: "resource",
1608
- resource: Z(o, e.routeResourceKind)
1670
+ resource: ne(n, e.routeResourceKind)
1609
1671
  } : void 0;
1610
1672
  }
1611
1673
  return r.kind === "command" ? {
@@ -1619,15 +1681,15 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1619
1681
  href: r.href
1620
1682
  }
1621
1683
  };
1622
- }, xr = (e) => {
1684
+ }, Kr = (e) => {
1623
1685
  const t = e.metadata.treeItems ?? [];
1624
1686
  if (t.length === 0) return [];
1625
- const r = [], o = /* @__PURE__ */ new Map();
1626
- for (const n of t) o.set(n.target, [...o.get(n.target) ?? [], n]);
1627
- for (const [n, s] of o) {
1628
- const a = `workbench.extension.treeItems.${n}`;
1687
+ const r = [], n = /* @__PURE__ */ new Map();
1688
+ for (const o of t) n.set(o.target, [...n.get(o.target) ?? [], o]);
1689
+ for (const [o, s] of n) {
1690
+ const i = `workbench.extension.treeItems.${o}`;
1629
1691
  r.push(e.workbench.renderers.registerTreeRenderer({
1630
- id: a,
1692
+ id: i,
1631
1693
  title: "Extensions",
1632
1694
  getChildren: (d) => d.children ?? [],
1633
1695
  getBody: () => [{
@@ -1635,286 +1697,310 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1635
1697
  label: "Extensions",
1636
1698
  nodes: s.map((d) => ({
1637
1699
  id: d.id,
1638
- label: m(d.label, d.id),
1700
+ label: u(d.label, d.id),
1639
1701
  icon: d.icon,
1640
- target: Er(e, d)
1702
+ target: jr(e, d)
1641
1703
  }))
1642
1704
  }]
1643
1705
  }), e.workbench.layout.registerPanel({
1644
1706
  closable: !1,
1645
- id: a,
1707
+ id: i,
1646
1708
  title: "Extensions",
1647
- region: Rr(n),
1648
- rendererId: a,
1709
+ region: Sr(o),
1710
+ rendererId: i,
1649
1711
  singleton: !0
1650
1712
  }));
1651
1713
  }
1652
- for (const n of t.filter((s) => s.action.kind === "href")) {
1653
- const s = n.action;
1714
+ for (const o of t.filter((s) => s.action.kind === "href")) {
1715
+ const s = o.action;
1654
1716
  s.kind === "href" && r.push(e.workbench.commands.registerCommand({
1655
- id: `workbench.extension.href.${n.id}`,
1656
- label: m(n.label, n.id)
1717
+ id: `workbench.extension.href.${o.id}`,
1718
+ label: u(o.label, o.id)
1657
1719
  }, {
1658
- execute: (a) => e.openHref?.(Cr(a)?.href ?? s.href)
1720
+ execute: (i) => e.openHref?.(Wr(i)?.href ?? s.href)
1659
1721
  }));
1660
1722
  }
1661
1723
  return r;
1662
- }, Y = "extension-route", Ar = "extensions", Pr = (e) => {
1724
+ }, ee = "extension-route", Mr = "extensions", Dr = (e) => {
1663
1725
  for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
1664
- }, ee = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Tr = (e) => e === void 0 ? void 0 : e, Sr = (e) => e === "global" ? "user" : "project", Wr = (e, t) => t ? (r) => ({
1726
+ }, oe = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $r = (e) => e === void 0 ? void 0 : e, Br = (e) => e === "global" ? "user" : "project", Hr = (e, t) => t ? (r) => ({
1665
1727
  ...e(r),
1666
1728
  ...t(r)
1667
- }) : e, Ke = (e, t) => {
1668
- const r = e.createWebviewHostCapabilities ?? yr({
1729
+ }) : e, Le = (e, t) => {
1730
+ const r = e.createWebviewHostCapabilities ?? Ar({
1669
1731
  executeCommand: e.executeCommand,
1670
1732
  files: e.webviewFiles,
1671
1733
  projectId: e.projectId,
1672
1734
  slotKind: t
1673
1735
  });
1674
- return Wr(r, e.createWebviewHostCapabilityOverrides);
1675
- }, jr = (e, t) => {
1676
- e.workbench.renderers.getRenderer(T) || t.push(e.workbench.renderers.registerRenderer(bt({
1677
- createHostCapabilities: Ke(e, "panel"),
1736
+ return Hr(r, e.createWebviewHostCapabilityOverrides);
1737
+ }, Lr = (e, t) => {
1738
+ e.workbench.renderers.getRenderer(K) || t.push(e.workbench.renderers.registerRenderer(It({
1739
+ createHostCapabilities: Le(e, "panel"),
1678
1740
  createProps: e.createWebviewProps,
1679
1741
  createTheme: e.createWebviewTheme
1680
1742
  })));
1681
- }, Kr = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
1743
+ }, Or = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
1682
1744
  id: r.id,
1683
- label: m(r.title, r.id),
1684
- description: m(r.description),
1745
+ label: u(r.title, r.id),
1746
+ description: u(r.description),
1685
1747
  params: r.params
1686
1748
  }, {
1687
- execute: (o, n) => k(e, r.id, {
1688
- params: ee(o),
1689
- resource: n?.resource
1749
+ execute: (n, o) => k(e, r.id, {
1750
+ params: oe(n),
1751
+ resource: o?.resource
1690
1752
  })
1691
- })), Me = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Mr = (e, t) => e.menuSlotsById ? Mt({
1753
+ })), Oe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Vr = (e, t) => e.menuSlotsById ? Vt({
1692
1754
  metadata: e.metadata,
1693
1755
  menuSlotsById: e.menuSlotsById,
1694
1756
  menuTargetsById: e.menuTargetsById,
1695
1757
  createWhenExpression: e.createMenuWhenExpression
1696
- }).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
1697
- execute: (n, s) => k(t, o.targetCommandId, {
1758
+ }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
1759
+ execute: (o, s) => k(t, n.targetCommandId, {
1698
1760
  params: {
1699
- ...o.contribution.params ?? {},
1700
- ...ee(n) ?? {}
1761
+ ...n.contribution.params ?? {},
1762
+ ...oe(o) ?? {}
1701
1763
  },
1702
- resource: Me(e, s),
1703
- slot: S({
1704
- id: o.contribution.slotId,
1764
+ resource: Oe(e, s),
1765
+ slot: M({
1766
+ id: n.contribution.slotId,
1705
1767
  kind: "menu",
1706
1768
  projectId: e.projectId,
1707
1769
  context: {
1708
- panelId: o.contribution.id
1770
+ panelId: n.contribution.id
1709
1771
  }
1710
1772
  })
1711
1773
  })
1712
- }), e.workbench.layout.registerMenuItem(o.menuPath, o.menuItem)]) : [], $r = (e, t) => $t({
1774
+ }), e.workbench.layout.registerMenuItem(n.menuPath, n.menuItem)]) : [], Fr = (e, t) => Ft({
1713
1775
  metadata: e.metadata
1714
- }).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
1715
- execute: (n, s) => k(t, o.targetCommandId, {
1776
+ }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
1777
+ execute: (o, s) => k(t, n.targetCommandId, {
1716
1778
  params: {
1717
- ...o.contribution.params ?? {},
1718
- ...ee(n) ?? {}
1779
+ ...n.contribution.params ?? {},
1780
+ ...oe(o) ?? {}
1719
1781
  },
1720
- resource: Me(e, s),
1721
- slot: S({
1782
+ resource: Oe(e, s),
1783
+ slot: M({
1722
1784
  id: "workbench.commandPalette",
1723
1785
  kind: "menu",
1724
1786
  projectId: e.projectId,
1725
1787
  context: {
1726
- panelId: o.contribution.id
1788
+ panelId: n.contribution.id
1727
1789
  }
1728
1790
  })
1729
1791
  }),
1730
- isVisible: () => Le(o.contribution.when, e.workbench.getPrimaryResource()?.kind)
1731
- }), e.workbench.layout.registerMenuItem(Oe, o.menuItem)]), Br = (e) => e.metadata.panels.flatMap((t) => t.webview ? [K({
1732
- workbench: e.workbench,
1733
- contribution: {
1734
- id: t.id,
1735
- title: m(t.title, t.id),
1736
- region: t.region,
1737
- closable: t.closable,
1738
- rendererId: T,
1739
- singleton: !0,
1740
- resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
1741
- eligibleLocations: W(t.eligibleLocations),
1742
- panelMenus: j(t.panelMenus),
1743
- config: {
1744
- ...N(t.webview),
1745
- ...t.region === "overlay" ? {
1746
- size: "lg",
1747
- scrollBehavior: "inside",
1748
- contentHeight: "min(560px, calc(100dvh - 48px))"
1749
- } : {}
1792
+ isVisible: () => ze(n.contribution.when, e.workbench.getPrimaryResource()?.kind)
1793
+ }), e.workbench.layout.registerMenuItem(Qe, n.menuItem)]), Nr = (e) => {
1794
+ const t = $(e.metadata.panels);
1795
+ return e.metadata.panels.flatMap((r, n) => r.webview ? [H({
1796
+ workbench: e.workbench,
1797
+ contribution: {
1798
+ id: r.id,
1799
+ title: u(r.title, r.id),
1800
+ region: r.region,
1801
+ closable: r.closable,
1802
+ rendererId: K,
1803
+ singleton: !0,
1804
+ resourceKinds: r.resourceKind ? [r.resourceKind] : void 0,
1805
+ eligibleLocations: D(r.eligibleLocations),
1806
+ panelMenus: B(r.panelMenus, t[n]),
1807
+ ...A({
1808
+ placement: r.placement,
1809
+ declarationIndex: n
1810
+ }),
1811
+ config: {
1812
+ ..._(r.webview),
1813
+ ...r.region === "overlay" ? {
1814
+ size: "lg",
1815
+ scrollBehavior: "inside",
1816
+ contentHeight: "min(560px, calc(100dvh - 48px))"
1817
+ } : {}
1818
+ }
1750
1819
  }
1751
- }
1752
- })] : []), Dr = (e) => {
1753
- const t = [], r = e.settingsSectionId ?? Ar;
1820
+ })] : []);
1821
+ }, Ur = (e) => {
1822
+ const t = [], r = e.settingsSectionId ?? Mr;
1754
1823
  e.workbench.settings.getSection(r) || t.push(e.workbench.settings.registerSection({
1755
1824
  id: r,
1756
1825
  title: e.settingsSectionTitle ?? "Extensions"
1757
1826
  }));
1758
- const o = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((n) => [n.key, {
1759
- type: n.type,
1760
- scope: Sr(n.scope),
1761
- default: Tr(n.default),
1762
- enum: n.enum,
1763
- description: m(n.description)
1827
+ const n = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((o) => [o.key, {
1828
+ type: o.type,
1829
+ scope: Br(o.scope),
1830
+ default: $r(o.default),
1831
+ enum: o.enum,
1832
+ description: u(o.description)
1764
1833
  }]));
1765
- Object.keys(o).length > 0 && t.push(e.workbench.preferences.registerSchema({
1766
- properties: o
1834
+ Object.keys(n).length > 0 && t.push(e.workbench.preferences.registerSchema({
1835
+ properties: n
1767
1836
  }));
1768
- for (const n of e.metadata.settingsPanels)
1837
+ for (const o of e.metadata.settingsPanels)
1769
1838
  t.push(e.workbench.settings.registerPanel({
1770
- id: n.id,
1771
- title: m(n.title, n.id),
1839
+ id: o.id,
1840
+ title: u(o.title, o.id),
1772
1841
  kind: "custom",
1773
1842
  section: r,
1774
- scope: n.scope,
1775
- render: (s) => Ce({
1843
+ scope: o.scope,
1844
+ render: (s) => Se({
1776
1845
  context: {
1777
1846
  workbench: s.workbench,
1778
- webviewId: n.id,
1847
+ webviewId: o.id,
1779
1848
  placement: {
1780
1849
  ...s.instance,
1781
- panelId: n.id
1850
+ panelId: o.id
1782
1851
  },
1783
- hostEvents: Re(s.workbench, s.instance)
1852
+ hostEvents: Te(s.workbench, s.instance)
1784
1853
  },
1785
- createHostCapabilities: Ke(e, "settings"),
1854
+ createHostCapabilities: Le(e, "settings"),
1786
1855
  createProps: e.createWebviewProps ?? (({
1787
- placement: a
1856
+ placement: i
1788
1857
  }) => ({
1789
- placement: a,
1790
- resource: a.resource
1858
+ placement: i,
1859
+ resource: i.resource
1791
1860
  })),
1792
1861
  createTheme: e.createWebviewTheme,
1793
- ownerId: n.extensionId,
1794
- title: m(n.title, n.id),
1795
- webview: N(n.webview)
1862
+ ownerId: o.extensionId,
1863
+ title: u(o.title, o.id),
1864
+ webview: _(o.webview)
1796
1865
  })
1797
1866
  }));
1798
1867
  return t;
1799
- }, Hr = (e) => {
1868
+ }, _r = (e) => {
1800
1869
  const t = /* @__PURE__ */ new Set();
1801
- for (const o of e.metadata.panels) o.resourceKind && t.add(o.resourceKind);
1802
- for (const o of e.metadata.kanbanRenderers ?? []) o.resourceKind && t.add(o.resourceKind);
1870
+ for (const n of e.metadata.panels) n.resourceKind && t.add(n.resourceKind);
1871
+ for (const n of e.metadata.kanbanRenderers ?? []) n.resourceKind && t.add(n.resourceKind);
1803
1872
  const r = [];
1804
- for (const o of t) {
1805
- e.workbench.resources.getKind(o) || r.push(e.workbench.resources.registerKind({
1806
- kind: o,
1807
- label: o,
1873
+ for (const n of t) {
1874
+ e.workbench.resources.getKind(n) || r.push(e.workbench.resources.registerKind({
1875
+ kind: n,
1876
+ label: n,
1808
1877
  icon: "FileText",
1809
1878
  surface: "primary"
1810
1879
  }));
1811
- const n = e.metadata.panels.filter((s) => s.resourceKind === o && s.region !== "overlay");
1812
- n.length > 0 && r.push(e.workbench.resources.registerPresenter({
1813
- id: `workbench.extension.resource.${o}`,
1814
- canOpen: (s) => s.kind === o,
1880
+ const o = e.metadata.panels.filter((s) => s.resourceKind === n && s.region !== "overlay");
1881
+ o.length > 0 && r.push(e.workbench.resources.registerPresenter({
1882
+ id: `workbench.extension.resource.${n}`,
1883
+ canOpen: (s) => s.kind === n,
1815
1884
  open: (s) => {
1816
- const a = n.map((d) => e.workbench.layout.openPanel(d.id, {
1885
+ const i = o.map((d) => e.workbench.layout.openPanel(d.id, {
1817
1886
  resource: s,
1818
- title: s.label ?? s.id ?? s.uri
1887
+ title: s.label ?? s.id ?? s.uri,
1888
+ strategy: {
1889
+ kind: "persistent"
1890
+ }
1819
1891
  }));
1820
- return a.find((d, c) => n[c]?.region === "main") ?? a[0];
1892
+ return i.find((d, c) => o[c]?.region === "main") ?? i[0];
1821
1893
  }
1822
1894
  }));
1823
1895
  }
1824
1896
  return r;
1825
- }, Vr = (e, t) => {
1826
- t.panel && e.layout.openPanel(t.panel, {
1897
+ }, qr = (e, t) => {
1898
+ if (!t.panel) return;
1899
+ e.layout.openPanel(t.panel, {
1827
1900
  region: t.region,
1828
1901
  pinned: t.pinned,
1829
- title: m(t.title)
1830
- });
1831
- }, Fr = (e, t, r) => {
1902
+ title: u(t.title),
1903
+ strategy: {
1904
+ kind: "persistent"
1905
+ }
1906
+ }), (t.region ?? e.layout.getPanel(t.panel)?.region) === "side" && e.shell.setSidePanelPresentation("attached");
1907
+ }, zr = (e, t, r) => {
1832
1908
  if (!r.resource) return;
1833
- const o = e.metadata.routes.find((n) => n.id === r.resource || n.path === r.resource);
1834
- o && t.resources.openResource(Z(o, e.routeResourceKind ?? Y));
1835
- }, Lr = (e, t, r) => {
1836
- for (const o of r.layout?.open ?? [])
1837
- Vr(t, o), Fr(e, t, o);
1838
- }, Or = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
1909
+ const n = e.metadata.routes.find((o) => o.id === r.resource || o.path === r.resource);
1910
+ n && t.resources.openResource(ne(n, e.routeResourceKind ?? ee));
1911
+ }, Qr = (e, t, r) => {
1912
+ for (const n of r.layout?.open ?? [])
1913
+ qr(t, n), zr(e, t, n);
1914
+ }, Gr = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
1839
1915
  id: t.modeId,
1840
- label: m(t.label, t.modeId),
1916
+ label: u(t.label, t.modeId),
1841
1917
  panels: t.layout?.panels,
1842
1918
  activate: () => {
1843
1919
  },
1844
1920
  seed: (r) => {
1845
- Lr(e, r, t);
1921
+ Qr(e, r, t);
1846
1922
  }
1847
- })), io = (e) => {
1923
+ })), pn = (e) => {
1848
1924
  const t = [], r = e;
1849
- return jr(e, t), t.push(...Kr(r, e.metadata)), t.push(...Mr(e, r)), t.push(...$r(e, r)), t.push(Ir(e)), t.push(Ft(e)), t.push(...Br(e)), t.push(dr(r, e.metadata.kanbanRenderers ?? [])), t.push(Pt(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels)), t.push(It(r, e.metadata.commandPaletteResources ?? [])), t.push(...Dr(e)), t.push(...vr({
1925
+ return Lr(e, t), t.push(...Or(r, e.metadata)), t.push(...Vr(e, r)), t.push(...Fr(e, r)), t.push(xr(e)), t.push(zt(e)), t.push(...Nr(e)), t.push(pr(r, e.metadata.kanbanRenderers ?? [])), t.push(Dt(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels)), t.push(Et(r, e.metadata.commandPaletteResources ?? [])), t.push(...Ur(e)), t.push(...Pr({
1850
1926
  metadata: e.metadata,
1851
- routeResourceKind: e.routeResourceKind ?? Y,
1927
+ routeResourceKind: e.routeResourceKind ?? ee,
1852
1928
  workbench: e.workbench
1853
- })), t.push(...xr({
1929
+ })), t.push(...Kr({
1854
1930
  metadata: e.metadata,
1855
1931
  openHref: e.openHref,
1856
- routeResourceKind: e.routeResourceKind ?? Y,
1932
+ routeResourceKind: e.routeResourceKind ?? ee,
1857
1933
  workbench: e.workbench
1858
- })), t.push(...Hr(e)), t.push(...Or(e)), {
1934
+ })), t.push(..._r(e)), t.push(...Gr(e)), {
1859
1935
  dispose() {
1860
- Pr(t);
1936
+ Dr(t);
1861
1937
  }
1862
1938
  };
1863
- }, Nr = (e) => new Set((e.treeRenderers ?? []).flatMap((t) => [t.bodyCommandId, t.childrenCommandId, t.footerCommandId].filter((r) => r))), Ur = (e) => new Set((e.kanbanRenderers ?? []).map((t) => t.queryCommandId)), _r = (e) => new Set((e.dataTableRenderers ?? []).map((t) => t.queryCommandId)), ge = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), qr = (e, t) => {
1939
+ }, Yr = (e) => new Set((e.treeRenderers ?? []).flatMap((t) => [t.bodyCommandId, t.childrenCommandId, t.footerCommandId].filter((r) => r))), Xr = (e) => new Set((e.kanbanRenderers ?? []).map((t) => t.queryCommandId)), Jr = (e) => new Set((e.dataTableRenderers ?? []).map((t) => t.queryCommandId)), Ce = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), Zr = (e, t) => {
1864
1940
  if (t)
1865
1941
  try {
1866
1942
  e.layout.activatePanel(t);
1867
1943
  } catch {
1868
1944
  }
1869
- }, zr = (e, t) => !Nr(e).has(t), Qr = (e, t) => !Ur(e).has(t), Gr = (e, t) => !_r(e).has(t), Yr = (e, t) => {
1945
+ }, en = (e, t) => !Yr(e).has(t), tn = (e, t) => !Xr(e).has(t), rn = (e, t) => !Jr(e).has(t), nn = (e, t) => {
1870
1946
  const r = e.layout.getLayout().activeWidgetId;
1871
- for (const o of t.panels) {
1872
- if (!o.webview || o.region === "overlay") continue;
1873
- const n = ge(e, o.id);
1874
- n && e.layout.openPanel(o.id, {
1875
- resource: n.resource,
1876
- title: m(o.title, n.title)
1947
+ for (const n of t.panels) {
1948
+ if (!n.webview || n.region === "overlay") continue;
1949
+ const o = Ce(e, n.id);
1950
+ o && e.layout.openPanel(n.id, {
1951
+ resource: o.resource,
1952
+ title: u(n.title, o.title),
1953
+ strategy: {
1954
+ kind: "replace-panel",
1955
+ instanceId: o.instanceId
1956
+ }
1877
1957
  });
1878
1958
  }
1879
- for (const o of t.routes) {
1880
- if (!o.webview) continue;
1881
- const n = ge(e, o.id);
1882
- n && e.layout.openPanel(o.id, {
1883
- resource: n.resource,
1884
- title: m(o.label, n.title)
1959
+ for (const n of t.routes) {
1960
+ if (!n.webview) continue;
1961
+ const o = Ce(e, n.id);
1962
+ o && e.layout.openPanel(n.id, {
1963
+ resource: o.resource,
1964
+ title: u(n.label, o.title),
1965
+ strategy: {
1966
+ kind: "replace-panel",
1967
+ instanceId: o.instanceId
1968
+ }
1885
1969
  });
1886
1970
  }
1887
- qr(e, r);
1888
- }, ao = (e, t, r) => {
1889
- if (Yr(e, t), zr(t, r))
1890
- for (const o of t.treeRenderers ?? []) e.renderers.refresh(o.id);
1891
- if (Qr(t, r))
1892
- for (const o of t.kanbanRenderers ?? []) e.renderers.refreshKanbanRenderer(o.id);
1893
- if (Gr(t, r))
1894
- for (const o of t.dataTableRenderers ?? [])
1895
- e.renderers.refreshDataTableRenderer(o.id);
1971
+ Zr(e, r);
1972
+ }, hn = (e, t, r) => {
1973
+ if (nn(e, t), en(t, r))
1974
+ for (const n of t.treeRenderers ?? []) e.renderers.refresh(n.id);
1975
+ if (tn(t, r))
1976
+ for (const n of t.kanbanRenderers ?? []) e.renderers.refreshKanbanRenderer(n.id);
1977
+ if (rn(t, r))
1978
+ for (const n of t.dataTableRenderers ?? [])
1979
+ e.renderers.refreshDataTableRenderer(n.id);
1896
1980
  };
1897
1981
  export {
1898
- T as BRIDGE_WEBVIEW_RENDERER_ID,
1899
- $t as buildWorkbenchExtensionCommandPaletteRegistrations,
1900
- Mt as buildWorkbenchExtensionMenuRegistrations,
1901
- so as buildWorkbenchExtensionRouteEntries,
1902
- bt as createBridgeWebviewRenderer,
1903
- it as createTerminalSessionCapability,
1904
- ve as createWorkbenchWebviewHostCapabilities,
1905
- no as emptyWorkbenchExtensionMetadata,
1906
- Yr as refreshOpenWorkbenchExtensionWebviews,
1907
- ao as refreshWorkbenchExtensionContributions,
1908
- It as registerWorkbenchExtensionCommandPaletteResources,
1909
- io as registerWorkbenchExtensionContributions,
1910
- oo as registerWorkbenchExtensionControlsRenderers,
1911
- Pt as registerWorkbenchExtensionDataTableRenderers,
1912
- Ft as registerWorkbenchExtensionFileRenderers,
1913
- dr as registerWorkbenchExtensionKanbanRenderers,
1914
- K as registerWorkbenchExtensionPanel,
1915
- Ir as registerWorkbenchExtensionTreeRenderers,
1916
- Ce as renderBridgeWebviewFrame,
1917
- Gr as shouldRefreshWorkbenchExtensionDataTableRenderers,
1918
- zr as shouldRefreshWorkbenchExtensionTrees
1982
+ K as BRIDGE_WEBVIEW_RENDERER_ID,
1983
+ Ft as buildWorkbenchExtensionCommandPaletteRegistrations,
1984
+ Vt as buildWorkbenchExtensionMenuRegistrations,
1985
+ fn as buildWorkbenchExtensionRouteEntries,
1986
+ It as createBridgeWebviewRenderer,
1987
+ ut as createTerminalSessionCapability,
1988
+ Ae as createWorkbenchWebviewHostCapabilities,
1989
+ bn as emptyWorkbenchExtensionMetadata,
1990
+ $ as panelMenuDeclarationOffsets,
1991
+ nn as refreshOpenWorkbenchExtensionWebviews,
1992
+ hn as refreshWorkbenchExtensionContributions,
1993
+ Et as registerWorkbenchExtensionCommandPaletteResources,
1994
+ pn as registerWorkbenchExtensionContributions,
1995
+ un as registerWorkbenchExtensionControlsRenderers,
1996
+ Dt as registerWorkbenchExtensionDataTableRenderers,
1997
+ zt as registerWorkbenchExtensionFileRenderers,
1998
+ pr as registerWorkbenchExtensionKanbanRenderers,
1999
+ H as registerWorkbenchExtensionPanel,
2000
+ xr as registerWorkbenchExtensionTreeRenderers,
2001
+ Se as renderBridgeWebviewFrame,
2002
+ rn as shouldRefreshWorkbenchExtensionDataTableRenderers,
2003
+ en as shouldRefreshWorkbenchExtensionTrees,
2004
+ A as toWorkbenchExtensionPlacementMetadata
1919
2005
  };
1920
2006
  //# sourceMappingURL=extensions.js.map