@cratis/stage.runtime 4.184.0 → 4.185.0

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