@cratis/stage.runtime 4.190.2 → 4.190.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -1,23 +1,24 @@
1
1
  import "./app.css";
2
2
  import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
3
- import { ColorScheme as l, DestinationKind as u, FormGenerationMode as d, FormWidthUnit as f, InteractionTriggerKind as p } from "@cratis/scene.model";
4
- import { ShellDiagnosticCode as m, ShellOrigin as h, createBindingResolver as g, resolveArgumentSource as _, resolveBehaviors as v, resolveStringsInElement as y, runBindings as b, validateBindingExpression as x } from "@cratis/scene.engine";
5
- import { CoreSliceDialog as S, CoreToolbarItem as C, InteractionScope as w, SceneElementView as T, SceneNavigationContextInternal as ee, SliceCommandFieldsProvider as te, SliceDialogView as ne, SliceInvokerProvider as E, attachmentFor as re, coreComponents as D, createBrowserDispatcher as ie, createHashSceneHistory as O, sliceDialogParameters as k, useInteractionScope as ae, useOptionalSceneNavigation as oe, useSceneNavigation as se, useSceneOutlets as ce, useSceneTheme as A } from "@cratis/scene.react";
6
- import { ApplicationHost as le, ColorScheme as ue, ComponentName as j, LayoutThemeProvider as de, SlotName as M, blueprintPackageCatalog as fe, composeApplicationScreen as pe, defaultBlueprintComponents as me, defaultBlueprintName as he, defaultBlueprintThemes as ge, effectiveShellOf as _e, externalComponent as N, galleryScreenTemplates as ve, layoutModes as ye, menuThemes as be, navigationElement as xe, previewComponents as Se, previewProfile as Ce, useLayoutConfig as we } from "@cratis/scene.blueprint.default";
3
+ import { ColorScheme as l, DestinationKind as u, FormGenerationMode as d, FormWidthUnit as f, InteractionTriggerKind as p, componentIconLibrary as m } from "@cratis/scene.model";
4
+ import { ShellDiagnosticCode as h, ShellOrigin as g, createBindingResolver as _, resolveArgumentSource as v, resolveBehaviors as y, resolveStringsInElement as b, runBindings as x, validateBindingExpression as ee } from "@cratis/scene.engine";
5
+ import { CoreSliceDialog as S, CoreToolbarItem as C, IconAdapterProvider as w, InteractionScope as te, SceneElementView as T, SceneNavigationContextInternal as ne, SliceCommandFieldsProvider as E, SliceDialogView as re, SliceInvokerProvider as D, attachmentFor as ie, coreComponents as O, createBrowserDispatcher as k, createHashSceneHistory as ae, createIconAdapterRegistry as oe, sliceDialogParameters as se, useInteractionScope as ce, useOptionalSceneNavigation as A, useSceneNavigation as le, useSceneOutlets as ue, useSceneTheme as j } from "@cratis/scene.react";
6
+ import { ApplicationHost as de, ColorScheme as fe, ComponentName as M, LayoutThemeProvider as pe, SlotName as N, blueprintPackageCatalog as me, composeApplicationScreen as he, defaultBlueprintComponents as ge, defaultBlueprintName as _e, defaultBlueprintThemes as ve, effectiveShellOf as ye, externalComponent as P, galleryScreenTemplates as be, layoutModes as xe, menuThemes as Se, navigationElement as Ce, previewComponents as we, previewProfile as Te, useLayoutConfig as Ee } from "@cratis/scene.blueprint.default";
7
7
  import "@cratis/scene.blueprint.default/styles.css";
8
- import { ArcContext as Te } from "@cratis/arc.react";
9
- import { ObservableQueryFor as Ee, Paging as De, QueryFor as Oe } from "@cratis/arc/queries";
10
- import { resolveCommand as ke, resolveExactQuery as Ae } from "@cratis/scene.components";
11
- import { Fragment as je, jsx as P, jsxs as F } from "react/jsx-runtime";
12
- import { Button as I } from "primereact/button";
13
- import { PrimeDialog as Me, PrimeMessage as Ne, primeReactComponents as Pe, primeReactPackageManifest as Fe } from "@cratis/scene.primereact";
14
- import { DateOnly as Ie, Guid as Le } from "@cratis/fundamentals";
15
- import { Command as Re } from "@cratis/arc/commands";
16
- import { CommandForm as ze, asCommandFormField as Be, withCommandFormFieldBinding as Ve } from "@cratis/arc.react/commands";
17
- import { CalendarField as He, CheckboxField as Ue, DropdownField as We, InputTextField as Ge, NumberField as Ke } from "@cratis/components/CommandForm";
18
- import qe from "@primeuix/themes/lara";
8
+ import { ArcContext as De } from "@cratis/arc.react";
9
+ import { ObservableQueryFor as Oe, Paging as ke, QueryFor as Ae } from "@cratis/arc/queries";
10
+ import { resolveCommand as je, resolveExactQuery as Me } from "@cratis/scene.components";
11
+ import { Fragment as Ne, jsx as F, jsxs as I } from "react/jsx-runtime";
12
+ import { Button as L } from "primereact/button";
13
+ import { PrimeDialog as Pe, PrimeMessage as Fe, primeReactComponents as Ie, primeReactPackageManifest as Le } from "@cratis/scene.primereact";
14
+ import { DateOnly as Re, Guid as ze } from "@cratis/fundamentals";
15
+ import { Command as Be } from "@cratis/arc/commands";
16
+ import { CommandForm as Ve, asCommandFormField as He, withCommandFormFieldBinding as Ue } from "@cratis/arc.react/commands";
17
+ import { CalendarField as We, CheckboxField as Ge, DropdownField as Ke, InputTextField as qe, NumberField as Je } from "@cratis/components/CommandForm";
18
+ import { dynamicIconImports as Ye } from "lucide-react/dynamic";
19
+ import Xe from "@primeuix/themes/lara";
19
20
  //#region src/stageSource.ts
