@cratis/stage.runtime 4.188.4 → 4.188.6

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