@sheetxl/scripting-mui 0.8.0-beta.10 → 0.8.0-beta.12

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,24 +1,25 @@
1
1
  /**
2
- * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.10
2
+ * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.12
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import e, { createElement as t, forwardRef as r, memo as n, useCallback as i, useEffect as o, useMemo as a, useReducer as l, useRef as s, useState as c } from "react";
7
+ import e, { createElement as t, forwardRef as r, memo as n, useCallback as i, useEffect as o, useMemo as l, useReducer as a, useRef as s, useState as c } from "react";
8
8
  import d from "clsx";
9
- import { Box as p, Button as m, CircularProgress as u, Paper as h, Typography as f, useTheme as x } from "@mui/material";
10
- import { Command as g, CommandButtonType as y, DefaultCommandButtonRegistry as S, DefaultIconService as b, DynamicIcon as v, KeyCodes as w, ReactUtils as k, useCallbackRef as C, useCommandButtonEntry as F, useCommands as N, useImperativeElement as T, useTranslator as K } from "@sheetxl/utils-react";
11
- import { AnimatedLoadingPanel as D, CommandButton as I, CommandPopupButton as L, CommandToolbar as P, ExhibitDivider as $, ExhibitMenuItem as E, OverflowPalette as R, defaultCreatePopupPanel as z } from "@sheetxl/utils-mui";
12
- import { DefaultTaskPaneRegistry as A, InputClipboardInjector as B, useModelSync as O, useWorkbook as M } from "@sheetxl/react";
13
- import { Fragment as W, jsx as j, jsxs as H } from "react/jsx-runtime";
14
- import { alpha as U } from "@mui/system";
15
- import { VERSION as q } from "@sheetxl/sdk";
16
- import { ChainedError as Z } from "@sheetxl/utils";
17
- import { ScriptEditor as G, ScriptingReactPlugin as J } from "@sheetxl/scripting-react";
18
- var _ = {
9
+ import { Box as p, Button as u, CircularProgress as m, Paper as f, Typography as h, useTheme as g } from "@mui/material";
10
+ import { Command as x, CommandButtonType as y, DefaultCommandButtonRegistry as S, DefaultIconService as b, DynamicIcon as v, KeyCodes as w, ReactUtils as k, useCallbackRef as C, useCommandButtonEntry as F, useCommands as K, useImperativeElement as N, useTranslator as T } from "@sheetxl/utils-react";
11
+ import { AnimatedLoadingPanel as D, CommandButton as $, CommandPopupButton as I, CommandToolbar as P, ExhibitDivider as E, ExhibitMenuItem as R, OverflowPalette as L, defaultRenderPopupPanel as M } from "@sheetxl/utils-mui";
12
+ import { DefaultTaskPaneRegistry as z, InputClipboardInjector as O, useModelSync as B, useWorkbook as A } from "@sheetxl/react";
13
+ import { Fragment as U, jsx as W, jsxs as H } from "react/jsx-runtime";
14
+ import { alpha as j } from "@mui/system";
15
+ import { listResources as q, releaseChannel as G } from "@sheetxl/utils";
16
+ import { VERSION as Z } from "@sheetxl/sdk";
17
+ import { ScriptEditor as _, ScriptingReactPlugin as J } from "@sheetxl/scripting-react";
18
+ var Q = {
19
19
  "insertFunction.fallbackLabel": "Function",
20
20
  "insertFunction.insertNamed": "Insert {name}",
21
21
  "insertScript.fallbackLabel": "Insert Script",
22
+ "insertScript.loadFailedRetry": "Couldn’t load templates. Retry",
22
23
  "insertScript.loading": "Loading...",
23
24
  "runScript.executeNamed": "Execute {name}",
24
25
  "runScript.fallbackLabel": "Macro",
@@ -28,41 +29,42 @@ var _ = {
28
29
  "templateSelect.intro": "Choose from a template to provide a starting point to automate tasks or create user defined functions.",
29
30
  "templateSelect.intro2": "Templates provide a foundation to customize and meet your specific needs.",
30
31
  "templateSelect.loadFailed": "Failed to load scripts",
32
+ "templateSelect.retry": "Retry",
31
33
  "templateSelect.title": "Script Template",
32
34
  "templateSelect.untitled": "Untitled"
33
- }, { DefaultCommandCatalogService: Q } = g, V = !1;
34
- function X() {
35
- V || (V = !0, Q.registerFromManifest("@sheetxl/scripting-mui", import.meta.url, { messages: _ }));
35
+ }, { DefaultCommandCatalogService: V } = x, X = !1;
36
+ function Y() {
37
+ X || (X = !0, V.registerFromManifest("@sheetxl/scripting-mui", import.meta.url, { messages: Q }));
36
38
  }
37
- X();
38
- var Y = n(r((e, r) => {
39
- const { groupKey: n, ...i } = e, a = M(), l = K(), [s, d] = c([]), [m, u] = c(!1);
39
+ Y();
40
+ var ee = n(r((e, r) => {
41
+ const { groupKey: n, ...i } = e, l = A(), a = T(), [s, d] = c([]), [u, m] = c(!1);
40
42
  o(() => {
41
- const e = a?.getScripts();
43
+ const e = l?.getScripts();
42
44
  if (!e) return;
43
45
  (async () => {
44
- u(!0);
46
+ m(!0);
45
47
  const t = await e.searchFunctions({ type: "macro" });
46
- d(t), u(!1);
48
+ d(t), m(!1);
47
49
  })();
48
- }, [a]);
49
- const h = {
50
+ }, [l]);
51
+ const f = {
50
52
  variant: y.Menuitem,
51
53
  groupKey: "scriptsOptions",
52
54
  shortcut: void 0
53
- }, f = [], x = s ? s.length : 0;
54
- for (let e = 0; e < x; e++) {
55
+ }, h = [], g = s ? s.length : 0;
56
+ for (let e = 0; e < g; e++) {
55
57
  const t = s[e];
56
- f.push(j(I, {
57
- ...h,
58
+ h.push(W($, {
59
+ ...f,
58
60
  commandKey: "executeScript",
59
61
  commandState: { declaration: t },
60
- propsTooltip: { description: l("runScript.executeNamed", { name: t.getName() ?? l("runScript.fallbackLabel") }) },
61
- icon: j(v, { iconKey: "ScriptMacro" }),
62
- label: t.getName() ?? l("runScript.fallbackLabel")
62
+ propsTooltip: { description: a("runScript.executeNamed", { name: t.getName() ?? a("runScript.fallbackLabel") }) },
63
+ icon: W(v, { iconKey: "ScriptMacro" }),
64
+ label: t.getName() ?? a("runScript.fallbackLabel")
63
65
  }, `macro-${t.getName()}-${e}`));
64
66
  }
65
- const g = H(p, {
67
+ const x = H(p, {
66
68
  ref: r,
67
69
  sx: {
68
70
  display: "flex",
@@ -70,105 +72,100 @@ var Y = n(r((e, r) => {
70
72
  flex: "1 1 100%",
71
73
  overflow: "hidden"
72
74
  },
73
- children: [f.length > 0 ? H(W, { children: [j(p, {
75
+ children: [h.length > 0 ? H(U, { children: [W(p, {
74
76
  sx: {
75
77
  overflow: "auto",
76
78
  flex: "1 1 100%"
77
79
  },
78
- children: f
79
- }), j($, { orientation: "horizontal" })] }) : null, t(I, {
80
- ...h,
80
+ children: h
81
+ }), W(E, { orientation: "horizontal" })] }) : null, t($, {
82
+ ...f,
81
83
  key: "show-editor",
82
84
  commandKey: "showScriptEditor"
83
85
  })]
84
86
  });
85
- return z({
87
+ return M({
86
88
  ...i,
87
- children: g
89
+ children: x
88
90
  });
89
91
  }));
90
- Y.displayName = "RunScriptPopupPanel";
91
- var ee = n(r((e, t) => {
92
- const { groupKey: r, disabled: n, ...o } = e, a = N(["showScriptEditor"])[0], l = F("scriptsOptions"), s = i((e) => {
93
- const t = j(Y, {
92
+ ee.displayName = "RunScriptPopupPanel";
93
+ var te = n(r((e, t) => {
94
+ const { groupKey: r, disabled: n, ...o } = e, l = K(["showScriptEditor"])[0], a = F("scriptsOptions"), s = i((e) => {
95
+ const t = W(ee, {
94
96
  disabled: n,
95
97
  groupKey: r,
96
98
  ...e
97
99
  });
98
- return z({
100
+ return M({
99
101
  ...e,
100
102
  children: t
101
103
  });
102
104
  }, [n, r]);
103
- return j(L, {
105
+ return W(I, {
104
106
  ref: t,
105
107
  disabled: n,
106
- createPopupPanel: s,
107
- selected: a?.getState(),
108
- label: l?.getLabel?.(),
109
- tooltip: l?.getDescription?.(),
108
+ renderPopupPanel: s,
109
+ selected: l?.getState(),
110
+ label: a?.getLabel?.(),
111
+ tooltip: a?.getDescription?.(),
110
112
  quickCommand: "showScriptEditor",
111
113
  ...o
112
114
  });
113
- })), te = /^\d+\.\d+\.\d+-([0-9A-Za-z-]+)/.exec(q)?.[1], re = `https://unpkg.com/@sheetxl/templates-scripting${te ? `@${te}` : ""}/dist`, ne = (e, t) => {
114
- try {
115
- return new URL(t).href;
116
- } catch {}
117
- if (t.startsWith("/") || /^[a-zA-Z]:/.test(t)) return t;
118
- let r = e.startsWith("http") ? e : `file:///${e.replace(/\\/g, "/")}`;
119
- return r.endsWith("/") || (r += "/"), new URL(t, r).href;
120
- }, ie = (e) => {
121
- if (e.metadata?.name) return e.metadata.name;
122
- let t = (e.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
123
- return "formula" === e.metadata?.icon ? t.toUpperCase() : (t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.replace(/[-_]/g, " ").trim().split(/\s+/).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "));
124
- }, oe = async (e) => {
125
- const t = ne(e, "./manifest.json"), r = await fetch(t);
126
- if (!r.ok) throw new Z(`Failed to retrieve directory at '${e}': ${r.statusText}`);
127
- const n = await r.text();
128
- if (n.trim().toLowerCase().startsWith("<!doctype html") || n.trim().toLowerCase().startsWith("<html")) throw new Z(`Failed to retrieve directory at '${e}'`);
115
+ })), re = G(Z), ne = `https://unpkg.com/@sheetxl/templates-scripting${re ? `@${re}` : ""}/dist`, ie = "templates-scripting", oe = [
116
+ "formula",
117
+ "macro",
118
+ "autostart"
119
+ ], le = (e) => "string" == typeof e && e ? e : void 0, ae = (e, t) => {
120
+ const r = (e.split("/").pop() ?? "").replace(/\.[^/.]+$/, "");
121
+ return "formula" === t ? r.toUpperCase() : r.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase());
122
+ }, se = async (e, t) => {
123
+ if (!/\.ts$/i.test(t.path)) return null;
124
+ const r = oe.includes(t.icon) ? t.icon : void 0, n = ((e, t) => {
125
+ const r = `${e}${e.endsWith("/") ? "" : "/"}${ie}/${t}`;
126
+ return "undefined" == typeof document ? r : new URL(r, document.baseURI).href;
127
+ })(e, t.path);
129
128
  let i;
130
129
  try {
131
- i = JSON.parse(n);
130
+ const e = await fetch(n);
131
+ if (!e.ok || (e.headers.get("content-type") ?? "").includes("text/html")) throw new Error(e.ok ? "not found" : e.statusText || String(e.status));
132
+ i = await e.text();
132
133
  } catch (e) {
133
- throw new Error(`Failed to parse directory: ${e.message}. Ensure the file is valid JSON.`);
134
+ return console.warn(`Script template '${n}' did not load: ${e?.message ?? e}`), null;
134
135
  }
135
- const o = i.map(async (t) => {
136
- try {
137
- const r = ne(e, t.path), n = await fetch(r);
138
- if (!n.ok) throw new Error(`Failed to fetch file at '${t.path}': ${n.statusText}`);
139
- const i = await n.text();
140
- let o = t.metadata;
141
- return o?.title || (o = {
142
- title: ie(t),
143
- ...o
144
- }), {
145
- path: t.path,
146
- content: i,
147
- metadata: o
148
- };
149
- } catch (e) {
150
- console.error(e.message);
151
- }
152
- return null;
153
- });
154
- return (await Promise.all(o)).filter((e) => null !== e);
155
- }, ae = { marginRight: "4px" }, le = "1em", se = n((e) => {
156
- const { disabled: t, snippet: r, description: n, handleInsert: i, sx: o, ...a } = e;
157
- let l;
158
- const s = r.metadata?.icon;
159
- return l = j(v, "formula" === s ? {
136
+ return {
137
+ path: t.path,
138
+ title: le(t.title) ?? ae(t.path, r),
139
+ summary: le(t.summary),
140
+ icon: r,
141
+ content: i
142
+ };
143
+ }, ce = /* @__PURE__ */ new Map(), de = (e = ne) => {
144
+ let t = ce.get(e);
145
+ return t || (t = (async () => {
146
+ const t = (await q("templates", ie, e)).find((e) => void 0 !== e.meta?.schema);
147
+ if (!t) throw new Error(`No script templates found at '${e}'.`);
148
+ return 1 !== Math.floor(Number(t.meta?.schema)) ? (console.warn(`Script template catalog at '${e}' has schema ${t.meta?.schema}; expected 1.`), []) : (await Promise.all(t.entries.map((t) => se(e, t)))).filter((e) => null !== e);
149
+ })(), ce.set(e, t), t.catch(() => {
150
+ ce.delete(e);
151
+ })), t;
152
+ }, pe = { marginRight: "4px" }, ue = "1em", me = n((e) => {
153
+ const { disabled: t, snippet: r, description: n, handleInsert: i, sx: o, ...l } = e;
154
+ let a;
155
+ const s = r.icon;
156
+ return a = W(v, "formula" === s ? {
160
157
  iconKey: "ScriptFormula",
161
- size: le,
162
- style: ae
158
+ size: ue,
159
+ style: pe
163
160
  } : "macro" === s ? {
164
161
  iconKey: "ScriptMacro",
165
- size: le,
166
- style: ae
162
+ size: ue,
163
+ style: pe
167
164
  } : {
168
165
  iconKey: "ScriptAutoRun",
169
- size: le,
170
- style: ae
171
- }), j(E, {
166
+ size: ue,
167
+ style: pe
168
+ }), W(R, {
172
169
  sx: {
173
170
  maxWidth: "460px",
174
171
  display: "flex",
@@ -176,7 +173,7 @@ var ee = n(r((e, t) => {
176
173
  ...o
177
174
  },
178
175
  disabled: t,
179
- icon: l,
176
+ icon: a,
180
177
  onMouseDown: (e) => {
181
178
  0 === e.button && e.preventDefault();
182
179
  },
@@ -186,7 +183,7 @@ var ee = n(r((e, t) => {
186
183
  onKeyDown: (e) => {
187
184
  e.keyCode !== w.Enter && e.keyCode !== w.Space || i(r);
188
185
  },
189
- ...a,
186
+ ...l,
190
187
  children: H(p, {
191
188
  sx: {
192
189
  display: "flex",
@@ -194,50 +191,62 @@ var ee = n(r((e, t) => {
194
191
  flexDirection: "column",
195
192
  overflow: "hidden"
196
193
  },
197
- children: [j(f, {
194
+ children: [W(h, {
198
195
  component: "div",
199
- children: r.metadata?.title ?? r.path
200
- }), j(f, {
196
+ children: r.title
197
+ }), W(h, {
201
198
  variant: "caption",
202
199
  component: "div",
203
200
  sx: {
204
- color: (e) => U(e.palette.text.secondary ?? e.palette.text.primary, .6),
201
+ color: (e) => j(e.palette.text.secondary ?? e.palette.text.primary, .6),
205
202
  overflow: "hidden",
206
203
  textOverflow: "ellipsis"
207
204
  },
208
- children: r.metadata?.summary
205
+ children: r.summary
209
206
  })]
210
207
  })
211
208
  });
212
- }), ce = n(r((e, r) => {
213
- const { groupKey: n, disabled: a, scriptPath: l = re, ...s } = e, d = K(), [m, u] = c([]), [h, f] = c(!0), [x] = N(["insertScript"]), g = a || (x?.disabled() ?? !1);
209
+ }), fe = n(r((e, r) => {
210
+ const { groupKey: n, disabled: l, scriptPath: a = ne, ...s } = e, d = T(), [u, m] = c([]), [f, h] = c("loading"), [g, x] = c(0), [S] = K(["insertScript"]), b = l || (S?.disabled() ?? !1);
214
211
  o(() => {
215
- (async () => {
216
- try {
217
- const e = await oe(l);
218
- u(e);
219
- } catch (e) {} finally {
220
- f(!1);
221
- }
222
- })();
223
- }, [l]);
224
- const S = i((e) => {
225
- if (h) return j("div", { children: d("insertScript.loading") });
212
+ let e = !1;
213
+ return h("loading"), de(a).then((t) => {
214
+ e || (m(t), h("ready"));
215
+ }, () => {
216
+ e || (m([]), h("error"));
217
+ }), () => {
218
+ e = !0;
219
+ };
220
+ }, [a, g]);
221
+ const v = i((e) => {
222
+ if ("loading" === f) return W("div", { children: d("insertScript.loading") });
226
223
  const r = {
227
224
  variant: y.Menuitem,
228
225
  groupKey: "scriptsOptions",
229
- disabled: g
226
+ disabled: b
230
227
  }, n = (t) => {
231
- x?.execute(t.content), e.closeFloat?.();
232
- }, i = [];
233
- for (let e = 0; e < m.length; e++) {
234
- const t = m[e];
235
- t && i.push(j(se, {
228
+ S?.execute(t.content), e.closeFloat?.();
229
+ }, i = () => x((e) => e + 1), o = [];
230
+ "error" === f && o.push(W(R, {
231
+ onMouseDown: (e) => {
232
+ 0 === e.button && e.preventDefault();
233
+ },
234
+ onMouseUp: (e) => {
235
+ 0 === e.button && i();
236
+ },
237
+ onKeyDown: (e) => {
238
+ e.keyCode !== w.Enter && e.keyCode !== w.Space || i();
239
+ },
240
+ children: d("insertScript.loadFailedRetry")
241
+ }, "retry"));
242
+ for (let e = 0; e < u.length; e++) {
243
+ const t = u[e];
244
+ t && o.push(W(me, {
236
245
  handleInsert: n,
237
246
  snippet: t
238
247
  }, t.path));
239
248
  }
240
- const o = H(p, {
249
+ const l = H(p, {
241
250
  sx: {
242
251
  display: "flex",
243
252
  flexDirection: "column",
@@ -245,106 +254,105 @@ var ee = n(r((e, t) => {
245
254
  overflow: "hidden"
246
255
  },
247
256
  children: [
248
- i.length > 0 ? H(W, { children: [j(p, {
257
+ o.length > 0 ? H(U, { children: [W(p, {
249
258
  sx: {
250
259
  overflow: "auto",
251
260
  flex: "1 1 100%"
252
261
  },
253
- children: i
254
- }), j($, { orientation: "horizontal" })] }) : null,
255
- t(I, {
262
+ children: o
263
+ }), W(E, { orientation: "horizontal" })] }) : null,
264
+ t($, {
256
265
  ...r,
257
266
  key: "showKeyboardShortcuts",
258
267
  commandKey: "showKeyboardShortcuts"
259
268
  }),
260
- t(I, {
269
+ t($, {
261
270
  ...r,
262
271
  key: "scriptingHelp",
263
272
  commandKey: "scriptingHelp"
264
273
  })
265
274
  ]
266
275
  });
267
- return z({
276
+ return M({
268
277
  ...e,
269
- children: o
278
+ children: l
270
279
  });
271
280
  }, [
272
- g,
281
+ b,
273
282
  n,
274
- h,
275
- x,
283
+ f,
284
+ u,
285
+ S,
276
286
  d
277
287
  ]);
278
- return j(L, {
288
+ return W(I, {
279
289
  ref: r,
280
- disabled: g,
290
+ disabled: b,
281
291
  groupKey: n,
282
- label: x?.getLabel(n) ?? d("insertScript.fallbackLabel"),
283
- tooltip: x?.getDescription(),
284
- createPopupPanel: S,
285
- icon: x?.getIcon() ?? "ScriptInsert",
292
+ label: S?.getLabel(n) ?? d("insertScript.fallbackLabel"),
293
+ tooltip: S?.getDescription(),
294
+ renderPopupPanel: v,
295
+ icon: S?.getIcon() ?? "ScriptInsert",
286
296
  ...s
287
297
  });
288
- })), de = n(r((e, t) => {
298
+ })), he = n(r((e, t) => {
289
299
  const { propsCommandButton: r, ...n } = e, i = C((e) => {
290
300
  const { propsCommandButton: t, propsCommandPopup: r } = e;
291
- return j(W, { children: H("div", {
301
+ return W(U, { children: H("div", {
292
302
  style: {
293
303
  display: "flex",
294
304
  flex: "1 1 100%"
295
305
  },
296
306
  children: [
297
- j("div", { children: j(R, {
307
+ W("div", { children: W(L, {
298
308
  style: {},
299
- children: j(I, {
309
+ children: W($, {
300
310
  ...t,
301
311
  commandKey: "saveScripts"
302
312
  })
303
313
  }) }),
304
- j("div", { style: { flex: "1 1 100%" } }),
305
- j("div", { children: j(R, {
314
+ W("div", { style: { flex: "1 1 100%" } }),
315
+ W("div", { children: W(L, {
306
316
  style: {},
307
- children: j(ce, { ...t })
317
+ children: W(fe, { ...t })
308
318
  }) })
309
319
  ]
310
320
  }) });
311
321
  }, []);
312
- return j(P, {
322
+ return W(P, {
313
323
  ref: t,
314
324
  propsCommandButton: r,
315
325
  renderToolbarPalette: i,
316
326
  ...n
317
327
  });
318
328
  }));
319
- de.displayName = "ScriptEditorToolbar", X();
320
- var pe = n(r((e, t) => {
321
- const { scriptPath: r = re, onScriptSelect: n, disabled: i = !1, sx: a = k.EmptyCssProperties, className: l, buttonMinWidth: s = 210, buttonMinHeight: h = 80, gap: x = 12, ...g } = e, y = K(), [S, b] = c([]), [w, C] = c(!0), [F, N] = c(null);
329
+ he.displayName = "ScriptEditorToolbar", Y();
330
+ var ge = n(r((e, t) => {
331
+ const { scriptPath: r = ne, onScriptSelect: n, disabled: i = !1, sx: l = k.EmptyCssProperties, className: a, buttonMinWidth: s = 210, buttonMinHeight: f = 80, gap: g = 12, ...x } = e, y = T(), [S, b] = c([]), [w, C] = c(!0), [F, K] = c(null), [N, D] = c(0);
322
332
  if (o(() => {
323
- (async () => {
324
- const e = [{
325
- path: null,
326
- metadata: {
327
- title: y("templateSelect.blankTitle"),
328
- summary: y("templateSelect.blankSummary")
329
- },
330
- content: ""
331
- }];
332
- try {
333
- C(!0), N(null);
334
- const t = await oe(r);
335
- for (let r = 0; r < t.length; r++) {
336
- const n = t[r];
337
- n && e.push(n);
338
- }
339
- } catch (e) {
340
- N(e instanceof Error ? e.message : y("templateSelect.loadFailed")), e instanceof Z || console.error("Error loading scripts:", e);
341
- } finally {
342
- b(e), C(!1);
343
- }
344
- })();
345
- }, [r, y]), w) return j(p, {
346
- className: d(l, "script-select"),
347
- ...g,
333
+ let e = !1;
334
+ const t = {
335
+ path: null,
336
+ title: y("templateSelect.blankTitle"),
337
+ summary: y("templateSelect.blankSummary"),
338
+ content: ""
339
+ };
340
+ return C(!0), K(null), de(r).then((r) => {
341
+ e || b([t, ...r]);
342
+ }, (r) => {
343
+ e || (b([t]), K(r instanceof Error ? r.message : y("templateSelect.loadFailed")));
344
+ }).finally(() => {
345
+ e || C(!1);
346
+ }), () => {
347
+ e = !0;
348
+ };
349
+ }, [
350
+ r,
351
+ y,
352
+ N
353
+ ]), w) return W(p, {
354
+ className: d(a, "script-select"),
355
+ ...x,
348
356
  sx: [{
349
357
  display: "flex",
350
358
  justifyContent: "center",
@@ -352,61 +360,69 @@ var pe = n(r((e, t) => {
352
360
  height: "100%",
353
361
  background: (e) => e.palette.background.paper,
354
362
  zIndex: 1e3,
355
- ...Array.isArray(a) ? {} : a
356
- }, ...Array.isArray(a) ? a : []],
357
- children: j(u, {})
363
+ ...Array.isArray(l) ? {} : l
364
+ }, ...Array.isArray(l) ? l : []],
365
+ children: W(m, {})
358
366
  });
359
- let T = null;
360
- F && (T = H(p, {
361
- className: d(l, "script-select", "error-results"),
362
- ...g,
363
- sx: [{
367
+ let $ = null;
368
+ F && ($ = H(p, {
369
+ className: "error-results",
370
+ sx: {
364
371
  display: "flex",
365
- justifyContent: "center",
366
- alignItems: "center",
367
- background: (e) => e.palette.error.light,
368
- flex: "0",
369
- zIndex: 1e3,
370
372
  flexDirection: "column",
371
- padding: (e) => e.spacing(1),
372
- border: (e) => `1px solid ${e.palette.error.main}`,
373
- borderBottomLeftRadius: 1,
374
- borderBottomRightRadius: 1
375
- }, ...Array.isArray(a) ? a : [a]],
376
- children: [j(f, {
377
- color: "error",
378
- variant: "h6",
379
- component: "div",
380
- gutterBottom: !0,
381
- children: y("templateSelect.errorTitle")
382
- }), j(f, {
383
- color: "error",
384
- component: "div",
385
- children: F
386
- })]
373
+ alignItems: "center",
374
+ flex: "none",
375
+ gap: .5,
376
+ padding: 1.5,
377
+ background: (e) => j(e.palette.error.main, "dark" === e.palette.mode ? .16 : .06),
378
+ borderTop: (e) => `1px solid ${j(e.palette.error.main, .4)}`
379
+ },
380
+ children: [
381
+ W(h, {
382
+ color: "error",
383
+ variant: "subtitle1",
384
+ component: "div",
385
+ children: y("templateSelect.errorTitle")
386
+ }),
387
+ W(h, {
388
+ variant: "body2",
389
+ component: "div",
390
+ sx: {
391
+ color: "text.secondary",
392
+ textAlign: "center"
393
+ },
394
+ children: F
395
+ }),
396
+ W(u, {
397
+ size: "small",
398
+ color: "error",
399
+ onClick: () => D((e) => e + 1),
400
+ children: y("templateSelect.retry")
401
+ })
402
+ ]
387
403
  }));
388
- const D = (e) => {
389
- const t = e.metadata?.icon;
390
- return "macro" === t ? j(v, {
404
+ const I = (e) => {
405
+ const t = e.icon;
406
+ return "macro" === t ? W(v, {
391
407
  iconKey: "ScriptMacro",
392
408
  size: "1em"
393
- }) : "formula" === t ? j(v, {
409
+ }) : "formula" === t ? W(v, {
394
410
  iconKey: "ScriptFormula",
395
411
  size: "1em"
396
- }) : "autostart" === t ? j(v, {
412
+ }) : "autostart" === t ? W(v, {
397
413
  iconKey: "ScriptAutoRun",
398
414
  size: "1em"
399
415
  }) : null;
400
416
  };
401
417
  return H(p, {
402
418
  ref: t,
403
- className: d(l, "script-select"),
419
+ className: d(a, "script-select"),
404
420
  sx: {
405
421
  background: (e) => e.palette.background.paper,
406
422
  zIndex: 1e3,
407
- ...a
423
+ ...l
408
424
  },
409
- ...g,
425
+ ...x,
410
426
  children: [H(p, {
411
427
  className: "script-select-content",
412
428
  sx: {
@@ -415,40 +431,40 @@ var pe = n(r((e, t) => {
415
431
  flex: "1 1 auto"
416
432
  },
417
433
  children: [
418
- j(f, {
434
+ W(h, {
419
435
  variant: "h6",
420
436
  gutterBottom: !0,
421
437
  children: y("templateSelect.title")
422
438
  }),
423
- j(f, {
439
+ W(h, {
424
440
  variant: "body2",
425
441
  component: "div",
426
442
  gutterBottom: !0,
427
443
  sx: { color: "text.secondary" },
428
444
  children: y("templateSelect.intro")
429
445
  }),
430
- j(f, {
446
+ W(h, {
431
447
  variant: "body2",
432
448
  component: "div",
433
449
  gutterBottom: !0,
434
450
  sx: { color: "text.secondary" },
435
451
  children: y("templateSelect.intro2")
436
452
  }),
437
- j(p, {
453
+ W(p, {
438
454
  sx: {
439
455
  display: "grid",
440
456
  gridTemplateColumns: `repeat(auto-fill, minmax(${s}px, 1fr))`,
441
- gap: `${x}px`,
457
+ gap: `${g}px`,
442
458
  padding: 2,
443
459
  paddingLeft: "0px",
444
460
  paddingRight: "0px"
445
461
  },
446
- children: S.map((e, t) => H(m, {
462
+ children: S.map((e, t) => H(u, {
447
463
  variant: "outlined",
448
464
  disabled: i,
449
465
  sx: {
450
466
  minWidth: s,
451
- minHeight: h,
467
+ minHeight: f,
452
468
  display: "flex",
453
469
  flexDirection: "column",
454
470
  justifyContent: "flex-start",
@@ -473,12 +489,12 @@ var pe = n(r((e, t) => {
473
489
  width: "100%",
474
490
  marginBottom: .5
475
491
  },
476
- children: [j(f, {
492
+ children: [W(h, {
477
493
  variant: "subtitle2",
478
494
  component: "div",
479
- children: e.metadata?.title || e.path?.split("/").pop()?.replace(/\.\w+$/, "") || y("templateSelect.untitled")
480
- }), D(e)]
481
- }), e.metadata?.summary && j(f, {
495
+ children: e.title || y("templateSelect.untitled")
496
+ }), I(e)]
497
+ }), e.summary && W(h, {
482
498
  variant: "body2",
483
499
  component: "div",
484
500
  sx: {
@@ -489,49 +505,49 @@ var pe = n(r((e, t) => {
489
505
  textOverflow: "ellipsis",
490
506
  alignItems: "flex-start"
491
507
  },
492
- children: e.metadata.summary
508
+ children: e.summary
493
509
  })]
494
510
  }, `${e.path}-${t}`))
495
511
  })
496
512
  ]
497
- }), T]
513
+ }), $]
498
514
  });
499
515
  }));
500
- pe.displayName = "TemplateSelectPanel";
501
- var me = n(r((e, t) => {
502
- const { className: r, sx: n, propsScriptEditor: l, readOnly: m = !1, frame: u, autoFocusSel: g, autoFocus: y = !0, scripts: S, ...b } = e, v = x(), [w, k] = c(!1), F = s(!1), [N, K] = c({
516
+ ge.displayName = "TemplateSelectPanel";
517
+ var xe = n(r((e, t) => {
518
+ const { className: r, sx: n, propsScriptEditor: a, readOnly: u = !1, frame: m, autoFocusSel: x, autoFocus: y = !0, scripts: S, ...b } = e, v = g(), [w, k] = c(!1), F = s(!1), [K, T] = c({
503
519
  message: "Loading",
504
520
  cursor: "",
505
521
  dirty: !1
506
- }), [I, L] = c(null);
522
+ }), [$, I] = c(null);
507
523
  o(() => {
508
524
  let e = !1;
509
- return L(null), async function() {
525
+ return I(null), async function() {
510
526
  if (S && (await S.start(), !e)) {
511
527
  const e = S.getModules().getItems()[0]?.getSource();
512
- L({ source: e || null });
528
+ I({ source: e || null });
513
529
  }
514
530
  }(), () => {
515
531
  e = !0;
516
532
  };
517
533
  }, [S]);
518
534
  const P = i((e) => {
519
- K((t) => ({
535
+ T((t) => ({
520
536
  ...t,
521
537
  ...e
522
538
  }));
523
- }, []), $ = s(null), [E, R] = c(null), z = s(null), A = C((e) => {
524
- if (E) return E.focus(e), !0;
525
- if (g) {
526
- const t = $.current?.querySelectorAll?.(g);
539
+ }, []), E = s(null), [R, L] = c(null), M = s(null), z = C((e) => {
540
+ if (R) return R.focus(e), !0;
541
+ if (x) {
542
+ const t = E.current?.querySelectorAll?.(x);
527
543
  if (t && t.length > 0) return t[0]?.focus?.(e), !0;
528
544
  }
529
- return $.current?.focus?.(e), !1;
545
+ return E.current?.focus?.(e), !1;
530
546
  }, [
531
- E,
532
- g,
547
+ R,
548
+ x,
533
549
  y
534
- ]), B = a(() => j(D, {
550
+ ]), O = l(() => W(D, {
535
551
  transitionDelay: "160ms",
536
552
  style: {
537
553
  position: "absolute",
@@ -539,7 +555,7 @@ var me = n(r((e, t) => {
539
555
  height: "100%"
540
556
  },
541
557
  transparentBackground: !1
542
- }), []), O = a(() => j(h, {
558
+ }), []), B = l(() => W(f, {
543
559
  elevation: 1,
544
560
  tabIndex: 0,
545
561
  sx: {
@@ -552,8 +568,8 @@ var me = n(r((e, t) => {
552
568
  marginTop: (e) => e.spacing(1),
553
569
  marginBottom: (e) => e.spacing(1)
554
570
  },
555
- children: j(de, {})
556
- }), [v]), M = a(() => j(p, {
571
+ children: W(he, {})
572
+ }), [v]), A = l(() => W(p, {
557
573
  className: d("script-status-panel", "status-panel"),
558
574
  sx: {
559
575
  display: "flex",
@@ -577,7 +593,7 @@ var me = n(r((e, t) => {
577
593
  justifyContent: "center"
578
594
  },
579
595
  children: [
580
- j(f, {
596
+ W(h, {
581
597
  component: "div",
582
598
  sx: {
583
599
  userSelect: "none",
@@ -588,9 +604,9 @@ var me = n(r((e, t) => {
588
604
  color: (e) => e.palette.text.secondary
589
605
  },
590
606
  variant: "caption",
591
- children: N.message
607
+ children: K.message
592
608
  }),
593
- j(f, {
609
+ W(h, {
594
610
  component: "div",
595
611
  sx: {
596
612
  userSelect: "none",
@@ -601,9 +617,9 @@ var me = n(r((e, t) => {
601
617
  color: (e) => e.palette.text.secondary
602
618
  },
603
619
  variant: "caption",
604
- children: N.dirty ? "Unsaved" : ""
620
+ children: K.dirty ? "Unsaved" : ""
605
621
  }),
606
- j(f, {
622
+ W(h, {
607
623
  component: "div",
608
624
  sx: {
609
625
  userSelect: "none",
@@ -618,11 +634,11 @@ var me = n(r((e, t) => {
618
634
  color: (e) => e.palette.text.secondary
619
635
  },
620
636
  variant: "caption",
621
- children: N.cursor
637
+ children: K.cursor
622
638
  })
623
639
  ]
624
640
  })
625
- }), [N]), W = a(() => H(p, {
641
+ }), [K]), U = l(() => H(p, {
626
642
  className: d("script-editor-content"),
627
643
  sx: {
628
644
  display: "flex",
@@ -632,8 +648,8 @@ var me = n(r((e, t) => {
632
648
  boxSizing: "border-box"
633
649
  },
634
650
  children: [
635
- O,
636
- j(p, {
651
+ B,
652
+ W(p, {
637
653
  sx: {
638
654
  display: "flex",
639
655
  flex: "1 1 100%",
@@ -642,35 +658,35 @@ var me = n(r((e, t) => {
642
658
  position: "relative",
643
659
  boxSizing: "border-box"
644
660
  },
645
- children: j(G, {
646
- ref: $,
647
- loadingPanel: B,
648
- readOnly: m,
649
- frame: u,
661
+ children: W(_, {
662
+ ref: E,
663
+ loadingPanel: O,
664
+ readOnly: u,
665
+ frame: m,
650
666
  scripts: S,
651
667
  autoFocus: y,
652
668
  onStatusChange: P,
653
669
  darkMode: "dark" === v.palette.mode,
654
- ...l
670
+ ...a
655
671
  })
656
672
  }),
657
- M
673
+ A
658
674
  ]
659
675
  }), [
660
676
  v,
661
- O,
662
- M,
663
- w,
664
677
  B,
665
- m,
666
- l,
667
- y,
668
- g,
678
+ A,
679
+ w,
680
+ O,
669
681
  u,
682
+ a,
683
+ y,
684
+ x,
685
+ m,
670
686
  P
671
- ]), U = a(() => {
687
+ ]), j = l(() => {
672
688
  let e;
673
- return null === I ? B : (null === I.source && (e = j(pe, {
689
+ return null === $ ? O : (null === $.source && (e = W(ge, {
674
690
  sx: {
675
691
  display: "flex",
676
692
  flex: "1 1 100%",
@@ -681,11 +697,11 @@ var me = n(r((e, t) => {
681
697
  width: "100%",
682
698
  height: "100%"
683
699
  },
684
- disabled: m,
700
+ disabled: u,
685
701
  onScriptSelect: (e) => {
686
- $.current?.insertSnippet(e.content), L({ source: e.content ?? "" }), requestAnimationFrame(() => $.current?.focus());
702
+ E.current?.insertSnippet(e.content), I({ source: e.content ?? "" }), requestAnimationFrame(() => E.current?.focus());
687
703
  }
688
- })), j(p, {
704
+ })), W(p, {
689
705
  tabIndex: 0,
690
706
  className: d("script-workspace", r),
691
707
  sx: {
@@ -699,7 +715,7 @@ var me = n(r((e, t) => {
699
715
  outline: "none"
700
716
  },
701
717
  onPointerDown: (e) => {
702
- e.isDefaultPrevented() || $.current?.focus();
718
+ e.isDefaultPrevented() || E.current?.focus();
703
719
  },
704
720
  children: H(p, {
705
721
  sx: {
@@ -707,7 +723,7 @@ var me = n(r((e, t) => {
707
723
  position: "relative",
708
724
  display: "flex"
709
725
  },
710
- children: [j(p, {
726
+ children: [W(p, {
711
727
  sx: {
712
728
  display: "flex",
713
729
  flex: "1 1 100%",
@@ -715,24 +731,24 @@ var me = n(r((e, t) => {
715
731
  minHeight: 0,
716
732
  visibility: e ? "hidden" : "visible"
717
733
  },
718
- children: W
734
+ children: U
719
735
  }), e]
720
736
  })
721
737
  }));
722
738
  }, [
723
- O,
724
- W,
725
- r,
726
- I,
727
739
  B,
728
- m
729
- ]), q = T(t, () => ({
740
+ U,
741
+ r,
742
+ $,
743
+ O,
744
+ u
745
+ ]), q = N(t, () => ({
730
746
  isScriptWorkspaceElement: () => !0,
731
747
  focus: (e) => {
732
- A(e);
748
+ z(e);
733
749
  }
734
750
  }), []);
735
- return j(p, {
751
+ return W(p, {
736
752
  sx: {
737
753
  display: "flex",
738
754
  flexDirection: "row",
@@ -743,60 +759,60 @@ var me = n(r((e, t) => {
743
759
  ref: q,
744
760
  ...b,
745
761
  onFocus: (e) => {
746
- k(!0), F.current = !0, q.current?.contains(e.target) && e.target !== q.current && R(e.target), e.relatedTarget && !z.current && (z.current = e.relatedTarget), b?.onFocus?.(e);
762
+ k(!0), F.current = !0, q.current?.contains(e.target) && e.target !== q.current && L(e.target), e.relatedTarget && !M.current && (M.current = e.relatedTarget), b?.onFocus?.(e);
747
763
  },
748
764
  onBlur: (e) => {
749
- q?.current?.contains(e.relatedTarget) || q?.current === e.relatedTarget || (z.current = null, F.current = !1, k(!1)), b?.onBlur?.(e);
765
+ q?.current?.contains(e.relatedTarget) || q?.current === e.relatedTarget || (M.current = null, F.current = !1, k(!1)), b?.onBlur?.(e);
750
766
  },
751
- children: U
767
+ children: j
752
768
  });
753
769
  }));
754
- me.displayName = "ScriptWorkspace";
755
- var { FocusActivation: ue, CommandScopeProvider: he, CommandAnchorProvider: fe, useCommandScope: xe } = g, ge = { scopeName: "scriptEditor" }, ye = ({ children: e }) => {
756
- const t = xe(), r = s(null);
757
- return t ? j(he, {
758
- spec: ge,
770
+ xe.displayName = "ScriptWorkspace";
771
+ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be, useCommandScope: ve } = x, we = { scopeName: "scriptEditor" }, ke = ({ children: e }) => {
772
+ const t = ve(), r = s(null);
773
+ return t ? W(Se, {
774
+ spec: we,
759
775
  elementRef: r,
760
776
  region: !0,
761
- children: j(Se, {
777
+ children: W(Ce, {
762
778
  paneRef: r,
763
779
  children: e
764
780
  })
765
781
  }) : e;
766
- }, Se = ({ paneRef: e, children: t }) => {
767
- const r = xe(), n = a(() => r ? new ue(r.getRoot(), r) : null, [r]);
768
- return n ? H(fe, {
782
+ }, Ce = ({ paneRef: e, children: t }) => {
783
+ const r = ve(), n = l(() => r ? new ye(r.getRoot(), r) : null, [r]);
784
+ return n ? H(be, {
769
785
  tracker: n,
770
786
  keyBindings: !1,
771
787
  debounce: 100,
772
788
  elementRef: e,
773
- children: [j(B, {}), j("div", {
789
+ children: [W(O, {}), W("div", {
774
790
  className: "script-editor-pane",
775
791
  style: { display: "contents" },
776
792
  ref: e,
777
793
  children: t
778
794
  })]
779
795
  }) : t;
780
- }, be = (e) => {
781
- const { model: t, entryKey: r, frame: n, ref: i, ...o } = e, a = M() ?? t;
782
- O(a, ["onProtectionChange"]);
783
- const l = a?.getScripts().isReadOnly() ?? !1;
784
- return j(ye, { children: j(me, {
796
+ }, Fe = (e) => {
797
+ const { model: t, entryKey: r, frame: n, ref: i, ...o } = e, l = A() ?? t;
798
+ B(l, ["onProtectionChange"]);
799
+ const a = l?.getScripts().isReadOnly() ?? !1;
800
+ return W(ke, { children: W(xe, {
785
801
  ref: i,
786
- readOnly: l,
802
+ readOnly: a,
787
803
  frame: n,
788
- scripts: a?.getScripts(),
804
+ scripts: l?.getScripts(),
789
805
  ...o
790
806
  }) });
791
- }, ve = n((e) => {
792
- const { alwaysShow: t = !1, ...r } = e, [n, i] = l((e) => e + 1, 0), [a] = N(["showScriptEditor"], { onChange: () => i() }), s = M(), [d, p] = c(t);
807
+ }, Ke = n((e) => {
808
+ const { alwaysShow: t = !1, ...r } = e, [n, i] = a((e) => e + 1, 0), [l] = K(["showScriptEditor"], { onChange: () => i() }), s = A(), [d, p] = c(t);
793
809
  return o(() => {
794
810
  if (t) return void p(!0);
795
811
  const e = s?.getScripts();
796
- if (!e || !a) return void p(!1);
812
+ if (!e || !l) return void p(!1);
797
813
  const r = async () => {
798
814
  let t = !1;
799
- a.getState() || (t = ((await e.searchFunctions({ type: "macro" }))?.length ?? 0) > 0), p(t || !!a.getState());
815
+ l.getState() || (t = ((await e.searchFunctions({ type: "macro" }))?.length ?? 0) > 0), p(t || !!l.getState());
800
816
  };
801
817
  r();
802
818
  const n = e.addListeners({ onChange: () => {
@@ -808,13 +824,13 @@ var { FocusActivation: ue, CommandScopeProvider: he, CommandAnchorProvider: fe,
808
824
  }, [
809
825
  t,
810
826
  s,
811
- a,
827
+ l,
812
828
  n
813
- ]), d ? H(W, { children: [j($, {}), j(ee, { ...r })] }) : null;
829
+ ]), d ? H(U, { children: [W(E, {}), W(te, { ...r })] }) : null;
814
830
  });
815
- ve.displayName = "RunScriptContribution", X();
816
- var we = n(r((e, r) => {
817
- const { ...n } = e, i = M(), a = K(), [l, s] = c([]);
831
+ Ke.displayName = "RunScriptContribution", Y();
832
+ var Ne = n(r((e, r) => {
833
+ const { ...n } = e, i = A(), l = T(), [a, s] = c([]);
818
834
  o(() => {
819
835
  const e = i?.getScripts();
820
836
  if (!e) return;
@@ -834,19 +850,19 @@ var we = n(r((e, r) => {
834
850
  const d = {
835
851
  variant: y.Menuitem,
836
852
  shortcut: void 0
837
- }, m = [], u = l ? l.length : 0;
838
- for (let e = 0; e < u; e++) {
839
- const t = l[e];
840
- m.push(j(I, {
853
+ }, u = [], m = a ? a.length : 0;
854
+ for (let e = 0; e < m; e++) {
855
+ const t = a[e];
856
+ u.push(W($, {
841
857
  ...d,
842
858
  commandKey: "insertFunction",
843
859
  commandState: t,
844
- propsTooltip: { description: a("insertFunction.insertNamed", { name: t.getName() ?? a("insertFunction.fallbackLabel") }) },
845
- icon: j(v, { iconKey: "FormulaCustom" }),
846
- label: t.getName() ?? a("insertFunction.fallbackLabel")
860
+ propsTooltip: { description: l("insertFunction.insertNamed", { name: t.getName() ?? l("insertFunction.fallbackLabel") }) },
861
+ icon: W(v, { iconKey: "FormulaCustom" }),
862
+ label: t.getName() ?? l("insertFunction.fallbackLabel")
847
863
  }, `function-${t.getName()}-${e}`));
848
864
  }
849
- const h = H(p, {
865
+ const f = H(p, {
850
866
  ref: r,
851
867
  sx: {
852
868
  display: "flex",
@@ -854,62 +870,62 @@ var we = n(r((e, r) => {
854
870
  flex: "1 1 100%",
855
871
  overflow: "hidden"
856
872
  },
857
- children: [m.length > 0 ? H(W, { children: [j(p, {
873
+ children: [u.length > 0 ? H(U, { children: [W(p, {
858
874
  sx: {
859
875
  overflow: "auto",
860
876
  flex: "1 1 100%"
861
877
  },
862
- children: m
863
- }), j($, { orientation: "horizontal" })] }) : null, t(I, {
878
+ children: u
879
+ }), W(E, { orientation: "horizontal" })] }) : null, t($, {
864
880
  ...d,
865
881
  key: "show-editor",
866
882
  commandKey: "showScriptEditor"
867
883
  })]
868
884
  });
869
- return z({
885
+ return M({
870
886
  ...n,
871
- children: h
887
+ children: f
872
888
  });
873
889
  }));
874
- we.displayName = "InsertFunctionPopupPanel";
875
- var ke = n(r((e, t) => {
876
- const { disabled: r, groupKey: n, ...o } = e, a = F("customFunctionOptions"), l = i((e) => {
877
- const t = j(we, {
890
+ Ne.displayName = "InsertFunctionPopupPanel";
891
+ var Te = n(r((e, t) => {
892
+ const { disabled: r, groupKey: n, ...o } = e, l = F("customFunctionOptions"), a = i((e) => {
893
+ const t = W(Ne, {
878
894
  disabled: r,
879
895
  groupKey: n,
880
896
  ...e
881
897
  });
882
- return z({
898
+ return M({
883
899
  ...e,
884
900
  children: t
885
901
  });
886
902
  }, [r, n]);
887
- return j(L, {
903
+ return W(I, {
888
904
  ref: t,
889
905
  disabled: r,
890
- createPopupPanel: l,
891
- label: a?.getLabel?.(),
892
- tooltip: a?.getDescription?.(),
906
+ renderPopupPanel: a,
907
+ label: l?.getLabel?.(),
908
+ tooltip: l?.getDescription?.(),
893
909
  icon: "FormulaCustom",
894
910
  ...o
895
911
  });
896
912
  }));
897
- ke.displayName = "InsertFunctionContribution";
898
- var Ce = () => {
899
- J(), b.register("plugin-scripts", { icons: {} }), A.registerTaskPane({
913
+ Te.displayName = "InsertFunctionContribution";
914
+ var De = () => {
915
+ J(), b.register("plugin-scripts", { icons: {} }), z.registerTaskPane({
900
916
  key: "scriptEditor",
901
917
  getTitle: () => "Script (Typescript)",
902
918
  getIcon: () => "ScriptRun",
903
- component: be,
919
+ component: Fe,
904
920
  keepMounted: !0
905
921
  }, !0), S.register({ key: "scriptsOptions" }, !0), S.register({ key: "customFunctionOptions" }, !0), S.register({
906
922
  key: "scripting.runScript.home",
907
923
  contributions: { homeToolbar: {} },
908
- render: (t) => e.createElement(ve, { ...t })
924
+ render: (t) => e.createElement(Ke, { ...t })
909
925
  }, !0), S.register({
910
926
  key: "scripting.runScript.view",
911
927
  contributions: { viewToolbar: { order: 10 } },
912
- render: (t) => e.createElement(ve, {
928
+ render: (t) => e.createElement(Ke, {
913
929
  ...t,
914
930
  groupKey: "view",
915
931
  alwaysShow: !0
@@ -920,7 +936,7 @@ var Ce = () => {
920
936
  anchor: "formulaCategory.web",
921
937
  order: 1
922
938
  } },
923
- render: (t) => e.createElement(ke, { ...t })
939
+ render: (t) => e.createElement(Te, { ...t })
924
940
  }, !0);
925
941
  };
926
- export { ce as InsertScriptCommandButton, ee as RunScriptCommandButton, de as ScriptEditorToolbar, be as ScriptTaskPane, me as ScriptWorkspace, Ce as ScriptingPlugin };
942
+ export { fe as InsertScriptCommandButton, te as RunScriptCommandButton, he as ScriptEditorToolbar, Fe as ScriptTaskPane, xe as ScriptWorkspace, De as ScriptingPlugin };