20
- function Je(e) {
21
+ function Ze(e) {
21
22
  return {
22
23
  scene: async () => e.scene,
23
24
  routes: async () => e.routes,
@@ -25,23 +26,23 @@ function Je(e) {
25
26
  strings: async (t) => e.strings[t] ?? {}
26
27
  };
27
28
  }
28
- var Ye = {
29
+ var Qe = {
29
30
  scene: "stage/scene",
30
31
  routes: "stage/routes",
31
32
  locales: "stage/locales",
32
33
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
33
- }, Xe = e(void 0);
34
- function Ze({ source: e, children: n }) {
35
- return t(Xe.Provider, { value: e }, n);
34
+ }, $e = e(void 0);
35
+ function et({ source: e, children: n }) {
36
+ return t($e.Provider, { value: e }, n);
36
37
  }
37
- function Qe() {
38
- let e = r(Xe);
38
+ function tt() {
39
+ let e = r($e);
39
40
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
40
41
  return e;
41
42
  }
42
- Ye.routes;
43
- function $e() {
44
- let e = Qe(), [t, n] = c({
43
+ Qe.routes;
44
+ function nt() {
45
+ let e = tt(), [t, n] = c({
45
46
  routes: void 0,
46
47
  ready: !1
47
48
  });
@@ -62,25 +63,25 @@ function $e() {
62
63
  }
63
64
  //#endregion
64
65
  //#region src/applyQueryChangeSet.ts
65
- function L(e) {
66
+ function R(e) {
66
67
  return typeof e == "object" && e && "id" in e ? e.id : void 0;
67
68
  }
68
- function et(e) {
69
+ function rt(e) {
69
70
  if (typeof e != "object" || !e) return e;
70
71
  let t = e.toString();
71
72
  return t === "[object Object]" ? JSON.stringify(e) : t;
72
73
  }
73
- function tt(e, t) {
74
- return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : et(e) === et(t);
74
+ function it(e, t) {
75
+ return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : rt(e) === rt(t);
75
76
  }
76
- function nt(e, t) {
77
- if (t.removed.length > 0 ? L(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => tt(L(e), L(t)))).map((e) => t.replaced.find((t) => tt(L(t), L(e))) ?? e), ...t.added];
77
+ function at(e, t) {
78
+ if (t.removed.length > 0 ? R(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => it(R(e), R(t)))).map((e) => t.replaced.find((t) => it(R(t), R(e))) ?? e), ...t.added];
78
79
  let n = new Set(t.removed.map((e) => JSON.stringify(e)));
79
80
  return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
80
81
  }
81
82
  //#endregion
82
83
  //#region src/hostedBasePath.ts
83
- function rt() {
84
+ function ot() {
84
85
  let e = globalThis.document?.baseURI ?? globalThis.location?.href;
85
86
  if (!e) return "";
86
87
  try {
@@ -89,62 +90,62 @@ function rt() {
89
90
  return "";
90
91
  }
91
92
  }
92
- function it(e) {
93
- return e || rt();
93
+ function st(e) {
94
+ return e || ot();
94
95
  }
95
96
  //#endregion
96
97
  //#region src/queryExecutor.ts
97
- var at;
98
- function ot(e) {
99
- at = e;
98
+ var ct;
99
+ function lt(e) {
100
+ ct = e;
100
101
  }
101
- function st(e, t) {
102
- let n = Ae(e);
103
- return n === "ambiguous" && t && (n = Ae(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), ct(n) ? n : t ? at?.(t) : void 0;
102
+ function ut(e, t) {
103
+ let n = Me(e);
104
+ return n === "ambiguous" && t && (n = Me(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), dt(n) ? n : t ? ct?.(t) : void 0;
104
105
  }
105
- function ct(e) {
106
- return typeof e == "function" && (e.prototype instanceof Oe || e.prototype instanceof Ee);
106
+ function dt(e) {
107
+ return typeof e == "function" && (e.prototype instanceof Ae || e.prototype instanceof Oe);
107
108
  }
108
- function lt(e, t) {
109
- e.setMicroservice(t.microservice), e.setApiBasePath(it(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = De.noPaging;
109
+ function ft(e, t) {
110
+ e.setMicroservice(t.microservice), e.setApiBasePath(st(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = ke.noPaging;
110
111
  }
111
- function ut(e, t, n) {
112
+ function pt(e, t, n) {
112
113
  let r = new e();
113
- return lt(r, n), r.perform(t);
114
+ return ft(r, n), r.perform(t);
114
115
  }
115
- function dt(e, t, n, r) {
116
+ function mt(e, t, n, r) {
116
117
  let i = new e();
117
- if (i instanceof Ee) return lt(i, n), i.subscribe(r, t);
118
+ if (i instanceof Oe) return ft(i, n), i.subscribe(r, t);
118
119
  }
119
- function ft(e) {
120
- if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
120
+ function ht(e) {
121
+ if (z(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
121
122
  }
122
- var pt = "STAGE-SCENE-ACTION-001", mt = "item.";
123
- function R(e) {
123
+ var gt = "STAGE-SCENE-ACTION-001", _t = "item.";
124
+ function z(e) {
124
125
  return typeof e == "object" && !!e && !Array.isArray(e);
125
126
  }
126
- function ht(e, t) {
127
+ function vt(e, t) {
127
128
  let n = e;
128
129
  for (let e of t.split(".").filter(Boolean)) {
129
- if (!R(n)) return;
130
+ if (!z(n)) return;
130
131
  n = n[e];
131
132
  }
132
133
  return n;
133
134
  }
134
- function gt(e) {
135
+ function yt(e) {
135
136
  return e === null || [
136
137
  "string",
137
138
  "number",
138
139
  "boolean"
139
140
  ].includes(typeof e);
140
141
  }
141
- function _t(e, t) {
142
+ function bt(e, t) {
142
143
  if (typeof e == "number") return t[e];
143
144
  if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
144
145
  }
145
- function vt(e, t, n, r) {
146
+ function xt(e, t, n, r) {
146
147
  if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
147
- let i = _t(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
148
+ let i = bt(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
148
149
  return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
149
150
  }
150
151
  switch (t) {
@@ -159,57 +160,57 @@ function vt(e, t, n, r) {
159
160
  default: return;
160
161
  }
161
162
  }
162
- function yt(e, t) {
163
- if (R(e)) {
163
+ function St(e, t) {
164
+ if (z(e)) {
164
165
  if (e.kind === "comparison") {
165
- let n = ft(e.left);
166
- if (typeof n != "string" || !n.startsWith(mt) || typeof e.operator != "string" || !gt(e.right)) return;
166
+ let n = ht(e.left);
167
+ if (typeof n != "string" || !n.startsWith(_t) || typeof e.operator != "string" || !yt(e.right)) return;
167
168
  let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
168
- return vt(ht(t, n.slice(5)), e.operator, e.right, r);
169
+ return xt(vt(t, n.slice(5)), e.operator, e.right, r);
169
170
  }
170
171
  if (e.kind === "logical") {
171
- let n = yt(e.left, t), r = yt(e.right, t);
172
+ let n = St(e.left, t), r = St(e.right, t);
172
173
  return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
173
174
  }
174
175
  }
175
176
  }
176
- function bt(e) {
177
- return e.every((e) => yt(e, {}) !== void 0);
177
+ function Ct(e) {
178
+ return e.every((e) => St(e, {}) !== void 0);
178
179
  }
179
- function xt(e, t) {
180
- if (bt(e)) return e.findIndex((e) => yt(e, t) === !0);
180
+ function wt(e, t) {
181
+ if (Ct(e)) return e.findIndex((e) => St(e, t) === !0);
181
182
  }
182
- function St(e, t) {
183
- if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
184
- let n = xt(e.alternatives, t);
183
+ function Tt(e, t) {
184
+ if (!z(e) || !Array.isArray(e.alternatives) || !z(t)) return;
185
+ let n = wt(e.alternatives, t);
185
186
  if (n !== void 0) {
186
187
  if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
187
188
  if (e.kind === "otherwise") return n === -1;
188
189
  }
189
190
  }
190
- function Ct(e, t) {
191
- if (e.startsWith(mt) && R(t)) return ht(t, e.slice(5));
191
+ function Et(e, t) {
192
+ if (e.startsWith(_t) && z(t)) return vt(t, e.slice(5));
192
193
  }
193
194
  //#endregion
194
195
  //#region src/stageSession.ts
195
- var wt = "stage.session.";
196
- function Tt(e) {
196
+ var Dt = "stage.session.";
197
+ function Ot(e) {
197
198
  try {
198
199
  return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
199
200
  } catch {
200
201
  return;
201
202
  }
202
203
  }
203
- function Et(e) {
204
- let t = Tt(e);
204
+ function kt(e) {
205
+ let t = Ot(e);
205
206
  if (t) return t;
206
207
  let n = globalThis.crypto.randomUUID();
207
208
  try {
208
- globalThis.localStorage?.setItem(`${wt}${e}`, n);
209
+ globalThis.localStorage?.setItem(`${Dt}${e}`, n);
209
210
  } catch {}
210
211
  return n;
211
212
  }
212
- function Dt() {
213
+ function At() {
213
214
  let e = {};
214
215
  try {
215
216
  let t = globalThis.localStorage;
@@ -224,7 +225,7 @@ function Dt() {
224
225
  }
225
226
  //#endregion
226
227
  //#region src/stageData.tsx
227
- var Ot = "cratis.stage.data-changed", kt = e({
228
+ var jt = "cratis.stage.data-changed", Mt = e({
228
229
  locale: "",
229
230
  locales: [],
230
231
  screen: "",
@@ -248,13 +249,13 @@ var Ot = "cratis.stage.data-changed", kt = e({
248
249
  resolveArgument: () => void 0,
249
250
  registerQueryResult: () => void 0,
250
251
  refreshVersion: 0
251
- }), At = [
252
+ }), Nt = [
252
253
  500,
253
254
  1500,
254
255
  3e3
255
- ], jt = {};
256
- function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, locales: l, screen: u, children: d }) {
257
- let [f, p] = c({}), [m, h] = c(0), [v, y] = c({}), [b, S] = c(), [C, w] = c({}), [T, ee] = c({}), [te, ne] = c({}), [E, re] = c({ version: 0 }), D = o(() => Rt(te), [te]), ie = n((e, t) => {
256
+ ], Pt = {};
257
+ function Ft({ routes: e, routesReady: t = !0, parameters: r = Pt, locale: a, locales: l, screen: u, children: d }) {
258
+ let [f, p] = c({}), [m, h] = c(0), [g, y] = c({}), [b, x] = c(), [S, C] = c({}), [w, te] = c({}), [T, ne] = c({}), [E, re] = c({ version: 0 }), D = o(() => Vt(T), [T]), ie = n((e, t) => {
258
259
  p((n) => {
259
260
  if (!t) {
260
261
  let { [e]: t, ...r } = n;
@@ -265,7 +266,7 @@ function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, loc
265
266
  [e]: t
266
267
  };
267
268
  });
268
- }, []), O = r, k = o(() => Dt(), [m]), ae = o(() => ({
269
+ }, []), O = r, k = o(() => At(), [m]), ae = o(() => ({
269
270
  name: u,
270
271
  keys: {
271
272
  ...k,
@@ -279,18 +280,18 @@ function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, loc
279
280
  y((n) => ({
280
281
  ...n,
281
282
  [e]: t
282
- })), S(t ? e : (t) => t === e ? void 0 : t);
283
+ })), x(t ? e : (t) => t === e ? void 0 : t);
283
284
  }, []), se = n((e) => {
284
285
  y((t) => ({
285
286
  ...t,
286
287
  [e]: void 0
287
- })), S((t) => t === e ? void 0 : t);
288
+ })), x((t) => t === e ? void 0 : t);
288
289
  }, []), ce = n((e, t, n) => {
289
- ee((r) => {
290
- let i = H(r[e]) ? r[e] : {};
290
+ te((r) => {
291
+ let i = U(r[e]) ? r[e] : {};
291
292
  return {
292
293
  ...r,
293
- [e]: Lt(i, t.split(".").filter(Boolean), n)
294
+ [e]: Bt(i, t.split(".").filter(Boolean), n)
294
295
  };
295
296
  });
296
297
  }, []), A = n((e) => re((t) => ({
@@ -298,54 +299,54 @@ function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, loc
298
299
  version: t.version + 1
299
300
  })), []), le = s([]), ue = n(() => {
300
301
  h((e) => e + 1), A();
301
- for (let e of At) le.current.push(setTimeout(() => A(), e));
302
+ for (let e of Nt) le.current.push(setTimeout(() => A(), e));
302
303
  }, [A]);
303
304
  i(() => () => le.current.forEach(clearTimeout), []), i(() => {
304
305
  let e = () => A(), t = (e) => A(e.detail?.query);
305
- return globalThis.addEventListener(Ot, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
306
- globalThis.removeEventListener(Ot, e), globalThis.removeEventListener("cratis.scene.refresh", t);
306
+ return globalThis.addEventListener(jt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
307
+ globalThis.removeEventListener(jt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
307
308
  };
308
309
  }, [A]);
309
- let j = b ? v[b] : void 0, de = n((e) => {
310
+ let j = b ? g[b] : void 0, de = n((e) => {
310
311
  if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
311
- if (typeof e == "string") return zt(e, j, v, f, C, O, ae, a, l);
312
- let t = Pt(j, f, C, {
312
+ if (typeof e == "string") return Ht(e, j, g, f, S, O, ae, a, l);
313
+ let t = Lt(j, f, S, {
313
314
  ...D,
314
- ...T
315
- }, v);
316
- if (!e.kind && e.path.startsWith("component.")) return _(e.path, t);
317
- if (!e.kind) return zt(e.path, j, v, f, C, O, ae, a, l);
318
- let n = x(e, t);
319
- return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), g(t)(e);
315
+ ...w
316
+ }, g);
317
+ if (!e.kind && e.path.startsWith("component.")) return v(e.path, t);
318
+ if (!e.kind) return Ht(e.path, j, g, f, S, O, ae, a, l);
319
+ let n = ee(e, t);
320
+ return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), _(t)(e);
320
321
  }, [
321
- T,
322
+ w,
322
323
  a,
323
324
  l,
324
- C,
325
+ S,
325
326
  O,
326
327
  D,
327
328
  f,
328
329
  ae,
329
330
  j,
330
- v
331
- ]), M = n((e) => e ? _(e, Pt(j, f, C, {
331
+ g
332
+ ]), fe = n((e) => e ? v(e, Lt(j, f, S, {
332
333
  ...D,
333
- ...T
334
- }, v)) : void 0, [
335
- T,
336
- C,
334
+ ...w
335
+ }, g)) : void 0, [
336
+ w,
337
+ S,
337
338
  D,
338
339
  f,
339
340
  j,
340
- v
341
- ]), fe = n((e, t) => ne((n) => ({
341
+ g
342
+ ]), M = n((e, t) => ne((n) => ({
342
343
  ...n,
343
344
  [e]: t
344
345
  })), []), pe = n((e) => ne((t) => {
345
346
  if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
346
347
  let n = { ...t };
347
348
  return delete n[e], n;
348
- }), []), me = o(() => Pt(void 0, f, {}, {}, {}).queryResults, [f]), he = o(() => ({
349
+ }), []), N = o(() => Lt(void 0, f, {}, {}, {}).queryResults, [f]), me = o(() => ({
349
350
  locale: a,
350
351
  locales: l,
351
352
  screen: u,
@@ -355,18 +356,18 @@ function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, loc
355
356
  session: k,
356
357
  queries: f,
357
358
  selected: j,
358
- selections: v,
359
+ selections: g,
359
360
  selectRow: oe,
360
361
  clearSelection: se,
361
- setState: (e, t) => w((n) => Lt(n, e.split(".").filter(Boolean), t)),
362
+ setState: (e, t) => C((n) => Bt(n, e.split(".").filter(Boolean), t)),
362
363
  setComponentOutput: ce,
363
- publishComponentOutputs: fe,
364
+ publishComponentOutputs: M,
364
365
  withdrawComponentOutputs: pe,
365
- queryResults: me,
366
+ queryResults: N,
366
367
  refreshQuery: A,
367
368
  refreshAfterCommand: ue,
368
369
  resolveBinding: de,
369
- resolveArgument: M,
370
+ resolveArgument: fe,
370
371
  registerQueryResult: ie,
371
372
  refreshVersion: E.version,
372
373
  refreshQueryName: E.query
@@ -380,10 +381,10 @@ function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, loc
380
381
  E.query,
381
382
  E.version,
382
383
  ie,
383
- fe,
384
- pe,
385
- me,
386
384
  M,
385
+ pe,
386
+ N,
387
+ fe,
387
388
  de,
388
389
  e,
389
390
  t,
@@ -392,41 +393,41 @@ function Mt({ routes: e, routesReady: t = !0, parameters: r = jt, locale: a, loc
392
393
  u,
393
394
  oe,
394
395
  j,
395
- v,
396
+ g,
396
397
  ce
397
398
  ]);
398
- return /* @__PURE__ */ P(kt.Provider, {
399
- value: he,
399
+ return /* @__PURE__ */ F(Mt.Provider, {
400
+ value: me,
400
401
  children: d
401
402
  });
402
403
  }
403
- var z = () => r(kt);
404
- function B(e) {
405
- let { refreshQueryName: t, refreshVersion: a, registerQueryResult: o } = z(), l = r(Te), u = e.publish !== !1, d = n((e, t) => {
404
+ var B = () => r(Mt);
405
+ function V(e) {
406
+ let { refreshQueryName: t, refreshVersion: a, registerQueryResult: o } = B(), l = r(De), u = e.publish !== !1, d = n((e, t) => {
406
407
  u && o(e, t);
407
- }, [u, o]), [f, p] = c([]), [m, h] = c(""), [g, _] = c(!1), [v, y] = c(0), b = s(0), x = s(!1), S = e.ready ?? !0, C = !!e.name && S, w = JSON.stringify(e.arguments ?? {});
408
+ }, [u, o]), [f, p] = c([]), [m, h] = c(""), [g, _] = c(!1), [v, y] = c(0), b = s(0), x = s(!1), ee = e.ready ?? !0, S = !!e.name && ee, C = JSON.stringify(e.arguments ?? {});
408
409
  return i(() => {
409
- if (!C) {
410
+ if (!S) {
410
411
  b.current += 1, p([]), h(""), _(!1), d(e.scope, void 0);
411
412
  return;
412
413
  }
413
414
  let t = b.current + 1;
414
415
  b.current = t;
415
- let n = new AbortController(), r = JSON.parse(w), i = st(e.name ?? "", e.route);
416
+ let n = new AbortController(), r = JSON.parse(C), i = ut(e.name ?? "", e.route);
416
417
  _(!0), h("");
417
418
  let a = (e) => {
418
419
  b.current !== t || n.signal.aborted || (x.current = !1, p([]), h(e instanceof Error ? e.message : String(e)), _(!1));
419
420
  }, o = [], s = (e) => {
420
421
  if (b.current !== t || n.signal.aborted) return;
421
- let r = Ht(e);
422
+ let r = Gt(e);
422
423
  if (r) {
423
424
  a(Error(r));
424
425
  return;
425
426
  }
426
- e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? nt(o, e.changeSet) : e.data, p(Ut(o)), h(""), _(!1));
427
+ e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? at(o, e.changeSet) : e.data, p(Kt(o)), h(""), _(!1));
427
428
  };
428
429
  if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
429
- let c = i.prototype instanceof Ee, u = () => Promise.resolve().then(() => ut(i, c ? {
430
+ let c = i.prototype instanceof Oe, u = () => Promise.resolve().then(() => pt(i, c ? {
430
431
  ...r,
431
432
  waitForFirstResult: !0
432
433
  } : r, l)).then(s).catch(a);
@@ -436,7 +437,7 @@ function B(e) {
436
437
  b.current !== t || n.signal.aborted || (x.current = !1, f?.unsubscribe(), f = void 0, u());
437
438
  }, 15e3);
438
439
  try {
439
- f = dt(i, r, l, (e) => {
440
+ f = mt(i, r, l, (e) => {
440
441
  e.isReady !== !1 && globalThis.clearTimeout(m), s(e);
441
442
  });
442
443
  } catch {
@@ -446,9 +447,9 @@ function B(e) {
446
447
  n.abort(), globalThis.clearTimeout(m), x.current = !1, f?.unsubscribe();
447
448
  };
448
449
  }, [
449
- C,
450
+ S,
450
451
  l,
451
- w,
452
+ C,
452
453
  v,
453
454
  d,
454
455
  e.name,
@@ -462,7 +463,7 @@ function B(e) {
462
463
  e.name,
463
464
  e.scope
464
465
  ]), i(() => {
465
- if (!C) {
466
+ if (!S) {
466
467
  d(e.scope, void 0);
467
468
  return;
468
469
  }
@@ -474,11 +475,11 @@ function B(e) {
474
475
  rows: f,
475
476
  loading: g,
476
477
  error: m,
477
- arguments: JSON.parse(w)
478
+ arguments: JSON.parse(C)
478
479
  });
479
480
  }, [
481
+ S,
480
482
  C,
481
- w,
482
483
  m,
483
484
  g,
484
485
  d,
@@ -497,29 +498,29 @@ function B(e) {
497
498
  }
498
499
  };
499
500
  }
500
- function Nt() {
501
- globalThis.dispatchEvent(new CustomEvent(Ot));
501
+ function It() {
502
+ globalThis.dispatchEvent(new CustomEvent(jt));
502
503
  }
503
- function Pt(e, t, n, r, i) {
504
+ function Lt(e, t, n, r, i) {
504
505
  let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
505
506
  return {
506
507
  dataContext: e,
507
508
  queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
508
- let n = t.list ? t.rows : Ft(t.rows);
509
+ let n = t.list ? t.rows : Rt(t.rows);
509
510
  return [
510
511
  [e, n],
511
512
  ...t.name ? [[t.name, n]] : [],
512
513
  ...t.alias ? [[t.alias, n]] : []
513
514
  ];
514
515
  })),
515
- componentOutputs: It(r, i),
516
+ componentOutputs: zt(r, i),
516
517
  state: n
517
518
  };
518
519
  }
519
- function Ft(e) {
520
+ function Rt(e) {
520
521
  return e.length === 1 ? e[0] : e;
521
522
  }
522
- function It(e, t) {
523
+ function zt(e, t) {
523
524
  let n = { ...e };
524
525
  for (let [e, r] of Object.entries(t)) r && (n[e] = {
525
526
  ...r,
@@ -527,17 +528,17 @@ function It(e, t) {
527
528
  });
528
529
  return n;
529
530
  }
530
- function Lt(e, t, n) {
531
+ function Bt(e, t, n) {
531
532
  let [r, ...i] = t;
532
533
  return r ? i.length === 0 ? {
533
534
  ...e,
534
535
  [r]: n
535
536
  } : {
536
537
  ...e,
537
- [r]: Lt(H(e[r]) ? e[r] : {}, i, n)
538
+ [r]: Bt(U(e[r]) ? e[r] : {}, i, n)
538
539
  } : e;
539
540
  }
540
- function Rt(e) {
541
+ function Vt(e) {
541
542
  let t = {};
542
543
  for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
543
544
  ...t[e],
@@ -545,30 +546,30 @@ function Rt(e) {
545
546
  };
546
547
  return t;
547
548
  }
548
- function zt(e, t, n, r, i, a, o, s, c) {
549
+ function Ht(e, t, n, r, i, a, o, s, c) {
549
550
  if (!e) return;
550
551
  let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
551
552
  if (l.length !== 0) {
552
553
  if (l[0] === "screen") {
553
554
  if (l.length === 1) return { name: o.name };
554
- let e = V(o, l.slice(1));
555
- return e === void 0 && l[1] === "keys" && l.length === 3 ? V(t, [l[2]]) : e;
555
+ let e = H(o, l.slice(1));
556
+ return e === void 0 && l[1] === "keys" && l.length === 3 ? H(t, [l[2]]) : e;
556
557
  }
557
- return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Vt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Bt(l.slice(1).join("."), t, n) : l[0] === "state" ? V(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : V(t, l) ?? Vt(r, void 0, l.join(".")) ?? V(i, l);
558
+ return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Wt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Ut(l.slice(1).join("."), t, n) : l[0] === "state" ? H(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : H(t, l) ?? Wt(r, void 0, l.join(".")) ?? H(i, l);
558
559
  }
559
560
  }
560
- function Bt(e, t, n) {
561
+ function Ut(e, t, n) {
561
562
  let r = e?.split(".").filter(Boolean) ?? [];
562
- return r.length > 0 && Object.hasOwn(n, r[0]) ? V(n[r[0]], r.slice(1)) : r.length === 0 ? t : V(t, r);
563
+ return r.length > 0 && Object.hasOwn(n, r[0]) ? H(n[r[0]], r.slice(1)) : r.length === 0 ? t : H(t, r);
563
564
  }
564
- function Vt(e, t, n) {
565
+ function Wt(e, t, n) {
565
566
  let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
566
567
  if (r.length === 0) return;
567
568
  let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
568
- return a.length === 0 ? i : i.length === 1 ? V(i[0], a) : i.map((e) => V(e, a));
569
+ return a.length === 0 ? i : i.length === 1 ? H(i[0], a) : i.map((e) => H(e, a));
569
570
  }
570
- function Ht(e) {
571
- if (!H(e)) return "";
571
+ function Gt(e) {
572
+ if (!U(e)) return "";
572
573
  if (e.isAuthorized === !1) return "The query answered 403.";
573
574
  if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
574
575
  let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
@@ -576,58 +577,58 @@ function Ht(e) {
576
577
  }
577
578
  return "";
578
579
  }
579
- function Ut(e) {
580
- return Array.isArray(e) ? e.filter(H) : H(e) ? [e] : [];
580
+ function Kt(e) {
581
+ return Array.isArray(e) ? e.filter(U) : U(e) ? [e] : [];
581
582
  }
582
- function V(e, t) {
583
+ function H(e, t) {
583
584
  let n = e;
584
585
  for (let e of t) {
585
- if (!H(n)) return;
586
+ if (!U(n)) return;
586
587
  n = n[e];
587
588
  }
588
589
  return n;
589
590
  }
590
- function H(e) {
591
+ function U(e) {
591
592
  return typeof e == "object" && !!e && !Array.isArray(e);
592
593
  }
593
594
  //#endregion
594
595
  //#region src/stageComponentOutputs.ts
595
- function Wt() {
596
- let e = a(), { publishComponentOutputs: t, withdrawComponentOutputs: r } = z();
596
+ function qt() {
597
+ let e = a(), { publishComponentOutputs: t, withdrawComponentOutputs: r } = B();
597
598
  return i(() => () => r(e), [e, r]), n((n) => t(e, n), [t, e]);
598
599
  }
599
600
  //#endregion
600
601
  //#region src/commandExecutor.ts
601
- function U(e, t, n) {
602
+ function W(e, t, n) {
602
603
  for (let r of [
603
604
  t,
604
605
  n?.replace(/^\//, ""),
605
606
  e
606
607
  ]) {
607
608
  if (!r) continue;
608
- let t = ke(r);
609
- if (Gt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
609
+ let t = je(r);
610
+ if (Jt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
610
611
  }
611
612
  }
612
- function Gt(e) {
613
- return typeof e == "function" && e.prototype instanceof Re;
613
+ function Jt(e) {
614
+ return typeof e == "function" && e.prototype instanceof Be;
614
615
  }
615
- function Kt(e, t) {
616
- return e.setApiBasePath(it(t)), e;
616
+ function Yt(e, t) {
617
+ return e.setApiBasePath(st(t)), e;
617
618
  }
618
- async function qt(e, t, n) {
619
- let r = U(e);
619
+ async function Xt(e, t, n) {
620
+ let r = W(e);
620
621
  if (!r) return {
621
622
  isSuccess: !1,
622
623
  validationErrors: [],
623
624
  messages: [`The modeled command “${e}” is not registered by this Stage.`]
624
625
  };
625
626
  let i = new r();
626
- i.setMicroservice(n.microservice), i.setApiBasePath(it(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
627
+ i.setMicroservice(n.microservice), i.setApiBasePath(st(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
627
628
  for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
628
- return Jt(e, await i.execute());
629
+ return Zt(e, await i.execute());
629
630
  }
630
- function Jt(e, t) {
631
+ function Zt(e, t) {
631
632
  let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
632
633
  member: t,
633
634
  message: e.message
@@ -643,53 +644,53 @@ function Jt(e, t) {
643
644
  messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
644
645
  };
645
646
  }
646
- function Yt() {
647
- let e = r(Te);
648
- return n((t, n) => qt(t, n, e), [e]);
647
+ function Qt() {
648
+ let e = r(De);
649
+ return n((t, n) => Xt(t, n, e), [e]);
649
650
  }
650
651
  //#endregion
651
652
  //#region src/stageNavigation.ts
652
- function Xt(e, t = {}) {
653
+ function $t(e, t = {}) {
653
654
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
654
655
  return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
655
656
  }
656
- function W(e, t = {}) {
657
+ function G(e, t = {}) {
657
658
  if (!globalThis.location) return;
658
- let n = Xt(e, t);
659
+ let n = $t(e, t);
659
660
  globalThis.location.hash !== n && (globalThis.location.hash = n);
660
661
  }
661
- function Zt(e) {
662
- return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Le)).map(([e, t]) => [e, String(t)]));
662
+ function en(e) {
663
+ return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof ze)).map(([e, t]) => [e, String(t)]));
663
664
  }
664
665
  //#endregion
665
666
  //#region src/stageFormSchema.ts
666
- var Qt = 8;
667
- function $t(e) {
667
+ var tn = 8;
668
+ function K(e) {
668
669
  if (!e) return [];
669
670
  try {
670
- return en(JSON.parse(e), 0);
671
+ return nn(JSON.parse(e), 0);
671
672
  } catch {
672
673
  return [];
673
674
  }
674
675
  }
675
- function en(e, t) {
676
- let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = ln(e.properties) ? e.properties : {};
677
- return Object.entries(i).map(([e, i]) => tn(e, i, !n || r.has(e), t));
676
+ function nn(e, t) {
677
+ let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = dn(e.properties) ? e.properties : {};
678
+ return Object.entries(i).map(([e, i]) => rn(e, i, !n || r.has(e), t));
678
679
  }
679
- function tn(e, t, n, r) {
680
+ function rn(e, t, n, r) {
680
681
  return {
681
682
  name: e,
682
683
  identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
683
684
  ...t?.["x-identity"] === !0 ? { identity: !0 } : {},
684
685
  required: n,
685
- ...nn(t, r)
686
+ ...an(t, r)
686
687
  };
687
688
  }
688
- function nn(e, t) {
689
+ function an(e, t) {
689
690
  let n = e?.type;
690
691
  if (Array.isArray(n)) {
691
692
  let r = n.filter((e) => e !== "null");
692
- return r.length === 1 ? nn({
693
+ return r.length === 1 ? an({
693
694
  ...e,
694
695
  type: r[0]
695
696
  }, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
@@ -700,8 +701,8 @@ function nn(e, t) {
700
701
  type: "date",
701
702
  withTime: e.format === "date-time"
702
703
  };
703
- if (n === "array") return rn(e, t);
704
- if (n === "object") return an(e, t);
704
+ if (n === "array") return on(e, t);
705
+ if (n === "object") return sn(e, t);
705
706
  if (n === void 0 || n === "string") {
706
707
  let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
707
708
  return t.length > 0 ? {
@@ -711,77 +712,77 @@ function nn(e, t) {
711
712
  }
712
713
  return { unsupportedReason: `type ${String(n)}` };
713
714
  }
714
- function rn(e, t) {
715
+ function on(e, t) {
715
716
  let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
716
- if (t >= Qt || e?.items === void 0) return n;
717
- let r = tn("", e.items, !0, t + 1);
717
+ if (t >= tn || e?.items === void 0) return n;
718
+ let r = rn("", e.items, !0, t + 1);
718
719
  return r.unsupportedReason || r.item ? n : { item: r };
719
720
  }
720
- function an(e, t) {
721
+ function sn(e, t) {
721
722
  let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
722
- if (t >= Qt || !ln(e?.properties) || Object.keys(e.properties).length === 0) return n;
723
- let r = en(e, t + 1), i = r.find((e) => e.unsupportedReason);
723
+ if (t >= tn || !dn(e?.properties) || Object.keys(e.properties).length === 0) return n;
724
+ let r = nn(e, t + 1), i = r.find((e) => e.unsupportedReason);
724
725
  return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
725
726
  }
726
- function G(e) {
727
+ function q(e) {
727
728
  let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
728
729
  return t.charAt(0).toUpperCase() + t.slice(1);
729
730
  }
730
- function on(e, t, n) {
731
+ function cn(e, t, n) {
731
732
  if (t != null) {
732
- if (e.members && ln(t)) for (let r of e.members) {
733
- let e = t[r.name], i = G(r.name);
734
- if (sn(e)) {
733
+ if (e.members && dn(t)) for (let r of e.members) {
734
+ let e = t[r.name], i = q(r.name);
735
+ if (ln(e)) {
735
736
  if (r.required) return `${n}: ${i} is required`;
736
737
  continue;
737
738
  }
738
- let a = on(r, e, `${n} ${i.toLowerCase()}`);
739
+ let a = cn(r, e, `${n} ${i.toLowerCase()}`);
739
740
  if (a) return a;
740
741
  }
741
742
  if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
742
- let t = sn(i) ? `${n} ${r + 1} is required` : on(e.item, i, `${n} ${r + 1}`);
743
+ let t = ln(i) ? `${n} ${r + 1} is required` : cn(e.item, i, `${n} ${r + 1}`);
743
744
  if (t) return t;
744
745
  }
745
746
  }
746
747
  }
747
- function sn(e) {
748
+ function ln(e) {
748
749
  return e == null || e === "";
749
750
  }
750
- function cn(e, t) {
751
- return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && ln(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
751
+ function un(e, t) {
752
+ return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && dn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
752
753
  let r = e.members?.find((e) => e.name === t);
753
- return [t, r ? cn(r, n) : n];
754
- })) : e.item && Array.isArray(t) ? t.map((t) => cn(e.item, t)) : t;
754
+ return [t, r ? un(r, n) : n];
755
+ })) : e.item && Array.isArray(t) ? t.map((t) => un(e.item, t)) : t;
755
756
  }
756
- function ln(e) {
757
+ function dn(e) {
757
758
  return typeof e == "object" && !!e && !Array.isArray(e);
758
759
  }
759
760
  //#endregion
760
761
  //#region src/StageValueFields.tsx
761
- var un = Be((e) => /* @__PURE__ */ P(dn, {
762
+ var fn = He((e) => /* @__PURE__ */ F(pn, {
762
763
  descriptor: e.descriptor,
763
- label: e.title ?? G(e.descriptor.name),
764
+ label: e.title ?? q(e.descriptor.name),
764
765
  value: e.value,
765
766
  onChange: e.onChange,
766
767
  onBlur: e.onBlur,
767
768
  invalid: e.invalid
768
769
  }), { defaultValue: void 0 });
769
- function dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
770
- return e.members ? /* @__PURE__ */ P(fn, {
770
+ function pn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
771
+ return e.members ? /* @__PURE__ */ F(mn, {
771
772
  descriptor: e,
772
773
  label: t,
773
774
  value: n,
774
775
  onChange: r,
775
776
  onBlur: i,
776
777
  invalid: a
777
- }) : e.item ? /* @__PURE__ */ P(pn, {
778
+ }) : e.item ? /* @__PURE__ */ F(hn, {
778
779
  descriptor: e,
779
780
  label: t,
780
781
  value: n,
781
782
  onChange: r,
782
783
  onBlur: i,
783
784
  invalid: a
784
- }) : /* @__PURE__ */ P(mn, {
785
+ }) : /* @__PURE__ */ F(gn, {
785
786
  descriptor: e,
786
787
  label: t,
787
788
  value: n,
@@ -790,14 +791,14 @@ function dn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
790
791
  invalid: a
791
792
  });
792
793
  }
793
- function fn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
794
- let o = _n(n) ? n : {};
795
- return /* @__PURE__ */ F("fieldset", {
794
+ function mn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
795
+ let o = yn(n) ? n : {};
796
+ return /* @__PURE__ */ I("fieldset", {
796
797
  className: "stage-record-field",
797
798
  "data-invalid": a ? "true" : void 0,
798
- children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(dn, {
799
+ children: [/* @__PURE__ */ F("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ F(pn, {
799
800
  descriptor: e,
800
- label: G(e.name),
801
+ label: q(e.name),
801
802
  value: o[e.name],
802
803
  onBlur: i,
803
804
  onChange: (t) => r({
@@ -807,74 +808,74 @@ function fn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
807
808
  }, e.name))]
808
809
  });
809
810
  }
810
- function pn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
811
+ function hn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
811
812
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
812
- return /* @__PURE__ */ F("fieldset", {
813
+ return /* @__PURE__ */ I("fieldset", {
813
814
  className: "stage-list-field",
814
815
  "data-invalid": a ? "true" : void 0,
815
816
  children: [
816
- /* @__PURE__ */ P("legend", { children: t }),
817
- s.length === 0 && /* @__PURE__ */ P("p", {
817
+ /* @__PURE__ */ F("legend", { children: t }),
818
+ s.length === 0 && /* @__PURE__ */ F("p", {
818
819
  className: "stage-note",
819
820
  children: "Nothing added yet."
820
821
  }),
821
- s.map((e, n) => /* @__PURE__ */ F("div", {
822
+ s.map((e, n) => /* @__PURE__ */ I("div", {
822
823
  className: "stage-list-field__row",
823
- children: [/* @__PURE__ */ P(dn, {
824
+ children: [/* @__PURE__ */ F(pn, {
824
825
  descriptor: o,
825
826
  label: `${t} ${n + 1}`,
826
827
  value: e,
827
828
  onBlur: i,
828
829
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
829
- }), /* @__PURE__ */ P("button", {
830
+ }), /* @__PURE__ */ F("button", {
830
831
  type: "button",
831
832
  "aria-label": `Remove ${t} ${n + 1}`,
832
833
  onClick: () => c(s.filter((e, t) => t !== n)),
833
834
  children: "Remove"
834
835
  })]
835
836
  }, n)),
836
- /* @__PURE__ */ P("button", {
837
+ /* @__PURE__ */ F("button", {
837
838
  type: "button",
838
839
  "aria-label": `Add ${t}`,
839
- onClick: () => c([...s, hn(o)]),
840
+ onClick: () => c([...s, _n(o)]),
840
841
  children: "Add"
841
842
  })
842
843
  ]
843
844
  });
844
845
  }
845
- function mn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
846
+ function gn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
846
847
  let o = {
847
848
  "aria-invalid": a ? !0 : void 0,
848
849
  onBlur: i
849
850
  };
850
- if (e.options) return /* @__PURE__ */ F("label", {
851
+ if (e.options) return /* @__PURE__ */ I("label", {
851
852
  className: "stage-value-field",
852
- children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ F("select", {
853
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ I("select", {
853
854
  ...o,
854
855
  value: typeof n == "string" ? n : "",
855
856
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
856
- children: [/* @__PURE__ */ P("option", {
857
+ children: [/* @__PURE__ */ F("option", {
857
858
  value: "",
858
859
  children: ""
859
- }), e.options.map((e) => /* @__PURE__ */ P("option", {
860
+ }), e.options.map((e) => /* @__PURE__ */ F("option", {
860
861
  value: e,
861
- children: G(e)
862
+ children: q(e)
862
863
  }, e))]
863
864
  })]
864
865
  });
865
866
  switch (e.type) {
866
- case "boolean": return /* @__PURE__ */ F("label", {
867
+ case "boolean": return /* @__PURE__ */ I("label", {
867
868
  className: "stage-value-field stage-value-field--check",
868
- children: [/* @__PURE__ */ P("input", {
869
+ children: [/* @__PURE__ */ F("input", {
869
870
  ...o,
870
871
  type: "checkbox",
871
872
  checked: n === !0,
872
873
  onChange: (e) => r(e.target.checked)
873
- }), /* @__PURE__ */ P("span", { children: t })]
874
+ }), /* @__PURE__ */ F("span", { children: t })]
874
875
  });
875
- case "number": return /* @__PURE__ */ F("label", {
876
+ case "number": return /* @__PURE__ */ I("label", {
876
877
  className: "stage-value-field",
877
- children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
878
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
878
879
  ...o,
879
880
  type: "number",
880
881
  step: "any",
@@ -882,18 +883,18 @@ function mn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
882
883
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
883
884
  })]
884
885
  });
885
- case "date": return /* @__PURE__ */ F("label", {
886
+ case "date": return /* @__PURE__ */ I("label", {
886
887
  className: "stage-value-field",
887
- children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
888
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
888
889
  ...o,
889
890
  type: e.withTime ? "datetime-local" : "date",
890
891
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
891
- onChange: (t) => r(t.target.value === "" ? void 0 : gn(t.target.value, e.withTime === !0))
892
+ onChange: (t) => r(t.target.value === "" ? void 0 : vn(t.target.value, e.withTime === !0))
892
893
  })]
893
894
  });
894
- default: return /* @__PURE__ */ F("label", {
895
+ default: return /* @__PURE__ */ I("label", {
895
896
  className: "stage-value-field",
896
- children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
897
+ children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
897
898
  ...o,
898
899
  type: "text",
899
900
  value: typeof n == "string" ? n : "",
@@ -902,158 +903,160 @@ function mn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
902
903
  });
903
904
  }
904
905
  }
905
- function hn(e) {
906
+ function _n(e) {
906
907
  return e.members ? {} : void 0;
907
908
  }
908
- function gn(e, t) {
909
+ function vn(e, t) {
909
910
  if (!t) return e;
910
911
  let n = new Date(e);
911
912
  return Number.isNaN(n.getTime()) ? e : n.toISOString();
912
913
  }
913
- function _n(e) {
914
+ function yn(e) {
914
915
  return typeof e == "object" && !!e && !Array.isArray(e);
915
916
  }
916
917
  //#endregion
917
918
  //#region src/StageCommandForm.tsx
918
- var vn = e(void 0);
919
- function yn({ element: e }) {
920
- let t = z(), n = r(Te), i = r(vn), a = o(() => xn(e), [e]), s = o(() => Kn(e), [e]), l = typeof e.properties.schema == "string", u = o(() => a ? Sn(a, s) : [], [a, s]), d = a ? U(a.command, q(e, "typeName"), q(e, "route")) : void 0, f = Fn(e, u, t.resolveArgument), p = Nn(e, s, t), m = JSON.stringify(p ?? null), h = o(() => p, [m]), g = o(() => Object.values(t.selections).filter((e) => e !== void 0), [t.selections]), _ = o(() => ({
919
+ var bn = e(void 0);
920
+ function xn({ element: e }) {
921
+ let t = B(), n = r(De), i = r(bn), a = o(() => Cn(e), [e]), s = o(() => Zn(e), [e]), l = typeof e.properties.schema == "string", u = o(() => a ? wn(a, s) : [], [a, s]), d = a ? W(a.command, Y(e, "typeName"), Y(e, "route")) : void 0, f = Bn(e, u, t.resolveArgument), p = Rn(e, s, t), m = JSON.stringify(p ?? null), h = o(() => p, [m]), g = o(() => Object.values(t.selections).filter((e) => e !== void 0), [t.selections]), _ = o(() => Fn(t.queries), [t.queries]), v = e.properties.rowAction === !0, y = o(() => ({
921
922
  ...h,
922
- ...On(u, s, t.parameters, g),
923
- ...Dn(u, t.parameters)
923
+ ...An(u, s, t.parameters, g, _, v),
924
+ ...kn(u, t.parameters)
924
925
  }), [
925
926
  h,
926
927
  u,
927
928
  s,
928
929
  t.parameters,
929
- g
930
- ]), v = o(() => a ? Cn(a, u, s) : void 0, [
930
+ g,
931
+ _,
932
+ v
933
+ ]), b = o(() => a ? Tn(a, u, s) : void 0, [
931
934
  a,
932
935
  u,
933
936
  s
934
- ]), y = o(() => a ? Wn(u, s) : [], [
937
+ ]), x = o(() => a ? Yn(u, s) : [], [
935
938
  a,
936
939
  u,
937
940
  s
938
- ]), b = o(() => a ? Gn(a.layout, u) : [], [a, u]), [x, S] = c([]);
939
- return a ? !d && !t.routesReady ? /* @__PURE__ */ F("p", {
941
+ ]), ee = o(() => a ? Xn(a.layout, u) : [], [a, u]), [S, C] = c([]);
942
+ return a ? !d && !t.routesReady ? /* @__PURE__ */ I("p", {
940
943
  className: "stage-note",
941
944
  children: [
942
945
  "The modeled command “",
943
946
  a.command,
944
947
  "” is waiting for Stage routes."
945
948
  ]
946
- }) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(bn, {
949
+ }) : d ? u.length === 0 && !l && e.properties.parameterless !== !0 ? /* @__PURE__ */ F(Sn, {
947
950
  form: a,
948
951
  messages: [`The modeled command “${a.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
949
- }) : y.length > 0 ? /* @__PURE__ */ P(bn, {
952
+ }) : x.length > 0 ? /* @__PURE__ */ F(Sn, {
950
953
  form: a,
951
- messages: y
952
- }) : /* @__PURE__ */ P("section", {
954
+ messages: x
955
+ }) : /* @__PURE__ */ F("section", {
953
956
  className: "stage-command-form",
954
957
  "data-command": a.command,
955
958
  "data-generation-mode": a.generationMode,
956
- children: /* @__PURE__ */ F(ze, {
959
+ children: /* @__PURE__ */ I(Ve, {
957
960
  command: d,
958
- initialValues: _,
961
+ initialValues: y,
959
962
  currentValues: f,
960
963
  validateOn: "both",
961
964
  validateAllFieldsOnChange: !0,
962
- onBeforeExecute: (e) => Kt(e, n.apiBasePath),
963
- onFieldValidate: (e, t, n, r) => Un(u, s, t, r),
964
- onValidationFailure: (e) => S(e.map((e) => e.message)),
965
- onException: (e) => S(e),
966
- onFailed: (e) => S(Jt(a.command, e).messages),
965
+ onBeforeExecute: (e) => Yt(e, n.apiBasePath),
966
+ onFieldValidate: (e, t, n, r) => Jn(u, s, t, r),
967
+ onValidationFailure: (e) => C(e.map((e) => e.message)),
968
+ onException: (e) => C(e),
969
+ onFailed: (e) => C(Zt(a.command, e).messages),
967
970
  onSuccess: () => {
968
- S([]), t.refreshAfterCommand();
969
- let n = q(e, "navigateToScreen");
970
- n && W(n, {}), i?.();
971
+ C([]), t.refreshAfterCommand();
972
+ let n = Y(e, "navigateToScreen");
973
+ n && G(n, {}), i?.();
971
974
  },
972
975
  children: [
973
- b.map((e) => /* @__PURE__ */ P("p", {
976
+ ee.map((e) => /* @__PURE__ */ F("p", {
974
977
  role: "alert",
975
978
  className: "stage-form-error",
976
979
  children: e
977
980
  }, e)),
978
- v,
979
- x.map((e) => /* @__PURE__ */ P("p", {
981
+ b,
982
+ S.map((e) => /* @__PURE__ */ F("p", {
980
983
  role: "alert",
981
984
  className: "stage-form-error",
982
985
  children: e
983
986
  }, e)),
984
987
  /* @__PURE__ */ F("button", {
985
988
  type: "submit",
986
- children: ["Execute ", a.label]
989
+ children: Y(e, "submitLabel") || `Execute ${a.label}`
987
990
  })
988
991
  ]
989
992
  }, m)
990
- }) : /* @__PURE__ */ F("p", {
993
+ }) : /* @__PURE__ */ I("p", {
991
994
  className: "stage-note",
992
995
  children: [
993
996
  "The modeled command “",
994
997
  a.command,
995
998
  "” is not registered by this Stage."
996
999
  ]
997
- }) : /* @__PURE__ */ P("p", {
1000
+ }) : /* @__PURE__ */ F("p", {
998
1001
  className: "stage-note",
999
1002
  children: "This form is missing its command metadata."
1000
1003
  });
1001
1004
  }
1002
- function bn({ form: e, messages: t }) {
1003
- return /* @__PURE__ */ P("section", {
1005
+ function Sn({ form: e, messages: t }) {
1006
+ return /* @__PURE__ */ F("section", {
1004
1007
  className: "stage-command-form",
1005
1008
  "data-command": e.command,
1006
1009
  "data-generation-mode": e.generationMode,
1007
- children: t.map((e) => /* @__PURE__ */ P("p", {
1010
+ children: t.map((e) => /* @__PURE__ */ F("p", {
1008
1011
  role: "alert",
1009
1012
  className: "stage-form-error",
1010
1013
  children: e
1011
1014
  }, e))
1012
1015
  });
1013
1016
  }
1014
- function xn(e) {
1015
- let t = q(e, "command");
1017
+ function Cn(e) {
1018
+ let t = Y(e, "command");
1016
1019
  if (!t) return;
1017
- let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(J) : [];
1020
+ let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(X) : [];
1018
1021
  return {
1019
1022
  command: t,
1020
- label: q(e, "label", t),
1023
+ label: Y(e, "label", t),
1021
1024
  fields: n,
1022
- generationMode: Ln(e.properties.generationMode),
1023
- layout: Rn(e.properties.layout)
1025
+ generationMode: Hn(e.properties.generationMode),
1026
+ layout: Un(e.properties.layout)
1024
1027
  };
1025
1028
  }
1026
- function Sn(e, t) {
1029
+ function wn(e, t) {
1027
1030
  return e.generationMode === d.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1028
1031
  name: e.name,
1029
1032
  label: e.name
1030
1033
  }));
1031
1034
  }
1032
- function Cn(e, t, n) {
1033
- let r = e.layout, i = r ? zn(r, t) : [];
1034
- if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => wn(e, n));
1035
- let a = new Map(t.map((e) => [e.name, e])), o = Bn(r, i), s = {
1036
- gridTemplateColumns: Array.from({ length: o }, (e, t) => Vn(t + 1, r.columns)).join(" "),
1037
- columnGap: K(r.columnGap),
1038
- rowGap: K(r.rowGap)
1035
+ function Tn(e, t, n) {
1036
+ let r = e.layout, i = r ? Wn(r, t) : [];
1037
+ if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => En(e, n));
1038
+ let a = new Map(t.map((e) => [e.name, e])), o = Gn(r, i), s = {
1039
+ gridTemplateColumns: Array.from({ length: o }, (e, t) => Kn(t + 1, r.columns)).join(" "),
1040
+ columnGap: J(r.columnGap),
1041
+ rowGap: J(r.rowGap)
1039
1042
  }, c = /* @__PURE__ */ new Set();
1040
- return /* @__PURE__ */ F("div", {
1043
+ return /* @__PURE__ */ I("div", {
1041
1044
  className: "stage-command-form__layout",
1042
1045
  style: s,
1043
1046
  children: [i.map((e) => {
1044
1047
  let t = a.get(e.field);
1045
- return t ? (c.add(t.name), wn(t, n, e)) : null;
1046
- }), t.filter((e) => !c.has(e.name)).map((e) => wn(e, n))]
1048
+ return t ? (c.add(t.name), En(t, n, e)) : null;
1049
+ }), t.filter((e) => !c.has(e.name)).map((e) => En(e, n))]
1047
1050
  });
1048
1051
  }
1049
- function wn(e, t, n) {
1052
+ function En(e, t, n) {
1050
1053
  let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
1051
1054
  if (i?.options) {
1052
1055
  let e = i.options.map((e) => ({
1053
1056
  value: e,
1054
- label: G(e)
1057
+ label: q(e)
1055
1058
  }));
1056
- return /* @__PURE__ */ P(We, {
1059
+ return /* @__PURE__ */ F(Ke, {
1057
1060
  value: o,
1058
1061
  fieldName: r,
1059
1062
  title: a,
@@ -1063,7 +1066,7 @@ function wn(e, t, n) {
1063
1066
  optionLabel: "label"
1064
1067
  });
1065
1068
  }
1066
- if (i?.members || i?.item) return /* @__PURE__ */ P(un, {
1069
+ if (i?.members || i?.item) return /* @__PURE__ */ F(fn, {
1067
1070
  value: o,
1068
1071
  fieldName: r,
1069
1072
  title: a,
@@ -1071,19 +1074,19 @@ function wn(e, t, n) {
1071
1074
  descriptor: i
1072
1075
  });
1073
1076
  switch (i?.type ?? "text") {
1074
- case "number": return /* @__PURE__ */ P(Ke, {
1077
+ case "number": return /* @__PURE__ */ F(Je, {
1075
1078
  value: o,
1076
1079
  fieldName: r,
1077
1080
  title: a,
1078
1081
  required: s
1079
1082
  });
1080
- case "boolean": return /* @__PURE__ */ P(Ue, {
1083
+ case "boolean": return /* @__PURE__ */ F(Ge, {
1081
1084
  value: o,
1082
1085
  fieldName: r,
1083
1086
  label: a,
1084
1087
  required: s
1085
1088
  });
1086
- case "date": return /* @__PURE__ */ P(Tn, {
1089
+ case "date": return /* @__PURE__ */ F(Dn, {
1087
1090
  value: o,
1088
1091
  fieldName: r,
1089
1092
  title: a,
@@ -1091,15 +1094,15 @@ function wn(e, t, n) {
1091
1094
  showIcon: !0,
1092
1095
  showTime: i?.withTime
1093
1096
  });
1094
- default: return /* @__PURE__ */ P(Ge, {
1097
+ default: return /* @__PURE__ */ F(qe, {
1095
1098
  value: o,
1096
1099
  fieldName: r,
1097
1100
  title: a,
1098
1101
  required: s
1099
1102
  });
1100
1103
  }
1101
- })(), l = Hn(n);
1102
- return /* @__PURE__ */ P("span", {
1104
+ })(), l = qn(n);
1105
+ return /* @__PURE__ */ F("span", {
1103
1106
  className: "stage-command-form__field",
1104
1107
  "data-field": e.name,
1105
1108
  "data-row": n?.row,
@@ -1109,21 +1112,21 @@ function wn(e, t, n) {
1109
1112
  children: c
1110
1113
  }, e.name);
1111
1114
  }
1112
- var Tn = Ve((e) => /* @__PURE__ */ P(He, {
1115
+ var Dn = Ue((e) => /* @__PURE__ */ F(We, {
1113
1116
  ...e,
1114
- currentValue: e.showTime ? e.currentValue : En(e.currentValue),
1115
- onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Ie.fromDate(t) : t)
1117
+ currentValue: e.showTime ? e.currentValue : On(e.currentValue),
1118
+ onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Re.fromDate(t) : t)
1116
1119
  }));
1117
- function En(e) {
1118
- if (e instanceof Ie) return e.toDate();
1120
+ function On(e) {
1121
+ if (e instanceof Re) return e.toDate();
1119
1122
  if (typeof e != "string") return e;
1120
1123
  try {
1121
- return Ie.parse(e).toDate();
1124
+ return Re.parse(e).toDate();
1122
1125
  } catch {
1123
1126
  return null;
1124
1127
  }
1125
1128
  }
1126
- function Dn(e, t) {
1129
+ function kn(e, t) {
1127
1130
  let n = {};
1128
1131
  for (let r of e) {
1129
1132
  let e = r.sourceProperty ?? r.name, i = t[e];
@@ -1131,103 +1134,117 @@ function Dn(e, t) {
1131
1134
  }
1132
1135
  return n;
1133
1136
  }
1134
- function On(e, t, n, r = []) {
1135
- let i = new Set(e.map((e) => e.sourceProperty ?? e.name)), a = t.some((e) => e.identity), o = {};
1137
+ function An(e, t, n, r = [], i = [], a = !1) {
1138
+ let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
1136
1139
  for (let e of t) {
1137
- if (!e.identifier || !e.required || i.has(e.name)) continue;
1138
- let t = An(e, n) ?? jn(e, r) ?? (e.identity || !a ? Et(e.identifier) : void 0);
1139
- t !== void 0 && (o[e.name] = t);
1140
+ if (!e.identifier || !e.required || o.has(e.name)) continue;
1141
+ if (a && Pn(e, i)) {
1142
+ let t = n[e.name] || Nn(e, r);
1143
+ t && (c[e.name] = t);
1144
+ continue;
1145
+ }
1146
+ let t = n[e.name] || Nn(e, r) || Ot(e.identifier) || (e.identity || !s && !Pn(e, i) ? kt(e.identifier) : void 0);
1147
+ t !== void 0 && (c[e.name] = t);
1140
1148
  }
1141
- return o;
1149
+ return c;
1142
1150
  }
1143
- function kn(e, t) {
1144
- return !e.identifier || !e.required ? !1 : e.identity === !0 || An(e, t) !== void 0;
1151
+ function jn(e, t) {
1152
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || Mn(e, t) !== void 0;
1145
1153
  }
1146
- function An(e, t) {
1147
- if (e.identifier) return t[e.name] || Tt(e.identifier);
1154
+ function Mn(e, t) {
1155
+ if (e.identifier) return t[e.name] || Ot(e.identifier);
1148
1156
  }
1149
- function jn(e, t) {
1157
+ function Nn(e, t) {
1150
1158
  if (!e.identifier) return;
1151
1159
  let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
1152
1160
  return n.size === 1 ? [...n][0] : void 0;
1153
1161
  }
1154
- function Mn(e) {
1162
+ function Pn(e, t) {
1163
+ return t.some((t) => Object.hasOwn(t, e.name));
1164
+ }
1165
+ function Fn(e) {
1166
+ return Object.values(e).flatMap((e) => e.rows);
1167
+ }
1168
+ function In(e, t, n, r) {
1169
+ return e.filter((e) => e.identifier && e.required && Pn(e, r)).filter((e) => !t[e.name] && Nn(e, n) === void 0).map((e) => e.name);
1170
+ }
1171
+ function Ln(e) {
1155
1172
  let t = e.properties.populateSource;
1156
- return J(t) ? t : void 0;
1173
+ return X(t) ? t : void 0;
1157
1174
  }
1158
- function Nn(e, t, n) {
1159
- let r = Mn(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Pn(e, r?.path ?? e, t, n)]), s = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = B({
1160
- scope: `populate:${q(e, "command")}`,
1175
+ function Rn(e, t, n) {
1176
+ let r = Ln(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, zn(e, r?.path ?? e, t, n)]), s = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = V({
1177
+ scope: `populate:${Y(e, "command")}`,
1161
1178
  name: i,
1162
1179
  route: i ? n.routes?.queries?.[i] : void 0,
1163
1180
  arguments: s,
1164
1181
  ready: c,
1165
1182
  publish: !1
1166
- }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : J(u) ? u : void 0;
1183
+ }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : X(u) ? u : void 0;
1167
1184
  return o(() => {
1168
1185
  if (!d) return;
1169
1186
  let e = {};
1170
1187
  for (let n of t) {
1171
1188
  let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1172
- t != null && (e[n.name] = cn(n, t));
1189
+ t != null && (e[n.name] = un(n, t));
1173
1190
  }
1174
1191
  return Object.keys(e).length > 0 ? e : void 0;
1175
1192
  }, [d, t]);
1176
1193
  }
1177
- function Pn(e, t, n, r) {
1194
+ function zn(e, t, n, r) {
1178
1195
  let i = r.parameters[t] ?? r.parameters[e];
1179
1196
  if (i) return i;
1180
1197
  let a = n.find((n) => n.name === t || n.name === e)?.identifier;
1181
- if (a) return Et(a);
1198
+ if (a) return kt(a);
1182
1199
  let o = r.resolveBinding({ path: t });
1183
1200
  return typeof o == "string" || typeof o == "number" ? o : void 0;
1184
1201
  }
1185
- function Fn(e, t, n) {
1186
- let r = o(() => In(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1202
+ function Bn(e, t, n) {
1203
+ let r = o(() => Vn(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1187
1204
  return o(() => {
1188
1205
  let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
1189
1206
  return Object.keys(e).length > 0 ? e : void 0;
1190
1207
  }, [r, a]);
1191
1208
  }
1192
- function In(e, t) {
1209
+ function Vn(e, t) {
1193
1210
  let n = e.properties.arguments;
1194
1211
  if (!Array.isArray(n)) return [];
1195
1212
  let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
1196
1213
  return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
1197
1214
  }
1198
- function Ln(e) {
1215
+ function Hn(e) {
1199
1216
  return e === d.Manual ? d.Manual : d.Auto;
1200
1217
  }
1201
- function Rn(e) {
1202
- if (!J(e)) return;
1218
+ function Un(e) {
1219
+ if (!X(e)) return;
1203
1220
  let t = e;
1204
1221
  return {
1205
- columns: Array.isArray(t.columns) ? t.columns.filter(qn) : [],
1206
- placements: Array.isArray(t.placements) ? t.placements.filter(Jn) : [],
1207
- columnGap: Yn(t.columnGap) ? t.columnGap : void 0,
1208
- rowGap: Yn(t.rowGap) ? t.rowGap : void 0
1222
+ columns: Array.isArray(t.columns) ? t.columns.filter(Qn) : [],
1223
+ placements: Array.isArray(t.placements) ? t.placements.filter($n) : [],
1224
+ columnGap: er(t.columnGap) ? t.columnGap : void 0,
1225
+ rowGap: er(t.rowGap) ? t.rowGap : void 0
1209
1226
  };
1210
1227
  }
1211
- function zn(e, t) {
1228
+ function Wn(e, t) {
1212
1229
  let n = new Map(e.placements.map((e) => [e.field, e]));
1213
- for (let e of t) !n.has(e.name) && Jn(e.placement) && n.set(e.name, e.placement);
1230
+ for (let e of t) !n.has(e.name) && $n(e.placement) && n.set(e.name, e.placement);
1214
1231
  return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
1215
1232
  }
1216
- function Bn(e, t) {
1233
+ function Gn(e, t) {
1217
1234
  return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
1218
1235
  }
1219
- function Vn(e, t) {
1220
- let n = t.find((t) => t.index === e), r = K(n?.width), i = K(n?.minWidth), a = K(n?.maxWidth);
1236
+ function Kn(e, t) {
1237
+ let n = t.find((t) => t.index === e), r = J(n?.width), i = J(n?.minWidth), a = J(n?.maxWidth);
1221
1238
  return n?.width?.unit === f.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1222
1239
  }
1223
- function Hn(e) {
1240
+ function qn(e) {
1224
1241
  if (e) return {
1225
1242
  gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
1226
1243
  gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
1227
- width: e.width?.unit === f.Fraction ? void 0 : K(e.width)
1244
+ width: e.width?.unit === f.Fraction ? void 0 : J(e.width)
1228
1245
  };
1229
1246
  }
1230
- function K(e) {
1247
+ function J(e) {
1231
1248
  if (e) switch (e.unit) {
1232
1249
  case f.Fraction: return `${e.value ?? 1}fr`;
1233
1250
  case f.Pixels: return `${e.value ?? 0}px`;
@@ -1235,60 +1252,60 @@ function K(e) {
1235
1252
  case f.Auto: return "auto";
1236
1253
  }
1237
1254
  }
1238
- function Un(e, t, n, r) {
1255
+ function Jn(e, t, n, r) {
1239
1256
  let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
1240
- if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? on(a, r, i?.label ?? n) : void 0;
1257
+ if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? cn(a, r, i?.label ?? n) : void 0;
1241
1258
  }
1242
- function Wn(e, t) {
1259
+ function Yn(e, t) {
1243
1260
  let n = new Map(t.map((e) => [e.name, e]));
1244
1261
  return e.flatMap((e) => {
1245
1262
  let t = n.get(e.sourceProperty ?? e.name);
1246
1263
  return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
1247
1264
  });
1248
1265
  }
1249
- function Gn(e, t) {
1266
+ function Xn(e, t) {
1250
1267
  if (!e) return [];
1251
- let n = zn(e, t).filter((e) => e.width?.unit === f.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === f.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1268
+ let n = Wn(e, t).filter((e) => e.width?.unit === f.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === f.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1252
1269
  return [...n, ...r];
1253
1270
  }
1254
- function Kn(e) {
1255
- return $t(q(e, "schema"));
1271
+ function Zn(e) {
1272
+ return K(Y(e, "schema"));
1256
1273
  }
1257
- function q(e, t, n = "") {
1274
+ function Y(e, t, n = "") {
1258
1275
  let r = e.properties[t];
1259
1276
  return typeof r == "string" ? r : n;
1260
1277
  }
1261
- function qn(e) {
1262
- return J(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1278
+ function Qn(e) {
1279
+ return X(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1263
1280
  }
1264
- function Jn(e) {
1265
- return J(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1281
+ function $n(e) {
1282
+ return X(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1266
1283
  }
1267
- function Yn(e) {
1268
- return J(e) && Object.values(f).includes(e.unit);
1284
+ function er(e) {
1285
+ return X(e) && Object.values(f).includes(e.unit);
1269
1286
  }
1270
- function J(e) {
1287
+ function X(e) {
1271
1288
  return typeof e == "object" && !!e && !Array.isArray(e);
1272
1289
  }
1273
1290
  //#endregion
1274
1291
  //#region src/StageGuardedAction.tsx
1275
- function Xn(e) {
1292
+ function tr(e) {
1276
1293
  return typeof e == "object" && !!e && !Array.isArray(e);
1277
1294
  }
1278
- function Y(e, t) {
1295
+ function nr(e, t) {
1279
1296
  let n = e.properties[t];
1280
1297
  return typeof n == "string" ? n : "";
1281
1298
  }
1282
- function Zn(e) {
1299
+ function rr(e) {
1283
1300
  return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
1284
1301
  }
1285
- function Qn(e) {
1286
- let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Y(e, "itemRoute"), i = Xn(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1302
+ function ir(e) {
1303
+ let t = B(), n = nr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? nr(e, "itemRoute"), i = tr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1287
1304
  for (let [e, n] of Object.entries(i)) {
1288
- let r = Xn(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
1305
+ let r = tr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
1289
1306
  a[e] = r, (r == null || r === "") && (o = !1);
1290
1307
  }
1291
- let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = B({
1308
+ let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = V({
1292
1309
  scope: `${e.id}:item`,
1293
1310
  name: n || void 0,
1294
1311
  route: r || void 0,
@@ -1304,23 +1321,23 @@ function Qn(e) {
1304
1321
  item: l.rows.length === 1 ? l.rows[0] : void 0
1305
1322
  };
1306
1323
  }
1307
- function $n(e, t) {
1308
- return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Ct(ft(n) ?? "", t)]));
1324
+ function ar(e, t) {
1325
+ return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Et(ht(n) ?? "", t)]));
1309
1326
  }
1310
- function er({ element: e, interactions: t }) {
1311
- let n = z(), r = Qn(e), i = Yt(), [a, s] = c([]), [l, u] = c(!1), d = Y(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Xn(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1312
- if (!bt(m) || !h || !r.hasSource) {
1313
- let n = r.hasSource ? `${pt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${pt}: “${d}” has no data subject to evaluate its guard against.`;
1314
- return /* @__PURE__ */ F("div", {
1327
+ function or({ element: e, interactions: t }) {
1328
+ let n = B(), r = ir(e), i = Qt(), [a, s] = c([]), [l, u] = c(!1), d = nr(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = tr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1329
+ if (!Ct(m) || !h || !r.hasSource) {
1330
+ let n = r.hasSource ? `${gt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${gt}: “${d}” has no data subject to evaluate its guard against.`;
1331
+ return /* @__PURE__ */ I("div", {
1315
1332
  className: "stage-guarded-action",
1316
1333
  "data-scene-id": e.id,
1317
- children: [/* @__PURE__ */ P(I, {
1334
+ children: [/* @__PURE__ */ F(L, {
1318
1335
  type: "button",
1319
1336
  disabled: !0,
1320
1337
  title: n,
1321
1338
  ...t,
1322
1339
  children: d
1323
- }), /* @__PURE__ */ P("p", {
1340
+ }), /* @__PURE__ */ F("p", {
1324
1341
  role: "alert",
1325
1342
  className: "stage-form-error",
1326
1343
  children: n
@@ -1328,42 +1345,42 @@ function er({ element: e, interactions: t }) {
1328
1345
  });
1329
1346
  }
1330
1347
  if (!r.item) return null;
1331
- let g = xt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1348
+ let g = wt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1332
1349
  if (!_?.command) return null;
1333
- let v = _.command, y = U(v), b = r.item, x = async () => {
1350
+ let v = _.command, y = W(v), b = r.item, x = async () => {
1334
1351
  if (!y) return;
1335
1352
  u(!0);
1336
- let t = await i(v, $n(_, b));
1353
+ let t = await i(v, ar(_, b));
1337
1354
  if (u(!1), s(t.messages), !t.isSuccess) return;
1338
1355
  n.refreshAfterCommand();
1339
- let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? Ct(`item.${a}`, b) : void 0;
1340
- r && W(r, a && o != null ? { [a]: String(o) } : {});
1356
+ let r = nr(e, "navigateToScreen"), a = nr(e, "navigateByParameter"), o = a ? Et(`item.${a}`, b) : void 0;
1357
+ r && G(r, a && o != null ? { [a]: String(o) } : {});
1341
1358
  };
1342
- return /* @__PURE__ */ F("div", {
1359
+ return /* @__PURE__ */ I("div", {
1343
1360
  className: "stage-guarded-action",
1344
1361
  "data-scene-id": e.id,
1345
1362
  "data-command": v,
1346
- children: [/* @__PURE__ */ P(I, {
1363
+ children: [/* @__PURE__ */ F(L, {
1347
1364
  ...t,
1348
1365
  type: "button",
1349
1366
  disabled: !y || l,
1350
1367
  title: y ? void 0 : "This command is not exposed as an API yet",
1351
1368
  onClick: () => void x(),
1352
1369
  children: d
1353
- }), a.map((e) => /* @__PURE__ */ P("p", {
1370
+ }), a.map((e) => /* @__PURE__ */ F("p", {
1354
1371
  role: "alert",
1355
1372
  className: "stage-form-error",
1356
1373
  children: e
1357
1374
  }, e))]
1358
1375
  });
1359
1376
  }
1360
- function tr(e) {
1361
- let t = ae(), r = s(void 0), a = o(() => v(re(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
1377
+ function sr(e) {
1378
+ let t = ce(), r = s(void 0), a = o(() => y(ie(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
1362
1379
  i(() => () => clearTimeout(r.current), []);
1363
1380
  let c = n((e) => {
1364
1381
  if (clearTimeout(r.current), r.current = void 0, !t) return;
1365
- let n = (n) => n.path === "$guard" ? St(n.value, e) : n.path?.startsWith("item.") ? Ct(n.path, e) : t.context.resolve(n);
1366
- b(a, t.dispatcher, {
1382
+ let n = (n) => n.path === "$guard" ? Tt(n.value, e) : n.path?.startsWith("item.") ? Et(n.path, e) : t.context.resolve(n);
1383
+ x(a, t.dispatcher, {
1367
1384
  ...t.context,
1368
1385
  resolve: n
1369
1386
  }).then((e) => {
@@ -1384,9 +1401,120 @@ function tr(e) {
1384
1401
  };
1385
1402
  }
1386
1403
  //#endregion
1404
+ //#region src/stageDialogScreens.ts
1405
+ var cr = "Stage:confirmDialog", lr = "ConfirmDialog";
1406
+ function ur(e, t) {
1407
+ let n = new Set(t.map((e) => e.name));
1408
+ return e.map((e) => {
1409
+ if (e.screenTemplate !== lr || n.has(lr)) return e;
1410
+ let t = dr(e), r = P(`confirm-dialog-${e.name}`, cr, {
1411
+ title: e.name,
1412
+ decisions: t
1413
+ });
1414
+ return {
1415
+ ...e,
1416
+ screenTemplate: void 0,
1417
+ slotContent: { content: [r] },
1418
+ forms: []
1419
+ };
1420
+ });
1421
+ }
1422
+ function dr(e) {
1423
+ let t = [];
1424
+ for (let n of fr(Object.values(e.slotContent).flat())) {
1425
+ let r = pr(n.properties.command);
1426
+ r && !t.some((e) => e.command === r) && t.push({
1427
+ command: r,
1428
+ label: pr(n.properties.label),
1429
+ navigateToScreen: pr(n.properties.navigateToScreen),
1430
+ typeName: pr(n.properties.typeName),
1431
+ route: pr(n.properties.route),
1432
+ form: e.forms.find((e) => e.forCommand === r)
1433
+ });
1434
+ }
1435
+ return t;
1436
+ }
1437
+ function fr(e) {
1438
+ return e.flatMap((e) => {
1439
+ let t = e;
1440
+ return t.componentName === "core:action" ? [t] : fr(Object.values(t.slots ?? {}).flat());
1441
+ });
1442
+ }
1443
+ function pr(e) {
1444
+ return typeof e == "string" && e !== "" ? e : void 0;
1445
+ }
1446
+ //#endregion
1447
+ //#region src/StageConfirmDialog.tsx
1448
+ function mr({ element: e }) {
1449
+ let { routes: t, parameters: n, selections: r } = B(), [a, o] = c(), l = s(null), u = typeof e.properties.title == "string" ? e.properties.title : "", d = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], f = d.find((e) => e.command === a), p = Object.values(r).filter((e) => e !== void 0);
1450
+ return i(() => l.current?.focus(), []), /* @__PURE__ */ I("section", {
1451
+ className: "scene-slice-dialog stage-confirm-dialog",
1452
+ role: "dialog",
1453
+ "aria-label": q(u),
1454
+ "data-stage-component": cr,
1455
+ children: [
1456
+ /* @__PURE__ */ F("header", {
1457
+ className: "scene-slice-dialog-header",
1458
+ children: /* @__PURE__ */ F("h2", {
1459
+ className: "scene-slice-dialog-title",
1460
+ children: q(u)
1461
+ })
1462
+ }),
1463
+ /* @__PURE__ */ F("div", {
1464
+ className: "stage-confirm-dialog__decisions",
1465
+ children: d.map((e, t) => /* @__PURE__ */ F("button", {
1466
+ ref: t === 0 ? l : void 0,
1467
+ type: "button",
1468
+ "aria-pressed": e.command === a,
1469
+ onClick: () => o(e.command),
1470
+ children: hr(e)
1471
+ }, e.command))
1472
+ }),
1473
+ f && /* @__PURE__ */ F(xn, { element: vr(f, t?.commandSchemas?.[f.command] ?? "", n, p) }, f.command)
1474
+ ]
1475
+ });
1476
+ }
1477
+ function hr(e) {
1478
+ return e.label ?? q(e.command);
1479
+ }
1480
+ function gr(e, t, n) {
1481
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || Nn(e, n) !== void 0;
1482
+ }
1483
+ function _r(e, t, n, r) {
1484
+ let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
1485
+ name: e.name,
1486
+ label: e.name
1487
+ })), o = new Set(t.filter((e) => gr(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
1488
+ return [...s, ...l.map((e) => ({
1489
+ name: e.name,
1490
+ label: q(e.name)
1491
+ }))];
1492
+ }
1493
+ function vr(e, t, n, r) {
1494
+ let i = _r(e, K(t), n, r);
1495
+ return {
1496
+ id: `confirm-${e.command}`,
1497
+ componentName: cr,
1498
+ properties: {
1499
+ command: e.command,
1500
+ label: hr(e),
1501
+ submitLabel: "Confirm",
1502
+ typeName: e.typeName,
1503
+ route: e.route,
1504
+ navigateToScreen: e.navigateToScreen,
1505
+ schema: t || void 0,
1506
+ generationMode: i.length === 0 ? d.Manual : e.form?.generationMode,
1507
+ layout: e.form?.layout,
1508
+ populateSource: e.form?.populateSource,
1509
+ fields: i
1510
+ },
1511
+ slots: {}
1512
+ };
1513
+ }
1514
+ //#endregion
1387
1515
  //#region src/stageComponents.tsx
1388
- var nr = "Stage:commandForm";
1389
- function X(e, t, n = {}) {
1516
+ var yr = "Stage:commandForm";
1517
+ function br(e, t, n = {}) {
1390
1518
  return {
1391
1519
  id: e,
1392
1520
  componentName: "",
@@ -1398,15 +1526,15 @@ function Z(e, t, n = "") {
1398
1526
  let r = e.properties[t];
1399
1527
  return typeof r == "string" ? r : n;
1400
1528
  }
1401
- function rr(e, t) {
1529
+ function xr(e, t) {
1402
1530
  let n = e.properties.queryArguments;
1403
- if (!sr(n)) return {
1531
+ if (!Tr(n)) return {
1404
1532
  values: {},
1405
1533
  ready: !0
1406
1534
  };
1407
1535
  let r = {}, i = !0;
1408
1536
  for (let [e, a] of Object.entries(n)) {
1409
- let n = or(a) ? t.resolveBinding(a) : a;
1537
+ let n = wr(a) ? t.resolveBinding(a) : a;
1410
1538
  r[e] = n, (n == null || n === "") && (i = !1);
1411
1539
  }
1412
1540
  return {
@@ -1414,7 +1542,7 @@ function rr(e, t) {
1414
1542
  ready: i
1415
1543
  };
1416
1544
  }
1417
- function ir(e, t) {
1545
+ function Sr(e, t) {
1418
1546
  let n = (e.slots.columns ?? []).map((e) => {
1419
1547
  let t = e.properties;
1420
1548
  return {
@@ -1430,14 +1558,14 @@ function ir(e, t) {
1430
1558
  function Q(e, t) {
1431
1559
  return e[t] ?? e.id ?? e.key;
1432
1560
  }
1433
- function ar({ element: e, slots: t }) {
1434
- let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), a = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), s = o(() => rr(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
1561
+ function Cr({ element: e, slots: t }) {
1562
+ let n = B(), r = Z(e, "query", Z(e, "typeName", e.id)), a = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), s = o(() => xr(e, n), [n, e]), { rows: c, error: l, loading: u } = V({
1435
1563
  scope: e.id,
1436
1564
  name: r,
1437
1565
  route: a || void 0,
1438
1566
  arguments: s.values,
1439
1567
  ready: s.ready
1440
- }), d = ir(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = tr(e);
1568
+ }), d = Sr(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = sr(e);
1441
1569
  i(() => {
1442
1570
  if (!h) return;
1443
1571
  let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
@@ -1478,15 +1606,15 @@ function ar({ element: e, slots: t }) {
1478
1606
  ...f && f !== n.screen ? {} : n.parameters,
1479
1607
  [p]: String(r)
1480
1608
  };
1481
- (!f || f === n.screen) && n.selectRow(e.id, t), W(f || n.screen, i);
1609
+ (!f || f === n.screen) && n.selectRow(e.id, t), G(f || n.screen, i);
1482
1610
  return;
1483
1611
  }
1484
1612
  n.selectRow(e.id, t);
1485
1613
  };
1486
- return !Z(e, "query") && !a && !st(r) ? /* @__PURE__ */ F("section", {
1614
+ return !Z(e, "query") && !a && !ut(r) ? /* @__PURE__ */ I("section", {
1487
1615
  className: "stage-table",
1488
1616
  "data-scene-id": e.id,
1489
- children: [/* @__PURE__ */ F("p", {
1617
+ children: [/* @__PURE__ */ I("p", {
1490
1618
  className: "stage-note",
1491
1619
  children: [
1492
1620
  "No query is exposed for ",
@@ -1494,40 +1622,40 @@ function ar({ element: e, slots: t }) {
1494
1622
  " yet."
1495
1623
  ]
1496
1624
  }), t.columns]
1497
- }) : /* @__PURE__ */ F("section", {
1625
+ }) : /* @__PURE__ */ I("section", {
1498
1626
  className: "stage-table",
1499
1627
  "data-scene-id": e.id,
1500
1628
  children: [
1501
- u && /* @__PURE__ */ P(Ne, {
1502
- element: X(`${e.id}-loading`, {
1629
+ u && /* @__PURE__ */ F(Fe, {
1630
+ element: br(`${e.id}-loading`, {
1503
1631
  severity: "info",
1504
1632
  text: "Loading…"
1505
1633
  }),
1506
1634
  slots: {}
1507
1635
  }),
1508
- l && /* @__PURE__ */ P(Ne, {
1509
- element: X(`${e.id}-error`, {
1636
+ l && /* @__PURE__ */ F(Fe, {
1637
+ element: br(`${e.id}-error`, {
1510
1638
  severity: "error",
1511
1639
  text: l
1512
1640
  }),
1513
1641
  slots: {}
1514
1642
  }),
1515
- h && /* @__PURE__ */ P(I, {
1643
+ h && /* @__PURE__ */ F(L, {
1516
1644
  type: "button",
1517
1645
  size: "small",
1518
1646
  onClick: () => {
1519
1647
  if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
1520
1648
  let { [p]: t, ...r } = n.parameters;
1521
- W(n.screen, r);
1649
+ G(n.screen, r);
1522
1650
  },
1523
1651
  children: "Clear selection"
1524
1652
  }),
1525
- /* @__PURE__ */ F("table", {
1653
+ /* @__PURE__ */ I("table", {
1526
1654
  "aria-label": Z(e, "label", Z(e, "typeName", "Results")),
1527
- children: [/* @__PURE__ */ P("thead", { children: /* @__PURE__ */ P("tr", { children: d.map((e) => /* @__PURE__ */ P("th", {
1655
+ children: [/* @__PURE__ */ F("thead", { children: /* @__PURE__ */ F("tr", { children: d.map((e) => /* @__PURE__ */ F("th", {
1528
1656
  scope: "col",
1529
1657
  children: e.label
1530
- }, e.property)) }) }), /* @__PURE__ */ F("tbody", { children: [c.map((e, t) => /* @__PURE__ */ P("tr", {
1658
+ }, e.property)) }) }), /* @__PURE__ */ I("tbody", { children: [c.map((e, t) => /* @__PURE__ */ F("tr", {
1531
1659
  "aria-selected": h === e,
1532
1660
  tabIndex: 0,
1533
1661
  onClick: () => _.click(e, () => v(e)),
@@ -1535,8 +1663,8 @@ function ar({ element: e, slots: t }) {
1535
1663
  onKeyDown: (t) => {
1536
1664
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
1537
1665
  },
1538
- children: d.map((t) => /* @__PURE__ */ P("td", { children: String(e[t.property] ?? "") }, t.property))
1539
- }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ P("tr", { children: /* @__PURE__ */ P("td", {
1666
+ children: d.map((t) => /* @__PURE__ */ F("td", { children: String(e[t.property] ?? "") }, t.property))
1667
+ }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ F("tr", { children: /* @__PURE__ */ F("td", {
1540
1668
  colSpan: Math.max(d.length, 1),
1541
1669
  children: "No records found"
1542
1670
  }) })] })]
@@ -1544,28 +1672,28 @@ function ar({ element: e, slots: t }) {
1544
1672
  ]
1545
1673
  });
1546
1674
  }
1547
- function or(e) {
1548
- return sr(e) && (typeof e.path == "string" || typeof e.kind == "string");
1675
+ function wr(e) {
1676
+ return Tr(e) && (typeof e.path == "string" || typeof e.kind == "string");
1549
1677
  }
1550
- function sr(e) {
1678
+ function Tr(e) {
1551
1679
  return typeof e == "object" && !!e && !Array.isArray(e);
1552
1680
  }
1553
- function cr({ element: e, interactions: t, slots: n }) {
1554
- return Zn(e) ? /* @__PURE__ */ P(er, {
1681
+ function Er({ element: e, interactions: t, slots: n }) {
1682
+ return rr(e) ? /* @__PURE__ */ F(or, {
1555
1683
  element: e,
1556
1684
  interactions: t
1557
- }) : /* @__PURE__ */ P(lr, {
1685
+ }) : /* @__PURE__ */ F(Dr, {
1558
1686
  element: e,
1559
1687
  interactions: t,
1560
1688
  slots: n
1561
1689
  });
1562
1690
  }
1563
- function lr({ element: e, interactions: t }) {
1691
+ function Dr({ element: e, interactions: t }) {
1564
1692
  let n = Z(e, "label", Z(e, "command"));
1565
- return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(ur, {
1693
+ return W(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ F(Or, {
1566
1694
  element: e,
1567
1695
  label: n
1568
- }) : /* @__PURE__ */ P(I, {
1696
+ }) : /* @__PURE__ */ F(L, {
1569
1697
  type: "button",
1570
1698
  "data-scene-id": e.id,
1571
1699
  disabled: !0,
@@ -1574,16 +1702,16 @@ function lr({ element: e, interactions: t }) {
1574
1702
  children: n
1575
1703
  });
1576
1704
  }
1577
- function ur({ element: e, label: t }) {
1578
- let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(vn.Provider, {
1705
+ function Or({ element: e, label: t }) {
1706
+ let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ F(bn.Provider, {
1579
1707
  value: a,
1580
- children: /* @__PURE__ */ P(yn, { element: e })
1708
+ children: /* @__PURE__ */ F(xn, { element: e })
1581
1709
  });
1582
- return /* @__PURE__ */ P("div", {
1710
+ return /* @__PURE__ */ F("div", {
1583
1711
  className: "stage-action",
1584
1712
  "data-scene-id": e.id,
1585
- children: /* @__PURE__ */ P(Me, {
1586
- element: X(e.id, {
1713
+ children: /* @__PURE__ */ F(Pe, {
1714
+ element: br(e.id, {
1587
1715
  visible: !1,
1588
1716
  header: t,
1589
1717
  triggerLabel: t
@@ -1592,41 +1720,41 @@ function ur({ element: e, label: t }) {
1592
1720
  }, r)
1593
1721
  });
1594
1722
  }
1595
- function dr(e) {
1596
- let t = e.element ?? X("slice-dialog", {}), r = oe(), { routes: i, parameters: a } = z(), s = k(r?.currentDialogParameters), c = Z(t, "command") || s?.command || Z(t, "slice") || "", l = Z(t, "title") || s?.title || c, u = i?.commandSchemas?.[c], d = o(() => $t(u ?? ""), [u]), f = n(() => r?.closeDialog(), [r]);
1597
- if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ P(S, {
1723
+ function kr(e) {
1724
+ let t = e.element ?? br("slice-dialog", {}), r = A(), { routes: i, parameters: a } = B(), s = se(r?.currentDialogParameters), c = Z(t, "command") || s?.command || Z(t, "slice") || "", l = Z(t, "title") || s?.title || c, u = i?.commandSchemas?.[c], d = o(() => K(u ?? ""), [u]), f = n(() => r?.closeDialog(), [r]);
1725
+ if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ F(S, {
1598
1726
  element: e.element,
1599
1727
  slots: e.slots ?? {}
1600
- }) : /* @__PURE__ */ P(ne, {});
1601
- let p = d.filter((e) => !kn(e, a)), m = X(`slice-dialog-${c}`, {
1728
+ }) : /* @__PURE__ */ F(re, {});
1729
+ let p = d.filter((e) => !jn(e, a)), m = br(`slice-dialog-${c}`, {
1602
1730
  command: c,
1603
1731
  label: l,
1604
1732
  schema: u,
1605
1733
  fields: p.map((e) => ({
1606
1734
  name: e.name,
1607
- label: G(e.name)
1735
+ label: q(e.name)
1608
1736
  })),
1609
1737
  generationMode: "manual"
1610
1738
  });
1611
- return /* @__PURE__ */ F("section", {
1739
+ return /* @__PURE__ */ I("section", {
1612
1740
  className: "scene-slice-dialog",
1613
1741
  "data-scene-slice-dialog": Z(t, "slice") || s?.slice,
1614
1742
  "data-scene-command": c,
1615
1743
  children: [
1616
- /* @__PURE__ */ P("header", {
1744
+ /* @__PURE__ */ F("header", {
1617
1745
  className: "scene-slice-dialog-header",
1618
- children: /* @__PURE__ */ P("h2", {
1746
+ children: /* @__PURE__ */ F("h2", {
1619
1747
  className: "scene-slice-dialog-title",
1620
1748
  children: l
1621
1749
  })
1622
1750
  }),
1623
- /* @__PURE__ */ P(vn.Provider, {
1751
+ /* @__PURE__ */ F(bn.Provider, {
1624
1752
  value: f,
1625
- children: /* @__PURE__ */ P(yn, { element: m })
1753
+ children: /* @__PURE__ */ F(xn, { element: m })
1626
1754
  }),
1627
- /* @__PURE__ */ P("footer", {
1755
+ /* @__PURE__ */ F("footer", {
1628
1756
  className: "scene-slice-dialog-footer",
1629
- children: /* @__PURE__ */ P("button", {
1757
+ children: /* @__PURE__ */ F("button", {
1630
1758
  type: "button",
1631
1759
  className: "scene-slice-dialog-cancel",
1632
1760
  onClick: f,
@@ -1636,39 +1764,58 @@ function dr(e) {
1636
1764
  ]
1637
1765
  });
1638
1766
  }
1639
- function fr(e) {
1767
+ function Ar(e) {
1640
1768
  let { element: t } = e;
1641
- if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ P(C, { ...e });
1642
- let n = Z(t, "name", t.id), r = {
1769
+ return Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "" ? /* @__PURE__ */ F(C, { ...e }) : /* @__PURE__ */ F(jr, { ...e });
1770
+ }
1771
+ function jr(e) {
1772
+ let { element: t } = e, { routes: n, parameters: r, queries: i, selections: a } = B(), s = Z(t, "name", t.id), c = Z(t, "target"), l = Z(t, "label", s), u = n?.commandSchemas?.[c], d = o(() => K(u ?? ""), [u]), f = o(() => Fn(i), [i]), p = In(d, r, o(() => Object.values(a).filter((e) => e !== void 0), [a]), f), m = d.filter((e) => !jn(e, r) && !(e.identifier && e.required && Pn(e, f))), h = u ? {
1773
+ schema: u,
1774
+ fields: m.map((e) => ({
1775
+ name: e.name,
1776
+ label: q(e.name)
1777
+ })),
1778
+ generationMode: "manual"
1779
+ } : {}, g = {
1643
1780
  ...t,
1644
1781
  componentName: "core:action",
1645
1782
  properties: {
1646
- command: Z(t, "target"),
1647
- label: Z(t, "label", n)
1783
+ command: c,
1784
+ label: l,
1785
+ rowAction: !0,
1786
+ ...h
1648
1787
  }
1649
1788
  };
1650
- return /* @__PURE__ */ P("span", {
1789
+ return /* @__PURE__ */ F("span", {
1651
1790
  className: "stage-toolbar-action",
1652
- "data-scene-toolbar-item": n,
1653
- children: /* @__PURE__ */ P(cr, {
1654
- element: r,
1791
+ "data-scene-toolbar-item": s,
1792
+ children: p.length > 0 ? /* @__PURE__ */ F(L, {
1793
+ type: "button",
1794
+ "data-scene-id": t.id,
1795
+ disabled: !0,
1796
+ title: "Select a row first",
1797
+ ...e.interactions,
1798
+ children: l
1799
+ }) : /* @__PURE__ */ F(Er, {
1800
+ element: g,
1655
1801
  interactions: e.interactions,
1656
1802
  slots: e.slots
1657
1803
  })
1658
1804
  });
1659
1805
  }
1660
- var pr = {
1661
- ...D,
1662
- "core:table": ar,
1663
- "core:action": cr,
1664
- "core:toolbarItem": fr,
1665
- "core:sliceDialog": dr,
1666
- [nr]: yn
1806
+ var Mr = {
1807
+ ...O,
1808
+ "core:table": Cr,
1809
+ "core:action": Er,
1810
+ "core:toolbarItem": Ar,
1811
+ "core:sliceDialog": kr,
1812
+ [yr]: xn,
1813
+ [cr]: mr
1667
1814
  };
1668
1815
  //#endregion
1669
1816
  //#region src/useStrings.ts
1670
- function mr() {
1671
- let e = Qe(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
1817
+ function Nr() {
1818
+ let e = tt(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
1672
1819
  return i(() => {
1673
1820
  let t = new AbortController();
1674
1821
  return e.locales(t.signal).then((e) => {
@@ -1685,11 +1832,11 @@ function mr() {
1685
1832
  dictionary: o
1686
1833
  };
1687
1834
  }
1688
- var hr = /* @__PURE__ */ new Set(["core:table"]);
1689
- function gr(e) {
1690
- return _r(e, /* @__PURE__ */ new Map(), void 0);
1835
+ var Pr = /* @__PURE__ */ new Set(["core:table"]);
1836
+ function Fr(e) {
1837
+ return Ir(e, /* @__PURE__ */ new Map(), void 0);
1691
1838
  }
1692
- function _r(e, t, n) {
1839
+ function Ir(e, t, n) {
1693
1840
  let r = e;
1694
1841
  if (!r.slots) return e;
1695
1842
  let i = !1, a = {};
@@ -1698,7 +1845,7 @@ function _r(e, t, n) {
1698
1845
  a[e] = o.map((e) => {
1699
1846
  let t = e, n = $(t, "typeName");
1700
1847
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
1701
- let a = _r(yr(vr(t, r), s), r, s);
1848
+ let a = Ir(Rr(Lr(t, r), s), r, s);
1702
1849
  return a !== e && (i = !0), a;
1703
1850
  });
1704
1851
  }
@@ -1707,8 +1854,8 @@ function _r(e, t, n) {
1707
1854
  slots: a
1708
1855
  } : e;
1709
1856
  }
1710
- function vr(e, t) {
1711
- if (!hr.has(e.componentName)) return e;
1857
+ function Lr(e, t) {
1858
+ if (!Pr.has(e.componentName)) return e;
1712
1859
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
1713
1860
  if (!r || e.properties.queryArguments !== void 0) return e;
1714
1861
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -1717,7 +1864,7 @@ function vr(e, t) {
1717
1864
  properties: a
1718
1865
  };
1719
1866
  }
1720
- function yr(e, t) {
1867
+ function Rr(e, t) {
1721
1868
  if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
1722
1869
  let n = { ...e.properties };
1723
1870
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -1736,7 +1883,7 @@ function $(e, t) {
1736
1883
  }
1737
1884
  //#endregion
1738
1885
  //#region src/stageQueryBindings.tsx
1739
- function br(e) {
1886
+ function zr(e) {
1740
1887
  let t = /* @__PURE__ */ new Set(), n = (e) => {
1741
1888
  if (Array.isArray(e)) {
1742
1889
  e.forEach(n);
@@ -1756,7 +1903,7 @@ function br(e) {
1756
1903
  };
1757
1904
  return r(e), [...t];
1758
1905
  }
1759
- function xr(e) {
1906
+ function Br(e) {
1760
1907
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
1761
1908
  let n = e.properties?.[t];
1762
1909
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -1775,8 +1922,8 @@ function xr(e) {
1775
1922
  };
1776
1923
  return r(e), [...t.values()];
1777
1924
  }
1778
- function Sr({ source: e }) {
1779
- let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, s = o(() => e.by ? a ? { [e.by]: a } : {} : {
1925
+ function Vr({ source: e }) {
1926
+ let { routes: t, routesReady: n, parameters: r, session: i } = B(), a = e.by ? r[e.by] || i[e.by] : void 0, s = o(() => e.by ? a ? { [e.by]: a } : {} : {
1780
1927
  ...i,
1781
1928
  ...r
1782
1929
  }, [
@@ -1785,7 +1932,7 @@ function Sr({ source: e }) {
1785
1932
  i,
1786
1933
  e.by
1787
1934
  ]);
1788
- return B({
1935
+ return V({
1789
1936
  scope: `data:${e.typeName}`,
1790
1937
  name: e.query,
1791
1938
  alias: e.typeName,
@@ -1795,12 +1942,12 @@ function Sr({ source: e }) {
1795
1942
  list: !0
1796
1943
  }), null;
1797
1944
  }
1798
- function Cr({ name: e }) {
1799
- let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = o(() => ({
1945
+ function Hr({ name: e }) {
1946
+ let { routes: t, routesReady: n, parameters: r, session: i } = B(), a = o(() => ({
1800
1947
  ...i,
1801
1948
  ...r
1802
1949
  }), [r, i]);
1803
- return B({
1950
+ return V({
1804
1951
  scope: `binding:${e}`,
1805
1952
  name: e,
1806
1953
  route: t?.queries?.[e],
@@ -1809,11 +1956,11 @@ function Cr({ name: e }) {
1809
1956
  list: !0
1810
1957
  }), null;
1811
1958
  }
1812
- function wr({ element: e }) {
1813
- let t = o(() => br(e), [e]), n = o(() => xr(e), [e]);
1814
- return /* @__PURE__ */ F(je, { children: [t.map((e) => /* @__PURE__ */ P(Cr, { name: e }, e)), n.map((e) => /* @__PURE__ */ P(Sr, { source: e }, e.typeName))] });
1959
+ function Ur({ element: e }) {
1960
+ let t = o(() => zr(e), [e]), n = o(() => Br(e), [e]);
1961
+ return /* @__PURE__ */ I(Ne, { children: [t.map((e) => /* @__PURE__ */ F(Hr, { name: e }, e)), n.map((e) => /* @__PURE__ */ F(Vr, { source: e }, e.typeName))] });
1815
1962
  }
1816
- function Tr(e) {
1963
+ function Wr(e) {
1817
1964
  let t = /* @__PURE__ */ new Set(), n = [];
1818
1965
  for (let r of e) for (let e of r.contributions ?? []) {
1819
1966
  if (e.contributionPointName !== "Navigation") continue;
@@ -1826,7 +1973,7 @@ function Tr(e) {
1826
1973
  ]);
1827
1974
  if (t.has(s)) continue;
1828
1975
  t.add(s);
1829
- let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = Or(r.destination) ? r.destination : void 0;
1976
+ let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = qr(r.destination) ? r.destination : void 0;
1830
1977
  n.push({
1831
1978
  label: i,
1832
1979
  targetScreen: a,
@@ -1834,7 +1981,7 @@ function Tr(e) {
1834
1981
  order: c,
1835
1982
  ...typeof r.icon == "string" ? { icon: r.icon } : {},
1836
1983
  ...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
1837
- ...l && kr(l) ? { destination: l } : {}
1984
+ ...l && Jr(l) ? { destination: l } : {}
1838
1985
  });
1839
1986
  }
1840
1987
  return n.map((e, t) => ({
@@ -1842,7 +1989,7 @@ function Tr(e) {
1842
1989
  index: t
1843
1990
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
1844
1991
  }
1845
- function Er(e) {
1992
+ function Gr(e) {
1846
1993
  let t = {
1847
1994
  label: "",
1848
1995
  children: []
@@ -1867,21 +2014,21 @@ function Er(e) {
1867
2014
  }
1868
2015
  return t.children;
1869
2016
  }
1870
- function Dr(e, t) {
2017
+ function Kr(e, t) {
1871
2018
  for (let n of e) {
1872
2019
  if (n.screen === t) return [n.label];
1873
- let e = Dr(n.children, t);
2020
+ let e = Kr(n.children, t);
1874
2021
  if (e.length > 0) return [n.label, ...e];
1875
2022
  }
1876
2023
  return [];
1877
2024
  }
1878
- function Or(e) {
2025
+ function qr(e) {
1879
2026
  return typeof e == "object" && !!e && !Array.isArray(e);
1880
2027
  }
1881
- function kr(e) {
2028
+ function Jr(e) {
1882
2029
  return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
1883
2030
  }
1884
- function Ar(e, t, n) {
2031
+ function Yr(e, t, n) {
1885
2032
  return e.filter((e) => !t.has(e.name)).map((e) => ({
1886
2033
  label: e.name,
1887
2034
  targetScreen: e.name,
@@ -1890,77 +2037,77 @@ function Ar(e, t, n) {
1890
2037
  }
1891
2038
  //#endregion
1892
2039
  //#region src/blueprint.ts
1893
- var jr = "Stage:locale";
1894
- function Mr(e) {
1895
- let t = Ce(e), n = t.packages.filter((e) => e !== "PrimeReact");
1896
- return n.splice(Math.max(n.indexOf(he), 0), 0, "PrimeReact"), {
2040
+ var Xr = "Stage:locale";
2041
+ function Zr(e) {
2042
+ let t = Te(e), n = t.packages.filter((e) => e !== "PrimeReact");
2043
+ return n.splice(Math.max(n.indexOf(_e), 0), 0, "PrimeReact"), {
1897
2044
  ...t,
1898
2045
  name: e?.length ? t.name : "Stage",
1899
2046
  packages: n
1900
2047
  };
1901
2048
  }
1902
- var Nr = {
1903
- ...fe,
1904
- PrimeReact: Fe.components
2049
+ var Qr = {
2050
+ ...me,
2051
+ PrimeReact: Le.components
1905
2052
  };
1906
- function Pr(e) {
2053
+ function $r(e) {
1907
2054
  return {
1908
- ...D,
1909
- ...Pe,
1910
- ...me,
1911
- ...Se,
2055
+ ...O,
2056
+ ...Ie,
2057
+ ...ge,
2058
+ ...we,
1912
2059
  ...e
1913
2060
  };
1914
2061
  }
1915
- function Fr(e) {
2062
+ function ei(e) {
1916
2063
  return e ? {
1917
2064
  ...e,
1918
- ...Nr
1919
- } : Nr;
2065
+ ...Qr
2066
+ } : Qr;
1920
2067
  }
1921
- var Ir = "Stage:navigationTree";
1922
- function Lr(e, t, n) {
1923
- return N(e, j.Logo, {
2068
+ var ti = "Stage:navigationTree";
2069
+ function ni(e, t, n) {
2070
+ return P(e, M.Logo, {
1924
2071
  label: t,
1925
2072
  initials: t.slice(0, 1).toUpperCase() || "S",
1926
2073
  targetScreen: "",
1927
2074
  ...n ? { lightImageUrl: n } : {}
1928
2075
  });
1929
2076
  }
1930
- function Rr(e, t, n, r, i, a = !1, o = !0) {
1931
- let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Tr(e), u = Ar(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = Er([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => xe({
2077
+ function ri(e, t, n, r, i, a = !1, o = !0) {
2078
+ let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Wr(e), u = Yr(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = Gr([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => Ce({
1932
2079
  label: e.name,
1933
2080
  targetScreen: e.name,
1934
2081
  icon: "pi pi-table",
1935
2082
  group: "Screens",
1936
2083
  order: n
1937
- }, t)), p = Dr(Er(l), t), m = e.find((e) => e.name === t)?.path?.length ? Dr(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", Ir, {
2084
+ }, t)), p = Kr(Gr(l), t), m = e.find((e) => e.name === t)?.path?.length ? Kr(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? P("menu-hierarchy", ti, {
1938
2085
  nodes: d,
1939
2086
  activeScreen: t
1940
- }) : N("menu-screens", j.Menu, {
2087
+ }) : P("menu-screens", M.Menu, {
1941
2088
  title: "Screens",
1942
2089
  label: "Screens"
1943
2090
  }, { items: f }), _ = [];
1944
- n.length > 1 && _.push(N("topbar-locale", jr, {
2091
+ n.length > 1 && _.push(P("topbar-locale", Xr, {
1945
2092
  locales: n,
1946
2093
  locale: r
1947
- })), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
2094
+ })), _.push(P("topbar-theme", M.ThemeSwitcher, { label: "Theme" }));
1948
2095
  let v = { regionNavigation: a };
1949
2096
  return {
1950
- [M.Topbar]: [N("topbar", j.Topbar, v, {
1951
- logo: [Lr("topbar-logo", c, i?.image)],
2097
+ [N.Topbar]: [P("topbar", M.Topbar, v, {
2098
+ logo: [ni("topbar-logo", c, i?.image)],
1952
2099
  end: _
1953
2100
  })],
1954
- [M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [Lr("sidebar-logo", c, i?.image)] })],
1955
- ...a ? {} : { [M.Menu]: [g] },
1956
- [M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
2101
+ [N.Sidebar]: [P("sidebar", M.Sidebar, v, { logo: [ni("sidebar-logo", c, i?.image)] })],
2102
+ ...a ? {} : { [N.Menu]: [g] },
2103
+ [N.Breadcrumb]: [P("breadcrumb", M.Breadcrumb, {
1957
2104
  homeTargetScreen: s,
1958
2105
  items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
1959
2106
  })],
1960
- ...o ? { [M.Footer]: [N("footer", j.Footer, { text: `${c} · rendered from your model` })] } : {},
1961
- [M.ConfigPanel]: [N(j.ConfigPanel, j.ConfigPanel, {
2107
+ ...o ? { [N.Footer]: [P("footer", M.Footer, { text: `${c} · rendered from your model` })] } : {},
2108
+ [N.ConfigPanel]: [P(M.ConfigPanel, M.ConfigPanel, {
1962
2109
  title: "Settings",
1963
- themes: ge.map((e) => ({
2110
+ themes: ve.map((e) => ({
1964
2111
  name: e.name,
1965
2112
  label: e.name,
1966
2113
  isDark: e.isDark ?? !1
@@ -1968,65 +2115,65 @@ function Rr(e, t, n, r, i, a = !1, o = !0) {
1968
2115
  })]
1969
2116
  };
1970
2117
  }
1971
- function zr(e) {
2118
+ function ii(e) {
1972
2119
  return `#/${encodeURIComponent(e)}`;
1973
2120
  }
1974
2121
  //#endregion
1975
2122
  //#region src/StageChrome.tsx
1976
- var Br = e({
2123
+ var ai = e({
1977
2124
  locales: [],
1978
2125
  locale: "",
1979
2126
  setLocale: () => void 0,
1980
2127
  activity: ""
1981
2128
  });
1982
- function Vr({ state: e, children: t }) {
1983
- return /* @__PURE__ */ P(Br.Provider, {
2129
+ function oi({ state: e, children: t }) {
2130
+ return /* @__PURE__ */ F(ai.Provider, {
1984
2131
  value: e,
1985
2132
  children: t
1986
2133
  });
1987
2134
  }
1988
- var Hr = "Stage:activity";
1989
- function Ur() {
1990
- let { locales: e, locale: t, setLocale: n } = r(Br);
1991
- return e.length < 2 ? null : /* @__PURE__ */ P("select", {
2135
+ var si = "Stage:activity";
2136
+ function ci() {
2137
+ let { locales: e, locale: t, setLocale: n } = r(ai);
2138
+ return e.length < 2 ? null : /* @__PURE__ */ F("select", {
1992
2139
  className: "stage-locale",
1993
2140
  "aria-label": "Locale",
1994
2141
  value: t,
1995
2142
  onChange: (e) => n(e.target.value),
1996
- children: e.map((e) => /* @__PURE__ */ P("option", {
2143
+ children: e.map((e) => /* @__PURE__ */ F("option", {
1997
2144
  value: e,
1998
2145
  children: e
1999
2146
  }, e))
2000
2147
  });
2001
2148
  }
2002
- function Wr({ element: e }) {
2149
+ function li({ element: e }) {
2003
2150
  let t = e.properties ?? {};
2004
- return /* @__PURE__ */ P("nav", {
2151
+ return /* @__PURE__ */ F("nav", {
2005
2152
  className: "stage-navigation-tree",
2006
2153
  "aria-label": "Navigation",
2007
2154
  "data-scene-id": e.id,
2008
- children: /* @__PURE__ */ P(Gr, {
2155
+ children: /* @__PURE__ */ F(ui, {
2009
2156
  nodes: t.nodes ?? [],
2010
2157
  activeScreen: t.activeScreen
2011
2158
  })
2012
2159
  });
2013
2160
  }
2014
- function Gr({ nodes: e, activeScreen: t }) {
2015
- return /* @__PURE__ */ P("ul", {
2161
+ function ui({ nodes: e, activeScreen: t }) {
2162
+ return /* @__PURE__ */ F("ul", {
2016
2163
  role: "tree",
2017
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
2164
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ I("li", {
2018
2165
  role: "treeitem",
2019
2166
  "aria-expanded": "true",
2020
- children: [/* @__PURE__ */ P("span", {
2167
+ children: [/* @__PURE__ */ F("span", {
2021
2168
  className: "stage-navigation-group",
2022
2169
  children: e.label
2023
- }), /* @__PURE__ */ P(Gr, {
2170
+ }), /* @__PURE__ */ F(ui, {
2024
2171
  nodes: e.children,
2025
2172
  activeScreen: t
2026
2173
  })]
2027
- }, e.label) : /* @__PURE__ */ P("li", {
2174
+ }, e.label) : /* @__PURE__ */ F("li", {
2028
2175
  role: "treeitem",
2029
- children: /* @__PURE__ */ P(Kr, {
2176
+ children: /* @__PURE__ */ F(di, {
2030
2177
  node: e,
2031
2178
  screen: e.screen,
2032
2179
  activeScreen: t
@@ -2034,56 +2181,56 @@ function Gr({ nodes: e, activeScreen: t }) {
2034
2181
  }, `${e.screen}:${e.label}`))
2035
2182
  });
2036
2183
  }
2037
- function Kr({ node: e, screen: t, activeScreen: n }) {
2038
- let i = r(ee), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s && kr(o) ? (e) => {
2184
+ function di({ node: e, screen: t, activeScreen: n }) {
2185
+ let i = r(ne), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s && Jr(o) ? (e) => {
2039
2186
  e.preventDefault(), i.navigate(o);
2040
2187
  } : void 0;
2041
- return /* @__PURE__ */ F("a", {
2042
- href: s ? o.route : zr(t),
2188
+ return /* @__PURE__ */ I("a", {
2189
+ href: s ? o.route : ii(t),
2043
2190
  rel: s ? "noreferrer" : void 0,
2044
2191
  "aria-current": t === n ? "page" : void 0,
2045
2192
  "aria-label": a === "icon" ? e.label : void 0,
2046
2193
  "data-presentation": e.presentation,
2047
2194
  "data-icon": e.icon,
2048
2195
  onClick: c,
2049
- children: [a !== "text" && e.icon && /* @__PURE__ */ P("span", {
2196
+ children: [a !== "text" && e.icon && /* @__PURE__ */ F("span", {
2050
2197
  className: "stage-navigation-icon",
2051
2198
  "aria-hidden": "true",
2052
2199
  "data-icon-name": e.icon
2053
2200
  }), a !== "icon" && e.label]
2054
2201
  });
2055
2202
  }
2056
- function qr({ element: e }) {
2057
- let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(ee), i = ce(), a = z(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
2058
- return /* @__PURE__ */ F("div", {
2203
+ function fi({ element: e }) {
2204
+ let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(ne), i = ue(), a = B(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
2205
+ return /* @__PURE__ */ I("div", {
2059
2206
  "data-scene-outlet": t,
2060
2207
  "data-scene-outlet-screen": o,
2061
- children: [c && o && /* @__PURE__ */ P("div", {
2208
+ children: [c && o && /* @__PURE__ */ F("div", {
2062
2209
  className: "scene-outlet-bar",
2063
- children: /* @__PURE__ */ P("button", {
2210
+ children: /* @__PURE__ */ F("button", {
2064
2211
  type: "button",
2065
2212
  className: "scene-outlet-close",
2066
2213
  "aria-label": "Close",
2067
2214
  onClick: () => n?.closeOutlet(t),
2068
2215
  children: "Close"
2069
2216
  })
2070
- }), s && i && /* @__PURE__ */ P(T, {
2217
+ }), s && i && /* @__PURE__ */ F(T, {
2071
2218
  element: s,
2072
2219
  registry: i.registry,
2073
2220
  resolveBinding: a.resolveBinding
2074
2221
  })]
2075
2222
  });
2076
2223
  }
2077
- function Jr() {
2078
- let { activity: e } = r(Br);
2079
- return e ? /* @__PURE__ */ P("p", {
2224
+ function pi() {
2225
+ let { activity: e } = r(ai);
2226
+ return e ? /* @__PURE__ */ F("p", {
2080
2227
  className: "stage-activity",
2081
2228
  role: "status",
2082
2229
  children: e
2083
2230
  }) : null;
2084
2231
  }
2085
- function Yr() {
2086
- let e = A(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2232
+ function mi() {
2233
+ let e = j(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2087
2234
  return i(() => {
2088
2235
  let r = e?.isDark ? "dark" : "light";
2089
2236
  document.documentElement.setAttribute("data-scene-color-scheme", r), document.body.setAttribute("data-scene-color-scheme", r), document.body.style.backgroundColor = t ?? "", document.body.style.color = n ?? "";
@@ -2093,56 +2240,56 @@ function Yr() {
2093
2240
  n
2094
2241
  ]), null;
2095
2242
  }
2096
- var Xr = {
2097
- [jr]: Ur,
2098
- [Ir]: Wr,
2099
- [Hr]: Jr,
2100
- "core:outlet": qr
2101
- }, Zr = [
2243
+ var hi = {
2244
+ [Xr]: ci,
2245
+ [ti]: li,
2246
+ [si]: pi,
2247
+ "core:outlet": fi
2248
+ }, gi = [
2102
2249
  "navigationMode",
2103
2250
  "menuTheme",
2104
2251
  "showFooter"
2105
- ], Qr = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2106
- function $r(e, t, n = !1) {
2252
+ ], _i = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2253
+ function vi(e, t, n = !1) {
2107
2254
  let r = [], i = t.options ?? {}, a = {
2108
2255
  showFooter: !0,
2109
2256
  followsSystem: !1,
2110
2257
  problems: r
2111
2258
  };
2112
2259
  for (let [e, n] of Object.entries(i)) {
2113
- if (!Zr.includes(e)) {
2114
- r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Zr.join(", ")}.`);
2260
+ if (!gi.includes(e)) {
2261
+ r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${gi.join(", ")}.`);
2115
2262
  continue;
2116
2263
  }
2117
2264
  if (e === "navigationMode") {
2118
- let e = ye.find((e) => e === n);
2119
- e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ye.join(", ")}.`);
2265
+ let e = xe.find((e) => e === n);
2266
+ e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${xe.join(", ")}.`);
2120
2267
  } else if (e === "menuTheme") {
2121
- let e = be.find((e) => e === n);
2122
- e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${be.join(", ")}.`);
2268
+ let e = Se.find((e) => e === n);
2269
+ e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${Se.join(", ")}.`);
2123
2270
  } else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
2124
2271
  }
2125
2272
  let o = e?.appearance;
2126
2273
  if (o?.colorScheme !== void 0) {
2127
2274
  a.followsSystem = o.colorScheme === l.System;
2128
2275
  let e = a.followsSystem ? n : o.colorScheme === l.Dark;
2129
- a.colorScheme = e ? ue.Dark : ue.Light, a.themeName = ge.find((t) => (t.isDark ?? !1) === e)?.name;
2276
+ a.colorScheme = e ? fe.Dark : fe.Light, a.themeName = ve.find((t) => (t.isDark ?? !1) === e)?.name;
2130
2277
  }
2131
- return o?.accent !== void 0 && (Qr.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2278
+ return o?.accent !== void 0 && (_i.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2132
2279
  }
2133
- function ei(e, t) {
2280
+ function yi(e, t) {
2134
2281
  if (e?.root === void 0) return [];
2135
2282
  let n = /* @__PURE__ */ new Set([
2136
- m.RootTemplateUnknown,
2137
- m.RootTemplateVersionNotSatisfied,
2138
- m.RootTemplateNotApplicable,
2139
- m.RootTemplateMissingContentSlot,
2140
- m.RootTemplateCycle,
2141
- m.RootTemplateBlueprintNotInstalled
2283
+ h.RootTemplateUnknown,
2284
+ h.RootTemplateVersionNotSatisfied,
2285
+ h.RootTemplateNotApplicable,
2286
+ h.RootTemplateMissingContentSlot,
2287
+ h.RootTemplateCycle,
2288
+ h.RootTemplateBlueprintNotInstalled
2142
2289
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
2143
- return r.length === 0 && t.origin !== h.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
2290
+ return r.length === 0 && t.origin !== g.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
2144
2291
  }
2145
- function ti(e) {
2292
+ function bi(e) {
2146
2293
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
2147
2294
  0,
2148
2295
  2,
@@ -2150,7 +2297,7 @@ function ti(e) {
2150
2297
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
2151
2298
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
2152
2299
  }
2153
- function ni(e, t) {
2300
+ function xi(e, t) {
2154
2301
  if (t === void 0) return e;
2155
2302
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
2156
2303
  0,
@@ -2162,20 +2309,20 @@ function ni(e, t) {
2162
2309
  tokens: {
2163
2310
  ...e.tokens,
2164
2311
  "primary.color": t,
2165
- "primary.contrastColor": ti(t),
2312
+ "primary.contrastColor": bi(t),
2166
2313
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
2167
2314
  }
2168
2315
  }));
2169
2316
  }
2170
2317
  //#endregion
2171
2318
  //#region src/StageShellSettings.tsx
2172
- var ri = "(prefers-color-scheme: dark)";
2173
- function ii() {
2319
+ var Si = "(prefers-color-scheme: dark)";
2320
+ function Ci() {
2174
2321
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
2175
2322
  }
2176
- function ai({ settings: e, onSystemSchemeChange: t }) {
2177
- let n = s(we());
2178
- n.current = we();
2323
+ function wi({ settings: e, onSystemSchemeChange: t }) {
2324
+ let n = s(Ee());
2325
+ n.current = Ee();
2179
2326
  let { mode: r, menuTheme: a, colorScheme: o, themeName: c } = e;
2180
2327
  return i(() => {
2181
2328
  let { setMode: e, setMenuTheme: t, setColorScheme: i, setThemeName: s } = n.current;
@@ -2187,16 +2334,16 @@ function ai({ settings: e, onSystemSchemeChange: t }) {
2187
2334
  c
2188
2335
  ]), i(() => {
2189
2336
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
2190
- let n = globalThis.matchMedia(ri), r = (e) => t(e.matches);
2337
+ let n = globalThis.matchMedia(Si), r = (e) => t(e.matches);
2191
2338
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
2192
2339
  }, [e.followsSystem, t]), null;
2193
2340
  }
2194
2341
  //#endregion
2195
2342
  //#region src/stageNavigationModel.ts
2196
- function oi(e) {
2343
+ function Ti(e) {
2197
2344
  return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
2198
2345
  }
2199
- function si(e) {
2346
+ function Ei(e) {
2200
2347
  let t = /* @__PURE__ */ new Map();
2201
2348
  for (let n of e) {
2202
2349
  let e = (n.path ?? []).join(".");
@@ -2209,38 +2356,38 @@ function si(e) {
2209
2356
  return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
2210
2357
  };
2211
2358
  }
2212
- function ci(e) {
2359
+ function Di(e) {
2213
2360
  return (t) => e.find((e) => e.name === t)?.path?.[0];
2214
2361
  }
2215
- function li(e, t) {
2362
+ function Oi(e, t) {
2216
2363
  return {
2217
2364
  structure: e.structure ?? { modules: [] },
2218
2365
  navigation: e.navigation ?? {
2219
2366
  application: { regions: [] },
2220
2367
  modules: []
2221
2368
  },
2222
- screenFor: si(e.screens),
2223
- moduleOf: ci(e.screens),
2369
+ screenFor: Ei(e.screens),
2370
+ moduleOf: Di(e.screens),
2224
2371
  ...t ? { isVisible: t } : {}
2225
2372
  };
2226
2373
  }
2227
2374
  //#endregion
2228
2375
  //#region src/stageSlices.ts
2229
- function ui(e) {
2230
- return (t) => $t(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2376
+ function ki(e) {
2377
+ return (t) => K(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2231
2378
  name: e.name,
2232
2379
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
2233
- label: di(e.name),
2380
+ label: Ai(e.name),
2234
2381
  required: e.required
2235
2382
  }));
2236
2383
  }
2237
- function di(e) {
2384
+ function Ai(e) {
2238
2385
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
2239
2386
  }
2240
- function fi(e, t, n) {
2387
+ function ji(e, t, n) {
2241
2388
  return { invoke: async (r, i, a) => {
2242
2389
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
2243
- if (!U(o)) return {
2390
+ if (!W(o)) return {
2244
2391
  succeeded: !1,
2245
2392
  message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
2246
2393
  };
@@ -2258,7 +2405,7 @@ function fi(e, t, n) {
2258
2405
  }
2259
2406
  //#endregion
2260
2407
  //#region src/withoutSeededSlots.ts
2261
- function pi(e, t) {
2408
+ function Mi(e, t) {
2262
2409
  let n = /* @__PURE__ */ new Map();
2263
2410
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
2264
2411
  return e.map((e) => {
@@ -2275,16 +2422,33 @@ function pi(e, t) {
2275
2422
  });
2276
2423
  }
2277
2424
  //#endregion
2425
+ //#region src/stageIcons.ts
2426
+ var Ni = /* @__PURE__ */ new Map([
2427
+ ["chart", "chart-column"],
2428
+ ["add", "plus"],
2429
+ ["dollar", "dollar-sign"],
2430
+ ["sitemap", "network"],
2431
+ ["refresh", "refresh-cw"],
2432
+ ["invoice", "receipt-text"],
2433
+ ["batch", "layers"]
2434
+ ]), Pi = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), Fi = oe([{
2435
+ library: m,
2436
+ loadGlyph: async ({ key: e }) => {
2437
+ let t = Pi(e), n = Ni.get(t) ?? t;
2438
+ if (Object.hasOwn(Ye, n)) return (await Ye[n]())?.default;
2439
+ }
2440
+ }]);
2441
+ //#endregion
2278
2442
  //#region src/App.tsx
2279
- function mi(e = {}) {
2280
- return Pr({
2443
+ function Ii(e = {}) {
2444
+ return $r({
2281
2445
  ...e,
2282
- ...pr,
2283
- ...Xr
2446
+ ...Mr,
2447
+ ...hi
2284
2448
  });
2285
2449
  }
2286
- function hi(e, t) {
2287
- return N(`form-${e}-${t.name}`, nr, {
2450
+ function Li(e, t) {
2451
+ return P(`form-${e}-${t.name}`, yr, {
2288
2452
  command: t.forCommand,
2289
2453
  label: t.name,
2290
2454
  generationMode: t.generationMode,
@@ -2292,43 +2456,47 @@ function hi(e, t) {
2292
2456
  fields: t.fields
2293
2457
  });
2294
2458
  }
2295
- function gi(e, t) {
2459
+ function Ri(e, t) {
2296
2460
  let n = e.screens[0];
2297
- return _e(e, n, {
2298
- profile: Mr(e.uiProfiles),
2299
- blueprintTemplates: t?.length ? [...ve, ...t] : void 0
2461
+ return ye(e, n, {
2462
+ profile: Zr(e.uiProfiles),
2463
+ blueprintTemplates: t?.length ? [...be, ...t] : void 0
2300
2464
  });
2301
2465
  }
2302
- function _i(e, t, n, r, i, a, o = !0) {
2303
- let s = oi(e.navigation), c = e.navigation?.application.logo ? {
2466
+ function zi(e, t, n, r, i, a, o = !0) {
2467
+ let s = Ti(e.navigation), c = e.navigation?.application.logo ? {
2304
2468
  title: e.navigation.application.logo.title,
2305
2469
  image: e.navigation.application.logo.image || void 0
2306
2470
  } : void 0;
2307
2471
  return {
2308
- profile: Mr(e.uiProfiles),
2309
- catalog: Fr(r),
2310
- blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
2311
- chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Rr(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Rr(e.screens, r.name, t, n, c, s, o),
2312
- form: hi,
2313
- trailing: [N("activity", Hr)],
2472
+ profile: Zr(e.uiProfiles),
2473
+ catalog: ei(r),
2474
+ blueprintTemplates: a?.length ? [...be, ...a] : void 0,
2475
+ chrome: (r, i) => i === M.FullPageShell ? { [N.ConfigPanel]: ri(e.screens, r.name, t, n, c, s, o)[N.ConfigPanel] } : ri(e.screens, r.name, t, n, c, s, o),
2476
+ form: Li,
2477
+ trailing: [P("activity", si)],
2314
2478
  decorate: (e) => {
2315
- let t = gr(e);
2316
- return i ? y(t, i) : t;
2479
+ let t = Fr(e);
2480
+ return i ? b(t, i) : t;
2317
2481
  }
2318
2482
  };
2319
2483
  }
2320
- function vi(e, t, n, r, i, a) {
2321
- return pe(e, t, _i(e, n, r, i, void 0, a)).element;
2484
+ function Bi(e, t, n, r, i, a) {
2485
+ let [o] = ur([t], Vi(e));
2486
+ return he(e, o, zi(e, n, r, i, void 0, a)).element;
2487
+ }
2488
+ function Vi(e) {
2489
+ return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
2322
2490
  }
2323
- function yi() {
2491
+ function Hi() {
2324
2492
  try {
2325
2493
  return globalThis.localStorage ?? null;
2326
2494
  } catch {
2327
2495
  return null;
2328
2496
  }
2329
2497
  }
2330
- function bi({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
2331
- let s = Qe(), l = o(() => mi(e), [e]), [u, d] = c(), [f, p] = c(""), m = $e(), h = mr();
2498
+ function Ui({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
2499
+ let s = tt(), l = o(() => Ii(e), [e]), [u, d] = c(), [f, p] = c(""), m = nt(), h = Nr();
2332
2500
  return i(() => {
2333
2501
  let e = new AbortController();
2334
2502
  return s.scene(e.signal).then((e) => d(r?.length ? {
@@ -2337,10 +2505,10 @@ function bi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
2337
2505
  } : e)).catch((t) => {
2338
2506
  e.signal.aborted || p(t instanceof Error ? t.message : String(t));
2339
2507
  }), () => e.abort();
2340
- }, [s, r]), f ? /* @__PURE__ */ F("main", {
2508
+ }, [s, r]), f ? /* @__PURE__ */ I("main", {
2341
2509
  className: "stage-message",
2342
- children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
2343
- }) : u ? /* @__PURE__ */ P(xi, {
2510
+ children: [/* @__PURE__ */ F("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ F("p", { children: f })]
2511
+ }) : u ? /* @__PURE__ */ F(Wi, {
2344
2512
  scene: u,
2345
2513
  registry: l,
2346
2514
  routeState: m,
@@ -2348,21 +2516,21 @@ function bi({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
2348
2516
  packageCatalog: t,
2349
2517
  screenTemplates: n,
2350
2518
  isVisible: a
2351
- }) : /* @__PURE__ */ P("main", {
2519
+ }) : /* @__PURE__ */ F("main", {
2352
2520
  className: "stage-message",
2353
- children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
2521
+ children: /* @__PURE__ */ F("h1", { children: "Preparing the Stage" })
2354
2522
  });
2355
2523
  }
2356
- function xi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
2357
- let u = o(() => O(), []), [d, f] = c(ii), p = e.screens[0]?.name ?? "", m = o(() => Mr(e.uiProfiles), [e]), h = o(() => p ? gi(e, s) : void 0, [
2524
+ function Wi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
2525
+ let u = o(() => ae(), []), [d, f] = c(Ci), p = e.screens[0]?.name ?? "", m = o(() => Zr(e.uiProfiles), [e]), h = o(() => p ? Ri(e, s) : void 0, [
2358
2526
  e,
2359
2527
  s,
2360
2528
  p
2361
- ]), g = o(() => h ? ei(m, h) : [], [m, h]), _ = o(() => h ? $r(m, h, d) : void 0, [
2529
+ ]), g = o(() => h ? yi(m, h) : [], [m, h]), _ = o(() => h ? vi(m, h, d) : void 0, [
2362
2530
  m,
2363
2531
  h,
2364
2532
  d
2365
- ]), v = o(() => ni(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => _i(e, i.locales, i.locale, a, i.dictionary, s, y), [
2533
+ ]), v = o(() => xi(ve, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => zi(e, i.locales, i.locale, a, i.dictionary, s, y), [
2366
2534
  e,
2367
2535
  i.locales,
2368
2536
  i.locale,
@@ -2370,33 +2538,33 @@ function xi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
2370
2538
  a,
2371
2539
  s,
2372
2540
  y
2373
- ]), x = n((e) => f(e), []), S = o(() => li(e, l), [e, l]), C = o(() => ({
2541
+ ]), x = n((e) => f(e), []), ee = o(() => Oi(e, l), [e, l]), S = o(() => ({
2374
2542
  ...e,
2375
- screens: pi(e.screens, [
2543
+ screens: ur(Mi(e.screens, [
2376
2544
  ...e.screenTemplates,
2377
2545
  ...e.dialogTemplates ?? [],
2378
- ...ve,
2546
+ ...be,
2379
2547
  ...s ?? []
2380
- ])
2548
+ ]), Vi(e))
2381
2549
  }), [e, s]);
2382
- return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
2550
+ return p ? g.length > 0 ? /* @__PURE__ */ I("main", {
2383
2551
  className: "stage-message",
2384
2552
  role: "alert",
2385
2553
  "data-stage-startup-problem": "root-template",
2386
2554
  children: [
2387
- /* @__PURE__ */ P("h1", { children: "Unable to start this Stage" }),
2388
- /* @__PURE__ */ P("p", { children: "The ui profile's root template cannot be the application's shell." }),
2389
- /* @__PURE__ */ P("ul", { children: g.map((e) => /* @__PURE__ */ P("li", { children: e }, e)) })
2555
+ /* @__PURE__ */ F("h1", { children: "Unable to start this Stage" }),
2556
+ /* @__PURE__ */ F("p", { children: "The ui profile's root template cannot be the application's shell." }),
2557
+ /* @__PURE__ */ F("ul", { children: g.map((e) => /* @__PURE__ */ F("li", { children: e }, e)) })
2390
2558
  ]
2391
- }) : /* @__PURE__ */ P(le, {
2392
- application: C,
2559
+ }) : /* @__PURE__ */ F(de, {
2560
+ application: S,
2393
2561
  composition: b,
2394
- navigationModel: S,
2562
+ navigationModel: ee,
2395
2563
  registry: t,
2396
2564
  initialScreen: p,
2397
2565
  history: u,
2398
- layoutConfigStorage: yi(),
2399
- scope: (t, n) => /* @__PURE__ */ P(Si, {
2566
+ layoutConfigStorage: Hi(),
2567
+ scope: (t, n) => /* @__PURE__ */ F(Gi, {
2400
2568
  scene: e,
2401
2569
  routeState: r,
2402
2570
  strings: i,
@@ -2406,25 +2574,25 @@ function xi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
2406
2574
  onSystemSchemeChange: x,
2407
2575
  children: n
2408
2576
  }),
2409
- renderScreen: (e, n) => /* @__PURE__ */ P(wi, {
2577
+ renderScreen: (e, n) => /* @__PURE__ */ F(qi, {
2410
2578
  element: e,
2411
2579
  configuration: n,
2412
2580
  registry: t
2413
2581
  }),
2414
- renderDialog: () => /* @__PURE__ */ P(dr, {}),
2415
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(Ti, {
2582
+ renderDialog: () => /* @__PURE__ */ F(kr, {}),
2583
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ F(Ji, {
2416
2584
  template: e,
2417
2585
  content: n,
2418
2586
  registry: t,
2419
2587
  strings: i,
2420
2588
  close: () => r.closeDialog()
2421
2589
  })
2422
- }) : /* @__PURE__ */ F("main", {
2590
+ }) : /* @__PURE__ */ I("main", {
2423
2591
  className: "stage-message",
2424
- children: [/* @__PURE__ */ P("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ P("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
2592
+ children: [/* @__PURE__ */ F("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ F("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
2425
2593
  });
2426
2594
  }
2427
- function Si({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
2595
+ function Gi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
2428
2596
  let [d, f] = c(""), { navigate: p } = r;
2429
2597
  return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
2430
2598
  let e = (e) => {
@@ -2441,41 +2609,44 @@ function Si({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
2441
2609
  r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? f(`The modeled screen “${r.screen}” is not available.`) : p(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? p(r) : f(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
2442
2610
  };
2443
2611
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
2444
- }, [p, e]), /* @__PURE__ */ F(de, {
2445
- themes: a,
2446
- children: [
2447
- o && /* @__PURE__ */ P(ai, {
2448
- settings: o,
2449
- onSystemSchemeChange: s
2450
- }),
2451
- /* @__PURE__ */ P(Yr, {}),
2452
- /* @__PURE__ */ P(Mt, {
2453
- routes: t.routes,
2454
- routesReady: t.ready,
2455
- parameters: r.currentParameters,
2456
- locale: n.locale,
2457
- locales: n.locales,
2458
- screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
2459
- children: /* @__PURE__ */ P(Ci, {
2460
- activity: d,
2612
+ }, [p, e]), /* @__PURE__ */ F(w, {
2613
+ registry: Fi,
2614
+ children: /* @__PURE__ */ I(pe, {
2615
+ themes: a,
2616
+ children: [
2617
+ o && /* @__PURE__ */ F(wi, {
2618
+ settings: o,
2619
+ onSystemSchemeChange: s
2620
+ }),
2621
+ /* @__PURE__ */ F(mi, {}),
2622
+ /* @__PURE__ */ F(Ft, {
2623
+ routes: t.routes,
2461
2624
  routesReady: t.ready,
2462
- scene: e,
2463
- setActivity: f,
2464
- strings: n,
2465
- children: l
2625
+ parameters: r.currentParameters,
2626
+ locale: n.locale,
2627
+ locales: n.locales,
2628
+ screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
2629
+ children: /* @__PURE__ */ F(Ki, {
2630
+ activity: d,
2631
+ routesReady: t.ready,
2632
+ scene: e,
2633
+ setActivity: f,
2634
+ strings: n,
2635
+ children: l
2636
+ })
2466
2637
  })
2467
- })
2468
- ]
2638
+ ]
2639
+ })
2469
2640
  });
2470
2641
  }
2471
- function Ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
2472
- let s = z(), c = se(), l = Yt(), d = o(() => fi(l, t, s.refreshAfterCommand), [
2642
+ function Ki({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
2643
+ let s = B(), c = le(), l = Qt(), d = o(() => ji(l, t, s.refreshAfterCommand), [
2473
2644
  l,
2474
2645
  t,
2475
2646
  s.refreshAfterCommand
2476
- ]), f = o(() => ui(n.commandSchemas), [n.commandSchemas]), p = ie({
2647
+ ]), f = o(() => ki(n.commandSchemas), [n.commandSchemas]), p = k({
2477
2648
  executeCommand: async (e, n) => {
2478
- let i = U(e);
2649
+ let i = W(e);
2479
2650
  if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
2480
2651
  isSuccess: !1,
2481
2652
  validationErrors: []
@@ -2492,7 +2663,7 @@ function Ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2492
2663
  };
2493
2664
  },
2494
2665
  navigate: (e, t) => {
2495
- n.screens.some((t) => t.name === e) ? W(e, Zt(t)) : r(`The modeled screen “${e}” is not available.`);
2666
+ n.screens.some((t) => t.name === e) ? G(e, en(t)) : r(`The modeled screen “${e}” is not available.`);
2496
2667
  },
2497
2668
  navigateBack: () => globalThis.history?.back(),
2498
2669
  openDialog: async (e) => {
@@ -2509,18 +2680,18 @@ function Ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2509
2680
  refreshQuery: async (e) => s.refreshQuery(e),
2510
2681
  raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
2511
2682
  });
2512
- return /* @__PURE__ */ P(Vr, {
2683
+ return /* @__PURE__ */ F(oi, {
2513
2684
  state: {
2514
2685
  locales: i.locales,
2515
2686
  locale: i.locale,
2516
2687
  setLocale: i.setLocale,
2517
2688
  activity: e
2518
2689
  },
2519
- children: /* @__PURE__ */ P(E, {
2690
+ children: /* @__PURE__ */ F(D, {
2520
2691
  invoker: d,
2521
- children: /* @__PURE__ */ P(te, {
2692
+ children: /* @__PURE__ */ F(E, {
2522
2693
  fieldsFor: f,
2523
- children: /* @__PURE__ */ P(w, {
2694
+ children: /* @__PURE__ */ F(te, {
2524
2695
  dispatcher: p,
2525
2696
  context: {
2526
2697
  resolve: s.resolveBinding,
@@ -2534,9 +2705,9 @@ function Ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2534
2705
  })
2535
2706
  });
2536
2707
  }
2537
- function wi({ element: e, configuration: t, registry: n }) {
2538
- let r = z(), i = Wt();
2539
- return /* @__PURE__ */ F(je, { children: [/* @__PURE__ */ P(wr, { element: e }), /* @__PURE__ */ P(T, {
2708
+ function qi({ element: e, configuration: t, registry: n }) {
2709
+ let r = B(), i = qt();
2710
+ return /* @__PURE__ */ I(Ne, { children: [/* @__PURE__ */ F(Ur, { element: e }), /* @__PURE__ */ F(T, {
2540
2711
  element: e,
2541
2712
  registry: n,
2542
2713
  resolveBinding: r.resolveBinding,
@@ -2545,25 +2716,25 @@ function wi({ element: e, configuration: t, registry: n }) {
2545
2716
  configuration: t
2546
2717
  })] });
2547
2718
  }
2548
- function Ti({ template: e, content: t, registry: n, strings: r, close: a }) {
2549
- let o = z(), s = Wt(), c = y(t, r.dictionary);
2719
+ function Ji({ template: e, content: t, registry: n, strings: r, close: a }) {
2720
+ let o = B(), s = qt(), c = b(t, r.dictionary);
2550
2721
  return i(() => {
2551
2722
  let e = (e) => {
2552
2723
  e.key === "Escape" && a();
2553
2724
  };
2554
2725
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
2555
- }, [a]), /* @__PURE__ */ P("div", {
2726
+ }, [a]), /* @__PURE__ */ F("div", {
2556
2727
  className: "stage-dialog-backdrop",
2557
- children: /* @__PURE__ */ F("section", {
2728
+ children: /* @__PURE__ */ I("section", {
2558
2729
  role: "dialog",
2559
2730
  "aria-modal": "true",
2560
2731
  "aria-label": e.displayName ?? e.name,
2561
2732
  className: "stage-dialog",
2562
- children: [/* @__PURE__ */ P("button", {
2733
+ children: [/* @__PURE__ */ F("button", {
2563
2734
  type: "button",
2564
2735
  onClick: a,
2565
2736
  children: "Close"
2566
- }), /* @__PURE__ */ P(T, {
2737
+ }), /* @__PURE__ */ F(T, {
2567
2738
  element: c,
2568
2739
  registry: n,
2569
2740
  resolveBinding: o.resolveBinding,
@@ -2575,9 +2746,9 @@ function Ti({ template: e, content: t, registry: n, strings: r, close: a }) {
2575
2746
  }
2576
2747
  //#endregion
2577
2748
  //#region src/stageTheme.ts
2578
- var Ei = "[data-scene-color-scheme='dark']", Di = {
2579
- preset: qe,
2580
- options: { darkModeSelector: Ei }
2749
+ var Yi = "[data-scene-color-scheme='dark']", Xi = {
2750
+ preset: Xe,
2751
+ options: { darkModeSelector: Yi }
2581
2752
  };
2582
2753
  //#endregion
2583
- export { bi as App, bi as StageApplication, yn as StageCommandForm, Mt as StageDataProvider, er as StageGuardedAction, Ze as StageSourceProvider, vi as composeStageScreen, fi as createStageSliceInvoker, Nt as dataChanged, qt as executeRegisteredCommand, ut as performQuery, ot as registerQueryRouteResolver, U as registeredCommand, st as registeredQuery, ui as sliceFieldsFrom, mi as stageApplicationRegistry, _i as stageComposition, Ei as stageDarkSelector, Ye as stageEndpoints, gi as stageShellOf, Di as stageTheme, Je as staticStageSource, dt as subscribeQuery, Yt as useStageCommandExecutor, z as useStageData, B as useStageQuery, Qe as useStageSource };
2754
+ export { Ui as App, Ui as StageApplication, xn as StageCommandForm, Ft as StageDataProvider, or as StageGuardedAction, et as StageSourceProvider, Bi as composeStageScreen, ji as createStageSliceInvoker, It as dataChanged, Xt as executeRegisteredCommand, pt as performQuery, lt as registerQueryRouteResolver, W as registeredCommand, ut as registeredQuery, ki as sliceFieldsFrom, Ii as stageApplicationRegistry, zi as stageComposition, Yi as stageDarkSelector, Qe as stageEndpoints, Ri as stageShellOf, Xi as stageTheme, Ze as staticStageSource, mt as subscribeQuery, Qt as useStageCommandExecutor, B as useStageData, V as useStageQuery, tt as useStageSource };